blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
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
75ca7947a26b134ecfc430b56fa886bfff3c133a
b073d0d95abdcbca2071899d12fde955b12ba076
/apigateway/src/main/java/xyz/zhangbohan/apigateway/ApigatewayApplication.java
27f889c5f11dbeca06584ffddc1c46e7af3c1657
[]
no_license
francis95-han/springcloudstudy
c7a788887ae15e640df32493a428dedbdd528e8a
8cdf9393baedbed34cfdf56176d94409c3e00fdc
refs/heads/master
2020-03-31T21:45:35.523538
2018-11-12T01:21:48
2018-11-12T01:21:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
594
java
package xyz.zhangbohan.apigateway; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.cloud.client.SpringCloudApplication; import org.springframework.cloud.netflix.zuul.EnableZuulProxy; /** * @author bohan */ @SpringCloudApplication @EnableZuulProxy public class ApigatewayApplication { public static void main(String[] args) { new SpringApplicationBuilder(ApigatewayApplication.class).web(true).run(args); } }
[ "mir2285@outlook.com" ]
mir2285@outlook.com
097234ba97a39d5883edca1465f7586f7bc108ce
5705dd19264f9ca3e3b45ed80f2f58cfb3b03605
/src/main/java/br/com/codenation/paymentmethods/CreditCardStrategy.java
c30a3acf74523711062e5100e9379d7e310de8d4
[]
no_license
MariaMuniz/java_16
b67119090e76337faedf9d50f70b7c6e45730145
edda2626451758cd656fbad8ebe1db92ded383c5
refs/heads/master
2022-07-23T08:05:58.277416
2020-05-10T13:35:54
2020-05-10T13:35:54
262,794,348
0
0
null
null
null
null
UTF-8
Java
false
false
199
java
package br.com.codenation.paymentmethods; public class CreditCardStrategy implements PriceStrategy{ @Override public Double calculate(Double price) { return price * 0.98; } }
[ "cidamuniz2011@yahoo.com.br" ]
cidamuniz2011@yahoo.com.br
461b40f950a80a1d674c98c711bae02c0e537dc2
44ddecb94209d50d75474a9f0709b3ac9594397b
/src/main/java/Hello.java
bf751916cf40189b612fd7482c6323e385256eb7
[]
no_license
BantuD/BRM_git
bca882e57695b04cf17d9f016729964b7c72370c
09cfc390ae07fe141c3987de3f808a2fefee510d
refs/heads/master
2023-02-27T09:24:10.699469
2021-02-03T15:54:34
2021-02-03T15:54:34
335,661,169
0
0
null
null
null
null
UTF-8
Java
false
false
115
java
public class Hello { public static void main(String arg[]) { System.out.println("hello world"); } }
[ "500069424@stu.upes.ac.in" ]
500069424@stu.upes.ac.in
770c586a55f0cf489ff74796c13a2c19df1f069b
701a254b0ecd8eb24f9660bba7c1c803c0786690
/LolZ/LolZ/LolZ.Android/obj/Debug/90/android/src/crc6493ec5992b526452f/MainActivity.java
c3a982ac558881ba738a3853aeb24f48d4a23314
[]
no_license
YashChatim/lolZ
2d3f6c6aebd880ad4213e4f11befa19ed8e193cb
8fbded82e500ceb8dfae9fb24d44a099814546e5
refs/heads/master
2022-12-22T08:00:41.850656
2020-01-28T16:47:00
2020-01-28T16:47:00
231,638,577
0
0
null
null
null
null
UTF-8
Java
false
false
1,414
java
package crc6493ec5992b526452f; public class MainActivity extends crc643f46942d9dd1fff9.FormsAppCompatActivity implements mono.android.IGCUserPeer { /** @hide */ public static final String __md_methods; static { __md_methods = "n_onCreate:(Landroid/os/Bundle;)V:GetOnCreate_Landroid_os_Bundle_Handler\n" + "n_onRequestPermissionsResult:(I[Ljava/lang/String;[I)V:GetOnRequestPermissionsResult_IarrayLjava_lang_String_arrayIHandler\n" + ""; mono.android.Runtime.register ("LolZ.Droid.MainActivity, LolZ.Android", MainActivity.class, __md_methods); } public MainActivity () { super (); if (getClass () == MainActivity.class) mono.android.TypeManager.Activate ("LolZ.Droid.MainActivity, LolZ.Android", "", this, new java.lang.Object[] { }); } public void onCreate (android.os.Bundle p0) { n_onCreate (p0); } private native void n_onCreate (android.os.Bundle p0); public void onRequestPermissionsResult (int p0, java.lang.String[] p1, int[] p2) { n_onRequestPermissionsResult (p0, p1, p2); } private native void n_onRequestPermissionsResult (int p0, java.lang.String[] p1, int[] p2); private java.util.ArrayList refList; public void monodroidAddReference (java.lang.Object obj) { if (refList == null) refList = new java.util.ArrayList (); refList.add (obj); } public void monodroidClearReferences () { if (refList != null) refList.clear (); } }
[ "yash.chatim@gmail.com" ]
yash.chatim@gmail.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
83e0c65cca3bc934b4ac765080482c52cc883c04
0ddc75edf1b56ac5f2cb22305a721c7e2ba28c21
/Day4/TestOOP/src/com/zantaclaus/TextBox.java
223516bad75c70486973535052eda3214b0f5a8e
[]
no_license
zantaclaus/CE-OOP
131826f2f2b4dd7d4177de623fb4622315b2edfb
cef5ecb8f0ce0de2c6ccff1479655096a47aee7c
refs/heads/master
2023-03-05T18:03:11.424481
2021-02-08T09:43:23
2021-02-08T09:43:23
328,623,417
0
0
null
null
null
null
UTF-8
Java
false
false
216
java
package com.zantaclaus; public class TextBox { String name; //field void setName(String newName) { //method name = newName; } void printName() { System.out.println(name); } }
[ "tarzuto@gmail.com" ]
tarzuto@gmail.com
8677e2a11f594faf7a1c85ff4c5ba10524576e42
fe3b788178710844fbb2a18c199811493c1f728a
/src/main/java/com/kevin/designmode/ProxyPattern2/Subject.java
96269d682e1e9a60e7df983b1e5a9132a5b88c0c
[]
no_license
ChengYongchao/kevinProject
4d83285ae1e2eb8a2b2c187aedfa4cb019a5726e
800c5557801f7587c1c4d41107f7e8aeeb5dc1f9
refs/heads/master
2022-01-01T10:42:04.950148
2020-11-20T07:41:53
2020-11-20T07:41:53
219,925,585
0
0
null
2021-12-14T21:53:56
2019-11-06T06:16:57
Java
UTF-8
Java
false
false
101
java
package com.kevin.designmode.ProxyPattern2; public interface Subject { public void request(); }
[ "chengyc@meng-tu.com" ]
chengyc@meng-tu.com
1465f5d5d0bb9a5918b33302149e520d2a897c31
cafca0f100f785e2c8ffdf1c74935f1b259413a3
/src/main/java/com/wanma/charge/ChargeApiApplication.java
ab4e192c81d9383bfbc4a68ba1df00a49b889a81
[]
no_license
kekaodewushi/spring-boot-demo
cb2df4b49bef8af5de5f73d10c42f0debb8375a8
6308e4a58cece839acb1fb916eb61d645ca479b0
refs/heads/master
2020-04-07T06:49:45.812457
2018-11-19T02:42:01
2018-11-19T02:42:01
158,151,863
0
0
null
null
null
null
UTF-8
Java
false
false
471
java
package com.wanma.charge; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; /** * @author zangyy */ @SpringBootApplication public class ChargeApiApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(ChargeApiApplication.class, args); } }
[ "770882203@qq.com" ]
770882203@qq.com
a17eb6bd82ec13e504f7893b54972c550c57b8b2
805b2a791ec842e5afdd33bb47ac677b67741f78
/Mage.Sets/src/mage/sets/modernmasters/BruteForce.java
b6b6c018b520c5b898475ea14c481890bb92d5c9
[]
no_license
klayhamn/mage
0d2d3e33f909b4052b0dfa58ce857fbe2fad680a
5444b2a53beca160db2dfdda0fad50e03a7f5b12
refs/heads/master
2021-01-12T19:19:48.247505
2015-08-04T20:25:16
2015-08-04T20:25:16
39,703,242
2
0
null
2015-07-25T21:17:43
2015-07-25T21:17:42
null
UTF-8
Java
false
false
2,163
java
/* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets.modernmasters; import java.util.UUID; /** * * @author LevelX2 */ public class BruteForce extends mage.sets.planarchaos.BruteForce { public BruteForce(UUID ownerId) { super(ownerId); this.cardNumber = 107; this.expansionSetCode = "MMA"; } public BruteForce(final BruteForce card) { super(card); } @Override public BruteForce copy() { return new BruteForce(this); } }
[ "ludwig.hirth@online.de" ]
ludwig.hirth@online.de
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
21ad4f302525aafb63b6f623729fc341467ee6df
95f304141bd145ebc2f8d418e293a28c7590162e
/src/main/java/dev/practice/order/domain/notification/NotificationService.java
e991fbf5874cc067e11f33e600be1ef6e5535194
[]
no_license
soohoonlee/fc-order
ee7bbdc68e007aa6d2cb05b1cc1aae608e1cfe64
dceed9f0eb9e1f83587f90317c079c395a4e32de
refs/heads/main
2023-08-31T14:44:53.409773
2021-09-28T07:16:40
2021-09-28T07:16:40
409,351,088
0
0
null
null
null
null
UTF-8
Java
false
false
271
java
package dev.practice.order.domain.notification; public interface NotificationService { void sendEmail(String email, String title, String description); void sendKakao(String phoneNo, String description); void sendSms(String phoneNo, String description); }
[ "jjinimania@gmail.com" ]
jjinimania@gmail.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
8df62e0b2d0a3cccd2ebed9c7093ecdf62bfa856
094e7b09fec8e60faf28f22f97dfba17e17e1e99
/Computer Programing - Griffin White/1st Qtr/HiBye.java
3cb4bf05d3cb4f0dc1b784f677ad96d1b6065ae9
[]
no_license
december454/PHS-Programming
eba46014fffd73e788a0751df697664bbf247028
6d906faaa06f3c445a619858198eb5ff6a4f1813
refs/heads/master
2023-03-08T10:12:28.468152
2019-07-30T13:38:06
2019-07-30T13:38:06
199,657,125
0
0
null
null
null
null
UTF-8
Java
false
false
736
java
/** * @(#)HiBye.java * * * @author * @version 1.00 2017/10/2 */ //GRADE = 100 public class HiBye { public static void main (String [] args) { //Assigning string variables. String a = "Hi"; String b = "Bye"; //First set of lines to print using only the String variables. System.out.println (a+b+b+a); System.out.println (b+a+b+a); System.out.println (a+a+b+b); //Second set of lines to print using both the string variables and other text. System.out.println ("\n" + a + " Mrs. Hlavaty."); System.out.println ("I like to drink " + a + "-C."); System.out.println ("I want to go " + b + "-" + b + ":)\n"); } }
[ "griffinowhite@gmail.com" ]
griffinowhite@gmail.com
bd6d9ce35541445f33719000ed45a813dabddf3b
8a029307e03155ea0ef9067cceb47d6533fda751
/persist/src/main/java/com/eim/persist/po/base/ApplicationPO.java
173027597657d5bf0f386c47055a95fe862e5801
[]
no_license
maximuszeng/IM-Dec
4bfdb8acbc606fdf9f560a980f25ae9c36fbe8c2
5a94c61b31c3549419377ba9c4d38e5bdaad9ea1
refs/heads/master
2021-01-10T19:37:20.203568
2014-06-11T16:04:06
2014-06-11T16:04:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,130
java
package com.eim.persist.po.base; import java.io.Serializable; import com.eim.persist.enums.AppType; import com.eim.persist.po.common.BasePO; @SuppressWarnings("serial") public class ApplicationPO extends BasePO implements Serializable { public static final String SEQUENCE_NAME = "APPID"; private Long appId; private Long uid; private String name; private String industryCategory; private String domain; private AppType appType; private String logoUrl; private String welcomeMessage; private String appKey; private Long createTime; private Long lastUpdateTime; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getIndustryCategory() { return industryCategory; } public void setIndustryCategory(String industryCategory) { this.industryCategory = industryCategory; } public Long getCreateTime() { return createTime; } public void setCreateTime(Long createTime) { this.createTime = createTime; } public Long getLastUpdateTime() { return lastUpdateTime; } public void setLastUpdateTime(Long lastUpdateTime) { this.lastUpdateTime = lastUpdateTime; } public Long getAppId() { return appId; } public void setAppId(Long appId) { this.appId = appId; } public Long getUid() { return uid; } public void setUid(Long uid) { this.uid = uid; } public String getDomain() { return domain; } public void setDomain(String domain) { this.domain = domain; } public AppType getAppType() { return appType; } public void setAppType(AppType appType) { this.appType = appType; } public String getLogoUrl() { return logoUrl; } public void setLogoUrl(String logoUrl) { this.logoUrl = logoUrl; } public String getWelcomeMessage() { return welcomeMessage; } public void setWelcomeMessage(String welcomeMessage) { this.welcomeMessage = welcomeMessage; } public String getAppKey() { return appKey; } public void setAppKey(String appKey) { this.appKey = appKey; } }
[ "maximuszeng@gmail.com" ]
maximuszeng@gmail.com
496661bfe43e6dacef5d68a345e217109349ac26
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_2ebf8964c2716c02574435626306acfaaadfe848/ExceptionHandlingUITest/8_2ebf8964c2716c02574435626306acfaaadfe848_ExceptionHandlingUITest_t.java
1ce755eaabafa58e036b2a994d9bcb967d67c3dd
[]
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
17,121
java
/* * Copyright (C) 2013 salesforce.com, inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.auraframework.http; import org.auraframework.Aura; import org.auraframework.controller.java.ServletConfigController; import org.auraframework.def.ApplicationDef; import org.auraframework.def.ComponentDef; import org.auraframework.def.DefDescriptor; import org.auraframework.def.InterfaceDef; import org.auraframework.system.AuraContext.Access; import org.auraframework.system.AuraContext.Format; import org.auraframework.system.AuraContext.Mode; import org.auraframework.test.WebDriverTestCase; import org.auraframework.test.annotation.ThreadHostileTest; import org.auraframework.test.annotation.UnAdaptableTest; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.WebDriverWait; /** * What should you see when something goes wrong. {@link ThreadHostile} due to setProdConfig and friends. * * @since 0.0.262 */ @UnAdaptableTest public class ExceptionHandlingUITest extends WebDriverTestCase { public ExceptionHandlingUITest(String name) { super(name); } private static final String baseAppTag = "<aura:application %s securityProvider='java://org.auraframework.components.security.SecurityProviderAlwaysAllows'>%s</aura:application>"; private static final String errorBoxPath = "//div[@class='auraMsgMask auraForcedErrorBox']//div[@id='auraErrorMessage']"; private void setProdConfig() throws Exception { ServletConfigController.setProductionConfig(true); Aura.getContextService().endContext(); Aura.getContextService().startContext(Mode.DEV, Format.HTML, Access.AUTHENTICATED); } private void setProdContextWithoutConfig() throws Exception { Aura.getContextService().endContext(); Aura.getContextService().startContext(Mode.PROD, Format.HTML, Access.AUTHENTICATED); } private String getAppUrl(String attributeMarkup, String bodyMarkup) throws Exception { String appMarkup = String.format(baseAppTag, attributeMarkup, bodyMarkup); DefDescriptor<ApplicationDef> add = addSourceAutoCleanup(ApplicationDef.class, appMarkup); return String.format("/%s/%s.app", add.getNamespace(), add.getName()); } /** * Due to duplicate div#auraErrorMessage on exceptions from server rendering, use different CSS selector to check * exception message. W-1308475 - Never'd removal/change of duplicate div#auraErrorMessage */ private void assertNoStacktraceServerRendering() throws Exception { WebElement elem = findDomElement(By .xpath(errorBoxPath)); if (elem == null) { fail("error message not found"); } String actual = elem.getText().replaceAll("\\s+", " "); assertEquals("Unable to process your request", actual); } private void assertNoStacktrace() throws Exception { String actual = auraUITestingUtil.getQuickFixMessage().replaceAll("\\s+", " "); assertEquals("Unable to process your request", actual); } /** * Due to duplicate div#auraErrorMessage on exceptions from server rendering, use different CSS selector to check * exception message. W-1308475 - Never'd removal/change of duplicate div#auraErrorMessage */ private void assertStacktraceServerRendering(String messageStartsWith, String... causeStartsWith) throws Exception { WebElement elem = findDomElement(By .xpath(errorBoxPath)); if (elem == null) { fail("error message not found"); } String actual = elem.getText().replaceAll("\\s+", " "); assertStacktraceCommon(actual, messageStartsWith, causeStartsWith); } private void assertStacktrace(String messageStartsWith, String... causeStartsWith) throws Exception { String actual = auraUITestingUtil.getQuickFixMessage().replaceAll("\\s+", " "); assertStacktraceCommon(actual, messageStartsWith, causeStartsWith); } private void assertStacktraceCommon(String actual, String messageStartsWith, String... causeStartsWith) throws Exception { if (!actual.contains(messageStartsWith)) { fail("unexpected error message - expected <" + messageStartsWith + "> but got <" + actual + ">"); } String childSelector = "#auraErrorMessage"; for (String expectedCause : causeStartsWith) { WebElement childElem = findDomElement(By.cssSelector(childSelector)); if (childElem == null) { fail("cause not found"); } actual = childElem.getAttribute("textContent"); if (actual == null) { // Selenium bug with Firefox trying to grab text not visible on screen. // https://code.google.com/p/selenium/issues/detail?id=5773 actual = childElem.getText(); } actual = actual.replaceAll("\\s+", " "); if (!actual.contains(expectedCause)) { fail("unexpected cause - expected <" + expectedCause + "> but got <" + actual + ">"); } } } /** * Generic error message displayed in PRODUCTION if component provider instantiation throws. */ @ThreadHostileTest("PRODUCTION") public void testProdCmpProviderThrowsDuringInstantiation() throws Exception { setProdConfig(); DefDescriptor<?> cdd = addSourceAutoCleanup( InterfaceDef.class, "<aura:interface provider='java://org.auraframework.impl.java.provider.TestProviderThrowsDuringInstantiation'></aura:interface>"); openRaw(getAppUrl("", String.format("<%s:%s/>", cdd.getNamespace(), cdd.getName()))); assertNoStacktrace(); } /** * Stacktrace displayed in non-PRODUCTION if component provider instantiation throws. */ public void testCmpProviderThrowsDuringInstantiation() throws Exception { setProdContextWithoutConfig(); DefDescriptor<?> cdd = addSourceAutoCleanup( InterfaceDef.class, "<aura:interface provider='java://org.auraframework.impl.java.provider.TestProviderThrowsDuringInstantiation'></aura:interface>"); openRaw(getAppUrl("", String.format("<%s:%s/>", cdd.getNamespace(), cdd.getName()))); assertStacktrace( "java.lang.RuntimeException: that was intentional at org.auraframework.impl.java.provider.TestProviderThrowsDuringInstantiation.", "(TestProviderThrowsDuringInstantiation.java:"); } /** * Generic error message displayed in PRODUCTION if application provider instantiation throws. */ @ThreadHostileTest("PRODUCTION") public void testProdAppProviderThrowsDuringInstantiation() throws Exception { setProdConfig(); openRaw(getAppUrl( "provider='java://org.auraframework.impl.java.provider.TestProviderThrowsDuringInstantiation'", "")); assertNoStacktrace(); } /** * Stacktrace displayed in non-PRODUCTION if application provider instantiation throws. */ public void testAppProviderThrowsDuringInstantiation() throws Exception { setProdContextWithoutConfig(); openRaw(getAppUrl( "provider='java://org.auraframework.impl.java.provider.TestProviderThrowsDuringInstantiation'", "")); assertStacktrace("that was intentional at org.auraframework.impl.java.provider.TestProviderThrowsDuringInstantiation."); } /** * Generic error message displayed in PRODUCTION if component provider instantiation throws. */ @ThreadHostileTest("PRODUCTION") public void testProdCmpProviderThrowsDuringProvide() throws Exception { setProdConfig(); DefDescriptor<?> cdd = addSourceAutoCleanup( InterfaceDef.class, "<aura:interface provider='java://org.auraframework.impl.java.provider.TestProviderThrowsDuringProvide'></aura:interface>"); openRaw(getAppUrl("", String.format("<%s:%s/>", cdd.getNamespace(), cdd.getName()))); assertNoStacktrace(); } /** * Stacktrace displayed in non-PRODUCTION if component provider instantiation throws. */ public void testCmpProviderThrowsDuringProvide() throws Exception { setProdContextWithoutConfig(); DefDescriptor<?> cdd = addSourceAutoCleanup( InterfaceDef.class, "<aura:interface provider='java://org.auraframework.impl.java.provider.TestProviderThrowsDuringProvide'></aura:interface>"); openRaw(getAppUrl("", String.format("<%s:%s/>", cdd.getNamespace(), cdd.getName()))); assertStacktrace("java.lang.RuntimeException: out of stock at .(org.auraframework.impl.java.provider.TestProviderThrowsDuringProvide)"); } /** * Generic error message displayed in PRODUCTION if component model instantiation throws. */ @ThreadHostileTest("PRODUCTION") public void testProdCmpModelThrowsDuringInstantiation() throws Exception { setProdConfig(); DefDescriptor<?> cdd = addSourceAutoCleanup(ComponentDef.class, "<aura:component model='java://org.auraframework.impl.java.model.TestModelThrowsDuringInstantiation'></aura:component>"); openRaw(getAppUrl("", String.format("<%s:%s/>", cdd.getNamespace(), cdd.getName()))); assertNoStacktrace(); } /** * Stacktrace displayed in non-PRODUCTION if component model instantiation throws. */ public void testCmpModelThrowsDuringInstantiation() throws Exception { setProdContextWithoutConfig(); DefDescriptor<?> cdd = addSourceAutoCleanup(ComponentDef.class, "<aura:component model='java://org.auraframework.impl.java.model.TestModelThrowsDuringInstantiation'></aura:component>"); openRaw(getAppUrl("", String.format("<%s:%s/>", cdd.getNamespace(), cdd.getName()))); assertStacktrace( "java.lang.RuntimeException: surprise! at org.auraframework.impl.java.model.TestModelThrowsDuringInstantiation.", "(TestModelThrowsDuringInstantiation.java:"); } /** * Generic error message displayed in PRODUCTION if component renderer instantiation throws. */ @ThreadHostileTest("PRODUCTION") public void testProdCmpRendererThrowsDuringInstantiation() throws Exception { setProdConfig(); DefDescriptor<?> cdd = addSourceAutoCleanup( ComponentDef.class, "<aura:component renderer='java://org.auraframework.impl.renderer.sampleJavaRenderers.TestRendererThrowsDuringInstantiation'></aura:component>"); openRaw(getAppUrl("", String.format("<%s:%s/>", cdd.getNamespace(), cdd.getName()))); assertNoStacktrace(); } /** * Stacktrace displayed in non-PRODUCTION if component renderer instantiation throws. */ public void testCmpRendererThrowsDuringInstantiation() throws Exception { setProdContextWithoutConfig(); DefDescriptor<?> cdd = addSourceAutoCleanup( ComponentDef.class, "<aura:component renderer='java://org.auraframework.impl.renderer.sampleJavaRenderers.TestRendererThrowsDuringInstantiation'></aura:component>"); openRaw(getAppUrl("", String.format("<%s:%s/>", cdd.getNamespace(), cdd.getName()))); assertStacktrace( "java.lang.Error: invisible me at org.auraframework.impl.renderer.sampleJavaRenderers.TestRendererThrowsDuringInstantiation.", "(TestRendererThrowsDuringInstantiation.java:"); } /** * Generic error message displayed in PRODUCTION if component renderer throws. */ @ThreadHostileTest("PRODUCTION") public void testProdCmpRendererThrowsDuringRender() throws Exception { setProdConfig(); DefDescriptor<?> cdd = addSourceAutoCleanup( ComponentDef.class, "<aura:component renderer='java://org.auraframework.impl.renderer.sampleJavaRenderers.TestRendererThrowingException'></aura:component>"); openRaw(getAppUrl("", String.format("<%s:%s/>", cdd.getNamespace(), cdd.getName()))); assertNoStacktraceServerRendering(); } /** * Stacktrace displayed in non-PRODUCTION if component renderer throws. */ public void testCmpRendererThrowsDuringRender() throws Exception { setProdContextWithoutConfig(); DefDescriptor<?> cdd = addSourceAutoCleanup( ComponentDef.class, "<aura:component renderer='java://org.auraframework.impl.renderer.sampleJavaRenderers.TestRendererThrowingException'></aura:component>"); openRaw(getAppUrl("", String.format("<%s:%s/>", cdd.getNamespace(), cdd.getName()))); assertStacktraceServerRendering("org.auraframework.throwable.AuraExecutionException: org.auraframework." + "renderer.ComponentRenderer: org.auraframework.throwable.AuraExecutionException: org.auraframework." + "renderer.HtmlRenderer: org.auraframework.throwable.AuraExecutionException: org.auraframework." + "renderer.HtmlRenderer: org.auraframework.throwable.AuraExecutionException: org.auraframework." + "renderer.ExpressionRenderer: org.auraframework.throwable.AuraExecutionException: org.auraframework." + "renderer.ComponentRenderer: org.auraframework.throwable.AuraExecutionException: org.auraframework." + "impl.renderer.sampleJavaRenderers.TestRendererThrowingException: java.lang.ArithmeticException at"); } /** * Parse error stack trace for application includes filename along with row,col */ public void testAppThrowsWithFileName() throws Exception { setProdContextWithoutConfig(); // load the defination in the loader DefDescriptor<?> add = addSourceAutoCleanup( ApplicationDef.class, "<aura:application securityProvider='java://org.auraframework.components.security.SecurityProviderAlwaysAllows''></aura:application>"); openRaw(String.format("/%s/%s.app", add.getNamespace(), add.getName())); assertStacktrace("org.auraframework.throwable.AuraUnhandledException: " + String.format("markup://%s:%s:1,111: ParseError at [row,col]:[2,111]", add.getNamespace(), add.getName())); } /** * Parse error stack trace for controller includes filename */ public void testControllerThrowsWithFileName() throws Exception { String fileName = "auratest/parseError"; openRaw(fileName + ".cmp"); assertStacktrace("org.auraframework.throwable.AuraRuntimeException: "); assertStacktrace("auratest/parseError/parseErrorController.js"); } /** * Default handler for ClientOutOfSync will reload the page. */ public void testClientOutOfSyncDefaultHandler() throws Exception { open("/updateTest/updateWithoutHandling.cmp?text=initial"); // make a client-side change to the page findDomElement(By.cssSelector(".update")).click(); waitForElementText(findDomElement(By.cssSelector(".uiOutputText")), "modified", true, 3000); assertTrue("Page was not changed after client action", auraUITestingUtil.getBooleanEval("return !!document.__PageModifiedTestFlag")); // make server POST call with outdated lastmod findDomElement(By.cssSelector(".trigger")).click(); // Wait till prior prior client-side change is gone indicating page // reload WebDriverWait wait = new WebDriverWait(getDriver(), 30); wait.until(new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver d) { return !auraUITestingUtil.getBooleanEval("return !!document.__PageModifiedTestFlag"); } }); // Wait for page to reload and aura framework initialization auraUITestingUtil.waitForAuraInit(); waitForElementText(findDomElement(By.cssSelector(".uiOutputText")), "initial", true, 3000); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1cd87e41094b1ca34e6a4b1b7615c79b94fa4348
c85030e929a741909243a9ff22f4ececf2bede08
/LogoWorld/src/ru/nsu/ccfit/molochev/task1/MyExcepts/FieldExcept/AIPosException.java
802fdc35dc630dbc73be6826c5e12ce4077ed424
[]
no_license
molo4evan/java_oop
6c7f0d4c89272405f661bed71b09be53465872cf
15c6fa9686424e714809b3efe0e4432d44cd5b7c
refs/heads/master
2021-04-28T13:09:59.308471
2018-06-15T11:10:38
2018-06-15T11:10:38
122,096,486
0
0
null
null
null
null
UTF-8
Java
false
false
277
java
package ru.nsu.ccfit.molochev.task1.MyExcepts; public class AIPosException extends MainException { int x, y; private AIPosException(){} public AIPosException(int x_, int y_){ x = x_; y = y_; } @Override public void print() { } }
[ "molo4evan@gmail.ru" ]
molo4evan@gmail.ru
efd1818e2ddc6d31c5ad831d341b0e9d59ff758d
93f2179895bfb23424dd303e050591f80fab453d
/MavenProjEclipse/src/test/java/com/learning/CrossBrowserTest.java
e8f3f219e8d1789ba91f0daf7f3180c438e01117
[]
no_license
Sundar312/MavenProjEclipseRemote
e2fc76a294b39b614236c1dafd138f1fb55bc44f
304c4e27777a9f03f3c63219cf46674e4d0b321e
refs/heads/master
2023-08-18T17:14:22.062966
2021-10-10T04:41:15
2021-10-10T04:41:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,402
java
package com.learning; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.testng.annotations.Parameters; import org.testng.annotations.Test; public class CrossBrowserTest { WebDriver driver; @Test @Parameters("Browser") public void CrssBrwoserTesting(String Browsername) throws InterruptedException { if(Browsername.equalsIgnoreCase("Firefox")) { System.setProperty("webdriver.gecko.driver", "C:\\Users\\dell46\\eclipse-workspace\\MavenProjEclipse\\DriverWarehouse\\geckodriver.exe"); driver = new FirefoxDriver(); } else if(Browsername.equalsIgnoreCase("Chrome")){ System.setProperty("webdriver.chrome.driver", "C:\\Users\\dell46\\eclipse-workspace\\MavenProjEclipse\\DriverWarehouse\\chromedriver1.exe"); driver = new ChromeDriver(); } else if(Browsername.equalsIgnoreCase("IE")){ System.setProperty("webdriver.ie.driver", "C:\\Users\\dell46\\eclipse-workspace\\MavenProjEclipse\\DriverWarehouse\\IEDriverServer.exe"); driver = new InternetExplorerDriver(); } driver.manage().window().maximize(); driver.manage().deleteAllCookies(); driver.navigate().to("https://stage.talentoz.com/Weblogin.aspx"); Thread.sleep(4000); driver.close(); } }
[ "sundar@talentoz.com" ]
sundar@talentoz.com
e8225b16a90d47e5a430ea0bbf9dd7f31a475158
79be772bb59cec02ad84941a8edd650cd9ac2bbf
/src/main/java/com/imd/KylxApplication.java
995148291d3e64fc6f3cc0bf30cc9256bbd78571
[]
no_license
jinyaozhuzhu/Kylx
34d91f5a34e2d14b87b9fc63774ec26aa6a8fa3b
f35b3919cc85747821ceaeef79598623cb10b498
refs/heads/master
2021-01-20T13:04:50.153865
2017-06-05T17:42:43
2017-06-05T17:42:43
90,446,366
0
0
null
null
null
null
UTF-8
Java
false
false
445
java
package com.imd; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ImportResource; @SpringBootApplication @MapperScan("com.imd.dao") public class KylxApplication { public static void main(String[] args) { SpringApplication.run(KylxApplication.class, args); } }
[ "274486471@qq.com" ]
274486471@qq.com
18a6031e21a98dd8a51f5cf8674b8a2a003dd34e
fbf253e0ee4dc8c9ae6ae51774dad6611cda879f
/src/main/java/gradebook/dao/GradebookCategoryDAO.java
3abdff6873b709fb703bcaf2b53258c8f691202d
[]
no_license
ckirkman93/gradebook
6fc908484e3c54f6280e82d5ce0fff2496c0f4e0
3408214da022dedb4afc86cb2c2e00caf6aac8ef
refs/heads/master
2020-04-09T20:07:13.306752
2013-07-31T19:07:05
2013-07-31T19:07:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,441
java
package gradebook.dao; import gradebook.model.GradeableEntity; import gradebook.model.GradebookCategory; import java.util.List; /** * GradebookCategoryDAO provides an interface for a concrete DAO that would * communicate with a data source to store and retrieve GradebookCategory * objects. * * @author christina * */ public interface GradebookCategoryDAO { /** * This method can be used to return a list of all the GradebookCategory * objects belonging to a particular GradebookEntity (such as a Student). * * @param entity The entity owning the gradebook categories. * @return categories A list of the gradebook categories. */ List<GradebookCategory> getCategoriesForEntity(GradeableEntity entity); /** * This method returns a specific GradebookCategory object. * * @param id The id of a gradebook category. * @return category The GradebookCategory object corresponding to the id. */ GradebookCategory getGradebookCategory(int id); /** * This is used to store a GradebookCategory object in the database. * * @param category The category being stored. */ void createGradebookCategory(GradebookCategory category); /** * This is used to remove a GradebookCategory object from the database. * * @param category The category to be deleted. */ void deleteGradebookCategory(GradebookCategory category); }
[ "christina.kirkman@gmail.com" ]
christina.kirkman@gmail.com
d7b54189cfa058a1d9d07fbd58be0b2a90276daa
0e9897b131cd29caafcd710b50b19be800de3e87
/app/src/main/java/com/itheima/mobilesafe/ui/SettingItemView.java
8ec28fcd07f42f95de387463a8efa73cc2496163
[]
no_license
Xiao-Y/MobilSafe
518950f418394df1c4d5b62b1b80bc68c7448d47
890791fe85bc038d2a94abbc4ca4c77f15f59c46
refs/heads/master
2020-07-20T12:21:45.985921
2016-11-19T07:05:28
2016-11-19T07:05:28
66,465,296
0
0
null
null
null
null
UTF-8
Java
false
false
2,650
java
package com.itheima.mobilesafe.ui; import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.widget.CheckBox; import android.widget.RelativeLayout; import android.widget.TextView; import com.itheima.mobilesafe.R; /** * 自定义的组合控件,它里面有两个TextView ,还有一个CheckBox,还有一个View * * @author XiaoY * @date: 2016年8月19日 下午10:54:09 */ public class SettingItemView extends RelativeLayout { public final static String ITHEIMA_SCHEMAS = "http://schemas.android.com/apk/res-auto"; //标题 private TextView tv_title; //说明 private TextView tv_desc; //选种状态 private CheckBox cb_status; //选种显示的信息 private String desc_on; //未选种显示的信息 private String desc_off; public SettingItemView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); iniView(context); } public SettingItemView(Context context, AttributeSet attrs) { super(context, attrs); iniView(context); this.initInfo(attrs); } public SettingItemView(Context context) { super(context); iniView(context); } /** * 初始化布局文件 * * @param context */ private void iniView(Context context) { // 把一个布局文件---》View 并且加载在SettingItemView View.inflate(context, R.layout.setting_item_view, this); cb_status = (CheckBox) this.findViewById(R.id.cb_status); tv_desc = (TextView) this.findViewById(R.id.tv_desc); tv_title = (TextView) this.findViewById(R.id.tv_title); } /** * 获取自定义的标签的属性 * * @param attrs */ private void initInfo(AttributeSet attrs) { String title = attrs.getAttributeValue(ITHEIMA_SCHEMAS, "title"); tv_title.setText(title); desc_on = attrs.getAttributeValue(ITHEIMA_SCHEMAS, "desc_on"); desc_off = attrs.getAttributeValue(ITHEIMA_SCHEMAS, "desc_off"); setDesc(desc_off); } /** * 校验组合控件是否选中 */ public boolean isChecked() { return cb_status.isChecked(); } /** * 设置组合控件的状态 */ public void setChecked(boolean checked) { if (checked) { setDesc(desc_on); } else { setDesc(desc_off); } cb_status.setChecked(checked); } /** * 设置组合控件的描述信息 */ public void setDesc(String text) { tv_desc.setText(text); } }
[ "lyongdtao123@126.com" ]
lyongdtao123@126.com
2f2fa58cab4343a515c88defaa14d35c63fdbe1c
54990491714869f9646ccf74402b03a70d746ee2
/EpicSpellWarsofBattleWizards-master/app/src/main/java/scottie/cs301/EpicActuals/Resources/Cards/CardActuals/MercyKilling.java
f53409fc5c05a667b326b917bb896196c3c4c491
[]
no_license
markusperry/EpicSpellWarsofBattleWizards-master
781548036d811c3fff3c33db4fe0f56fa74e28fc
94549305a9b2dbf2d39bd626a57817997c1f7ab2
refs/heads/master
2016-09-13T09:19:57.846837
2016-04-25T17:10:56
2016-04-25T17:10:59
57,060,711
0
0
null
null
null
null
UTF-8
Java
false
false
1,727
java
package scottie.cs301.EpicActuals.Resources.Cards.CardActuals; import java.io.Serializable; import java.util.Random; import scottie.cs301.EpicActuals.Resources.Cards.Card; import scottie.cs301.EpicActuals.Resources.Info.GameStateActual; import scottie.cs301.Imports.GameFramework.R; /** * Created by mukai18 on 4/12/2016. * * deals damage to weakest player based on dice roll */ public class MercyKilling extends Card implements Serializable{ //to satisfy the Serializable interface private static final long serialVersionUID = 3339755561382710158L; /** * constructor */ public MercyKilling() { super(31, 5, 3, R.drawable.mercykilling); } /** * overrides method from superclass * heals or damages caster or foes * * @param currentState current GameStateActual object * @param myCasterID ID of person casting it */ @Override public void resolve(GameStateActual currentState, int myCasterID) { // find the weakest player int weakest = 0; int foeID = 0; for (int i = 0; i < currentState.playerHealths.length; i++) { if (currentState.playerHealths[i]<=weakest) { weakest = currentState.playerHealths[i]; foeID = i; } } // deal damage based on input from dice roll Random gen = new Random(); int roll = (gen.nextInt(6)+1)+(gen.nextInt(6)+1); if (roll<=4) { currentState.damage(2,foeID); } else if (roll<=9) { currentState.damage(3,foeID); } else { currentState.damage(4,foeID); } } }
[ "perryma18@up.edu" ]
perryma18@up.edu
f6e177a4600442557ffe7b6216e7f12472210bcf
c4e48d742e363f7a30426615c80cfc1008e9c710
/estabelecs/src/br/com/bjbraz/app/estabelecimentos/config/SpringConfigurator.java
26768ee1db999ab28cb88c215dc379f20ec50e00
[]
no_license
alexjavabraz/estabelecs
6924ee983fb58d9571496184869ef2e00576e1c8
9158c762000f390712e2b0f0b46a92d2954ba11c
refs/heads/master
2021-01-18T21:08:38.068436
2017-04-11T03:20:47
2017-04-11T03:20:47
52,836,075
0
0
null
null
null
null
UTF-8
Java
false
false
7,229
java
package br.com.bjbraz.app.estabelecimentos.config; import java.io.IOException; import java.lang.reflect.Constructor; import java.util.Arrays; import java.util.Comparator; import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanInitializationException; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.beans.factory.support.BeanDefinitionReader; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.ResourceLoaderAware; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.io.support.ResourcePatternResolver; import org.springframework.web.context.support.XmlWebApplicationContext; /** * <p/> * Configure the Spring application context from files on standard locations, * based on a runnng mode<p/> * <p/> * First it reads all property files in the order below and makes the properties * available in the application context. The files in each directory are sorted * alphabetically. System properties override other property sources.<p/> * <ol> * <li>classpath*:META-INF/config/*.properties</li> * <li>classpath*:META-INF/config/MODE/*.properties</li> * <li>/WEB-INF/config/*.properties</li> * <li>/WEB-INF/config/MODE/*.properties</li> * </ol> * <p/> * Then it reads all xml files in the order below and makes the beans available * in the application context. The files in each directory are sorted * alphabetically.<p/> * <ol> * <li>classpath*:META-INF/config/*.xml</li> * <li>classpath*:META-INF/config/MODE/*.xml</li> * <li>/WEB-INF/config/*.xml</li> * <li>/WEB-INF/config/MODE/*.xml</li> * </ol> * @version $VERSION */ public class SpringConfigurator extends PropertyPlaceholderConfigurer implements ResourceLoaderAware { protected Logger logger = LoggerFactory.getLogger(SpringConfigurator.class); private static final String STANDARD_LOCATION_PREFIX = "classpath*:META-INF/config"; private static final String STANDARD_WEB_LOCATION_PREFIX = "/WEB-INF/config"; protected boolean inWebConteiner; protected ResourceLoader resourceLoader; public void setResourceLoader(ResourceLoader resourceLoader) { this.resourceLoader = resourceLoader; if (resourceLoader instanceof XmlWebApplicationContext) { Resource r = resourceLoader.getResource(STANDARD_WEB_LOCATION_PREFIX); if (r.exists()) { inWebConteiner = true; } } } public void postProcessBeanFactory(ConfigurableListableBeanFactory factory) throws BeansException { try { setSystemPropertiesMode(SYSTEM_PROPERTIES_MODE_OVERRIDE); // define properties setLocations(findProperties()); // define xml contexts BeanDefinitionReader reader = new XmlBeanDefinitionReader((DefaultListableBeanFactory) factory); reader.loadBeanDefinitions(findContexts()); super.postProcessBeanFactory(factory); } catch (Exception ex) { throw new IllegalStateException(ex); } } protected Resource[] findProperties() { Resource[] resources = findStandardResources("properties"); for (Resource r : resources) { logger.debug("Properties -> " + r); } return resources; } protected Resource[] findContexts() { Resource[] resources = findStandardResources("xml"); for (Resource r : resources) { logger.debug("Context -> " + r); } return resources; } protected Resource[] findStandardResources(String extension) { Resource[] resources = findModeResources(STANDARD_LOCATION_PREFIX, extension); if (inWebConteiner) { Resource[] webResources = findModeResources(STANDARD_WEB_LOCATION_PREFIX, extension); resources = concat(resources, webResources); } return resources; } protected Resource[] findModeResources(String prefix, String extension) { Resource[] resources = findResources(prefix + "/*." + extension); Set<String> runningModes = RunningMode.get(); for (String runningMode : runningModes) { Resource[] modeResources = findResources(prefix + "/" + runningMode + "/*." + extension); resources = concat(resources, modeResources); } return resources; } protected Resource[] findResources(String locationPattern) { ResourcePatternResolver resolver = getResolver(); try { Resource[] resources = resolver.getResources(locationPattern); Arrays.sort(resources, new ResourceComparator()); return resources; } catch (IOException e) { throw new BeanInitializationException("Error reading resources", e); } } @SuppressWarnings("unchecked") protected ResourcePatternResolver getResolver() { if (inWebConteiner) { try { Constructor ctor = ((Class) Class.forName("ServletContextResourcePatternResolver")).getConstructor(); return (ResourcePatternResolver) ctor.newInstance(resourceLoader); } catch (Exception e) { // ignore } } return new PathMatchingResourcePatternResolver(resourceLoader); } protected Resource[] concat(Resource[] a1, Resource[] a2) { int l1 = a1.length; int l2 = a2.length; Resource[] r = new Resource[l1 + l2]; System.arraycopy(a1, 0, r, 0, l1); System.arraycopy(a2, 0, r, l1, l2); return r; } protected final static class ResourceComparator implements Comparator<Resource> { protected static final String WEB_INF_CLASSES_META_INF_CONFIG = "/WEB-INF/classes/META-INF/config/"; public int compare(Resource r1, Resource r2) { try { String name1 = r1.getURL().toExternalForm().replace('\\', '/'); String name2 = r2.getURL().toExternalForm().replace('\\', '/'); boolean webInfClasses1 = name1.indexOf(WEB_INF_CLASSES_META_INF_CONFIG) != -1; boolean webInfClasses2 = name2.indexOf(WEB_INF_CLASSES_META_INF_CONFIG) != -1; if (!webInfClasses1 && webInfClasses2) { return -1; } if (webInfClasses1 && !webInfClasses2) { return 1; } } catch (IOException io) { // ignore } return r1.getFilename().compareTo(r2.getFilename()); } } }
[ "alexjavabraz@gmail.com" ]
alexjavabraz@gmail.com
5a22e31a54eb7631135e5557047b844c2b2f60fd
05938563d3032a1670f55e4e8e4ed3af1501e441
/app/src/main/java/com/gymtrainer/gymuserapp/Model/Hire.java
53662a17705d855a7c7c621aa22cdefd3e129b46
[]
no_license
10507037/Fitness-expert-User
a4fa86e65812cdbb624bcf689e5ffb240e145a86
478e13e874ad0a2ab6a5a47ebea0ce3b555d79d0
refs/heads/master
2020-06-15T08:11:37.180269
2019-08-13T12:33:22
2019-08-13T12:33:22
195,245,396
0
0
null
null
null
null
UTF-8
Java
false
false
2,162
java
package com.gymtrainer.gymuserapp.Model; import java.util.ArrayList; import java.util.List; public class Hire { public String userId,trainerId,categoryName,trainerName,userName,imageUrl,rate,date; public ArrayList<String> hourList; public Hire(){} public Hire(String userId, String trainerId, String categoryName,String trainerName,String userName,String imageUrl, String rate, ArrayList<String> hourList,String date) { this.userId = userId; this.trainerId = trainerId; this.categoryName = categoryName; this.trainerName = trainerName; this.userName = userName; this.imageUrl = imageUrl; this.rate = rate; this.hourList = hourList; this.date = date; } public String getTrainerName() { return trainerName; } public void setTrainerName(String trainerName) { this.trainerName = trainerName; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } public String getImageUrl() { return imageUrl; } public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; } public String getRate() { return rate; } public void setRate(String rate) { this.rate = rate; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getTrainerId() { return trainerId; } public void setTrainerId(String trainerId) { this.trainerId = trainerId; } public String getCategoryName() { return categoryName; } public void setCategoryName(String categoryName) { this.categoryName = categoryName; } public ArrayList<String> getHourList() { return hourList; } public void setHourList(ArrayList<String> hourList) { this.hourList = hourList; } }
[ "10507037@mydbs.ie" ]
10507037@mydbs.ie
9a5db8f52e575c568f06b154c93fc47699ba06d4
ea539be028864a7f897dcefc50deb7fa081c930f
/RepartoSAHUAYO/app/src/main/java/com/example/repartosahuayo/Adapter/ListAdapterEventos.java
61c3296f3a265d74ad239e20eb186b4be3004e1f
[]
no_license
ARV02/Reparto
9dc0052855fd4709997bba5de7fb0de2c8eb1458
eb036b195951379465cfe6cb4996b6f040ff366f
refs/heads/master
2022-03-31T07:25:44.802843
2020-01-14T18:32:26
2020-01-14T18:32:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,263
java
package com.example.repartosahuayo.Adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import com.example.repartosahuayo.R; import java.util.ArrayList; public class ListAdapterEventos extends ArrayAdapter<Eventos> implements View.OnClickListener { private ArrayList<Eventos> eventos; Context mContext; private static class ViewHolder{ public TextView evento,folio,importe; } public ListAdapterEventos(ArrayList<Eventos>items, Context context){ super(context, R.layout.eventos,items); this.eventos = items; this.mContext = context; } public void onClick(View v) { int position=(Integer) v.getTag(); Object object= getItem(position); Eventos eventos=(Eventos) object; } private int lastPosition = -1; @Override public View getView(int position, View convertView, ViewGroup parent) { // Get the data item for this position Eventos dataModel = getItem(position); // Check if an existing view is being reused, otherwise inflate the view ListAdapterEventos.ViewHolder viewHolder; // view lookup cache stored in tag final View result; if (convertView == null) { viewHolder = new ListAdapterEventos.ViewHolder(); LayoutInflater inflater = LayoutInflater.from(getContext()); convertView = inflater.inflate(R.layout.eventos, parent, false); viewHolder.evento = convertView.findViewById(R.id.eventosc); viewHolder.folio = convertView.findViewById(R.id.folio); viewHolder.importe = convertView.findViewById(R.id.importe); result=convertView; convertView.setTag(viewHolder); } else { viewHolder = (ListAdapterEventos.ViewHolder) convertView.getTag(); result=convertView; } lastPosition = position; viewHolder.evento.setText(dataModel.getEvento()); viewHolder.folio.setText(dataModel.getFolio()); viewHolder.importe.setText(String.valueOf(dataModel.getImporte())); return convertView; } }
[ "ar0439708@gmail.com" ]
ar0439708@gmail.com
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
938d7f9cd60bb119bb01d799a60f08d44d72becc
edc530772605be03e8abf9d38bfab2f8f54bffcd
/source/sorm-1.0/src/sorm/bean/ColumnInfo.java
2f391e13d646261b4c322c68eccaf1c305294753
[]
no_license
simplewow/Java_learning
8be39adefe885e0f364b218c1d9646229e936b35
7df00a9c3fcff70b4254fe078a9f79b0b1642451
refs/heads/master
2020-12-12T18:55:26.139008
2020-03-12T13:00:21
2020-03-12T13:00:21
234,204,965
1
0
null
null
null
null
UTF-8
Java
false
false
869
java
package sorm.bean; /** * 封装表中一个字段的信息 * @author jx * @version 0.8 */ public class ColumnInfo { /** * 字段名称 */ private String name; /** * 字段的数据类型 */ private String dataType; /** * 字段的键类型(0:普通键,1:主键 2:外键) */ private int keyType; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDataType() { return dataType; } public void setDataType(String dataType) { this.dataType = dataType; } public int getKeyType() { return keyType; } public void setKeyType(int keyType) { this.keyType = keyType; } public ColumnInfo(String name, String dataType, int keyType) { super(); this.name = name; this.dataType = dataType; this.keyType = keyType; } public ColumnInfo() { } }
[ "1297406731@qq.com" ]
1297406731@qq.com
cc82dc1d771dddabc73f82926623c2d8479a255a
2a34b2bf274a1ac783a080b1b05d01aae8bb187c
/app/src/main/java/com/maza/allaboutrocks/Questions.java
a30d4926a21aef1c751c161544fd04366313d08b
[]
no_license
YSWilliger/AllAboutRocks
2a560b588b83f6d3389c307d3c8ac2ac6812748f
7cebb474a20ae6ae152807988ad5c7e00dfd372c
refs/heads/master
2016-09-12T21:38:58.244294
2016-04-14T12:07:48
2016-04-14T12:07:48
56,234,221
0
0
null
null
null
null
UTF-8
Java
false
false
206
java
package com.maza.allaboutrocks; /** * Created by yswilliger on 4/13/2016. */ public class Questions { public static String[] question = {"Test1", "Test2", "Test3", "Test5", "Test6"}; }
[ "yswilliger@gmail.com" ]
yswilliger@gmail.com
4be0a7d20c3e987d9c20853b028e414c2ee83a8e
cc018dfdf1896e43f112d87de43e3203255b1197
/src/main/java/cl/loslinux/webapp/service/PasajeroService.java
d7da73d6002a7c53126270ef5633337ae0209ce3
[]
no_license
leximar17/Destinos-Spring
a91e745ab6fc91ea5926b1ba011fdc46f72396ae
85ded46745cc43e96a768e8f59b1ea05746b02d3
refs/heads/master
2023-01-12T17:39:08.586536
2020-11-23T19:08:51
2020-11-23T19:08:51
315,414,315
0
0
null
null
null
null
UTF-8
Java
false
false
213
java
package cl.loslinux.webapp.service; import java.util.List; import cl.loslinux.webapp.model.Pasajero; public interface PasajeroService { void save (Pasajero pasajero); List<Pasajero> findAll(); }
[ "l.ximar@gmail.com" ]
l.ximar@gmail.com
1784cd15f3a447b245e37c79fc2e9f2e63344900
67a61bebd500b903a67021de2ef73c27bf8eb636
/src/battlegame/ClientCommands/ClientCommand.java
8d0f600454e1175cefcd9d74e7eab6964f53479a
[]
no_license
Lambdara/battle
2032cb0cf2a693f82d6695f61ac77e92ffc6bfce
78ac2012dd3bd5721b9ce6fe16f5e8ace99ad372
refs/heads/master
2022-11-14T18:06:21.065560
2019-03-19T14:29:51
2019-03-19T14:29:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
205
java
package battlegame.ClientCommands; import java.io.Serializable; public class ClientCommand implements Serializable{ /** * */ private static final long serialVersionUID = 9152325249937970041L; }
[ "uwila@runbox.com" ]
uwila@runbox.com
a30bf699cb429db0f1d927e694ad52eb0723e791
d40b6906c30a24ea40b2c46d098bb18f49641c32
/src/main/java/recordwriter/model/Record.java
6926aee5306ac03c5efbc6f3ba319c42297ae34d
[]
no_license
harigayayosiko/kadai
33c016b983532ae4d0006c4713c7f697a268d6e0
6454da781255517249ec0ac215656fcc9bb0bc58
refs/heads/master
2016-09-15T17:49:08.080455
2015-07-31T10:07:44
2015-07-31T10:07:44
37,887,389
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package recordwriter.model; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; import java.util.Date; /** * Created by kajiwarayutaka on 2015/05/13. */ @Data @Entity @Table @NoArgsConstructor @AllArgsConstructor public class Record { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private String title; private String record; private Date date; }
[ "21311253yh@tama.ac.jp" ]
21311253yh@tama.ac.jp
6065a64d2d4d7d9ab8e2d0624687962ac26d4929
54b152d6899244c7c21077b7b14ab97f5251c7dc
/Yeep/src/main/java/com/creditcloud/yeep/model/service/query/CpTransferRecordResponse.java
04f29f07a31d51a9c75972b106a602f15d01fe57
[]
no_license
ultrapro/Gateway
401e6b7493f69241e112136ae4d0235410613b59
dd7df229f9180f2ccd0080781cd280463dae09e8
refs/heads/master
2021-01-15T15:43:32.325668
2015-05-26T14:52:54
2015-05-26T14:52:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,224
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 com.creditcloud.yeep.model.service.query; import com.creditcloud.yeep.model.BaseResponse; import java.util.List; import javax.validation.constraints.NotNull; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; /** * 通用转账记录 * * @author tinglany */ @XmlRootElement (name = "response") public class CpTransferRecordResponse extends BaseResponse { @NotNull private List<CpTransferRecord> records; public CpTransferRecordResponse() { } public CpTransferRecordResponse(String platformNo, String code, String description,List<CpTransferRecord> records) { super(platformNo, code, description); this.records = records; } @XmlElementWrapper(name="records") @XmlElement(name="record") public List<CpTransferRecord> getRecords() { return records; } public void setRecords(List<CpTransferRecord> records) { this.records = records; } }
[ "lanyuntai@gmail.com" ]
lanyuntai@gmail.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
6568f91b8de2a570817b89af53bf87ef0f78b5b1
090918047253b4632eee972581efaa41bb3e3ee4
/main/de/rwth/reversiai/clients/StandaloneClient.java
a562a2536e97be052a86140d53f5eda377c4e53c
[]
no_license
hense96/reversiai
41979ba49325690f5e1ed946a6c66f2ccc394ece
78073405bd41c36f454a52648313dce01e83e062
refs/heads/master
2022-11-02T20:54:57.566227
2020-06-20T13:39:23
2020-06-20T13:39:23
273,713,172
0
0
null
null
null
null
UTF-8
Java
false
false
12,109
java
package de.rwth.reversiai.clients; import de.rwth.reversiai.AI; import de.rwth.reversiai.configuration.Configurator; import de.rwth.reversiai.game.State; import de.rwth.reversiai.move.Move; import de.rwth.reversiai.util.LogTopic; import de.rwth.reversiai.util.MoveLogParser; import de.rwth.reversiai.util.StateBuilder; import de.rwth.reversiai.visualization.InteractiveStateVisualization; import de.rwth.reversiai.visualization.StateVisualization; import java.io.IOException; /** * The {@code StandaloneClient} manages a game that is not hosted by a server. It creates and maintains a visualization * of the game. * Gameplay options: * <ul> * <li>choose the board,</li> * <li>choose number of human players and AI configuration,</li> * <li>simulate a matchpoint game by passing its logfile.</li> * </ul> * * @see de.rwth.reversiai.visualization */ public class StandaloneClient extends Client { /** * The current game state. */ private State state = null; /** * The visualization of the game. */ private StateVisualization visualization = null; /** * Array of agents playing against each other. Agent of index i belongs to player i+1. Might contain {@code null} * entries representing human players. */ private AI[] agents; /** * Parser for a move log file from matchpoint. This parser maintains a stack of moves to be executed. */ private MoveLogParser moves; /** * Variable that will contain a move entered via the GUI as an interactive player. */ private volatile Move interactiveMove; /** * {@code true} if the move log parser still contains moves to be simulated. */ private boolean replayPhase; /** * Flag indicating whether user currently wants the game not to progress. */ private volatile boolean pause; /** * Flag whether the client is currently paused. We need this because we use Object.wait both when waiting for a user * input of a move and while pausing the automatic game progress */ private volatile boolean paused; /** * Indicates how many ms the client waits between executing two moves. */ private volatile long delay; /** * @param boardFile A map file containing a board. * @param humanPlayers Number of human players. * @param replayFile A logfile from matchpoint. * @param configurator A configurator containing an AI configuration. */ public StandaloneClient( String boardFile, int humanPlayers, String replayFile, Configurator configurator ) { LogTopic.info.log( "Starting Group 7 Reversi Standalone Client..." ); try { LogTopic.info.log( "Parsing board from file..." ); // Parse board from file this.state = new StateBuilder().parseFile( boardFile ).buildState(); } catch ( Exception e ) { LogTopic.error.error( e.getMessage() ); System.exit( -1 ); } if ( humanPlayers > this.state.getPlayers().getNumberOfPlayers() ) { LogTopic.error.error( "The given board may only be played by %d players!", this.state.getPlayers().getNumberOfPlayers() ); System.exit( -1 ); } try { if ( replayFile != null ) { LogTopic.info.log( "Parsing replay file..." ); // Parse log file for replay feature this.moves = new MoveLogParser(); this.moves.parseFile( replayFile, this.state.getPlayers().getNumberOfPlayers() ); this.replayPhase = true; } else { this.replayPhase = false; } } catch ( IOException e ) { LogTopic.error.error( e.getMessage() ); System.exit( -1 ); } // Initialize waiting properties this.setPause( true ); this.setDelay( 4000 ); // Initialize agents this.agents = new AI[ this.state.getPlayers().getNumberOfPlayers() ]; // Human players will occupy the lower player IDs for ( byte id = 1; id <= humanPlayers; id++ ) { this.agents[ id - 1 ] = null; } // Fill up the other players with AIs for ( byte id = (byte) ( humanPlayers + 1 ); id <= this.agents.length; id++ ) { this.agents[ id - 1 ] = new AI( state, id, configurator.buildAIConfiguration() ); } // Start the visualization if ( humanPlayers > 0 ) { this.visualization = new InteractiveStateVisualization( this.state, this ); } else { this.visualization = new StateVisualization( this.state, this ); } } /** * Executes moves and updates current game state as well as its visualization until the game is finished. */ @Override public void run() { while ( !this.state.isOver() ) { if ( this.replayPhase ) { if ( this.moves.hasNextMove() ) { // Load next move from log file Move move = this.moves.getNextMove( this.state ); // Pause and "only next move" feature if ( this.pause ) { this.pause(); } // Wait feature try { Thread.sleep( this.delay ); } catch ( InterruptedException e ) { // Will probably not happen, nothing to be done here } // Execute the move if ( move != null ) { this.updateState( move.execute() ); } else { // If null is returned, player needs to be disqualified this.state.disqualify( this.state.getTurnPlayer().getID() ); this.updateState( this.state ); } } else { this.replayPhase = false; } } else { // Get the game agent whose turn it is to make a move AI agent = this.agents[ this.state.getTurnPlayer().getID() - 1 ]; Move move = null; if ( agent == null ) { // Enable the move entry in the GUI ( (InteractiveStateVisualization) this.visualization ).acceptInput(); synchronized ( this ) { try { this.wait(); } catch ( InterruptedException e ) { // Will probably not happen, nothing to be done here } } move = this.interactiveMove; this.interactiveMove = null; } else { // Pause and "only next move" feature if ( this.pause ) { this.pause(); } long tic = System.currentTimeMillis(); move = agent.computeBestMove( this.delay * 1000000L, 0, 1 ); long toc = System.currentTimeMillis(); long computationTime = toc - tic; if ( this.delay - computationTime > 0 ) { // Wait feature try { Thread.sleep( this.delay - computationTime ); } catch ( InterruptedException e ) { // Will probably not happen, nothing to be done here } } } this.updateState( move.execute() ); } } this.visualization.displayPopUpMessage( "The game is over!" ); } /** * Used to pause the automatic progress of a game until either the play or next button in the GUI is pressed. */ private void pause() { this.paused = true; synchronized ( this ) { try { this.wait(); } catch ( InterruptedException e ) { // Will probably not happen, nothing to be done here } } this.paused = false; } /** * Updates current game state and communicates the changes to the visualization and the AIs. * * @param state The new game state. */ private void updateState( State state ) { this.state = state; this.visualization.updateState( state ); for ( AI ai : this.agents ) { if ( ai != null ) { ai.setState( state ); } } } /** * Method called by the GUI controllers once a new move delay is set. * * @param delay Delay time in ms. */ public void setDelay( int delay ) { assert delay >= 0; this.delay = delay; } /** * Method called by the GUI controllers once the pause button is pressed. * * @param pause {@code true} if the game should not progress at the moment. */ public void setPause( boolean pause ) { this.pause = pause; } /** * Method called by the GUI controllers once the play or next button is pressed. Resumes the progress of the game * (for one step if the game is still paused) */ public void nextMove() { if ( this.paused ) { synchronized ( this ) { this.notify(); } } } /** * Method called by the GUI controllers once a move is entered. * * @param x x coordinate on which the stone should be placed * @param y y coordinate on which the stone should be placed * @param moveType Type of the move to be made * @param prefValue Choice/Bonus preference or null if the move is not a choice/bonus tile move */ public void notifyWithInteractiveMoveData( int x, int y, Move.Type moveType, Object prefValue ) { if ( ( moveType == Move.Type.BonusTileMove || moveType == Move.Type.ChoiceTileMove ) && prefValue == null ) { this.visualization.displayPopUpMessage( "Must specify a valid preference!" ); // Try again ( (InteractiveStateVisualization) this.visualization ).acceptInput(); return; } if ( prefValue instanceof Byte && ( (byte) prefValue < 1 || (byte) prefValue > this.state.getBoard().getPlayers() ) ) { this.visualization.displayPopUpMessage( "Must specify a valid player ID to switch stones with!" ); // Try again ( (InteractiveStateVisualization) this.visualization ).acceptInput(); return; } Move move = this.state.buildMove( x, y, prefValue ); if ( !move.isValid() ) { this.visualization.displayPopUpMessage( "This is not a valid move!" ); // Try again ( (InteractiveStateVisualization) this.visualization ).acceptInput(); return; } this.interactiveMove = move; // Wake up the client synchronized ( this ) { StandaloneClient.this.notify(); } } }
[ "julius@hense-ge.de" ]
julius@hense-ge.de
86a2417a5589aa7205134adff91c14a62ab8b70c
7c837f60883c8fbfc23772785dfca67a0df0ea46
/HomeSofaMobile/src/test/java/PageObjects/HomePage.java
43f7a61f0c89e8992b5adcd36b5a6078e39cdb6c
[]
no_license
kuldip16/kuldeepmaven
05da41dd0a33b828e7df91ad1a1ebb8d379ad99f
f2663b5f6d1cb89aa13000112997a304ccfbd4ce
refs/heads/master
2021-01-02T08:56:02.311503
2017-08-18T14:05:56
2017-08-18T14:05:56
99,102,309
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
package PageObjects; import UtilityMobile.BaseMobile; public class HomePage extends BaseMobile { public static String menu = ".//*[@id='header']/div[1]"; public static String menuCountXpath = "//span[@class='jq-wishlist-menu-count']"; public static String homeSofaLogo = "//div[@class='comp-logo']/a[@title='Homesofa.de']"; }
[ "kuldipkumar169@gmail.com" ]
kuldipkumar169@gmail.com
d21ff48d33c3bdb8a68de2cdd0e74cb690417a51
338d8dee5e7318590140f40bd88d6ae9c2516b94
/spark-demo/src/main/java/com/spark/demo/JobTimerTask.java
ae15ea9e87dea2d7768146afc131361eba589e93
[]
no_license
self-repo/spark-demo
4092582890fedc608fc42a6925e9152dd2ec5c5d
a42793a243b8f6c9a76990217c50780cc133970a
refs/heads/master
2020-03-11T23:33:56.513686
2018-04-21T06:43:01
2018-04-21T06:43:01
130,325,082
0
0
null
null
null
null
UTF-8
Java
false
false
1,143
java
package com.spark.demo; import java.util.concurrent.TimeUnit; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; import org.apache.spark.sql.SparkSession; import org.jboss.netty.util.HashedWheelTimer; import org.jboss.netty.util.Timeout; import org.jboss.netty.util.TimerTask; public class JobTimerTask implements TimerTask { private SparkSession spark; private HashedWheelTimer timer; public JobTimerTask(SparkSession spark, HashedWheelTimer timer) { this.spark = spark; this.timer = timer; } @Override public void run(Timeout timeout) throws Exception { // Dataset<Row> appDF = spark.read().json("app.json"); // Dataset<Row> pcDF = spark.read().json("pc.json"); // appDF.createOrReplaceTempView("app"); // pcDF.createOrReplaceTempView("pc"); // spark.sql("select distinct name FROM (SELECT name FROM app union all // SELECT name FROM pc)").show(); Dataset<Row> stuDF = spark.read().json("stu.json"); stuDF.createOrReplaceTempView("stu"); spark.sql("SELECT name,myAverage(scores) as avg_salary FROM stu group by name").show(); this.timer.newTimeout(this, 10, TimeUnit.SECONDS); } }
[ "550595698@qq.com" ]
550595698@qq.com
1d4bd7092a37fb9145d9d3a84aa749b630401647
8f6da7f91d338f8755e33ffdb65c468a86c216d8
/chapters/3-sorting/collinear/src/main/java/Point.java
bd19590875a7eadd83272ae561de2c0887cc0f67
[]
no_license
grodin/algorithms-pt1
ee08fe54c147806ec4d47af04bcf30daa9bd31f0
e475fe048de8fa0f41b524621adc839c763f018a
refs/heads/main
2023-05-04T05:04:32.589566
2021-04-29T13:57:54
2021-04-29T13:57:54
343,829,162
0
0
null
null
null
null
UTF-8
Java
false
false
3,953
java
/****************************************************************************** * Compilation: javac Point.java * Execution: java Point * Dependencies: none * * An immutable data type for points in the plane. * For use on Coursera, Algorithms Part I programming assignment. * ******************************************************************************/ import java.util.Comparator; import edu.princeton.cs.algs4.StdDraw; public class Point implements Comparable<Point> { private static final Comparator<Point> POINT_COMPARATOR_Y_THEN_X = Comparator.comparing((Point pt) -> pt.y).thenComparing((Point pt) -> pt.x); private final int x; // x-coordinate of this point private final int y; // y-coordinate of this point /** * Initializes a new point. * * @param x the <em>x</em>-coordinate of the point * @param y the <em>y</em>-coordinate of the point */ public Point(int x, int y) { /* DO NOT MODIFY */ this.x = x; this.y = y; } /** * Draws this point to standard draw. */ public void draw() { /* DO NOT MODIFY */ StdDraw.point(x, y); } /** * Draws the line segment between this point and the specified point to * standard draw. * * @param that the other point */ public void drawTo(Point that) { /* DO NOT MODIFY */ StdDraw.line(this.x, this.y, that.x, that.y); } /** * Returns the slope between this point and the specified point. Formally, if * the two points are (x0, y0) and (x1, y1), then the slope is (y1 - y0) / (x1 * - x0). For completeness, the slope is defined to be +0.0 if the line * segment connecting the two points is horizontal; Double.POSITIVE_INFINITY * if the line segment is vertical; and Double.NEGATIVE_INFINITY if (x0, y0) * and (x1, y1) are equal. * * @param that the other point * @return the slope between this point and the specified point */ public double slopeTo(Point that) { final int dx = that.x - this.x; final int dy = that.y - this.y; if (dx == 0) { if (dy == 0) { return Double.NEGATIVE_INFINITY; } else { return Double.POSITIVE_INFINITY; } } else { final double slope = ((double) dy) / dx; if (isNegativeZero(slope)) { return 0.0; } else { return slope; } } } /** * Compares two points by y-coordinate, breaking ties by x-coordinate. * Formally, the invoking point (x0, y0) is less than the argument point (x1, * y1) if and only if either y0 < y1 or if y0 = y1 and x0 < x1. * * @param that the other point * @return the value <tt>0</tt> if this point is equal to the argument point * (x0 = x1 and y0 = y1); a negative integer if this point is less than the * argument point; and a positive integer if this point is greater than the * argument point */ public int compareTo(Point that) { return POINT_COMPARATOR_Y_THEN_X.compare(this, that); } /** * Compares two points by the slope they make with this point. The slope is * defined as in the slopeTo() method. * * @return the Comparator that defines this ordering on points */ public Comparator<Point> slopeOrder() { return Comparator.comparing(this::slopeTo); } /** * Returns a string representation of this point. This method is provide for * debugging; your program should not rely on the format of the string * representation. * * @return a string representation of this point */ public String toString() { /* DO NOT MODIFY */ return "(" + x + ", " + y + ")"; } /** * Unit tests the Point data type. */ public static void main(String[] args) { /* YOUR CODE HERE */ } private static final long negativeZeroRawBits = Double.doubleToRawLongBits(-0.0); private boolean isNegativeZero(double value) { return Double.doubleToRawLongBits(value) == negativeZeroRawBits; } }
[ "cooper.joseph@gmail.com" ]
cooper.joseph@gmail.com
c986283ad6aa2ae88fe1dbea018ae12ca986a5a2
07925a617a35b119a406e5d9e4d3d965c1cbdd81
/src/main/java/com/github/casside/pac4jx/clients/pac4j/springframework/security/web/DelegatingCallbackFilter.java
9915b065719e033d820013b35e6bcfdabd5e4f1f
[]
no_license
cas-side/pac4j-x-clients
ee35476f74d8478112cddf0dc19f63d6ef45db66
803132ad418c7e83733167a34b5d7ffd91c757e0
refs/heads/main
2023-03-08T01:10:50.717449
2021-02-24T07:04:25
2021-02-24T07:04:25
341,070,848
0
0
null
null
null
null
UTF-8
Java
false
false
3,193
java
package com.github.casside.pac4jx.clients.pac4j.springframework.security.web; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import org.pac4j.core.client.Client; import org.pac4j.core.client.Clients; import org.pac4j.core.client.finder.ClientFinder; import org.pac4j.core.config.Config; import org.pac4j.core.context.J2EContext; import org.pac4j.core.context.WebContext; import org.pac4j.springframework.security.web.CallbackFilter; /** * 包装 CallbackFilter,每次都动态设置 Pac4j.Config */ @RequiredArgsConstructor public class DelegatingCallbackFilter implements Filter { final CallbackFilter callbackFilter; final List<ClientFinder> clientFinders; final Config config; private Config obtainConfig(WebContext context, String clientNames) { Clients clients = config.getClients(); // List<Client> foundClients = clientFinder.find(clients, context, clientNames); List<Client> foundClients = clientFinders.stream().map(clientFinder -> { return clientFinder.find(clients, context, clientNames); }).filter(Objects::nonNull).flatMap(Collection::stream).collect(Collectors.toList()); Config tmpConfig = cloneConfig(config); Clients newClients = new Clients(); List<Client> newClientList = new ArrayList<>(foundClients); newClients.setClients(newClientList); tmpConfig.setClients(newClients); return tmpConfig; } private Config cloneConfig(Config config) { Config tmpConfig = new Config(config.getClients()); tmpConfig.setAuthorizers(config.getAuthorizers()); tmpConfig.setCallbackLogic(config.getCallbackLogic()); tmpConfig.setAuthorizers(config.getAuthorizers()); tmpConfig.setHttpActionAdapter(config.getHttpActionAdapter()); tmpConfig.setLogoutLogic(config.getLogoutLogic()); tmpConfig.setSecurityLogic(config.getSecurityLogic()); tmpConfig.setSessionStore(config.getSessionStore()); tmpConfig.setMatchers(config.getMatchers()); tmpConfig.setProfileManagerFactory(config.getProfileManagerFactory()); return tmpConfig; } @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain filterChain) throws IOException, ServletException { final J2EContext context = new J2EContext((HttpServletRequest) req, (HttpServletResponse) resp, config.getSessionStore()); callbackFilter.setConfig(obtainConfig(context, null)); callbackFilter.doFilter(req, resp, filterChain); } @Override public void destroy() { } }
[ "624498030@qq.com" ]
624498030@qq.com
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
1e9ae1293bfa3726cb67783932b556807e185791
b26eeb04899bb499f9e98a54c28d82be9ee83206
/Downloads/ParkSistemi/src/Time.java
1fbab35e9a941529d10d96f977389388649e3f69
[]
no_license
huseynvaliyev/AutoparkSimulation
1a79f7b9cada00e6e77412aa795cdcdb8ae38f3f
d82353878e9d5107c900b71b8ad7b2cbd68b3c6b
refs/heads/master
2023-06-03T12:56:04.844929
2021-06-18T14:29:59
2021-06-18T14:29:59
257,668,185
0
0
null
null
null
null
UTF-8
Java
false
false
607
java
import java.util.Calendar; public class Time { private int hour; private int minute; Calendar now = Calendar.getInstance(); public Time(int hour,int minute) { this.hour = hour; this.minute = minute; } public int getHour() { return hour; } public void setHour(int hour) { this.hour = hour; } public int getMinute() { return minute; } public void setMinute(int minute) { this.minute = minute; } public int getDifference(Time other) { int difference = ((now.get(Calendar.HOUR_OF_DAY)*60)+now.get(Calendar.MINUTE))-((other.hour*60)+other.minute); return difference; } }
[ "huseynvaliyev2015@gmail.com" ]
huseynvaliyev2015@gmail.com
1f502bc6997812141bb14181fcc244b3b61130c7
18d147a443ffbf3bc8acea447c3db067fdaf530d
/src/main/java/top/lucas9/lblog/config/ShiroConfig.java
c9f29cb175ca3156c5e97a7522018f0819184603
[]
no_license
Lucas-9/fly-community
e35e214cce5e1df08698ccfacb570b46ac690a49
c3023a61d8135fca0c7a83eeecf601e9089f87cb
refs/heads/main
2023-06-06T13:00:22.455332
2021-06-25T14:50:33
2021-06-25T14:50:33
380,263,032
0
0
null
null
null
null
UTF-8
Java
false
false
3,592
java
package top.lucas9.lblog.config; import org.apache.shiro.mgt.DefaultSessionStorageEvaluator; import org.apache.shiro.mgt.DefaultSubjectDAO; import org.apache.shiro.session.mgt.SessionManager; import org.apache.shiro.spring.web.ShiroFilterFactoryBean; import org.apache.shiro.spring.web.config.DefaultShiroFilterChainDefinition; import org.apache.shiro.spring.web.config.ShiroFilterChainDefinition; import org.apache.shiro.web.mgt.DefaultWebSecurityManager; import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; import org.apache.shiro.mgt.SecurityManager; import org.crazycake.shiro.RedisCacheManager; import org.crazycake.shiro.RedisSessionDAO; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import top.lucas9.lblog.shiro.AccountCredentialsMatcher; import top.lucas9.lblog.shiro.AccountRealm; import top.lucas9.lblog.shiro.JwtFilter; import javax.servlet.Filter; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; @Configuration public class ShiroConfig { @Bean public SessionManager sessionManager(RedisSessionDAO redisSessionDAO) { DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); sessionManager.setSessionDAO(redisSessionDAO); return sessionManager; } @Bean public DefaultWebSecurityManager securityManager(AccountRealm accountRealm, SessionManager sessionManager, RedisCacheManager redisCacheManager) { DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(accountRealm); securityManager.setRealm(accountRealm); securityManager.setSessionManager(sessionManager); securityManager.setCacheManager(redisCacheManager); DefaultSubjectDAO subjectDAO = new DefaultSubjectDAO(); DefaultSessionStorageEvaluator sessionStorageEvaluator = new DefaultSessionStorageEvaluator(); sessionStorageEvaluator.setSessionStorageEnabled(false); subjectDAO.setSessionStorageEvaluator(sessionStorageEvaluator); securityManager.setSubjectDAO(subjectDAO); return securityManager; } @Bean public ShiroFilterChainDefinition shiroFilterChainDefinition() { DefaultShiroFilterChainDefinition chainDefinition = new DefaultShiroFilterChainDefinition(); Map<String, String> filterMap = new LinkedHashMap<>(); filterMap.put("/**", "jwt"); chainDefinition.addPathDefinitions(filterMap); return chainDefinition; } @Bean("shiroFilterFactoryBean") public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager, ShiroFilterChainDefinition shiroFilterChainDefinition) { ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean(); shiroFilter.setSecurityManager(securityManager); Map<String, Filter> filters = new HashMap<>(); filters.put("jwt", new JwtFilter()); shiroFilter.setFilters(filters); Map<String, String> filterMap = shiroFilterChainDefinition.getFilterChainMap(); shiroFilter.setFilterChainDefinitionMap(filterMap); return shiroFilter; } @Bean public AccountRealm getAccountRealm(AccountCredentialsMatcher accountCredentialsMatcher) { AccountRealm accountRealm = new AccountRealm(); accountRealm.setCredentialsMatcher(accountCredentialsMatcher); return accountRealm; } }
[ "1778410268@qq.com" ]
1778410268@qq.com
7e2a84d521b0053630f96adf051607a039318ab4
00abdb7ab73e43221d0b1e15cf126ab7d4f71258
/Creative/src/Oops/ConstructorOverRiding.java
d5e6679d6ebbab007ec5ffc91a16df56d4fff77e
[]
no_license
Darshan131/javaProject
8d544748836be9ebe5d692725ca94be22819ffcf
fcbea42816fd9d795fbd341bef13b8a48fbea4cf
refs/heads/master
2020-08-06T06:42:15.415868
2019-10-30T03:11:29
2019-10-30T03:11:29
212,875,933
0
0
null
null
null
null
UTF-8
Java
false
false
610
java
package Oops; public class ConstructorOverRiding { public static void main(String[] args) { B obj = new B(5); } } class A { public A() { System.out.println("in A"); } public A(int i) { System.out.println("In I of Constructor"); } //In-Order to call each Constructor we need to Create Object //In this case it will call specified parameter of Sub-Class as well as the Default Constructor of } //Super-Class class B extends A { public B() { System.out.println("lIn B"); } public B(int i) { System.out.println("In i of Constructor B"); } }
[ "db@172.20.10.2" ]
db@172.20.10.2
ed228913f79cffb2f9e0c55ce5ef37a1a5e1ca83
f39c3d2638fe2b673a10f3f4ea9dd947291efe74
/library/src/androidTest/java/com/hippo/quickjs/android/JSContextTest.java
eed0172bb26b5764e27382a9ca710212d3968d41
[ "Apache-2.0" ]
permissive
gubaojian/quickjs-android
c19f56b83d81c956be78cc1c57ad9669a05f222e
5d430ac41240310c48237d1abedc876219f95507
refs/heads/master
2020-07-10T15:58:16.800884
2019-08-24T07:40:37
2019-08-24T07:40:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,706
java
/* * Copyright 2019 Hippo Seven * * 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.hippo.quickjs.android; import androidx.annotation.Nullable; import org.junit.Ignore; import org.junit.Test; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Type; import static com.hippo.quickjs.android.Utils.assertException; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.*; public class JSContextTest { @Ignore("There is no guarantee that this test will pass") @Test public void testJSValueGC() { QuickJS quickJS = new QuickJS.Builder().build(); try (JSRuntime runtime = quickJS.createJSRuntime()) { try (JSContext context = runtime.createJSContext()) { int jsValueCount = 3; assertEquals(0, context.getNotRemovedJSValueCount()); for (int i = 0; i < jsValueCount; i++) { context.evaluate("1", "unknown.js", int.class); } assertEquals(jsValueCount, context.getNotRemovedJSValueCount()); Runtime.getRuntime().gc(); Runtime.getRuntime().gc(); context.evaluate("1", "unknown.js", int.class); assertEquals(1, context.getNotRemovedJSValueCount()); } } } @Test public void throwException() { QuickJS quickJS = new QuickJS.Builder().build(); try (JSRuntime runtime = quickJS.createJSRuntime()) { try (JSContext context = runtime.createJSContext()) { assertException( JSEvaluationException.class, "Throw: 1\n", () -> context.evaluate("throw 1", "unknown.js") ); } } } @Test public void throwExceptionWithReturn() { QuickJS quickJS = new QuickJS.Builder().build(); try (JSRuntime runtime = quickJS.createJSRuntime()) { try (JSContext context = runtime.createJSContext()) { assertException( JSEvaluationException.class, "Throw: 1\n", () -> context.evaluate("throw 1", "unknown.js", int.class) ); } } } @Test public void getGlobalObject() { QuickJS quickJS = new QuickJS.Builder().build(); try (JSRuntime runtime = quickJS.createJSRuntime()) { try (JSContext context = runtime.createJSContext()) { context.evaluate("a = 1", "unknown.js", int.class); assertEquals(1, context.getGlobalObject().getProperty("a").cast(JSNumber.class).getInt()); context.getGlobalObject().setProperty("b", context.createJSString("string")); assertEquals("string", context.evaluate("b", "unknown.js", String.class)); } } } @Test public void evaluateWithoutReturn() { QuickJS quickJS = new QuickJS.Builder().build(); try (JSRuntime runtime = quickJS.createJSRuntime()) { try (JSContext context = runtime.createJSContext()) { context.evaluate("a = {}", "test.js"); assertThat(context.getGlobalObject().getProperty("a")).isInstanceOf(JSObject.class); } } } private static class StringHolder { final String str; StringHolder(String str) { this.str = str; } @Override public int hashCode() { return str.hashCode(); } @Override public boolean equals(@Nullable Object obj) { return obj instanceof StringHolder && str.equals(((StringHolder) obj).str); } } private static class ClassA { boolean emptyCalled; public void funEmpty() { emptyCalled = false; } public boolean funBoolean(boolean a, Boolean b) { return a && b; } public char funChar(char a, Character b) { return (char) ((short) a + (short) (char) b); } public byte funByte(byte a, Byte b) { return (byte) (a + b); } public short funShort(short a, Short b) { return (short) (a + b); } public int funInt(int a, Integer b) { return a + b; } public long funLong(long a, Long b) { return a + b; } public float funFloat(float a, Float b) { return a + b; } public double funDouble(double a, Double b) { return a + b; } public String funString(char a, String b) { return a + b; } public StringHolder funInnerClass(char a, StringHolder b) { return new StringHolder(a + b.str); } static boolean staticEmptyCalled; public static void staticFunEmpty() { staticEmptyCalled = false; } public static boolean staticFunBoolean(boolean a, Boolean b) { return a && b; } public static char staticFunChar(char a, Character b) { return (char) ((short) a + (short) (char) b); } public static byte staticFunByte(byte a, Byte b) { return (byte) (a + b); } public static short staticFunShort(short a, Short b) { return (short) (a + b); } public static int staticFunInt(int a, Integer b) { return a + b; } public static long staticFunLong(long a, Long b) { return a + b; } public static float staticFunFloat(float a, Float b) { return a + b; } public static double staticFunDouble(double a, Double b) { return a + b; } public static String staticFunString(char a, String b) { return a + b; } public static StringHolder staticFunInnerClass(char a, StringHolder b) { return new StringHolder(a + b.str); } } private void invokeJavaMethodInJS( JSContext context, Object instance, java.lang.reflect.Method rawMethod, Object[] args ) throws InvocationTargetException, IllegalAccessException { Method method = Method.create(instance.getClass(), rawMethod); assertNotNull(method); JSFunction fun = context.createJSFunction(instance, method); context.getGlobalObject().setProperty("fun", fun); JSValue[] jsArgs = new JSValue[method.parameterTypes.length]; for (int i = 0; i < method.parameterTypes.length; i++) { jsArgs[i] = context.quickJS.getAdapter(method.parameterTypes[i]).toJSValue(context.quickJS, context, args[i]); } JSValue jsResult = fun.invoke(null, jsArgs); assertEquals( rawMethod.invoke(instance, args), context.quickJS.getAdapter(method.returnType).fromJSValue(context.quickJS, context, jsResult) ); } private void invokeJavaStaticMethodInJS( JSContext context, Class clazz, java.lang.reflect.Method rawMethod, Object[] args ) throws InvocationTargetException, IllegalAccessException { Method method = Method.create(clazz, rawMethod); assertNotNull(method); JSFunction fun = context.createJSFunctionS(clazz, method); context.getGlobalObject().setProperty("fun", fun); JSValue[] jsArgs = new JSValue[method.parameterTypes.length]; for (int i = 0; i < method.parameterTypes.length; i++) { jsArgs[i] = context.quickJS.getAdapter(method.parameterTypes[i]).toJSValue(context.quickJS, context, args[i]); } JSValue jsResult = fun.invoke(null, jsArgs); assertEquals( rawMethod.invoke(null, args), context.quickJS.getAdapter(method.returnType).fromJSValue(context.quickJS, context, jsResult) ); } @Test public void createValueFunction() throws InvocationTargetException, IllegalAccessException { QuickJS quickJS = new QuickJS.Builder().registerTypeAdapter(StringHolder.class, new TypeAdapter<StringHolder>() { @Override public JSValue toJSValue(Depot depot, Context context, @Nullable StringHolder value) { return context.createJSString(value.str); } @Override public StringHolder fromJSValue(Depot depot, Context context, JSValue value) { return new StringHolder(value.cast(JSString.class).getString()); } }).build(); try (JSRuntime runtime = quickJS.createJSRuntime()) { try (JSContext context = runtime.createJSContext()) { ClassA a = new ClassA(); JSFunction fun1 = context.createJSFunction(a, new Method(void.class, "funEmpty", new Type[] {})); context.getGlobalObject().setProperty("fun", fun1); a.emptyCalled = true; context.evaluate("fun()", "test.js"); assertFalse(a.emptyCalled); for (java.lang.reflect.Method rawMethod : ClassA.class.getMethods()) { Object[] args = null; switch (rawMethod.getName()) { case "funBoolean": args = new Object[] { true, false }; break; case "funChar": args = new Object[] { 'a', '*' }; break; case "funByte": args = new Object[] { (byte) 23, (byte) (-54) }; break; case "funShort": args = new Object[] { (short) 23, (short) (-54) }; break; case "funInt": args = new Object[] { 23, -54 }; break; case "funLong": args = new Object[] { 23L, -54L }; break; case "funFloat": args = new Object[] { 23.1f, -54.8f }; break; case "funDouble": args = new Object[] { 23.1, -54.8 }; break; case "funString": args = new Object[] { '9', "str" }; break; case "funInnerClass": args = new Object[] { '9', new StringHolder("str") }; break; } if (args != null) { invokeJavaMethodInJS(context, a, rawMethod, args); } } JSFunction fun2 = context.createJSFunctionS(ClassA.class, new Method(void.class, "staticFunEmpty", new Type[] {})); context.getGlobalObject().setProperty("fun", fun2); ClassA.staticEmptyCalled = true; context.evaluate("fun()", "test.js"); assertFalse(ClassA.staticEmptyCalled); for (java.lang.reflect.Method rawMethod : ClassA.class.getMethods()) { Object[] args = null; switch (rawMethod.getName()) { case "staticFunBoolean": args = new Object[] { true, false }; break; case "staticFunChar": args = new Object[] { 'a', '*' }; break; case "staticFunByte": args = new Object[] { (byte) 23, (byte) (-54) }; break; case "staticFunShort": args = new Object[] { (short) 23, (short) (-54) }; break; case "staticFunInt": args = new Object[] { 23, -54 }; break; case "staticFunLong": args = new Object[] { 23L, -54L }; break; case "staticFunFloat": args = new Object[] { 23.1f, -54.8f }; break; case "staticFunDouble": args = new Object[] { 23.1, -54.8 }; break; case "staticFunString": args = new Object[] { '9', "str" }; break; case "staticFunInnerClass": args = new Object[] { '9', new StringHolder("str") }; break; } if (args != null) { invokeJavaStaticMethodInJS(context, ClassA.class, rawMethod, args); } } } } } @Test public void createValueFunctionNoMethod() { QuickJS quickJS = new QuickJS.Builder().build(); try (JSRuntime runtime = quickJS.createJSRuntime()) { try (JSContext context = runtime.createJSContext()) { Method method = new Method(long.class, "atoi", new Type[] { String.class }); assertException( NoSuchMethodError.class, "no non-static method \"Ljava/lang/Integer;.atoi(Ljava/lang/String;)J\"", () -> context.createJSFunction(1, method) ); assertException( NoSuchMethodError.class, "no static method \"Ljava/lang/Integer;.atoi(Ljava/lang/String;)J\"", () -> context.createJSFunctionS(Integer.class, method) ); } } } @Test public void createValueFunctionNull() { QuickJS quickJS = new QuickJS.Builder().build(); try (JSRuntime runtime = quickJS.createJSRuntime()) { try (JSContext context = runtime.createJSContext()) { Method method = new Method(int.class, "atoi", new Type[] { String.class }); assertException( NullPointerException.class, "instance == null", () -> context.createJSFunction(null, method) ); assertException( NullPointerException.class, "method == null", () -> context.createJSFunction(1, null) ); assertException( NullPointerException.class, "clazz == null", () -> context.createJSFunctionS(null, method) ); assertException( NullPointerException.class, "method == null", () -> context.createJSFunctionS(Class.class, null) ); } } } }
[ "seven332@163.com" ]
seven332@163.com
e142f683621f45805ccbdee7f332fe3b6df61505
0a47e0a80fa7dc9c681ebce938395090d2f9fb54
/2.Lists/src/Laptop.java
7eb87841115ac1d1eb728430a55db04f749b6b3a
[]
no_license
Pawel-Wojtarowicz/Exercises
1b00e71c8db2726c0e8aff7e0f37368ac7519c09
5340042c38d5e16b37fe7b488a810007e5acbd1b
refs/heads/master
2021-03-26T07:43:04.352229
2020-06-09T12:20:02
2020-06-09T12:20:02
247,685,305
0
0
null
null
null
null
UTF-8
Java
false
false
1,481
java
import java.util.ArrayList; import java.util.List; public class Laptop { String name; int rating; //rating [0-50] public Laptop(String name, int rating) { this.name = name; this.rating = rating; } void introduce() { System.out.print("Hi, I'm " + name); if ((rating > 0) && (rating <= 9)) { System.out.print(" and I'm a very slow laptop.\n"); } else if ((rating > 9) && (rating <= 24)) { System.out.print(" and I'm a quite decent laptop.\n"); } else if ((rating > 24) && (rating <= 50)) { System.out.print(" and I'm a gaming machine\n"); } } public static void main(String[] args) { List<Laptop> laptopList = new ArrayList<>(); Laptop asus = new Laptop("ASUS NOVAGO TP370QL", 9); Laptop acer = new Laptop("ACER PREDATOR 21 X", 38); Laptop dell = new Laptop("DELL LATITUDE 7390", 14); Laptop alienware = new Laptop("ALIENWARE 15 R3", 29); laptopList.add(asus); laptopList.add(acer); laptopList.add(dell); laptopList.add(alienware); asus.introduce(); acer.introduce(); dell.introduce(); alienware.introduce(); for (Laptop laptop : laptopList) { if (laptop.rating > 20) { System.out.println(laptop.name + " is rated " + laptop.rating); } } } }
[ "wojtarowicz.pawel@gmail.com" ]
wojtarowicz.pawel@gmail.com
4141ba4f0430585676f7a62e14444569d4de8eac
489be79110d0844e23bc18c2a8aadfc12dfce55f
/src/HW1/Athlets/Cat.java
d4faa4bb25cc52e70f28894eaf69e7854be19bac
[]
no_license
yeliseyL/JavaCoreAdvancedHW
705c9a852c50789bf4dca4a6ebb240f6f8cc417a
3f14b11fb4f3c6844e9b750c6d3fb66a5c539cfb
refs/heads/master
2022-11-15T22:33:40.149033
2020-07-09T21:41:43
2020-07-09T21:41:43
272,532,015
0
0
null
2020-07-09T21:50:35
2020-06-15T19:59:40
Java
UTF-8
Java
false
false
125
java
package HW1.Athlets; public class Cat extends Athlete { public Cat(String name) { super(name, 100, 2); } }
[ "crimsonorama@gmail.com" ]
crimsonorama@gmail.com
610d698a3c3dd4287be37a86f48e27339b697deb
ea941062a11bdf76e41efb2657f2d65a9811ce7b
/src/dev/java/org/jplate/foundation/source/SourceFactoryIfc.java
3c39eed4ddf81d9513422aca43e31fa29c66c94b
[]
no_license
FlossWare-Archives/jplate
c5aa738fbe01cbb745145d3ac0923db48bc3cdad
6af84c0499447efd594d2604c932bc8639494477
refs/heads/master
2022-01-14T08:48:33.045565
2019-07-10T20:23:10
2019-07-10T20:23:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,276
java
package org.jplate.foundation.source; import java.io.Serializable; /** Defines the API for creating implementations of SourceIfc. For an example implementation and usage, please refer to {@link org.jplate.foundation.source.impl.defaults.DefaultSourceFactory}. <p/> <pre> Modifications: $Date: 2008-12-02 12:32:45 -0500 (Tue, 02 Dec 2008) $ $Revision: 479 $ $Author: sfloess $ $HeadURL: https://jplate.svn.sourceforge.net/svnroot/jplate/trunk/src/dev/java/org/jplate/foundation/source/SourceFactoryIfc.java $ </pre> @param <S> The real "source" (for instance, file, URL, etc). @see org.jplate.foundation.source.impl.defaults.DefaultSourceFactory */ public interface SourceFactoryIfc <S> extends Serializable { // ---------------------------------------------------------------------- // // Interface definitions follow... // // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // // Static class definitions follow... // // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // // Static member definitions follow... // // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // // Instance class definitions follow... // // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // // Instance method definitions follow... // // ---------------------------------------------------------------------- /** * * Create and return a source. * * @param source The "real" source from which something exists (for instance a * file). * * @param line The line number in <code>source</code>. * * @param column The column number in <code>source.</code> * * @return A source. * */ public SourceIfc <S> createSource ( S source, int line, int column ); }
[ "sfloess@nc.rr.com" ]
sfloess@nc.rr.com
f704fe26127d98dacd230db784cbf64d4b9a403d
0a38129b452242804f49df3c478a2acbf824fb73
/BasektExample1/src/main/java/basketdemo1/services/PaymentServiceInterface.java
567aad62eef1dd073fd7286531caa49fb0596064
[]
no_license
arheinao/Basket
21d7752f7dcaa3dd6add36beb4920cbfb09eed5a
00d0be5de050185a12f18b4018bf5b761e4f49a1
refs/heads/master
2023-05-14T00:30:04.917570
2021-05-30T13:12:47
2021-05-30T13:12:47
372,092,677
0
0
null
null
null
null
UTF-8
Java
false
false
247
java
package basketdemo1.services; import java.math.BigDecimal; import basketdemo1.entities.PaymentDetails; public interface PaymentServiceInterface { public Long pay(PaymentDetails paymentDetails, Long basketId, BigDecimal totalPrice); }
[ "mkelava@hotmail.com" ]
mkelava@hotmail.com
ccf95d23ff54a609ad569c10514282c3fec967c8
e42a877655ed39b4631bf0de0ecf077eb6dee849
/src/main/java/com/boot/template/framework/exception/Template404NotFoundException.java
d6d8e983be7fd8b9034a62cd0dc68b585163e570
[]
no_license
AndrewJEON/boot-spring-template
cd317f0f1288a79645643b89c889f74e02be316f
5d9668b0f156db2d88edbe5c384ab01e938fc632
refs/heads/master
2020-04-10T15:28:20.946739
2018-08-06T09:03:51
2018-08-06T09:03:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,270
java
package com.boot.template.framework.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(code = HttpStatus.NOT_FOUND) public class Template404NotFoundException extends TemplateApiException { private static final long serialVersionUID = -6188871656643410832L; public Template404NotFoundException(String errorCode, String message, String debugMessage, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(HttpStatus.NOT_FOUND, errorCode, message, debugMessage, cause, enableSuppression, writableStackTrace); } public Template404NotFoundException(String errorCode, String message, String debugMessage, Throwable cause) { super(HttpStatus.NOT_FOUND, errorCode, message, debugMessage, cause); } public Template404NotFoundException(String errorCode, String message, String debugMessage) { super(HttpStatus.NOT_FOUND, errorCode, message, debugMessage); } public Template404NotFoundException(String errorCode, Throwable cause) { super(HttpStatus.NOT_FOUND, errorCode, cause); } public Template404NotFoundException(String errorCode) { super(HttpStatus.NOT_FOUND, errorCode); } }
[ "hashmap27@gmail.com" ]
hashmap27@gmail.com
b4eb7fc7147329d303abccfa05e320bbdaa0f2af
60d6ee574fdb530e08723906cbad9b914cfb3ef0
/app/src/main/java/wallet/bitcoin/bitcoinwallet/auth/facebook/FacebookUser.java
0999eb0a4395c4dd03b61bc8ed9003d247a0398e
[]
no_license
Jtl12/BitcoinWallet
3cf2459d72eaeca8d44aedd89c6ea9acf4ae3798
64af3a8bac5a4c33a9185b49f14cf8fee998e641
refs/heads/master
2023-04-26T12:51:40.783261
2018-06-06T14:29:29
2018-06-06T14:29:29
138,178,938
1
0
null
2022-04-06T01:06:37
2018-06-21T14:10:20
Java
UTF-8
Java
false
false
448
java
package wallet.bitcoin.bitcoinwallet.auth.facebook; import org.json.JSONObject; public class FacebookUser { public String name; public String email; public String facebookID; public String gender; public String about; public String bio; public String coverPicUrl; public String profilePic; /** * JSON response received. If you want to parse more fields. */ public JSONObject response; }
[ "wallet-devs@gmail.com" ]
wallet-devs@gmail.com
e65c732a8f8827a46b2f3c4d0d813109f4f131f8
26913a1b465df00cc0b8ef18ca8d66cadff3ced5
/src/tests/HFTest.java
0a8ec83551928f2abfbc26bce7070bacdeeb5e89
[]
no_license
oattia/MiniBase-Java
cb95e28a9d78698251dd998f08b4d1256048eb89
9bc3308e0d5766da9852055124e1add45804a36f
refs/heads/master
2021-05-28T05:56:27.714187
2014-09-24T22:27:13
2014-09-24T22:27:13
24,434,894
0
1
null
null
null
null
UTF-8
Java
false
false
21,104
java
package tests; import java.io.*; import bufmgr.BufMgr; import heap.*; import global.*; import chainexception.*; /** * Note that in JAVA, methods can't be overridden to be more private. Therefore, * the declaration of all private functions are now declared protected as * opposed to the private type in C++. */ class HFDriver extends HFTestDriver implements GlobalConst { private final static boolean OK = true; private final static boolean FAIL = false; private int choice; private final static int reclen = 32; private BufMgr bm; public HFDriver() { super("hptest"); // choice = 100; // big enough for file to occupy > 1 data page // choice = 2000; // big enough for file to occupy > 1 directory page choice = 5; } public boolean runTests() { System.out .println("\n" + "Running " + testName() + " tests...." + "\n"); SystemDefs sysdef = new SystemDefs(dbpath, 100, 100, "Clock"); bm = SystemDefs.JavabaseBM; // Kill anything that might be hanging around String newdbpath; String newlogpath; String remove_logcmd; String remove_dbcmd; // String remove_cmd = "/bin/rm -rf "; String remove_cmd = "cmd /k del"; newdbpath = dbpath; newlogpath = logpath; remove_logcmd = remove_cmd + logpath; remove_dbcmd = remove_cmd + dbpath; // Commands here is very machine dependent. We assume // user are on UNIX system here try { Runtime.getRuntime().exec(remove_logcmd); Runtime.getRuntime().exec(remove_dbcmd); } catch (IOException e) { System.err.println("IO error: " + e); } remove_logcmd = remove_cmd + newlogpath; remove_dbcmd = remove_cmd + newdbpath; try { Runtime.getRuntime().exec(remove_logcmd); Runtime.getRuntime().exec(remove_dbcmd); } catch (IOException e) { System.err.println("IO error: " + e); } // Run the tests. Return type different from C++ boolean _pass = runAllTests(); // Clean up again try { Runtime.getRuntime().exec(remove_logcmd); Runtime.getRuntime().exec(remove_dbcmd); } catch (IOException e) { System.err.println("IO error: " + e); } System.out.print("\n" + " ... " + testName() + " tests "); System.out.print(_pass == OK ? "completely successfully" : "failed"); System.out.print(".\n\n"); return _pass; } protected boolean test1() { System.out.println("\n Test 1: Insert and scan fixed-size records\n"); boolean status = OK; RID rid = new RID(); Heapfile f = null; System.out.println(" - Create a heap file\n"); try { f = new Heapfile("file_1"); } catch (Exception e) { status = FAIL; System.err.println("*** Could not create heap file\n"); e.printStackTrace(); } if (status == OK && SystemDefs.JavabaseBM.getNumUnpinnedBuffers() != SystemDefs.JavabaseBM .getNumBuffers()) { System.err.println("*** The heap file has left pages pinned\n"); status = FAIL; } if (status == OK) { System.out.println(" - Add " + choice + " records to the file\n"); for (int i = 0; (i < choice) && (status == OK); i++) { // fixed length record DummyRecord rec = new DummyRecord(reclen); rec.ival = i; rec.fval = (float) (i * 2.5); rec.name = "record" + i; try { rid = f.insertRecord(rec.toByteArray()); } catch (Exception e) { status = FAIL; System.err .println("*** Error inserting record " + i + "\n"); e.printStackTrace(); } if (status == OK && SystemDefs.JavabaseBM.getNumUnpinnedBuffers() != SystemDefs.JavabaseBM .getNumBuffers()) { System.err.println("*** Insertion left a page pinned\n"); status = FAIL; } } try { if (f.getRecCnt() != choice) { status = FAIL; System.err.println("*** File reports " + f.getRecCnt() + " records, not " + choice + "\n"); } } catch (Exception e) { status = FAIL; System.out.println("" + e); e.printStackTrace(); } } // In general, a sequential scan won't be in the same order as the // insertions. However, we're inserting fixed-length records here, and // in this case the scan must return the insertion order. Scan scan = null; if (status == OK) { System.out.println(" - Scan the records just inserted\n"); try { scan = f.openScan(); } catch (Exception e) { status = FAIL; System.err.println("*** Error opening scan\n"); e.printStackTrace(); } if (status == OK && SystemDefs.JavabaseBM.getNumUnpinnedBuffers() == SystemDefs.JavabaseBM .getNumBuffers()) { System.err .println("*** The heap-file scan has not pinned the first page\n"); status = FAIL; } } if (status == OK) { int len, i = 0; DummyRecord rec = null; Tuple tuple = new Tuple(); boolean done = false; while (!done) { try { tuple = scan.getNext(rid); if (tuple == null) { done = true; break; } } catch (Exception e) { status = FAIL; e.printStackTrace(); } if (status == OK && !done) { try { rec = new DummyRecord(tuple); } catch (Exception e) { System.err.println("" + e); e.printStackTrace(); } len = tuple.getLength(); if (len != reclen) { System.err.println("*** Record " + i + " had unexpected length " + len + "\n"); status = FAIL; break; } else if (SystemDefs.JavabaseBM.getNumUnpinnedBuffers() == SystemDefs.JavabaseBM .getNumBuffers()) { System.err.println("On record " + i + ":\n"); System.err .println("*** The heap-file scan has not left its " + "page pinned\n"); status = FAIL; break; } String name = ("record" + i); if ((rec.ival != i) || (rec.fval != (float) i * 2.5) || (!name.equals(rec.name))) { System.err.println("*** Record " + i + " differs from what we inserted\n"); System.err.println("rec.ival: " + rec.ival + " should be " + i + "\n"); System.err.println("rec.fval: " + rec.fval + " should be " + (i * 2.5) + "\n"); System.err.println("rec.name: " + rec.name + " should be " + name + "\n"); status = FAIL; break; } } ++i; } // If it gets here, then the scan should be completed if (status == OK) { if (SystemDefs.JavabaseBM.getNumUnpinnedBuffers() != SystemDefs.JavabaseBM .getNumBuffers()) { System.err .println("*** The heap-file scan has not unpinned " + "its page after finishing\n"); status = FAIL; } else if (i != (choice)) { status = FAIL; System.err.println("*** Scanned " + i + " records instead of " + choice + "\n"); } } } if (status == OK) System.out.println(" Test 1 completed successfully.\n"); return status; } protected boolean test2() { System.out.println("\n Test 2: Delete fixed-size records\n"); boolean status = OK; Scan scan = null; RID rid = new RID(); Heapfile f = null; System.out.println(" - Open the same heap file as test 1\n"); try { f = new Heapfile("file_1"); } catch (Exception e) { status = FAIL; System.err.println(" Could not open heapfile"); e.printStackTrace(); } if (status == OK) { System.out.println(" - Delete half the records\n"); try { scan = f.openScan(); } catch (Exception e) { status = FAIL; System.err.println("*** Error opening scan\n"); e.printStackTrace(); } } if (status == OK) { int i = 0; Tuple tuple = new Tuple(); boolean done = false; while (!done) { try { tuple = scan.getNext(rid); if (tuple == null) { done = true; } } catch (Exception e) { status = FAIL; e.printStackTrace(); } if (!done && status == OK) { boolean odd = true; if (i % 2 == 1) odd = true; if (i % 2 == 0) odd = false; if (odd) { // Delete the odd-numbered ones. try { status = f.deleteRecord(rid); } catch (Exception e) { status = FAIL; System.err.println("*** Error deleting record " + i + "\n"); e.printStackTrace(); break; } } } ++i; } } scan.closescan(); // destruct scan!!!!!!!!!!!!!!! scan = null; if (status == OK && SystemDefs.JavabaseBM.getNumUnpinnedBuffers() != SystemDefs.JavabaseBM .getNumBuffers()) { System.out.println("\nt2: in if: Number of unpinned buffers: " + SystemDefs.JavabaseBM.getNumUnpinnedBuffers() + "\n"); System.err.println("t2: in if: getNumbfrs: " + SystemDefs.JavabaseBM.getNumBuffers() + "\n"); System.err.println("*** Deletion left a page pinned\n"); status = FAIL; } if (status == OK) { System.out.println(" - Scan the remaining records\n"); try { scan = f.openScan(); } catch (Exception e) { status = FAIL; System.err.println("*** Error opening scan\n"); e.printStackTrace(); } } if (status == OK) { int i = 0; DummyRecord rec = null; Tuple tuple = new Tuple(); boolean done = false; while (!done) { try { tuple = scan.getNext(rid); if (tuple == null) { done = true; } } catch (Exception e) { status = FAIL; e.printStackTrace(); } if (!done && status == OK) { try { rec = new DummyRecord(tuple); } catch (Exception e) { System.err.println("" + e); e.printStackTrace(); } if ((rec.ival != i) || (rec.fval != (float) i * 2.5)) { System.err.println("*** Record " + i + " differs from what we inserted\n"); System.err.println("rec.ival: " + rec.ival + " should be " + i + "\n"); System.err.println("rec.fval: " + rec.fval + " should be " + (i * 2.5) + "\n"); status = FAIL; break; } i += 2; // Because we deleted the odd ones... } } } if (status == OK) System.out.println(" Test 2 completed successfully.\n"); return status; } protected boolean test3() { System.out.println("\n Test 3: Update fixed-size records\n"); boolean status = OK; Scan scan = null; RID rid = new RID(); Heapfile f = null; System.out.println(" - Open the same heap file as tests 1 and 2\n"); try { f = new Heapfile("file_1"); } catch (Exception e) { status = FAIL; System.err.println("*** Could not create heap file\n"); e.printStackTrace(); } if (status == OK) { System.out.println(" - Change the records\n"); try { scan = f.openScan(); } catch (Exception e) { status = FAIL; System.err.println("*** Error opening scan\n"); e.printStackTrace(); } } if (status == OK) { int i = 0; DummyRecord rec = null; Tuple tuple = new Tuple(); boolean done = false; while (!done) { try { tuple = scan.getNext(rid); if (tuple == null) { done = true; } } catch (Exception e) { status = FAIL; e.printStackTrace(); } if (!done && status == OK) { try { rec = new DummyRecord(tuple); } catch (Exception e) { System.err.println("" + e); e.printStackTrace(); } rec.fval = (float) 7 * i; // We'll check that i==rec.ival // below. Tuple newTuple = null; try { newTuple = new Tuple(rec.toByteArray(), 0, rec.getRecLength()); } catch (Exception e) { status = FAIL; System.err.println("" + e); e.printStackTrace(); } try { status = f.updateRecord(rid, newTuple); } catch (Exception e) { status = FAIL; e.printStackTrace(); } if (status != OK) { System.err.println("*** Error updating record " + i + "\n"); break; } i += 2; // Recall, we deleted every other record above. } } } scan = null; if (status == OK && SystemDefs.JavabaseBM.getNumUnpinnedBuffers() != SystemDefs.JavabaseBM .getNumBuffers()) { System.out.println("t3, Number of unpinned buffers: " + SystemDefs.JavabaseBM.getNumUnpinnedBuffers() + "\n"); System.err.println("t3, getNumbfrs: " + SystemDefs.JavabaseBM.getNumBuffers() + "\n"); System.err.println("*** Updating left pages pinned\n"); status = FAIL; } if (status == OK) { System.out.println(" - Check that the updates are really there\n"); try { scan = f.openScan(); } catch (Exception e) { status = FAIL; e.printStackTrace(); } if (status == FAIL) { System.err.println("*** Error opening scan\n"); } } if (status == OK) { int i = 0; DummyRecord rec = null; DummyRecord rec2 = null; Tuple tuple = new Tuple(); Tuple tuple2 = new Tuple(); boolean done = false; while (!done) { try { tuple = scan.getNext(rid); if (tuple == null) { done = true; break; } } catch (Exception e) { status = FAIL; e.printStackTrace(); } if (!done && status == OK) { try { rec = new DummyRecord(tuple); } catch (Exception e) { System.err.println("" + e); } // While we're at it, test the getRecord method too. try { tuple2 = f.getRecord(rid); } catch (Exception e) { status = FAIL; System.err.println("*** Error getting record " + i + "\n"); e.printStackTrace(); break; } try { rec2 = new DummyRecord(tuple2); } catch (Exception e) { System.err.println("" + e); e.printStackTrace(); } if ((rec.ival != i) || (rec.fval != (float) i * 7) || (rec2.ival != i) || (rec2.fval != i * 7)) { System.err.println("*** Record " + i + " differs from our update\n"); System.err.println("rec.ival: " + rec.ival + " should be " + i + "\n"); System.err.println("rec.fval: " + rec.fval + " should be " + (i * 7.0) + "\n"); status = FAIL; break; } } i += 2; // Because we deleted the odd ones... } } if (status == OK) System.out.println(" Test 3 completed successfully.\n"); return status; } // deal with variable size records. it's probably easier to re-write // one instead of using the ones from C++ protected boolean test5() { return true; } protected boolean test4() { System.out.println("\n Test 4: Test some error conditions\n"); boolean status = OK; Scan scan = null; RID rid = new RID(); Heapfile f = null; try { f = new Heapfile("file_1"); } catch (Exception e) { status = FAIL; System.err.println("*** Could not create heap file\n"); e.printStackTrace(); } if (status == OK) { System.out.println(" - Try to change the size of a record\n"); try { scan = f.openScan(); } catch (Exception e) { status = FAIL; System.err.println("*** Error opening scan\n"); e.printStackTrace(); } } // The following is to test whether tinkering with the size of // the tuples will cause any problem. if (status == OK) { int len; DummyRecord rec = null; Tuple tuple = new Tuple(); try { tuple = scan.getNext(rid); if (tuple == null) { status = FAIL; } } catch (Exception e) { status = FAIL; e.printStackTrace(); } if (status == FAIL) { System.err.println("*** Error reading first record\n"); } if (status == OK) { try { rec = new DummyRecord(tuple); } catch (Exception e) { System.err.println("" + e); status = FAIL; } len = tuple.getLength(); Tuple newTuple = null; try { newTuple = new Tuple(rec.toByteArray(), 0, len - 1); } catch (Exception e) { System.err.println("" + e); e.printStackTrace(); } try { status = f.updateRecord(rid, newTuple); } catch (ChainException e) { status = checkException(e, "heap.InvalidUpdateException"); if (status == FAIL) { System.err.println("**** Shortening a record"); System.out.println(" --> Failed as expected \n"); } } catch (Exception e) { e.printStackTrace(); } if (status == OK) { status = FAIL; System.err .println("######The expected exception was not thrown\n"); } else { status = OK; } } if (status == OK) { try { rec = new DummyRecord(tuple); } catch (Exception e) { System.err.println("" + e); e.printStackTrace(); } len = tuple.getLength(); Tuple newTuple = null; try { newTuple = new Tuple(rec.toByteArray(), 0, len + 1); } catch (Exception e) { System.err.println("" + e); e.printStackTrace(); } try { status = f.updateRecord(rid, newTuple); } catch (ChainException e) { status = checkException(e, "heap.InvalidUpdateException"); if (status == FAIL) { System.err.println("**** Lengthening a record"); System.out.println(" --> Failed as expected \n"); } } catch (Exception e) { e.printStackTrace(); } if (status == OK) { status = FAIL; System.err .println("The expected exception was not thrown\n"); } else { status = OK; } } } scan = null; if (status == OK) { System.out.println(" - Try to insert a record that's too long\n"); byte[] record = new byte[MINIBASE_PAGESIZE + 4]; try { rid = f.insertRecord(record); } catch (ChainException e) { status = checkException(e, "heap.SpaceNotAvailableException"); if (status == FAIL) { System.err.println("**** Inserting a too-long record"); System.out.println(" --> Failed as expected \n"); } } catch (Exception e) { e.printStackTrace(); } if (status == OK) { status = FAIL; System.err.println("The expected exception was not thrown\n"); } else { status = OK; } } if (status == OK) System.out.println(" Test 4 completed successfully.\n"); return (status == OK); } protected boolean test6() { return true; } protected boolean runAllTests() { boolean _passAll = OK; if (!test1()) { _passAll = FAIL; } if (!test2()) { _passAll = FAIL; } if (!test3()) { _passAll = FAIL; } if (!test4()) { _passAll = FAIL; } if (!test5()) { _passAll = FAIL; } if (!test6()) { _passAll = FAIL; } return _passAll; } protected String testName() { return "Heap File"; } } // This is added to substitute the struct construct in C++ class DummyRecord { // content of the record public int ival; public float fval; public String name; // length under control private int reclen; private byte[] data; /** * Default constructor */ public DummyRecord() { } /** * another constructor */ public DummyRecord(int _reclen) { setRecLen(_reclen); data = new byte[_reclen]; } /** * constructor: convert a byte array to DummyRecord object. * * @param arecord * a byte array which represents the DummyRecord object */ public DummyRecord(byte[] arecord) throws java.io.IOException { setIntRec(arecord); setFloRec(arecord); setStrRec(arecord); data = arecord; setRecLen(name.length()); } /** * constructor: translate a tuple to a DummyRecord object it will make a * copy of the data in the tuple * * @param atuple * : the input tuple */ public DummyRecord(Tuple _atuple) throws java.io.IOException { data = new byte[_atuple.getLength()]; data = _atuple.getTupleByteArray(); setRecLen(_atuple.getLength()); setIntRec(data); setFloRec(data); setStrRec(data); } /** * convert this class objcet to a byte array this is used when you want to * write this object to a byte array */ public byte[] toByteArray() throws java.io.IOException { // data = new byte[reclen]; Convert.setIntValue(ival, 0, data); Convert.setFloValue(fval, 4, data); Convert.setStrValue(name, 8, data); return data; } /** * get the integer value out of the byte array and set it to the int value * of the DummyRecord object */ public void setIntRec(byte[] _data) throws java.io.IOException { ival = Convert.getIntValue(0, _data); } /** * get the float value out of the byte array and set it to the float value * of the DummyRecord object */ public void setFloRec(byte[] _data) throws java.io.IOException { fval = Convert.getFloValue(4, _data); } /** * get the String value out of the byte array and set it to the float value * of the HTDummyRecorHT object */ public void setStrRec(byte[] _data) throws java.io.IOException { // System.out.println("reclne= "+reclen); // System.out.println("data size "+_data.size()); name = Convert.getStrValue(8, _data, reclen - 8); } // Other access methods to the size of the String field and // the size of the record public void setRecLen(int size) { reclen = size; } public int getRecLength() { return reclen; } } public class HFTest { public static void main(String argv[]) { HFDriver hd = new HFDriver(); boolean dbstatus; dbstatus = hd.runTests(); if (dbstatus != true) { System.err.println("Error encountered during HeapFile tests\n"); Runtime.getRuntime().exit(1); } Runtime.getRuntime().exit(0); } }
[ "oy.attia@gmail.com" ]
oy.attia@gmail.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
8f8b4c6fcf20b6c460adfe51515754544493e957
1a6d4308a3a71ad153346cd74854330080e770d9
/003_FloatAndDouble/src/Main.java
e04891964805b23b88dbb4182cc35e88c3df95bb
[]
no_license
pkro/Java-Masterclass
65ba6aeac045697cf192c3d00c57c9536b705bd1
02f3e4cc83b0e6e1fdeb19a77b86d1ee4cb0d68b
refs/heads/main
2023-08-04T07:45:41.930397
2021-09-17T14:54:17
2021-09-17T14:54:17
338,786,247
0
0
null
null
null
null
UTF-8
Java
false
false
1,002
java
public class Main { public static void main(String[] args) { float floatMax = Float.MAX_VALUE; float floatMin = Float.MIN_VALUE; double doubleMax = Double.MAX_VALUE; double doubleMin = Double.MIN_VALUE; System.out.println("float min: " + floatMin); System.out.println("float max: " + floatMax); System.out.println("double min: " + doubleMin); System.out.println("double max: " + doubleMax); int myInt = 5; float myFloat = 5; double myDouble = 5; // myFloat = 5.3; // error as 5.3 is interpreted as double (default data type // for fp numbers) myFloat = 5.3f; // ok myFloat = (float) 5.3; // ok myFloat = 5; myDouble = 5.3; // ok myDouble = 5.3d; // good for documentation myInt = 5 / 3; // 1 myFloat = 5f / 3; // 1.6666666 myDouble = 5d / 3; // 1.6666666666666667 System.out.println("myInt: " + myInt); System.out.println("myFloat: " + myFloat); System.out.println("myDouble: " + myDouble); } }
[ "pkrombach@web.de" ]
pkrombach@web.de
add0001d4ab8a2e5596a0c4f591c1f20e9859248
9d5a985a408569021a07e018eb2393a6dcdd8815
/zzg-springboot-nettyrpc-druidsevlet/src/main/java/com/springboot/nettyrpc/ZzgSpringbootNettyrpcApplication.java
fc71ec612454a80b24aa83902f6f2b8064815a29
[]
no_license
qingjianmoxie/springboot-zzg-netttrpc
d53bad2c9e17fac6b3deb77b7f328f5eb8259a88
9357ae656ad369da18059871b0ed4fa5a1f13bd3
refs/heads/master
2020-04-02T09:20:26.131033
2018-10-23T08:13:04
2018-10-23T08:13:04
154,288,256
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
package com.springboot.nettyrpc; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.transaction.annotation.EnableTransactionManagement; @SpringBootApplication @EnableTransactionManagement @MapperScan(basePackages = "com.springboot.nettyrpc.dao.mapper") @ServletComponentScan //像这样http://127.0.0.1:8084/druid/index.html访问druid的监控平台 public class ZzgSpringbootNettyrpcApplication { public static void main(String[] args) { SpringApplication.run(ZzgSpringbootNettyrpcApplication.class, args); } }
[ "814939649@qq.com" ]
814939649@qq.com
d2baa7c39e14a48f0e107b89eedeb1c222000e97
b82cd8095f0b4f95af6fc6fbdb8c072f454f1a4e
/src/main/java/com/example/demo/model/CheckLogin.java
05bd23b5cc97ca22ae480c1f6fa7afd3d6417dbd
[]
no_license
hailita1/ThucTapChuyenMon_BackEnd
973ea014d2e2465cac7489dc27ac11bbe824caca
fe396bf4b6599edcb5072ffb01141af4ad9222b1
refs/heads/master
2022-11-12T02:20:53.379313
2020-07-08T14:53:42
2020-07-08T14:53:42
277,985,128
0
0
null
null
null
null
UTF-8
Java
false
false
276
java
package com.example.demo.model; import lombok.Data; import javax.persistence.*; @Data @Entity public class CheckLogin { @Id @GeneratedValue( strategy = GenerationType.AUTO) private Long id; @Column(nullable = false) private Boolean checkLogin = true; }
[ "hailit2306@gmail.com" ]
hailit2306@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
56fa95554e2ec0d95b2a48fc7f70c9c16158d0ec
1ac6cf6638ecf5224341ab34196bb3dcd9c5ed12
/danya-homerask-27-09-21/2-find-numbers-with-even-number-of-digits.java
23216d073c5d427cb7e92c6b3501a6a714d969a7
[]
no_license
ozgreat/leetcode-sandbox
f3fd1443bd9edc471e915988a2dc6855fbd45079
de9fda74e7557e699a74ff63b7a4f97143b3eb59
refs/heads/main
2023-08-19T09:42:10.547596
2021-10-17T20:02:13
2021-10-17T20:02:13
410,247,148
0
0
null
2021-09-25T10:51:25
2021-09-25T10:51:25
null
UTF-8
Java
false
false
375
java
class Solution { public int findNumbers(int[] nums) { int even = 0; for(int i: nums) { int digits = 0; do { digits++; i /= 10; } while (i != 0); if (digits % 2 == 0){ even++; } } return even; } }
[ "ozgreat@ukr.net" ]
ozgreat@ukr.net
c36199af89df0dce919af00007456e541e961791
bc97f1d7a5d5b37fc785077a2f47b81f815025fe
/Hibernate/Hibernate annotations/src/p2/Account.java
2b1e5784219a307a632b58771d0510a70357c14b
[]
no_license
ramkurapati/javapracticles
3cd3494e75bb8ecbf02b6f12aee9185c52f098e6
a4988217d9c3a5baac02a28ead5036662bb661c6
refs/heads/master
2021-01-23T04:19:45.507721
2017-06-10T13:49:10
2017-06-10T13:50:16
92,924,434
0
0
null
null
null
null
UTF-8
Java
false
false
704
java
package p2; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @Entity(name="AccountInfo") public class Account { @Id @Column(name="accnum") private long accNum; public long getAccNum() { return accNum; } public void setAccNum(long accNum) { this.accNum = accNum; } @Column(name="acctype") private String accType; public String getAccType() { return accType; } public void setAccType(String accType) { this.accType = accType; } @Column(name="accBalance") private float accBalance; public float getAccBalance() { return accBalance; } public void setAccBalance(float accBalance) { this.accBalance = accBalance; } }
[ "rnaidu@nextgen.com" ]
rnaidu@nextgen.com
53f5b7b536b6959b6f1a9c0ed05dd5f5fea3be54
f743af89e5851c3732d19466fc6bf39c6233ee5f
/app/src/main/java/com/example/tourguide/API/NewsAPI.java
8f5404cf21eb08ac6dd808cb113a75d043b76d03
[]
no_license
pradipdkl/TourGuide
d23dc4196417c579d39f4507f64d425e4cce6f07
9c369fb4a19476ec8d5889108ca761e8cabf5666
refs/heads/master
2023-02-15T13:25:46.053932
2021-01-15T14:34:27
2021-01-15T14:34:27
325,730,873
0
0
null
null
null
null
UTF-8
Java
false
false
234
java
package com.example.tourguide.API; import com.example.tourguide.model.Response.JSONResponse; import retrofit2.Call; import retrofit2.http.GET; public interface NewsAPI { @GET("sources.json") Call<JSONResponse> getNews(); }
[ "pradipdkl46@gmail.com" ]
pradipdkl46@gmail.com
42de3a4ae1fcca08d9f39fe76a746dc50651d20b
4cef62e15dc9073232d8c41e0c29bb3934102a43
/src/main/java/simplon/sn/stock/service/impl/MagasinServiceImpl.java
10bf2caa067f73d1893e2c887932c1ba8bf92e77
[]
no_license
fadeldiouf/gestion_stock
2eb93f5e97a1b81078ddd362df9a306c40a1cf4c
9e9df1dbc2a80910310f551068196f898485eb72
refs/heads/main
2023-07-29T13:12:21.016402
2021-09-13T20:41:24
2021-09-13T20:41:24
399,616,289
0
0
null
null
null
null
UTF-8
Java
false
false
1,377
java
package simplon.sn.stock.service.impl; import java.util.List; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import simplon.sn.stock.dao.GerantRepository; import simplon.sn.stock.dao.MagasinRepository; import simplon.sn.stock.entites.Gerant; import simplon.sn.stock.entites.Magasin; import simplon.sn.stock.service.MagasinService; @Service public class MagasinServiceImpl implements MagasinService { @Autowired private MagasinRepository magasinRepository; @Autowired private GerantRepository gerantRepository; @Override public List<Magasin> findMagasins() { // TODO Auto-generated method stub return magasinRepository.findAll(); } @Override public Magasin create(Magasin m) { // TODO Auto-generated method stub return magasinRepository.save(m); } @Override public Boolean update(Long id,Magasin m) { // TODO Auto-generated method stub Boolean updated=true; Optional<Magasin> magasin= magasinRepository.findById(m.getId()); if(magasin.isPresent()) { magasinRepository.save(m); return updated; } return false; } @Override public Optional<Magasin> findById(Long id) { // TODO Auto-generated method stub Optional<Magasin> magasin= magasinRepository.findById(id); if(magasin.isPresent()) { return magasin; } return null; } }
[ "diouffadel406@gmail.com" ]
diouffadel406@gmail.com
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
f26b797225d3f609a4a56bcd78f2d89851b7db0e
1f2693e57a8f6300993aee9caa847d576f009431
/myfaces-csi/work/myfaces-skins/skins-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/parse/SkinNodeParser.java
8d2e9a65f9be93b1184cfd93901217b20dd6af23
[]
no_license
mr-sobol/myfaces-csi
ad80ed1daadab75d449ef9990a461d9c06d8c731
c142b20012dda9c096e1384a46915171bf504eb8
refs/heads/master
2021-01-10T06:11:13.345702
2009-01-05T09:46:26
2009-01-05T09:46:26
43,557,323
0
0
null
null
null
null
UTF-8
Java
false
false
4,735
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.myfaces.trinidadinternal.skin.parse; import org.apache.myfaces.trinidadinternal.share.xml.BaseNodeParser; import org.apache.myfaces.trinidadinternal.share.xml.NodeParser; import org.apache.myfaces.trinidadinternal.share.xml.ParseContext; import org.apache.myfaces.trinidadinternal.share.xml.StringParser; import org.xml.sax.Attributes; import org.xml.sax.SAXParseException; /** * NodeParser for &lt;skin&gt; node in trinidad-skins.xml * * @version $Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/ui/laf/xml/parse/SkinExtensionParser.java#0 $) $Date: 10-nov-2005.18:50:44 $ * @todo ELIMINATE NAMESPACE */ public class SkinNodeParser extends BaseNodeParser implements XMLConstants { @Override public void startElement( ParseContext context, String namespaceURI, String localName, Attributes attrs ) throws SAXParseException { _namespace = namespaceURI; } @Override public Object endElement( ParseContext context, String namespaceURI, String localName ) throws SAXParseException { // id and family are required. log a severe error if they are null. // if (_id == null) // _LOG.severe("REQUIRED_ELEMENT_ID_NOT_FOUND"); // if (_family == null) // _LOG.severe("REQURIED_ELEMENT_FAMILY_NOT_FOUND"); if ((_bundleName != null) && (_translationSourceExpression != null)) { // _LOG.severe("BOTH_BUNDLENAME_TRANSLATIONSOURCE_SET"); _translationSourceExpression = null; } if (_translationSourceExpression != null && !(_translationSourceExpression.startsWith("#{") && _translationSourceExpression.endsWith("}"))) { // _LOG.severe("TRANSLATION_SOURCE_NOT_EL"); _translationSourceExpression = null; } return new SkinNode(_id, _family, _renderKitId, _extends, _styleSheetName, _bundleName, _translationSourceExpression); } @Override public NodeParser startChildElement( ParseContext context, String namespaceURI, String localName, Attributes attrs ) throws SAXParseException { if (!namespaceURI.equals(_namespace)) return null; if ("id".equals(localName) || "family".equals(localName) || "render-kit-id".equals(localName) || "style-sheet-name".equals(localName) || "bundle-name".equals(localName) || "translation-source".equals(localName) || "extends".equals(localName)) { return new StringParser(); } return null; } @Override public void addCompletedChild( ParseContext context, String namespaceURI, String localName, Object child ) throws SAXParseException { if ("id".equals(localName)) _id = (String) child; else if ("family".equals(localName)) _family = (String) child; else if ("render-kit-id".equals(localName)) _renderKitId = (String) child; else if ("style-sheet-name".equals(localName)) _styleSheetName = (String) child; else if ("bundle-name".equals(localName)) _bundleName = (String) child; else if ("translation-source".equals(localName)) _translationSourceExpression = (String) child; else if ("extends".equals(localName)) _extends = (String) child; } private String _namespace; private String _id; private String _family; private String _styleSheetName; private String _renderKitId; private String _bundleName; private String _translationSourceExpression; private String _extends; // private static final TrinidadLogger _LOG = // TrinidadLogger.createTrinidadLogger(SkinNodeParser.class); }
[ "paulrivera22@ea1d4837-9632-0410-a0b9-156113df8070" ]
paulrivera22@ea1d4837-9632-0410-a0b9-156113df8070
ba528beef200451a5af47d34e9c205e8e1155104
93f1d4d5a1b9c780f382f74ba988ab90d7d64fa9
/intuit/isMeetingAvailable/CalendarQuery.java
fd791ca1e4d39fca776889363aa689c6dca3cc07
[]
no_license
PEGGY-CAO/LeetCode
377c22e3fd145c2ad3bee3ba0cad732122786878
e52b8851e1d8e6aa2454aa1158f0232e9fdcff3a
refs/heads/master
2022-12-09T13:37:08.050381
2022-11-30T03:30:09
2022-11-30T03:30:09
146,214,507
5
0
null
null
null
null
UTF-8
Java
false
false
911
java
import java.util.*; public class CalendarQuery { public static boolean isAvailable(int[][] meeting, int startTime, int endTime) { for (int i = 0; i < meeting.length; i++) { int existingStartTime = meeting[i][0]; int existingEndTime = meeting[i][1]; if (startTime <= existingStartTime && endTime > existingStartTime) return false; if (startTime < existingEndTime && endTime > existingStartTime) return false; } return true; } public static void main(String[] args) { int[][] meeting = { {800, 900}, {1340, 1600}, {915, 1020} }; System.out.println(isAvailable(meeting, 915, 950));//expect false System.out.println(isAvailable(meeting, 1020, 1150));//expect true System.out.println(isAvailable(meeting, 820, 850));//expect false } }
[ "yuqi.cao.sjtu@gmail.com" ]
yuqi.cao.sjtu@gmail.com
b2569d7402239b9efdb73229bfde1e1cdb5c25ac
5ed0e7e895831fb39aefaf4aa5cd1316c72fd6af
/src/site/lvkun/leetcode/flipping_an_image/Solution.java
b92f8122dd7b3ece22b2ca57a53218b36387c47f
[]
no_license
lvkun/leetcode
2fe4389f11f31ff634502213e95d53af40a372b2
aaeb0a1d33ce3b5b15a3c934c9bc96baa005586d
refs/heads/master
2020-07-09T09:06:47.362353
2019-04-15T15:28:51
2019-04-15T15:28:51
21,848,508
0
0
null
null
null
null
UTF-8
Java
false
false
78
java
package site.lvkun.leetcode.flipping_an_image; public class Solution { }
[ "lvkun@outlook.com" ]
lvkun@outlook.com
0c471fd150e5e866491a66a67338b83ff97fa110
5a1af86726449e8acf21bdf7f550c7311baa4b8b
/src/main/java/com/db/sys/entity/BaseEntity.java
2675922672d6132c7043a24d67a628e19afb58a6
[]
no_license
rickchen1014tw/CGB-DB-SYS-V3.03
c77508b5fc0a801c9cdfd0bdc5776735d22b4e39
222509fe987f5d2f92001f2a716f328d3544b0d8
refs/heads/master
2022-11-26T13:36:31.991756
2020-08-15T02:14:01
2020-08-15T02:14:01
286,976,471
0
0
null
null
null
null
UTF-8
Java
false
false
945
java
package com.db.sys.entity; import java.io.Serializable; import java.util.Date; public class BaseEntity implements Serializable { private static final long serialVersionUID = 6052101108571661841L; /**创建用户*/ private String createdUser; /**修改用户*/ private String modifiedUser; private Date createdTime; private Date modifiedTime; public String getCreatedUser() { return createdUser; } public void setCreatedUser(String createdUser) { this.createdUser = createdUser; } public String getModifiedUser() { return modifiedUser; } public void setModifiedUser(String modifiedUser) { this.modifiedUser = modifiedUser; } public Date getCreatedTime() { return createdTime; } public void setCreatedTime(Date createdTime) { this.createdTime = createdTime; } public Date getModifiedTime() { return modifiedTime; } public void setModifiedTime(Date modifiedTime) { this.modifiedTime = modifiedTime; } }
[ "rickchen1014@gmail.com" ]
rickchen1014@gmail.com
d24ef4ad82f7a55cb389ddffe2f841fcf620a4da
79874ac7ba3ce164ac0b2df6e21c7150b86a9e82
/homework_9/spring-cloud-overview/users/src/main/java/com/epam/springcloud/UsersApplication.java
3754dec06e5bc4a0341a742a998a7561d7a112f6
[]
no_license
akellanotavailable/epam_homeworks
ba6ec2434fafad98901ecdd36747b9baa80444ac
50650dd3732e7f5dac29f1da75e42cd9b4107fb3
refs/heads/main
2023-05-22T01:54:54.476828
2021-06-11T09:40:27
2021-06-11T09:40:27
367,954,858
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package com.epam.springcloud; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableEurekaClient @RibbonClient(name = "orders", configuration = RibbonConfig.class) @EnableCircuitBreaker @EnableFeignClients public class UsersApplication { public static void main(String[] args) { SpringApplication.run(UsersApplication.class, args); } }
[ "havrylchenko.d@gmail.com" ]
havrylchenko.d@gmail.com
d44f32d5f835bd71413c53a7e502f5945ab6c01b
d3c2dd8a80683a97dedf2ac9ae83a71995c1f827
/src/main/java/com/example/saas2020/pojo/SaasCancelStrategyPO.java
e6c2766c373d5941a6f5d45ce7353750ccfe3aba
[]
no_license
haohaodiniyao/saas-2020
09c267eaddc9ee596c6e4f87d4495c33cebc5b67
8e95a489c0a8bfd0bdbef2e14657f652ed87bea3
refs/heads/master
2021-01-16T05:37:52.278137
2020-02-25T14:45:05
2020-02-25T14:45:05
242,994,484
0
0
null
null
null
null
UTF-8
Java
false
false
405
java
package com.example.saas2020.pojo; import lombok.Data; import org.jfaster.mango.annotation.ID; @Data public class SaasCancelStrategyPO { @ID private Long id; private String channelNo; private String name; private String ruleVal; private Integer status; private String createDate; private String updateDate; private String createUser; private String updateUser; }
[ "yaokai@01zhuanche.com" ]
yaokai@01zhuanche.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
de9d2dca7c4438fdf429d5a1a0a3d29f5b51898a
026f1d40c1bf08e712e984eab652d0e13634999c
/GTI410_LAB_03/src/controller/GFilter3x3.java
2c97beebccb1f3a46ada2dc4b4cf21dfcabef4fd
[]
no_license
wizguen/GTI410-LAB03
de421ef21e033fb974e67c08d1634a1377b9368b
687ee5702dc5686915763501af66beff81842df2
refs/heads/master
2021-05-03T08:51:37.274937
2016-11-27T20:53:27
2016-11-27T20:53:27
72,236,661
0
0
null
null
null
null
UTF-8
Java
false
false
3,537
java
package controller; import model.*; public class GFilter3x3 extends Filter { private double filterMatrix[][] = null; /** * Default constructor. * @param paddingStrategy PaddingStrategy used * @param conversionStrategy ImageConversionStrategy used */ public GFilter3x3(PaddingStrategy paddingStrategy, ImageConversionStrategy conversionStrategy) { super(paddingStrategy, conversionStrategy); filterMatrix = new double[3][3]; filterMatrix[0][0] = 0; filterMatrix[1][0] = 0 ; filterMatrix[2][0] = 0; filterMatrix[0][1] = 0; filterMatrix[1][1] = 0; filterMatrix[2][1] = 0; filterMatrix[0][2] = 0; filterMatrix[1][2] = 0; filterMatrix[2][2] = 0; } /** * @param _coordinates * @param _value */ public void updateKernel(Coordinates _coordinates, float _value) { filterMatrix[(_coordinates.getColumn() - 1)][(_coordinates.getRow() - 1)]= _value; } /** * Filters an ImageX and returns a ImageDouble. */ public ImageDouble filterToImageDouble(ImageX image) { return filter(conversionStrategy.convert(image)); } /** * Filters an ImageDouble and returns a ImageDouble. */ public ImageDouble filterToImageDouble(ImageDouble image) { return filter(image); } /** * Filters an ImageX and returns an ImageX. */ public ImageX filterToImageX(ImageX image) { ImageDouble filtered = filter(conversionStrategy.convert(image)); return conversionStrategy.convert(filtered); } /** * Filters an ImageDouble and returns a ImageX. */ public ImageX filterToImageX(ImageDouble image) { ImageDouble filtered = filter(image); return conversionStrategy.convert(filtered); } /* * Filter Implementation */ private ImageDouble filter(ImageDouble image) { int imageWidth = image.getImageWidth(); int imageHeight = image.getImageHeight(); ImageDouble newImage = new ImageDouble(imageWidth, imageHeight); PixelDouble newPixel = null; double result = 0; for (int x = 0; x < imageWidth; x++) { for (int y = 0; y < imageHeight; y++) { newPixel = new PixelDouble(); //******************************* // RED for (int i = 0; i <= 2; i++) { for (int j = 0; j <= 2; j++) { result += filterMatrix[i][j] * getPaddingStrategy().pixelAt(image, x+(i-1), y+(j-1)).getRed(); } } newPixel.setRed(result); result = 0; //******************************* // Green for (int i = 0; i <= 2; i++) { for (int j = 0; j <= 2; j++) { result += filterMatrix[i][j] * getPaddingStrategy().pixelAt(image, x+(i-1), y+(j-1)).getGreen(); } } newPixel.setGreen(result); result = 0; //******************************* // Blue for (int i = 0; i <= 2; i++) { for (int j = 0; j <= 2; j++) { result += filterMatrix[i][j] * getPaddingStrategy().pixelAt(image, x+(i-1), y+(j-1)).getBlue(); } } newPixel.setBlue(result); result = 0; //******************************* // Alpha - Untouched in this filter newPixel.setAlpha(getPaddingStrategy().pixelAt(image, x,y).getAlpha()); //******************************* // Done newImage.setPixel(x, y, newPixel); } } return newImage; } }
[ "wizguen@gmail.com" ]
wizguen@gmail.com
faae271b5be8315519ace33114b3a46ea35f51d2
408b256b3f7def82a68d5241bac4fd1258c96e4c
/src/main/java/andkantor/f1betting/form/PenaltyForm.java
02f9577b1ef888f9c13636802236713446921553
[]
no_license
andkantor/f1-betting
fb5a7800d902d99fcd85e18d81b7ad3da70bea0e
28528efed30ab1fd0ad3b08133d88840fef31e35
refs/heads/master
2021-09-06T23:17:38.019395
2018-02-13T10:54:46
2018-02-13T10:54:46
83,090,732
0
0
null
null
null
null
UTF-8
Java
false
false
567
java
package andkantor.f1betting.form; import andkantor.f1betting.entity.Penalty; import andkantor.f1betting.entity.Race; import java.util.List; public class PenaltyForm { private Race race; private List<Penalty> penalties; public PenaltyForm() { } public Race getRace() { return race; } public void setRace(Race race) { this.race = race; } public List<Penalty> getPenalties() { return penalties; } public void setPenalties(List<Penalty> penalties) { this.penalties = penalties; } }
[ "and.kantor@gmail.com" ]
and.kantor@gmail.com
ec34e1b919e8eb8b5f74f1c26b08a932863b8ec6
a56f3a061b7221568dd8934ea74b005ae26aa84d
/limits-service/src/main/java/com/wipro/microservice/controller/LimitServiceConfigurationController.java
95db59dd47b4d7d27ce267583b5c7cbe8cda5f11
[]
no_license
sivabalansethu/SpringCloud_Microservices
9cf8954c07d223ff2a7ff0dc4577c212cf79adef
42cf5d4b15685bf864ae9c8b5f4a14dece3cff48
refs/heads/master
2022-07-11T03:15:13.834268
2020-05-06T11:14:40
2020-05-06T11:14:40
261,653,294
0
0
null
null
null
null
UTF-8
Java
false
false
1,234
java
package com.wipro.microservice.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import com.wipro.microservice.bean.LimitConfiguration; import com.wipro.microservice.config.Configuration; @RestController @EnableDiscoveryClient public class LimitServiceConfigurationController { @Autowired private Configuration configuration; @GetMapping ("/limits") @HystrixCommand(fallbackMethod="rollbackRetireveConfiguration") public LimitConfiguration retrieveLimitsFromConfiguration() { //return new LimitConfiguration(1, 1000); return new LimitConfiguration(configuration.getMinimum(), configuration.getMaximum()); } @GetMapping ("/fault-tolerance-example") @HystrixCommand(fallbackMethod="rollbackRetireveConfiguration") public LimitConfiguration retireveConfiguration() { throw new RuntimeException("Not Available"); } public LimitConfiguration rollbackRetireveConfiguration() { return new LimitConfiguration(9,999); } }
[ "sivabalan.sethu@gmail.com" ]
sivabalan.sethu@gmail.com
7635b6e6a743bb4363eb30aa80c73ce85e7c3d17
52f11e546c8f9764398c848052b3fb332d4c78b2
/AxisP2PAutomation/src/com/abb/ventyx/utilities/Platform.java
77eeb4892846644958c3c13932fb0ceaeb9f2c74
[]
no_license
nicholaskhuong/axisautomation
b9cad25f429563364c7e2ed4d43eee61776035bc
305c4334dbbc60dae00a6e53178d3a254b8d02dc
refs/heads/master
2020-04-16T01:45:15.324957
2017-12-04T04:27:30
2017-12-04T04:27:30
83,295,791
1
0
null
null
null
null
UTF-8
Java
false
false
153
java
package com.abb.ventyx.utilities; public class Platform { public static final int APPIUM_ANDROID = 1001; public static final int SELENDRIOD = 1002; }
[ "nicholas@enclave.vn" ]
nicholas@enclave.vn
62a08ab1fe02c38738054d13a98560cd48388fcb
308821822ed477f9f5737fee3189ed637f7e875f
/Heaps/Heap.java
4a05e17bbf0d10d964811a42fa5236be77441f3d
[]
no_license
Invictus252/DataStructures
b8364a4c3cc2bc2cf67439a03332311cb1f3726d
95401fb10b94e90963f4ac4f34c00b70b2b6e057
refs/heads/master
2020-07-23T14:35:47.406710
2019-11-14T19:40:01
2019-11-14T19:40:01
207,594,119
0
0
null
null
null
null
UTF-8
Java
false
false
5,177
java
import java.util.*; public class Heap implements IHeap { private static Integer[] Heap; /** * Creates an Integer[] backed object set to 0 */ public Heap() { Heap = new Integer[0]; } /** * Checks to see if Heap[nodeIndex] is a leaF * @param nodeIndex Heap index * @return boolean True|False */ private boolean isLeaf(int nodeIndex) { if (nodeIndex >= (size() / 2) && nodeIndex <= size()) { return true; } return false; } /** * Swaps two named locations in Heap * @param x Location 1 * @param y Location 2 */ private void swap(int x, int y) { int tmp; tmp = Heap[x]; Heap[x] = Heap[y]; Heap[y] = tmp; } /** * Moves Heap[nodeIndex] towards top * @param nodeIndex Heap index * @return Kill function if leaf */ public void moveUp(int nodeIndex) { if (isLeaf(nodeIndex)) return; swap(getRight(nodeIndex, Heap),nodeIndex); } /** * Moves Heap[nodeIndex] away from top * @param nodeIndex Heap index * @return Kill function if leaf */ public void moveDown(int nodeIndex) { if (isLeaf(nodeIndex)) return; swap(getLeft(nodeIndex,Heap), nodeIndex); } /** * Retrieve parent of Heap[nodeIndex] * @return Kill function if leaf */ public int getParent(int nodeIndex) { return Heap[nodeIndex/2]; } /** * Retrieve left child of Heap[nodeIndex] * @return Self if null | left child else */ public int getLeft(int nodeIndex, Integer ary[]) { if(size() > 4) return ary[(nodeIndex * 2) + 1]; return ary[1]; } /** * Retrieve right child of Heap[nodeIndex] * @return Self if null | right child else */ public int getRight(int nodeIndex, Integer ary[]) { if(size() > 4) return ary[(nodeIndex * 2) + 2]; return ary[1]; } /** * Modify heap to new size * @param h Initialized heap of needed size */ private void copyHeap(Integer[] h) { for (int i = 0; i < Heap.length; ++i) { h[i] = Heap[i]; } Heap = h; } /** * default sort of MaxHeap */ private void sort() { for (int i = 1; i < Heap.length; i++) { if(Heap[i-1] > Heap[i]){ swap(i-1,i); sort(); } //System.out.println("in sort() -> " + toString()); //System.out.println("in sort() Heap[i- 1] -> " + Integer.toString(Heap[i-1])); //System.out.println("in sort() Heap[i] -> " + Integer.toString(Heap[i])); } } /** * Sort based on declaration of needed type * @param s Type of sort to be done */ private void sort(String s) { switch(s) { case "MAX": case "max": case "M": for (int i = 1; i < Heap.length; i++) { if(Heap[i-1] > Heap[i]){ swap(i-1,i); sort("M"); } //System.out.println("in sort(String s)[MAX] -> " + toString()); } break; case "MIN": case "min": case "m": for (int i = 1; i < Heap.length; i++) { if(Heap[i-1] < Heap[i]){ swap(i-1,i); sort("m"); } //System.out.println("in sort(String s)[MIN] -> " + toString()); } break; default: System.out.println("Ummm...No"); break; } } @Override public void insert(int item) { int i, newLen = Heap.length + 1; Integer[] newArray = new Integer[newLen]; Integer[] fitArray = null; int size = 0; for (i = 0; i < Heap.length; ++i) { newArray[i] = Heap[i]; } Heap = newArray; for (i = 0; i < Heap.length; ++i) { if(Heap[i] == null){ Heap[i] = item; size = i; while(i < Heap.length){ i++; } } } fitArray = new Integer[size + 1]; for (i = 0; i < fitArray.length; ++i) { fitArray[i] = Heap[i]; } Heap = fitArray; sort(); } @Override public void insertAll(List items) { int newLen = items.size(); Heap = new Integer[newLen]; for (int i = 0; i < items.size(); i++) { int x =Integer.parseInt(items.get(i).toString()); Heap[i] =x; } // Could be user input to declare, Max was presented in class sort(); } @Override public int size() { return Heap.length; } @Override public void clear() { Heap = new Integer[0]; } @Override public int removeTop() { Integer tmp = null; for (int i = 0; i < Heap.length-1; i++) { tmp = Heap[Heap.length -1- i]; if(tmp != null){ Heap[Heap.length-1-i] = null; return tmp; } } return tmp; } @Override public String toString() { return Arrays.toString(Heap); } }
[ "jason@invictus413.com" ]
jason@invictus413.com
d7a6b80e69e40c2a8f507fd81966fb0e6c648c83
44e7adc9a1c5c0a1116097ac99c2a51692d4c986
/aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/transform/DeleteAttributesRequestMarshaller.java
103f96615660ae437aebe60ced21a8d575968856
[ "Apache-2.0" ]
permissive
QiAnXinCodeSafe/aws-sdk-java
f93bc97c289984e41527ae5bba97bebd6554ddbe
8251e0a3d910da4f63f1b102b171a3abf212099e
refs/heads/master
2023-01-28T14:28:05.239019
2020-12-03T22:09:01
2020-12-03T22:09:01
318,460,751
1
0
Apache-2.0
2020-12-04T10:06:51
2020-12-04T09:05:03
null
UTF-8
Java
false
false
2,351
java
/* * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.ecs.model.transform; import java.util.List; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.ecs.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * DeleteAttributesRequestMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class DeleteAttributesRequestMarshaller { private static final MarshallingInfo<String> CLUSTER_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("cluster").build(); private static final MarshallingInfo<List> ATTRIBUTES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("attributes").build(); private static final DeleteAttributesRequestMarshaller instance = new DeleteAttributesRequestMarshaller(); public static DeleteAttributesRequestMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(DeleteAttributesRequest deleteAttributesRequest, ProtocolMarshaller protocolMarshaller) { if (deleteAttributesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteAttributesRequest.getCluster(), CLUSTER_BINDING); protocolMarshaller.marshall(deleteAttributesRequest.getAttributes(), ATTRIBUTES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
ff8e9969cc8f0573ce7e21c55b2fd8a3b2a813d0
1fd44715ff88f677a02998a63b9ea0ac0ef3d770
/app/src/main/java/com/example/administrator/lsys_camera/GIFSaver.java
d03083d29dab44c414358d38ea9ab52bc27bc168
[]
no_license
lim4097/LSYS-l
3db7a63dc408ff8a5fef21c2f88a916f6a662426
26f5446407227841af9f32918cdf5068743a20b0
refs/heads/master
2021-05-07T05:56:33.265730
2017-11-22T12:22:14
2017-11-22T12:22:14
111,680,600
0
0
null
null
null
null
UTF-8
Java
false
false
5,278
java
package com.example.administrator.lsys_camera; import android.content.Context; import android.graphics.Bitmap; import android.os.Environment; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.TextureView; import android.view.View; import android.view.animation.AlphaAnimation; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.Switch; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; public class GIFSaver extends Saver{ ArrayList<Bitmap> bitmapList; private AnimatedGifEncoder encoder; private int gifGoalCount; public GIFSaver(Context context, ArrayList<Bitmap> bitmapList, int gifGoalCount, Object saveObject , int gifTextId) { super(context,saveObject); this.bitmapList = bitmapList; encoder = new AnimatedGifEncoder(); this.gifGoalCount = gifGoalCount; } @Override public void run() { synchronized (saveObject) { File mFile; String mPath = MakePath("gif"); // 경로(저장될파일명)생성 OutputStream fileOutputStream = null; try { mFile = new File(mPath); fileOutputStream = new FileOutputStream(mFile); // 파일스트림을이용하여 GIF 형태를 만듬 encoder.start(fileOutputStream); encoder.setDelay(100); //변경가능, 나중에 설정만 생성자 인자로 받아서 바꾸면 될듯? encoder.setRepeat(0); //encoder.setSize(60,60); //이러면 원래 사진에서 잘림. 미리 사이즈를 줄여야할듯 //encoder.setFrameRate(20); AppCompatActivity activity = (AppCompatActivity) context; ProgressBar bar = (ProgressBar) activity.findViewById(R.id.progressBar); int i; for (i = 0; i < gifGoalCount && !Thread.currentThread().isInterrupted(); i++) { // mBitmap = bitmapList[i]; Log.e("for","for"); float per =((float)i / (float)gifGoalCount) * 100; bar.setProgress((int)per); encoder.addFrame(bitmapList.get(i)); } Log.e("for","for2"); encoder.finish(); for (int j = 0; j < gifGoalCount; j++) { bitmapList.get(j).recycle(); } bitmapList.clear(); Log.e("gifgif", "yes"); fileOutputStream.flush(); fileOutputStream.close(); if(i != gifGoalCount) // 제대로 끝마쳐지지 않았을때 { File file = new File(mPath); file.delete(); } else addImageToGallery(mFile.toString(), context,"gif"); // 저장이 되어야 다음촬영실행 } catch (IOException e) { e.printStackTrace(); } finally { mHandler.post(new Runnable() { // 찍힌게 완료 됐을 때 @Override public void run() { AppCompatActivity activity = (AppCompatActivity) context; //Toast.makeText(context.getApplicationContext(), "complete", Toast.LENGTH_SHORT).show(); ProgressBar bar = (ProgressBar) activity.findViewById(R.id.progressBar); bar.setVisibility(View.GONE); btCapture = (ImageView) activity.findViewById(R.id.id_icon_circle); btCapture.setEnabled(true); btChange = (ImageView) activity.findViewById(R.id.id_icon_change); btChange.setEnabled(true); btFlash = (ImageView) activity.findViewById(R.id.id_icon_flash); btFlash.setEnabled(true); btTimer = (ImageView) activity.findViewById(R.id.id_icon_timer); btTimer.setEnabled(true); collageButton = (ImageView) activity.findViewById(R.id.id_icon_collage); collageButton.setEnabled(true); galleyButton = (ImageView) activity.findViewById(R.id.id_icon_gallery); galleyButton.setEnabled(true); MainActivity.collageAdapterLock = true; switchOfGif = (Switch)activity.findViewById(R.id.id_switch_gif); switchOfGif.setEnabled(true); } }); if (null != fileOutputStream) { try { fileOutputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } } } }
[ "best_con@naver.com" ]
best_con@naver.com
d7e7b79e76b3b682f9d46c24e422ea3f4c984526
7e61681a3d9d8aca4c6518a09f16721c83cdeb64
/latte-ec/src/main/java/icefrog/com/latte/ec/main/sort/list/SortRecyclerAdapter.java
0c40dd5f7be3ccebd481d6ad4eddbfa92aae5c6b
[]
no_license
iceFrog2280/miniEC
f9ff2bba61e98b7310699cdd900d31f0cce4a092
abd2661c62d66b1c739a220069119f4043e33dda
refs/heads/master
2020-06-10T18:32:44.066993
2019-06-26T01:27:32
2019-06-26T01:27:32
193,663,708
0
0
null
null
null
null
UTF-8
Java
false
false
4,084
java
package icefrog.com.latte.ec.main.sort.list; import android.graphics.Color; import android.support.v4.content.ContextCompat; import android.support.v7.widget.AppCompatTextView; import android.view.View; import java.util.List; import icefrog.com.latte.core.delegates.LatteDelegate; import icefrog.com.latte.ui.recycle.ItemType; import icefrog.com.latte.ui.recycle.MultipleFields; import icefrog.com.latte.ui.recycle.MultipleItemEntity; import icefrog.com.latte.ui.recycle.MultipleRecyclerAdapter; import icefrog.com.latte.ui.recycle.MultipleViewHolder; import icefrog.com.latte.ec.R; import icefrog.com.latte.ec.main.sort.SortDelegate; import icefrog.com.latte.ec.main.sort.content.ContentDelegate; import me.yokeyword.fragmentation.SupportHelper; public class SortRecyclerAdapter extends MultipleRecyclerAdapter { private final SortDelegate DELEGATE; private int mPrePosition = 0; protected SortRecyclerAdapter(List<MultipleItemEntity> data, SortDelegate delegate) { super(data); this.DELEGATE = delegate; //添加垂直菜单布局 addItemType(ItemType.VERTICAL_MENU_LIST, R.layout.item_vertical_menu_list); } @Override protected void convert(final MultipleViewHolder holder, final MultipleItemEntity entity) { super.convert(holder, entity); switch (holder.getItemViewType()) { case ItemType.VERTICAL_MENU_LIST: final String text = entity.getField(MultipleFields.TEXT); final boolean isClicked = entity.getField(MultipleFields.TAG); final AppCompatTextView name = holder.getView(R.id.tv_vertical_item_name); final View line = holder.getView(R.id.view_line); final View itemView = holder.itemView; itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final int currentPosition = holder.getAdapterPosition(); if (mPrePosition != currentPosition) { //还原上一个 getData().get(mPrePosition).setField(MultipleFields.TAG, false); notifyItemChanged(mPrePosition); //更新选中的item entity.setField(MultipleFields.TAG, true); notifyItemChanged(currentPosition); mPrePosition = currentPosition; final int contentId = getData().get(currentPosition).getField(MultipleFields.ID); showContent(contentId); } } }); if (!isClicked) { line.setVisibility(View.INVISIBLE); name.setTextColor(ContextCompat.getColor(mContext, R.color.we_chat_black)); itemView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.item_background)); } else { line.setVisibility(View.VISIBLE); name.setTextColor(ContextCompat.getColor(mContext, R.color.app_main)); line.setBackgroundColor(ContextCompat.getColor(mContext, R.color.app_main)); itemView.setBackgroundColor(Color.WHITE); } holder.setText(R.id.tv_vertical_item_name, text); break; default: break; } } private void showContent(int contentId) { final ContentDelegate delegate = ContentDelegate.newInstance(contentId); switchContent(delegate); } private void switchContent(ContentDelegate delegate) { //通过传值形式通信 final LatteDelegate contentDelegate = SupportHelper.findFragment(DELEGATE.getChildFragmentManager(), ContentDelegate.class); if (contentDelegate != null) { contentDelegate.getSupportDelegate().replaceFragment(delegate, false); } } }
[ "1342596163@qq.com" ]
1342596163@qq.com
eaf876d41869a0ab284a6e34b52468fc8cda55cd
6fcab1c38376c02c687f18c23fdb86625c38e03a
/src/test/java/seedu/address/testutil/TypicalConsumption.java
cf5d87590aae2405a6ab6b457e25ee471a7f5a34
[ "MIT", "LicenseRef-scancode-other-permissive" ]
permissive
daongochieu2810/tp
3c1529d1645d70f5bde3797460105c645c117bf3
51fe97ff93b1d5912eb5f809b4c52c12edb2a63d
refs/heads/master
2023-01-11T04:18:30.552403
2020-11-09T06:06:48
2020-11-09T06:06:48
294,742,401
0
0
NOASSERTION
2020-09-11T16:12:39
2020-09-11T16:12:38
null
UTF-8
Java
false
false
2,888
java
package seedu.address.testutil; import static seedu.address.testutil.TypicalRecipes.BURGER; import static seedu.address.testutil.TypicalRecipes.EGGS; import static seedu.address.testutil.TypicalRecipes.ENCHILADAS; import static seedu.address.testutil.TypicalRecipes.FLORENTINE; import static seedu.address.testutil.TypicalRecipes.MARGARITAS; import static seedu.address.testutil.TypicalRecipes.NOODLE; import static seedu.address.testutil.TypicalRecipes.PASTA; import static seedu.address.testutil.TypicalRecipes.PATTY; import static seedu.address.testutil.TypicalRecipes.PORK; import static seedu.address.testutil.TypicalRecipes.SANDWICH; import static seedu.address.testutil.TypicalRecipes.SOUP; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import seedu.address.model.WishfulShrinking; import seedu.address.model.consumption.Consumption; public class TypicalConsumption { public static final Consumption EAT_SANDWICH = new ConsumptionBuilder().withRecipe(SANDWICH).build(); public static final Consumption EAT_PASTA = new ConsumptionBuilder().withRecipe(PASTA).build(); public static final Consumption EAT_PORK = new ConsumptionBuilder().withRecipe(PORK).build(); public static final Consumption EAT_FLORENTINE = new ConsumptionBuilder().withRecipe(FLORENTINE).build(); public static final Consumption EAT_ENCHILADAS = new ConsumptionBuilder().withRecipe(ENCHILADAS).build(); public static final Consumption EAT_EGGS = new ConsumptionBuilder().withRecipe(EGGS).build(); public static final Consumption EAT_PATTY = new ConsumptionBuilder().withRecipe(PATTY).build(); // Manually added public static final Consumption EAT_BURGER = new ConsumptionBuilder().withRecipe(BURGER).build(); public static final Consumption EAT_SOUP = new ConsumptionBuilder().withRecipe(SOUP).build(); // Manually added - Consumption's details found in {@code CommandTestUtil} public static final Consumption EAT_NOODLE = new ConsumptionBuilder().withRecipe(NOODLE).build(); public static final Consumption EAT_MARGARITAS = new ConsumptionBuilder().withRecipe(MARGARITAS).build(); public static final String KEYWORD_MATCHING_MEIER = "Meier"; // A keyword that matches MEIER private TypicalConsumption() {} // prevents instantiation /** * Returns an {@code WishfulShrinking} with all the typical consumption. */ public static WishfulShrinking getTypicalWishfulShrinking() { WishfulShrinking ab = new WishfulShrinking(); for (Consumption consumption : getTypicalConsumption()) { ab.addConsumption(consumption); } return ab; } public static List<Consumption> getTypicalConsumption() { return new ArrayList<>(Arrays.asList(EAT_SANDWICH, EAT_PASTA, EAT_PORK, EAT_FLORENTINE, EAT_ENCHILADAS, EAT_EGGS, EAT_PATTY)); } }
[ "goh_ty@users.noreply.github.com" ]
goh_ty@users.noreply.github.com
c39fec7d9f47ea4d5c79d7932bd49c3a686a0c65
576105f0492419191ffeb99ec6f53ad3899b1bbc
/src/test/java/com/cybertek/pages/LoginPage.java
3dc71140355769ed2355c75304d648ef941f7198
[]
no_license
onas2729/Summer-2019-VA-Test-NG-Selenium-Project
0c32c4ff4cd9b327851330d180aa02b446590c4a
9c62893fa7f88d1ea5ee7c09eb16fdae511ea49c
refs/heads/master
2023-05-27T02:11:59.179970
2020-03-11T02:04:55
2020-03-11T02:04:55
226,749,002
0
0
null
2023-05-09T18:37:46
2019-12-08T23:47:56
Java
UTF-8
Java
false
false
1,041
java
package com.cybertek.pages; import com.cybertek.utilities.Driver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBys; import org.openqa.selenium.support.PageFactory; public class LoginPage { public LoginPage(){ PageFactory.initElements(Driver.get(), this); } // FindBys Method // @FindBys({ // @FindBy(id="prependedInput") // @FindBy(name="prependedInput") }) @FindBy(id="prependedInput") public WebElement userName; @FindBy(id="prependedInput2") public WebElement password; @FindBy(name="_submit") public WebElement submit; public void login (String userNameStr, String passwordStr){ userName.sendKeys(userNameStr); password.sendKeys(passwordStr); submit.click(); } }
[ "karabacakn35@gmail.com" ]
karabacakn35@gmail.com
e9e5048fe82056f8308e027f62c8746895330596
6663de4a926635b9260d320f27ad9bbe454ac31f
/ssm/src/main/java/com/jiang/ssm/service/impl/JudgeServiceImpl.java
ddf1789813efcb8a8e03132ef02f515355785e49
[]
no_license
amrjlg/ssm
a212395f5435fe25fb362b79729ce8ed9aaaad7e
8e4200172d64bd95ebe96b75dd05d9816f9feb74
refs/heads/master
2021-08-30T15:59:47.076975
2017-12-18T14:38:27
2017-12-18T14:38:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,239
java
package com.jiang.ssm.service.impl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.jiang.ssm.bean.ChoiceExample; import com.jiang.ssm.bean.Judge; import com.jiang.ssm.bean.JudgeExample; import com.jiang.ssm.mapper.JudgeMapper; import com.jiang.ssm.service.JudgeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service("judgeService") public class JudgeServiceImpl implements JudgeService{ @Autowired private JudgeMapper judgeMapper; @Override public int addJudge(Judge judge) { judgeMapper.insert(judge); return judge.getJudgeId(); } @Override public int updateJudge(Judge judge) { int result = judgeMapper.updateByPrimaryKeySelective(judge); return result; } @Override public int deleteJudge(int judgeId) { int result = judgeMapper.deleteByPrimaryKey(judgeId); return result; } @Override public int deleteJudge(Judge judge) { int result = judgeMapper.deleteByExample(getExample(judge)); return result; } @Override public Judge getJudge(int judgeId) { return judgeMapper.selectByPrimaryKey(judgeId); } @Override public List<Judge> getJudge() { return judgeMapper.selectByExample(null); } @Override public PageInfo getJudge(int page, int pageSize) { PageHelper.startPage(page,pageSize); List<Judge> judge = getJudge(); return new PageInfo(judge); } private JudgeExample getExample(Judge judge){ JudgeExample judgeExample =new JudgeExample(); JudgeExample.Criteria criteria = judgeExample.createCriteria(); if (judge!=null) { if (judge.getCourseId() != null) { criteria.andCourseIdEqualTo(judge.getCourseId()); } if (judge.getJudgeAnswer() != null) { criteria.andJudgeAnswerEqualTo(judge.getJudgeAnswer()); } if (judge.getJudgeTitle() != null) { criteria.andJudgeTitleEqualTo(judge.getJudgeTitle()); } } return judgeExample; } }
[ "2899297045@qq.com" ]
2899297045@qq.com
91bfb1560f50cd18fdab4e677634b45cf0bcaa7a
7ea6aedc842daa9f3363990dea0d84b434913f7f
/src/dynamicprogramming/Fibonacci.java
86cf3b68942efba81b26a2f5bcff584d1ddffa09
[]
no_license
Harish-tamilan/geekster
fca5165b29fe4a6293075973882e887f7656e683
9a9248a4b74acecf61522ed5ec6c855b2a14e793
refs/heads/main
2023-07-16T23:13:20.006772
2021-09-07T17:47:35
2021-09-07T17:47:35
338,271,148
0
0
null
null
null
null
UTF-8
Java
false
false
541
java
package dynamicprogramming; public class Fibonacci { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(fib(41)); System.out.println(fib(41, new int[42])); } public static int fib(int i) { // TODO Auto-generated method stub if(i==1 || i==2) return i-1; int ans = fib(i-1)+fib(i-2); return ans; } public static int fib(int i, int[] arr) { if(i==1 || i==2) return i-1; if(arr[i]!=0) return arr[i]; arr[i] = fib(i-1,arr)+fib(i-2,arr); return arr[i]; } }
[ "harishtamilan05@gmail.com" ]
harishtamilan05@gmail.com
a517a6bbe848c47b3f32fcf4d9db8c9b1da3e6df
112f23486ca41458e012dfecb48b16bef66b7d39
/app/src/main/java/com/vijayjaidewan01vivekrai/smsservice_github/MainActivity.java
91e0c184e1408ff44643552f2a4b4efcce7a9158
[]
no_license
vivekraideveloper/SmsService
88a43be013973a7b40dd8848d8f83affe03857c5
8ec50f0578a47d2074739db4a5d4244a088a61b2
refs/heads/master
2020-03-19T13:54:39.304219
2018-06-08T09:51:38
2018-06-08T09:51:38
136,600,604
0
0
null
null
null
null
UTF-8
Java
false
false
1,598
java
package com.vijayjaidewan01vivekrai.smsservice_github; import android.Manifest; import android.content.pm.PackageManager; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.telephony.SmsManager; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends AppCompatActivity { EditText phone; EditText message; Button send; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); phone = findViewById(R.id.phone); message = findViewById(R.id.message); send = findViewById(R.id.send); if (ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.SEND_SMS) != PackageManager.PERMISSION_GRANTED){ ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.SEND_SMS}, 20); return; } send.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String s1 = phone.getText().toString(); String s2 = message.getText().toString(); Toast.makeText(MainActivity.this, "Message Sent", Toast.LENGTH_SHORT).show(); SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage(s1, null, s2, null, null); } }); } }
[ "vijayjaidewan01@gmail.com" ]
vijayjaidewan01@gmail.com
e472f650e45db27afef2af87406d8cc10dbf243a
3bf129941709d3f2b211fa8603cbf999a7fb9ec9
/samples/delayMQ-mybatis-mutiple/src/main/java/com/luoluo/mybatis/config/datasource/MybatisPlusConfig4delaymq.java
0e5f1882ebad8fe419681608cf0725763868d578
[ "Apache-2.0" ]
permissive
zengxinbo/delaymq
20f969017e5c82efeee4d92e1403b4bd546b58a6
f003ee3227bc9578d617262352cca7ce18e6cbaf
refs/heads/master
2022-12-02T20:18:45.745483
2020-08-28T03:21:09
2020-08-28T03:21:09
290,941,496
1
0
Apache-2.0
2020-08-28T03:27:14
2020-08-28T03:27:13
null
UTF-8
Java
false
false
1,949
java
package com.luoluo.mybatis.config.datasource; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import javax.sql.DataSource; /** * Mybatis 和delayMq同一个数据源 * * @see DataSourceConfig */ @Configuration @MapperScan(basePackages = "com.luoluo.mybatis.mapper", sqlSessionTemplateRef = "delaymqSqlSessionTemplate") public class MybatisPlusConfig4delaymq { //delaymq数据源 @Bean("delaymqSqlSessionFactory") public SqlSessionFactory delaymqSqlSessionFactory(@Qualifier("delaymqDataSource") DataSource dataSource) throws Exception { SqlSessionFactoryBean sqlSessionFactory = new SqlSessionFactoryBean(); sqlSessionFactory.setDataSource(dataSource); sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver(). getResources("classpath:mapper/*.xml")); sqlSessionFactory.setTypeAliasesPackage("com.luoluo.mybatis.dataobject"); return sqlSessionFactory.getObject(); } //事务支持 @Bean(name = "delaymqTransactionManager") public DataSourceTransactionManager delaymqTransactionManager(@Qualifier("delaymqDataSource") DataSource dataSource) { return new DataSourceTransactionManager(dataSource); } @Bean(name = "delaymqSqlSessionTemplate") public SqlSessionTemplate delaymqSqlSessionTemplate(@Qualifier("delaymqSqlSessionFactory") SqlSessionFactory sqlSessionFactory) { return new SqlSessionTemplate(sqlSessionFactory); } }
[ "luoyubin@968666.net" ]
luoyubin@968666.net
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
9e03c8cbff94cee61baaaa18b909e5bc82c8fab7
f24571cea9b8fe33c9506abb48b45778767aa44b
/src/main/java/frc/robot/subsystems/Hatch.java
d5952caf7a400e66c0e13a1b463e583dfba2d516
[]
no_license
astan54321/122SummerBot
3a03d3b7b641a4b71ecd28593a717ed66f3f4a41
32c5685583c091044695ac130141306fbbfc598d
refs/heads/master
2020-06-14T10:37:49.930835
2019-08-27T15:13:15
2019-08-27T15:13:15
194,983,778
0
0
null
null
null
null
UTF-8
Java
false
false
3,156
java
package frc.robot.subsystems; import com.ctre.phoenix.motorcontrol.NeutralMode; import com.ctre.phoenix.motorcontrol.can.WPI_VictorSPX; import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.command.Subsystem; import frc.robot.Constants; import frc.robot.maps.RobotMap; public class Hatch extends Subsystem { private WPI_VictorSPX intake; private DoubleSolenoid deployer; private DigitalInput hatchCollected; public Hatch() { initMotors(); initPneumatics(); // initSensors(); } // ________________________________________________________________ public void intakeManual(double speed) { intake.set(speed); } // ________________________________________________________________ public void intake(boolean intake) { deploy(); double intakeSpeed = intake ? Constants.HATCH_INTAKE_SPEED : Constants.HATCH_STALL_SPEED; intakeManual(intakeSpeed); } // ________________________________________________________________ public void intake() { intake(true); } // ________________________________________________________________ public void eject(boolean eject) { double ejectSpeed = eject ? Constants.HATCH_EJECT_SPEED : Constants.HATCH_STALL_SPEED; intakeManual(ejectSpeed); } // ________________________________________________________________ public void eject() { eject(true); } // ________________________________________________________________ public void stall() { intake(false); eject(false); } // ________________________________________________________________ public void stopIntake() { intakeManual(0); } // ________________________________________________________________ public void deploy() { deployer.set(Constants.DEPLOY); } // ________________________________________________________________ public void retract() { deployer.set(Constants.RETRACT); } // ________________________________________________________________ private boolean getDeployed() { return deployer.get() == Constants.DEPLOY; } // ________________________________________________________________ public boolean hasHatch() { return hatchCollected.get(); } // ________________________________________________________________ private void initMotors() { intake = new WPI_VictorSPX(RobotMap.HATCH_INTAKE); resetMotors(); intake.setNeutralMode(NeutralMode.Brake); } // ________________________________________________________________ public void initPneumatics() { deployer = new DoubleSolenoid(RobotMap.PCM_CHANNEL, RobotMap.HATCH_CHANNEL_A, RobotMap.HATCH_CHANNEL_B); } // ________________________________________________________________ private void initSensors() { hatchCollected = new DigitalInput(RobotMap.HATCH_COLLECTED_SWITCH); } // ________________________________________________________________ private void resetMotors() { intake.configFactoryDefault(); } // ________________________________________________________________ @Override public void initDefaultCommand() { } }
[ "astan54321@gmail.com" ]
astan54321@gmail.com
295f386148bd8bd7cde6c6d8aaf76552c858e4e7
a457378ffcf89f8d31951b83ba71df50be4630d8
/src/simulation_atm/test.java
b619fb558ee7121def36b5e7f04893ba090436d3
[]
no_license
neupaneel/AtmSimulation
7e7a064b35688b83146d28a8c2803e79f9875df0
fa413681e0ef96428c4549a42d835328e4bc7dc0
refs/heads/main
2023-02-13T11:51:09.139814
2020-12-28T16:19:15
2020-12-28T16:19:15
325,058,377
0
0
null
null
null
null
UTF-8
Java
false
false
372
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 simulation_atm; import DB.DbOperation; /** * * @author Anil */ public class test { public static void main(String[] args) { System.out.println((int)4.0); } }
[ "anilneupane07@gmail.com" ]
anilneupane07@gmail.com
177a7378e4aaec6c79f5008033269429c70629e3
0a406328375640fb9c9507f8da61b6950d6f2ddc
/HOANTQ/RN_BASE/RN_BASE_0.61/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/legacy/v4/R.java
be564a639c1125000e5ea8b808d4ca9597d657e2
[]
no_license
truongthangmt3/RN_TUTORIAL
f101bb65691a512a6a913dd367462042dbf008d5
b72f72bdd622d688ceeb3eba5a719dab9fc962a5
refs/heads/master
2021-07-24T00:35:22.253854
2020-10-27T07:55:54
2020-10-27T07:55:54
291,994,089
0
1
null
null
null
null
UTF-8
Java
false
false
14,494
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 androidx.legacy.v4; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f02002a; public static final int coordinatorLayoutStyle = 0x7f02007e; public static final int font = 0x7f02009e; public static final int fontProviderAuthority = 0x7f0200a0; public static final int fontProviderCerts = 0x7f0200a1; public static final int fontProviderFetchStrategy = 0x7f0200a2; public static final int fontProviderFetchTimeout = 0x7f0200a3; public static final int fontProviderPackage = 0x7f0200a4; public static final int fontProviderQuery = 0x7f0200a5; public static final int fontStyle = 0x7f0200a6; public static final int fontVariationSettings = 0x7f0200a7; public static final int fontWeight = 0x7f0200a8; public static final int keylines = 0x7f0200ba; public static final int layout_anchor = 0x7f0200bd; public static final int layout_anchorGravity = 0x7f0200be; public static final int layout_behavior = 0x7f0200bf; public static final int layout_dodgeInsetEdges = 0x7f0200c0; public static final int layout_insetEdge = 0x7f0200c1; public static final int layout_keyline = 0x7f0200c2; public static final int statusBarBackground = 0x7f02011a; public static final int ttcIndex = 0x7f02014e; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f040061; public static final int notification_icon_bg_color = 0x7f040062; public static final int notification_material_background_media_default_color = 0x7f040063; public static final int primary_text_default_material_dark = 0x7f040068; public static final int ripple_material_light = 0x7f04006d; public static final int secondary_text_default_material_dark = 0x7f04006e; public static final int secondary_text_default_material_light = 0x7f04006f; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f050063; public static final int compat_button_inset_vertical_material = 0x7f050064; public static final int compat_button_padding_horizontal_material = 0x7f050065; public static final int compat_button_padding_vertical_material = 0x7f050066; public static final int compat_control_corner_material = 0x7f050067; public static final int compat_notification_large_icon_max_height = 0x7f050068; public static final int compat_notification_large_icon_max_width = 0x7f050069; public static final int notification_action_icon_size = 0x7f050073; public static final int notification_action_text_size = 0x7f050074; public static final int notification_big_circle_margin = 0x7f050075; public static final int notification_content_margin_start = 0x7f050076; public static final int notification_large_icon_height = 0x7f050077; public static final int notification_large_icon_width = 0x7f050078; public static final int notification_main_column_padding_top = 0x7f050079; public static final int notification_media_narrow_margin = 0x7f05007a; public static final int notification_right_icon_size = 0x7f05007b; public static final int notification_right_side_padding_top = 0x7f05007c; public static final int notification_small_icon_background_padding = 0x7f05007d; public static final int notification_small_icon_size_as_large = 0x7f05007e; public static final int notification_subtext_size = 0x7f05007f; public static final int notification_top_pad = 0x7f050080; public static final int notification_top_pad_large_text = 0x7f050081; public static final int subtitle_corner_radius = 0x7f050082; public static final int subtitle_outline_width = 0x7f050083; public static final int subtitle_shadow_offset = 0x7f050084; public static final int subtitle_shadow_radius = 0x7f050085; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f06008b; public static final int notification_bg = 0x7f06008c; public static final int notification_bg_low = 0x7f06008d; public static final int notification_bg_low_normal = 0x7f06008e; public static final int notification_bg_low_pressed = 0x7f06008f; public static final int notification_bg_normal = 0x7f060090; public static final int notification_bg_normal_pressed = 0x7f060091; public static final int notification_icon_background = 0x7f060092; public static final int notification_template_icon_bg = 0x7f060093; public static final int notification_template_icon_low_bg = 0x7f060094; public static final int notification_tile_bg = 0x7f060095; public static final int notify_panel_notification_icon_bg = 0x7f060096; } public static final class id { private id() {} public static final int action0 = 0x7f07002d; public static final int action_container = 0x7f070035; public static final int action_divider = 0x7f070037; public static final int action_image = 0x7f070038; public static final int action_text = 0x7f07003e; public static final int actions = 0x7f07003f; public static final int async = 0x7f070047; public static final int blocking = 0x7f07004b; public static final int bottom = 0x7f07004c; public static final int cancel_action = 0x7f070055; public static final int chronometer = 0x7f07005f; public static final int end = 0x7f070079; public static final int end_padder = 0x7f07007a; public static final int forever = 0x7f070086; public static final int icon = 0x7f07008d; public static final int icon_group = 0x7f07008e; public static final int info = 0x7f070092; public static final int italic = 0x7f070094; public static final int left = 0x7f070096; public static final int line1 = 0x7f070098; public static final int line3 = 0x7f070099; public static final int media_actions = 0x7f07009c; public static final int none = 0x7f0700a2; public static final int normal = 0x7f0700a3; public static final int notification_background = 0x7f0700a4; public static final int notification_main_column = 0x7f0700a5; public static final int notification_main_column_container = 0x7f0700a6; public static final int right = 0x7f0700b7; public static final int right_icon = 0x7f0700b8; public static final int right_side = 0x7f0700b9; public static final int start = 0x7f0700df; public static final int status_bar_latest_event_content = 0x7f0700e0; public static final int tag_transition_group = 0x7f0700e9; public static final int tag_unhandled_key_event_manager = 0x7f0700ea; public static final int tag_unhandled_key_listeners = 0x7f0700eb; public static final int text = 0x7f0700ec; public static final int text2 = 0x7f0700ed; public static final int time = 0x7f0700f0; public static final int title = 0x7f0700f1; public static final int top = 0x7f0700f4; } public static final class integer { private integer() {} public static final int cancel_button_image_alpha = 0x7f080002; public static final int status_bar_notification_info_maxnum = 0x7f080007; } public static final class layout { private layout() {} public static final int notification_action = 0x7f0a0027; public static final int notification_action_tombstone = 0x7f0a0028; public static final int notification_media_action = 0x7f0a0029; public static final int notification_media_cancel_action = 0x7f0a002a; public static final int notification_template_big_media = 0x7f0a002b; public static final int notification_template_big_media_custom = 0x7f0a002c; public static final int notification_template_big_media_narrow = 0x7f0a002d; public static final int notification_template_big_media_narrow_custom = 0x7f0a002e; public static final int notification_template_custom_big = 0x7f0a002f; public static final int notification_template_icon_group = 0x7f0a0030; public static final int notification_template_lines_media = 0x7f0a0031; public static final int notification_template_media = 0x7f0a0032; public static final int notification_template_media_custom = 0x7f0a0033; public static final int notification_template_part_chronometer = 0x7f0a0034; public static final int notification_template_part_time = 0x7f0a0035; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0d007d; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0e00fd; public static final int TextAppearance_Compat_Notification_Info = 0x7f0e00fe; public static final int TextAppearance_Compat_Notification_Info_Media = 0x7f0e00ff; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e0100; public static final int TextAppearance_Compat_Notification_Line2_Media = 0x7f0e0101; public static final int TextAppearance_Compat_Notification_Media = 0x7f0e0102; public static final int TextAppearance_Compat_Notification_Time = 0x7f0e0103; public static final int TextAppearance_Compat_Notification_Time_Media = 0x7f0e0104; public static final int TextAppearance_Compat_Notification_Title = 0x7f0e0105; public static final int TextAppearance_Compat_Notification_Title_Media = 0x7f0e0106; public static final int Widget_Compat_NotificationActionContainer = 0x7f0e0179; public static final int Widget_Compat_NotificationActionText = 0x7f0e017a; public static final int Widget_Support_CoordinatorLayout = 0x7f0e017b; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f02002a }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] CoordinatorLayout = { 0x7f0200ba, 0x7f02011a }; public static final int CoordinatorLayout_keylines = 0; public static final int CoordinatorLayout_statusBarBackground = 1; public static final int[] CoordinatorLayout_Layout = { 0x10100b3, 0x7f0200bd, 0x7f0200be, 0x7f0200bf, 0x7f0200c0, 0x7f0200c1, 0x7f0200c2 }; public static final int CoordinatorLayout_Layout_android_layout_gravity = 0; public static final int CoordinatorLayout_Layout_layout_anchor = 1; public static final int CoordinatorLayout_Layout_layout_anchorGravity = 2; public static final int CoordinatorLayout_Layout_layout_behavior = 3; public static final int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4; public static final int CoordinatorLayout_Layout_layout_insetEdge = 5; public static final int CoordinatorLayout_Layout_layout_keyline = 6; public static final int[] FontFamily = { 0x7f0200a0, 0x7f0200a1, 0x7f0200a2, 0x7f0200a3, 0x7f0200a4, 0x7f0200a5 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f02009e, 0x7f0200a6, 0x7f0200a7, 0x7f0200a8, 0x7f02014e }; 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_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
[ "hoantq19@gmail.com" ]
hoantq19@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
e41f1cb1866121d82934051afce881cac75b9174
a07fd886ef4bdb53c41dc56f968798e6f6747baa
/src/com/erv/fungsi/DecimalFormatRenderer.java
3638a0c0098ef727eb6bb1e155a5d304b22c24d8
[]
no_license
javariesoft/JavarieSoft
be9d985704e67ecd66b7b5f6e908fe0b6dc6d703
106589df3d1b9fc8ddf4281942fdd7dce8476ff0
refs/heads/master
2021-06-16T17:50:11.064916
2021-05-06T06:40:31
2021-05-06T06:40:31
195,138,004
0
0
null
null
null
null
UTF-8
Java
false
false
1,025
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.erv.fungsi; import java.awt.Component; import java.text.DecimalFormat; import javax.swing.JTable; import javax.swing.SwingConstants; import javax.swing.table.DefaultTableCellRenderer; /** * * @author JavarieSoft */ public class DecimalFormatRenderer extends DefaultTableCellRenderer { //// private static final DecimalFormat formatter = new DecimalFormat("#0.00"); private static final DecimalFormat formatter = new DecimalFormat("###,###,###,###.00"); @Override public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { // First format the cell value as require value = formatter.format((Number) value); setHorizontalAlignment(SwingConstants.RIGHT); return super.getTableCellRendererComponent( table, value, isSelected, hasFocus, row, column); } }
[ "USER@DESKTOP-6D5F2J3.mshome.net" ]
USER@DESKTOP-6D5F2J3.mshome.net
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
40a01cf0a9625ff0aeaf9c0c3264563ea71f46c7
094488bc048b0e11c7c88bbbfe015122194536f6
/android/src/com/tomas/game/AndroidLauncher.java
12627de9a33abde291858307ee7faea6b520e39c
[]
no_license
NoraTomas/WhereIsArne
f9e1b08d9829982f0d07e28cc95ee5d87a72250b
9a6b41655ea5603faa4eddfdd31948e6e8061d7a
refs/heads/master
2020-03-06T23:37:12.321596
2018-03-31T08:12:30
2018-03-31T08:12:30
127,136,930
0
0
null
null
null
null
UTF-8
Java
false
false
507
java
package com.tomas.game; import android.os.Bundle; import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; import com.tomas.game.FindArne; public class AndroidLauncher extends AndroidApplication { @Override protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); initialize(new FindArne(), config); } }
[ "noratomas@hotmail.com" ]
noratomas@hotmail.com
2f3b605e15ec0240501ac9e10e064b842d4b9485
1e7a882c00e3b882bce914f5348a886756fb9201
/app/src/main/java/mimosale/com/home/shop_sale/ProductsAdapter.java
a9d475cd6deee1c03ea9262fc81554d75f0da7e2
[]
no_license
mayurpadhye/Classified-master
c372624deea265c2990abf83f0b7bbbbcab2029b
0c160613baacc2ec87862d8ec83c583017be7a92
refs/heads/master
2020-05-28T01:44:32.192551
2019-06-18T13:29:50
2019-06-18T13:29:50
188,845,618
0
1
null
null
null
null
UTF-8
Java
false
false
16,870
java
package mimosale.com.home.shop_sale; import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.graphics.Point; import android.support.annotation.NonNull; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.Display; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.ImageView; import android.widget.RatingBar; import android.widget.TextView; import android.widget.Toast; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; import cn.pedant.SweetAlert.SweetAlertDialog; import mimosale.com.R; import mimosale.com.helperClass.PrefManager; import mimosale.com.home.fragments.AllProductPojo; import mimosale.com.login.LoginActivity; import mimosale.com.network.RestInterface; import mimosale.com.network.RetrofitClient; import mimosale.com.network.WebServiceURLs; import mimosale.com.products.ProductDetailsActivity; import mimosale.com.products.ProductDetailsActivityNew; import retrofit.Callback; import retrofit.RetrofitError; import retrofit.client.Response; import com.github.siyamed.shapeimageview.RoundedImageView; import com.google.gson.JsonElement; import com.squareup.picasso.Picasso; import com.varunest.sparkbutton.SparkButton; import com.varunest.sparkbutton.SparkEventListener; import org.json.JSONException; import org.json.JSONObject; import java.util.List; public class ProductsAdapter extends RecyclerView.Adapter<ProductsAdapter.MyViewHolder> { List<AllProductPojo> allProductPojoList; Context mctx; ProgressDialog pDialog; public ProductsAdapter(List<AllProductPojo> allProductPojoList, Context mctx) { this.allProductPojoList = allProductPojoList; this.mctx = mctx; pDialog=new ProgressDialog(mctx); pDialog.setMessage(mctx.getResources().getString(R.string.loading)); } @NonNull @Override public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { int itemWidth = parent.getWidth() / 2; View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.row_shop_sale, parent, false); ViewGroup.LayoutParams layoutParams = itemView.getLayoutParams(); layoutParams.width = itemWidth; itemView.getLayoutParams().width = (int) (getScreenWidth() / 1.5); return new MyViewHolder(itemView); } @Override public void onBindViewHolder(@NonNull final MyViewHolder holder, final int position) { final AllProductPojo items = allProductPojoList.get(position); holder.tv_product_name.setText(items.getName()); RequestOptions requestOptions = new RequestOptions(); requestOptions.placeholder(R.drawable.placeholder_logo); requestOptions.fitCenter(); holder.cv_shop_main.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mctx.startActivity(new Intent(mctx, ProductDetailsActivityNew.class).putExtra("product_id", items.getId()).putExtra("from","home"));} }); if (items.getFav_status().equals("1")) { holder.spark_button.setChecked(true); } else { holder.spark_button.setChecked(false); } holder.tv_discount.setText(items.getDiscount()+" %"); Picasso.with(mctx).load(WebServiceURLs.SHOP_IMAGE + items.getProduct_images()).into(holder.iv_product_image1); Picasso.with(mctx).load(WebServiceURLs.SHOP_IMAGE + items.getImage2()).into(holder.iv_product_image2); holder.tv_price_range.setText(items.getPrice()); holder.tv_desc.setText(items.getDescription()); holder.tv_total_like.setText(items.getLike_count()); if (items.getLike_status().equals("1")) { holder.iv_like.setImageDrawable(mctx.getResources().getDrawable(R.drawable.like_hand_black)); } else { holder.iv_like.setImageDrawable(mctx.getResources().getDrawable(R.drawable.like_black)); } holder.iv_like.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (PrefManager.getInstance(mctx).IS_LOGIN()) { likeProduct(items.getId(),position,holder.iv_like,items.getLike_status(),holder.tv_total_like,items.getLike_count()); } else { ShowDialog("shop_fav",holder.spark_button); } } }); if (position == 0) { holder.ratingBar.setRating(3.5f); } holder.spark_button.setEventListener(new SparkEventListener(){ @Override public void onEvent(ImageView button, boolean buttonState) { if (buttonState) { if (PrefManager.getInstance(mctx).IS_LOGIN()) { addToFavorite(items.getId(),position,holder.spark_button); } else { ShowDialog("shop_fav",holder.spark_button); } } else { if (PrefManager.getInstance(mctx).IS_LOGIN()) { removeFromFavorite(items.getId(),position,holder.spark_button); } else { ShowDialog("shop_fav",holder.spark_button); } // Button is inactive } } @Override public void onEventAnimationEnd(ImageView button, boolean buttonState) { } @Override public void onEventAnimationStart(ImageView button, boolean buttonState) { } }); } @Override public int getItemCount() { return allProductPojoList.size(); } public class MyViewHolder extends RecyclerView.ViewHolder { RoundedImageView iv_product_image2, iv_product_image1; ImageView iv_like; TextView tv_desc, tv_price_range, tv_product_name,tv_discount,tv_dis,tv_total_like; RatingBar ratingBar; SparkButton spark_button; CardView cv_shop_main; ImageView iv_pop_up; public MyViewHolder(View view) { super(view); iv_product_image2 = (RoundedImageView) view.findViewById(R.id.iv_product_image2); iv_product_image1 = (RoundedImageView) view.findViewById(R.id.iv_product_image1); iv_like = (ImageView) view.findViewById(R.id.iv_like); tv_desc = (TextView) view.findViewById(R.id.tv_desc); tv_price_range = (TextView) view.findViewById(R.id.tv_price_range); tv_product_name = (TextView) view.findViewById(R.id.tv_product_name); tv_discount = (TextView) view.findViewById(R.id.tv_discount); tv_dis = (TextView) view.findViewById(R.id.tv_dis); spark_button = (SparkButton) view.findViewById(R.id.spark_button); ratingBar = view.findViewById(R.id.ratingBar); cv_shop_main = view.findViewById(R.id.cv_shop_main); iv_pop_up = view.findViewById(R.id.iv_pop_up); tv_total_like = view.findViewById(R.id.tv_total_like); } } public int getScreenWidth() { WindowManager wm = (WindowManager) mctx.getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); Point size = new Point(); display.getSize(size); return size.x; } public void likeProduct(String product_id, final int position, final ImageView iv_like, String likeStatus, TextView tv_total_like, final String like_count) { String like_flag=""; if (likeStatus.equals("0")) { like_flag="like"; } else like_flag="unlike"; try { pDialog.show(); RetrofitClient retrofitClient = new RetrofitClient(); RestInterface service = retrofitClient.getAPIClient(WebServiceURLs.DOMAIN_NAME); service.like_product("product", PrefManager.getInstance(mctx).getUserId(),like_flag, product_id, "Bearer " + PrefManager.getInstance(mctx).getApiToken(), new Callback<JsonElement>() { @Override public void success(JsonElement jsonElement, Response response) { try { JSONObject jsonObject = new JSONObject(jsonElement.toString()); pDialog.dismiss(); String status = jsonObject.getString("status"); String message = jsonObject.getString("message"); if (message.equals("Liked")) { allProductPojoList.get(position).setLike_status("1"); try { tv_total_like.setText(""+(Integer.parseInt(like_count)+1)); allProductPojoList.get(position).setLike_count(""+(Integer.parseInt(like_count)+1)); }catch (NumberFormatException e) { e.printStackTrace(); } notifyItemChanged(position); iv_like.setImageDrawable(mctx.getResources().getDrawable(R.drawable.like_hand_black)); } else { allProductPojoList.get(position).setLike_status("0"); notifyItemChanged(position); iv_like.setImageDrawable(mctx.getResources().getDrawable(R.drawable.like_black)); if (!like_count.equals("0")) { tv_total_like.setText(""+(Integer.parseInt(like_count)-1)); allProductPojoList.get(position).setLike_count(""+(Integer.parseInt(like_count)-1)); } } } catch (JSONException e) { e.printStackTrace(); } } @Override public void failure(RetrofitError error) { pDialog.dismiss(); Toast.makeText(mctx, mctx.getResources().getString(R.string.check_internet), Toast.LENGTH_LONG).show(); Log.i("fdfdfdfdfdf", "" + error.getMessage()); } }); } catch (Exception e) { e.printStackTrace(); pDialog.dismiss(); Log.i("detailsException", "" + e.toString()); } } public void addToFavorite(String shop_id, final int position, final SparkButton sparkButton) { try { pDialog.show(); RetrofitClient retrofitClient = new RetrofitClient(); RestInterface service = retrofitClient.getAPIClient(WebServiceURLs.DOMAIN_NAME); service.add_to_fav("product", PrefManager.getInstance(mctx).getUserId(), shop_id, "Bearer " + PrefManager.getInstance(mctx).getApiToken(), new Callback<JsonElement>() { @Override public void success(JsonElement jsonElement, Response response) { try { JSONObject jsonObject = new JSONObject(jsonElement.toString()); pDialog.dismiss(); String status = jsonObject.getString("status"); String message = jsonObject.getString("message"); if (status.equals("1")) { Toast.makeText(mctx, "" + mctx.getString(R.string.added_to_fav), Toast.LENGTH_SHORT).show(); sparkButton.setChecked(true); allProductPojoList.get(position).setFav_status("1"); notifyItemChanged(position); } else { sparkButton.setChecked(false); allProductPojoList.get(position).setFav_status("0"); notifyItemChanged(position); } } catch (JSONException e) { e.printStackTrace(); sparkButton.setChecked(false); } } @Override public void failure(RetrofitError error) { pDialog.dismiss(); sparkButton.setChecked(false); Toast.makeText(mctx, mctx.getResources().getString(R.string.check_internet), Toast.LENGTH_LONG).show(); Log.i("fdfdfdfdfdf", "" + error.getMessage()); } }); } catch (Exception e) { e.printStackTrace(); pDialog.dismiss(); Log.i("detailsException", "" + e.toString()); } } public void removeFromFavorite(String shop_id, final int position, SparkButton sparkButton) { try { pDialog.show(); RetrofitClient retrofitClient = new RetrofitClient(); RestInterface service = retrofitClient.getAPIClient(WebServiceURLs.DOMAIN_NAME); service.remove_from_fav("product", PrefManager.getInstance(mctx).getUserId(), shop_id, "Bearer " + PrefManager.getInstance(mctx).getApiToken(), new Callback<JsonElement>() { @Override public void success(JsonElement jsonElement, Response response) { try { JSONObject jsonObject = new JSONObject(jsonElement.toString()); pDialog.dismiss(); String status = jsonObject.getString("status"); String message = jsonObject.getString("message"); if (status.equals("1")) { allProductPojoList.get(position).setFav_status("0"); notifyItemChanged(position); Toast.makeText(mctx, "" + mctx.getString(R.string.remove_from_fav), Toast.LENGTH_SHORT).show(); } else { allProductPojoList.get(position).setFav_status("1"); notifyItemChanged(position); } } catch (JSONException e) { e.printStackTrace(); } } @Override public void failure(RetrofitError error) { pDialog.dismiss(); Toast.makeText(mctx, mctx.getResources().getString(R.string.check_internet), Toast.LENGTH_LONG).show(); Log.i("fdfdfdfdfdf", "" + error.getMessage()); } }); } catch (Exception e) { e.printStackTrace(); pDialog.dismiss(); Log.i("detailsException", "" + e.toString()); } } public void ShowDialog(final String intent_from, final SparkButton spark_button) { SweetAlertDialog dialog=new SweetAlertDialog(mctx); dialog.setTitleText(mctx.getResources().getString(R.string.login_waning)) .setContentText(mctx.getResources().getString(R.string.please_login)) .setConfirmText(mctx.getResources().getString(R.string.login)) .setCancelText(mctx.getResources().getString(R.string.cancel)) .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() { @Override public void onClick(SweetAlertDialog sDialog) { Intent i = new Intent(mctx, LoginActivity.class); i.putExtra("intent_from", intent_from); ((Activity) mctx).startActivityForResult(i, 1); sDialog.dismissWithAnimation(); } }) .setCancelClickListener(new SweetAlertDialog.OnSweetClickListener() { @Override public void onClick(SweetAlertDialog sweetAlertDialog) { sweetAlertDialog.dismissWithAnimation(); spark_button.setChecked(false); } }); dialog.show(); dialog.setCancelable(false); dialog.setCanceledOnTouchOutside(false); } }
[ "iam@2611" ]
iam@2611
03e35e1fb2bd8c79facce3f7bed2b76008ab9983
d3499295e446e0a779f08acf49df14b02d134f27
/game/src/com/saucy/game/map/entities/TempSprite.java
ede020d003693f5a35fa1568ebfec39fd5a868e4
[]
no_license
JonForce/RedDefense
5aa002f0159d0a66002da0d26c7ebcbd26ae63af
1a2b01ee6ca1bcaf6ab0919f6b85794a4b7c6197
refs/heads/master
2021-06-03T21:56:26.048794
2016-08-09T20:11:55
2016-08-09T20:13:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
916
java
package com.saucy.game.map.entities; import com.badlogic.gdx.graphics.Texture; import com.saucy.framework.io.InputProxy; import com.saucy.framework.rendering.Graphic; import com.saucy.framework.util.Updatable; import com.saucy.game.map.ViewController; public class TempSprite extends Graphic implements Updatable { private long startTime, lifespan; public boolean shouldRemove = false; private ViewController vc; public TempSprite(float x, float y, Texture texture, ViewController vc, long lifespan) { super(x, y, texture); this.vc = vc; this.startTime = System.currentTimeMillis(); this.lifespan = lifespan; } @Override public float x() { return super.position.x - vc.x(); } @Override public float y() { return super.position.y - vc.y(); } @Override public void updateWith(InputProxy input) { if (System.currentTimeMillis() - startTime > lifespan) shouldRemove = true; } }
[ "vanaficionado@gmail.com" ]
vanaficionado@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
4062c55a3084ef36e1604cab306ded9b299118e2
89907d07b54a744539aff61156f910ac5092f1b7
/src/main/java/com/codecool/web/servlet/Task1Servlet.java
5b4cfa76385c408bbc4d293281297f2de70557a1
[]
no_license
szilardGaal/northwind_webapp
1689f8d9a0bedb257a80494d254d86555bb1fcc4
36779040230fee554adc709afe28817a60bf3ebd
refs/heads/master
2020-05-04T15:54:55.804035
2019-04-05T11:13:33
2019-04-05T11:13:33
179,261,105
0
0
null
null
null
null
UTF-8
Java
false
false
2,303
java
package com.codecool.web.servlet; import com.codecool.web.dao.database.NorthwindDAO; import com.codecool.web.model.Task1; import com.codecool.web.service.Task1Service; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import java.util.List; @WebServlet("/task1") public final class Task1Servlet extends AbstractServlet { // https://www.postgresql.org/docs/current/static/errcodes-appendix.html private static final String SQL_ERROR_CODE_UNIQUE_VIOLATION = "23505"; @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { List<Task1> test = (List<Task1>) req.getAttribute("list"); if (test != null) { req.getRequestDispatcher("task1.jsp").forward(req, resp); } else { try (Connection connection = getConnection(req.getServletContext())) { NorthwindDAO dao = new NorthwindDAO(connection); Task1Service service = new Task1Service(dao); List<Task1> list = service.getAllResult(); req.setAttribute("list", list); } catch (SQLException ex) { throw new ServletException(ex); } req.getRequestDispatcher("task1.jsp").forward(req, resp); } } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { try (Connection connection = getConnection(req.getServletContext())) { NorthwindDAO dao = new NorthwindDAO(connection); Task1Service service = new Task1Service(dao); String companyName = req.getParameter("company"); req.setAttribute("list", service.filter(companyName)); } catch (SQLException ex) { if (SQL_ERROR_CODE_UNIQUE_VIOLATION.equals(ex.getSQLState())) { req.setAttribute("error", "Task1 has been already added to one of the selected shops"); } else { throw new ServletException(ex); } } doGet(req, resp); } }
[ "gaalszilard23@gmail.com" ]
gaalszilard23@gmail.com
b3ce059166590f6eb4d5861a9db2f17257fb5713
0baaf1a30c5a5088fe2200f6afad25ffdbde833c
/android/src/com/zorba/bt/app/Logger.java
48e97ec58d3b42108b64eaf8121d502b54111dd1
[]
no_license
zorbaraju/mobile
e47663c9b7edd5ce12423a09d307c180ff4f88c6
24d640b0612214a5d4675e6e3761e2d2f5ea3ab7
refs/heads/firstbranch
2021-01-25T04:02:51.961983
2017-06-10T10:32:53
2017-06-10T10:32:56
54,809,300
0
3
null
2017-04-18T07:24:01
2016-03-27T02:41:22
Java
UTF-8
Java
false
false
210
java
package com.zorba.bt.app; import android.content.Context; public class Logger { public static void e(Context context, String tag, String msg) { System.out.println("Error: "+tag+" : "+msg); } }
[ "uniraju@gmail.com" ]
uniraju@gmail.com
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
7a200fdd1c3c6248a2f14ed8157aea9eafdd540f
1a30e62422629a4e3a07ddc28da3e576c76d129b
/AP_CS260_wk3_2dImage_Rotation/src/cgcc/cs260/AP_wk3/MainEntry.java
f9b934b84376ef4e481f7a0fb39e438e205f510e
[]
no_license
adampentz/-AP_wk3_ManipulatingDataWithAlgarithms-
1efcebbeb37a302aeaec4d98e9245e984bc374cd
a65b229f75295e3cb24814b8234e82d4786ce9d9
refs/heads/master
2020-08-12T03:43:46.046781
2019-10-15T03:35:34
2019-10-15T03:35:34
214,681,664
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package cgcc.cs260.AP_wk3; public class MainEntry { public static void main(String[] args) { Algos algos = new Algos(); Matrix matrix = new Matrix(); algos.create(); algos.display(); System.out.println(" "); matrix.matTri(); matrix.matGls(); System.out.println(" "); algos.create2(); algos.display(); System.out.println(" "); algos.create3(); algos.display2(); } }
[ "55722970+adampentz@users.noreply.github.com" ]
55722970+adampentz@users.noreply.github.com