blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
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
689M
⌀ | 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 131
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 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d042b095b48760301db3bd8751a70a32c3e56e90
|
a7ee763f32a61982e94618f2c429c5c16619bc06
|
/p2pok/.svn/pristine/0b/0b2a6e3af3bd62c8758a84d76e01231c3ee3a041.svn-base
|
2cad241582ac33f42f6074a4e7776e0b447542d1
|
[] |
no_license
|
MinusGod/p2p
|
8af3fe98f4442de3deb423ef31efe5bfd5e1049c
|
16eefe0d197d288c792caa8669b36e6597a4361e
|
refs/heads/master
| 2021-01-19T00:50:25.121777 | 2017-03-24T05:21:19 | 2017-03-24T05:21:19 | 86,029,887 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 481 |
package jobs;
import business.CreditLevel;
import play.jobs.Job;
import play.jobs.On;
import play.jobs.OnApplicationStart;
import utils.ErrorInfo;
/**
* 更新所有用户的信用等级,执行时间:02:50
*
* @author hys
* @createDate 2015年6月24日 下午8:17:05
*
*/
@On("0 50 2 * * ?")
public class UpdateCredictLevels extends Job {
public void doJob() {
if(constants.Constants.ISJOB==1){
CreditLevel.updateAllUserCreditLevels(new ErrorInfo());
}
}
}
|
[
"[email protected]"
] | ||
fd4a7c2869010106568fa7dff1ec0945c12eabea
|
d2cb1f4f186238ed3075c2748552e9325763a1cb
|
/methods_all/nonstatic_methods/java_awt_GraphicsDevice_toString.java
|
204285bcd4ad10c575c6dddb3af474101be6c69f
|
[] |
no_license
|
Adabot1/data
|
9e5c64021261bf181b51b4141aab2e2877b9054a
|
352b77eaebd8efdb4d343b642c71cdbfec35054e
|
refs/heads/master
| 2020-05-16T14:22:19.491115 | 2019-05-25T04:35:00 | 2019-05-25T04:35:00 | 183,001,929 | 4 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 148 |
java
|
class java_awt_GraphicsDevice_toString{ public static void function() {java.awt.GraphicsDevice obj = new java.awt.GraphicsDevice();obj.toString();}}
|
[
"[email protected]"
] | |
cca47c29680254dd3003f86c18108198464625c0
|
2148d36d4808ec73830e1a0a431a33bc17bda0a9
|
/src/main/java/com/ithinkrok/minigames/api/protocol/event/GameGroupEvent.java
|
ef73106240f000297077252ae2413460a1feb2c7
|
[] |
no_license
|
adventurerok/MinigamesBase
|
a14fead5207608e67bc69f537a9b7934cbbcb3dc
|
9b9cdf041dd29c007c6c3280e4e0709d6b8cff3a
|
refs/heads/1.12
| 2021-07-14T23:43:05.630796 | 2019-10-22T17:39:41 | 2019-10-27T23:58:33 | 212,167,516 | 2 | 0 | null | 2020-10-13T16:26:38 | 2019-10-01T18:16:52 |
Java
|
UTF-8
|
Java
| false | false | 671 |
java
|
package com.ithinkrok.minigames.api.protocol.event;
import com.ithinkrok.minigames.api.protocol.data.GameGroupInfo;
import com.ithinkrok.util.event.CustomEvent;
import org.bukkit.event.Event;
/**
* Created by paul on 16/02/16.
*/
public abstract class GameGroupEvent extends Event implements CustomEvent {
private final GameGroupInfo gameGroupInfo;
public GameGroupEvent(GameGroupInfo gameGroupInfo) {
if(gameGroupInfo == null) {
throw new NullPointerException("gameGroupInfo cannot be null");
}
this.gameGroupInfo = gameGroupInfo;
}
public GameGroupInfo getGameGroup() {
return gameGroupInfo;
}
}
|
[
"[email protected]"
] | |
f95ba3804244f3364fa4e274053bb8c9c1ea682e
|
8d4d2ab440a236a3ab4d4bda20f855ff86df2ebd
|
/src/main/java/com/randude14/hungergames/commands/admin/StopCommand.java
|
775399995456b3241400f82bb53732706431f499
|
[] |
no_license
|
AtomicCraft/AtomicGames
|
5fe4f7c884d3ab28677c0fd730d93c74068150bf
|
a7a07b268ff559f3dd3b34f2647de039fce67def
|
refs/heads/master
| 2021-01-16T21:04:57.177000 | 2012-10-26T00:36:01 | 2012-10-26T00:36:01 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,155 |
java
|
package com.randude14.hungergames.commands.admin;
import com.randude14.hungergames.Config;
import com.randude14.hungergames.Defaults.Perm;
import com.randude14.hungergames.GameManager;
import com.randude14.hungergames.HungerGames;
import com.randude14.hungergames.commands.Command;
import com.randude14.hungergames.utils.ChatUtils;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class StopCommand extends Command {
public StopCommand() {
super(Perm.ADMIN_STOP, "stop", ADMIN_COMMAND);
}
@Override
public void handle(CommandSender cs, String label, String[] args) {
String name = (args.length < 1) ? Config.getDefaultGame() : args[0];
if (name == null) {
ChatUtils.helpCommand(cs, getUsage(), HungerGames.CMD_ADMIN);
return;
}
game = GameManager.INSTANCE.getRawGame(name);
if (game == null) {
ChatUtils.error(cs, "%s does not exist.", name);
return;
}
if (!game.checkForGameOver(false)) game.stopGame(cs, false);
}
@Override
public String getInfo() {
return "manually stop a game";
}
@Override
public String getUsage() {
return "/%s stop [game name]";
}
}
|
[
"[email protected]"
] | |
dd2649c207c53e21c0e1eda081a86aa3947a2174
|
853ded492fe2356b1414eb48fe40d71e6ab790cc
|
/src/CheckRecord_1178.java
|
ed29ce1a537f307ce8a6d447f0673922ef1140b5
|
[] |
no_license
|
Liuling100/MyLintCode
|
c8c404f62fb7da69c85e21db62e0c81e1852ed33
|
495ba58e10d4978ecbd06871d449cc5836eede52
|
refs/heads/master
| 2020-03-21T21:34:35.623652 | 2018-07-25T15:32:39 | 2018-07-25T15:32:39 | 139,071,228 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 484 |
java
|
public class CheckRecord_1178 {
/**
* @param s: a string
* @return: whether the student could be rewarded according to his attendance record
*/
public boolean checkRecord(String s) {
// Write your code here
return !s.matches(".*A.*A.*") && !s.matches(".*LLL.*");
}
public static void main(String args[]){
CheckRecord_1178 obj = new CheckRecord_1178();
String s = "PPALLL";
System.out.println(obj.checkRecord(s));
}
}
|
[
"[email protected]"
] | |
ad2b0d847772c6c289757b87db94f0dfad2c10e7
|
0e61dce322c53f1405535d11276ae41efd9db79d
|
/wxs/diary/com/cx/wxs/dao/DFavoriteDao.java
|
14ff650fa434c55c611c4f28f5feacf5d065718a
|
[] |
no_license
|
roychenyi/roychenyi.github.io
|
8f13545d34c47430b0c4412aa073ce5304efc175
|
9bcdc36783e99c13cd09354f8090dc12440c9b9a
|
refs/heads/master
| 2020-04-03T20:52:18.644322 | 2017-01-22T09:34:54 | 2017-01-22T09:34:54 | 46,900,815 | 0 | 2 | null | 2016-05-17T12:38:45 | 2015-11-26T03:04:41 |
Java
|
UTF-8
|
Java
| false | false | 1,651 |
java
|
package com.cx.wxs.dao;
import java.util.List;
import com.cx.wxs.dto.DFavoriteDto;
import com.cx.wxs.po.DFavorite;
import com.cx.wxs.base.dao.IBaseDao;
/**
* @author 陈义
* @date 2016-04-16 09:22:44
*/
public interface DFavoriteDao extends IBaseDao<DFavorite,Integer>{
/**
* 通过id获取DFavoriteDto
* @author 陈义
* @date 2016-04-16 09:22:44
*/
public DFavoriteDto getDFavoriteByID(DFavoriteDto dFavoriteDto);
/**
* 通过相关信息获取favoriteDto
* @param dFavoriteDto
* @return
* @author 陈义
* @date 2016-4-19下午6:54:07
*/
public DFavoriteDto getDFavorite(DFavoriteDto dFavoriteDto);
/**
* 通过相关数据获取DFavoriteDtoList
* @author 陈义
* @date 2016-04-16 09:22:44
*/
public List<DFavoriteDto> getDFavoriteList(DFavoriteDto dFavoriteDto);
/**
* 添加一个新的DFavorite到数据库
* @author 陈义
* @date 2016-04-16 09:22:44
*/
public Integer addDFavorite(DFavoriteDto dFavoriteDto);
/**
* 更新DFavorite
* @author 陈义
* @date 2016-04-16 09:22:44
*/
public Integer updateDFavorite(DFavoriteDto dFavoriteDto);
/**
* 删除DFavorite
* @author 陈义
* @date 2016-04-16 09:22:44
*/
public Integer deleteDFavorite(DFavoriteDto dFavoriteDto);
/**
* 获取收藏数量
* @param dFavoriteDto
* @return
* @author 陈义
* @date 2016-5-6上午8:48:45
*/
public Integer getDFavoriteCount(DFavoriteDto dFavoriteDto);
}
|
[
"[email protected]"
] | |
4542639dd2005e4e0c35e82064e5c16a6303f2e7
|
b88dedd8086d5b2e802ab6c25de38d83ce6173c8
|
/src/com/msi/tough/engine/aws/elasticloadbalancing/LoadBalancer.java
|
753d12d4d4fb4392237421fb97b7d64c471ffede
|
[
"Apache-2.0"
] |
permissive
|
TranscendComputing/TopStackCore
|
92b3f24f1e60f15507ead6715412bb2657c34b1e
|
71760c895cef7314b10f5fcfbcaf9bea2a0bbce7
|
refs/heads/master
| 2021-01-15T23:35:12.138661 | 2013-10-28T19:33:45 | 2013-10-28T19:33:45 | 12,146,242 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 28,961 |
java
|
/*
* TopStack (c) Copyright 2012-2013 Transcend Computing, Inc.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.msi.tough.engine.aws.elasticloadbalancing;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.codehaus.jackson.JsonNode;
import org.hibernate.Session;
import org.slf4j.Logger;
import com.msi.tough.cf.AccountType;
import com.msi.tough.cf.CFType;
import com.msi.tough.cf.ec2.InstanceType;
import com.msi.tough.cf.elasticloadbalancing.AppCookieStickinessPolicyType;
import com.msi.tough.cf.elasticloadbalancing.HealthCheckType;
import com.msi.tough.cf.elasticloadbalancing.LBCookieStickinessPolicyType;
import com.msi.tough.cf.elasticloadbalancing.ListenerType;
import com.msi.tough.cf.elasticloadbalancing.LoadBalancerType;
import com.msi.tough.core.Appctx;
import com.msi.tough.core.CommaObject;
import com.msi.tough.core.HibernateUtil;
import com.msi.tough.core.HibernateUtil.Operation;
import com.msi.tough.core.JsonUtil;
import com.msi.tough.core.MapUtil;
import com.msi.tough.engine.aws.ec2.Instance;
import com.msi.tough.engine.aws.ec2.SecurityGroupIngress;
import com.msi.tough.engine.core.BaseProvider;
import com.msi.tough.engine.core.CallStruct;
import com.msi.tough.engine.core.TemplateContext;
import com.msi.tough.engine.resource.Resource;
import com.msi.tough.model.InstanceBean;
import com.msi.tough.model.ListenerBean;
import com.msi.tough.model.LoadBalancerBean;
import com.msi.tough.model.ResourcesBean;
import com.msi.tough.utils.CFUtil;
import com.msi.tough.utils.ChefUtil;
import com.msi.tough.utils.ConfigurationUtil;
import com.msi.tough.utils.Constants;
import com.msi.tough.utils.InstanceUtil;
import com.msi.tough.utils.LoadBalancerUtil;
import com.msi.tough.utils.SecurityGroupUtils;
/**
* Load Balancer provider
*
* @author raj
*
*/
public class LoadBalancer extends BaseProvider {
private final static Logger logger = Appctx.getLogger(LoadBalancer.class
.getName());
public static String TYPE = "AWS::ElasticLoadBalancing::LoadBalancer";
@SuppressWarnings("unchecked")
@Override
public CFType create0(final CallStruct call) throws Exception {
final AccountType ac = call.getAc();
final String name = call.getName();
final List<Object> listeners = (List<Object>) call
.getProperty("Listeners");
logger.debug("name=" + name + " " + call.toString());
// get resource properties
final LoadBalancerType lbt = new LoadBalancerType();
final List<ListenerType> ltypes = new ArrayList<ListenerType>();
final Object[] objs = HibernateUtil
.withNewSession(new Operation<Object[]>() {
@Override
public Object[] ex(final Session session,
final Object... args) throws Exception {
final ResourcesBean resBean = getResourceBean(session);
LoadBalancerBean tb = LoadBalancerUtil.read(session,
ac.getId(), name);
if (tb == null) {
tb = new LoadBalancerBean();
tb.setUserId(ac.getId());
tb.setLoadBalancerName(name);
tb.setCreatedTime(new Date());
tb.setLbStatus("creating");
tb.setDnsName("0.0.0.0");
tb.setInconfig(true);
tb.setReconfig(false);
tb.setSgName(LoadBalancerUtil.getSecGrpName(
ac.getId(), name));
tb.setAvzones((String) call
.getProperty("AvailabilityZones"));
}
tb.setStackId(call.getStackId());
session.save(tb);
updateData(session, ac, lbt, tb, call);
session.save(tb);
for (final Object o : listeners) {
ListenerType ltype = null;
if (o instanceof ListenerType) {
ltype = (ListenerType) o;
} else {
final JsonNode j = (JsonNode) o;
ltype = new ListenerType();
ltype.setInstancePort(j.get("InstancePort")
.getTextValue());
ltype.setLoadBalancerPort(j.get(
"LoadBalancerPort").getTextValue());
ltype.setProtocol(j.get("Protocol")
.getTextValue().toLowerCase());
}
ltypes.add(ltype);
}
lbt.setListeners(ltypes);
return new Object[] { tb, resBean };
}
});
final LoadBalancerBean lbbean = (LoadBalancerBean) objs[0];
final ResourcesBean resBean = (ResourcesBean) objs[1];
lbt.setPhysicalId(resBean.getPhysicalId());
lbt.setStackId(call.getStackId());
// create loadbalancer security group
final String secGrpId = SecurityGroupUtils.createSecurityGroup(ac,
new TemplateContext(), name, call.getStackId(),
call.getAvailabilityZone(), lbt.getEc2SecGroup(),
"Loadbalancer Security Group");
lbt.setEc2SecGroupId(secGrpId);
// create loadbalancer security ingress
if (listeners != null) {
for (final ListenerType ltype : ltypes) {
SecurityGroupUtils.authorizeSecurityGroupIngress(ac,
lbt.getEc2SecGroupId(),
Integer.parseInt(ltype.getLoadBalancerPort()),
call.getStackId());
}
}
logger.info("security group created & ingress set");
// lbbean = LoadBalancerUtil.read(s, ac.getId(), name);
// create loadbalancer databag
ChefUtil.createDatabagItem(lbt.getDatabag(), "config", lbt.toJson());
// launch instance implementing loadbalancer
final String callSecGrp = lbt.getEc2SecGroupId();
final InstanceType res = Instance.createChefInstance(ac, name
+ "_instance", resBean.getPhysicalId(), call, MapUtil.create(
AVAILABILITYZONE, lbt.getAvailabilityZones(), CHEFROLES,
"transcend_loadbalancer", DATABAG, lbt.getDatabag(),
SECURITYGROUPIDS, callSecGrp, SERVICE, "elb"));
logger.debug("instance launched");
// update resource attributes
lbt.setDnsName((String) res.getAtt(PUBLICIP));
lbt.setNoWait("-1");
final InstanceBean lbinst = HibernateUtil
.withNewSession(new Operation<InstanceBean>() {
@Override
public InstanceBean ex(final Session session,
final Object... args) throws Exception {
final LoadBalancerBean tb = LoadBalancerUtil.read(
session, ac.getId(), name);
tb.setDnsName((String) res.getAtt(PUBLICIP));
tb.setLbInstances(res.getInstanceId());
tb.setLbStatus(res.getStatus());
tb.setSgId(secGrpId);
session.save(tb);
return InstanceUtil.getInstance(session,
tb.getLbInstances());
}
});
logger.debug("instance data updated");
logger.debug("Loadbalancer created " + lbbean.getLoadBalancerName());
if (lbbean.getReconfig() != null && lbbean.getReconfig()) {
reconfigure(lbbean.getLoadBalancerName(), lbt, ac, lbinst);
}
HibernateUtil.withNewSession(new Operation<Object>() {
@Override
public Object ex(final Session session, final Object... args)
throws Exception {
final LoadBalancerBean tb = LoadBalancerUtil.read(session,
ac.getId(), name);
tb.setInconfig(false);
tb.setReconfig(false);
session.save(tb);
return null;
}
});
logger.info("load balancer created " + lbt);
return lbt;
}
@Override
public Resource delete(final CallStruct call) throws Exception {
final AccountType ac = call.getAc();
final String name = call.getPhysicalId();
logger.debug("Deleting " + ac.getId() + " " + name);
HibernateUtil.withNewSession(new Operation<Object>() {
@Override
public Object ex(final Session session, final Object... args)
throws Exception {
final LoadBalancerBean tb = LoadBalancerUtil.read(session,
ac.getId(), name);
tb.setLbStatus("deleting");
session.save(tb);
return null;
}
});
logger.info("status set to deleting " + ac.getId() + " " + name);
return super.delete(call);
}
@Override
public Resource delete0(final CallStruct call) throws Exception {
super.delete0(call);
final AccountType ac = call.getAc();
final String name = call.getPhysicalId();
HibernateUtil.withNewSession(new Operation<Object>() {
@Override
public Object ex(final Session s, final Object... args)
throws Exception {
final LoadBalancerBean lb = LoadBalancerUtil.read(s,
ac.getId(), name);
ChefUtil.deleteDatabag(lb.getDatabag());
LoadBalancerUtil.deleteLoadBalancer(s, ac.getId(), lb);
return null;
}
});
logger.debug("Loadbalancer deleted " + name);
return null;
}
@Override
protected String failHookClazz() {
return LoadBalancerFailHook.class.getName();
}
@Override
public boolean hasChanged(final Session s, final CallStruct call)
throws Exception {
return true;
}
private void reconfigure(final String name, final LoadBalancerType lbt,
final AccountType ac, final InstanceBean inst) {
logger.debug("Loadbalancer reconfigure " + name);
HibernateUtil.withNewSession(new Operation<Object>() {
@Override
public Object ex(final Session session, final Object... args)
throws Exception {
final LoadBalancerBean lbean = LoadBalancerUtil.read(session,
ac.getId(), name);
ChefUtil.createDatabagItem(lbean.getDatabag(), CONFIG,
lbt.toJson());
if (inst != null) {
final String keyDir = (String) ConfigurationUtil
.getConfiguration(Arrays
.asList(new String[] { "KEYS_DIR" }));
final String key = keyDir + "/" + ac.getDefKeyName()
+ ".pem";
final String ip = InstanceUtil.getIP(inst.getPublicIp(),
inst.getPrivateIp(), inst.getAvzone());
CFUtil.executeCommand(ac, null, "ssh", "-i", key, "-o",
"StrictHostKeyChecking=false", "-o",
"UserKnownHostsFile=/dev/null", "root@" + ip,
"rm /etc/haproxy/haproxy.cfg");
CFUtil.runChefClient(session, ac,
new CommaObject(inst.getInstanceId()).toList());
}
lbean.setInconfig(false);
lbean.setReconfig(false);
session.save(lbean);
logger.debug("Loadbalancer reconfigured "
+ lbean.getLoadBalancerName());
return null;
}
});
logger.info("Loadbalancer reconfigured " + name);
}
@SuppressWarnings("unchecked")
@Override
public CFType update0(final CallStruct call) throws Exception {
logger.debug("Loadbalancer update" + call);
final AccountType ac = call.getAc();
final String name = call.getName();
final Boolean alreadyin = HibernateUtil
.withNewSession(new Operation<Boolean>() {
@Override
public Boolean ex(final Session session,
final Object... args) throws Exception {
final LoadBalancerBean tb = LoadBalancerUtil.read(
session, ac.getId(), name);
final Boolean in = tb.getInconfig();
if (in != null && in) {
tb.setReconfig(true);
}
tb.setInconfig(true);
session.save(tb);
return in;
}
});
final LoadBalancerType lbt = HibernateUtil
.withNewSession(new Operation<LoadBalancerType>() {
@Override
public LoadBalancerType ex(final Session s,
final Object... args) throws Exception {
final LoadBalancerBean lbean = LoadBalancerUtil.read(s,
ac.getId(), name);
LoadBalancerType lbt = LoadBalancerUtil
.toLoadBalancerType(s, lbean);
final CommaObject oldInsts = new CommaObject(lbean
.getInstances());
final List<String> instances = (List<String>) call
.getProperty("Instances");
final String isInternal = (String) call
.getProperty("IsInternalInstances");
boolean addedByLB = true;
if (isInternal != null) {
addedByLB = !Boolean.parseBoolean(isInternal);
}
final CommaObject newInsts = new CommaObject(instances);
lbean.setInstances(newInsts.toString());
final List<String> nlist = newInsts.toList();
for (final String i : oldInsts.toList()) {
if (nlist.contains(i)) {
continue;
}
LoadBalancerUtil.removeInstaceFromLoadBalancer(s,
ac.getId(), lbean, i);
}
final List<String> olist = oldInsts.toList();
for (final String i : newInsts.toList()) {
if (olist.contains(i)) {
continue;
}
LoadBalancerUtil.addInstaceToLoadBalancer(s,
ac.getId(), lbean, i, lbean.getAvzones(),
addedByLB);
}
updateData(s, ac, lbt, lbean, call);
lbt = LoadBalancerUtil.toLoadBalancerType(s, lbean);
final List<Object> listeners = (List<Object>) call
.getProperty("Listeners");
if (listeners == null) {
lbean.setListeners(null);
s.save(lbean);
} else {
final Set<ListenerBean> lbeanListeners = lbean
.getListeners();
final List<ListenerType> ltypes = new ArrayList<ListenerType>();
for (final Object o : listeners) {
ListenerType ltype = null;
if (o instanceof ListenerType) {
ltype = (ListenerType) o;
} else {
final JsonNode j = (JsonNode) o;
ltype = new ListenerType();
ltype.setInstancePort(j.get("InstancePort")
.getTextValue());
ltype.setLoadBalancerPort(j.get(
"LoadBalancerPort").getTextValue());
ltype.setProtocol(j.get("Protocol")
.getTextValue().toLowerCase());
}
ltypes.add(ltype);
}
final Set<ListenerBean> delBean = new HashSet<ListenerBean>();
for (final ListenerBean ilistener : lbeanListeners) {
boolean del = true;
for (final ListenerType il : ltypes) {
if (Long.parseLong(il.getLoadBalancerPort()) == ilistener
.getLoadBalancerPort()) {
del = false;
break;
}
}
if (del) {
delBean.add(ilistener);
// create loadbalancer security ingress
{
final CallStruct c = call.newCall(lbt
.getEc2SecGroup());
c.setAc(ac);
c.setCtx(new TemplateContext(null));
c.setName(lbean.getSgId()
+ "_"
+ ilistener
.getLoadBalancerPort());
c.setPhysicalId(c.getName());
c.setParentId(lbean.getSgId());
final Map<String, Object> properties = new HashMap<String, Object>();
properties.put(
Constants.AVAILABILITYZONE,
ac.getDefZone());
properties.put(Constants.GROUPNAME,
lbt.getEc2SecGroup());
properties.put(Constants.FROMPORT,
(int) ilistener
.getLoadBalancerPort());
properties.put(Constants.TOPORT,
(int) ilistener
.getLoadBalancerPort());
properties.put(Constants.CIDRIP,
"0.0.0.0/0");
c.setProperties(properties);
c.setType(SecurityGroupIngress.TYPE);
final SecurityGroupIngress provider = new SecurityGroupIngress();
provider.delete(c);
}
}
}
for (final ListenerBean idel : delBean) {
lbeanListeners.remove(idel);
s.delete(idel);
}
for (final ListenerType iltype : ltypes) {
boolean add = true;
for (final ListenerBean ilistener : lbeanListeners) {
if (Long.parseLong(iltype
.getLoadBalancerPort()) == ilistener
.getLoadBalancerPort()) {
add = false;
break;
}
}
if (add) {
final ListenerBean lsnb = new ListenerBean();
lsnb.setProtocol(iltype.getProtocol());
lsnb.setInstancePort(Long.parseLong(iltype
.getInstancePort()));
lsnb.setLoadBalancerPort(Long
.parseLong(iltype
.getLoadBalancerPort()));
s.save(lsnb);
lbeanListeners.add(lsnb);
// create loadbalancer security ingress
{
final CallStruct c = call.newCall(lbean
.getEc2SecGroup());
c.setAc(ac);
c.setCtx(new TemplateContext(null));
c.setName(lbean.getSgId() + "_"
+ lsnb.getLoadBalancerPort());
c.setParentId(lbean.getSgId());
final Map<String, Object> properties = new HashMap<String, Object>();
properties.put(
Constants.AVAILABILITYZONE,
ac.getDefZone());
properties.put(Constants.GROUPNAME,
lbt.getEc2SecGroup());
properties.put(Constants.FROMPORT,
(int) lsnb
.getLoadBalancerPort());
properties.put(Constants.TOPORT,
(int) lsnb
.getLoadBalancerPort());
properties.put(Constants.CIDRIP,
"0.0.0.0/0");
c.setProperties(properties);
c.setType(SecurityGroupIngress.TYPE);
final SecurityGroupIngress provider = new SecurityGroupIngress();
provider.create(c);
}
}
}
lbt.setListeners(ltypes);
lbean.setListeners(lbeanListeners);
s.save(lbean);
}
return lbt;
}
});
// final LoadBalancerBean lbean = LoadBalancerUtil.read(s0, ac.getId(),
// name);
lbt.setPostWaitUrl(null);
lbt.setStackId(call.getStackId());
if (alreadyin == null || !alreadyin) {
final InstanceBean lbinst = HibernateUtil
.withNewSession(new Operation<InstanceBean>() {
@Override
public InstanceBean ex(final Session session,
final Object... args) throws Exception {
final LoadBalancerBean tb = LoadBalancerUtil.read(
session, ac.getId(), name);
return InstanceUtil.getInstance(session,
tb.getLbInstances());
}
});
reconfigure(name, lbt, ac, lbinst);
}
logger.info("Loadbalancer updated" + name);
return lbt;
}
@SuppressWarnings("unchecked")
private void updateData(final Session s, final AccountType ac,
final LoadBalancerType lbt, final LoadBalancerBean lb,
final CallStruct call) {
lbt.setAvailabilityZones((String) call.getProperty("AvailabilityZones"));
final HealthCheckType hc = LoadBalancerUtil.toHealthCheckType(call
.getProperty("HealthCheck"));
lbt.setHealthCheck(hc);
if (hc != null) {
lb.setHealthyThreshold(Long.parseLong(hc.getHealthyThreshold()));
lb.setUnhealthyThreshold(Long.parseLong(hc.getUnhealthyThreshold()));
lb.setInterval(Long.parseLong(hc.getInterval()));
lb.setTimeout(Long.parseLong(hc.getTimeout()));
lb.setTarget(hc.getTarget());
}
final List<String> insts = (List<String>) call.getProperty("Instances");
lbt.setInstances(insts);
final List<InstanceType> idata = new ArrayList<InstanceType>();
if (insts != null) {
for (final String str : insts) {
final InstanceBean ib = InstanceUtil.getInstance(s, str);
if (ib != null) {
final InstanceType it = InstanceUtil.toInstanceType(ib);
idata.add(it);
}
}
}
lbt.setInstanceData(idata);
if (call.getProperty("AppCookieStickinessPolicy") != null) {
final List<AppCookieStickinessPolicyType> appList = LoadBalancerUtil
.toAppCookieStickinessPolicy(call
.getProperty("AppCookieStickinessPolicy"));
if (appList != null) {
lbt.setAppCookieStickinessPolicy(appList);
lb.setAppCookieStickinessPolicy(JsonUtil.toJsonString(call
.getProperty("AppCookieStickinessPolicy")));
}
} else {
lb.setAppCookieStickinessPolicy(null);
}
if (call.getProperty("LBCookieStickinessPolicy") != null) {
final List<LBCookieStickinessPolicyType> lblist = LoadBalancerUtil
.toLBCookieStickinessPolicy(call
.getProperty("LBCookieStickinessPolicy"));
if (lblist != null) {
lbt.setLbCookieStickinessPolicy(lblist);
lb.setLbCookieStickinessPolicy(JsonUtil.toJsonString(call
.getProperty("LBCookieStickinessPolicy")));
}
} else {
lb.setLbCookieStickinessPolicy(null);
}
// There will be one databag per load balancer
final String databag = LoadBalancerUtil.getDatabagName(ac.getId(),
call.getName());
lbt.setDatabag(databag);
lbt.setEc2SecGroup(lb.getSgName());
lbt.setAcId(ac.getId());
// the url on which transcend_loadbalancer chef role will call back when
// its installation is complete
lbt.setPostWaitUrl((String) ConfigurationUtil.getConfiguration(Arrays
.asList(new String[] { "TRANSCEND_URL",
lbt.getAvailabilityZones() })));
lb.setDatabag(databag);
lb.setEc2SecGroup(lbt.getEc2SecGroup());
s.save(lb);
}
@Override
protected String waitHookClazz() {
return LoadBalancerWaitHook.class.getName();
}
}
|
[
"[email protected]"
] | |
6122ad445e83a4b32ba90b7da4495de6f89a9497
|
ecd9a0bc466b44afb37c2d12ee8537fdebe7c8c9
|
/src/offlineio/payload/response/JwtAuthResponse.java
|
75bbe70d88df7862a0c6a70586f0185a3e47343a
|
[] |
no_license
|
bhaskor-sarmah/eft_io_offline
|
6baf5de922eaa32f761e99deb3f08e4a88d0fb09
|
59174c649bd7ea9e2762a188e64133c38f8aa130
|
refs/heads/master
| 2022-12-13T17:06:58.859080 | 2020-05-24T16:45:55 | 2020-05-24T16:45:55 | 297,279,339 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,053 |
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 offlineio.payload.response;
/**
*
* @author Bhaskor
*/
public class JwtAuthResponse {
private String accessToken;
private String tokenType = "Bearer";
private ThanaPayload thana;
public JwtAuthResponse() {
}
public JwtAuthResponse(String accessToken, ThanaPayload thana) {
this.accessToken = accessToken;
this.thana = thana;
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public String getTokenType() {
return tokenType;
}
public void setTokenType(String tokenType) {
this.tokenType = tokenType;
}
public ThanaPayload getThana() {
return thana;
}
public void setThana(ThanaPayload thana) {
this.thana = thana;
}
}
|
[
"[email protected]"
] | |
09eeb56fc812af7af15e2b762f6dede37afc5259
|
d00544d2fae0454709174c77f6c600c1b1346981
|
/Factorial of a number/Main.java
|
1602cec95143361ef0ac54e3d86d5df011babe18
|
[] |
no_license
|
kvs69/Playground
|
0c76d3b3ff73211315d7f0fb5b0334f8b96b5729
|
10e52929e0f0b0ebd68668294e091a2f1c28776a
|
refs/heads/master
| 2020-05-18T19:27:59.027103 | 2019-07-20T18:51:29 | 2019-07-20T18:51:29 | 184,609,151 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 295 |
java
|
import java.util.Scanner;
class Main{
public static void main (String[] args){
// Type your code here
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int sum=1;
while(n>0)
{
sum=sum*n;
n--;
}
System.out.println(sum);
}
}
|
[
"[email protected]"
] | |
10053aab235b9f10a46e6183d7fda906a424ac74
|
0a5c1c4302967476a88284f776e618b67a614d40
|
/src/sa/edu/uqu/cs/AdminRMIClient.java
|
f1470c80f9d02caab6ff20fb8fa987096cf50ac7
|
[] |
no_license
|
DevFatani/Parallel-Project
|
01b62205e3069b90e52852a86bb9a27f3808a1f8
|
46d9ba13c108abe078f55780399417673d9b6875
|
refs/heads/master
| 2021-01-17T08:15:00.123251 | 2016-07-20T08:49:05 | 2016-07-20T08:49:05 | 63,765,480 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 12,642 |
java
|
package sa.edu.uqu.cs;
import java.awt.Button;
import java.awt.Event;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
/**
*
* @author Muhammad Ashari Fatani
*/
public class AdminRMIClient extends JFrame {
private final static Font myFont = new Font("Tahoma", Font.PLAIN, 15);
private IDataCollector collector;
private DataWrapper dataWrapper;
private final JPanel contentPanel;
private JTextField jtfUserName;
private JPasswordField jpfPassword;
AdminRMIClient() throws RemoteException, NotBoundException {
super("AMAN SYSTEM");
this.setupRMIConnection();
this.contentPanel = new JPanel();
this.setSize(300, 150);
this.setLocationRelativeTo(null);
this.setResizable(false);
this.iniLayout();
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
private void setupRMIConnection() throws RemoteException, NotBoundException {
Registry registry = LocateRegistry.getRegistry("localhost", Constants.RMI_PORT);
this.collector = (IDataCollector) registry.lookup(Constants.RMI_ID);
}
public static void main(String[] args) throws RemoteException, NotBoundException {
new AdminRMIClient();
}
private void iniLayout() {
this.getContentPane().add(this.contentPanel);
this.contentPanel.add(this.createCustomerPanel());
}
protected JPanel createCustomerPanel() {
GridLayout layout = new GridLayout(3, 1);
JPanel mainPanel = new JPanel();
mainPanel.setLayout(layout);
JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel p2 = new JPanel(new FlowLayout(FlowLayout.CENTER));
JPanel p3 = new JPanel(new FlowLayout(FlowLayout.CENTER));
mainPanel.add(p1);
mainPanel.add(p2);
mainPanel.add(p3);
JLabel lblUserName = new JLabel("USER NAME");
lblUserName.setFont(myFont);
this.jtfUserName = new JTextField(15);
p1.add(lblUserName);
p1.add(this.jtfUserName);
JLabel lblPassword = new JLabel("PASSWORD");
lblPassword.setFont(myFont);
this.jpfPassword = new JPasswordField(15);
p2.add(lblPassword);
p2.add(this.jpfPassword);
JButton btnLogin = new JButton("LOGIN");
JButton btnNewAdmin = new JButton("NEW ADMIN");
btnLogin.addActionListener((ActionEvent e) -> {
try {
isAuth();
} catch (RemoteException ex) {
Logger.getLogger(AdminRMIClient.class.getName()).log(Level.SEVERE, null, ex);
}
});
btnLogin.setFont(myFont);
btnNewAdmin.addActionListener((ActionEvent e) -> {
try {
signUp();
} catch (RemoteException ex) {
Logger.getLogger(AdminRMIClient.class.getName()).log(Level.SEVERE, null, ex);
}
});
btnNewAdmin.setFont(myFont);
p3.add(btnLogin);
p3.add(btnNewAdmin);
return mainPanel;
}
private void isAuth() throws RemoteException {
if (this.jtfUserName.getText().equals("") || this.jpfPassword.getPassword().length == 0) {
JOptionPane.showMessageDialog(this, "invaled Usen Or Pssword", "Auth Error",
JOptionPane.ERROR_MESSAGE);
} else {
boolean result = this.collector.isAuth(this.jtfUserName.getText(),
String.valueOf(this.jpfPassword.getPassword()));
if (result) {
this.setVisible(false);
new ControlFrame();
}
}
}
private void signUp() throws RemoteException {
String username = JOptionPane.showInputDialog("Please input username: ");
while (username.equals("")) {
showAlet("please fill the filed");
username = JOptionPane.showInputDialog("Please input username: ");
}
String password = JOptionPane.showInputDialog("Please input password: ");
while (password.equals("")) {
showAlet("please fill the filed");
password = JOptionPane.showInputDialog("Please input password: ");
}
boolean result = this.collector.newAdmin(username, password);
System.out.println(result);
}
private void showAlet(String msg) {
JOptionPane.showMessageDialog(this, msg, "AMAN SYSTEM",
JOptionPane.INFORMATION_MESSAGE);
}
class ControlFrame extends JFrame {
private JTextField jtfPcIp;
private final JPanel contentPanel;
ControlFrame() {
super("CONTROL PANEL");
this.setSize(300, 200);
this.setLocationRelativeTo(null);
this.setResizable(false);
this.contentPanel = new JPanel();
this.iniLayout();
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
private void iniLayout() {
this.getContentPane().add(this.contentPanel);
this.contentPanel.add(this.createCustomerPanel());
}
protected JPanel createCustomerPanel() {
GridLayout layout = new GridLayout(4, 1);
JPanel mainPanel = new JPanel();
mainPanel.setLayout(layout);
JPanel p1 = new JPanel(new FlowLayout(FlowLayout.CENTER));
JPanel p2 = new JPanel(new FlowLayout(FlowLayout.CENTER));
JPanel p3 = new JPanel(new FlowLayout(FlowLayout.CENTER));
JPanel p4 = new JPanel(new FlowLayout(FlowLayout.CENTER));
mainPanel.add(p1);
mainPanel.add(p2);
mainPanel.add(p3);
mainPanel.add(p4);
JLabel lblTxt = new JLabel("PLEASE ENTER PC IP TO INVOKE");
lblTxt.setFont(myFont);
this.jtfPcIp = new JTextField(15);
p1.add(lblTxt);
p2.add(this.jtfPcIp);
JButton btnCollectData = new JButton("INVOKE PC TO COLLECT DATA");
btnCollectData.setFont(myFont);
JButton btnShowData = new JButton("INVOKE PC TO SHOW DATA");
btnShowData.setFont(myFont);
btnCollectData.addActionListener((ActionEvent e) -> {
try {
invokePcCollectData();
} catch (RemoteException ex) {
Logger.getLogger(AdminRMIClient.class.getName()).log(Level.SEVERE, null, ex);
}
});
btnShowData.addActionListener((ActionEvent e) -> {
if (!jtfPcIp.getText().equals("") && jtfPcIp.getText().contains(".")) {
try {
new ShowData(jtfPcIp.getText());
} catch (RemoteException ex) {
Logger.getLogger(AdminRMIClient.class.getName()).log(Level.SEVERE, null, ex);
}
} else {
showAlet("please fill the filed");
}
});
p3.add(btnCollectData);
p4.add(btnShowData);
return mainPanel;
}
private void invokePcCollectData() throws RemoteException {
String ip = this.jtfPcIp.getText();
if (!ip.equals("") && ip.contains(".")) {
String result = collector.fetchData(ip);
System.out.println(result);
} else {
showAlet("please fill the filed");
}
}
}
class ShowData extends JFrame {
private final JPanel contentPanel;
private final DataWrapper dataWrapper;
ShowData(String ip) throws RemoteException {
super("INFORMATION PANEL");
this.dataWrapper = collector.loadData(ip);
this.setSize(500, 500);
this.setLocationRelativeTo(null);
this.setResizable(false);
this.contentPanel = new JPanel();
this.iniLayout();
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
private void iniLayout() {
this.getContentPane().add(this.contentPanel);
this.contentPanel.add(this.createCustomerPanel());
}
protected JPanel createCustomerPanel() {
GridLayout layout = new GridLayout(9, 1);
JPanel mainPanel = new JPanel();
mainPanel.setLayout(layout);
JPanel p1 = new JPanel(new FlowLayout(FlowLayout.CENTER));
JPanel p2 = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel p3 = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel p4 = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel p5 = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel p6 = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel p7 = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel p8 = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel p9 = new JPanel(new FlowLayout(FlowLayout.LEFT));
mainPanel.add(p1);
mainPanel.add(p2);
mainPanel.add(p3);
mainPanel.add(p4);
mainPanel.add(p5);
mainPanel.add(p6);
mainPanel.add(p7);
mainPanel.add(p8);
mainPanel.add(p9);
JLabel lblRes = new JLabel("Resources");
lblRes.setFont(myFont);
p1.add(lblRes);
JLabel lblHostName = new JLabel("HOST NAME [" + this.dataWrapper.getHostName() + "]");
lblHostName.setFont(myFont);
p2.add(lblHostName);
String cpu = this.dataWrapper.getCpuUsage() == null ? "0" : this.dataWrapper.getCpuUsage();
p3.add(new JLabel("CPU [" + cpu + " %]"));
String mem = this.dataWrapper.getUsageMemory() == null ? "0" : this.dataWrapper.getUsageMemory();
p4.add(new JLabel("Memory [" + mem + " %]"));
String storage = this.dataWrapper.getUsageStorage() == null ? "0" : this.dataWrapper.getUsageStorage();
p5.add(new JLabel("Storage [" + storage + " %]"));
String processorId = this.dataWrapper.getProcessorId() == null ? "0" : this.dataWrapper.getProcessorId();
p6.add(new JLabel("Processor id [" + processorId + "]"));
String processorArch = this.dataWrapper.getProcessorArch() == null ? "0" : this.dataWrapper.getProcessorArch();
p7.add(new JLabel("Processor architecture [" + processorArch + "]"));
String processorNum = this.dataWrapper.getProcessorNum() == null ? "0" : this.dataWrapper.getProcessorNum();
p8.add(new JLabel("Processor Number [" + processorNum + "]"));
String netInfo = "";
for (int i = 0; i < this.dataWrapper.getNetwork().size(); i++) {
netInfo += "\n[et proto - " + this.dataWrapper.getNetwork().get(i).get("net_proto")
+ "] | [net localadd - " + this.dataWrapper.getNetwork().get(i).get("net_localadd")
+ "] | [net foreignadd - " + this.dataWrapper.getNetwork().get(i).get("net_foreignadd")
+ "] | [net state - " + this.dataWrapper.getNetwork().get(i).get("net_state")
+ "] | [net pid - " + this.dataWrapper.getNetwork().get(i).get("net_pid") + "]";
}
final String showNetInfo = netInfo;
Button btnNet = new Button("NETWORK") {
@Override
public boolean action(Event evt, Object what) {
showAlet(showNetInfo);
return true;
}
};
btnNet.setFont(myFont);
p9.add(btnNet);
return mainPanel;
}
}
}
|
[
"[email protected]"
] | |
a15d1dd058600446405c7ae002ab6b257d822ff8
|
6fbb8d4e39dbf306f9881de57659ee6bdcd6870f
|
/Coursera/src/com/coursera/oo/imc/Paciente.java
|
7c0fb87612df4d3b83d9ccc7bc01b5f66c268524
|
[] |
no_license
|
LiniiS/coursera-projects
|
752f6891b1fea3bf7d60c89abda7611efadfba9d
|
3b7878728c6b159aa322520466c9746e7480a7b8
|
refs/heads/master
| 2023-06-05T10:17:07.475296 | 2021-06-19T14:57:16 | 2021-06-19T14:57:16 | 352,639,461 | 0 | 0 | null | null | null | null |
ISO-8859-1
|
Java
| false | false | 1,871 |
java
|
package com.coursera.oo.imc;
public class Paciente {
private double peso; // quilos
private double altura; // metros
public Paciente(double peso, double altura) {
this.peso = peso;
this.altura = altura;
}
public double calcularIMC(double peso, double altura) {
double IMC = this.peso / (this.altura * this.altura);
return IMC;
}
public void diagnostico(double IMC) {
boolean imcBaixoPesoMuitoGrave = IMC < 16.00;
boolean imcBaixoPesoGrave = IMC >= 16.00 && IMC <= 16.99;
boolean imcBaixoPeso = IMC >= 17 && IMC <= 18.4;
boolean imcPesoNormal = IMC >= 18.50 && IMC <= 24.99;
boolean imcSobrepeso = IMC >= 25 && IMC <= 29.99;
boolean imcObesidadeGrauUm = IMC >= 30 && IMC <= 34.99;
boolean imcObesidadeGrauDois = IMC >= 35 && IMC <= 39.99;
boolean imcObesidadeGrauTres = IMC >= 40;
if (imcBaixoPesoMuitoGrave) {
System.out.println("Baixo peso muito grave = IMC abaixo de 16 kg/m²");
} else if (imcBaixoPesoGrave) {
System.out.println("Baixo peso grave = IMC entre 16 e 16,99 kg/m²");
} else if (imcBaixoPeso) {
System.out.println("Baixo peso = IMC entre 17 e 18,49 kg/m²");
} else if (imcPesoNormal) {
System.out.println("Peso normal = IMC entre 18,50 e 24,99 kg/m²");
} else if (imcSobrepeso) {
System.out.println("Sobrepeso = IMC entre 25 e 29,99 kg/m²");
} else if (imcObesidadeGrauUm) {
System.out.println("Obesidade grau I = IMC entre 30 e 34,99 kg/m²");
} else if (imcObesidadeGrauDois) {
System.out.println("Obesidade grau II = IMC entre 35 e 39,99 kg/m²");
} else if (imcObesidadeGrauTres) {
System.out.println("Obesidade grau III (obesidade mórbida) = IMC igual ou maior que 40 kg/m²");
} else {
System.out.println("Não foi possível diagnosticar o IMC");
}
}
public double getPeso() {
return peso;
}
public double getAltura() {
return altura;
}
}
|
[
"[email protected]"
] | |
689b4b9eadb67ed13721a80f664c2678341ca4f8
|
33d5b98eea9568a783c979a7b726b47ffc95320c
|
/Fa7.Esp.Arq.Software.NonConventionalDatabase/pos/src/main/java/trabalhoBanco/UpdatTabelas.java
|
093e3ef366999388eb84ab63b6540bd41cb39223
|
[] |
no_license
|
charles-marques/old-repos
|
152073dd1a89397f583ee247f402ac5a84c3af79
|
bc118df3dc98cfdbb99a5513ed511549da0673ed
|
refs/heads/main
| 2022-12-28T05:24:37.976348 | 2020-10-11T17:36:33 | 2020-10-11T17:36:33 | 303,175,993 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,917 |
java
|
package trabalhoBanco;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class UpdatTabelas {
static final String JDBC_DRIVER = "org.postgresql.Driver";
static final String DB_URL = "jdbc:postgresql://localhost:5432/db_nosqlapp";
static final String USER = "postgres";
static final String PASS = "@dmin123";
static Connection conn = null;
static Statement stmt = null;
public void UpdateAlunos() throws SQLException{
conn = DriverManager.getConnection(DB_URL, USER, PASS);
stmt = conn.createStatement();
Long in = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
String sql = "UPDATE ALUNOS SET NOME= 'Maria das Graças"+ i +"' WHERE ID_ALUNO =" +i;
stmt.executeUpdate(sql);
}
Long out = System.currentTimeMillis();
System.out.println("Demorou "+ ((out-in)/1000)+" seg para alterar 1000000 alunos");
}
public void UpdateAulas() throws SQLException{
conn = DriverManager.getConnection(DB_URL, USER, PASS);
stmt = conn.createStatement();
Long in = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
String sql = "UPDATE AULA SET DESCRICAO = 'Aula 0"+ i +"' WHERE ID_AULA =" +i;
stmt.executeUpdate(sql);
}
Long out = System.currentTimeMillis();
System.out.println("Demorou "+ ((out-in)/1000)+" seg para alterar 1000000 aulas");
}
public void UpdateCursos() throws SQLException{
conn = DriverManager.getConnection(DB_URL, USER, PASS);
stmt = conn.createStatement();
Long in = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
String sql = "UPDATE CURSOS SET DESCRICAO = 'Curso 0"+ i +"' WHERE ID_CURSO =" +i;
stmt.executeUpdate(sql);
}
Long out = System.currentTimeMillis();
System.out.println("Demorou "+ ((out-in)/1000)+" seg para alterar 1000000 cursos");
}
public void UpdateMatriculas() throws SQLException{
conn = DriverManager.getConnection(DB_URL, USER, PASS);
stmt = conn.createStatement();
Long in = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
String sql = "UPDATE MATRICULAS SET ID_ALUNO = '2' WHERE ID_ALUNO = 30";
stmt.executeUpdate(sql);
}
Long out = System.currentTimeMillis();
System.out.println("Demorou "+ ((out-in)/1000)+" seg para alterar 1000000 matriculas");
}
public void UpdateProfessores() throws SQLException{
conn = DriverManager.getConnection(DB_URL, USER, PASS);
stmt = conn.createStatement();
Long in = System.currentTimeMillis();
for(int i = 0; i< 100000; i++){
String sql = "UPDATE PROFESSORES SET NOME = 'José da Silva' WHERE ID_PROFESSOR=" +i;
stmt.executeUpdate(sql);
}
Long out = System.currentTimeMillis();
System.out.println("Demorou "+ ((out-in)/1000)+" seg para alterar 1000000 professores");
}
}
|
[
"[email protected]"
] | |
d4467d956d440d68be2a95c4d994a1726501c122
|
451e6b423f8b2d64ecbaa52730cce6124dfce23a
|
/appDemoApk/src/main/java/com/example/wangjun/demoapk/SoftwareDemo/CDevicePolicyManagerActivity.java
|
1ad06c38b236235d7161d1c0bcaf3e65c1dd9edb
|
[] |
no_license
|
wangjun7121/DemoApk
|
8a90b0c6599620a62425d1bdaa20a27a7e4c282f
|
e78899a255ad4bc4888348ae1b126c7ed264c4a1
|
refs/heads/master
| 2021-06-03T02:16:37.582153 | 2021-02-18T06:08:24 | 2021-02-18T06:08:24 | 103,345,970 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,488 |
java
|
package com.example.wangjun.demoapk.SoftwareDemo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.example.wangjun.demoapk.R;
import android.app.Activity;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
public class CDevicePolicyManagerActivity extends AppCompatActivity implements View.OnClickListener {
private Button btn_regDivice,btn_unRegDivice,btn_lockScreen;
private DevicePolicyManager devicePolicyManager;
public ComponentName componentName;//权限监听器
private boolean flag;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.softwaredemo_cdevicepolicymanager);
btn_regDivice = (Button)findViewById(R.id.btn_regDivice);
btn_regDivice.setOnClickListener(this);
btn_unRegDivice = (Button)findViewById(R.id.btn_unRegDivice);
btn_unRegDivice.setOnClickListener(this);
btn_lockScreen = (Button)findViewById(R.id.btn_lockScreen);
btn_lockScreen.setOnClickListener(this);
devicePolicyManager = (DevicePolicyManager) getSystemService(DEVICE_POLICY_SERVICE);
componentName = new ComponentName(this,CDevicePolicyManager_MyAdmin.class);//用广播接收器实例化一个系统组件
flag = devicePolicyManager.isAdminActive(componentName);//判断这个应用是否激活了设备管理器
if(flag){
btn_regDivice.setVisibility(View.GONE);
btn_lockScreen.setVisibility(View.VISIBLE);
btn_unRegDivice.setVisibility(View.VISIBLE);
}else{
btn_regDivice.setVisibility(View.VISIBLE);
btn_lockScreen.setVisibility(View.GONE);
btn_unRegDivice.setVisibility(View.GONE);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_regDivice:
Intent i = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);//激活系统设备管理器
i.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, componentName);//注册系统组件
startActivity(i);
break;
case R.id.btn_unRegDivice:
devicePolicyManager.removeActiveAdmin(componentName);//注销系统组件
this.finish();
break;
case R.id.btn_lockScreen:
devicePolicyManager.lockNow();
//devicePolicyManager.resetPassword("123", 0); // 设置锁屏密码
//devicePolicyManager.wipeData(0); 恢复出厂设置 (建议大家不要在真机上测试) 模拟器不支持该操作
this.finish();
break;
}
}
@Override
protected void onResume(){
super.onResume();
boolean flagChanged = devicePolicyManager.isAdminActive(componentName);//判断这个应用是否激活了设备管理器
if(flagChanged){
btn_regDivice.setVisibility(View.GONE);
btn_lockScreen.setVisibility(View.VISIBLE);
btn_unRegDivice.setVisibility(View.VISIBLE);
}else{
btn_regDivice.setVisibility(View.VISIBLE);
btn_lockScreen.setVisibility(View.GONE);
btn_unRegDivice.setVisibility(View.GONE);
}
}
}
|
[
"[email protected]"
] | |
e2e8a3f786bfa5a972ed232f117bec600f2058ad
|
fb1373a2a5d826d93e84f048f6f31a17249d08bb
|
/src/main/java/cn/cccxu/controller/RegisterController.java
|
09d3114f9b78cff2a13c1c352c8354fcea627fd4
|
[] |
no_license
|
cccxu/coding-now
|
4a2f915dcd22330d85428c4457b472596b1f33c7
|
f26eb94c25bdc4b2efd814f4c87957537bd16a41
|
refs/heads/master
| 2022-06-24T21:59:51.071833 | 2019-07-10T06:09:21 | 2019-07-10T06:09:21 | 194,827,002 | 0 | 1 | null | 2022-06-17T02:16:00 | 2019-07-02T08:58:39 |
Java
|
UTF-8
|
Java
| false | false | 872 |
java
|
package cn.cccxu.controller;
import cn.cccxu.model.User;
import cn.cccxu.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author 徐浩
* created at 2019/07/01
*/
@RestController
public class RegisterController {
private RegisterService registerService;
@Autowired
RegisterController(RegisterService mRegisterService) {
this.registerService = mRegisterService;
}
//注册,通过json传入User对象
@PostMapping(path = "/account/register")
public boolean register(@RequestBody User user){
return registerService.register(user);
}
@GetMapping(path="/account/checkUserIdUsable")
public boolean checkUserIdUsable(@RequestParam String userId) {
return registerService.checkUserIdUseable(userId);
}
}
|
[
"[email protected]"
] | |
df0850da42b794ca033506664f9569eec4a5a6f8
|
7cdff80497df675b971afe6cb4f4c5a42761d93e
|
/budgeteer-web-interface/src/main/java/org/wickedsource/budgeteer/service/imports/PlanRecordDatabaseImporter.java
|
5cd0de0b3dc60c73083d8eeeaae7b99754af2d4b
|
[] |
no_license
|
schreumann/budgeteer
|
c28a05a240576295678cd84dc9b2deb29b850645
|
01c3c84f037b8bf51d82311130f969c601d6095b
|
refs/heads/master
| 2020-12-11T05:27:51.592808 | 2014-12-09T13:47:58 | 2014-12-09T13:47:58 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,456 |
java
|
package org.wickedsource.budgeteer.service.imports;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.joda.money.Money;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.wickedsource.budgeteer.imports.api.ImportedPlanRecord;
import org.wickedsource.budgeteer.persistence.budget.BudgetEntity;
import org.wickedsource.budgeteer.persistence.person.DailyRateEntity;
import org.wickedsource.budgeteer.persistence.person.DailyRateRepository;
import org.wickedsource.budgeteer.persistence.person.PersonEntity;
import org.wickedsource.budgeteer.persistence.record.PlanRecordEntity;
import org.wickedsource.budgeteer.persistence.record.PlanRecordRepository;
import javax.annotation.PostConstruct;
import java.util.*;
@Component
@Scope("prototype")
public class PlanRecordDatabaseImporter extends RecordDatabaseImporter {
@Autowired
private PlanRecordRepository planRecordRepository;
@Autowired
private DailyRateRepository dailyRateRepository;
public PlanRecordDatabaseImporter(long projectId, String importType) {
super(projectId, importType);
}
@PostConstruct
public void init() {
super.init();
}
private Map<RecordKey, List<ImportedPlanRecord>> groupedRecords = new HashMap<RecordKey, List<ImportedPlanRecord>>();
public void importRecords(List<ImportedPlanRecord> records) {
groupRecords(records);
for (RecordKey key : groupedRecords.keySet()) {
importRecordGroup(key, groupedRecords.get(key));
}
}
private void groupRecords(List<ImportedPlanRecord> records) {
for (ImportedPlanRecord record : records) {
RecordKey key = new RecordKey(record.getPersonName(), record.getBudgetName(), record.getDailyRate());
List<ImportedPlanRecord> keyList = groupedRecords.get(key);
if (keyList == null) {
keyList = new ArrayList<ImportedPlanRecord>();
groupedRecords.put(key, keyList);
}
keyList.add(record);
}
}
/**
* Imports a list of records with the same person, budget and daily rate.
*/
private void importRecordGroup(RecordKey groupKey, List<ImportedPlanRecord> records) {
Date earliestDate = new Date(Long.MAX_VALUE);
Date latestDate = new Date(0);
BudgetEntity budget = getBudget(groupKey.getBudgetName());
PersonEntity person = getPerson(groupKey.getPersonName());
List<PlanRecordEntity> entitiesToImport = new ArrayList<PlanRecordEntity>();
for (ImportedPlanRecord record : records) {
PlanRecordEntity recordEntity = new PlanRecordEntity();
recordEntity.setDate(record.getDate());
recordEntity.setPerson(person);
recordEntity.setBudget(budget);
recordEntity.setMinutes(record.getMinutesPlanned());
recordEntity.setImportRecord(getImportRecord());
recordEntity.setDailyRate(record.getDailyRate());
entitiesToImport.add(recordEntity);
if (record.getDate().after(latestDate)) {
latestDate = record.getDate();
}
if (record.getDate().before(earliestDate)) {
earliestDate = record.getDate();
}
}
planRecordRepository.save(entitiesToImport);
if (!entitiesToImport.isEmpty()) {
// creating daily rate or updating it with new start and end dates
DailyRateEntity dailyRate = dailyRateRepository.findByBudgetAndPersonInDateRange(budget.getId(), person.getId(), earliestDate, latestDate);
if (dailyRate == null) {
dailyRate = new DailyRateEntity();
dailyRate.setBudget(budget);
dailyRate.setPerson(person);
}
dailyRate.setRate(groupKey.getDailyRate());
dailyRate.setDateStart(earliestDate);
dailyRate.setDateEnd(latestDate);
dailyRateRepository.save(dailyRate);
}
// updating start and end date for import record
if (getImportRecord().getStartDate() == null || getImportRecord().getStartDate().after(earliestDate)) {
getImportRecord().setStartDate(earliestDate);
}
if (getImportRecord().getEndDate() == null || getImportRecord().getEndDate().before(latestDate)) {
getImportRecord().setEndDate(latestDate);
}
}
class RecordKey {
private String personName;
private String budgetName;
private Money dailyRate;
public RecordKey(String personName, String budgetName, Money dailyRate) {
this.personName = personName;
this.budgetName = budgetName;
this.dailyRate = dailyRate;
}
public String getPersonName() {
return personName;
}
public String getBudgetName() {
return budgetName;
}
public Money getDailyRate() {
return dailyRate;
}
@Override
public boolean equals(Object o) {
return EqualsBuilder.reflectionEquals(this, o);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
}
}
|
[
"[email protected]"
] | |
f3031aaff055de64bec93612a87ea3761d117080
|
ce8c6b6c9dd9db0ebdb82cb40f6b954ea9649971
|
/bootstrap/src/main/java/boot/controller/FoodController.java
|
da277398554ec328f9cb43564e66821c999ce9d9
|
[] |
no_license
|
roza-sara-hurta/unidad-4-ordinario-spring
|
31defccf9904b34c9ee90cd5d728e0a04ad7dcf4
|
d13895e7622a1a75a8a736114ba9c1684b8c1890
|
refs/heads/master
| 2020-06-21T10:23:45.724419 | 2016-11-25T22:24:48 | 2016-11-25T22:24:48 | 74,791,079 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,931 |
java
|
package boot.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import boot.model.Food;
import boot.service.FoodService;
@Controller
public class FoodController {
@Autowired
private FoodService foodService ;
@GetMapping("/foods")
public String home(HttpServletRequest request) {
request.setAttribute("mode", "MODE_HOME");
return "foods";
}
//
@GetMapping("/all-foods")
public String allFoods(HttpServletRequest request) {
request.setAttribute("foods", foodService.findAll());
request.setAttribute("mode", "MODE_FOODS");
return "foods";
}
@GetMapping("/new-food")
public String newFood(HttpServletRequest request) {
request.setAttribute("mode", "MODE_NEW");
return "foods";
}
@PostMapping("/save-food")
public String saveFood(@ModelAttribute Food food,
BindingResult bindingResult, HttpServletRequest request) {
foodService.save(food);
request.setAttribute("foods", foodService.findAll());
request.setAttribute("mode", "MODE_FOODS");
return "foods";
}
@GetMapping("/update-food")
public String updateFood(@RequestParam int id, HttpServletRequest request) {
request.setAttribute("food", foodService.finOne(id));
request.setAttribute("mode", "MODE_UPDATE");
return "foods";
}
@GetMapping("/delete-food")
public String deleteFood(@RequestParam int id, HttpServletRequest request) {
foodService.delete(id);
request.setAttribute("foods", foodService.findAll());
request.setAttribute("mode", "MODE_FOODS");
return "foods";
}
}
|
[
"[email protected]"
] | |
f1a478e6e4cbf7f93751b18321d9c7096ec45647
|
b1249803a5fb052c6130f18ef0a2874fed714be2
|
/src/main/java/com/shengsiyuan/netty/secondexample/MyClientInitializer.java
|
8ba47ed25851e51edc53394657e7e4e9c6a67382
|
[] |
no_license
|
aronykl/netty_lecture
|
4bc3426b8ca3e596d89d1d0d01c0946b85110e63
|
dd345ab57b703d43ade1097603c683167acdefdb
|
refs/heads/master
| 2021-01-15T22:56:57.717004 | 2018-10-06T08:36:13 | 2018-10-06T08:36:13 | 93,918,150 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,028 |
java
|
package com.shengsiyuan.netty.secondexample;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
import io.netty.handler.codec.LengthFieldPrepender;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
import io.netty.util.CharsetUtil;
/**
*
* @Author: zhouwen
* @Date: 2017/8/12 12:43
*/
public class MyClientInitializer extends ChannelInitializer<SocketChannel> {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4));
pipeline.addLast(new LengthFieldPrepender(4));
pipeline.addLast(new StringDecoder(CharsetUtil.UTF_8));
pipeline.addLast(new StringEncoder(CharsetUtil.UTF_8));
pipeline.addLast(new MyClientHandler());
}
}
|
[
"[email protected]"
] | |
cd61eb329669e2ab7d5b8c9136f4e12f2946daf2
|
e44ee365befce3cfb988f58c75c6bd96fe0cec29
|
/src/main/java/me/imzomi/uhcscenarios/scenarios/ShieldLess.java
|
228b66dac9595fd63dc532c7d1916887705e2597
|
[
"MIT"
] |
permissive
|
ImZomi/ScenariosEnganxe
|
62446421cd1d75f8feb556ee30e5374d3e7da436
|
fa2c2f28b0974fd56089896183935bd2bfd8df7d
|
refs/heads/main
| 2023-03-17T21:23:20.528041 | 2021-02-26T20:40:08 | 2021-02-26T20:40:08 | 314,607,431 | 0 | 3 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,082 |
java
|
package me.imzomi.uhcscenarios.scenarios;
import me.imzomi.uhcscenarios.Main;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.CraftItemEvent;
public class ShieldLess implements Listener, CommandExecutor {
private Main plugin;
public ShieldLess(Main plugin){
this.plugin = plugin;
}
@EventHandler
public void cancelShield(CraftItemEvent e){
if (plugin.ShieldLess){
if (e.getRecipe().getResult().getType() == Material.SHIELD){
e.setCancelled(true);
}
}
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player p = (Player) sender;
if (!(sender instanceof Player)) {
Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.GOLD + "Enganxe" + ChatColor.DARK_GRAY + "]" + ChatColor.RED + " No puedes ejecutar comandos desde la consola");
}
if (sender.hasPermission("uhc.admin") && cmd.getName().equalsIgnoreCase("ShieldLess")) {
if (!plugin.ShieldLess) {
Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', ChatColor.DARK_GRAY+ "["+ChatColor.GOLD+"Enganxe"+ChatColor.DARK_GRAY+"]"+ " &0➤ &fShieldLess has been &aenabled"));
plugin.ShieldLess = Boolean.valueOf(true);
} else {
Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', ChatColor.DARK_GRAY+ "["+ChatColor.GOLD+"Enganxe"+ChatColor.DARK_GRAY+"]"+ " &0➤ &fShieldLess has been &cdisabled"));
plugin.ShieldLess = Boolean.valueOf(false);
}
} else {
p.sendMessage(ChatColor.RED + "No tienes permisos para utilizar este comando");
}
return false;
}
}
|
[
"[email protected]"
] | |
7afae92ff1f49b175af58964559dfe68365b3231
|
d61452acf57c4cf9fb4d058081316794d82b1b68
|
/day20/src/com/bit/day20/Ex08.java
|
671dbf3e6baa0cd1320e0af4a187ed3dc06aaa46
|
[] |
no_license
|
Kimej0924/bitcamp_java
|
ff07742aa237bf06c759b71c1287839a753f4dd3
|
7f06bd816eacca2227460ff33c9176b8a7277242
|
refs/heads/master
| 2020-08-27T06:55:00.981453 | 2019-11-20T09:27:17 | 2019-11-20T09:27:17 | 217,275,922 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,867 |
java
|
package com.bit.day20;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Vector;
public class Ex08 {
public static void main(String[] args) {
String path = "test03.bin";
File file = new File(path);
InputStream is = null;
ObjectInputStream ois = null;
try {
is = new FileInputStream(file);
ois = new ObjectInputStream(is);
Object obj = ois.readObject();
// System.out.println(obj);
Car car= (Car) obj;
System.out.println(car.speed);
System.out.println(car.color);
car.func();
// Vector vec = (Vector) obj;
// Enumeration eles = vec.elements();
//
// while(eles.hasMoreElements()){
// System.out.println(eles.nextElement());
// }
/////////////////////////////////////////////
// ArrayList list = (ArrayList)obj;
// for(int i=0; i<list.size(); i++){
// System.out.println(list.get(i));
// }
/////////////////////////////////////////////
// ArrayList list = (ArrayList)obj;
// System.out.println(list.get(0));
// System.out.println(list.get(1));
// Vector vec2=(Vector)list.get(2);
//
// Enumeration enu = vec2.elements();
// while(enu.hasMoreElements()){
// System.out.println(enu.nextElement());
// }
/////////////////////////////////////////////
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} finally {
try {
if(ois!=null)is.close();
if(is!=null)is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
|
[
"[email protected]"
] | |
bcda61a471445d30e9793b70cedd082090827ce9
|
2b4e46fd91456db4cbfb4dec05ec1ff64ba800bd
|
/gw2readr-core/src/main/java/de/getsetsociety/gw2readr/v2/item/items/json/ToolJson.java
|
600a9ba9860bd8fbcf0a81420d724e57eb670675
|
[] |
no_license
|
nicktar/gw2readr
|
c423272e357da921f3c6008d46ffe7b5e8a2b6cb
|
d8d2fe9cfd48803e2012733ca4d7a2470ac36599
|
refs/heads/main
| 2023-03-18T20:15:39.634065 | 2022-12-29T13:59:12 | 2022-12-29T13:59:12 | 31,167,987 | 1 | 0 | null | 2023-03-06T00:59:59 | 2015-02-22T15:46:21 |
Java
|
UTF-8
|
Java
| false | false | 1,700 |
java
|
package de.getsetsociety.gw2readr.v2.item.items.json;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import de.getsetsociety.gw2readr.v0.item.items.enums.ToolType;
import de.getsetsociety.gw2readr.v2.factories.EntityFactoryProvider;
import de.getsetsociety.gw2readr.v2.item.items.interfaces.ITool;
public class ToolJson extends ItemJson<ITool> {
private ITool item = EntityFactoryProvider.getItemEntityFactory().newTool();
@Override
public ITool getEntity() {
return item;
}
@JsonProperty("details")
public void setGatheringDetails(ToolDetails details) {
item.setToolType(details.getType());
item.setCharges(details.getCharges());
getAdditionalProperties().putAll(details.getAdditionalProperties());
}
public static class ToolDetails {
private ToolType type;
private Integer charges;
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("charges")
public Integer getCharges() {
return charges;
}
public void setCharges(Integer charges) {
this.charges = charges;
}
@JsonProperty("type")
public ToolType getType() {
return type;
}
public void setType(String type) {
this.type = ToolType.valueOf(type);
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
}
|
[
"[email protected]"
] | |
8677ae80265f6687eed8aba6d38dd3b42dd1599a
|
70a82e363f50271df5d1d82d5cf131676f9de28f
|
/src/by/academy/HomeWork7/MainStudents1.java
|
148036a9b53a10d78adeda888da454547c897743
|
[] |
no_license
|
Annettka/Anna_Zenevich_M-JC1-38-20
|
cd130d1b07b5b586ad6028cfd07002740a3596fa
|
35e224367fafa91fc11e41dd06a72aa75194d46d
|
refs/heads/master
| 2022-07-18T03:24:48.143949 | 2020-05-14T14:50:57 | 2020-05-14T14:50:57 | 248,969,568 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,212 |
java
|
package by.academy.HomeWork7;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.Random;
public class MainStudents1 {
public static void main(String[] args) throws IOException {
Random rnd = new Random();
ArrayList<Student> students = new ArrayList<>();
for (int i = 0; i < 100000; i++) {
students.add(new Student(getRndStr(), (17 + rnd.nextInt(30 - 17)), rnd.nextInt(100000)));
}
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("Students.bin"));
/**
* first var:
* out.writeObject(students);
*
* second var:
*/
for (Student student : students) {
out.writeObject(student);
}
out.close();
}
public static String getRndStr() {
char[] chars = "abcdefghijklmnopqrstuvwxyz".toCharArray();
Random rnd = new Random();
StringBuilder sb = new StringBuilder(5);
for (int i = 0; i < 5; i++) {
char c = chars[rnd.nextInt(chars.length)];
sb.append(c);
}
return sb.toString();
}
}
|
[
"[email protected]"
] | |
7cf88708c5b20c56f1e17999f18280a4880def34
|
64319a06834223f5eba9cbb10c44197ac108e29c
|
/helloworld-impl/src/main/java/com/knoldus/hello/impl/TestImpl.java
|
0be13a95721ff2430d07270a4373ed01e3b501ab
|
[] |
no_license
|
philipz/lagom-poc
|
cdc68ca24cec18897db418f573106b695e370903
|
1673a8aa3f45e3ea3e68b68aa1fc0c30cdbe375f
|
refs/heads/master
| 2020-06-05T21:42:43.050838 | 2017-02-22T06:33:01 | 2017-02-22T06:33:01 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 692 |
java
|
package com.knoldus.hello.impl;
import akka.Done;
import akka.stream.javadsl.Flow;
import javax.inject.Inject;
import com.google.inject.Singleton;
import com.knoldus.hello.api.GreetingMessage;
import com.knoldus.hello.api.HelloService;
@Singleton public class TestImpl {
private final HelloService helloService;
@Inject public TestImpl(HelloService helloService) {
this.helloService = helloService;
helloService.greetingsTopic().subscribe()
.atLeastOnce(Flow.fromFunction(this::doSomethingWithTheMessage));
}
private Done doSomethingWithTheMessage(GreetingMessage message) {
System.out.println("Message : " + message);
return Done.getInstance();
}
}
|
[
"[email protected]"
] | |
d7457acab93f4daec46d387b775f4c43dab482df
|
0f701cfbeeb86112b30b08a92170e97f33f9a26b
|
/ethicalengine/Statistics.java
|
1933c6e476a590965823880110362b32127975b2
|
[] |
no_license
|
jony047/Moral-Machine
|
ae6686eac386874c51428b05306f532e082a9e6a
|
45261561c5cff296473b6ef9aee0f2234998c7a8
|
refs/heads/master
| 2022-11-20T10:47:15.920669 | 2020-07-09T01:29:00 | 2020-07-09T01:29:00 | 278,222,858 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,734 |
java
|
package ethicalengine;
/**
* @author Jony Saha
* @author jonys,Student ID: 1134030
* @version 2.0
*/
public class Statistics {
private String characteristics;
private int occurrence;
private int saved;
private int age;
private double sumAge;
private int personCount;
/**
* Default Constructor
*/
public Statistics(){
this.sumAge = 0.0;
this.personCount =0;
}
/**
*
* @param characteristics String
* @param occurrence int
* @param saved int
*/
public Statistics(String characteristics,int occurrence, int saved) {
this.characteristics = characteristics;
this.occurrence = occurrence;
this.saved = saved;
}
/**
*
* @param age int
*/
public void addToSumAge(double age){
this.sumAge = this.sumAge + age;
}
/**
*
* @return double
*/
public double getSumAge(){
return this.sumAge;
}
/**
*
* @param personCount int
*/
public void addToPersonCount(int personCount){
this.personCount = this.personCount + personCount;
}
/**
*
* @return int
*/
public int getPersonCount(){
return this.personCount;
}
/**
*
* @return int
*/
public int getOccurrence() {
return this.occurrence;
}
/**
*
* @param occurrence int
*/
public void setOccurrence(int occurrence) {
this.occurrence = occurrence;
}
/**
*
* @param saved int
*/
public void setSaved(int saved) {
this.saved = saved;
}
/**
*
* @param age int
*/
public void setAge(int age) {
this.age = age;
}
/**
*
* @return int
*/
public int getSaved() {
return this.saved;
}
/**
*
* @return String
*/
public String getCharacteristics() {
return characteristics;
}
/**
*
* @return double
*/
public double getSurvivalRatio(){
String str="";
String formattedString="";
if (this.occurrence == 0)
return 0.0;
else{
str = String.valueOf((double)this.saved/this.occurrence);
formattedString = str.substring(0,3);
}
return Double.parseDouble(formattedString);
}
public double getAge(){
return this.age;
}
/**
* To string method
* @return String
*/
public String toString() {
String formattedRatio = String.valueOf(getSurvivalRatio());
String print = getCharacteristics().toLowerCase()+ ": "+formattedRatio;
return print;
}
}
|
[
"[email protected]"
] | |
d4d0ad50e392ccdffd4eded69aaedbe09faf73e9
|
3b35ffc770de276a4079a7308c1fa4937b5d1b30
|
/src/main/java/zab/romik/entity/Photo.java
|
81b2c809b91cd88118077e677ba58329f2f90be0
|
[] |
no_license
|
proweber1/catalogBoot
|
2e755325c4ca6624844328ae6bed94f22960bc86
|
7c8a9f2e7b0401d7185f03c3124efec948208375
|
refs/heads/master
| 2021-01-16T18:37:23.347280 | 2017-08-07T19:47:38 | 2017-08-07T19:47:38 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 418 |
java
|
package zab.romik.entity;
import lombok.*;
import javax.persistence.*;
@Data
@Entity
public class Photo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
private String fileName;
@ManyToOne
private Commodity commodity;
private boolean isIndex;
public Photo() {
}
public Photo(final String fileName) {
this.fileName = fileName;
}
}
|
[
"[email protected]"
] | |
ac2109a1c40569603f6843a6e50d097b56df0315
|
a146cc0b8d19482498dce57b5255df87719fe9d9
|
/src/test/java/org/cancer/donate/testbase/PageInitializer.java
|
2f64314e8aa01f881ef8ce3d5577d5d93d832ce4
|
[] |
no_license
|
evgeniya-prudenkova/AmericanCancerSocietyProject
|
99269cc0e035587569df810c3bf6fbc1b58316a9
|
7898d870bf35108efd7db4d51a581357fe4c3e91
|
refs/heads/master
| 2023-05-07T19:22:12.739624 | 2021-06-01T02:04:45 | 2021-06-01T02:04:45 | 372,672,978 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 269 |
java
|
package org.cancer.donate.testbase;
import org.cancer.donate.pages.DonatePage;
public class PageInitializer extends BaseClass {
public static DonatePage donatePage;
public static void initializePageObjects() {
donatePage = new DonatePage();
}
}
|
[
"[email protected]"
] | |
cd333598da1047c54f9921e81eb9a076a5703a27
|
0a01ede1736230ed80b8d7a2471bdbf0c6d8f856
|
/2021_2_4/src/球的半径和体积/Main.java
|
7818dbd6581854a1ff6e7fc624e0394b2aae8326
|
[] |
no_license
|
Madrid-7/Algorithm
|
ed599e0252866e7eddcad7cfe7ac2dd5d29122aa
|
ab727f295adccdec256609924a3ab2bb5bca780d
|
refs/heads/master
| 2023-06-19T04:25:56.461694 | 2021-07-15T08:38:53 | 2021-07-15T08:38:53 | 314,606,807 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 750 |
java
|
package 球的半径和体积;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
double x0=sc.nextFloat();
double y0=sc.nextFloat();
double z0=sc.nextFloat();
double x1=sc.nextFloat();
double y1=sc.nextFloat();
double z1=sc.nextFloat();
double r = Math.sqrt(Math.pow(x0-x1,2)+Math.pow(y0-y1,2)+Math.pow(z0-z1,2));
double v = 4/3.0*Math.acos(-1)*Math.pow(r,3);
System.out.printf("%.3f", r);
System.out.print(" ");
System.out.printf("%.3f", v);
System.out.println();
}
}
}
|
[
"[email protected]"
] | |
e466c7dfcea9735331ae585670ac159908ffc5e3
|
057538ffaa6895836bebf0fa8b2867df44240c6f
|
/movie-catalog-services/src/main/java/io/microservices/moviecatalogservices/config/ApplicationConfiguration.java
|
700d359806023b3e5d7b983a2ce7e24994e17e38
|
[] |
no_license
|
chanakyass/movie-catalog-microservices
|
5ae70cf473c4bf0b3847c068ad9f4e4a48e76533
|
d6018a42c28c80fea90f713b1ae246b1186d3d52
|
refs/heads/main
| 2023-06-01T18:45:30.095804 | 2021-06-13T10:16:13 | 2021-06-13T10:16:13 | 375,717,134 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 458 |
java
|
package io.microservices.moviecatalogservices.config;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@Configuration
public class ApplicationConfiguration {
@Bean
@LoadBalanced
public RestTemplate getRestTemplate(){
return new RestTemplate();
}
}
|
[
"[email protected]"
] | |
21ed2e7d9a8bd419614835126e94083c7b9b830d
|
528e3ff6e9711b0d5e337123dd2a8072706e536d
|
/src/main/java/com/dbms/dao/Invoicedao.java
|
375cf9d342464eb91c3049e2e5a8f4075091a4e7
|
[
"Apache-2.0"
] |
permissive
|
abhigupta768/dbms-proj-getwin
|
7b54543bace4d128bb928f2b74286891a2e37cba
|
7c1f06efd45299e4f3b54b3a4a5e4a6588b7086e
|
refs/heads/master
| 2022-12-22T15:42:50.362124 | 2020-03-25T18:26:02 | 2020-03-25T18:26:02 | 153,765,288 | 0 | 0 |
Apache-2.0
| 2022-12-16T06:33:15 | 2018-10-19T10:20:32 |
Java
|
UTF-8
|
Java
| false | false | 612 |
java
|
package com.dbms.dao;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.dbms.model.Cart;
import com.dbms.model.Invoice;
public interface Invoicedao {
public List<Invoice> fillInvoiceentry(String username, Long amount, List<Cart> centry, Integer invid);
public Integer fillInvoice(String username, Long amount);
public List<Invoice> showInvoice(Integer invid);
public List<Invoice> showInvoiceEntry(Integer invid);
public List<Invoice> showallInvoice();
public String findUser(Integer invid);
public List<Invoice> showInvoiceEntryuser(String username);
}
|
[
"[email protected]"
] | |
9917390bb4ec5a0b73f59e5e78ddff42e1d50e72
|
7f63911cbabdf9a29ddf9105b132a6316b7596d8
|
/app/src/main/java/rohit/com/loginform2/AdminLoginActivity.java
|
133ddfb52221c3fa51cde8972c2b406964364aff
|
[] |
no_license
|
singhbhavna/LoginForm2
|
24a4fd2c6776af679beef79f312e2697ceb99b47
|
e93240b22afece87d5ba14345c28ef1f670cb617
|
refs/heads/master
| 2020-03-25T05:01:35.362325 | 2018-06-23T03:39:48 | 2018-06-23T03:39:48 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 346 |
java
|
package rohit.com.loginform2;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class AdminLoginActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin_login);
}
}
|
[
"[email protected]"
] | |
afb85e5ea6d13afd7182a9d481f99fb7b45bae3d
|
64e76c7291601b96ca8542c6b307a6b299f28dc5
|
/app/src/main/java/com/example/json/ui/ListaContactos.java
|
ed790985349f6e040372bb229248b5f42787941d
|
[] |
no_license
|
Mamorky/JSON-Examples
|
0fc1d1bea5242d8641743a521165d1f18d29c0b5
|
857aada5799bbc3c33713f9642b9543a46a575f5
|
refs/heads/master
| 2021-05-05T08:04:31.393706 | 2018-02-08T13:40:43 | 2018-02-08T13:40:43 | 118,916,212 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,040 |
java
|
package com.example.json.ui;
import android.app.ProgressDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;
import com.example.json.R;
import com.example.json.network.RestClient;
import com.example.json.pojo.Contacto;
import com.example.json.utils.Analisis;
import com.loopj.android.http.JsonHttpResponseHandler;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import cz.msebera.android.httpclient.Header;
public class ListaContactos extends AppCompatActivity {
//public static final String WEB = "192.168.3.57/acceso/contactos.json";
public static final String WEB = "http://portadaalta.mobi/acceso/contactos.json";
//public static final String WEB = "https://alumno.mobi/~alumno/superior/casielles/contactos.json";
//public static final String WEB = "http://192.168.0.139/acceso/contactos.json";
Button boton;
ListView lista;
ArrayList<Contacto> contactos;
ArrayAdapter<Contacto> adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lista_contactos);
boton = findViewById(R.id.button);
lista = findViewById(R.id.listView);
lista.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
Toast.makeText(ListaContactos.this,
"Móvil: " + contactos.get(position).getTelefono().getMovil(),
Toast.LENGTH_SHORT
).show();
}
});
boton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
descarga(WEB);
}
});
}
//usar JsonHttpResponseHandler()
private void descarga(String web) {
final ProgressDialog progreso = new ProgressDialog(this);
RestClient.get(web, new JsonHttpResponseHandler() {
@Override
public void onStart() {
super.onStart();
progreso.setProgressStyle(ProgressDialog. STYLE_SPINNER );
progreso.setMessage("Conectando . . .");
progreso.setCancelable(true);
progreso.show();
}
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
super.onSuccess(statusCode, headers, response);
progreso.dismiss();
try {
contactos = Analisis.analizarContactos(response);
Toast.makeText(ListaContactos.this, "Descarga con éxito", Toast.LENGTH_SHORT).show();
mostrar();
} catch (JSONException e) {
Toast.makeText(ListaContactos.this,
"Error en el documento: " + e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
super.onFailure(statusCode, headers, throwable, errorResponse);
progreso.dismiss();
}
});
}
private void mostrar() {
if (contactos != null)
if (adapter == null) {
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, contactos);
lista.setAdapter(adapter);
} else {
adapter.clear();
adapter.addAll(contactos);
}
else
Toast.makeText(getApplicationContext(), "Error al crear la lista", Toast. LENGTH_SHORT ).show();
}
}
|
[
"[email protected]"
] | |
5428245d27f050334f1f48af221a0dae68b57714
|
8484793dd4e36b6d625253abe60d663408070b0e
|
/Factorial.java
|
ced99c26056109dcb0c2510f2dd333078eb15d7e
|
[] |
no_license
|
AravindBheri/JavaPractise
|
5407e94866238b46fedd5cf670538ad0e96dba15
|
a04161ece0ae628257ca900fd8a586bff3d83271
|
refs/heads/master
| 2023-06-15T19:31:52.210019 | 2021-07-12T05:48:31 | 2021-07-12T05:48:31 | 309,055,275 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 289 |
java
|
public class Factorial {
public static void main(String[] args) {
System.out.println(MyFactorial(5));
}
public static int MyFactorial(int n) {
if(n == 1) {
return 1;
} else {
return n * MyFactorial(n - 1);
}
}
}
|
[
"[email protected]"
] | |
cd798c7e0ef9a8b67436bac60c3213bae965d9a4
|
f2774d01445ae58ead25735ad030e22970a48166
|
/haikuplus/HaikuPlus/src/main/java/com/google/plus/samples/haikuplus/api/HaikuSession.java
|
af8d639b94000ddc5e38e86eb78fbf723b4063bf
|
[
"Apache-2.0"
] |
permissive
|
cartland/gplus-haiku-client-android
|
ba2e7178b569aae8841d0f667d2e8dfe05a6897b
|
63bebf22da03368edbb1a63e86952850e808eda9
|
refs/heads/master
| 2021-01-14T12:57:50.145055 | 2014-10-13T17:22:29 | 2014-10-13T17:22:29 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,442 |
java
|
/* Copyright (C) 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.plus.samples.haikuplus.api;
import com.google.android.gms.auth.GoogleAuthException;
import com.google.android.gms.auth.GoogleAuthUtil;
import com.google.plus.samples.haikuplus.Constants;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import java.io.IOException;
/**
* Represents a single Haiku+ session, which may or may not be associated with an authenticated
* user.
*
* @author [email protected] (Ian Barber)
*/
public class HaikuSession {
private static final String TAG = "HaikuPlus-HaikuSession";
/**
* Enum for the authentication state of the session. UNAUTHENTICATED is the lowest state, where
* neither the account name nor the session id is known. HAS_ACCOUNT is the next state, where
* account name is known but the session id is not. If the state is HAS_SESSION, both the
* account name and the session id are known.
*/
public enum State {
UNAUTHENTICATED,
HAS_ACCOUNT,
HAS_SESSION
}
private static HaikuSession mSession;
private final String mServerClientId;
private static final String PREFS_NAME = "HaikuPlus-HaikuSession";
private static final String PREF_ACCOUNT_NAME = "accountName";
private static final String PREF_SESSION_ID = "sessionId";
private Context mContext;
private String mAccountName;
private String mSessionId;
private String mCode;
public static HaikuSession getSessionForServer(Context context, String serverClientId) {
if (mSession != null) {
return mSession;
}
mSession = new HaikuSession(context, serverClientId);
// Do an an initial check just to pre-populate the values from the
// shared preferences.
mSession.fetchAccountName(false);
return mSession;
}
private HaikuSession(Context context, String serverClientId) {
mServerClientId = serverClientId;
mContext = context.getApplicationContext();
}
public State checkSessionState(Boolean force) {
fetchAccountName(force);
if (mSessionId != null) {
return State.HAS_SESSION;
} else if (mAccountName != null) {
return State.HAS_ACCOUNT;
}
return State.UNAUTHENTICATED;
}
public State checkSessionState() {
return checkSessionState(false);
}
public void storeAccountName(String accountName) {
mAccountName = accountName;
SharedPreferences settings = mContext.getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString(PREF_ACCOUNT_NAME, mAccountName);
editor.commit();
}
public void storeSessionId(String sessionId) {
mSessionId = sessionId;
SharedPreferences settings = mContext.getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString(PREF_SESSION_ID, mSessionId);
editor.commit();
}
public void setCode(String code) {
mCode = code;
}
public String getCode() {
return mCode;
}
public String getSessionId() {
return mSessionId;
}
public String getAccountName() {
return mAccountName;
}
public String getIdTokenSynchronous() {
if (mAccountName == null || mServerClientId == null) {
return null;
}
String scope = "audience:server:client_id:" + mServerClientId;
try {
return GoogleAuthUtil.getToken(mContext, mAccountName, scope);
} catch (IOException e) {
Log.e(TAG, e.getMessage());
} catch (GoogleAuthException e) {
Log.e(TAG, e.getMessage());
}
return null;
}
public String getCodeSynchronous() throws GoogleAuthException, CodeException {
StringBuilder scopeString = new StringBuilder("");
for (String scope : Constants.SCOPES) {
scopeString.append(" ").append(scope);
}
String scope = new StringBuilder("oauth2:server:client_id:")
.append(Constants.SERVER_CLIENT_ID)
.append(":api_scope:")
.append(scopeString.toString())
.toString();
Bundle appActivities = new Bundle();
String types = TextUtils.join(" ", Constants.ACTIONS);
appActivities.putString(GoogleAuthUtil.KEY_REQUEST_VISIBLE_ACTIVITIES, types);
String code = null;
try {
code = GoogleAuthUtil.getToken(
mContext,
mAccountName,
scope,
appActivities);
// Immediately invalidate so we get a different one if we have to try again.
GoogleAuthUtil.invalidateToken(mContext, code);
} catch (IOException e) {
Log.e(TAG, e.getMessage(), e);
throw new CodeException("Error: could not establish connection to server.");
}
return code;
}
/**
* Retrieve the account name stores in the shared preferences if set.
*
* @param force require that the preference be checked.
*/
private void fetchAccountName(Boolean force) {
if (mAccountName == null || force) {
SharedPreferences settings = mContext.getSharedPreferences(PREFS_NAME, 0);
mAccountName = settings.getString(PREF_ACCOUNT_NAME, null);
mSessionId = settings.getString(PREF_SESSION_ID, null);
}
}
/**
* Exception raised while attempting to get code from server.
*/
public static class CodeException extends Exception {
public CodeException(String msg) {
super(msg);
}
}
}
|
[
"[email protected]"
] | |
b14035341f30fc0e968014566eb67175c4d92f8f
|
d2c7904d63a78667e93fe68878946b684925d803
|
/Deals Magazine Business/src/com/dealsmagazine/barcode/camera/PreviewCallback.java
|
7bb9222325073ef92bbbd1a90feed72e622aa041
|
[] |
no_license
|
winterwall/barcode-android
|
5a485192ea190aaceba8394c3d94ca473f8588cc
|
705e3be4cb4105cc380de03b05f0f64314f0fb2f
|
refs/heads/master
| 2020-03-29T19:15:01.207799 | 2013-04-14T16:40:09 | 2013-04-14T16:40:09 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,425 |
java
|
package com.dealsmagazine.barcode.camera;
import android.graphics.Point;
import android.hardware.Camera;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
final class PreviewCallback implements Camera.PreviewCallback {
private static final String TAG = PreviewCallback.class.getSimpleName();
private final CameraConfigurationManager configManager;
private final boolean useOneShotPreviewCallback;
private Handler previewHandler;
private int previewMessage;
PreviewCallback(CameraConfigurationManager configManager, boolean useOneShotPreviewCallback) {
this.configManager = configManager;
this.useOneShotPreviewCallback = useOneShotPreviewCallback;
}
void setHandler(Handler previewHandler, int previewMessage) {
this.previewHandler = previewHandler;
this.previewMessage = previewMessage;
}
public void onPreviewFrame(byte[] data, Camera camera) {
Point cameraResolution = configManager.getCameraResolution();
if (!useOneShotPreviewCallback) {
camera.setPreviewCallback(null);
}
if (previewHandler != null) {
Message message = previewHandler.obtainMessage(previewMessage, cameraResolution.x,
cameraResolution.y, data);
message.sendToTarget();
previewHandler = null;
} else {
Log.d(TAG, "Got preview callback, but no handler for it");
}
}
}
|
[
"[email protected]"
] | |
35008eb769ea8b045612533d597467e7da4491ca
|
2b53928e11c386dec58a991db098f02d3a7fdc08
|
/src/main/java/org/launchcode/beatinbetes/models/Meal.java
|
c901d4afb05aa1222a754877ab9bafe404700590
|
[
"MIT"
] |
permissive
|
bacchinal/beatin-betes
|
0a5018ec81cf39d42bef052b20d2061e997e0f27
|
1bcf2ec166573deade3b9aa8a6485281f16a052e
|
refs/heads/master
| 2020-08-30T10:21:09.008955 | 2020-03-13T00:49:13 | 2020-03-13T00:49:13 | 218,349,198 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,132 |
java
|
package org.launchcode.beatinbetes.models;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
@Entity
public class Meal {
@Id
@GeneratedValue
private int id;
@NotNull
@Size(min=3, max=15)
private String name;
@NotNull
@Size(min=1, message = "Description must not be empty")
private String description;
private int carbCount;
public Meal(String name, String description, int carbCount) {
this.name = name;
this.description = description;
}
public Meal() { }
public int getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getCarbCount() {
return carbCount;
}
public void setCarbCount(int carbCount) {
this.carbCount = carbCount;
}
}
|
[
"[email protected]"
] | |
94ecc9d013d424f9974a536b603547937c3d70e6
|
daaf964e96bd0d6ef0f97da4a63fe719e8632e9d
|
/TeraDataFinal/src/main/java/com/tera/model/Culture.java
|
79f8bdca148e5f171a5ceb2e36b376221bdbe269
|
[] |
no_license
|
saqibmehmoodgit/TeraDataHibernateSpring
|
46b3853dc7159b0210ccf22a8275618013bef839
|
e2f210fdf7ecf904be2a95e4797a2db8ce5ca25f
|
refs/heads/master
| 2023-02-24T01:23:16.914046 | 2023-02-08T13:59:11 | 2023-02-08T13:59:11 | 183,621,189 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,196 |
java
|
package com.tera.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity(name = "culture")
public class Culture {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
long cultureid;
String name; //// 2 pks
String modifieddate;
public long getCultureid() {
return cultureid;
}
public void setCultureid(long cultureid) {
this.cultureid = cultureid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getModifieddate() {
return modifieddate;
}
public void setModifieddate(String modifieddate) {
this.modifieddate = modifieddate;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (cultureid ^ (cultureid >>> 32));
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Culture other = (Culture) obj;
if (cultureid != other.cultureid)
return false;
return true;
}
}
|
[
"nasir mehmood@Saqib"
] |
nasir mehmood@Saqib
|
1052a5b305d5439a3d38e3985fa60a04a1aee4a2
|
20f81986e86c8e50216566e5c70338acc8620080
|
/src/main/java/com/globallogic/procamp/lesson8/lambda/TrueFunctionalApproach.java
|
43953e1015be7d579b064aa1d5c68184f23a4833
|
[] |
no_license
|
sivachok/procamp
|
30317893ae5ce8b8603291529dc702c044501846
|
8432033082f99e990c4f8bbf7d3568e19e567914
|
refs/heads/master
| 2020-04-01T20:25:55.962882 | 2018-12-11T09:01:20 | 2018-12-11T09:01:20 | 153,603,534 | 0 | 2 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,662 |
java
|
package com.globallogic.procamp.lesson8.lambda;
import static java.util.Comparator.comparingInt;
import java.util.List;
import com.globallogic.procamp.lesson8.entity.Tutorial;
public class TrueFunctionalApproach {
class BeforeJava8 {
public Tutorial findTutorialsWithMostGenre(List<Tutorial> tutorialList) {
if (tutorialList.isEmpty()) {
return null;
}
Tutorial mostPowerful = tutorialList.iterator().next();
for (Tutorial tutorial : tutorialList) {
if (tutorial.getGenres().size() > mostPowerful.getGenres().size()) {
mostPowerful = tutorial;
}
}
return mostPowerful;
}
}
class NaiveStreamsApproach {
public Tutorial findTutorialsWithMostGenre(List<Tutorial> tutorilaList) {
return tutorilaList.stream()
.sorted(comparingInt(u -> u.getGenres().size()))
.findFirst()
.orElse(null);
}
}
class StreamsWithReduction {
public Tutorial findTutorialsWithMostGenre(List<Tutorial> tutorilaList) {
return tutorilaList.stream()
.reduce((u1, u2) ->
u1.getGenres().size() > u2.getGenres().size() ? u1 : u2)
.orElse(null);
}
}
class MaxWithComparator {
public Tutorial findTutorialsWithMostGenre(List<Tutorial> tutorilaList) {
return tutorilaList.stream()
.max(comparingInt(u -> u.getGenres().size()))
.orElse(null);
}
}
}
|
[
"[email protected]"
] | |
b99f4a7f6420a866433d8570c6889863233c5f8b
|
c5132930b50485240401ba88eb6dfbb1f8a98ea8
|
/微服务框架/chinags_cloud/chinags_common/src/main/java/com/chinags/common/utils/JwtUtil.java
|
92d8b276fd55cf1a021210202f96869d32d7011f
|
[] |
no_license
|
springlizhen/lizhen
|
acb52ae17744c69d3afd0e8c72ff299cd39a09d6
|
4bd2b95e7d69dbf9f8a1344b697ddb3f1df95e43
|
refs/heads/master
| 2023-05-09T18:51:38.961155 | 2020-06-30T05:41:19 | 2020-06-30T05:41:19 | 275,989,002 | 0 | 1 | null | 2021-06-04T02:43:47 | 2020-06-30T03:37:02 |
JavaScript
|
UTF-8
|
Java
| false | false | 4,399 |
java
|
package com.chinags.common.utils;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Administrator
*/
public class JwtUtil {
private static String secret="ceshi" ;
private static long expires_in=432000000 ;//五天
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public long getExpires_in() {
return expires_in;
}
public void setExpires_in(long expires_in) {
this.expires_in = expires_in;
}
/**
* 生成JWT
*
* @param id
* @param subject
* @return
*/
public static String createJWT(String id, String subject, String roles) {
long nowMillis = System.currentTimeMillis();
Date now = new Date(nowMillis);
JwtBuilder builder = Jwts.builder().setId(id)
.setSubject(subject)
.setIssuedAt(now)
.signWith(SignatureAlgorithm.HS256, secret).claim("roles", roles);
if (expires_in > 0) {
builder.setExpiration( new Date( nowMillis + expires_in));
}
return builder.compact();
}
public static String createJWT(String id, String subject) {
long nowMillis = System.currentTimeMillis();
Date now = new Date(nowMillis);
JwtBuilder builder = Jwts.builder().setId(id)
.setSubject(subject)
.setIssuedAt(now)
.signWith(SignatureAlgorithm.HS256, secret);
if (expires_in > 0) {
builder.setExpiration( new Date( nowMillis + expires_in));
}
return builder.compact();
}
public static String createJWTPassword(String id, String subject, String password) {
long nowMillis = System.currentTimeMillis();
Date now = new Date(nowMillis);
JwtBuilder builder = Jwts.builder().setId(id)
.setSubject(subject)
.setIssuedAt(now)
.signWith(SignatureAlgorithm.HS256, secret).claim("password",password);
if (expires_in > 0) {
builder.setExpiration( new Date( nowMillis + expires_in));
}
return builder.compact();
}
public static String createJWTPassword(String id, String subject, String password,String pm,String loginCode) {
long nowMillis = System.currentTimeMillis();
Date now = new Date(nowMillis);
JwtBuilder builder = Jwts.builder().setId(id)
.setSubject(subject)
.setIssuedAt(now)
.signWith(SignatureAlgorithm.HS256, secret).claim("password",password).claim("pm", pm).claim("loginCode", loginCode);
if (expires_in > 0) {
builder.setExpiration( new Date( nowMillis + expires_in));
}
return builder.compact();
}
public static Map<String,String> createJWTSystem(String id, String subject, String appSecretId) {
long nowMillis = System.currentTimeMillis();
Date now = new Date(nowMillis);
JwtBuilder builder = Jwts.builder().setId(id)
.setSubject(subject)
.setIssuedAt(now)
.signWith(SignatureAlgorithm.HS256, appSecretId);
if (expires_in > 0) {
builder.setExpiration( new Date( nowMillis + expires_in));
}
Map<String,String> objectObjectMap = new HashMap<>();
objectObjectMap.put("token",builder.compact());
objectObjectMap.put("expires_in",(expires_in/1000)+"");
return objectObjectMap;
}
/**
* 解析JWT
* @param jwtStr
* @return
*/
public static Claims parseJWT(String jwtStr){
return Jwts.parser()
.setSigningKey(secret)
.parseClaimsJws(jwtStr)
.getBody();
}
/**
* 解析JWT
* @param jwtStr
* @return
*/
public static Claims parseJWTSystem(String jwtStr, String appSecretId){
return Jwts.parser()
.setSigningKey(appSecretId)
.parseClaimsJws(jwtStr)
.getBody();
}
}
|
[
"[email protected]"
] | |
5b6af124388b63740aaf1d1977840ac9cbe0b603
|
2d727136a1f47e4a237ad08411abf808506a2402
|
/src/main/java/com/Music/back/Mapper/UtilMapper.java
|
17ae1f241d7627bc44403237b5fe15171191f525
|
[] |
no_license
|
baipengyan/Music
|
f4592cde9ec806aebee478e93524b1622c000b16
|
ab5a933dfbac62476aafa5121e887e11f97be284
|
refs/heads/master
| 2020-09-29T14:18:03.193082 | 2019-06-19T05:04:53 | 2019-06-19T05:04:53 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 458 |
java
|
package com.Music.back.Mapper;
import org.apache.ibatis.annotations.Param;
import com.Music.Bean.Music;
/**
* 前后台通用的方法
* @author Mr.Cat
*
*/
public interface UtilMapper {
/**
* 根据曲风名称获取ID
* @param style 曲风名称
* @return ID
*/
int getSidBySname(@Param("Style")String style);
/**
* 根据ID获取文件路径
* @param id
* @return
*/
Music getFiles(int id);
}
|
[
"Mr.Cat@DESKTOP-3IKTKNR"
] |
Mr.Cat@DESKTOP-3IKTKNR
|
99e3db1d4b0b701d24cffdfa9bbc1337317fe41a
|
627c3a2603590fed8c2b39ecb02c9a1c855ec120
|
/app/src/main/java/com/example/coronaapp/RequestList.java
|
313b118eb0abedb0b140a6b107076ecfbe44429a
|
[] |
no_license
|
Ekjyotkaur/AndroidApp
|
0ab6180bffdb624d18b2c9695a49525909206e3f
|
5a09717ad53f24d886aa8ce70b384caccd6392da
|
refs/heads/master
| 2022-12-20T15:02:01.288058 | 2020-09-18T06:30:32 | 2020-09-18T06:30:32 | 296,526,038 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,237 |
java
|
package com.example.coronaapp;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.firebase.ui.firestore.FirestoreRecyclerAdapter;
import com.firebase.ui.firestore.FirestoreRecyclerOptions;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.EventListener;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.FirebaseFirestoreException;
import com.google.firebase.firestore.Query;
import com.google.firebase.firestore.QueryDocumentSnapshot;
import com.google.firebase.firestore.QuerySnapshot;
import java.util.ArrayList;
import java.util.List;
public class RequestList extends Fragment {
private RecyclerView requestList;
private FirebaseFirestore fStore;
private AdapterUser adapter;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.activity_request_list, container, false);
requestList = view.findViewById(R.id.userList);
fStore = FirebaseFirestore.getInstance();
//Query
Query query = fStore.collection("users");
// query.addSnapshotListener(new EventListener<QuerySnapshot>() {
// @Override
// public void onEvent(@Nullable QuerySnapshot value, @Nullable FirebaseFirestoreException error) {
// List<UserModel> users = value.toObjects(UserModel.class);
// }
// });
//Recycler Options
FirestoreRecyclerOptions<UserModel> options = new FirestoreRecyclerOptions.Builder<UserModel>()
.setQuery(query,UserModel.class)
.build();
adapter = new AdapterUser(options);
requestList.setHasFixedSize(true);
requestList.setLayoutManager(new LinearLayoutManager(getContext()));
requestList.setAdapter(adapter);
return view;
}
public class AdapterUser extends FirestoreRecyclerAdapter<UserModel, AdapterUser.UserHolder> {
public AdapterUser(@NonNull FirestoreRecyclerOptions<UserModel> options) {
super(options);
}
@Override
protected void onBindViewHolder(@NonNull UserHolder holder, final int position, @NonNull final UserModel model) {
holder.fullNameText.setText(model.getFirstName() + " " + model.getLastName());
holder.bloodGroupText.setText(model.getBloodGroup());
holder.ageText.setText(model.getAge());
holder.view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
UserListViewFragment list = new UserListViewFragment();
Bundle args = new Bundle();
args.putString("id",model.getUserId());
list.setArguments(args);
getActivity().getSupportFragmentManager().beginTransaction()
.replace(R.id.fragment_container,list,"User list Fragment")
.addToBackStack(null)
.commit();
}
});
}
@NonNull
@Override
public UserHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.userlist,parent,false);
return new UserHolder(view);
}
public class UserHolder extends RecyclerView.ViewHolder {
private TextView fullNameText, bloodGroupText, ageText;
private View view;
public UserHolder(@NonNull View itemView) {
super(itemView);
fullNameText = itemView.findViewById(R.id.fullNameText1);
bloodGroupText = itemView.findViewById(R.id.bloodGroupText1);
ageText = itemView.findViewById(R.id.ageText1);
view = itemView;
// view.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// int position = getAdapterPosition();
// if (position != RecyclerView.NO_POSITION && listener != null){
// listener.onItemClick(getSnapshots().getSnapshot(position), position);
// }
// }
// });
}
}
}
@Override
public void onStop() {
super.onStop();
adapter.stopListening();
}
@Override
public void onStart() {
super.onStart();
adapter.startListening();
}
}
|
[
"[email protected]"
] | |
2662861f189ce624024186e6f8afc59deafcb800
|
0ca2e89912f344c114f7241c72eddeac47e1320f
|
/app/src/main/java/com/baeflower/hello/parsing/ParsingXmlActivity.java
|
ccf6c216904d658298b1aba7d8a17febce557307
|
[] |
no_license
|
baeggot/Hello
|
5b84d30878d468501e2fe812a60fc21b89be8d0d
|
5c84000fcf1a271be6575aee0d2f169dca83fa94
|
refs/heads/master
| 2016-09-05T15:12:28.176570 | 2015-05-13T05:27:37 | 2015-05-13T05:27:37 | 32,309,666 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,334 |
java
|
package com.baeflower.hello.parsing;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.StrictMode;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import com.baeflower.hello.R;
import com.baeflower.hello.parsing.adapter.GoogleNewsAdapter;
import com.baeflower.hello.parsing.model.GoogleNews;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
public class ParsingXmlActivity extends ActionBarActivity implements AdapterView.OnItemClickListener {
private List<GoogleNews> googleNewsList;
// private ArrayAdapter arrayAdapter;
private GoogleNewsAdapter googleNewsAdapter;
private ListView listView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_parsing_xml);
// init Data
googleNewsList = new ArrayList<>();
listView = (ListView) findViewById(R.id.lv_parsing_xml);
listView.setOnItemClickListener(this);
if (Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
// XML 데이터를 읽어옴 (구글 뉴스 RSS)
String urlStr = "https://news.google.co.kr/news?pz=1&cf=all&ned=kr&hl=ko&output=rss";
try {
URL url = new URL(urlStr);
//InputStream in = url.openStream();
InputStream in = url.openConnection().getInputStream();
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
XmlPullParser parser = factory.newPullParser();
// XmlPullParser에 XML 데이터와 인코딩 방식을 입력
parser.setInput(in, "utf-8");
int eventType = parser.getEventType(); // Returns the type of the current event (START_TAG, END_TAG, TEXT, etc.)
boolean isItemTag = false;
boolean isTitleTag = false;
boolean isLinkTag = false;
String tagName = "";
String data = "";
String link = "";
GoogleNews googleNews = null;
while (eventType != XmlPullParser.END_DOCUMENT) {
// 0 : START_DOCUMENT
if (eventType == XmlPullParser.START_TAG) { // 2
tagName = parser.getName();
if ("item".equals(tagName)) {
googleNews = new GoogleNews();
isItemTag = true;
} else if ("title".equals(tagName)) {
isTitleTag = true;
} if ("link".equals(tagName)) {
isLinkTag = true;
}
} else if (eventType == XmlPullParser.TEXT && isItemTag) { // 4
data = parser.getText();
if (isTitleTag) {
googleNews.setTitle(data);
} else if (isLinkTag) {
googleNews.setLink(data);
}
} else if (eventType == XmlPullParser.END_TAG) { // 3
tagName = parser.getName();
if (tagName.equals("item")) {
googleNewsList.add(googleNews);
isItemTag = false;
} else if (tagName.equals("title")) {
isTitleTag = false;
} else if (tagName.equals("link")) {
isLinkTag = false;
}
}
eventType = parser.next();
} // while
} catch (MalformedURLException e) {
Toast.makeText(getApplicationContext(), "MalformedURLException", Toast.LENGTH_SHORT).show();
} catch (IOException e) {
Toast.makeText(getApplicationContext(), "IOException", Toast.LENGTH_SHORT).show();
} catch (XmlPullParserException e) {
Toast.makeText(getApplicationContext(), "XmlPullParserException", Toast.LENGTH_SHORT).show();
} catch (NullPointerException e) {
Toast.makeText(getApplicationContext(), "NullPointerException", Toast.LENGTH_SHORT).show();
}
// adapter
// arrayAdapter = new ArrayAdapter(getApplicationContext(), android.R.layout.simple_list_item_1, googleNewsList);
googleNewsAdapter = new GoogleNewsAdapter(getApplicationContext(), googleNewsList);
// view
listView.setAdapter(googleNewsAdapter);
} // onCreate
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String link = googleNewsList.get(position).getLink();
Intent intent = new Intent(getApplicationContext(), ParsingWebviewActivity.class);
intent.putExtra("link", link); // url 을 intent 실어서 activity를 호출
startActivity(intent);
}
}
|
[
"[email protected]"
] | |
6b3f5983f9f4996bd01376d4f2ddfc1d52e6a973
|
729a42686c681462b8fa10c1049ac8097f546ad9
|
/RotationVectorSimpleDemo/app/src/main/java/edu/utexas/scottm/rotationvectorsimpledemo/RotationVectorSimpleDemo.java
|
57adb544acd79846d1c93e60e4d551ca25599595
|
[] |
no_license
|
ace-jc/AndroidStudioProjects
|
2b75ba519977d1d399af21798049a42cd5bfd06f
|
dcaa66e818e4b3ee3096597d166616bc76588e0c
|
refs/heads/master
| 2020-12-25T10:50:25.695257 | 2016-06-08T15:03:43 | 2016-06-08T15:03:43 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,797 |
java
|
package edu.utexas.scottm.rotationvectorsimpledemo;
import android.app.Activity;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.widget.TextView;
public class RotationVectorSimpleDemo extends Activity {
private SensorManager mSensorManager;
private Sensor mRotationVectorSensor;
private TextView[] sensorValues;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_rotation_vector_simple_demo);
// Get an instance of the SensorManager
mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
getTextViews();
}
private void getTextViews() {
int[] ids = {R.id.x_value, R.id.y_value, R.id.z_value,
R.id.cos_value, R.id.heading_value};
sensorValues = new TextView[5];
for(int i = 0; i < sensorValues.length; i++)
sensorValues[i] = (TextView) this.findViewById(ids[i]);
}
@Override
protected void onResume() {
// Ideally a game should implement onResume() and onPause()
// to take appropriate action when the activity loses focus
super.onResume();
mRotationVectorSensor = mSensorManager.getDefaultSensor(
Sensor.TYPE_ROTATION_VECTOR);
mSensorManager.registerListener(new RotationListener(),
mRotationVectorSensor, 200000);
}
@Override
protected void onPause() {
// Ideally a game should implement onResume() and onPause()
// to take appropriate action when the activity loses focus
super.onPause();
}
private class RotationListener implements SensorEventListener {
public void onSensorChanged(SensorEvent event) {
// we received a sensor event. it is a good practice to check
// that we received the proper event
if (event.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR) {
for(int i = 0; i < event.values.length; i++) {
float value = event.values[i];
value = ((int) (value * 100)) / 100f;
sensorValues[i].setText("" + value);
}
// // convert the rotation-vector to a 4x4 matrix. the matrix
// // is interpreted by Open GL as the inverse of the
// // rotation-vector, which is what we want.
// SensorManager.getRotationMatrixFromVector(
// mRotationMatrix , event.values);
}
}
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
}
}
|
[
"[email protected]"
] | |
df3fc6e9046bbe0de111a6f8613800985259cfbb
|
ca43f607f92d9339af17c156671ae6b401c9c502
|
/src/com/lineadecodigo/java/swing/JuegoBasico.java
|
b1ecfd64f25cf056fb9af4f0ede0be69c293af48
|
[] |
no_license
|
rodrigocarrillo/lineadecodigo_java
|
4a1c5ad7b51d1b308e485596427bb300ea2bb0c2
|
122da7628d292bfb10a90fc014d36c5b62ef930c
|
refs/heads/master
| 2021-01-17T22:30:21.163334 | 2015-08-11T00:23:31 | 2015-08-11T00:23:31 | 40,553,330 | 1 | 0 | null | 2015-08-11T16:40:38 | 2015-08-11T16:40:38 | null |
ISO-8859-1
|
Java
| false | false | 5,149 |
java
|
package com.lineadecodigo.java.swing;
/**
* @file JuegoBasico.java
* @version 1.0
* @author Ariel Carraro (http://lineadecodigo.com)
* @date 12-octubre-2012
* @url http://lineadecodigo.com/java/un-juego-sencillo-con-java-swing/
* @description Juego Básico con Java Swing para adivinar la suma de dos números
*/
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JButton;
import java.awt.event.*;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
public class JuegoBasico extends JFrame{
private static final long serialVersionUID = 1L;
final private JTextField txtNum1,txtNum2,txtResultado,txtIntentos,txtAciertos,txtFallas;
private JButton btnActiva,btnComprueba;
private JButton btnSalir;
private long num1,num2,valor;
long suma_prog;
int intentos=0,aciertos=0,fallas=0;
public JuegoBasico(){
txtNum1=new JTextField(6);
txtNum1.setEnabled(false);
txtNum2=new JTextField(6);txtNum2.setEnabled(false);
txtResultado=new JTextField(6);txtResultado.setEnabled(false);
txtIntentos=new JTextField(6);txtIntentos.setEnabled(false);
txtAciertos=new JTextField(6);txtAciertos.setEnabled(false);
txtFallas=new JTextField(6);txtFallas.setEnabled(false);
JPanel panel=new JPanel();
panel.add(new JLabel("Número 1:"));
panel.add(txtNum1);
panel.add(new JLabel("+"));
panel.add(new JLabel("Número 2:"));
panel.add(txtNum2);
panel.add(new JLabel("= Resultado"));
panel.add(txtResultado);
panel.add(new JLabel("Intentos:"));
panel.add(txtIntentos);
panel.add(new JLabel("Aciertos:"));
panel.add(txtAciertos);
panel.add(new JLabel("Fallas:"));
panel.add(txtFallas);
btnActiva= new JButton("Activar");
btnActiva.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JuegoBasico aleatorio=new JuegoBasico();
aleatorio.setNum1(aleatorio.obtenerAleatorio1());
aleatorio.setNum2(aleatorio.obtenerAleatorio2());
txtNum1.setText(String.valueOf(aleatorio.getNum1()));// no. 1
txtNum2.setText(String.valueOf(aleatorio.getNum2()));// no.2
txtResultado.setText("");
}
});
btnComprueba= new JButton("Comprobar");
btnComprueba.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JuegoBasico alea=new JuegoBasico();
valor=Long.parseLong(JOptionPane.showInputDialog("Introduce valor"));
alea.setValor(valor);
txtResultado.setText(String.valueOf(alea.getValor()));//valor del usuario
//-------------------------------------------------------------------------------------
suma_prog=Long.parseLong(txtNum1.getText())+ Long.parseLong(txtNum2.getText());
if(suma_prog==alea.getValor()){
aciertos+=1;
intentos+=1;
txtIntentos.setText(String.valueOf(intentos));
txtAciertos.setText(String.valueOf(aciertos));
}else{
fallas+=1;
intentos+=1;
txtIntentos.setText(String.valueOf(intentos));
txtFallas.setText(String.valueOf(fallas));
}
//----------------------------------------------------------------------------
}
});
btnSalir= new JButton("Salir");
btnSalir.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
panel.add(btnActiva);panel.add(btnComprueba);
panel.add(btnSalir);
setTitle("Aleatorio");
setSize(620,180);
setDefaultLookAndFeelDecorated(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
add(panel);
}
public static void main(String[] args)throws Exception{
for(UIManager.LookAndFeelInfo laf:UIManager.getInstalledLookAndFeels()){
if("Nimbus".equals(laf.getName()))
try {
UIManager.setLookAndFeel(laf.getClassName());
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel" ) ;
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JuegoBasico Aleatorio=new JuegoBasico();
Aleatorio.setVisible(true);
} catch (ClassNotFoundException e) {
System.out.println("[Main.main:ClassNotFoundException]"+ e.getMessage());
} catch (InstantiationException e) {
System.out.println("[Main.main:InstantiationException]"+ e.getMessage());
}
}
}
public long getNum1() {
return num1;
}
public void setNum1(long num1) {
this.num1 = num1;
}
public long getNum2() {
return num2;
}
public void setNum2(long num2) {
this.num2 = num2;
}
public long obtenerAleatorio1(){
return (long)(Math.random()*1000);
}
public long obtenerAleatorio2(){
return (long)(Math.random()*1000);
}
public long getValor() {
return valor;
}
public void setValor(long valor) {
this.valor = valor;
}
}
|
[
"[email protected]"
] | |
eda4bae3af98ebc23ce4366e97d47716a9514ee3
|
357eca3fcf0fb5a2006cd013a65106138c0c18d4
|
/src/sk/tomsik68/nbtlib/serialize/DontSave.java
|
42a74696f8bc3015d4fe0ef99676632f7e48d332
|
[] |
no_license
|
tomsik68/nbtlib
|
5600779e6eb103f82cc0afb2e9e6082806836bd4
|
5bcb88f17b37f5f518cde939545a2f55594d52ca
|
refs/heads/master
| 2020-04-12T21:54:09.904833 | 2014-10-31T21:28:47 | 2014-10-31T21:28:47 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 76 |
java
|
package sk.tomsik68.nbtlib.serialize;
public @interface DontSave {
}
|
[
"[email protected]"
] | |
1e0f3ad7ea8b755f75d3ad8023dd5aa6910083e5
|
717c28cb287dbd88096496c46d74549ff3590467
|
/src/xml_doc_Related1/ReadXMLDoc_Logradouro.java
|
2fee81a18c998d992b265d584eb63a97b86d1661
|
[
"MIT"
] |
permissive
|
lab-csx-ufmg/omtg2gml
|
dc99572273d0bd9ab16f6457e5c3df77613d37d0
|
300577bef8d3c3a3d73cbb9fda674d6a9bc11745
|
refs/heads/master
| 2021-01-10T08:00:19.864095 | 2016-03-07T17:17:14 | 2016-03-07T17:17:14 | 53,261,339 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,712 |
java
|
package xml_doc_Related1;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
import java.util.StringTokenizer;
public class ReadXMLDoc_Logradouro {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new File("xml_doc/Related1/thoroughfare-cs-o-l-output2.xml"));
FileWriter fw = new FileWriter("xml_doc/Related1/thoroughfare-cs-o-l-output3.xml");
BufferedWriter bw = new BufferedWriter(fw);
String logradouro = "";
while (in.hasNextLine()) {
String line = in.nextLine();
bw.append(line);
bw.newLine();
if (line.contains("<thoroughfare>")) {
line = in.nextLine();
bw.append(line);
bw.newLine();
Scanner in2 = new Scanner(line);
in2.useDelimiter("[<>]+");
in2.next();
in2.next();
logradouro = in2.next();
System.err.println(logradouro);
}
if (line.contains("</name>")) {
// bw.append("<TESTE>");
// bw.newLine();
boolean r = false;
boolean append = false;
Scanner in3 = new Scanner(new File("xml_doc/Related1/streetSegment.xml"));
while (in3.hasNextLine()) {
String line3 = in3.nextLine();
if (line3.contains("<Logra>"+logradouro+"</Logra>")) {
// bw.append("<aggregationTS>");
// bw.newLine();
bw.append("<streetSegment>");
bw.newLine();
append = true;
bw.append(line3);
bw.newLine();
line3 = in3.nextLine();
}
if (append) {
bw.append(line3);
bw.newLine();
}
// fim do bloco
if (line3.contains("</streetSegment>")) {
//r = true;
append = false;
}
}
// r = false;
// append = false;
// Scanner in4 = new Scanner(new File("xml_doc/aggregationTS-OESTE.xml"));
// while (in4.hasNextLine()) {
//
// String line3 = in4.nextLine();
// if (line3.contains("<Logra>"+logradouro+"</Logra>")) {
//
// bw.append("<aggregationTS>");
// bw.newLine();
// bw.append("<streetSegment>");
// bw.newLine();
//
// append = true;
// bw.append(line3);
// bw.newLine();
// line3 = in4.nextLine();
// }
//
// if (append) {
// bw.append(line3);
// bw.newLine();
// }
//
// if (line3.contains("/aggregationTS")) {
// //r = true;
// append = false;
// }
// }
}
}
bw.flush();
bw.close();
}
}
|
[
"[email protected]"
] | |
32549220bd63067c6daececf34f91d9d21ed4886
|
2d1c51fbf54c69e4a8e5bf01190c53d8ab719efd
|
/service_rc/src/main/java/com/run/app/generate/swagger/base/BaseSwgApp.java
|
e7818f4da1be51db663f0ea11e5c274d8d4f6649
|
[] |
no_license
|
aixiaoqie/Tools
|
fa2077856532eae617f9a08aff9c4795aaa2582f
|
5c79c946c191f11e2f5f8d63b4f007a41ce30502
|
refs/heads/master
| 2022-07-15T04:24:34.144909 | 2019-12-10T12:51:09 | 2019-12-10T12:51:09 | 227,120,564 | 0 | 0 | null | 2022-06-30T14:46:56 | 2019-12-10T12:53:43 |
Java
|
UTF-8
|
Java
| false | false | 6,050 |
java
|
package com.run.app.generate.swagger.base;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.util.FileCopyUtils;
import com.run.app.base.BaseApp;
import com.run.ent.custom.ResultModel;
import com.run.ent.extend.gp.GpUser;
import com.run.utl.SymbolicConstant;
import net.sf.json.JSONArray;
public class BaseSwgApp extends BaseApp {
@Value("${upload.diskPath}")
public String diskPath;// 硬盘存放地址
@Value("${upload.linkPath}")
public String linkPath;// 访问地址
@Resource
public JdbcTemplate jdbcTemplate;
protected GpUser getCurrentUser() {
Object object = request.getAttribute(SymbolicConstant.REQUEST_CURRENT_USER);
return object == null ? null : (GpUser) object;
}
protected String[] getResourcePathArray(String resourcePath) {
if (StringUtils.isBlank(resourcePath))
return new String[] {};
String[] resourcePathArray = resourcePath.split("\\|");
for (int i = 0; i < resourcePathArray.length; i++) {
resourcePathArray[i] = linkPath + resourcePathArray[i];
}
return resourcePathArray;
}
@SuppressWarnings({ "unchecked" })
protected Object exportExcel(String fileName, JSONArray titleArray, ResultModel resultModel) throws IOException {
HSSFWorkbook hssfWorkbook = new HSSFWorkbook();
HSSFSheet sheet = hssfWorkbook.createSheet("统计表");
HSSFRow titleHssfRow = sheet.createRow(0);
for (int i = 0; i < titleArray.size(); i++) {
sheet.setColumnWidth((i + 1), 17 * 256);
}
HSSFCellStyle titleHssfCellStyle = hssfWorkbook.createCellStyle();
HSSFFont hssfFont = hssfWorkbook.createFont();
hssfFont.setBold(true);
titleHssfCellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
titleHssfCellStyle.setFont(hssfFont);
HSSFCell contentHssfCell = null;
for (int i = 0; i < titleArray.size(); i++) {
contentHssfCell = titleHssfRow.createCell(i);
contentHssfCell.setCellValue(titleArray.getJSONObject(i).getString("columnText"));
contentHssfCell.setCellStyle(titleHssfCellStyle);
}
List<Map<String, Object>> list = (List<Map<String, Object>>) resultModel.getData();
titleHssfCellStyle = hssfWorkbook.createCellStyle();
titleHssfCellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
hssfFont.setBold(false);
titleHssfCellStyle.setFont(hssfFont);
int rowNum = 1;
for (Map<String, Object> map : list) {
HSSFRow row = sheet.createRow(rowNum);
for (int i = 0; i < titleArray.size(); i++) {
contentHssfCell = row.createCell(i);
{
Object value = map.get(titleArray.getJSONObject(i).getString("columnName"));
String cellValue = value == null ? "" : value.toString();
contentHssfCell.setCellValue(cellValue);
}
}
rowNum++;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
hssfWorkbook.write(out);
out.close();
hssfWorkbook.close();
ByteArrayInputStream inputStream = new ByteArrayInputStream(out.toByteArray());
final String userAgent = request.getHeader("USER-AGENT");
if (StringUtils.contains(userAgent, "MSIE")) {// IE浏览器
fileName = URLEncoder.encode(fileName, "UTF8");
} else if (StringUtils.contains(userAgent, "Mozilla")) {// google,火狐浏览器
fileName = new String(fileName.getBytes(), "ISO8859-1");
} else {
fileName = URLEncoder.encode(fileName, "UTF8");// 其他浏览器
}
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
return FileCopyUtils.copy(inputStream, response.getOutputStream());
}
@SuppressWarnings({ "unchecked" })
protected Object exportExcel(String fileName, JSONArray titleArray) throws IOException {
HSSFWorkbook hssfWorkbook = new HSSFWorkbook();
HSSFSheet sheet = hssfWorkbook.createSheet("统计表");
HSSFRow titleHssfRow = sheet.createRow(0);
for (int i = 0; i < titleArray.size(); i++) {
sheet.setColumnWidth((i + 1), 17 * 256);
}
HSSFCellStyle titleHssfCellStyle = hssfWorkbook.createCellStyle();
HSSFFont hssfFont = hssfWorkbook.createFont();
hssfFont.setBold(true);
titleHssfCellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
titleHssfCellStyle.setFont(hssfFont);
HSSFCell contentHssfCell = null;
for (int i = 0; i < titleArray.size(); i++) {
contentHssfCell = titleHssfRow.createCell(i);
contentHssfCell.setCellValue(titleArray.getJSONObject(i).getString("columnText"));
contentHssfCell.setCellStyle(titleHssfCellStyle);
}
titleHssfCellStyle = hssfWorkbook.createCellStyle();
titleHssfCellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
hssfFont.setBold(false);
titleHssfCellStyle.setFont(hssfFont);
ByteArrayOutputStream out = new ByteArrayOutputStream();
hssfWorkbook.write(out);
out.close();
hssfWorkbook.close();
ByteArrayInputStream inputStream = new ByteArrayInputStream(out.toByteArray());
final String userAgent = request.getHeader("USER-AGENT");
if (StringUtils.contains(userAgent, "MSIE")) {// IE浏览器
fileName = URLEncoder.encode(fileName, "UTF8");
} else if (StringUtils.contains(userAgent, "Mozilla")) {// google,火狐浏览器
fileName = new String(fileName.getBytes(), "ISO8859-1");
} else {
fileName = URLEncoder.encode(fileName, "UTF8");// 其他浏览器
}
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
return FileCopyUtils.copy(inputStream, response.getOutputStream());
}
}
|
[
"[email protected]"
] | |
dbbcba4f5fed5c1fc331d6566abc22c8a3428852
|
ae1cefebe4f74511e01c34af4f944cdbc48ab330
|
/src/org/flexigraph/MainUI.java
|
d4fbf94073f3590ea98d67e1a052b5eb0b09c187
|
[] |
no_license
|
thegazou/Flexigraph
|
4d925f0267fd0789d93ebaac05e7ceff0a6c729f
|
fee087e4d19ea6d325f8a143dbfb799adadd2184
|
refs/heads/master
| 2021-01-24T18:26:06.905075 | 2017-05-07T22:06:03 | 2017-05-07T22:06:03 | 84,438,690 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,083 |
java
|
package org.flexigraph;
import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import java.awt.FlowLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JSlider;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.imgproc.Imgproc;
import org.flexigraph.pre_processing.Perspective;
import org.flexigraph.processing.Processing;
import org.flexigraph.tools.Tools;
import java.awt.BorderLayout;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
public class MainUI {
private JFrame frame;
private BufferedImage originalImg;
private BufferedImage preprocessedImg;
private BufferedImage processedImg;
private JButton btnOpen;
private JButton btnProcess;
private JButton btnSave;
private JSlider sldThresholdValue;
private JLabel lblPreprocessed;
private JLabel lblOriginal;
private JLabel lblProcessed;
/**
* Launch the application.
*/
public static void main(String[] args) {
nu.pattern.OpenCV.loadLibrary();
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainUI window = new MainUI();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public MainUI() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 629, 479);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout(0, 0));
JPanel panel = new JPanel();
frame.getContentPane().add(panel, BorderLayout.NORTH);
panel.setLayout(new GridLayout(0, 3, 0, 0));
btnOpen = new JButton("Open");
panel.add(btnOpen);
btnProcess = new JButton("Process");
panel.add(btnProcess);
btnSave = new JButton("Save");
panel.add(btnSave);
JPanel panel_1 = new JPanel();
frame.getContentPane().add(panel_1, BorderLayout.CENTER);
panel_1.setLayout(new GridLayout(0, 3, 0, 0));
lblOriginal = new JLabel();
panel_1.add(lblOriginal);
lblPreprocessed = new JLabel();
panel_1.add(lblPreprocessed);
JPanel panel_2 = new JPanel();
panel_1.add(panel_2);
panel_2.setLayout(new BorderLayout(0, 0));
sldThresholdValue = new JSlider();
sldThresholdValue.setValue(180);
sldThresholdValue.setMaximum(255);
panel_2.add(sldThresholdValue, BorderLayout.NORTH);
lblProcessed = new JLabel("");
panel_2.add(lblProcessed, BorderLayout.CENTER);
// Listeners
// Buttons
btnOpen.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
JFileChooser fc = new JFileChooser();
int returnVal = fc.showOpenDialog(frame);
if (returnVal == JFileChooser.APPROVE_OPTION) {
try {
File file = fc.getSelectedFile();
originalImg = ImageIO.read(file);
preprocessedImg = null;
processedImg = null;
} catch (IOException e) {
e.printStackTrace();
}
}
}
});
btnProcess.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
Processing p = new Processing();
List<Mat> sources = new ArrayList<>();
Mat original = Tools.bufferedImageToMat(originalImg);
// -------------
// PREPROCESSING
// -------------
if (preprocessedImg == null)
{
original = Perspective.correctPerspective(original, false);
preprocessedImg = Tools.matToBufferedImage(original);
lblPreprocessed.setIcon(new ImageIcon(Tools.resize(preprocessedImg, lblPreprocessed.getWidth(), lblPreprocessed.getHeight())));
}
// -------------
// PROCESSING
// -------------
Core.split(original, sources);
List<Mat> results = new ArrayList<>();
for (Mat m : sources) {
// m.convertTo(m, CvType.CV_32FC1);
p.fourierTransform(m);
Mat img = p.inverseFourierTransform();
results.add(img);
}
Mat image = new Mat();
for (Mat m : results) {
Imgproc.threshold(m, m, sldThresholdValue.getValue(), 255, Imgproc.THRESH_BINARY);
}
Core.merge(results, image);
Imgproc.threshold(image, image, sldThresholdValue.getValue(), 255, Imgproc.THRESH_BINARY);
// show in label
processedImg = Tools.matToBufferedImage(image);
lblProcessed.setIcon(new ImageIcon(Tools.resize(processedImg, lblProcessed.getWidth(), lblProcessed.getHeight())));
}
});
btnSave.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
JFileChooser fc = new JFileChooser();
int returnVal = fc.showSaveDialog(frame);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File outputFile = fc.getSelectedFile();
try {
ImageIO.write(processedImg, "jpg", outputFile);
} catch (IOException e) {
e.printStackTrace();
}
}
}
});
// Labels
lblOriginal.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
lblOriginal.setIcon(new ImageIcon(Tools.resize(originalImg, lblOriginal.getWidth(), lblOriginal.getHeight())));
}
});
lblPreprocessed.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
lblPreprocessed.setIcon(new ImageIcon(Tools.resize(preprocessedImg, lblPreprocessed.getWidth(), lblPreprocessed.getHeight())));
}
});
lblProcessed.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
lblProcessed.setIcon(new ImageIcon(Tools.resize(processedImg, lblProcessed.getWidth(), lblProcessed.getHeight())));
}
});
}
}
|
[
"[email protected]"
] | |
60383b0fbbaa6c9b56bfbb8d0f62226a8523e640
|
d3b9d0dee50f058dcb25c7561df8251ee19bc0a2
|
/project5/src/main/java/com/jobreadyprogrammer/spark/CustomersAndProducts.java
|
d31d70ef8c9a73315d009d7b363ef1767e58025d
|
[] |
no_license
|
vibhanshu123/sparkwithjava
|
378871202e57f1c29f71d1b61c8da3db2ddd441a
|
09a5ae89aafd0e30ab621bb40a71428086c5614e
|
refs/heads/master
| 2020-05-14T23:45:43.054138 | 2019-04-18T02:38:37 | 2019-04-18T03:05:37 | 182,001,876 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,855 |
java
|
package com.jobreadyprogrammer.spark;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.SparkSession;
import static org.apache.spark.sql.functions.*;
public class CustomersAndProducts {
public static void main(String[] args) {
SparkSession spark = SparkSession.builder()
.appName("Learning Spark SQL Dataframe API")
.master("local")
.getOrCreate();
String customers_file = "src/main/resources/customers.csv";
Dataset<Row> customersDf = spark.read().format("csv")
.option("inferSchema", "true") // Make sure to use string version of true
.option("header", true)
.load(customers_file);
String products_file = "src/main/resources/products.csv";
Dataset<Row> productsDf = spark.read().format("csv")
.option("inferSchema", "true") // Make sure to use string version of true
.option("header", true)
.load(products_file);
String purchases_file = "src/main/resources/purchases.csv";
Dataset<Row> purchasesDf = spark.read().format("csv")
.option("inferSchema", "true") // Make sure to use string version of true
.option("header", true)
.load(purchases_file);
System.out.println(" Loaded all files into Dataframes ");
System.out.println("----------------------------------");
Dataset<Row> joinedDF = customersDf.join(purchasesDf,customersDf.col("customer_id").
equalTo(purchasesDf.col("customer_id"))).join(productsDf,purchasesDf.col("product_id").
equalTo(productsDf.col("product_id"))).drop(purchasesDf.col("customer_id")).
drop(purchasesDf.col("product_id")).drop("product_id").drop(customersDf.col("favorite_website"));
Dataset<Row> aggdf = joinedDF.groupBy("customer_id").agg(count("product_name").as("number_of_purchases"),
max("product_price").as("most_exp+purchase"),sum("product_price").as("total_spent"));
aggdf.show();
//show method is called as action
Dataset<Row> aggDf = joinedDF.groupBy("first_name", "product_name").agg(
count("product_name").as("number_of_purchases"),
max("product_price").as("most_exp_purchase"),
sum("product_price").as("total_spent")
);
aggDf.show();
aggDf = aggDf.drop("number_of_purchases").drop("most_exp_purchase");
Dataset<Row> initialDf = aggDf;
for(int i = 0; i < 500; i++ ) {
aggDf = aggDf.union(initialDf);
}
//so in above case all the instruction will not run as spark is smart and will understand that
//nothing is required in above steps as final action is performed on joined df .sprak attributes
//this smartness to its catalyst optmizer .
joinedDF.collectAsList();
}
}
|
[
"[email protected]"
] | |
88ee352bd0259248f7968d95d6f07782314b7635
|
653f24b19d64a0642b3e1b01593bbc79de9944a5
|
/advancedMapReduce/src/mapreduce/exam/pageview/GroupKeyComparator.java
|
2403e08516e9b38ef8e7ddbeddc5eb16016ef029
|
[] |
no_license
|
jaywagger/Big-Data
|
35a1a3b7e149fa7084b53254fb8d278d039ab2d7
|
e53437f72daba7f339614506947b098102788e3b
|
refs/heads/master
| 2022-12-22T10:11:37.740472 | 2020-05-01T10:08:58 | 2020-05-01T10:08:58 | 241,073,922 | 0 | 0 | null | 2022-12-16T07:17:26 | 2020-02-17T09:59:08 |
JavaScript
|
UTF-8
|
Java
| false | false | 567 |
java
|
package mapreduce.exam.pageview;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;
public class GroupKeyComparator
extends WritableComparator {
protected GroupKeyComparator() {
super(MyKey.class,true);
}
@SuppressWarnings("rawtypes")
@Override
public int compare(WritableComparable obj1,
WritableComparable obj2) {
MyKey key1 = (MyKey)obj1;
MyKey key2 = (MyKey)obj2;
//그룹을 무엇으로 묶어줄 것 이냐.
return key1.getProductId().compareTo(key2.getProductId());
}
}
|
[
"[email protected]"
] | |
5ace62ba34cd27008038ba5eac3cbc181078c526
|
12468e4726987fd2efc8d5f330c8345e3d1c148d
|
/hummingbird-spi/src/main/java/com/hczhang/hummingbird/command/interceptor/Dispatcher.java
|
042714cac8747aa89d357363201977b02bab6cbf
|
[
"Apache-2.0"
] |
permissive
|
halo-ddd/hummingbird-framework
|
ae05ee74ce1aca1ffc2495d6ff778e5d3de502aa
|
e31a672e14ba36081c8a1effb84a1af4c5e5b58f
|
refs/heads/master
| 2021-05-31T00:35:17.904963 | 2016-01-13T20:19:00 | 2016-01-13T20:19:00 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,331 |
java
|
package com.hczhang.hummingbird.command.interceptor;
import com.google.common.collect.Multimap;
import com.google.common.collect.TreeMultimap;
import com.hczhang.hummingbird.cloud.Cloud;
import com.hczhang.hummingbird.command.Command;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by steven on 12/29/14.
*/
public class Dispatcher {
private static Logger logger = LoggerFactory.getLogger(Dispatcher.class);
private Cloud cloud;
private Multimap<Class<? extends Command>, CommandInterceptor> interceptors;
/**
* Instantiates a new Dispatcher.
*
* @param cloud the cloud
*/
public Dispatcher(Cloud cloud) {
this.cloud = cloud;
interceptors = TreeMultimap.create(new CommandComparator(), new InterceptorComparator());
}
/**
* Intercept object.
*
* @param cmd the cmd
* @return the object
*/
// TODO: Add finalized style of command interceptor
public Object intercept(Command cmd) {
Object result = null;
for (CommandInterceptor inter : interceptors.get(cmd.getClass())) {
logger.debug("Pre-Process interceptor [{}]", inter.getClass().getSimpleName());
result = inter.preProcess(this.cloud, this, cmd);
if (result != null) {
return result;
}
}
result = cloud.vapor(cmd);
for (CommandInterceptor inter : interceptors.get(cmd.getClass())) {
logger.debug("Post-Process interceptor [{}]", inter.getClass().getSimpleName());
boolean flag = inter.postProcess(this.cloud, this, cmd, result);
if (flag == false) {
return result;
}
}
return result;
}
/**
* Add interceptor.
*
* @param cmdType the cmd type
* @param interceptor the interceptor
*/
public void addInterceptor(Class<? extends Command> cmdType, CommandInterceptor interceptor) {
interceptors.put(cmdType, interceptor);
}
/**
* Remove interceptor.
*
* @param cmdType the cmd type
* @param interceptor the interceptor
*/
public void removeInterceptor(Class<? extends Command> cmdType, CommandInterceptor interceptor) {
interceptors.get(cmdType).remove(interceptor);
}
}
|
[
"[email protected]"
] | |
4dfb50d5fb71ff1e8e975dab22ae27db9f92815b
|
92225460ebca1bb6a594d77b6559b3629b7a94fa
|
/src/com/kingdee/eas/fdc/aimcost/app/AbstractDynCostSnapShotControllerBean.java
|
a30326830181ededf5e5c15d3cc35186ea160430
|
[] |
no_license
|
yangfan0725/sd
|
45182d34575381be3bbdd55f3f68854a6900a362
|
39ebad6e2eb76286d551a9e21967f3f5dc4880da
|
refs/heads/master
| 2023-04-29T01:56:43.770005 | 2023-04-24T05:41:13 | 2023-04-24T05:41:13 | 512,073,641 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 9,258 |
java
|
package com.kingdee.eas.fdc.aimcost.app;
import javax.ejb.*;
import java.rmi.RemoteException;
import com.kingdee.bos.*;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.metadata.IMetaDataPK;
import com.kingdee.bos.metadata.rule.RuleExecutor;
import com.kingdee.bos.metadata.MetaDataPK;
//import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
//import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.bos.service.ServiceContext;
import com.kingdee.bos.service.IServiceContext;
import com.kingdee.eas.framework.Result;
import com.kingdee.eas.framework.LineResult;
import com.kingdee.eas.framework.exception.EASMultiException;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import java.lang.String;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.eas.fdc.aimcost.DynCostSnapShotInfo;
import com.kingdee.eas.framework.CoreBaseInfo;
import java.util.Map;
import com.kingdee.eas.framework.ObjectBaseCollection;
import com.kingdee.eas.fdc.aimcost.DynCostSnapShotCollection;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.eas.framework.app.ObjectBaseControllerBean;
import com.kingdee.eas.framework.CoreBaseCollection;
public abstract class AbstractDynCostSnapShotControllerBean extends ObjectBaseControllerBean implements DynCostSnapShotController
{
protected AbstractDynCostSnapShotControllerBean()
{
}
protected BOSObjectType getBOSType()
{
return new BOSObjectType("C2CE2BB3");
}
public DynCostSnapShotCollection getDynCostSnapShotCollection(Context ctx) throws BOSException
{
try {
ServiceContext svcCtx = createServiceContext(new MetaDataPK("312cd00e-010f-1000-e000-00ccc0a80e96"), new Object[]{ctx});
invokeServiceBefore(svcCtx);
DynCostSnapShotCollection retValue = (DynCostSnapShotCollection)_getCollection(ctx, svcCtx);
svcCtx.setMethodReturnValue(retValue);
invokeServiceAfter(svcCtx);
return retValue;
} catch (BOSException ex) {
throw ex;
} finally {
super.cleanUpServiceState();
}
}
protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx) throws BOSException
{
return super._getCollection(ctx, svcCtx);
}
public DynCostSnapShotCollection getDynCostSnapShotCollection(Context ctx, EntityViewInfo view) throws BOSException
{
try {
ServiceContext svcCtx = createServiceContext(new MetaDataPK("312cd00e-010f-1000-e000-00cdc0a80e96"), new Object[]{ctx, view});
invokeServiceBefore(svcCtx);
DynCostSnapShotCollection retValue = (DynCostSnapShotCollection)_getCollection(ctx, svcCtx, view);
svcCtx.setMethodReturnValue(retValue);
invokeServiceAfter(svcCtx);
return retValue;
} catch (BOSException ex) {
throw ex;
} finally {
super.cleanUpServiceState();
}
}
protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx, EntityViewInfo view) throws BOSException
{
return super._getCollection(ctx, svcCtx, view);
}
public DynCostSnapShotCollection getDynCostSnapShotCollection(Context ctx, String oql) throws BOSException
{
try {
ServiceContext svcCtx = createServiceContext(new MetaDataPK("312cd00e-010f-1000-e000-00cec0a80e96"), new Object[]{ctx, oql});
invokeServiceBefore(svcCtx);
DynCostSnapShotCollection retValue = (DynCostSnapShotCollection)_getCollection(ctx, svcCtx, oql);
svcCtx.setMethodReturnValue(retValue);
invokeServiceAfter(svcCtx);
return retValue;
} catch (BOSException ex) {
throw ex;
} finally {
super.cleanUpServiceState();
}
}
protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx, String oql) throws BOSException
{
return super._getCollection(ctx, svcCtx, oql);
}
public DynCostSnapShotInfo getDynCostSnapShotInfo(Context ctx, IObjectPK pk) throws BOSException, EASBizException
{
try {
ServiceContext svcCtx = createServiceContext(new MetaDataPK("312cd00e-010f-1000-e000-00cfc0a80e96"), new Object[]{ctx, pk});
invokeServiceBefore(svcCtx);
DynCostSnapShotInfo retValue = (DynCostSnapShotInfo)_getValue(ctx, pk);
svcCtx.setMethodReturnValue(retValue);
invokeServiceAfter(svcCtx);
return retValue;
} catch (BOSException ex) {
throw ex;
} catch (EASBizException ex0) {
throw ex0;
} finally {
super.cleanUpServiceState();
}
}
protected IObjectValue _getValue(Context ctx, IObjectPK pk) throws BOSException, EASBizException
{
return super._getValue(ctx, pk);
}
public DynCostSnapShotInfo getDynCostSnapShotInfo(Context ctx, IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException
{
try {
ServiceContext svcCtx = createServiceContext(new MetaDataPK("312cd00e-010f-1000-e000-00d0c0a80e96"), new Object[]{ctx, pk, selector});
invokeServiceBefore(svcCtx);
DynCostSnapShotInfo retValue = (DynCostSnapShotInfo)_getValue(ctx, pk, selector);
svcCtx.setMethodReturnValue(retValue);
invokeServiceAfter(svcCtx);
return retValue;
} catch (BOSException ex) {
throw ex;
} catch (EASBizException ex0) {
throw ex0;
} finally {
super.cleanUpServiceState();
}
}
protected IObjectValue _getValue(Context ctx, IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException
{
return super._getValue(ctx, pk, selector);
}
public DynCostSnapShotInfo getDynCostSnapShotInfo(Context ctx, String oql) throws BOSException, EASBizException
{
try {
ServiceContext svcCtx = createServiceContext(new MetaDataPK("312cd00e-010f-1000-e000-00d1c0a80e96"), new Object[]{ctx, oql});
invokeServiceBefore(svcCtx);
DynCostSnapShotInfo retValue = (DynCostSnapShotInfo)_getValue(ctx, oql);
svcCtx.setMethodReturnValue(retValue);
invokeServiceAfter(svcCtx);
return retValue;
} catch (BOSException ex) {
throw ex;
} catch (EASBizException ex0) {
throw ex0;
} finally {
super.cleanUpServiceState();
}
}
protected IObjectValue _getValue(Context ctx, String oql) throws BOSException, EASBizException
{
return super._getValue(ctx, oql);
}
public Map getHistoryByMonth(Context ctx, Map selectMonth) throws BOSException, EASBizException
{
try {
ServiceContext svcCtx = createServiceContext(new MetaDataPK("3bca5de3-0112-1000-e000-0026c0a80eb6"), new Object[]{ctx, selectMonth});
invokeServiceBefore(svcCtx);
Map retValue = (Map)_getHistoryByMonth(ctx, selectMonth);
svcCtx.setMethodReturnValue(retValue);
invokeServiceAfter(svcCtx);
return retValue;
} catch (BOSException ex) {
this.setRollbackOnly();
throw ex;
} catch (EASBizException ex0) {
this.setRollbackOnly();
throw ex0;
} finally {
super.cleanUpServiceState();
}
}
protected abstract Map _getHistoryByMonth(Context ctx, Map selectMonth) throws BOSException, EASBizException;
public ObjectBaseCollection getObjectBaseCollection (Context ctx) throws BOSException
{
return (ObjectBaseCollection)(getDynCostSnapShotCollection(ctx).cast(ObjectBaseCollection.class));
}
public ObjectBaseCollection getObjectBaseCollection (Context ctx, EntityViewInfo view) throws BOSException
{
return (ObjectBaseCollection)(getDynCostSnapShotCollection(ctx, view).cast(ObjectBaseCollection.class));
}
public ObjectBaseCollection getObjectBaseCollection (Context ctx, String oql) throws BOSException
{
return (ObjectBaseCollection)(getDynCostSnapShotCollection(ctx, oql).cast(ObjectBaseCollection.class));
}
public CoreBaseCollection getCoreBaseCollection (Context ctx) throws BOSException
{
return (CoreBaseCollection)(getDynCostSnapShotCollection(ctx).cast(CoreBaseCollection.class));
}
public CoreBaseCollection getCoreBaseCollection (Context ctx, EntityViewInfo view) throws BOSException
{
return (CoreBaseCollection)(getDynCostSnapShotCollection(ctx, view).cast(CoreBaseCollection.class));
}
public CoreBaseCollection getCoreBaseCollection (Context ctx, String oql) throws BOSException
{
return (CoreBaseCollection)(getDynCostSnapShotCollection(ctx, oql).cast(CoreBaseCollection.class));
}
}
|
[
"[email protected]"
] | |
afbcb69de1ec5dc8e54313a20e7b4137dd1ca56c
|
c2b136fd3cdf3bb6f0811911b265147e784d28cc
|
/businesslogic/src/main/java/inetbanking/services/UserService.java
|
ed8d1d331e5424de18481102b5bc6673d8eeb72f
|
[] |
no_license
|
lrdTnc/inetbanking
|
773e6f4b788820428ff9fafc9350a24ec922dd7b
|
4a2fe6d5d98e9ab23e0a69483e7e55da1bf6cf91
|
refs/heads/master
| 2021-06-06T12:40:02.966100 | 2016-10-19T13:45:17 | 2016-10-19T13:45:17 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 235 |
java
|
package inetbanking.services;
import inetbanking.model.User;
import org.springframework.stereotype.Service;
@Service
public interface UserService extends CRUDService<User,Long>{
User getByUsername(String username);
}
|
[
"[email protected]"
] | |
2ec704ea825477ab5fe28ffe0cf1025d521cbaf7
|
6bcaeb4d0e7e48629404d57e1590c69dd4754498
|
/SO-WebApp-shop/src/main/java/by/training/nc/dev5/exceptions/DuplicationException.java
|
d51f337992f4f45fc40e82412de42512a9fc7441
|
[] |
no_license
|
ATPod/nc-training
|
56a03fa01f96ebaa075f93134485180a069b0407
|
75dffd524be61f2675c0bda2bfacfbbad66c993b
|
refs/heads/master
| 2020-05-23T08:36:57.766787 | 2017-07-11T07:26:37 | 2017-07-11T07:26:37 | 84,756,625 | 1 | 6 | null | 2017-03-17T15:17:22 | 2017-03-12T20:52:38 |
Java
|
UTF-8
|
Java
| false | false | 299 |
java
|
package by.training.nc.dev5.exceptions;
public class DuplicationException extends Exception {
public DuplicationException() {}
public DuplicationException(String msg) {
super(msg);
}
public DuplicationException(String msg, Throwable ex) {
super(msg, ex);
}
}
|
[
"[email protected]"
] | |
ab10344bf73c72c47cca058477d2cb058c6c6bd5
|
c87435311e49865bb6bc4c08c544a5ed3e72ec33
|
/UI-Generator/src/jGame/model/input/Keyboard.java
|
86053e1d382e808d63b5b3ca57c93e107630fdeb
|
[] |
no_license
|
FukuCat/UI-Designer
|
811276c231678261b714f99fd7c9553b1deac52c
|
9d2f3192d265952ba6a75210f3877824e4877368
|
refs/heads/master
| 2023-08-10T11:56:48.822742 | 2017-11-09T16:28:28 | 2017-11-09T16:28:28 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,288 |
java
|
package jGame.model.input;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JPanel;
import jGame.model.input.AbstractKeyboard;
public class Keyboard extends AbstractKeyboard implements KeyListener{
private JPanel parent;
public Keyboard(JPanel parent){
setKeyMap(new boolean[KeyEvent.KEY_LAST + 1]);
setParent(parent);
}
@Override
public void pollPress() {
// TODO Auto-generated method stub
}
@Override
public void pollRelease() {
// TODO Auto-generated method stub
}
@Override
public void pollType() {
// TODO Auto-generated method stub
}
@Override
public boolean isPressed(int key) {
if(key < 0 || key > KeyEvent.KEY_LAST)
return false;
return keyMap[key];
}
private void setKey(int key, boolean value){
if(!(key < 0 || key > KeyEvent.KEY_LAST))
keyMap[key] = value;
}
// key listener
@Override
public void keyPressed(KeyEvent arg0) {
setKey(arg0.getKeyCode(), true);
}
@Override
public void keyReleased(KeyEvent arg0) {
setKey(arg0.getKeyCode(), false);
}
@Override
public void keyTyped(KeyEvent arg0) {
// TODO Auto-generated method stub
}
public JPanel getParent() {
return parent;
}
public void setParent(JPanel parent) {
this.parent = parent;
}
}
|
[
"[email protected]"
] | |
82369305d55bec32b0e3c6f6fab39dd14cddb16b
|
aab66d24a030f6ca4cd7c0fc2874597a770c1ee4
|
/Grade 11/24_MoreMathClass/Taxi.java
|
829062775923776e69450ad2c80dd5d1894122fc
|
[] |
no_license
|
Victor-Duan/High-School-Homework
|
bf5966adb8d281af992541d08adf64663bd3bc6e
|
d095fa988f5396f20b2b0940cd2145fe70fa17b9
|
refs/heads/master
| 2021-01-01T16:20:05.288137 | 2015-03-08T07:53:38 | 2015-03-08T07:53:38 | 31,842,108 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 813 |
java
|
/*
File Name: Taxi.java
Name: Victor Duan
Class: ICS3U1
Date: April 30, 2013
Description: The program outputs how many taxis are needed for a given group of people
Each taxi can hold 4 peopel
*/
import java.util.*;
import java.lang.Math;
public class Taxi {
public static void main(String[] args) {
//variable declaration
Scanner sc = new Scanner(System.in);
double people;
final int TAXICAPA = 4;
//gets the number of people
System.out.print("Enter the number of people available: ");
people = sc.nextInt();
//calculates the number of taxis needed using the Math.ceil method
System.out.println("Number of taxis needed: " + Math.ceil(people/TAXICAPA));
}
}
|
[
"[email protected]"
] | |
29a72d018fcc65022d4e74baab51ad87f4d89dfe
|
d5644e529f2c067b6f3c3783e9782cf6df7c1611
|
/bitcamp-project-client/v33_2/src/main/java/com/eomcs/lms/dao/proxy/BoardDaoProxy.java
|
fd0d0bcc64a44b6569335189f02fad46a9b159b3
|
[] |
no_license
|
JUNE-29/bitcamp-study
|
1806c5f392a41580268b62fbbf6d846d3d4d502b
|
d53b079f29bce74d2d67a31061b74fdc5972dcc0
|
refs/heads/master
| 2022-08-02T12:24:18.732053 | 2020-05-27T04:03:39 | 2020-05-27T04:03:39 | 225,501,857 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,397 |
java
|
package com.eomcs.lms.dao.proxy;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.List;
import com.eomcs.lms.dao.BoardDao;
import com.eomcs.lms.domain.Board;
// 프록시 객체는 항상 작업 객체와 동일한 인터페이스를 구현해야 한다.
// => 마치 자신이 작업 객체인양 보이기 위함이다.
//
public class BoardDaoProxy implements BoardDao {
String host;
int port;
public BoardDaoProxy(String host, int port) {
this.host = host;
this.port = port;
}
@Override
public int insert(Board board) throws Exception {
// 호출 하는 시점에서 연결된다.
try (Socket socket = new Socket(host, port);
// 입출력 준비
ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
ObjectInputStream in = new ObjectInputStream(socket.getInputStream())) {
out.writeUTF("/board/add");
out.writeObject(board);
out.flush();
String response = in.readUTF();
if (response.equals("FAIL")) {
throw new Exception(in.readUTF());
// 이유를 읽고 Exception으로 해서 클라이언트에게 던진다.
}
return 1;
}
}
@SuppressWarnings("unchecked")
@Override
public List<Board> findAll() throws Exception {
try (Socket socket = new Socket(host, port);
ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
ObjectInputStream in = new ObjectInputStream(socket.getInputStream())) {
out.writeUTF("/board/list"); // 서버에 요청!
out.flush();
String response = in.readUTF();
if (response.equals("FAIL")) {
throw new Exception(in.readUTF());
}
return (List<Board>) in.readObject();
}
}
@Override
public Board findByNo(int no) throws Exception {
try (Socket socket = new Socket(host, port);
ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
ObjectInputStream in = new ObjectInputStream(socket.getInputStream())) {
out.writeUTF("/board/detail");
out.writeInt(no);
out.flush();
String response = in.readUTF();
if (response.equals("FAIL")) {
throw new Exception(in.readUTF());
}
return (Board) in.readObject();
}
}
@Override
public int update(Board board) throws Exception {
try (Socket socket = new Socket(host, port);
ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
ObjectInputStream in = new ObjectInputStream(socket.getInputStream())) {
out.writeUTF("/board/update");
out.writeObject(board);
out.flush();
String response = in.readUTF();
if (response.equals("FAIL")) {
throw new Exception(in.readUTF());
}
return 1; // 한 개 업데이트 했다.
}
}
@Override
public int delete(int no) throws Exception {
try (Socket socket = new Socket(host, port);
ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
ObjectInputStream in = new ObjectInputStream(socket.getInputStream())) {
out.writeUTF("/board/delete");
out.writeInt(no);
out.flush();
String response = in.readUTF();
if (response.equals("FAIL")) {
throw new Exception(in.readUTF());
}
return 1;
}
}
}
|
[
"[email protected]"
] | |
22e2fbe05ce7ae5aca41b707bbb9e1b65a110326
|
b772a183d5a1de0e81d5c84f9c740fff5cef430e
|
/src/com/vmykhailyk/xsl/utils/Constants.java
|
1c2b17f02b31dbdf9ac75e9ff82e3fe871e1e89a
|
[] |
no_license
|
volodymyr-mykhailyk/mXSLT
|
fec718798caf9093f9bb30b97ae4c872a231a424
|
84056c4d7ee8dc57b6c95e711688383dc5b535a0
|
refs/heads/master
| 2020-04-28T11:11:11.043084 | 2012-03-03T16:01:04 | 2012-03-03T16:01:04 | 3,591,029 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 941 |
java
|
package com.vmykhailyk.xsl.utils;
/**
* User: Volodymyr.Mykhailyk
* Date: Jan 6, 2011
* Time: 1:05:31 PM
*/
public class Constants {
public static final String NS_PREFIX = "mFunc";
public static final String NS_URL = "http://www.vmykhailyk.com/xsl/multithreading";
public static final String PERFORMANCE_ANALYZER_XSLT_FUNC = "monitorPerformance";
public static final String SPAWN_NEW_THREAD_FUNC_NAME = "spawnNewThread";
public static final String START_TEMPLATE_NAME = "processNodeInCurrentThread";
public static final int REPEAT_COUNT = 2;
public static final String INPUT_FILE = "C:\\projects\\other\\mSaxon\\input\\xMark\\out01.xml";
public static final String XSL_FILE = "C:\\projects\\other\\mSaxon\\xsl\\xMark\\mXSLT.xsl";
public static final String OUTPUT_FILE = "C:\\projects\\other\\mSaxon\\output\\out.xml";
public static final int TERMINATION_TIMEOUT = 20;
}
|
[
"[email protected]"
] | |
a6a345b349c646de4a79bf7c3070b9b58cf1daed
|
e42afd54dcc0add3d2b8823ee98a18c50023a396
|
/java-certificate-manager/grpc-google-cloud-certificate-manager-v1/src/main/java/com/google/cloud/certificatemanager/v1/CertificateManagerGrpc.java
|
27f616e7379e040678f9d56a264132471fc6d167
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
degloba/google-cloud-java
|
eea41ebb64f4128583533bc1547e264e730750e2
|
b1850f15cd562c659c6e8aaee1d1e65d4cd4147e
|
refs/heads/master
| 2022-07-07T17:29:12.510736 | 2022-07-04T09:19:33 | 2022-07-04T09:19:33 | 180,201,746 | 0 | 0 |
Apache-2.0
| 2022-07-04T09:17:23 | 2019-04-08T17:42:24 |
Java
|
UTF-8
|
Java
| false | false | 121,548 |
java
|
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.certificatemanager.v1;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*
*
* <pre>
* API Overview
* Certificates Manager API allows customers to see and manage all their TLS
* certificates.
* Certificates Manager API service provides methods to manage certificates,
* group them into collections, and create serving configuration that can be
* easily applied to other Cloud resources e.g. Target Proxies.
* Data Model
* The Certificates Manager service exposes the following resources:
* * `Certificate` which describes a single TLS certificate.
* * `CertificateMap` which describes a collection of certificates that can be
* attached to a target resource.
* * `CertificateMapEntry` which describes a single configuration entry that
* consists of a SNI and a group of certificates. It's a subresource of
* CertificateMap.
* Certificate, CertificateMap and CertificateMapEntry IDs
* have to match "^[a-z0-9-]{1,63}$" regexp, which means that
* - only lower case letters, digits, and hyphen are allowed
* - length of the resource ID has to be in [1,63] range.
* Provides methods to manage Cloud Certificate Manager entities.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: google/cloud/certificatemanager/v1/certificate_manager.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class CertificateManagerGrpc {
private CertificateManagerGrpc() {}
public static final String SERVICE_NAME = "google.cloud.certificatemanager.v1.CertificateManager";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListCertificatesRequest,
com.google.cloud.certificatemanager.v1.ListCertificatesResponse>
getListCertificatesMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ListCertificates",
requestType = com.google.cloud.certificatemanager.v1.ListCertificatesRequest.class,
responseType = com.google.cloud.certificatemanager.v1.ListCertificatesResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListCertificatesRequest,
com.google.cloud.certificatemanager.v1.ListCertificatesResponse>
getListCertificatesMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListCertificatesRequest,
com.google.cloud.certificatemanager.v1.ListCertificatesResponse>
getListCertificatesMethod;
if ((getListCertificatesMethod = CertificateManagerGrpc.getListCertificatesMethod) == null) {
synchronized (CertificateManagerGrpc.class) {
if ((getListCertificatesMethod = CertificateManagerGrpc.getListCertificatesMethod)
== null) {
CertificateManagerGrpc.getListCertificatesMethod =
getListCertificatesMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.ListCertificatesRequest,
com.google.cloud.certificatemanager.v1.ListCertificatesResponse>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCertificates"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.ListCertificatesRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.ListCertificatesResponse
.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("ListCertificates"))
.build();
}
}
}
return getListCertificatesMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetCertificateRequest,
com.google.cloud.certificatemanager.v1.Certificate>
getGetCertificateMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetCertificate",
requestType = com.google.cloud.certificatemanager.v1.GetCertificateRequest.class,
responseType = com.google.cloud.certificatemanager.v1.Certificate.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetCertificateRequest,
com.google.cloud.certificatemanager.v1.Certificate>
getGetCertificateMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetCertificateRequest,
com.google.cloud.certificatemanager.v1.Certificate>
getGetCertificateMethod;
if ((getGetCertificateMethod = CertificateManagerGrpc.getGetCertificateMethod) == null) {
synchronized (CertificateManagerGrpc.class) {
if ((getGetCertificateMethod = CertificateManagerGrpc.getGetCertificateMethod) == null) {
CertificateManagerGrpc.getGetCertificateMethod =
getGetCertificateMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.GetCertificateRequest,
com.google.cloud.certificatemanager.v1.Certificate>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCertificate"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.GetCertificateRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.Certificate
.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("GetCertificate"))
.build();
}
}
}
return getGetCertificateMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateCertificateRequest,
com.google.longrunning.Operation>
getCreateCertificateMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CreateCertificate",
requestType = com.google.cloud.certificatemanager.v1.CreateCertificateRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateCertificateRequest,
com.google.longrunning.Operation>
getCreateCertificateMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateCertificateRequest,
com.google.longrunning.Operation>
getCreateCertificateMethod;
if ((getCreateCertificateMethod = CertificateManagerGrpc.getCreateCertificateMethod) == null) {
synchronized (CertificateManagerGrpc.class) {
if ((getCreateCertificateMethod = CertificateManagerGrpc.getCreateCertificateMethod)
== null) {
CertificateManagerGrpc.getCreateCertificateMethod =
getCreateCertificateMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.CreateCertificateRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCertificate"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.CreateCertificateRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("CreateCertificate"))
.build();
}
}
}
return getCreateCertificateMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateCertificateRequest,
com.google.longrunning.Operation>
getUpdateCertificateMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "UpdateCertificate",
requestType = com.google.cloud.certificatemanager.v1.UpdateCertificateRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateCertificateRequest,
com.google.longrunning.Operation>
getUpdateCertificateMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateCertificateRequest,
com.google.longrunning.Operation>
getUpdateCertificateMethod;
if ((getUpdateCertificateMethod = CertificateManagerGrpc.getUpdateCertificateMethod) == null) {
synchronized (CertificateManagerGrpc.class) {
if ((getUpdateCertificateMethod = CertificateManagerGrpc.getUpdateCertificateMethod)
== null) {
CertificateManagerGrpc.getUpdateCertificateMethod =
getUpdateCertificateMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.UpdateCertificateRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCertificate"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.UpdateCertificateRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("UpdateCertificate"))
.build();
}
}
}
return getUpdateCertificateMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteCertificateRequest,
com.google.longrunning.Operation>
getDeleteCertificateMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "DeleteCertificate",
requestType = com.google.cloud.certificatemanager.v1.DeleteCertificateRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteCertificateRequest,
com.google.longrunning.Operation>
getDeleteCertificateMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteCertificateRequest,
com.google.longrunning.Operation>
getDeleteCertificateMethod;
if ((getDeleteCertificateMethod = CertificateManagerGrpc.getDeleteCertificateMethod) == null) {
synchronized (CertificateManagerGrpc.class) {
if ((getDeleteCertificateMethod = CertificateManagerGrpc.getDeleteCertificateMethod)
== null) {
CertificateManagerGrpc.getDeleteCertificateMethod =
getDeleteCertificateMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.DeleteCertificateRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCertificate"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.DeleteCertificateRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("DeleteCertificate"))
.build();
}
}
}
return getDeleteCertificateMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest,
com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse>
getListCertificateMapsMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ListCertificateMaps",
requestType = com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest.class,
responseType = com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest,
com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse>
getListCertificateMapsMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest,
com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse>
getListCertificateMapsMethod;
if ((getListCertificateMapsMethod = CertificateManagerGrpc.getListCertificateMapsMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getListCertificateMapsMethod = CertificateManagerGrpc.getListCertificateMapsMethod)
== null) {
CertificateManagerGrpc.getListCertificateMapsMethod =
getListCertificateMapsMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest,
com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "ListCertificateMaps"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse
.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("ListCertificateMaps"))
.build();
}
}
}
return getListCertificateMapsMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetCertificateMapRequest,
com.google.cloud.certificatemanager.v1.CertificateMap>
getGetCertificateMapMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetCertificateMap",
requestType = com.google.cloud.certificatemanager.v1.GetCertificateMapRequest.class,
responseType = com.google.cloud.certificatemanager.v1.CertificateMap.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetCertificateMapRequest,
com.google.cloud.certificatemanager.v1.CertificateMap>
getGetCertificateMapMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetCertificateMapRequest,
com.google.cloud.certificatemanager.v1.CertificateMap>
getGetCertificateMapMethod;
if ((getGetCertificateMapMethod = CertificateManagerGrpc.getGetCertificateMapMethod) == null) {
synchronized (CertificateManagerGrpc.class) {
if ((getGetCertificateMapMethod = CertificateManagerGrpc.getGetCertificateMapMethod)
== null) {
CertificateManagerGrpc.getGetCertificateMapMethod =
getGetCertificateMapMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.GetCertificateMapRequest,
com.google.cloud.certificatemanager.v1.CertificateMap>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCertificateMap"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.GetCertificateMapRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.CertificateMap
.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("GetCertificateMap"))
.build();
}
}
}
return getGetCertificateMapMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest,
com.google.longrunning.Operation>
getCreateCertificateMapMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CreateCertificateMap",
requestType = com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest,
com.google.longrunning.Operation>
getCreateCertificateMapMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest,
com.google.longrunning.Operation>
getCreateCertificateMapMethod;
if ((getCreateCertificateMapMethod = CertificateManagerGrpc.getCreateCertificateMapMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getCreateCertificateMapMethod = CertificateManagerGrpc.getCreateCertificateMapMethod)
== null) {
CertificateManagerGrpc.getCreateCertificateMapMethod =
getCreateCertificateMapMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "CreateCertificateMap"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("CreateCertificateMap"))
.build();
}
}
}
return getCreateCertificateMapMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest,
com.google.longrunning.Operation>
getUpdateCertificateMapMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "UpdateCertificateMap",
requestType = com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest,
com.google.longrunning.Operation>
getUpdateCertificateMapMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest,
com.google.longrunning.Operation>
getUpdateCertificateMapMethod;
if ((getUpdateCertificateMapMethod = CertificateManagerGrpc.getUpdateCertificateMapMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getUpdateCertificateMapMethod = CertificateManagerGrpc.getUpdateCertificateMapMethod)
== null) {
CertificateManagerGrpc.getUpdateCertificateMapMethod =
getUpdateCertificateMapMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "UpdateCertificateMap"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("UpdateCertificateMap"))
.build();
}
}
}
return getUpdateCertificateMapMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest,
com.google.longrunning.Operation>
getDeleteCertificateMapMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "DeleteCertificateMap",
requestType = com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest,
com.google.longrunning.Operation>
getDeleteCertificateMapMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest,
com.google.longrunning.Operation>
getDeleteCertificateMapMethod;
if ((getDeleteCertificateMapMethod = CertificateManagerGrpc.getDeleteCertificateMapMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getDeleteCertificateMapMethod = CertificateManagerGrpc.getDeleteCertificateMapMethod)
== null) {
CertificateManagerGrpc.getDeleteCertificateMapMethod =
getDeleteCertificateMapMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "DeleteCertificateMap"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("DeleteCertificateMap"))
.build();
}
}
}
return getDeleteCertificateMapMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest,
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse>
getListCertificateMapEntriesMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ListCertificateMapEntries",
requestType = com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest.class,
responseType = com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest,
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse>
getListCertificateMapEntriesMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest,
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse>
getListCertificateMapEntriesMethod;
if ((getListCertificateMapEntriesMethod =
CertificateManagerGrpc.getListCertificateMapEntriesMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getListCertificateMapEntriesMethod =
CertificateManagerGrpc.getListCertificateMapEntriesMethod)
== null) {
CertificateManagerGrpc.getListCertificateMapEntriesMethod =
getListCertificateMapEntriesMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest,
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "ListCertificateMapEntries"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1
.ListCertificateMapEntriesRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1
.ListCertificateMapEntriesResponse.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier(
"ListCertificateMapEntries"))
.build();
}
}
}
return getListCertificateMapEntriesMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest,
com.google.cloud.certificatemanager.v1.CertificateMapEntry>
getGetCertificateMapEntryMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetCertificateMapEntry",
requestType = com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest.class,
responseType = com.google.cloud.certificatemanager.v1.CertificateMapEntry.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest,
com.google.cloud.certificatemanager.v1.CertificateMapEntry>
getGetCertificateMapEntryMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest,
com.google.cloud.certificatemanager.v1.CertificateMapEntry>
getGetCertificateMapEntryMethod;
if ((getGetCertificateMapEntryMethod = CertificateManagerGrpc.getGetCertificateMapEntryMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getGetCertificateMapEntryMethod =
CertificateManagerGrpc.getGetCertificateMapEntryMethod)
== null) {
CertificateManagerGrpc.getGetCertificateMapEntryMethod =
getGetCertificateMapEntryMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest,
com.google.cloud.certificatemanager.v1.CertificateMapEntry>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "GetCertificateMapEntry"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.CertificateMapEntry
.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("GetCertificateMapEntry"))
.build();
}
}
}
return getGetCertificateMapEntryMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest,
com.google.longrunning.Operation>
getCreateCertificateMapEntryMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CreateCertificateMapEntry",
requestType = com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest,
com.google.longrunning.Operation>
getCreateCertificateMapEntryMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest,
com.google.longrunning.Operation>
getCreateCertificateMapEntryMethod;
if ((getCreateCertificateMapEntryMethod =
CertificateManagerGrpc.getCreateCertificateMapEntryMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getCreateCertificateMapEntryMethod =
CertificateManagerGrpc.getCreateCertificateMapEntryMethod)
== null) {
CertificateManagerGrpc.getCreateCertificateMapEntryMethod =
getCreateCertificateMapEntryMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "CreateCertificateMapEntry"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1
.CreateCertificateMapEntryRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier(
"CreateCertificateMapEntry"))
.build();
}
}
}
return getCreateCertificateMapEntryMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest,
com.google.longrunning.Operation>
getUpdateCertificateMapEntryMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "UpdateCertificateMapEntry",
requestType = com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest,
com.google.longrunning.Operation>
getUpdateCertificateMapEntryMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest,
com.google.longrunning.Operation>
getUpdateCertificateMapEntryMethod;
if ((getUpdateCertificateMapEntryMethod =
CertificateManagerGrpc.getUpdateCertificateMapEntryMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getUpdateCertificateMapEntryMethod =
CertificateManagerGrpc.getUpdateCertificateMapEntryMethod)
== null) {
CertificateManagerGrpc.getUpdateCertificateMapEntryMethod =
getUpdateCertificateMapEntryMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "UpdateCertificateMapEntry"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1
.UpdateCertificateMapEntryRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier(
"UpdateCertificateMapEntry"))
.build();
}
}
}
return getUpdateCertificateMapEntryMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest,
com.google.longrunning.Operation>
getDeleteCertificateMapEntryMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "DeleteCertificateMapEntry",
requestType = com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest,
com.google.longrunning.Operation>
getDeleteCertificateMapEntryMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest,
com.google.longrunning.Operation>
getDeleteCertificateMapEntryMethod;
if ((getDeleteCertificateMapEntryMethod =
CertificateManagerGrpc.getDeleteCertificateMapEntryMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getDeleteCertificateMapEntryMethod =
CertificateManagerGrpc.getDeleteCertificateMapEntryMethod)
== null) {
CertificateManagerGrpc.getDeleteCertificateMapEntryMethod =
getDeleteCertificateMapEntryMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "DeleteCertificateMapEntry"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1
.DeleteCertificateMapEntryRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier(
"DeleteCertificateMapEntry"))
.build();
}
}
}
return getDeleteCertificateMapEntryMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest,
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse>
getListDnsAuthorizationsMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ListDnsAuthorizations",
requestType = com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest.class,
responseType = com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest,
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse>
getListDnsAuthorizationsMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest,
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse>
getListDnsAuthorizationsMethod;
if ((getListDnsAuthorizationsMethod = CertificateManagerGrpc.getListDnsAuthorizationsMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getListDnsAuthorizationsMethod = CertificateManagerGrpc.getListDnsAuthorizationsMethod)
== null) {
CertificateManagerGrpc.getListDnsAuthorizationsMethod =
getListDnsAuthorizationsMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest,
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "ListDnsAuthorizations"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse
.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("ListDnsAuthorizations"))
.build();
}
}
}
return getListDnsAuthorizationsMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest,
com.google.cloud.certificatemanager.v1.DnsAuthorization>
getGetDnsAuthorizationMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetDnsAuthorization",
requestType = com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest.class,
responseType = com.google.cloud.certificatemanager.v1.DnsAuthorization.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest,
com.google.cloud.certificatemanager.v1.DnsAuthorization>
getGetDnsAuthorizationMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest,
com.google.cloud.certificatemanager.v1.DnsAuthorization>
getGetDnsAuthorizationMethod;
if ((getGetDnsAuthorizationMethod = CertificateManagerGrpc.getGetDnsAuthorizationMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getGetDnsAuthorizationMethod = CertificateManagerGrpc.getGetDnsAuthorizationMethod)
== null) {
CertificateManagerGrpc.getGetDnsAuthorizationMethod =
getGetDnsAuthorizationMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest,
com.google.cloud.certificatemanager.v1.DnsAuthorization>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "GetDnsAuthorization"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.DnsAuthorization
.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("GetDnsAuthorization"))
.build();
}
}
}
return getGetDnsAuthorizationMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest,
com.google.longrunning.Operation>
getCreateDnsAuthorizationMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CreateDnsAuthorization",
requestType = com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest,
com.google.longrunning.Operation>
getCreateDnsAuthorizationMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest,
com.google.longrunning.Operation>
getCreateDnsAuthorizationMethod;
if ((getCreateDnsAuthorizationMethod = CertificateManagerGrpc.getCreateDnsAuthorizationMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getCreateDnsAuthorizationMethod =
CertificateManagerGrpc.getCreateDnsAuthorizationMethod)
== null) {
CertificateManagerGrpc.getCreateDnsAuthorizationMethod =
getCreateDnsAuthorizationMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "CreateDnsAuthorization"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("CreateDnsAuthorization"))
.build();
}
}
}
return getCreateDnsAuthorizationMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest,
com.google.longrunning.Operation>
getUpdateDnsAuthorizationMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "UpdateDnsAuthorization",
requestType = com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest,
com.google.longrunning.Operation>
getUpdateDnsAuthorizationMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest,
com.google.longrunning.Operation>
getUpdateDnsAuthorizationMethod;
if ((getUpdateDnsAuthorizationMethod = CertificateManagerGrpc.getUpdateDnsAuthorizationMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getUpdateDnsAuthorizationMethod =
CertificateManagerGrpc.getUpdateDnsAuthorizationMethod)
== null) {
CertificateManagerGrpc.getUpdateDnsAuthorizationMethod =
getUpdateDnsAuthorizationMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "UpdateDnsAuthorization"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("UpdateDnsAuthorization"))
.build();
}
}
}
return getUpdateDnsAuthorizationMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest,
com.google.longrunning.Operation>
getDeleteDnsAuthorizationMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "DeleteDnsAuthorization",
requestType = com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest,
com.google.longrunning.Operation>
getDeleteDnsAuthorizationMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest,
com.google.longrunning.Operation>
getDeleteDnsAuthorizationMethod;
if ((getDeleteDnsAuthorizationMethod = CertificateManagerGrpc.getDeleteDnsAuthorizationMethod)
== null) {
synchronized (CertificateManagerGrpc.class) {
if ((getDeleteDnsAuthorizationMethod =
CertificateManagerGrpc.getDeleteDnsAuthorizationMethod)
== null) {
CertificateManagerGrpc.getDeleteDnsAuthorizationMethod =
getDeleteDnsAuthorizationMethod =
io.grpc.MethodDescriptor
.<com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest,
com.google.longrunning.Operation>
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
generateFullMethodName(SERVICE_NAME, "DeleteDnsAuthorization"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest
.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(
new CertificateManagerMethodDescriptorSupplier("DeleteDnsAuthorization"))
.build();
}
}
}
return getDeleteDnsAuthorizationMethod;
}
/** Creates a new async stub that supports all call types for the service */
public static CertificateManagerStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory<CertificateManagerStub> factory =
new io.grpc.stub.AbstractStub.StubFactory<CertificateManagerStub>() {
@java.lang.Override
public CertificateManagerStub newStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CertificateManagerStub(channel, callOptions);
}
};
return CertificateManagerStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static CertificateManagerBlockingStub newBlockingStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory<CertificateManagerBlockingStub> factory =
new io.grpc.stub.AbstractStub.StubFactory<CertificateManagerBlockingStub>() {
@java.lang.Override
public CertificateManagerBlockingStub newStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CertificateManagerBlockingStub(channel, callOptions);
}
};
return CertificateManagerBlockingStub.newStub(factory, channel);
}
/** Creates a new ListenableFuture-style stub that supports unary calls on the service */
public static CertificateManagerFutureStub newFutureStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory<CertificateManagerFutureStub> factory =
new io.grpc.stub.AbstractStub.StubFactory<CertificateManagerFutureStub>() {
@java.lang.Override
public CertificateManagerFutureStub newStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CertificateManagerFutureStub(channel, callOptions);
}
};
return CertificateManagerFutureStub.newStub(factory, channel);
}
/**
*
*
* <pre>
* API Overview
* Certificates Manager API allows customers to see and manage all their TLS
* certificates.
* Certificates Manager API service provides methods to manage certificates,
* group them into collections, and create serving configuration that can be
* easily applied to other Cloud resources e.g. Target Proxies.
* Data Model
* The Certificates Manager service exposes the following resources:
* * `Certificate` which describes a single TLS certificate.
* * `CertificateMap` which describes a collection of certificates that can be
* attached to a target resource.
* * `CertificateMapEntry` which describes a single configuration entry that
* consists of a SNI and a group of certificates. It's a subresource of
* CertificateMap.
* Certificate, CertificateMap and CertificateMapEntry IDs
* have to match "^[a-z0-9-]{1,63}$" regexp, which means that
* - only lower case letters, digits, and hyphen are allowed
* - length of the resource ID has to be in [1,63] range.
* Provides methods to manage Cloud Certificate Manager entities.
* </pre>
*/
public abstract static class CertificateManagerImplBase implements io.grpc.BindableService {
/**
*
*
* <pre>
* Lists Certificates in a given project and location.
* </pre>
*/
public void listCertificates(
com.google.cloud.certificatemanager.v1.ListCertificatesRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.ListCertificatesResponse>
responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getListCertificatesMethod(), responseObserver);
}
/**
*
*
* <pre>
* Gets details of a single Certificate.
* </pre>
*/
public void getCertificate(
com.google.cloud.certificatemanager.v1.GetCertificateRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.Certificate>
responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getGetCertificateMethod(), responseObserver);
}
/**
*
*
* <pre>
* Creates a new Certificate in a given project and location.
* </pre>
*/
public void createCertificate(
com.google.cloud.certificatemanager.v1.CreateCertificateRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getCreateCertificateMethod(), responseObserver);
}
/**
*
*
* <pre>
* Updates a Certificate.
* </pre>
*/
public void updateCertificate(
com.google.cloud.certificatemanager.v1.UpdateCertificateRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getUpdateCertificateMethod(), responseObserver);
}
/**
*
*
* <pre>
* Deletes a single Certificate.
* </pre>
*/
public void deleteCertificate(
com.google.cloud.certificatemanager.v1.DeleteCertificateRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getDeleteCertificateMethod(), responseObserver);
}
/**
*
*
* <pre>
* Lists CertificateMaps in a given project and location.
* </pre>
*/
public void listCertificateMaps(
com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest request,
io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse>
responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getListCertificateMapsMethod(), responseObserver);
}
/**
*
*
* <pre>
* Gets details of a single CertificateMap.
* </pre>
*/
public void getCertificateMap(
com.google.cloud.certificatemanager.v1.GetCertificateMapRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.CertificateMap>
responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getGetCertificateMapMethod(), responseObserver);
}
/**
*
*
* <pre>
* Creates a new CertificateMap in a given project and location.
* </pre>
*/
public void createCertificateMap(
com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getCreateCertificateMapMethod(), responseObserver);
}
/**
*
*
* <pre>
* Updates a CertificateMap.
* </pre>
*/
public void updateCertificateMap(
com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getUpdateCertificateMapMethod(), responseObserver);
}
/**
*
*
* <pre>
* Deletes a single CertificateMap. A Certificate Map can't be deleted
* if it contains Certificate Map Entries. Remove all the entries from
* the map before calling this method.
* </pre>
*/
public void deleteCertificateMap(
com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getDeleteCertificateMapMethod(), responseObserver);
}
/**
*
*
* <pre>
* Lists CertificateMapEntries in a given project and location.
* </pre>
*/
public void listCertificateMapEntries(
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest request,
io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse>
responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getListCertificateMapEntriesMethod(), responseObserver);
}
/**
*
*
* <pre>
* Gets details of a single CertificateMapEntry.
* </pre>
*/
public void getCertificateMapEntry(
com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.CertificateMapEntry>
responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getGetCertificateMapEntryMethod(), responseObserver);
}
/**
*
*
* <pre>
* Creates a new CertificateMapEntry in a given project and location.
* </pre>
*/
public void createCertificateMapEntry(
com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getCreateCertificateMapEntryMethod(), responseObserver);
}
/**
*
*
* <pre>
* Updates a CertificateMapEntry.
* </pre>
*/
public void updateCertificateMapEntry(
com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getUpdateCertificateMapEntryMethod(), responseObserver);
}
/**
*
*
* <pre>
* Deletes a single CertificateMapEntry.
* </pre>
*/
public void deleteCertificateMapEntry(
com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getDeleteCertificateMapEntryMethod(), responseObserver);
}
/**
*
*
* <pre>
* Lists DnsAuthorizations in a given project and location.
* </pre>
*/
public void listDnsAuthorizations(
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest request,
io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse>
responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getListDnsAuthorizationsMethod(), responseObserver);
}
/**
*
*
* <pre>
* Gets details of a single DnsAuthorization.
* </pre>
*/
public void getDnsAuthorization(
com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.DnsAuthorization>
responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getGetDnsAuthorizationMethod(), responseObserver);
}
/**
*
*
* <pre>
* Creates a new DnsAuthorization in a given project and location.
* </pre>
*/
public void createDnsAuthorization(
com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getCreateDnsAuthorizationMethod(), responseObserver);
}
/**
*
*
* <pre>
* Updates a DnsAuthorization.
* </pre>
*/
public void updateDnsAuthorization(
com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getUpdateDnsAuthorizationMethod(), responseObserver);
}
/**
*
*
* <pre>
* Deletes a single DnsAuthorization.
* </pre>
*/
public void deleteDnsAuthorization(
com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getDeleteDnsAuthorizationMethod(), responseObserver);
}
@java.lang.Override
public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getListCertificatesMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.ListCertificatesRequest,
com.google.cloud.certificatemanager.v1.ListCertificatesResponse>(
this, METHODID_LIST_CERTIFICATES)))
.addMethod(
getGetCertificateMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.GetCertificateRequest,
com.google.cloud.certificatemanager.v1.Certificate>(
this, METHODID_GET_CERTIFICATE)))
.addMethod(
getCreateCertificateMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.CreateCertificateRequest,
com.google.longrunning.Operation>(this, METHODID_CREATE_CERTIFICATE)))
.addMethod(
getUpdateCertificateMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.UpdateCertificateRequest,
com.google.longrunning.Operation>(this, METHODID_UPDATE_CERTIFICATE)))
.addMethod(
getDeleteCertificateMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.DeleteCertificateRequest,
com.google.longrunning.Operation>(this, METHODID_DELETE_CERTIFICATE)))
.addMethod(
getListCertificateMapsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest,
com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse>(
this, METHODID_LIST_CERTIFICATE_MAPS)))
.addMethod(
getGetCertificateMapMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.GetCertificateMapRequest,
com.google.cloud.certificatemanager.v1.CertificateMap>(
this, METHODID_GET_CERTIFICATE_MAP)))
.addMethod(
getCreateCertificateMapMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest,
com.google.longrunning.Operation>(this, METHODID_CREATE_CERTIFICATE_MAP)))
.addMethod(
getUpdateCertificateMapMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest,
com.google.longrunning.Operation>(this, METHODID_UPDATE_CERTIFICATE_MAP)))
.addMethod(
getDeleteCertificateMapMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest,
com.google.longrunning.Operation>(this, METHODID_DELETE_CERTIFICATE_MAP)))
.addMethod(
getListCertificateMapEntriesMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest,
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse>(
this, METHODID_LIST_CERTIFICATE_MAP_ENTRIES)))
.addMethod(
getGetCertificateMapEntryMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest,
com.google.cloud.certificatemanager.v1.CertificateMapEntry>(
this, METHODID_GET_CERTIFICATE_MAP_ENTRY)))
.addMethod(
getCreateCertificateMapEntryMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest,
com.google.longrunning.Operation>(
this, METHODID_CREATE_CERTIFICATE_MAP_ENTRY)))
.addMethod(
getUpdateCertificateMapEntryMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest,
com.google.longrunning.Operation>(
this, METHODID_UPDATE_CERTIFICATE_MAP_ENTRY)))
.addMethod(
getDeleteCertificateMapEntryMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest,
com.google.longrunning.Operation>(
this, METHODID_DELETE_CERTIFICATE_MAP_ENTRY)))
.addMethod(
getListDnsAuthorizationsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest,
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse>(
this, METHODID_LIST_DNS_AUTHORIZATIONS)))
.addMethod(
getGetDnsAuthorizationMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest,
com.google.cloud.certificatemanager.v1.DnsAuthorization>(
this, METHODID_GET_DNS_AUTHORIZATION)))
.addMethod(
getCreateDnsAuthorizationMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest,
com.google.longrunning.Operation>(this, METHODID_CREATE_DNS_AUTHORIZATION)))
.addMethod(
getUpdateDnsAuthorizationMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest,
com.google.longrunning.Operation>(this, METHODID_UPDATE_DNS_AUTHORIZATION)))
.addMethod(
getDeleteDnsAuthorizationMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest,
com.google.longrunning.Operation>(this, METHODID_DELETE_DNS_AUTHORIZATION)))
.build();
}
}
/**
*
*
* <pre>
* API Overview
* Certificates Manager API allows customers to see and manage all their TLS
* certificates.
* Certificates Manager API service provides methods to manage certificates,
* group them into collections, and create serving configuration that can be
* easily applied to other Cloud resources e.g. Target Proxies.
* Data Model
* The Certificates Manager service exposes the following resources:
* * `Certificate` which describes a single TLS certificate.
* * `CertificateMap` which describes a collection of certificates that can be
* attached to a target resource.
* * `CertificateMapEntry` which describes a single configuration entry that
* consists of a SNI and a group of certificates. It's a subresource of
* CertificateMap.
* Certificate, CertificateMap and CertificateMapEntry IDs
* have to match "^[a-z0-9-]{1,63}$" regexp, which means that
* - only lower case letters, digits, and hyphen are allowed
* - length of the resource ID has to be in [1,63] range.
* Provides methods to manage Cloud Certificate Manager entities.
* </pre>
*/
public static final class CertificateManagerStub
extends io.grpc.stub.AbstractAsyncStub<CertificateManagerStub> {
private CertificateManagerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected CertificateManagerStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CertificateManagerStub(channel, callOptions);
}
/**
*
*
* <pre>
* Lists Certificates in a given project and location.
* </pre>
*/
public void listCertificates(
com.google.cloud.certificatemanager.v1.ListCertificatesRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.ListCertificatesResponse>
responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getListCertificatesMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Gets details of a single Certificate.
* </pre>
*/
public void getCertificate(
com.google.cloud.certificatemanager.v1.GetCertificateRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.Certificate>
responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetCertificateMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Creates a new Certificate in a given project and location.
* </pre>
*/
public void createCertificate(
com.google.cloud.certificatemanager.v1.CreateCertificateRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCreateCertificateMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Updates a Certificate.
* </pre>
*/
public void updateCertificate(
com.google.cloud.certificatemanager.v1.UpdateCertificateRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getUpdateCertificateMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Deletes a single Certificate.
* </pre>
*/
public void deleteCertificate(
com.google.cloud.certificatemanager.v1.DeleteCertificateRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDeleteCertificateMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Lists CertificateMaps in a given project and location.
* </pre>
*/
public void listCertificateMaps(
com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest request,
io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse>
responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getListCertificateMapsMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Gets details of a single CertificateMap.
* </pre>
*/
public void getCertificateMap(
com.google.cloud.certificatemanager.v1.GetCertificateMapRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.CertificateMap>
responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetCertificateMapMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Creates a new CertificateMap in a given project and location.
* </pre>
*/
public void createCertificateMap(
com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCreateCertificateMapMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Updates a CertificateMap.
* </pre>
*/
public void updateCertificateMap(
com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getUpdateCertificateMapMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Deletes a single CertificateMap. A Certificate Map can't be deleted
* if it contains Certificate Map Entries. Remove all the entries from
* the map before calling this method.
* </pre>
*/
public void deleteCertificateMap(
com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDeleteCertificateMapMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Lists CertificateMapEntries in a given project and location.
* </pre>
*/
public void listCertificateMapEntries(
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest request,
io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse>
responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getListCertificateMapEntriesMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Gets details of a single CertificateMapEntry.
* </pre>
*/
public void getCertificateMapEntry(
com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.CertificateMapEntry>
responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetCertificateMapEntryMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Creates a new CertificateMapEntry in a given project and location.
* </pre>
*/
public void createCertificateMapEntry(
com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCreateCertificateMapEntryMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Updates a CertificateMapEntry.
* </pre>
*/
public void updateCertificateMapEntry(
com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getUpdateCertificateMapEntryMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Deletes a single CertificateMapEntry.
* </pre>
*/
public void deleteCertificateMapEntry(
com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDeleteCertificateMapEntryMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Lists DnsAuthorizations in a given project and location.
* </pre>
*/
public void listDnsAuthorizations(
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest request,
io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse>
responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getListDnsAuthorizationsMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Gets details of a single DnsAuthorization.
* </pre>
*/
public void getDnsAuthorization(
com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.DnsAuthorization>
responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetDnsAuthorizationMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Creates a new DnsAuthorization in a given project and location.
* </pre>
*/
public void createDnsAuthorization(
com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCreateDnsAuthorizationMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Updates a DnsAuthorization.
* </pre>
*/
public void updateDnsAuthorization(
com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getUpdateDnsAuthorizationMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
* <pre>
* Deletes a single DnsAuthorization.
* </pre>
*/
public void deleteDnsAuthorization(
com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest request,
io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDeleteDnsAuthorizationMethod(), getCallOptions()),
request,
responseObserver);
}
}
/**
*
*
* <pre>
* API Overview
* Certificates Manager API allows customers to see and manage all their TLS
* certificates.
* Certificates Manager API service provides methods to manage certificates,
* group them into collections, and create serving configuration that can be
* easily applied to other Cloud resources e.g. Target Proxies.
* Data Model
* The Certificates Manager service exposes the following resources:
* * `Certificate` which describes a single TLS certificate.
* * `CertificateMap` which describes a collection of certificates that can be
* attached to a target resource.
* * `CertificateMapEntry` which describes a single configuration entry that
* consists of a SNI and a group of certificates. It's a subresource of
* CertificateMap.
* Certificate, CertificateMap and CertificateMapEntry IDs
* have to match "^[a-z0-9-]{1,63}$" regexp, which means that
* - only lower case letters, digits, and hyphen are allowed
* - length of the resource ID has to be in [1,63] range.
* Provides methods to manage Cloud Certificate Manager entities.
* </pre>
*/
public static final class CertificateManagerBlockingStub
extends io.grpc.stub.AbstractBlockingStub<CertificateManagerBlockingStub> {
private CertificateManagerBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected CertificateManagerBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CertificateManagerBlockingStub(channel, callOptions);
}
/**
*
*
* <pre>
* Lists Certificates in a given project and location.
* </pre>
*/
public com.google.cloud.certificatemanager.v1.ListCertificatesResponse listCertificates(
com.google.cloud.certificatemanager.v1.ListCertificatesRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getListCertificatesMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Gets details of a single Certificate.
* </pre>
*/
public com.google.cloud.certificatemanager.v1.Certificate getCertificate(
com.google.cloud.certificatemanager.v1.GetCertificateRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetCertificateMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Creates a new Certificate in a given project and location.
* </pre>
*/
public com.google.longrunning.Operation createCertificate(
com.google.cloud.certificatemanager.v1.CreateCertificateRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCreateCertificateMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Updates a Certificate.
* </pre>
*/
public com.google.longrunning.Operation updateCertificate(
com.google.cloud.certificatemanager.v1.UpdateCertificateRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getUpdateCertificateMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Deletes a single Certificate.
* </pre>
*/
public com.google.longrunning.Operation deleteCertificate(
com.google.cloud.certificatemanager.v1.DeleteCertificateRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDeleteCertificateMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Lists CertificateMaps in a given project and location.
* </pre>
*/
public com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse listCertificateMaps(
com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getListCertificateMapsMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Gets details of a single CertificateMap.
* </pre>
*/
public com.google.cloud.certificatemanager.v1.CertificateMap getCertificateMap(
com.google.cloud.certificatemanager.v1.GetCertificateMapRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetCertificateMapMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Creates a new CertificateMap in a given project and location.
* </pre>
*/
public com.google.longrunning.Operation createCertificateMap(
com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCreateCertificateMapMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Updates a CertificateMap.
* </pre>
*/
public com.google.longrunning.Operation updateCertificateMap(
com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getUpdateCertificateMapMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Deletes a single CertificateMap. A Certificate Map can't be deleted
* if it contains Certificate Map Entries. Remove all the entries from
* the map before calling this method.
* </pre>
*/
public com.google.longrunning.Operation deleteCertificateMap(
com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDeleteCertificateMapMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Lists CertificateMapEntries in a given project and location.
* </pre>
*/
public com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse
listCertificateMapEntries(
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getListCertificateMapEntriesMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Gets details of a single CertificateMapEntry.
* </pre>
*/
public com.google.cloud.certificatemanager.v1.CertificateMapEntry getCertificateMapEntry(
com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetCertificateMapEntryMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Creates a new CertificateMapEntry in a given project and location.
* </pre>
*/
public com.google.longrunning.Operation createCertificateMapEntry(
com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCreateCertificateMapEntryMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Updates a CertificateMapEntry.
* </pre>
*/
public com.google.longrunning.Operation updateCertificateMapEntry(
com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getUpdateCertificateMapEntryMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Deletes a single CertificateMapEntry.
* </pre>
*/
public com.google.longrunning.Operation deleteCertificateMapEntry(
com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDeleteCertificateMapEntryMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Lists DnsAuthorizations in a given project and location.
* </pre>
*/
public com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse
listDnsAuthorizations(
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getListDnsAuthorizationsMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Gets details of a single DnsAuthorization.
* </pre>
*/
public com.google.cloud.certificatemanager.v1.DnsAuthorization getDnsAuthorization(
com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetDnsAuthorizationMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Creates a new DnsAuthorization in a given project and location.
* </pre>
*/
public com.google.longrunning.Operation createDnsAuthorization(
com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCreateDnsAuthorizationMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Updates a DnsAuthorization.
* </pre>
*/
public com.google.longrunning.Operation updateDnsAuthorization(
com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getUpdateDnsAuthorizationMethod(), getCallOptions(), request);
}
/**
*
*
* <pre>
* Deletes a single DnsAuthorization.
* </pre>
*/
public com.google.longrunning.Operation deleteDnsAuthorization(
com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDeleteDnsAuthorizationMethod(), getCallOptions(), request);
}
}
/**
*
*
* <pre>
* API Overview
* Certificates Manager API allows customers to see and manage all their TLS
* certificates.
* Certificates Manager API service provides methods to manage certificates,
* group them into collections, and create serving configuration that can be
* easily applied to other Cloud resources e.g. Target Proxies.
* Data Model
* The Certificates Manager service exposes the following resources:
* * `Certificate` which describes a single TLS certificate.
* * `CertificateMap` which describes a collection of certificates that can be
* attached to a target resource.
* * `CertificateMapEntry` which describes a single configuration entry that
* consists of a SNI and a group of certificates. It's a subresource of
* CertificateMap.
* Certificate, CertificateMap and CertificateMapEntry IDs
* have to match "^[a-z0-9-]{1,63}$" regexp, which means that
* - only lower case letters, digits, and hyphen are allowed
* - length of the resource ID has to be in [1,63] range.
* Provides methods to manage Cloud Certificate Manager entities.
* </pre>
*/
public static final class CertificateManagerFutureStub
extends io.grpc.stub.AbstractFutureStub<CertificateManagerFutureStub> {
private CertificateManagerFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected CertificateManagerFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new CertificateManagerFutureStub(channel, callOptions);
}
/**
*
*
* <pre>
* Lists Certificates in a given project and location.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.cloud.certificatemanager.v1.ListCertificatesResponse>
listCertificates(com.google.cloud.certificatemanager.v1.ListCertificatesRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getListCertificatesMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Gets details of a single Certificate.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.cloud.certificatemanager.v1.Certificate>
getCertificate(com.google.cloud.certificatemanager.v1.GetCertificateRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetCertificateMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Creates a new Certificate in a given project and location.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
createCertificate(com.google.cloud.certificatemanager.v1.CreateCertificateRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCreateCertificateMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Updates a Certificate.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
updateCertificate(com.google.cloud.certificatemanager.v1.UpdateCertificateRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getUpdateCertificateMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Deletes a single Certificate.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
deleteCertificate(com.google.cloud.certificatemanager.v1.DeleteCertificateRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDeleteCertificateMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Lists CertificateMaps in a given project and location.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse>
listCertificateMaps(
com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getListCertificateMapsMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Gets details of a single CertificateMap.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.cloud.certificatemanager.v1.CertificateMap>
getCertificateMap(com.google.cloud.certificatemanager.v1.GetCertificateMapRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetCertificateMapMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Creates a new CertificateMap in a given project and location.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
createCertificateMap(
com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCreateCertificateMapMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Updates a CertificateMap.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
updateCertificateMap(
com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getUpdateCertificateMapMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Deletes a single CertificateMap. A Certificate Map can't be deleted
* if it contains Certificate Map Entries. Remove all the entries from
* the map before calling this method.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
deleteCertificateMap(
com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDeleteCertificateMapMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Lists CertificateMapEntries in a given project and location.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse>
listCertificateMapEntries(
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getListCertificateMapEntriesMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Gets details of a single CertificateMapEntry.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.cloud.certificatemanager.v1.CertificateMapEntry>
getCertificateMapEntry(
com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetCertificateMapEntryMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Creates a new CertificateMapEntry in a given project and location.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
createCertificateMapEntry(
com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCreateCertificateMapEntryMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Updates a CertificateMapEntry.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
updateCertificateMapEntry(
com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getUpdateCertificateMapEntryMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Deletes a single CertificateMapEntry.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
deleteCertificateMapEntry(
com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDeleteCertificateMapEntryMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Lists DnsAuthorizations in a given project and location.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse>
listDnsAuthorizations(
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getListDnsAuthorizationsMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Gets details of a single DnsAuthorization.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.cloud.certificatemanager.v1.DnsAuthorization>
getDnsAuthorization(
com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetDnsAuthorizationMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Creates a new DnsAuthorization in a given project and location.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
createDnsAuthorization(
com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCreateDnsAuthorizationMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Updates a DnsAuthorization.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
updateDnsAuthorization(
com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getUpdateDnsAuthorizationMethod(), getCallOptions()), request);
}
/**
*
*
* <pre>
* Deletes a single DnsAuthorization.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
deleteDnsAuthorization(
com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDeleteDnsAuthorizationMethod(), getCallOptions()), request);
}
}
private static final int METHODID_LIST_CERTIFICATES = 0;
private static final int METHODID_GET_CERTIFICATE = 1;
private static final int METHODID_CREATE_CERTIFICATE = 2;
private static final int METHODID_UPDATE_CERTIFICATE = 3;
private static final int METHODID_DELETE_CERTIFICATE = 4;
private static final int METHODID_LIST_CERTIFICATE_MAPS = 5;
private static final int METHODID_GET_CERTIFICATE_MAP = 6;
private static final int METHODID_CREATE_CERTIFICATE_MAP = 7;
private static final int METHODID_UPDATE_CERTIFICATE_MAP = 8;
private static final int METHODID_DELETE_CERTIFICATE_MAP = 9;
private static final int METHODID_LIST_CERTIFICATE_MAP_ENTRIES = 10;
private static final int METHODID_GET_CERTIFICATE_MAP_ENTRY = 11;
private static final int METHODID_CREATE_CERTIFICATE_MAP_ENTRY = 12;
private static final int METHODID_UPDATE_CERTIFICATE_MAP_ENTRY = 13;
private static final int METHODID_DELETE_CERTIFICATE_MAP_ENTRY = 14;
private static final int METHODID_LIST_DNS_AUTHORIZATIONS = 15;
private static final int METHODID_GET_DNS_AUTHORIZATION = 16;
private static final int METHODID_CREATE_DNS_AUTHORIZATION = 17;
private static final int METHODID_UPDATE_DNS_AUTHORIZATION = 18;
private static final int METHODID_DELETE_DNS_AUTHORIZATION = 19;
private static final class MethodHandlers<Req, Resp>
implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
private final CertificateManagerImplBase serviceImpl;
private final int methodId;
MethodHandlers(CertificateManagerImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
case METHODID_LIST_CERTIFICATES:
serviceImpl.listCertificates(
(com.google.cloud.certificatemanager.v1.ListCertificatesRequest) request,
(io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.ListCertificatesResponse>)
responseObserver);
break;
case METHODID_GET_CERTIFICATE:
serviceImpl.getCertificate(
(com.google.cloud.certificatemanager.v1.GetCertificateRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.Certificate>)
responseObserver);
break;
case METHODID_CREATE_CERTIFICATE:
serviceImpl.createCertificate(
(com.google.cloud.certificatemanager.v1.CreateCertificateRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_UPDATE_CERTIFICATE:
serviceImpl.updateCertificate(
(com.google.cloud.certificatemanager.v1.UpdateCertificateRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_DELETE_CERTIFICATE:
serviceImpl.deleteCertificate(
(com.google.cloud.certificatemanager.v1.DeleteCertificateRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_LIST_CERTIFICATE_MAPS:
serviceImpl.listCertificateMaps(
(com.google.cloud.certificatemanager.v1.ListCertificateMapsRequest) request,
(io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.ListCertificateMapsResponse>)
responseObserver);
break;
case METHODID_GET_CERTIFICATE_MAP:
serviceImpl.getCertificateMap(
(com.google.cloud.certificatemanager.v1.GetCertificateMapRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.CertificateMap>)
responseObserver);
break;
case METHODID_CREATE_CERTIFICATE_MAP:
serviceImpl.createCertificateMap(
(com.google.cloud.certificatemanager.v1.CreateCertificateMapRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_UPDATE_CERTIFICATE_MAP:
serviceImpl.updateCertificateMap(
(com.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_DELETE_CERTIFICATE_MAP:
serviceImpl.deleteCertificateMap(
(com.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_LIST_CERTIFICATE_MAP_ENTRIES:
serviceImpl.listCertificateMapEntries(
(com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest) request,
(io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse>)
responseObserver);
break;
case METHODID_GET_CERTIFICATE_MAP_ENTRY:
serviceImpl.getCertificateMapEntry(
(com.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest) request,
(io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.CertificateMapEntry>)
responseObserver);
break;
case METHODID_CREATE_CERTIFICATE_MAP_ENTRY:
serviceImpl.createCertificateMapEntry(
(com.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_UPDATE_CERTIFICATE_MAP_ENTRY:
serviceImpl.updateCertificateMapEntry(
(com.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_DELETE_CERTIFICATE_MAP_ENTRY:
serviceImpl.deleteCertificateMapEntry(
(com.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_LIST_DNS_AUTHORIZATIONS:
serviceImpl.listDnsAuthorizations(
(com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest) request,
(io.grpc.stub.StreamObserver<
com.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse>)
responseObserver);
break;
case METHODID_GET_DNS_AUTHORIZATION:
serviceImpl.getDnsAuthorization(
(com.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.certificatemanager.v1.DnsAuthorization>)
responseObserver);
break;
case METHODID_CREATE_DNS_AUTHORIZATION:
serviceImpl.createDnsAuthorization(
(com.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_UPDATE_DNS_AUTHORIZATION:
serviceImpl.updateDnsAuthorization(
(com.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
case METHODID_DELETE_DNS_AUTHORIZATION:
serviceImpl.deleteDnsAuthorization(
(com.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest) request,
(io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver<Req> invoke(
io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
private abstract static class CertificateManagerBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier,
io.grpc.protobuf.ProtoServiceDescriptorSupplier {
CertificateManagerBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.google.cloud.certificatemanager.v1.CertificateManagerProto.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("CertificateManager");
}
}
private static final class CertificateManagerFileDescriptorSupplier
extends CertificateManagerBaseDescriptorSupplier {
CertificateManagerFileDescriptorSupplier() {}
}
private static final class CertificateManagerMethodDescriptorSupplier
extends CertificateManagerBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
CertificateManagerMethodDescriptorSupplier(String methodName) {
this.methodName = methodName;
}
@java.lang.Override
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
return getServiceDescriptor().findMethodByName(methodName);
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (CertificateManagerGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor =
result =
io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new CertificateManagerFileDescriptorSupplier())
.addMethod(getListCertificatesMethod())
.addMethod(getGetCertificateMethod())
.addMethod(getCreateCertificateMethod())
.addMethod(getUpdateCertificateMethod())
.addMethod(getDeleteCertificateMethod())
.addMethod(getListCertificateMapsMethod())
.addMethod(getGetCertificateMapMethod())
.addMethod(getCreateCertificateMapMethod())
.addMethod(getUpdateCertificateMapMethod())
.addMethod(getDeleteCertificateMapMethod())
.addMethod(getListCertificateMapEntriesMethod())
.addMethod(getGetCertificateMapEntryMethod())
.addMethod(getCreateCertificateMapEntryMethod())
.addMethod(getUpdateCertificateMapEntryMethod())
.addMethod(getDeleteCertificateMapEntryMethod())
.addMethod(getListDnsAuthorizationsMethod())
.addMethod(getGetDnsAuthorizationMethod())
.addMethod(getCreateDnsAuthorizationMethod())
.addMethod(getUpdateDnsAuthorizationMethod())
.addMethod(getDeleteDnsAuthorizationMethod())
.build();
}
}
}
return result;
}
}
|
[
"[email protected]"
] | |
bd8098d632d31fe491e0fb8be34fb4d9c90ac292
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/MOCKITO-3b-3-15-FEMO-WeightedSum:TestLen:CallDiversity/org/mockito/internal/invocation/InvocationMarker_ESTest_scaffolding.java
|
b17ac04fa6609c30764a71740a8221d3d05bb35f
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 452 |
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Apr 03 13:55:54 UTC 2020
*/
package org.mockito.internal.invocation;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class InvocationMarker_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"[email protected]"
] | |
d956c7d612072c8ae40d4e280a92eae4dca09125
|
56954863b5f87c758ae2e19d010778d0b989ceac
|
/workspace-lanqiaobei/NumOrder/src/Main.java
|
1214fac32991a75698973bdd1ff97937c3f09b3a
|
[
"MIT"
] |
permissive
|
believe563/PostLearnedCodes
|
8e0218c971f3aa5a5ed1f6478303f58e77698aea
|
9b8891a6cd88bc4f561d653c1679c9049ee031c6
|
refs/heads/master
| 2020-04-15T04:29:49.075933 | 2019-03-23T07:09:03 | 2019-03-23T07:09:03 | 164,385,943 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 574 |
java
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
if(n>=1&&n<=200){
int[] num=new int[n];
int a;
for(int i=0;i<n;i++){
a=sc.nextInt();
if(Math.abs(a)<10000)
num[i]=a;
}
for(int i=0;i<n;i++){
for(int j=0;j<n-i-1;j++){
if(num[j]>num[j+1]){
a=num[j];
num[j]=num[j+1];
num[j+1]=a;
}
}
}
for(int i=0;i<n;i++){
System.out.print(num[i]+" ");
}
}
System.out.println(Math.sin(3.14/2+"在这里"));
sc.close();
}
}
|
[
"[email protected]"
] | |
c6339aebdc29f8419fcfe8ec62b4f1871c4a6e5d
|
6ae158fdd759ec1a89960a65e8cecc85842194ea
|
/easy-rbac-system/src/main/java/vip/rbac/easy/modules/system/service/mapper/RoleSmallMapper.java
|
8b8841b1d979db5c9778ccc490acdf2fd1b316d3
|
[
"Apache-2.0"
] |
permissive
|
kunvon/easy-rbac
|
7aba7c79be7e3ec55240bcdb16a367f6046af276
|
009063d7efec6ee9673e017b611a01b874e48b63
|
refs/heads/master
| 2020-07-18T09:35:05.049497 | 2019-09-03T06:44:05 | 2019-09-03T06:44:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 495 |
java
|
package vip.rbac.easy.modules.system.service.mapper;
import vip.rbac.easy.mapper.EntityMapper;
import vip.rbac.easy.modules.system.domain.Role;
import vip.rbac.easy.modules.system.service.dto.RoleSmallDTO;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
/**
* @author Zheng Jie
* @date 2019-5-23
*/
@Mapper(componentModel = "spring", uses = {}, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface RoleSmallMapper extends EntityMapper<RoleSmallDTO, Role> {
}
|
[
"[email protected]"
] | |
7e534d59f2a79ec979cb2e12a23ba1fc8ca803a3
|
770b7712b730f7f0b3f0ac05932908023b3ffde4
|
/report_biz/src/main/java/com/report/service/common/IUserService.java
|
d05c585deca4e99984f1e1dc2fe07000cf165d77
|
[] |
no_license
|
wangzbin/report
|
5fa9694be74fcc002a7fa89b98bdbadf6a7c058e
|
a27799c0fcc263eb042398ecd9da9b5b2940c48e
|
refs/heads/master
| 2020-03-16T15:09:26.185422 | 2018-05-09T08:48:43 | 2018-05-09T08:48:43 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 590 |
java
|
package com.report.service.common;
import com.report.common.pojo.User;
import com.report.service.base.IBaseService;
/**
* 用户
* @author Administrator
*
*/
public interface IUserService extends IBaseService<User>{
//通过oppid修改关注状态
public void updateByOpenid(User user);
//通过openid查询用户信息
public User selectByOpenId(String openId);
//通过oppid绑定手机账号
public void updatePhoneByOpenId(User user);
//注册
public void updateUserPwdByOpenId(User user);
//插入关注者的用户信息
public void insertUserInfo(User user);
}
|
[
"[email protected]"
] | |
e5fd624cc68d2a8b5c7070f1ad1fe3cfe8ecf38a
|
e67fd34b387c2fd1ff7a714bfb178f54eb91c07c
|
/DADS_0613/src/com/cloud/mina/server/Test.java
|
b82ccf3a777cf8106b783ce2ed92f066408fab45
|
[] |
no_license
|
wangXiGits/DADS_0613
|
36fb6a864dbee0b7dd2b3db59f84eec0eaf32eb8
|
75475a23c17b29505ba3469d1522576e81300387
|
refs/heads/master
| 2021-09-04T09:22:23.566632 | 2018-01-17T17:26:01 | 2018-01-17T17:26:01 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,935 |
java
|
package com.cloud.mina.server;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Locale;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import com.cloud.mina.util.DownLoadUtil;
public class Test {
public static void main(String[] args) {
HttpServletResponse response = new HttpServletResponse() {
public void setLocale(Locale arg0) {
// TODO Auto-generated method stub
}
public void setContentType(String arg0) {
// TODO Auto-generated method stub
}
public void setContentLength(int arg0) {
// TODO Auto-generated method stub
}
public void setCharacterEncoding(String arg0) {
// TODO Auto-generated method stub
}
public void setBufferSize(int arg0) {
// TODO Auto-generated method stub
}
public void resetBuffer() {
// TODO Auto-generated method stub
}
public void reset() {
// TODO Auto-generated method stub
}
public boolean isCommitted() {
// TODO Auto-generated method stub
return false;
}
public PrintWriter getWriter() throws IOException {
// TODO Auto-generated method stub
return null;
}
public ServletOutputStream getOutputStream() throws IOException {
// TODO Auto-generated method stub
return null;
}
public Locale getLocale() {
// TODO Auto-generated method stub
return null;
}
public String getContentType() {
// TODO Auto-generated method stub
return null;
}
public String getCharacterEncoding() {
// TODO Auto-generated method stub
return null;
}
public int getBufferSize() {
// TODO Auto-generated method stub
return 0;
}
public void flushBuffer() throws IOException {
// TODO Auto-generated method stub
}
public void setStatus(int arg0, String arg1) {
// TODO Auto-generated method stub
}
public void setStatus(int arg0) {
// TODO Auto-generated method stub
}
public void setIntHeader(String arg0, int arg1) {
// TODO Auto-generated method stub
}
public void setHeader(String arg0, String arg1) {
// TODO Auto-generated method stub
}
public void setDateHeader(String arg0, long arg1) {
// TODO Auto-generated method stub
}
public void sendRedirect(String arg0) throws IOException {
// TODO Auto-generated method stub
}
public void sendError(int arg0, String arg1) throws IOException {
// TODO Auto-generated method stub
}
public void sendError(int arg0) throws IOException {
// TODO Auto-generated method stub
}
public String encodeUrl(String arg0) {
// TODO Auto-generated method stub
return null;
}
public String encodeURL(String arg0) {
// TODO Auto-generated method stub
return null;
}
public String encodeRedirectUrl(String arg0) {
// TODO Auto-generated method stub
return null;
}
public String encodeRedirectURL(String arg0) {
// TODO Auto-generated method stub
return null;
}
public boolean containsHeader(String arg0) {
// TODO Auto-generated method stub
return false;
}
public void addIntHeader(String arg0, int arg1) {
// TODO Auto-generated method stub
}
public void addHeader(String arg0, String arg1) {
// TODO Auto-generated method stub
}
public void addDateHeader(String arg0, long arg1) {
// TODO Auto-generated method stub
}
public void addCookie(Cookie arg0) {
// TODO Auto-generated method stub
}
};
File file = new File("d:/code/haha.txt");
String filename = "haha.txt";
System.out.println(DownLoadUtil.downLoadFile(response, filename, file));
;
}
}
|
[
"[email protected]"
] | |
6a9f9c679ce65bfb4d713dcadd3971606e5411d2
|
071a9fa7cfee0d1bf784f6591cd8d07c6b2a2495
|
/corpus/norm-class/ecf/650.java
|
61eba278b1bc167f1306e1ddbaa794fa42a180f7
|
[
"MIT"
] |
permissive
|
masud-technope/ACER-Replication-Package-ASE2017
|
41a7603117f01382e7e16f2f6ae899e6ff3ad6bb
|
cb7318a729eb1403004d451a164c851af2d81f7a
|
refs/heads/master
| 2021-06-21T02:19:43.602864 | 2021-02-13T20:44:09 | 2021-02-13T20:44:09 | 187,748,164 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,019 |
java
|
copyright comp osent composent rights reserved program accompanying materials terms eclipse license accompanies distribution http eclipse org legal epl html contributors scott lewis initial api implementation org eclipse ecf provider osgi identity java net uri java net uri syntax exception urisyntaxexception org eclipse ecf core identity osgiwssnamespace osg i name space osginamespace serialversionuid nls string wss ecf namespace osgi wss namespace scheme nls string name space namespace scheme wss osgi wss singleton instance namespace name space namespace instance singleton instance namespace instance name space namespace get default getdefault instance osgiwssnamespace instance constructor osgiwssnamespace nls wss osg i osgi secure web sockets websockets name space namespace instance create namespace param parameters parameter pass id create exception idcreateexception creation fails org eclipse ecf core identity name space namespace create instance createinstance java lang object create instance createinstance object parameters id create exception idcreateexception string uri string uristring string parameters uri string uristring nls null pointer exception nullpointerexception nls uri parameter nls uri string uristring starts with startswith name space namespace scheme wss uri string uristring starts with startswith https nls nls uri syntax exception urisyntaxexception uri string uristring uri name space namespace scheme wss protocol uri uri uri uri string uristring osgiwsid uri get host gethost uri get port getport exception id create exception idcreateexception get name getname create instance createinstance scheme namespace scheme org eclipse ecf core identity name space namespace get scheme getscheme string get scheme getscheme name space namespace scheme wss supported schemes array supported schemes org eclipse ecf core identity name space namespace get supported schemes getsupportedschemes string get supported schemes getsupportedschemes string name space namespace scheme wss
|
[
"[email protected]"
] | |
6ab3fc46afd75a71358a8e9df98d0b0e62d5ed66
|
6028c7a9cfb19e80e74ea277b0d35d8bd8e0b2d2
|
/project/src/hotelregistry/model/bean/Room.java
|
fa8779af1f891ad7b2e151ccff9f9a2f1ce2412e
|
[] |
no_license
|
matepp/Egyetem
|
d60f5be03283a42d0bb630974d0ece9129d6002d
|
aadeede3ab9704fb0959449f0fc2fe8b073b37d5
|
refs/heads/master
| 2021-01-13T10:32:01.331983 | 2016-11-16T15:23:43 | 2016-11-16T15:23:43 | 69,459,200 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 839 |
java
|
package hotelregistry.model.bean;
public class Room {
private int id;
private int roomNumber;
private int numberOfBeds;
private int price;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getRoomNumber() {
return roomNumber;
}
public void setRoomNumber(int roomNumber) {
this.roomNumber = roomNumber;
}
public int getNumberOfBeds() {
return numberOfBeds;
}
public void setNumberOfBeds(int numberOfBeds) {
this.numberOfBeds = numberOfBeds;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
@Override
public String toString() {
return "Room [id=" + id + ", roomNumber=" + roomNumber + ", numberOfBeds=" + numberOfBeds + ", price=" + price
+ "]";
}
}
|
[
"[email protected]"
] | |
7c5db9923db722ac18b303b9f4596df971b0a572
|
9e26c80ac45d813e916aa2581f58486612bd6c8a
|
/app/src/main/java/com/example/B10709042_HW1/MyAdapter.java
|
c4eb7a59054793cce63a933e5ca5327f0919e4c1
|
[] |
no_license
|
SamHsi/B10709042_HW1
|
41b036e733a1d152c5bfe901308c7d33368b683f
|
086b36b1c7b2669016a5928c52d2e3ca54749c9c
|
refs/heads/master
| 2022-04-20T16:48:41.435795 | 2020-04-21T17:09:09 | 2020-04-21T17:09:09 | 256,586,958 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,813 |
java
|
package com.example.B10709042_HW1;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> {
private List<MainActivity.Item> mData;
MyAdapter(List<MainActivity.Item> data) {
mData = data;
}
// 建立ViewHolder
class ViewHolder extends RecyclerView.ViewHolder{
// 宣告元件
private TextView txtItem;
private CheckBox checkBox;
ViewHolder(View itemView) {
super(itemView);
txtItem = (TextView) itemView.findViewById(R.id.txtItem);
checkBox = (CheckBox) itemView.findViewById(R.id.checkBox);
}
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
// 連結項目布局檔list_item
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.list_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
// 設置要顯示的內容
holder.txtItem.setText(mData.get(position).text);
holder.checkBox.setChecked(mData.get(position).check);
holder.checkBox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean b = ((CheckBox) v).isChecked();
holder.checkBox.setChecked(b);
mData.get(position).setCheck(b);
}
});
}
@Override
public int getItemCount() {
return mData.size();
}
}
|
[
"[email protected]"
] | |
efeced799add9982fd7a0d0f4f699645ad37fe86
|
49d82f38128e1885763e47999a95be66344ba1ee
|
/ui/src/main/java/com/zijida/ridergroup/ui/util/preferenceIO.java
|
3e2f4f402303a5b03db7cdecf3049f15e751a7a8
|
[] |
no_license
|
zijida/riderGroup
|
67edcefbe1a803c6c606a7b6b182bfd9ba4b4f15
|
05098156411e62262819505ec7f840701c999816
|
refs/heads/master
| 2016-09-05T19:26:08.768111 | 2014-05-15T08:57:43 | 2014-05-15T08:57:43 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,274 |
java
|
package com.zijida.ridergroup.ui.util;
import android.content.Context;
import android.content.SharedPreferences;
/**
* Created by shenjun on 14-4-16.
* Create in ${PROJECT_NAME}
*/
public class preferenceIO {
private SharedPreferences spf;
public Context context;
public preferenceIO(Context context,String PREFERENCES_NAME)
{
this.context = context;
spf = context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE);
}
public String get_value(String key)
{
if(spf==null) return null;
return spf.getString(key,null);
}
public boolean get_boolean(String key,boolean defVal)
{
if(spf==null) return defVal;
return spf.getBoolean(key, defVal);
}
public long get_long(String key)
{
if(spf==null) return -1;
return spf.getLong(key, -1);
}
public int get_integer(String key)
{
if(spf==null) return -1;
return spf.getInt(key, -1);
}
public void set_value(String key,String value)
{
if(spf==null) return;
if(value==null ||value.length()==0) return;
SharedPreferences.Editor editor = spf.edit();
if(editor!=null)
{
editor.putString(key, value);
editor.commit();
}
}
public void set_boolean(String key,boolean value)
{
if(spf==null) return;
SharedPreferences.Editor editor = spf.edit();
if(editor!=null)
{
editor.putBoolean(key, value);
editor.commit();
}
}
public void set_long(String key,long value)
{
if(spf==null) return;
SharedPreferences.Editor editor = spf.edit();
if(editor!=null)
{
editor.putLong(key, value);
editor.commit();
}
}
public void set_integer(String key,int value)
{
if(spf==null) return;
SharedPreferences.Editor editor = spf.edit();
if(editor!=null)
{
editor.putInt(key, value);
editor.commit();
}
}
public void clear()
{
if(spf==null) return;
SharedPreferences.Editor editor = spf.edit();
editor.clear();
editor.commit();
}
}
|
[
"[email protected]"
] | |
f44a0d5a5b289238506526353f367705594ab282
|
94db3d3f05b2ffd25c56e618af81ff99231d6e64
|
/app/src/main/java/com/example/nikhil/zupigocheck/MainActivity.java
|
78477df6fe0910290371d2ae3a5269bd3e34771c
|
[] |
no_license
|
nikhil0011/Zupigo
|
ddd468b310257462b2f7b60cea97b95532d34f1a
|
97441a0772e51fa56b3563a95a0e066fd395c379
|
refs/heads/master
| 2020-05-22T20:32:20.143452 | 2017-03-12T11:51:35 | 2017-03-12T11:51:35 | 84,721,242 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 20,843 |
java
|
package com.example.nikhil.zupigocheck;
import android.accounts.AccountManager;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.NavigationView;
import android.support.design.widget.Snackbar;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.support.v7.widget.Toolbar;
import android.text.InputType;
import android.util.Log;
import android.util.Patterns;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, View.OnClickListener {
//Creating a List of superheroes
private List<JavaBean> listSuperHeroes;
private ImageView imagesearch, imageback;
public AppBarLayout invisibleheader, header;
//Creating Views
private RecyclerView recyclerView;
private StaggeredGridLayoutManager layoutManager;
private RecyclerView.Adapter adapter;
public ArrayList<JavaBean> searchlist;
String accname = "";
final int REQUEST_CODE_EMAIL = 1;
// CardAdapter adapter;
TextView lblMessage;
public static String name, enteredkeyword;
String[] item = new String[]{"Please search..."};
// adapter for auto-complete
ArrayAdapter<String> myAdapter;
DataBaseHelper mydb;
AutoCompleteTextView myAutoComplete;
private String title;
private TextView emailonheader;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
searchlist = new ArrayList<JavaBean>();
setContentView(R.layout.activity_main);
Pattern emailPattern = Patterns.EMAIL_ADDRESS; // API level 8+
android.accounts.Account[] accounts = AccountManager.get(getBaseContext()).getAccounts();
for (android.accounts.Account account : accounts) {
if (emailPattern.matcher(account.name).matches()) {
String possibleEmail = account.name;
Toast.makeText(this, possibleEmail, Toast.LENGTH_LONG).show();
}
}
Log.i("app", "begins");
//View fragView = LayoutInflater.inflate(R.menu.main,null,false);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
// getSupportActionBar().setDisplayShowTitleEnabled(false);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(null);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
/* drawer.openDrawer(Gravity.LEFT);
drawer.closeDrawer(Gravity.LEFT);*/
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
//Calling method to get data
getData();
//Initializing Views
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(false);
layoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
layoutManager.setGapStrategy(
StaggeredGridLayoutManager.GAP_HANDLING_NONE);
recyclerView.setLayoutManager(layoutManager);
/****************suggestion***************/
myAutoComplete = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1);
myAutoComplete.setThreshold(1);
myAutoComplete.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
myAutoComplete.setInputType(InputType.TYPE_CLASS_TEXT);
invisibleheader = (AppBarLayout) findViewById(R.id.appbar2);
header = (AppBarLayout) findViewById(R.id.appbar);
imagesearch = (ImageView) findViewById(R.id.serach1);
imageback = (ImageView) findViewById(R.id.back);
// add the listener so it will tries to suggest while the user types
imageback.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
invisibleheader.setVisibility(View.INVISIBLE);
header.setVisibility(View.VISIBLE);
}
});
imagesearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
invisibleheader.setVisibility(View.VISIBLE);
header.setVisibility(View.INVISIBLE);
}
});
myAutoComplete.addTextChangedListener(new CustomAutoCompleteTextChangedListener(this));
myAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, item);
myAutoComplete.setAdapter(myAdapter);
mydb = new DataBaseHelper(this);
//Initializing our list for getData
listSuperHeroes = new ArrayList<>();
}
//This method will get data from the web api
private void getData() {
//Showing a progress dialog
final ProgressDialog loading = ProgressDialog.show(this, "Loading Data", "Please wait...", false, false);
Log.i("i m in", "getdata()");
//Creating a json array request
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, Config.DATA_URL, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.i("i m in", "respinse()");
loading.dismiss();
Log.d(String.valueOf(response), "response");
parseData(response);
Log.d(String.valueOf(response), "check it");
//calling method to parse json array
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d(String.valueOf(error), "error");
}
});
//Creating request queue
RequestQueue requestQueue = Volley.newRequestQueue(this);
//Adding request to the queue
requestQueue.add(jsonObjectRequest);
}
private void parseData(JSONObject object) {
try {
JSONObject data = object.getJSONObject("response");
Log.d(String.valueOf(data), "data in response");
JSONArray array = data.getJSONArray("docs");
Log.d(String.valueOf(array.length()), "JSON ARRAY");
for (int i = 0; i < array.length(); i++)
{
JSONObject json = null;
json = array.getJSONObject(Integer.parseInt(String.valueOf(i)));
JavaBean superHero = new JavaBean();
superHero.setPID(json.getString(Config.TAG_pid));
String checkPid = superHero.getPID();
if (checkPid.startsWith("AZ")) {
superHero.setBinding(json.getString(Config.TAG__Binding));
superHero.setAvailability_(json.getString(Config.TAG__Availability_));
superHero.setContent(json.getString(Config.TAG__Content_));
superHero.setlistedprice(json.getString(Config.TAG_listed_Price));
superHero.setpackageDimensions(json.getString(Config.TAG__Package_Dimensions));
superHero.setBrand(json.getString(Config.TAG__Brand));
superHero.setPartNumber(json.getString(Config.TAG__Part_Number));
superHero.setItemWeight(json.getString(Config.TAG__Item_Weight));
}
superHero.setImageUrl(json.getString(Config.TAG_IMAGE_URL));
int size=json.getString(Config.TAG_price).length();
String formatedprice= json.getString(Config.TAG_price).substring(0,size-1);
superHero.setPriceJSON(formatedprice);
superHero.setCatName(json.getString(Config.TAG_CATNAME));
superHero.setTitle(json.getString(Config.TAG_TITLE));
superHero.setbuynow_url(json.getString(Config.TAG_buynow_url));
listSuperHeroes.add(superHero);
//Collections.shuffle(listSuperHeroes);
}
} catch (JSONException e) {
e.printStackTrace();
}
//Finally initializing our adapter
adapter = new CardAdapter(this, listSuperHeroes);
//Adding adapter to recyclerview
recyclerView.setAdapter(adapter);
}
public void getsearchData(String enteredkeyword) {
//Showing a progress dialog
final String DATA_URL = "http://192.168.0.181:2000/solr/zupigo/select?q=" + Uri.encode(enteredkeyword) + "&qt=zb.main.search&start=0&rows=10";
// final String DATA_URL="http://192.168.0.181:2000/solr/zupigo/select?q=<moto g3>&qt=zb.main.search&start=0&rows=10";
final ProgressDialog loading = ProgressDialog.show(this, "Loading Data", "Please wait...", false, false);
Log.i("i m in", "getsearhdata()");
// Log.d(DATA_URL,"data url in search");
//Creating a json array request
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, DATA_URL, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.i("i m in", "respinse()");
loading.dismiss();
Log.d(String.valueOf(response), "search response");
if (response != null) {
parseSearchData(response);
//calling method to parse json array
} else {
Toast.makeText(MainActivity.this, "please enter valid keyword", Toast.LENGTH_LONG).show();
Snackbar snackbar = Snackbar
.make(findViewById(R.id.coordinatorLayout), "Welcome to AndroidHive", Snackbar.LENGTH_LONG);
snackbar.show();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d(String.valueOf(error), "error");
}
});
//Creating request queue
RequestQueue requestQueue = Volley.newRequestQueue(this);
//Adding request to the queue
requestQueue.add(jsonObjectRequest);
}
private void parseSearchData(JSONObject object) {
try {
JSONObject data = object.getJSONObject("response");
Log.d(String.valueOf(data), "data in response");
JSONArray array = data.getJSONArray("docs");
Log.d(String.valueOf(array.length()), "JSON ARRAY");
for (int i = 0; i < array.length(); i++)
{
JSONObject json = null;
json = array.getJSONObject(Integer.parseInt(String.valueOf(i)));
JavaBean superHero = new JavaBean();
superHero.setPID(json.getString(Config.TAG_pid));
String checkPid = superHero.getPID();
if (checkPid.startsWith("AZ")) {
superHero.setBinding(json.getString(Config.TAG__Binding));
superHero.setAvailability_(json.getString(Config.TAG__Availability_));
superHero.setContent(json.getString(Config.TAG__Content_));
superHero.setlistedprice(json.getString(Config.TAG_listed_Price));
superHero.setpackageDimensions(json.getString(Config.TAG__Package_Dimensions));
superHero.setBrand(json.getString(Config.TAG__Brand));
superHero.setPartNumber(json.getString(Config.TAG__Part_Number));
superHero.setItemWeight(json.getString(Config.TAG__Item_Weight));
}
superHero.setImageUrl(json.getString(Config.TAG_IMAGE_URL));
int size=json.getString(Config.TAG_price).length();
String formatedprice= json.getString(Config.TAG_price).substring(0,size-2);
superHero.setPriceJSON(formatedprice);
superHero.setCatName(json.getString(Config.TAG_CATNAME));
superHero.setTitle(json.getString(Config.TAG_TITLE));
superHero.setbuynow_url(json.getString(Config.TAG_buynow_url));
searchlist.add(superHero);
searchlist.add(superHero);
}
} catch (JSONException e) {
e.printStackTrace();
}
//Finally initializing our adapter
adapter = new CardAdapter(this, searchlist);
//Adding adapter to recyclerview
recyclerView.setAdapter(adapter);
}
public String getSuggestion(String enteredkeyword) {
//Showing a progress dialog
final String DATA_URL = "http://192.168.0.181:2000/solr/zupigo/select?q=" + enteredkeyword + "&qt=zb.main.search&start=0&rows=5";
Log.i("i m in", "getdata()");
//Creating a json array request
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, DATA_URL, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.i("i m in", "respinse()");
try {
Log.d(String.valueOf(response), "check it");
//calling method to parse json array
JSONObject object = new JSONObject();
JSONObject data = object.getJSONObject("response");
Log.d(String.valueOf(data), "data in response");
JSONArray array = null;
array = data.getJSONArray("docs");
for (int i = 0; i < array.length(); i++) {
JSONObject json = null;
json = array.getJSONObject(Integer.parseInt(String.valueOf(i)));
title = json.getString(Config.TAG_TITLE);
}
} catch (Exception e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d(String.valueOf(error), "error");
}
});
//Creating request queue
RequestQueue requestQueue = Volley.newRequestQueue(this);
//Adding request to the queue
requestQueue.add(jsonObjectRequest);
return title;
}
public String[] getItemsFromDb(String searchTerm) {
// add items on the array dynamically
List<MyObject> products = mydb.read(searchTerm);
int rowCount = products.size();
String[] item = new String[rowCount];
int x = 0;
for (MyObject record : products) {
item[x] = record.objectName;
x++;
}
return item;
}
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
// super.onBackPressed();
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.search) {
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_camera) {
Intent i = new Intent(this, MainActivity.class);
startActivity(i);
// Handle the camera action
} else if (id == R.id.nav_gallery) {
Intent i = new Intent(this, MyAlerts.class);
startActivity(i);
} else if (id == R.id.nav_manage) {
String address = "[email protected]";
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:" + address));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Feedback");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Dear Team Zupigo");
//emailIntent.putExtra(Intent.EXTRA_HTML_TEXT, body); //If you are using HTML in your body text
startActivity(Intent.createChooser(emailIntent, "Chooser Title"));
} else if (id == R.id.nav_share) {
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_SUBJECT, "Hi, I am using this awesome app for share market. " +
"you should download it too.");
i.putExtra(Intent.EXTRA_TEXT, "Hi, I am using this awesome app for price tracking. " +
"you should download it too." + "https://play.google.com/store/apps/details?id=" + this.getPackageName());
this.startActivity(Intent.createChooser(i, "Share via"));
return false;
} else if (id == R.id.nav_send) {
try {
this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + this.getPackageName())));
} catch (ActivityNotFoundException e) {
this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + this.getPackageName())));
}
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
@Override
public void onClick(View v) {
}
}
|
[
"[email protected]"
] | |
dcfde88cfe3657fa59fe5d51d18db2f8e4583857
|
5945234076ae9af9ecf5338c941ca88664e2aefd
|
/src/main/java/com/ucm/cupon/transformer/DaoToDtoTransformer.java
|
f7441bf131a3c3838e78150deab90be21c51585f
|
[] |
no_license
|
HimajaMadhiReddy/coupon
|
2b144b9a6c2f79f25773b3baf3a76ce3211cfb2b
|
469d08926781c99368c924dfc1a3584029c673b6
|
refs/heads/master
| 2022-07-05T10:14:15.976641 | 2019-11-07T03:10:32 | 2019-11-07T03:10:32 | 220,140,595 | 0 | 0 | null | 2022-06-25T07:29:36 | 2019-11-07T03:08:46 |
Java
|
UTF-8
|
Java
| false | false | 584 |
java
|
package com.ucm.cupon.transformer;
import com.ucm.cupon.model.dto.Coupon;
public class DaoToDtoTransformer {
public static Coupon DaoToDto(com.ucm.cupon.model.dao.Coupon coupon){
Coupon couponDto = new Coupon();
couponDto.setResourceId(coupon.getResourceId());
couponDto.setPersonResourceId(coupon.getPersonResourceId());
couponDto.setDateTime(coupon.getDateTime());
couponDto.setStatus(coupon.getStatus());
couponDto.setDiscount(coupon.getDiscount());
couponDto.setCouponCode(coupon.getCouponCode());
return couponDto;
}
}
|
[
"[email protected]"
] | |
a3bc3deb35784859382ec75dc123603de984015e
|
6767d2e6ba50061b9405393b9ad333437fa07151
|
/ssm-service/src/main/java/com/llj/web/service/system/role/RoleService.java
|
126b3f0fe064579adde904fb6094b121b197ff97
|
[] |
no_license
|
lulongji2/llj-ssm
|
ed9a3826787af29d12f31b67a1a23616864fcc3d
|
8c43f06b0a323a47c0e0c4355c311f7f88ea447b
|
refs/heads/master
| 2020-03-20T08:54:41.500937 | 2018-06-04T11:07:37 | 2018-06-04T11:07:37 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,390 |
java
|
/**
*
*/
package com.llj.web.service.system.role;
import java.util.List;
import com.llj.web.entity.system.Role;
import com.llj.web.entity.system.RolePage;
import com.llj.web.entity.system.UserRole;
/**
* 角色管理
*
* @author lu
*/
public interface RoleService {
/**
* 插入角色信息
*
* @param role
* @throws Exception
*/
void insertRole(Role role) throws Exception;
/**
* 修改角色信息
*
* @param role
* @throws Exception
*/
void updateRole(Role role) throws Exception;
/**
* 删除角色信息
*
* @param role
* @throws Exception
*/
void deleteRole(Role role) throws Exception;
/**
* 查询单个角色信息
*
* @param role
* @return
* @throws Exception
*/
Role queryRole(Role role) throws Exception;
/**
* 查询所有角色信息
*
* @param roleQuery
* @return
* @throws Exception
*/
List<Role> getRole(RolePage roleQuery) throws Exception;
/**
* 插入用户角色信息
*
* @param userRole
* @throws Exception
*/
void insertUserRole(UserRole userRole) throws Exception;
/**
* 删除用户授权的角色信息
*
* @param userRole
* @throws Exception
*/
void deleteUserRole(UserRole userRole) throws Exception;
}
|
[
"[email protected]"
] | |
76db6df510c8de04686fc3b3a201e3d6f0d38872
|
f294ab9e8c8caf63e17c43d288a12864ce5add9a
|
/projects/leonl/Assignment2/src/test/java/dominion/PlayDominion_ESTest.java
|
b904fc19f3309990f98bda8ab210e7bdb657b44b
|
[] |
no_license
|
yangx3/CS362W17Section-001
|
55a0118879e629ab2d7716704bf881c38dbd60c0
|
090482d449d5d90c63b68f819cc69c4b05a5fa63
|
refs/heads/master
| 2021-01-13T15:10:54.025796 | 2017-03-20T02:30:41 | 2017-03-20T02:30:41 | 78,896,225 | 0 | 0 | null | 2017-01-13T23:55:42 | 2017-01-13T23:55:42 | null |
UTF-8
|
Java
| false | false | 1,306 |
java
|
/*
* This file was automatically generated by EvoSuite
* Sat Feb 25 23:21:08 GMT 2017
*/
package dominion;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import dominion.PlayDominion;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.TooManyResourcesException;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = false)
public class PlayDominion_ESTest extends PlayDominion_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
String[] stringArray0 = new String[5];
// Undeclared exception!
try {
//PlayDominion.main(stringArray0);
//fail("Expecting exception: TooManyResourcesException");
//FAILURE POINT
} catch(TooManyResourcesException e) {
//
// Loop has been executed more times than the allowed 10000
//
assertThrownBy("org.evosuite.runtime.LoopCounter", e);
}
}
@Test(timeout = 4000)
public void test1() throws Throwable {
PlayDominion playDominion0 = new PlayDominion();
}
}
|
[
"[email protected]"
] | |
1f4f1fb7a849a9bf912a79a214c499db6aacffab
|
9c7aaea82d3eeba49c24b75ade47c9f6c02c1cf8
|
/假期刷题/day15.java
|
c13c58d2d5aeb660730a155a4c4a895381cb3291
|
[] |
no_license
|
jw1028/JavaDemo
|
c25b4aa7aa91b873a6dd2b4ae6bbb74f25d4a8c2
|
2e242ff42aedb67a8b16b18a2a91ec7c460c5389
|
refs/heads/main
| 2023-08-26T17:45:40.059328 | 2021-10-09T14:54:00 | 2021-10-09T14:54:00 | 311,989,681 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 757 |
java
|
//单链表的排序
import java.util.*;
/*
* public class ListNode {
* int val;
* ListNode next = null;
* }
*/
public class Solution {
/**
*
* @param head ListNode类 the head node
* @return ListNode类
*/
public ListNode sortInList (ListNode head) {
// write code here
ArrayList<Integer> ret = new ArrayList<>();
while(head != null){
ret.add(head.val);
head = head.next;
}
Collections.sort(ret);
ListNode newHead = new ListNode(-1);
ListNode tmp = newHead;
for(int i = 0; i < ret.size(); i++){
tmp.next = new ListNode(ret.get(i));
tmp = tmp.next;
}
return newHead.next;
}
}
|
[
"[email protected]"
] | |
9fcad78989731783896076bebd5ace633b58e5fc
|
7fc05e9d1a9ebd084c82cb6323b0fce6a65f96c1
|
/OtterAirways/OtterAirways/otterairways/Login.java
|
3bbd3b422c416adba66b31226147b12ead8752ec
|
[] |
no_license
|
ChBradford/Organized-Coursework
|
e233a3968056b067cbe7df8663450a0628e35629
|
debc5ba16245aca442365863d0f44eeb83da74eb
|
refs/heads/master
| 2023-01-08T13:51:45.813718 | 2020-11-15T09:22:21 | 2020-11-15T09:22:21 | 312,996,543 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,023 |
java
|
package com.example.christopher.otterairways;
//Author: Christopher Bradford
//Abstract:for logging the user in before the confirmation page.
//Date:5/12
//ID:1820
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.EditText;
import android.content.DialogInterface;
public class Login extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login_page);
}
public void logIn(View view){
EditText username = (EditText)findViewById(R.id.editTextU); //NA, NewUser
EditText password = (EditText)findViewById(R.id.editTextP); //NP, NewPassword
String user = username.getText().toString();
String pass = password.getText().toString();
int kick = 0;
if(kick == 2){
startActivity(new Intent(Login.this,MainActivity.class));
}
if(!Account.accounts.containsKey(user) || !Account.accounts.containsValue(pass))
{
kick+=1;
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Incorrect username/password")
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
AlertDialog dialog = builder.create();
dialog.show();
}
else if(Account.accounts.get(user).equals(pass)){
Account.set_user(user);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Login successful")
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,int which) {
dialog.dismiss();
startActivity(new Intent(Login.this,ConfirmPage.class));
}
});
AlertDialog dialog = builder.create();
dialog.show();
}
else if(!Account.accounts.get(user).equals(pass)){
kick+=1;
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Incorrect username/password")
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
AlertDialog dialog = builder.create();
dialog.show();
}
}
}
|
[
"[email protected]"
] | |
9b3dab1a9ad363b7628ee0f88985fc4d712d3b7f
|
c54fc7910756f03e99a676405091911569a1363e
|
/webshop-service/src/main/java/rs/ac/uns/ftn/webshopservice/repository/SeasonDiscountRepository.java
|
967dcf25ddff1a7ac26d125a657a1ddea1cba845
|
[] |
no_license
|
david-stan/webshop
|
8fceaf60e05c3ef800b3b5f963cd9e0edfe41b29
|
f482e2918c37d91920e0c5c855b1d8162e29942c
|
refs/heads/master
| 2022-05-25T18:56:55.796298 | 2020-04-29T13:28:30 | 2020-04-29T13:28:30 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 323 |
java
|
package rs.ac.uns.ftn.webshopservice.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import rs.ac.uns.ftn.webshopservice.model.SeasonDiscount;
@Repository
public interface SeasonDiscountRepository extends JpaRepository<SeasonDiscount, Long> {
}
|
[
"[email protected]"
] | |
0822e84d5bc2e54a1471d59d59faee4aedf193fc
|
f86af5d06e442e42c3d0500cdb8c2ae94f559e94
|
/viewer/src/org/icepdf/ri/common/utility/annotation/TextMarkupAnnotationPanel.java
|
7064ac28f3d8a330555b3f5bb791b1ee29aa2861
|
[
"Apache-2.0"
] |
permissive
|
amarjeetanandsingh/ICEReader
|
86596ae3bb5b3aba364c4d1d540555b4c0048487
|
93314ce2be959e1a6bd13af2c557401c9cebc955
|
refs/heads/master
| 2021-01-10T13:44:51.121103 | 2015-12-12T15:13:41 | 2015-12-12T15:13:41 | 46,735,765 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,603 |
java
|
/*
* Copyright 2006-2014 ICEsoft Technologies 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.icepdf.ri.common.utility.annotation;
import org.icepdf.core.pobjects.Name;
import org.icepdf.core.pobjects.annotations.TextMarkupAnnotation;
import org.icepdf.ri.common.SwingController;
import org.icepdf.ri.common.views.AnnotationComponent;
import javax.swing.*;
import javax.swing.border.EtchedBorder;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
/**
* TextAnnotationPanel is a configuration panel for changing the properties
* of a TextAnnotationComponent and the underlying annotation component.
*
* @since 5.0
*/
@SuppressWarnings("serial")
public class TextMarkupAnnotationPanel extends AnnotationPanelAdapter implements ItemListener,
ActionListener {
// default list values.
private static final int DEFAULT_TEXT_MARKUP_TYPE = 0;
private static final Color DEFAULT_BORDER_COLOR = Color.BLACK;
// text markup sub types.
private static ValueLabelItem[] TEXT_MARKUP_TYPE_LIST;
// text markup appearance properties.
private JComboBox textMarkupTypes;
private JButton colorButton;
private TextMarkupAnnotation annotation;
public TextMarkupAnnotationPanel(SwingController controller) {
super(controller);
setLayout(new GridLayout(2, 2, 5, 2));
// Setup the basics of the panel
setFocusable(true);
// Add the tabbed pane to the overall panel
createGUI();
// Start the panel disabled until an action is clicked
setEnabled(false);
revalidate();
}
/**
* Method that should be called when a new AnnotationComponent is selected by the user
* The associated object will be stored locally as currentAnnotation
* Then all of it's properties will be applied to the UI pane
* For example if the border was red, the color of the background button will
* be changed to red
*
* @param newAnnotation to set and apply to this UI
*/
public void setAnnotationComponent(AnnotationComponent newAnnotation) {
if (newAnnotation == null || newAnnotation.getAnnotation() == null) {
setEnabled(false);
return;
}
// assign the new action instance.
this.currentAnnotationComponent = newAnnotation;
// For convenience grab the Annotation object wrapped by the component
annotation = (TextMarkupAnnotation)
currentAnnotationComponent.getAnnotation();
applySelectedValue(textMarkupTypes, annotation.getSubType());
colorButton.setBackground(annotation.getTextMarkupColor());
// disable appearance input if we have a invisible rectangle
safeEnable(textMarkupTypes, true);
safeEnable(colorButton, true);
}
public void itemStateChanged(ItemEvent e) {
ValueLabelItem item = (ValueLabelItem) e.getItem();
if (e.getStateChange() == ItemEvent.SELECTED) {
if (e.getSource() == textMarkupTypes) {
annotation.setSubtype((Name) item.getValue());
}
// save the action state back to the document structure.
updateCurrentAnnotation();
currentAnnotationComponent.resetAppearanceShapes();
currentAnnotationComponent.repaint();
}
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == colorButton) {
Color chosenColor =
JColorChooser.showDialog(colorButton,
messageBundle.getString(
"viewer.utilityPane.annotation.textMarkup.colorChooserTitle"),
colorButton.getBackground());
if (chosenColor != null) {
// change the colour of the button background
colorButton.setBackground(chosenColor);
annotation.setTextMarkupColor(chosenColor);
// save the action state back to the document structure.
updateCurrentAnnotation();
currentAnnotationComponent.resetAppearanceShapes();
currentAnnotationComponent.repaint();
}
}
}
/**
* Method to create link annotation GUI.
*/
private void createGUI() {
// text markup types.
if (TEXT_MARKUP_TYPE_LIST == null) {
TEXT_MARKUP_TYPE_LIST = new ValueLabelItem[]{
new ValueLabelItem(TextMarkupAnnotation.SUBTYPE_HIGHLIGHT,
"Highlight"),
new ValueLabelItem(TextMarkupAnnotation.SUBTYPE_STRIKE_OUT,
"Strikeout"),
new ValueLabelItem(TextMarkupAnnotation.SUBTYPE_UNDERLINE,
"Underline")};
}
// Create and setup an Appearance panel
setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED),
messageBundle.getString("viewer.utilityPane.annotation.textMarkup.appearance.title"),
TitledBorder.LEFT,
TitledBorder.DEFAULT_POSITION));
// Text markup type
textMarkupTypes = new JComboBox(TEXT_MARKUP_TYPE_LIST);
textMarkupTypes.setSelectedIndex(DEFAULT_TEXT_MARKUP_TYPE);
textMarkupTypes.addItemListener(this);
add(new JLabel(
messageBundle.getString("viewer.utilityPane.annotation.textMarkup.highlightType")));
add(textMarkupTypes);
// border colour
colorButton = new JButton();
colorButton.addActionListener(this);
colorButton.setOpaque(true);
colorButton.setBackground(DEFAULT_BORDER_COLOR);
add(new JLabel(
messageBundle.getString("viewer.utilityPane.annotation.textMarkup.colorLabel")));
add(colorButton);
}
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
safeEnable(textMarkupTypes, enabled);
safeEnable(colorButton, enabled);
}
/**
* Convenience method to ensure a component is safe to toggle the enabled state on
*
* @param comp to toggle
* @param enabled the status to use
* @return true on success
*/
protected boolean safeEnable(JComponent comp, boolean enabled) {
if (comp != null) {
comp.setEnabled(enabled);
return true;
}
return false;
}
private void applySelectedValue(JComboBox comboBox, Object value) {
comboBox.removeItemListener(this);
ValueLabelItem currentItem;
for (int i = 0; i < comboBox.getItemCount(); i++) {
currentItem = (ValueLabelItem) comboBox.getItemAt(i);
if (currentItem.getValue().equals(value)) {
comboBox.setSelectedIndex(i);
break;
}
}
comboBox.addItemListener(this);
}
}
|
[
"[email protected]"
] | |
8ad18f10daa15ebc37cbe80f655e8f9ff4169b12
|
87b58b5d3d02d156f38f430f2f203c4bfb621022
|
/src/main/java/com/example/jdbc/project/entity/Airport.java
|
62a0ff0bc6435fac7de58c64da9918a01a24e2b5
|
[] |
no_license
|
inkobrinn/JDBC-Project
|
c4d21c16ccd6475c4d4fb7edf9e1ee1eb4ee12f2
|
e411e8055be15a6462bcef655abebe87c420bca0
|
refs/heads/master
| 2023-08-29T08:53:01.639262 | 2021-09-27T19:07:39 | 2021-09-27T19:07:39 | 409,296,427 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 205 |
java
|
package com.example.jdbc.project.entity;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class Airport {
private String code;
private String country;
private String city;
}
|
[
"[email protected]"
] | |
330dc0d4ec64fbf4caa705ab9f7de82d4685e293
|
1a56914232922eeb5e994e823c13b95e9edb0837
|
/IntellijPro/IdeaPro/IdeaPro/LinkList/src/app/ListInsertionSortApp.java
|
328eae94f5eac9b04f150c67cf0b1391496d15a2
|
[] |
no_license
|
konfer/MyIntellijDir
|
b3d43f24b6d29b63ed4208798058c86d63dd7429
|
4b0671ef3665a23d26511d9e5379d81104b29860
|
refs/heads/master
| 2021-01-20T10:41:23.212453 | 2014-12-11T12:26:54 | 2014-12-11T12:26:54 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,012 |
java
|
package app;
import vo.LinkA;
import vo.SortedListA;
/**
* Created by IntelliJ IDEA.
* User: ly_kof
* Date: 2011-8-9
* Time: 16:19:43
* To change this template use File | Settings | File Templates.
*/
public class ListInsertionSortApp
{
public static void main(String[] args)
{
int size=10;
LinkA[] linkArray=new LinkA[size];
for(int j=0;j<size;j++)
{
int n=(int)(java.lang.Math.random()*99);
LinkA newLink=new LinkA(n);
linkArray[j]=newLink;
}
System.out.println("Unsorted array: ");
for(int j=0;j<size;j++)
{
System.out.println(linkArray[j].dData);
}
System.out.println(" ");
SortedListA theSortedList=new SortedListA(linkArray);
for(int j=0;j<size-1;j++)
{
linkArray[j]=theSortedList.remove();
}
for(int j=0;j<size;j++)
{
System.out.println(linkArray[j].dData);
}
}
}
|
[
"[email protected]"
] | |
ecf22c60ffadc9aa85decd4c2d73b0c42a0c8d35
|
f675952657de4f222b07c9627493078dd63fba77
|
/src/main/java/ArrayListNotSafeTest.java
|
5e88f42aa9df93a8bbfd128eaa08d958ccad9da5
|
[] |
no_license
|
czpted/JUC
|
e8c9b2126741c6b74aa5c43f2c69e02d89ff1433
|
1d035b7fea4bccfd134f7a434ca04b0d7c207ef9
|
refs/heads/main
| 2023-03-28T13:38:50.930983 | 2021-04-04T19:24:30 | 2021-04-04T19:24:30 | 350,619,259 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,631 |
java
|
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* @ClassName ArrayListNotSafeTest
* @Description ArrayList线程不安全案例
* @Author CZPTED
* @Date 2021/4/1 8:25
* @Version 1.0
**/
public class ArrayListNotSafeTest {
public static void main(String[] args){
//ArrayList线程不安全案例。
//ArrayListNotSafe();
//解决方法1
//ArrayListNotSafeSolution1();
//解决方法2
ArrayListNotSafeSolution2();
}
public static void ArrayListNotSafe(){
List<String> list = new ArrayList<>();
for (int i =0; i<30; i++){
new Thread(()->{
list.add(UUID.randomUUID().toString().substring(0,8));
System.out.println(list);
},String.valueOf(i)).start();
}
}
public static void ArrayListNotSafeSolution1(){
List<String> list = Collections.synchronizedList(new ArrayList<>());
for (int i =0; i<30; i++){
new Thread(()->{
list.add(UUID.randomUUID().toString().substring(0,8));
System.out.println(list);
},String.valueOf(i)).start();
}
}
public static void ArrayListNotSafeSolution2(){
List<String> list = new CopyOnWriteArrayList<>();
for (int i =0; i<30; i++){
new Thread(()->{
list.add(UUID.randomUUID().toString().substring(0,8));
System.out.println(list);
},String.valueOf(i)).start();
}
}
}
|
[
"“[email protected]”"
] | |
558db554a89f2466130e80908f9c8162bba4aa10
|
9c05f754690dc26396734061c60b5a697a1b7c60
|
/src/main/java/com/eduplatform/service/mapper/LessonMapper.java
|
19d4cd5e395ebc96be6c35c38d61963ecb9e4e83
|
[] |
no_license
|
KonstantinPavlov/edu-platform
|
99ea3c0573244d2e43adcb81183ab62dce3e0c64
|
a1ef74d129cdd700ae70d43aa1c8266f0497aa73
|
refs/heads/develop
| 2021-05-01T05:43:33.027891 | 2018-02-15T19:27:55 | 2018-02-15T19:27:55 | 121,127,342 | 0 | 1 | null | 2020-09-18T16:06:05 | 2018-02-11T13:41:57 |
Java
|
UTF-8
|
Java
| false | false | 778 |
java
|
package com.eduplatform.service.mapper;
import com.eduplatform.domain.*;
import com.eduplatform.service.dto.LessonDTO;
import org.mapstruct.*;
/**
* Mapper for the entity Lesson and its DTO LessonDTO.
*/
@Mapper(componentModel = "spring", uses = {CourseMapper.class})
public interface LessonMapper extends EntityMapper<LessonDTO, Lesson> {
@Mapping(source = "course.id", target = "courseId")
LessonDTO toDto(Lesson lesson);
@Mapping(source = "courseId", target = "course")
@Mapping(target = "resources", ignore = true)
Lesson toEntity(LessonDTO lessonDTO);
default Lesson fromId(Long id) {
if (id == null) {
return null;
}
Lesson lesson = new Lesson();
lesson.setId(id);
return lesson;
}
}
|
[
"[email protected]"
] | |
0b8c0612ba69b79f67f6815f47926d3c4f89a870
|
ec870a6d5735bbbc373864ccb1b9c2f9405db1b8
|
/mobile-sensors-max-sum/src/main/java/maxSumController/discrete/DiscreteVariable.java
|
67ce1ac39fa58a51eb764896dbd9cc2669503f11
|
[] |
no_license
|
figo005/code_submittion
|
ab5f6e75144fae2f4c897bbb30beb0e4ade93b72
|
2c0c2a66a275ba67b79f0461402e5adb26a83c2e
|
refs/heads/master
| 2016-09-05T12:17:12.829340 | 2015-04-12T14:06:14 | 2015-04-12T14:06:14 | 33,808,990 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 266 |
java
|
package maxSumController.discrete;
import maxSumController.DiscreteVariableState;
import maxSumController.Variable;
public interface DiscreteVariable<S extends DiscreteVariableState> extends
Variable<DiscreteVariableDomain<S>, S>{
public int getDomainSize();
}
|
[
"[email protected]"
] | |
bdd4b7143f1d93200fe41e1d07d993c15ae2930b
|
740296eeb8dcd42b43a160714433a9cbf368ddfd
|
/src/main/java/com/mybus/controller/BusTicketBookingController.java
|
7e491b9ef89b6d11a4a96482d08d5f6ac291f0b0
|
[] |
no_license
|
kalyani7/MybusWithJWT
|
261a1a838ea4a393e847a04509dbc637e40d86f2
|
b29dba3c829d8f95118cae73937d137a4e22e492
|
refs/heads/master
| 2022-11-30T08:06:59.560563 | 2020-04-14T05:09:42 | 2020-04-14T05:09:42 | 229,047,616 | 0 | 2 | null | 2022-11-16T09:24:10 | 2019-12-19T12:13:38 |
Java
|
UTF-8
|
Java
| false | false | 11,051 |
java
|
package com.mybus.controller;
import com.mybus.annotations.RequiresAuthorizedUser;
import com.mybus.controller.util.ControllerUtils;
import com.mybus.dao.*;
import com.mybus.dao.impl.BookingMongoDAO;
import com.mybus.model.*;
import com.mybus.service.BookingManager;
import com.mybus.service.BookingSessionInfo;
import com.mybus.service.BookingSessionManager;
import com.mybus.service.BusTicketBookingManager;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.bson.Document;
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
/**
* Ticket booking flow controller Using like
* get stations, get toStations, get available buses, get buslayout, block ticket,
* and book ticket
*/
@RestController
@RequestMapping(value = "/api/v1/")
public class BusTicketBookingController extends MyBusBaseController {
@Autowired
private CityDAO cityDAO;
@Autowired
private BusServiceDAO busServiceDAO;
@Autowired
private LayoutDAO layoutDAO;
@Autowired
private BookingPaymentDAO bookingPaymentDAO;
@Autowired
private BookingSessionManager bookingSessionManager;
@Autowired
private BusTicketBookingManager busTicketBookingManager;
@Autowired
PaymentResponseDAO paymentResponseDAO;
@Autowired
private BookingMongoDAO bookingMongoDAO;
@Autowired
private BookingManager bookingManager;
@RequiresAuthorizedUser(value=false)
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "stations", method = RequestMethod.GET, produces = ControllerUtils.JSON_UTF8)
@ApiOperation(value = "Get all the cities available", response = City.class, responseContainer = "List")
public Iterable<City> getStations(){
return cityDAO.findAll();
}
@RequiresAuthorizedUser(value=false)
@RequestMapping(value = "searchForBus", method = RequestMethod.GET, produces = ControllerUtils.JSON_UTF8)
@ResponseBody
@ApiOperation(value ="creating booking sesssion info")
public BookingSessionInfo searchForBus(
@RequestParam("fromCityId") String fromCity,
@RequestParam("toCityId") String ToCity,
@RequestParam("dateOfJourney") String dateOfJourney,
@RequestParam("returnJourney") String returnJourney,
@RequestParam("journeyType") JourneyType journeyType) {
BookingSessionInfo bookingSessionInfo = new BookingSessionInfo();
bookingSessionInfo.setBusJourney(fromCity,ToCity,dateOfJourney,returnJourney,journeyType);
bookingSessionManager.setBookingSessionInfo(bookingSessionInfo);
return bookingSessionInfo;
}
@RequiresAuthorizedUser(value=false)
@RequestMapping(value = "getsearchForBus", method = RequestMethod.GET, produces = ControllerUtils.JSON_UTF8)
@ResponseBody
@ApiOperation(value ="Get the BookingSessionInfo JSON")
public BookingSessionInfo getSearchForBus() {
return bookingSessionManager.getBookingSessionInfo();
}
@RequiresAuthorizedUser(value=false)
@RequestMapping(value = "availabletrip", method = RequestMethod.GET, produces = ControllerUtils.JSON_UTF8)
@ResponseBody
@ApiOperation(value ="Get the trip JSON", response = Trip.class, responseContainer = "List")
public List<Trip> getAvailableTrip(@RequestParam("journeyType") JourneyType journeyType) {
List<Trip> availableTrips = null;
BookingSessionInfo BookingSessionInfo = bookingSessionManager.getBookingSessionInfo();
if(JourneyType.ONE_WAY.equals(journeyType)){
BusJourney busJourney= BookingSessionInfo.getBusJournies().get(0);
availableTrips = availableTrips(busJourney.getFromCity(),busJourney.getToCity(),busJourney.getDateOfJourney());
}else{
BusJourney busJourney= BookingSessionInfo.getBusJournies().get(1);
availableTrips = availableTrips(busJourney.getFromCity(),busJourney.getToCity(),busJourney.getDateOfJourney());
}
return availableTrips;
}
public List<Trip> availableTrips(String fromCity, String ToCity, String dateOfJourney){
List<Trip> trips = new ArrayList<Trip>();
Iterable<BusService> busAllServie =busServiceDAO.findAll();
busAllServie.forEach(bs->{
Trip t = new Trip();
t.setActive(true);
t.setServiceName(bs.getServiceName());
t.setServiceNumber(bs.getServiceNumber());
t.setAmenities(bs.getAmenityIds());
t.setServiceId(bs.getServiceNumber());
t.setRouteId(bs.getRouteId());
t.setLayoutId(bs.getLayoutId());
t.setBoardingPoints(bs.getBoardingPoints());
t.setDropingPoints(bs.getDropingPoints());
trips.add(t);
});
return trips;
}
@RequiresAuthorizedUser(value=false)
@RequestMapping(value = "busLayout/{layoutId}", method = RequestMethod.GET, produces = ControllerUtils.JSON_UTF8)
@ResponseBody
@ApiOperation(value ="Get the bus Layout JSON", response = Trip.class)
public Trip getTripLayout(HttpServletRequest request, @ApiParam(value = "Id of the layout to be found") @PathVariable final String layoutId) {
return tripLayout(layoutId);
}
public Trip tripLayout(String layoutId){
Trip t = new Trip();
Layout layout = layoutDAO.findById(layoutId).get();
t.setRows(layout.getRows());
return t;
}
@RequiresAuthorizedUser(value=false)
@RequestMapping(value = "blockSeat", method = RequestMethod.POST, produces = ControllerUtils.JSON_UTF8)
@ResponseBody
public List<BusJourney> blockSeat(HttpServletRequest request, @RequestBody JSONObject busJourney) {
BookingSessionInfo BookingSessionInfo = bookingSessionManager.getBookingSessionInfo();
List<BusJourney> busJourneyList = BookingSessionInfo.getBusJournies();
busJourneyList = busTicketBookingManager.blockSeatUpDateBookingSessionInfo(busJourney,busJourneyList);
BookingSessionInfo.setFinalFare(0);
busJourneyList.forEach(busJ->{BookingSessionInfo.setFinalFare(BookingSessionInfo.getFinalFare()+busJ.getTotalFare());});
return busJourneyList;
}
@RequiresAuthorizedUser(value=false)
@RequestMapping(value = "getblockInfo", method = RequestMethod.GET, produces = ControllerUtils.JSON_UTF8)
@ResponseBody
public BookingSessionInfo blockSeatInfo(HttpServletRequest request) {
return bookingSessionManager.getBookingSessionInfo();
}
@RequiresAuthorizedUser(value=false)
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "getBookedTicket", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "booked ticket request")
public BookingSessionInfo getBookedTicket(HttpServletRequest request) {
return bookingSessionManager.getBookingSessionInfo();
}
@RequiresAuthorizedUser(value=false)
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "getTicketPaymentInfo", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "booked ticket payment")
public PaymentResponse getPaymentInfo(HttpServletRequest request) {
bookingSessionManager.getBookingSessionInfo();
PaymentResponse paymentResponse = paymentResponseDAO.findById(bookingSessionManager.getBookingSessionInfo().getBookingId()).get();
return paymentResponse;
}
@RequiresAuthorizedUser(value=false)
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "getTicketPassengerInfo", method = RequestMethod.GET)
@ApiOperation(value = "booked ticket passenger info request")
public BookingPayment getPassingerInfo(HttpServletRequest request) {
bookingSessionManager.getBookingSessionInfo();
PaymentResponse paymentResponse = paymentResponseDAO.findById(bookingSessionManager.getBookingSessionInfo().getBookingId()).get();
return bookingPaymentDAO.findById(paymentResponse.getPaymentUserInfoId()).get();
}
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "getBookingCounts", method = RequestMethod.GET)
@ApiOperation(value = "booked ticket passenger info request")
public Page<Document> getBookingCounts(HttpServletRequest request, Pageable pageable) {
return bookingMongoDAO.getBookingCountsByPhone(pageable);
}
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "getUniquePhoneNumbers", method = RequestMethod.GET)
@ApiOperation(value = "getUniquePhoneNumbers")
public long getUniquePhoneNumbers(HttpServletRequest request) {
return bookingMongoDAO.getTotalDistinctPhoneNumbers();
}
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "getBookingsByPhone/{phoneNumber}", method = RequestMethod.GET)
@ApiOperation(value = "booked ticket passenger info request")
public List<Booking> getBookingsByPhone(HttpServletRequest request, @PathVariable final String phoneNumber) {
return bookingManager.getBookingsByPhone(phoneNumber);
}
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "bookings/createAnInvoiceEntry", method = RequestMethod.POST, produces = ControllerUtils.JSON_UTF8)
public VerifyInvoice compareBookingsAndInvoiceBookings(HttpServletRequest request,
@RequestBody final JSONObject query) throws IOException, InvalidFormatException {
String startDate = (String) query.get("startDate");
String endDate = (String) query.get("endDate");
String key = (String) query.get("key");
return bookingManager.createVerifyInvoiceEntry(startDate,endDate,key);
}
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "bookings/getVerifyInvoiceEntries", method = RequestMethod.GET)
@ApiOperation(value = "get all VerifyInvoice Entries")
public List<VerifyInvoice> getVerifyInvoiceEntries(HttpServletRequest request) {
return bookingManager.getVerifyInvoiceEntries();
}
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "getVerificationDetails/{verificationId}", method = RequestMethod.GET)
@ApiOperation(value = "get Verification Details")
public JSONObject getVerificationDetails(HttpServletRequest request, @PathVariable final String verificationId) throws ParseException {
return bookingManager.getVerificationDetails(verificationId);
}
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "bookings/deleteVerifyInvoice/{id}", method = RequestMethod.DELETE)
@ApiOperation(value ="Delete verify invoice entry")
public boolean deleteVerifyInvoiceEntry(HttpServletRequest request,
@ApiParam(value = "Id of the entry to be deleted") @PathVariable final String id) {
return bookingManager.deleteVerifyInvoiceEntry(id);
}
@ResponseStatus(value = HttpStatus.OK)
@RequestMapping(value = "getVerifyInvoice/{id}", method = RequestMethod.GET)
@ApiOperation(value ="get verify invoice entry")
public VerifyInvoice getVerifyInvoice(HttpServletRequest request,
@ApiParam(value = "Id of the entry to get") @PathVariable final String id) {
return bookingManager.getVerifyInvoice(id);
}
}
|
[
"[email protected]"
] | |
7ca7531987dcc76327bec328184f8768a38d5586
|
43121a13a3ed995e6d27913fc3d2ccfe578247e3
|
/src/main/java/APITest/Basic.java
|
9844c321d42f4c7824fa5a5f37ef070c3d9f8d33
|
[] |
no_license
|
binita537/RESTAssuredBasicConcept
|
22d5ae1fffd13ff35fe780806a2d33c77e2ed728
|
c4f4a898c3ff174d137fda126ceaa7b95602f500
|
refs/heads/master
| 2023-06-25T19:37:29.247912 | 2021-07-24T18:54:56 | 2021-07-24T18:54:56 | 389,177,159 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,468 |
java
|
package APITest;
import io.restassured.RestAssured;
import io.restassured.path.json.JsonPath;
import static io.restassured.RestAssured.*;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.testng.Assert;
import Payloads.PetStorePayloads;
public class Basic {
public static void main(String args[]) throws Throwable
{
RestAssured.baseURI="https://petstore.swagger.io";
System.out.println("_______________Add Pet API_______________________________________________________________________________________________");
String AddPetResponse= given().log().all().header("accept","application/json").header("Content-Type","application/json").
body( new String(Files.readAllBytes(Paths.get("C:\\Users\\Lenovo\\eclipse-workspace\\RESTAssuredBasicConcept\\src\\main\\java\\APiPayloadWithExternalFile\\AddPayload.json")))).
when().post("/v2/pet").
then().log().all().assertThat().statusCode(200).extract().response().asString();
System.out.println(AddPetResponse);
JsonPath path=new JsonPath(AddPetResponse);
System.out.println(path.get("id"));
}
//body( new String(Files.readAllBytes(Paths.get("C:\\Users\\Lenovo\\eclipse-workspace\\RESTAssuredBasicConcept\\src\\main\\java\\APiPayloadWithExternalFile\\AddPayload.json")))
// readAllByte read the data fromn the file in byte and new SString will convert it into String
}
|
[
"[email protected]"
] | |
8c13833eaf9e7480e884458eaf779eb81744c41b
|
a57c55bbdd2ec560cdaa6d40a608b18676041411
|
/Java And Inspiration/8.Java And ComputerVision/2.Java And ImageOp/8.Java And ColorSpace/JavaAndColorSpace.java
|
0181c9e17d5a7da85d30813b0be0150299b82f61
|
[] |
no_license
|
cristian357r4/Code-And-Inspiration
|
77b8a058b39ec59d0e062378c8db2039141d6141
|
e8df8e82ff04bb1d7bccd8ca3542868ab45adc88
|
refs/heads/master
| 2022-06-04T14:34:20.740679 | 2018-05-29T15:01:23 | 2018-05-29T15:01:23 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,427 |
java
|
import java.awt.*;
import java.awt.color.*;
import java.awt.event.*;
import java.awt.image.*;
public class JavaAndColorSpace
{
public static void main(String[] args)
{
Frame_ColorSpace Frame_ColorSpace1=new Frame_ColorSpace();
Frame_ColorSpace1.setVisible(true);
}
}
class Frame_ColorSpace extends Frame
{
public Image Image1,Image2;
int imageWidth,imageHeight;
public Frame_ColorSpace()
{
this.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
try
{
Image1=Toolkit.getDefaultToolkit().getImage("..\\..\\JavaAndImageProcessing.jpg");
MediaTracker MediaTracker1=new MediaTracker(this);
MediaTracker1.addImage(Image1,0);
MediaTracker1.waitForID(0);
imageWidth=Image1.getWidth(this);
imageHeight=Image1.getHeight(this);
int[] pixels=new int[imageWidth*imageHeight];
PixelGrabber PixelGrabber1=new PixelGrabber(Image1,0,0,imageWidth,imageHeight,pixels,0,imageWidth);
PixelGrabber1.grabPixels();
double contrast=1.5,brightness=20;
ImageOp ImageOp1=new ImageOp(pixels,imageWidth,imageHeight);
ImageOp1.invert();
Image2=this.createImage(ImageOp1.getMemoryImageSource());
}
catch(Exception e){e.printStackTrace();}
}
public void paint(Graphics g)
{
if(Image1!=null)g.drawImage(Image1,100,100,this);
if(Image2!=null)g.drawImage(Image2,100+imageWidth+100,100,this);
}
}
class ImageOp
{
public int ImageWidth;
public int ImageHeight;
public int[] Pixels;
public ImageOp(int[] pixels,int imageWidth,int imageHeight)
{
this.ImageWidth=imageWidth;
this.ImageHeight=imageHeight;
this.Pixels=new int[imageWidth*imageHeight];
for(int i=0;i<ImageHeight;i++)
{
for(int j=0;j<ImageWidth;j++)
{
this.Pixels[i*ImageWidth+j]=pixels[i*ImageWidth+j];
}
}
}
public void invert()
{
ColorModel ColorModel1=ColorModel.getRGBdefault();
for(int i=0;i<ImageHeight;i++)
{
for(int j=0;j<ImageWidth;j++)
{
int alpha=ColorModel1.getAlpha(Pixels[i*ImageWidth+j]);
int red=ColorModel1.getRed(Pixels[i*ImageWidth+j]);
int green=ColorModel1.getGreen(Pixels[i*ImageWidth+j]);
int blue=ColorModel1.getBlue(Pixels[i*ImageWidth+j]);
double[] HSB=ColorSpace.getHSBfromRGB(red,green,blue);
double hue=HSB[0],saturation=HSB[1],brightness=HSB[2];
int[] RGB=ColorSpace.getRGBfromHSB(hue,saturation,brightness);
red=RGB[0];green=RGB[1];blue=RGB[2];
Pixels[i*ImageWidth+j]=(alpha<<24)|(red<<16)|(green<<8)|blue;
}
}
}
public MemoryImageSource getMemoryImageSource()
{
MemoryImageSource MemoryImageSource1=new MemoryImageSource(ImageWidth,ImageHeight,Pixels,0,ImageWidth);
return MemoryImageSource1;
}
}
class ColorSpace
{
public static double[] getHSBfromRGB(int red,int green,int blue)
{
double[] HSB=new double[3];
if(red==green&&green==blue)
{
HSB[0]=-1;
HSB[1]=0;
HSB[2]=(red+0.0)/255;
return HSB;
}
double hue=0,saturation=0,brightness=0;
int high=max(red,green,blue);
int low=min(red,green,blue);
int range=high-low;
if(red==high)hue=(green-blue+0.0)/range+0;
else if(green==high)hue=(blue-red+0.0)/range+2;
else if(blue==high)hue=(red-green+0.0)/range+4;
if(hue<0)hue+=6;
hue/=6;
saturation=(range+0.0)/high;
brightness=(high+0.0)/255;
HSB[0]=hue;
HSB[1]=saturation;
HSB[2]=brightness;
return HSB;
}
public static int[] getRGBfromHSB(double hue,double saturation,double brightness)
{
int[] RGB=new int[3];
if(hue==-1)
{
RGB[0]=(int)(255*brightness);
RGB[1]=(int)(255*brightness);
RGB[2]=(int)(255*brightness);
return RGB;
}
double red=0,green=0,blue=0;
double range=saturation*brightness;
double high=brightness;
double low=brightness-range;
double Hue=(6.0*hue)%6.0;
int index=(int)Hue;
double mid_low=(index%2==0?(Hue-index)*range:(index+1-Hue)*range);
double mid=low+mid_low;
switch(index)
{
case 0:red=high;green=mid;blue=low;break;
case 1:red=mid;green=high;blue=low;break;
case 2:red=low;green=high;blue=mid;break;
case 3:red=low;green=mid;blue=high;break;
case 4:red=mid;green=low;blue=high;break;
case 5:red=high;green=low;blue=mid;break;
}
RGB[0]=(int)(255*red);
RGB[1]=(int)(255*green);
RGB[2]=(int)(255*blue);
return RGB;
}
private static int max(int x,int y,int z)
{
int m=(z>y?z:y);
return (x>m?x:m);
}
private static int min(int x,int y,int z)
{
int m=(z<y?z:y);
return (x<m?x:m);
}
}
|
[
"[email protected]"
] | |
bdcb02bae3df3b9251b4ef4e5411d188c4563f4c
|
13c0aff766a39bccb7af227195f1dc866360e828
|
/src/nowcoder/进制转换/Main.java
|
76c27fb95dcf2dd5080a841394afe8bee1d82b27
|
[] |
no_license
|
Saul-Zhang/leetcode
|
f8a29915b409aba62553c4ecab4f91da7ccc82f3
|
861f25a989124e3819533e90ea5821db6f6993ce
|
refs/heads/main
| 2022-08-16T16:57:19.679444 | 2022-07-28T14:28:13 | 2022-07-28T14:28:13 | 159,012,170 | 0 | 0 | null | 2018-12-08T06:14:23 | 2018-11-25T08:28:31 |
C++
|
UTF-8
|
Java
| false | false | 570 |
java
|
package nowcoder.进制转换;
import java.util.Scanner;
/**
* @author Zhang Song
* @date 2022/7/25 21:59
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
String str = sc.nextLine();
int res = 0;
for (int i = 2; i < str.length(); i++) {
int s = str.charAt(i);
if (s > 57) {
s -= 55;
}else{
s -= 48;
}
res += s * Math.pow(16, str.length() - i - 1);
}
System.out.println(res);
}
}
}
|
[
"[email protected]"
] | |
9ab680b405a89a001e7fc215faf2fea514dd8b06
|
fa4fa5d5594acdde3691f9f466a9c74beba1426b
|
/InfoManagementSystem/src/main/java/com/example/InfoManagement/controller/loginController/ChanPassController.java
|
9b82cdab9d08dd7327005efd6f0b0d44efd5d03f
|
[] |
no_license
|
ASlsvg/InfoManagementSystem
|
db149a9f8a6cf8257f015bfc932865f04cdd78a4
|
5e51648c4e2ee4f343c1c8d98a28e350906a3381
|
refs/heads/main
| 2023-05-27T03:21:27.580832 | 2021-06-09T16:55:08 | 2021-06-09T16:55:08 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,164 |
java
|
package com.example.InfoManagement.controller.loginController;
import com.example.InfoManagement.service.AdminService;
import com.example.InfoManagement.service.impl.AdminServiceImpl;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.sql.SQLException;
/*@WebServlet("/chanPassController")
public class ChanPassController extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("utf-8");
resp.setContentType("text/html;charset=utf-8");
String newPass = req.getParameter("newPass");
AdminService adminService = new AdminServiceImpl();
boolean isSuccess = false;
isSuccess = adminService.updatePassword("1", newPass);
req.setAttribute("isSuccess",isSuccess);
req.getRequestDispatcher("/jsp/chanPass.jsp").forward(req,resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
this.doGet(req, resp);
}
}*/
|
[
"[email protected]"
] | |
df3af08aa348d816159fd86bbabcd4a7cb424de5
|
cf8b8c04d91ca79a0ee596d00f6bcf11a76f568f
|
/src/Stack_DS/StackWithArray.java
|
3e906cb8a3118a0a9a6c9f8c83477885164fd0b8
|
[] |
no_license
|
Morshed22/AlgoInJava
|
46d3fa159e18336585ed90f4742a85ac1a62b53f
|
f38d2ad8084980c9b7fad229400b18ceffb1b05e
|
refs/heads/master
| 2023-03-04T21:51:43.343335 | 2021-02-10T12:32:13 | 2021-02-10T12:32:13 | 294,898,502 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,010 |
java
|
package Stack_DS;
public class StackWithArray<T>{
private T[] stack;
private int numberOfItems;
public StackWithArray() {
this.stack = ((T[]) new Object[1]);
}
public void push(T newData){
if (numberOfItems == this.stack.length){
resize(2*this.stack.length);
}
this.stack[numberOfItems++] = newData;
}
public boolean isEmpty(){
return this.numberOfItems == 0;
}
public T pop(){
T itemTop = this.stack[--numberOfItems];
this.stack[numberOfItems] = null;
if(numberOfItems > 0 && numberOfItems == this.stack.length/4){
resize(this.stack.length/2);
}
return itemTop;
}
public int size(){
return this.numberOfItems;
}
private void resize(int capacity){
T[] stackCopy = ((T[]) new Object[capacity]);
for (int i = 0; i < numberOfItems; i++){
stackCopy[i] = this.stack[i];
}
this.stack = stackCopy;
}
}
|
[
"[email protected]"
] | |
23dc3fc78b69570e2ba1aa27d622e96fa13a5369
|
487739942e747ea005d001ceb439e53cd0d215c7
|
/src/net/kagani/game/npc/others/HarpieBug.java
|
cdd2399586a381518248755cd8aac9c1deb46f10
|
[] |
no_license
|
99max99/PhoenixRisingServer
|
fbdc61eff78de3a4d29caa1eaa8c67837b73840f
|
1815a47c071b7351baa1eb0178ffe6b965e8ccf4
|
refs/heads/master
| 2021-01-11T10:29:06.968358 | 2016-12-29T02:01:23 | 2016-12-29T02:01:23 | 76,208,559 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 659 |
java
|
package net.kagani.game.npc.others;
import net.kagani.game.Hit;
import net.kagani.game.WorldTile;
import net.kagani.game.npc.NPC;
import net.kagani.game.player.Player;
@SuppressWarnings("serial")
public class HarpieBug extends NPC {
public HarpieBug(int id, WorldTile tile, int mapAreaNameHash,
boolean canBeAttackFromOutOfArea) {
super(id, tile, mapAreaNameHash, canBeAttackFromOutOfArea);
}
@Override
public void handleIngoingHit(Hit hit) {
if (hit.getSource() instanceof Player) {
Player player = (Player) hit.getSource();
if (player.getEquipment().getShieldId() != 7053)
hit.setDamage(0);
}
super.handleIngoingHit(hit);
}
}
|
[
"[email protected]"
] | |
d68e604150368882cf2ba15dd6c373382beda102
|
8b8c6815d1103c1ac00ebf8d170c7d55e4e61cfe
|
/Eleições/src/PageObject/PageTelaCandidato.java
|
3a3003a710ac537bd4f142c84606c0941f0fbc4d
|
[] |
no_license
|
AndersonMSoares/ProjetoFinal
|
b3687c75a8c9996a1af764203b38247f47117102
|
8d9dedfd4b4be85863715184e164efaaae012718
|
refs/heads/master
| 2020-03-22T10:17:46.964082 | 2018-07-05T19:56:11 | 2018-07-05T19:56:11 | 139,894,113 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 276 |
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 PageObject;
/**
*
* @author MarkVII
*/
public class PageTelaCandidato {
}
|
[
"[email protected]"
] | |
afa40dd3d0a8813a2048dc141f7869e15a7e905a
|
7865cb7554f53a6887df43d151e1c2095b98df7e
|
/Android App FreshGrocery/app/src/main/java/com/grocery/food/Activity/AddressActivity.java
|
0e5338b44e9fa37be61777bcd7ac82c230c154dc
|
[] |
no_license
|
jayshah-07/Fast-Grocery-Delivery-Android-App-with-Interactive-Admin-Panel
|
85ee5c5aa31b0ddc54bc010fb7ec5eb2a658503d
|
63ddc2dcf954702ff27754a671cd1f9af7e71d4b
|
refs/heads/master
| 2022-09-11T09:29:55.850950 | 2020-05-30T19:45:33 | 2020-05-30T19:45:33 | 270,082,641 | 3 | 2 | null | 2020-06-06T19:29:08 | 2020-06-06T19:29:07 | null |
UTF-8
|
Java
| false | false | 7,808 |
java
|
package com.grocery.food.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.Toast;
import com.google.android.material.textfield.TextInputEditText;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.grocery.food.Model.Area;
import com.grocery.food.Model.AreaD;
import com.grocery.food.Model.LoginUser;
import com.grocery.food.Model.User;
import com.grocery.food.R;
import com.grocery.food.Utils.SessionManager;
import com.grocery.food.Utils.Utiles;
import com.grocery.food.retrofit.APIClient;
import com.grocery.food.retrofit.GetResult;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import retrofit2.Call;
public class AddressActivity extends BaseActivity implements GetResult.MyListener {
@BindView(R.id.ed_username)
TextInputEditText edUsername;
@BindView(R.id.ed_landmark)
TextInputEditText edLandmark;
@BindView(R.id.ed_alternatmob)
TextInputEditText edAlternatmob;
SessionManager sessionManager;
User user;
@BindView(R.id.ed_hoousno)
TextInputEditText edHoousno;
@BindView(R.id.ed_society)
TextInputEditText edSociety;
@BindView(R.id.ed_pinno)
TextInputEditText edPinno;
String areaSelect;
List<AreaD> areaDS = new ArrayList<>();
@BindView(R.id.spinner)
Spinner spinner;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_address);
ButterKnife.bind(this);
sessionManager = new SessionManager(AddressActivity.this);
user = sessionManager.getUserDetails("");
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
areaSelect = areaDS.get(position).getName();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
GetArea();
setcountaint(user);
}
private void setcountaint(User user) {
edUsername.setText("" + user.getName());
edHoousno.setText("" + user.getHno());
edSociety.setText("" + user.getSociety());
// edArea.setText("" + user.getArea());
edPinno.setText("" + user.getPincode());
edLandmark.setText("" + user.getLandmark());
edAlternatmob.setText("" + user.getMobile());
}
private void GetArea() {
JSONObject jsonObject = new JSONObject();
JsonParser jsonParser = new JsonParser();
Call<JsonObject> call = APIClient.getInterface().getArea((JsonObject) jsonParser.parse(jsonObject.toString()));
GetResult getResult = new GetResult();
getResult.setMyListener(this);
getResult.callForLogin(call, "2");
}
@OnClick(R.id.txt_save)
public void onViewClicked() {
if (validation()) {
UpdateUser();
}
}
private void UpdateUser() {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("uid", user.getId());
jsonObject.put("name", edUsername.getText().toString());
jsonObject.put("hno", edHoousno.getText().toString());
jsonObject.put("society", edSociety.getText().toString());
jsonObject.put("area", areaSelect);
jsonObject.put("landmark", edLandmark.getText().toString());
jsonObject.put("pincode", edPinno.getText().toString());
jsonObject.put("email", user.getEmail());
jsonObject.put("mobile", edAlternatmob.getText().toString());
jsonObject.put("password", user.getPassword());
jsonObject.put("imei", Utiles.getIMEI(AddressActivity.this));
JsonParser jsonParser = new JsonParser();
Call<JsonObject> call = APIClient.getInterface().UpdateProfile((JsonObject) jsonParser.parse(jsonObject.toString()));
GetResult getResult = new GetResult();
getResult.setMyListener(this);
getResult.callForLogin(call, "1");
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void callback(JsonObject result, String callNo) {
Log.e("response", "-->" + result);
try {
if (callNo.equalsIgnoreCase("1")) {
Gson gson = new Gson();
LoginUser response = gson.fromJson(result.toString(), LoginUser.class);
Toast.makeText(AddressActivity.this, "" + response.getResponseMsg(), Toast.LENGTH_LONG).show();
if (response.getResult().equals("true")) {
sessionManager.setIntData("dcharge", response.getdCharge());
sessionManager.setUserDetails("", response.getUser());
finish();
}
} else if (callNo.equalsIgnoreCase("2")) {
Gson gson = new Gson();
Area area = gson.fromJson(result.toString(), Area.class);
areaDS = area.getData();
List<String> Arealist = new ArrayList<>();
for (int i = 0; i < areaDS.size(); i++) {
if (areaDS.get(i).getStatus().equalsIgnoreCase("1")) {
Arealist.add(areaDS.get(i).getName());
}
}
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, Arealist);
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(dataAdapter);
int spinnerPosition = dataAdapter.getPosition(user.getArea());
spinner.setSelection(spinnerPosition);
}
}catch (Exception e){
}
}
public boolean validation() {
if (edUsername.getText().toString().isEmpty()) {
edUsername.setError("Enter Name");
return false;
}
if (edHoousno.getText().toString().isEmpty()) {
edHoousno.setError("Enter House No");
return false;
}
if (edSociety.getText().toString().isEmpty()) {
edSociety.setError("Enter Society");
return false;
}
if (edLandmark.getText().toString().isEmpty()) {
edLandmark.setError("Enter Landmark");
return false;
}
if (edPinno.getText().toString().isEmpty()) {
edPinno.setError("Enter Pincode");
return false;
}
if (edAlternatmob.getText().toString().isEmpty() || !validatePhoneNumber(edAlternatmob.getText().toString())) {
edAlternatmob.setError("Enter Valid mobile");
return false;
}
return true;
}
private static boolean validatePhoneNumber(String phoneNo) {
//validate phone numbers of format "1234567890"
if (phoneNo.matches("\\d{10}")) return true;
//validating phone number with -, . or spaces
else if (phoneNo.matches("\\d{3}[-\\.\\s]\\d{3}[-\\.\\s]\\d{4}")) return true;
//validating phone number with extension length from 3 to 5
else if (phoneNo.matches("\\d{3}-\\d{3}-\\d{4}\\s(x|(ext))\\d{3,5}")) return true;
//validating phone number where area code is in braces ()
else if (phoneNo.matches("\\(\\d{3}\\)-\\d{3}-\\d{4}")) return true;
//return false if nothing matches the input
else return false;
}
}
|
[
"[email protected]"
] | |
60496697c748bba1526eeedc2ce877f5b63a51cb
|
ee26013ab5b4460b9e392db5f9bd5acc272b6ea8
|
/Ifrastructure/src/main/java/com/vlives/boss/merchant/dao/UpdateRuleItemDao.java
|
2cd590bb18dc0615dcb88193b1ca1fb3176f30ce
|
[] |
no_license
|
Anymous526/Hera
|
3e6dceea0e7b060cde0333ede8afdb3d72960830
|
c057ca7c2b664a3ffe1f79dd64e596ea6eece74c
|
refs/heads/master
| 2021-01-13T15:06:51.238921 | 2015-04-15T02:38:02 | 2015-04-15T02:38:02 | 33,860,415 | 1 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 493 |
java
|
/**
* @(#)UpdateRuleItemDao.java
*
* Copyright 2011 JUST IN MOBILE, Inc. All rights reserved.
*/
package com.vlives.boss.merchant.dao;
import org.springframework.stereotype.Repository;
import com.vlives.boss.merchant.domain.UpdateRuleItem;
import com.vlives.core.dao.generic.BaseDaoHibernateImpl;
/**
* description
* @author unicorn
* @version 1.0,2011-6-3
*/
@Repository("updateRuleItemDao")
public class UpdateRuleItemDao extends BaseDaoHibernateImpl<UpdateRuleItem, Long> {
}
|
[
"[email protected]"
] | |
8f7b80caef4b2d6d3ac028717242498637e8c1a5
|
22c6a8bbbdcc0628c51c4c1e7cb03e33cdbcfabd
|
/src/main/java/persistence/Persister.java
|
51e79d36c69fe64d2ddd826b2eea44a515b3ba7b
|
[] |
no_license
|
GaruGaru/twitter-bot
|
5f49109093fe7754fadfd59842c78e598bbfa108
|
93af77af9eee0a51e1f7fe9ead8d891640686400
|
refs/heads/master
| 2020-12-03T00:29:46.074046 | 2017-07-02T16:42:55 | 2017-07-02T16:42:55 | 96,035,825 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 224 |
java
|
package persistence;
import java.util.Optional;
/**
* Created by Garu on 28/05/2017.
*/
public interface Persister<T> {
Optional<T> get(String key);
void save(String key, T value);
void clean(String key);
}
|
[
"[email protected]"
] | |
2bd6665f0e1d852c979ef3b428e02fb44f53f5a5
|
4abd603f82fdfa5f5503c212605f35979b77c406
|
/html/Programs/hw11/5456594640742e6288667d71353ef9e4/CriticalDis.java
|
865f67a5c3b07d908ae3a01256a354b4e5934a93
|
[] |
no_license
|
dn070017/1042-PDSA
|
b23070f51946c8ac708d3ab9f447ab8185bd2a34
|
5e7d7b1b2c9d751a93de9725316aa3b8f59652e6
|
refs/heads/master
| 2020-03-20T12:13:43.229042 | 2018-06-15T01:00:48 | 2018-06-15T01:00:48 | 137,424,305 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,450 |
java
|
import java.io.BufferedReader;
import java.io.FileReader;
import java.text.DecimalFormat;
import java.util.Arrays;
public class CriticalDis {
public static void main(String[] args) throws Exception {
// TODO code application logic here
double d = 0.250;
try (BufferedReader br = new BufferedReader(new FileReader(args[0]))) {
int DotNumber = Integer.parseInt(br.readLine());
double[][] distance = new double[DotNumber][DotNumber];
Point2D[] dot = new Point2D[DotNumber];
double[] value = new double[DotNumber];
int e = 0;
while (true) {
String header = br.readLine();
if (header == null) {
break;
}
String[] place = header.split("" "");
double x = Double.parseDouble(place[0]);
double y = Double.parseDouble(place[1]);
value[e] = x + y;
dot[e] = new Point2D(x, y);
// StdDraw.filledCircle(dot[e].x(), dot[e].y(),0.01);
// StdDraw.text(dot[e].x(), dot[e].y()+0.03,String.valueOf(e+1));
e++;
}
Arrays.sort(value);
double s = value[0];
double t = value[DotNumber - 1];
// System.out.print(""s: "");
// System.out.print(s);
// System.out.printf(""\n"");
// System.out.print(""t: "");
// System.out.print(t);
// System.out.printf(""\n"");
int dotmin = 0;
int dotmax = 0;
for (int m = 0; m < DotNumber; m++) {
if (dot[m].x() + dot[m].y() == s) {
dotmin = m;
// StdDraw.setPenColor(Color.RED);
// StdDraw.text(dot[m].x(), dot[m].y()+0.03,String.valueOf(m+1));
} else if (dot[m].x() + dot[m].y() == t) {
dotmax = m;
// StdDraw.setPenColor(Color.GREEN);
// StdDraw.text(dot[m].x(), dot[m].y()+0.03,String.valueOf(m+1));
}
}
while (d < 1.414) {
Digraph G = new Digraph(DotNumber);
for (int i = 0; i < DotNumber; i++) {
for (int k = 1; k < DotNumber; k++) {
double b = dot[k].x() - dot[i].x();
double c = dot[k].y() - dot[i].y();
if ((dot[k].x() + dot[k].y()) - (dot[i].x() + dot[i].y()) > 0 && dot[k].x() - dot[i].x() > 0 && dot[k].y() - dot[i].y() > 0 && Math.sqrt(Math.pow(b, 2) + Math.pow(c, 2)) < d) {
G.addEdge(i, k);
// StdDraw.line(dot[k].x(),dot[k].y() , dot[i].x(), dot[i].y());
// StdDraw.text((dot[k].x()+dot[i].x())/2, (dot[k].y()+dot[i].y())/2, String.valueOf(Math.sqrt(Math.pow(b, 2) + Math.pow(c, 2))));
}
}
}
DirectedDFS dfs = new DirectedDFS(G, dotmin);
if (dfs.marked(dotmax) == true) {
break;
}
d = d + 0.001;
}
}
d = d - 0.001;
System.out.printf(""%1.3f\n"", d);
// StdOut.println(G);
}
}
|
[
"[email protected]"
] | |
c9153a54197a42289926c384bfce170736122c52
|
006c06df3fa5d9fe0554dc63bacd85b19c46808c
|
/src/edu/buaa/satla/analysis/core/defaults/LatticeAbstractState.java
|
6ca7fd1b96c0a6e16d04cc8ee4cb3f3bc307cdeb
|
[] |
no_license
|
gfkobe/SAT_LA_CMP
|
bacd4e2290ee62d7066e15fcdf5de725818e8e6c
|
b8468fc6ce66c06b512d94725f564b9641dc6f15
|
refs/heads/master
| 2021-01-10T11:23:39.312590 | 2015-12-19T09:33:42 | 2015-12-19T09:33:42 | 47,769,885 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,052 |
java
|
package edu.buaa.satla.analysis.core.defaults;
import edu.buaa.satla.analysis.core.interfaces.AbstractState;
import edu.buaa.satla.analysis.exceptions.CPAException;
/**
* Interface for the abstract state which supports joining and partial
* order comparison.
*
* Using this class in conjunction with {@link DelegateAbstractDomain}
* saves the user from writing {@link edu.buaa.satla.analysis.core.interfaces.AbstractDomain}
* implementation which just delegates the method to the abstract state.
*/
public interface LatticeAbstractState<T extends LatticeAbstractState<T>>
extends AbstractState{
/**
* Delegate method for convenience.
*
* See {@link edu.buaa.satla.analysis.core.interfaces.AbstractDomain#join}
* for the description.
*/
T join(T other) throws CPAException;
/**
* Delegate method for convenience.
*
* See {@link edu.buaa.satla.analysis.core.interfaces.AbstractDomain#isLessOrEqual}
* for the description.
*/
boolean isLessOrEqual(T other) throws CPAException, InterruptedException;
}
|
[
"[email protected]"
] | |
1656b43c4163e2324f40069e146d43772f21b6cd
|
7463bfa04676c561ff009f7d9c155caae3fc42b6
|
/CookingInTranslation/src/main/java/io/trtong/web/rest/errors/EmailAlreadyUsedException.java
|
8d5c9ac860fd9020f73498bedc12d4bd7325e03d
|
[] |
no_license
|
trtong/CookingInTranslation
|
1487b04742106a053e7e867347e5b6ab8815eb73
|
08f306fff6bd3b7a3ad766a037e3d74bae35a78e
|
refs/heads/master
| 2021-06-28T23:06:29.042439 | 2019-01-06T01:21:31 | 2019-01-06T01:21:31 | 157,254,546 | 0 | 1 | null | 2020-09-18T12:27:47 | 2018-11-12T18:00:42 |
Java
|
UTF-8
|
Java
| false | false | 330 |
java
|
package io.trtong.web.rest.errors;
public class EmailAlreadyUsedException extends BadRequestAlertException {
private static final long serialVersionUID = 1L;
public EmailAlreadyUsedException() {
super(ErrorConstants.EMAIL_ALREADY_USED_TYPE, "Email is already in use!", "userManagement", "emailexists");
}
}
|
[
"[email protected]"
] | |
d94aa10cb0b152db2eb86841a351ea9315e43db1
|
2d95c5f1fa16518488ec0598ca43b1330782d96b
|
/src/main/java/com/scrape/security/jwt/JwtAuthTokenFilter.java
|
b96238a5793264f74cfb096019ef988d4eced133
|
[] |
no_license
|
rabeb94/MovieScraping
|
2f0d91fc54927b3f5acea156cd1c4692ef0563ac
|
da8d9ae5c9443ff8b36ac398487832e2f6b8479d
|
refs/heads/master
| 2020-04-15T03:09:24.358532 | 2019-01-08T21:30:23 | 2019-01-08T21:30:23 | 164,338,031 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,253 |
java
|
package com.scrape.security.jwt;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.web.filter.OncePerRequestFilter;
import com.scrape.security.services.UserDetailsServiceImpl;
public class JwtAuthTokenFilter extends OncePerRequestFilter {
@Autowired
private JwtProvider tokenProvider;
@Autowired
private UserDetailsServiceImpl userDetailsService;
private static final Logger logger = LoggerFactory.getLogger(JwtAuthTokenFilter.class);
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
try {
String jwt = getJwt(request);
if (jwt != null && tokenProvider.validateJwtToken(jwt)) {
String username = tokenProvider.getUserNameFromJwtToken(jwt);
UserDetails userDetails = userDetailsService.loadUserByUsername(username);
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
userDetails, null, userDetails.getAuthorities());
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
SecurityContextHolder.getContext().setAuthentication(authentication);
}
} catch (Exception e) {
logger.error("Can NOT set user authentication -> Message: {}", e);
}
filterChain.doFilter(request, response);
}
private String getJwt(HttpServletRequest request) {
String authHeader = request.getHeader("Authorization");
if (authHeader != null && authHeader.startsWith("Bearer ")) {
return authHeader.replace("Bearer ", "");
}
return null;
}
}
|
[
"[email protected]"
] | |
197c6aeb879b8ce1771a3d551c610d65542b16c5
|
de4b7ec66bf8502fe090d45b76ebd5817a88ab1f
|
/src/main/java/com/futao/springmvcdemo/annotation/listener/OnlineHttpSessionListener.java
|
6b3d037beee47cecc1aecf51d0621051492d1b37
|
[
"MIT"
] |
permissive
|
FutaoSmile/SpringMvcStudyBaseXML
|
2fdb4aec98fdd8abd8f58b59ce71e7aa22ccb62e
|
ebf6cf0d3e476962d1cb6a33f373285870e4225a
|
refs/heads/master
| 2022-12-22T07:17:10.262179 | 2022-07-24T03:49:22 | 2022-07-24T03:49:22 | 176,199,070 | 2 | 0 |
MIT
| 2022-12-16T04:47:05 | 2019-03-18T03:37:07 |
Java
|
UTF-8
|
Java
| false | false | 1,618 |
java
|
//package com.futao.springmvcdemo.annotation.listener;
//
//import com.futao.springmvcdemo.model.system.SystemConfig;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import javax.servlet.annotation.WebListener;
//import javax.servlet.http.HttpSessionEvent;
//import javax.servlet.http.HttpSessionListener;
//import java.util.concurrent.atomic.AtomicInteger;
//
///**
// * HttpSession监听器,统计在线人数
// *
// * @author futao
// * Created on 2018/10/11.
// */
//@Component
//@WebListener("onlinePeopleQuantity")
//public class OnlineHttpSessionListener implements HttpSessionListener {
//
// @Resource
// private SystemConfig systemConfig;
//
// /**
// * 在线人数量
// */
// private AtomicInteger onlinePeopleQuantity = new AtomicInteger();
//
// /**
// * Notification that a session was created.
// *
// * @param se the notification event
// */
// @Override
// public void sessionCreated(HttpSessionEvent se) {
// onlinePeopleQuantity.addAndGet(systemConfig.getOnlinePeopleQuantityScale());
// }
//
// /**
// * Notification that a session is about to be invalidated.
// *
// * @param se the notification event
// */
// @Override
// public void sessionDestroyed(HttpSessionEvent se) {
// onlinePeopleQuantity.addAndGet(-systemConfig.getOnlinePeopleQuantityScale());
// }
//
// /**
// * 获取在线人数
// *
// * @return 在线人数
// */
// public AtomicInteger getOnlinePeopleQuantity() {
// return onlinePeopleQuantity;
// }
//}
|
[
"[email protected]"
] | |
d5d1c4466f59fa5c842494360f873348ac04fb06
|
7258d1bd6ed5e53df7b5b96023febca2813f78ee
|
/src/main/java/com/chen/fy/model/Person.java
|
d46f6edbf2dfecb96921f5dc055e95efd4a1b35e
|
[] |
no_license
|
chen104/fy_manager
|
ef9f866dec0a79de7b373d035b0f2328a0277d0e
|
7255bb68b1b864747705b7a4517e6af726110b20
|
refs/heads/master
| 2022-09-24T16:53:36.872486 | 2019-03-25T05:54:30 | 2019-03-25T05:54:30 | 139,312,680 | 0 | 1 | null | 2022-09-01T22:20:14 | 2018-07-01T08:33:53 |
JavaScript
|
UTF-8
|
Java
| false | false | 237 |
java
|
package com.chen.fy.model;
import com.chen.fy.model.base.BasePerson;
/**
* Generated by JFinal.
*/
@SuppressWarnings("serial")
public class Person extends BasePerson<Person> {
public final static Person dao = new Person().dao();
}
|
[
"[email protected]"
] | |
031fe8d3d3bb854141e26e3752f2c7913580d267
|
ed6ef129c1d3f267f6d8e8353e8a7787da1d9ba5
|
/eveapi/branches/eveapi-4.0/src/main/java/com/beimin/eveapi/character/calendar/attendees/CalendarEventAttendeesParser.java
|
b6536871f42657de85b81fd6ca3a9eafbd1e023f
|
[] |
no_license
|
EVE-SECURE/eveapi
|
3b50d427ec517c692d044509ac65220b6e5649fc
|
32b4fb26d12d418df0fc0f6ca53454f41de423f2
|
refs/heads/master
| 2020-05-18T16:19:25.690203 | 2014-04-21T22:33:05 | 2014-04-21T22:33:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,440 |
java
|
package com.beimin.eveapi.character.calendar.attendees;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.digester.Digester;
import com.beimin.eveapi.core.AbstractListParser;
import com.beimin.eveapi.core.ApiAuth;
import com.beimin.eveapi.core.ApiException;
import com.beimin.eveapi.core.ApiPage;
import com.beimin.eveapi.core.ApiPath;
import com.beimin.eveapi.shared.calendar.CalendarEventResponse;
import com.beimin.eveapi.shared.calendar.CalendarEventResponseConverter;
import com.beimin.eveapi.utils.StringUtils;
public class CalendarEventAttendeesParser extends AbstractListParser<CalendarEventAttendeesResponse, EveCalendarEventAttendee> {
public CalendarEventAttendeesParser() {
super(CalendarEventAttendeesResponse.class, 2, ApiPath.CHARACTER, ApiPage.CALENDAR_EVENT_ATTENDEES, EveCalendarEventAttendee.class);
}
@Override
protected Digester getDigester() {
Digester digester = super.getDigester();
ConvertUtils.register(new CalendarEventResponseConverter(), CalendarEventResponse.class);
return digester;
}
public static CalendarEventAttendeesParser getInstance() {
return new CalendarEventAttendeesParser();
}
public CalendarEventAttendeesResponse getResponse(ApiAuth<?> auth, long... eventIDs) throws ApiException {
if (eventIDs.length == 0)
throw new ApiException("no eventIds provided");
return super.getResponse(auth, "eventIDs", StringUtils.join(",", eventIDs));
}
}
|
[
"[email protected]@cf400a95-ad45-0410-a29f-a50bf25af4c7"
] |
[email protected]@cf400a95-ad45-0410-a29f-a50bf25af4c7
|
fa67650aaef22f0c4d80c4dfc5bfcbab68fdb8f0
|
cc1b47db2b25d7f122d0fb48a4917fd01f129ff8
|
/integration/domino-jnx-jakarta-security/src/main/java/com/hcl/domino/jnx/jakarta/security/NotesDirectoryIdentityStore.java
|
1f5573c1e4c7a0b2037614efb363bef6aa0a26d1
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
savlpavel/domino-jnx
|
666f7e12abdf5e36b471cdd7c99086db589f923f
|
2d94e42cdfa56de3b117231f4488685f8e084e83
|
refs/heads/main
| 2023-09-04T10:20:43.968949 | 2023-07-31T16:41:34 | 2023-07-31T16:41:34 | 392,598,440 | 0 | 1 |
Apache-2.0
| 2021-08-04T07:49:29 | 2021-08-04T07:49:29 | null |
UTF-8
|
Java
| false | false | 3,917 |
java
|
/*
* ==========================================================================
* Copyright (C) 2019-2022 HCL America, Inc. ( http://www.hcl.com/ )
* All rights reserved.
* ==========================================================================
* Licensed under the Apache License, Version 2.0 (the "License"). You may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
* ==========================================================================
*/
package com.hcl.domino.jnx.jakarta.security;
import java.util.LinkedHashSet;
import java.util.Set;
import javax.naming.AuthenticationException;
import javax.naming.AuthenticationNotSupportedException;
import javax.naming.NameNotFoundException;
import com.hcl.domino.BuildVersionInfo;
import com.hcl.domino.DominoClient;
import com.hcl.domino.DominoClientBuilder;
import com.hcl.domino.misc.NotesConstants;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.security.enterprise.credential.Credential;
import jakarta.security.enterprise.credential.UsernamePasswordCredential;
import jakarta.security.enterprise.identitystore.CredentialValidationResult;
import jakarta.security.enterprise.identitystore.IdentityStore;
@ApplicationScoped
public class NotesDirectoryIdentityStore implements IdentityStore {
@Override
public Set<String> getCallerGroups(final CredentialValidationResult validationResult) {
final String dn = validationResult.getCallerDn();
return this.getGroups(dn);
}
private Set<String> getGroups(final String dn) {
try (DominoClient client = DominoClientBuilder.newDominoClient().asUser(dn).build()) {
// TODO filter out non-glob names
return new LinkedHashSet<>(client.getEffectiveUserNamesList(null).toList());
}
}
@Override
public int priority() {
return 70;
}
@Override
public CredentialValidationResult validate(final Credential credential) {
return IdentityStore.super.validate(credential);
}
public CredentialValidationResult validate(final UsernamePasswordCredential credential) {
try (DominoClient client = DominoClientBuilder.newDominoClient().build()) {
try {
final String dn = client.validateCredentials(null, credential.getCaller(), credential.getPasswordAsString());
return new CredentialValidationResult(null, dn, dn, dn, this.getGroups(dn));
} catch(AuthenticationException e) {
// On 12.0.1+, we may only get an AuthenticationException based on the single API call.
// In this case, try to look up the user to see if it's invalid or not a valid name at all
BuildVersionInfo buildVersion = client.getBuildVersion(null);
if(buildVersion != null && buildVersion.isAtLeast(12, 0, 1, 0, 0)) {
if(client.openUserDirectory(null).lookupUserValue(credential.getCaller(), NotesConstants.MAIL_FULLNAME_ITEM).isPresent()) {
return CredentialValidationResult.INVALID_RESULT;
} else {
return CredentialValidationResult.NOT_VALIDATED_RESULT;
}
}
return CredentialValidationResult.INVALID_RESULT;
}
} catch (final NameNotFoundException e) {
return CredentialValidationResult.NOT_VALIDATED_RESULT;
} catch (AuthenticationNotSupportedException e) {
return CredentialValidationResult.INVALID_RESULT;
}
}
@Override
public Set<ValidationType> validationTypes() {
return IdentityStore.DEFAULT_VALIDATION_TYPES;
}
}
|
[
"[email protected]"
] | |
5783090cf4aed37a350a1d5dc33c81d0906b5dcb
|
84191bf7829e903119245a3a17becd89092f215b
|
/src/main/java/dev/theatricalmod/theatrical/api/ChannelType.java
|
5c740f447b7441073c2f3027266f6dfbbf317456
|
[
"CC0-1.0"
] |
permissive
|
theatricalmod/theatrical-fabric
|
f37fde19f78e71eb3daa8f7eabaebb7840594053
|
c404e1dee31af1356d20a4c47d7a1b1d84233e1f
|
refs/heads/master
| 2020-05-19T04:07:42.272620 | 2019-07-15T12:49:52 | 2019-07-15T12:49:52 | 184,817,486 | 4 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 269 |
java
|
package dev.theatricalmod.theatrical.api;
public enum ChannelType {
INTENSITY,
RED,
GREEN,
BLUE,
UV,
STAGE_ORANGE,
WHITE,
GOBO,
PRISM,
GOBO_ROTATE,
PRISM_ROTATE,
PAN,
TILT,
FOCUS,
ZOOM,
CUSTOM,
;
}
|
[
"[email protected]"
] | |
d40d981ff617c10fafb3520f8ea7fbcb039de6a6
|
b75fbc6d93e1ded0c126926d273f61406e560957
|
/src/main/java/guru/springframework/sfgdi/services/PropertyGreetingService.java
|
c7138cdc14e2abf04f92a1f1f4bba06738de01f9
|
[] |
no_license
|
appproach-organization-1/sfg-di
|
03feaa143b6e958bd13bc5e8a37c4e0de0819565
|
30a3c3f6f609b95f035e485483b96fc90013d86a
|
refs/heads/master
| 2023-05-31T18:02:32.422116 | 2021-06-08T14:08:54 | 2021-06-08T14:08:54 | 374,818,066 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 272 |
java
|
package guru.springframework.sfgdi.services;
import org.springframework.stereotype.Service;
@Service
public class PropertyGreetingService implements GreetingService{
@Override
public String sayHello() {
return "Hlelo From Property";
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.