blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
d6771863e5bfc79b4f23d2f0d0fbacfa318365a2
95cd21c6bfd537886adefa1dd7e5916ca4dcf559
/net/minecraft/advancements/CriteriaTriggers.java
edfae6d27bf05a12e3c89fb200614f1488d97ef0
[]
no_license
RavenLeaks/BetterCraft-src
acd3653e9259b46571e102480164d86dc75fb93f
fca1f0f3345b6b75eef038458c990726f16c7ee8
refs/heads/master
2022-10-27T23:36:27.113266
2020-06-09T15:50:17
2020-06-09T15:50:17
271,044,072
4
2
null
null
null
null
UTF-8
Java
false
false
6,665
java
/* */ package net.minecraft.advancements; /* */ /* */ import com.google.common.collect.Maps; /* */ import java.util.Map; /* */ import javax.annotation.Nullable; /* */ import net.minecraft.advancements.critereon.BredAnimalsTrigger; /* */ import net.minecraft.advancements.critereon.BrewedPotionTrigger; /* */ import net.minecraft.advancements.critereon.ChangeDimensionTrigger; /* */ import net.minecraft.advancements.critereon.ConstructBeaconTrigger; /* */ import net.minecraft.advancements.critereon.ConsumeItemTrigger; /* */ import net.minecraft.advancements.critereon.CuredZombieVillagerTrigger; /* */ import net.minecraft.advancements.critereon.EffectsChangedTrigger; /* */ import net.minecraft.advancements.critereon.EnchantedItemTrigger; /* */ import net.minecraft.advancements.critereon.EnterBlockTrigger; /* */ import net.minecraft.advancements.critereon.EntityHurtPlayerTrigger; /* */ import net.minecraft.advancements.critereon.ImpossibleTrigger; /* */ import net.minecraft.advancements.critereon.InventoryChangeTrigger; /* */ import net.minecraft.advancements.critereon.ItemDurabilityTrigger; /* */ import net.minecraft.advancements.critereon.KilledTrigger; /* */ import net.minecraft.advancements.critereon.LevitationTrigger; /* */ import net.minecraft.advancements.critereon.NetherTravelTrigger; /* */ import net.minecraft.advancements.critereon.PlacedBlockTrigger; /* */ import net.minecraft.advancements.critereon.PlayerHurtEntityTrigger; /* */ import net.minecraft.advancements.critereon.PositionTrigger; /* */ import net.minecraft.advancements.critereon.RecipeUnlockedTrigger; /* */ import net.minecraft.advancements.critereon.SummonedEntityTrigger; /* */ import net.minecraft.advancements.critereon.TameAnimalTrigger; /* */ import net.minecraft.advancements.critereon.TickTrigger; /* */ import net.minecraft.advancements.critereon.UsedEnderEyeTrigger; /* */ import net.minecraft.advancements.critereon.UsedTotemTrigger; /* */ import net.minecraft.advancements.critereon.VillagerTradeTrigger; /* */ import net.minecraft.util.ResourceLocation; /* */ /* */ public class CriteriaTriggers /* */ { /* 36 */ private static final Map<ResourceLocation, ICriterionTrigger<?>> field_192139_s = Maps.newHashMap(); /* 37 */ public static final ImpossibleTrigger field_192121_a = func_192118_a(new ImpossibleTrigger()); /* 38 */ public static final KilledTrigger field_192122_b = func_192118_a(new KilledTrigger(new ResourceLocation("player_killed_entity"))); /* 39 */ public static final KilledTrigger field_192123_c = func_192118_a(new KilledTrigger(new ResourceLocation("entity_killed_player"))); /* 40 */ public static final EnterBlockTrigger field_192124_d = func_192118_a(new EnterBlockTrigger()); /* 41 */ public static final InventoryChangeTrigger field_192125_e = func_192118_a(new InventoryChangeTrigger()); /* 42 */ public static final RecipeUnlockedTrigger field_192126_f = func_192118_a(new RecipeUnlockedTrigger()); /* 43 */ public static final PlayerHurtEntityTrigger field_192127_g = func_192118_a(new PlayerHurtEntityTrigger()); /* 44 */ public static final EntityHurtPlayerTrigger field_192128_h = func_192118_a(new EntityHurtPlayerTrigger()); /* 45 */ public static final EnchantedItemTrigger field_192129_i = func_192118_a(new EnchantedItemTrigger()); /* 46 */ public static final BrewedPotionTrigger field_192130_j = func_192118_a(new BrewedPotionTrigger()); /* 47 */ public static final ConstructBeaconTrigger field_192131_k = func_192118_a(new ConstructBeaconTrigger()); /* 48 */ public static final UsedEnderEyeTrigger field_192132_l = func_192118_a(new UsedEnderEyeTrigger()); /* 49 */ public static final SummonedEntityTrigger field_192133_m = func_192118_a(new SummonedEntityTrigger()); /* 50 */ public static final BredAnimalsTrigger field_192134_n = func_192118_a(new BredAnimalsTrigger()); /* 51 */ public static final PositionTrigger field_192135_o = func_192118_a(new PositionTrigger(new ResourceLocation("location"))); /* 52 */ public static final PositionTrigger field_192136_p = func_192118_a(new PositionTrigger(new ResourceLocation("slept_in_bed"))); /* 53 */ public static final CuredZombieVillagerTrigger field_192137_q = func_192118_a(new CuredZombieVillagerTrigger()); /* 54 */ public static final VillagerTradeTrigger field_192138_r = func_192118_a(new VillagerTradeTrigger()); /* 55 */ public static final ItemDurabilityTrigger field_193132_s = func_192118_a(new ItemDurabilityTrigger()); /* 56 */ public static final LevitationTrigger field_193133_t = func_192118_a(new LevitationTrigger()); /* 57 */ public static final ChangeDimensionTrigger field_193134_u = func_192118_a(new ChangeDimensionTrigger()); /* 58 */ public static final TickTrigger field_193135_v = func_192118_a(new TickTrigger()); /* 59 */ public static final TameAnimalTrigger field_193136_w = func_192118_a(new TameAnimalTrigger()); /* 60 */ public static final PlacedBlockTrigger field_193137_x = func_192118_a(new PlacedBlockTrigger()); /* 61 */ public static final ConsumeItemTrigger field_193138_y = func_192118_a(new ConsumeItemTrigger()); /* 62 */ public static final EffectsChangedTrigger field_193139_z = func_192118_a(new EffectsChangedTrigger()); /* 63 */ public static final UsedTotemTrigger field_193130_A = func_192118_a(new UsedTotemTrigger()); /* 64 */ public static final NetherTravelTrigger field_193131_B = func_192118_a(new NetherTravelTrigger()); /* */ /* */ /* */ private static <T extends ICriterionTrigger> T func_192118_a(T p_192118_0_) { /* 68 */ if (field_192139_s.containsKey(p_192118_0_.func_192163_a())) /* */ { /* 70 */ throw new IllegalArgumentException("Duplicate criterion id " + p_192118_0_.func_192163_a()); /* */ } /* */ /* */ /* 74 */ field_192139_s.put(p_192118_0_.func_192163_a(), (ICriterionTrigger<?>)p_192118_0_); /* 75 */ return p_192118_0_; /* */ } /* */ /* */ /* */ /* */ @Nullable /* */ public static <T extends ICriterionInstance> ICriterionTrigger<T> func_192119_a(ResourceLocation p_192119_0_) { /* 82 */ return (ICriterionTrigger<T>)field_192139_s.get(p_192119_0_); /* */ } /* */ /* */ /* */ public static Iterable<? extends ICriterionTrigger<?>> func_192120_a() { /* 87 */ return field_192139_s.values(); /* */ } /* */ } /* Location: C:\Users\emlin\Desktop\BetterCraft.jar!\net\minecraft\advancements\CriteriaTriggers.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "emlin2021@gmail.com" ]
emlin2021@gmail.com
1fa2f8b23b591a2ccf67b38e26db48ab16e55f01
217e44b1dad361145b400f3c413d12e4342f7413
/javatest/src/D3_if_Quiz/D3_if4_로그인문제.java
9c225a104125579eaf86cc4df1ac43cbc2808006
[]
no_license
s02asy/study
7e5cc299edf2848aeba5a8fa7909fb06bd4b7f5d
55a1a6f9ae3a9bc83702c9679d239bbab7f4ede8
refs/heads/master
2023-08-15T14:15:31.652270
2021-09-06T08:56:55
2021-09-06T08:56:55
403,499,304
0
0
null
null
null
null
UHC
Java
false
false
835
java
package D3_if_Quiz; import java.util.Scanner; public class D3_if4_로그인문제 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int dbid = 1234; int dbpw = 1111; // 문제1) 아이디와 비밀번호를 입력받고 로그인성공 , 실패 출력 // 조건) 아이디를 입력받고 아이디만 검사후 아이디가 맞으면 비밀번호 // 물어보기 System.out.println("아이디를 입력하세요"); int id = scan.nextInt(); if(dbid == id) { System.out.println("비밀번호를 입력하세요."); int pw = scan.nextInt(); if(dbpw == pw) { System.out.println("로그인 성공."); } else { System.out.println("비밀번호가 틀렸습니다."); } } else { System.out.println("아이디를 확인하세요"); } } }
[ "A@DESKTOP-H0948LR" ]
A@DESKTOP-H0948LR
3dcb6a6d63d3e71fb0d727f629a0e81b3c8a3af3
84c3301dd799d1d0e7de58ed50f30719568760e6
/pu/pusettlement/src/client/nc/ui/pu/m4t/action/M4TAddManualAction.java
41d351f99e6edda096e857412b922baf2f01c69d
[]
no_license
hljlgj/YonyouNC
264d1f38b76fb3c9937603dd48753a9b2666c3ee
fec9955513594a3095be76c4d7f98b0927d721b6
refs/heads/master
2020-06-12T08:25:44.710709
2018-07-04T09:11:33
2018-07-04T09:11:33
null
0
0
null
null
null
null
GB18030
Java
false
false
3,135
java
/** * */ package nc.ui.pu.m4t.action; import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; import nc.itf.pu.pub.IPURemoteCallCombinator; import nc.ui.pu.m4t.rule.EditableByCurrency; import nc.ui.pu.m4t.rule.ReferenceFilterByOrg; import nc.ui.pu.pub.editor.CardEditorHelper; import nc.ui.pu.pub.util.BusitypeSetter; import nc.ui.pubapp.uif2app.actions.AbstractReferenceAction; import nc.ui.uif2.UIState; import nc.ui.uif2.editor.IBillCardPanelEditor; import nc.ui.uif2.model.AbstractAppModel; import nc.vo.pu.m4t.rule.HeadDefaultValue; import nc.vo.pu.m4t.rule.LineDefaultValue; import nc.vo.scmpub.res.billtype.POBillType; /** * <b>本类主要完成以下功能:</b> * <ul> * <li>期初暂估单自制按钮</li> * </ul> * <p> * </p> * * @author xiebo * @version 6.0 * @see * @since * @time 2010-1-28 下午02:00:31 */ public class M4TAddManualAction extends AbstractReferenceAction { private static final long serialVersionUID = 7280021438919507432L; private IBillCardPanelEditor editor; private AbstractAppModel model; @Override public void doAction(ActionEvent e) throws Exception { this.model.setUiState(UIState.ADD); CardEditorHelper helper = new CardEditorHelper(this.getEditor().getBillCardPanel()); // 设置表头默认值 new HeadDefaultValue(helper, this.getModel().getContext()) .setDefaultValue(); // 设置表体默认值 new LineDefaultValue(helper, this.getModel().getContext()) .setDefaultValue(0); new EditableByCurrency(this.getEditor().getBillCardPanel()).setEditable(); List<IPURemoteCallCombinator> rccRuleLst = new ArrayList<IPURemoteCallCombinator>(); // 注册可合并的远程调用 this.registerRccRule(rccRuleLst); // 执行远程调用规则 this.doRccRule(rccRuleLst); // 过滤参照 new ReferenceFilterByOrg(this.getEditor()).filter(); } public IBillCardPanelEditor getEditor() { return this.editor; } public AbstractAppModel getModel() { return this.model; } public void setEditor(IBillCardPanelEditor editor) { this.editor = editor; } public void setModel(AbstractAppModel model) { this.model = model; model.addAppEventListener(this); } private void doRccRule(List<IPURemoteCallCombinator> rccRuleLst) { for (IPURemoteCallCombinator rccRule : rccRuleLst) { if (null != rccRule) { rccRule.process(); } } } private void regiest_bizRule(List<IPURemoteCallCombinator> rccRuleLst) { CardEditorHelper billhelper = new CardEditorHelper(this.editor.getBillCardPanel()); new BusitypeSetter(POBillType.InitEstimate, billhelper, this.model .getContext()).manualAddSet(rccRuleLst); } private void registerRccRule(List<IPURemoteCallCombinator> rccRuleLst) { // 支持批量远程调用-确定业务流程-注册 this.regiest_bizRule(rccRuleLst); } @Override protected boolean isActionEnable() { return this.model.getUiState() == UIState.NOT_EDIT; } @Override protected boolean isManual() { return true; } }
[ "944482059@qq.com" ]
944482059@qq.com
c2f643b8a4396df3f24ebcbed3447fc1d44f748a
8e9e10734775849c1049840727b63de749c06aae
/src/java/com/webify/shared/edi/model/hipaa837i/Loop2410.java
5302bfaa7ac568b5770ecbf485f3222d82947f59
[]
no_license
mperham/edistuff
6ee665082b7561d73cb2aa49e7e4b0142b14eced
ebb03626514d12e375fa593e413f1277a614ab76
refs/heads/master
2023-08-24T00:17:34.286847
2020-05-04T21:31:42
2020-05-04T21:31:42
261,299,559
4
0
null
null
null
null
UTF-8
Java
false
false
614
java
package com.webify.shared.edi.model.hipaa837i; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.webify.shared.edi.model.hipaa837i.beans.BaseLoop2410; /* * BaseLoop2410 subclass, put any business logic in this class */ public class Loop2410 extends BaseLoop2410 { private static final Log log = LogFactory.getLog(Loop2410.class); /* * Uncomment this to hook into the input validation. This method is * called when an EDI file is parsed into a document. protected void validate(EDIInputStream eis) { super.validate(eis); } */ }
[ "mperham@gmail.com" ]
mperham@gmail.com
15f9129b5887826cf7b4ac9c18c545217d5a0b4e
302bc3bb0cb2e7aea93efddc3997c0f5cc4397d9
/src/main/java/com/anbang/p2p/cqrs/c/service/disruptor/DisruptorCmdServiceBase.java
a2bf794ff8ed2f7f56291fc7c0821aa33d172fb1
[]
no_license
hangzhouanbang/p2p_financial
72a763a881a4f1134f3c10554ec2143611875efa
765e48c1046d2c2599848321b161c506d6850310
refs/heads/master
2020-04-24T02:36:14.869924
2019-05-16T02:14:39
2019-05-16T02:14:39
171,642,676
0
0
null
null
null
null
UTF-8
Java
false
false
1,285
java
package com.anbang.p2p.cqrs.c.service.disruptor; import java.util.concurrent.Callable; import org.springframework.beans.factory.annotation.Autowired; import com.highto.framework.concurrent.DeferredResult; import com.highto.framework.ddd.CommonCommand; import com.highto.framework.disruptor.event.CommandEvent; import com.lmax.disruptor.dsl.Disruptor; public abstract class DisruptorCmdServiceBase { @Autowired protected DisruptorFactory disruptorFactory; protected <T> DeferredResult<T> publishEvent(Disruptor<CommandEvent> disruptor, CommonCommand cmd, Callable<T> callable) { DeferredResult<T> deferredResult = new DeferredResult<>(); disruptor.publishEvent((event, sequence) -> { event.setCmd(cmd); event.setHandler(() -> { T returnObj = null; try { returnObj = callable.call(); deferredResult.setResult(returnObj); } catch (Exception e) { e.printStackTrace(); deferredResult.setExceptionResult(e); } return null; }); }); // T result = getResult(deferredResult); return deferredResult; } // private <T> T getResult(DeferredResult<T> deferredResult) { // try { // return deferredResult.getResult(); // } catch (Exception e) { // return null; // } // } }
[ "林少聪 @PC-20180515PRDG" ]
林少聪 @PC-20180515PRDG
0a2b418986605e4ad222140c88d5b8bea249f4bd
43689621d00dadcb0f4bf767629fd1facff20f36
/vertx-lang-js-gen/src/test/java/io/vertx/test/lang/js/InheritedMethodsTest.java
153c191daeb1d89c0e5dc5678c230622b48e2f0b
[ "Apache-2.0" ]
permissive
vert-x3/vertx-lang-js
910ab1e0e345b1fedb5496f1b11acac6b2f765d1
cd3a3ed36f59a1db8ef8fb8230510cc6ab8238bd
refs/heads/3.9
2023-08-18T18:39:11.138946
2023-05-12T08:20:26
2023-05-12T08:20:26
21,415,560
40
30
Apache-2.0
2023-07-31T14:43:14
2014-07-02T07:40:15
JavaScript
UTF-8
Java
false
false
483
java
package io.vertx.test.lang.js; import org.junit.Test; public class InheritedMethodsTest extends JSTestBase { @Override protected String getTestFile() { return "inherited_methods_test.js"; } @Test public void testCallInheritedMethods() throws Exception { runTest(); } @Test public void testCallMethodOverloadingInheritedMethods() throws Exception { runTest(); } @Test public void testCallStaticMethods() throws Exception { runTest(); } }
[ "julien@julienviet.com" ]
julien@julienviet.com
dc360b4d7049adea1b8558315674170e50ca3fa8
c8ead390cdf760883d6e9720a7bf0608adcc92ab
/src/main/java/br/com/caelum/camel/RotaMovimentacoesHTML.java
2ec17209118716ea53aa501847645317b3ea1261
[]
no_license
gabrielsmartins/apache-camel
e8421c9a7c3673ff42c5ed16475c7e33bbf5d73e
371b367a48be6e5c2c39a1227770a98579d0a457
refs/heads/master
2020-04-09T05:26:42.100954
2018-12-02T16:08:36
2018-12-02T16:08:36
160,064,605
0
0
null
null
null
null
UTF-8
Java
false
false
1,327
java
package br.com.caelum.camel; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.DefaultCamelContext; public class RotaMovimentacoesHTML { public static void main(String[] args) throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("direct:entrada") .to("xslt:movimentacoes-para-html.xslt") .setHeader(Exchange.FILE_NAME, constant("movimentacoes.html")) .log("${body}") .to("file:saida"); } }); context.start(); ProducerTemplate producer = context.createProducerTemplate(); producer.sendBody("direct:entrada", "<movimentacoes>" + "<movimentacao><valor>2314.4</valor><data>11/12/2015</data><tipo>ENTRADA</tipo></movimentacao>" + "<movimentacao><valor>546.98</valor><data>11/12/2015</data><tipo>SAIDA</tipo></movimentacao>" + "<movimentacao><valor>314.1</valor><data>12/12/2015</data><tipo>SAIDA</tipo></movimentacao>" + "<movimentacao><valor>56.99</valor><data>13/12/2015</data><tipo>SAIDA</tipo></movimentacao>" + "</movimentacoes>"); Thread.sleep(20000); context.stop(); } }
[ "ga.smartins94@gmail.com" ]
ga.smartins94@gmail.com
37a72a6417dc4af80c37a3c368bd91c525802d93
13b00b2d96697790749400270b2a9fe08220c93b
/retail-web/retail-web-backstage/src/main/java/club/xyes/zkh/retail/web/backstage/controller/StatisticsController.java
026293e6cacfda7d642dc2c4f0f0d6e43e86810f
[]
no_license
coomia/retail-parent
16a492b358c1fad67b0c3387170c770e13c51ef2
1e4cb9ae769d5380395ac2da95f00d7010c96fa7
refs/heads/master
2020-08-03T14:24:36.140041
2019-09-30T03:31:17
2019-09-30T03:31:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,658
java
package club.xyes.zkh.retail.web.backstage.controller; import club.xyes.zkh.retail.commons.vo.GeneralResult; import club.xyes.zkh.retail.service.general.OrderService; import club.xyes.zkh.retail.service.general.UserService; import club.xyes.zkh.retail.web.commons.controller.AbstractController; import lombok.val; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.Map; /** * Create by 郭文梁 2019/7/26 10:18 * StatisticsController * 后台数据统计相关数据访问控制器 * * @author 郭文梁 * @data 2019/7/26 10:18 */ @RestController @RequestMapping("/api/statistics") public class StatisticsController extends AbstractController { private final OrderService orderService; private final UserService userService; public StatisticsController(OrderService orderService, UserService userService) { this.orderService = orderService; this.userService = userService; } /** * 概览统计信息 * * @return GR with data map */ @GetMapping("/overview") public GeneralResult<Map<String, Object>> overviewStatistics() { val res = new HashMap<String, Object>(16); orderStatistics(res); userStatistics(res); return GeneralResult.ok(res); } /** * 订单相关数据统计 * * @param context 上下文 */ private void orderStatistics(Map<String, Object> context) { val paidOrderCount = orderService.paidOrderCount(); val completeOrderCount = orderService.completeOrderCount(); val totalOrderCount = orderService.count(); val overviewPerDate = orderService.getOverviewPerDate(); val orderOverview = new HashMap<String, Object>(16); orderOverview.put("paidCount", paidOrderCount); orderOverview.put("completeCount", completeOrderCount); orderOverview.put("totalCount", totalOrderCount); orderOverview.put("overviewPerDate", overviewPerDate); context.put("order", orderOverview); } /** * 用户相关统计 * * @param context 上下文 */ private void userStatistics(Map<String, Object> context) { val totalCount = userService.count(); val overviewPerDate = userService.overviewPerDate(); val userOverview = new HashMap<String, Object>(16); userOverview.put("totalCount", totalCount); userOverview.put("overviewPerDate", overviewPerDate); context.put("user", userOverview); } }
[ "levent8421@outlook.com" ]
levent8421@outlook.com
4adb93af3a7db2ddaf9e14b342a387bcf5322ded
1153de40cf48076779039f1b29df45067b72397d
/vertx-samples/chat/src/main/java/org/atmosphere/vertx/samples/chat/ChatProtocol.java
0ab17ebe6790ae061e2538d23ca95d7efbc1b74e
[ "Apache-2.0" ]
permissive
seamusmac/atmosphere-samples
9b90a648cf148a8b3c59d9da7f8efd3535c16c3f
5faf36a6b98d90598b9289fe6b2c5313ab977bb5
refs/heads/master
2021-01-14T10:53:09.766108
2016-02-18T20:26:08
2016-02-18T20:26:08
24,748,345
0
1
null
null
null
null
UTF-8
Java
false
false
2,656
java
/* * Copyright 2014 Jeanfrancois Arcand * * 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.atmosphere.vertx.samples.chat; import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.List; import java.util.UUID; public class ChatProtocol implements JacksonEncoder.Encodable { private String message = ""; private String author = ""; private long time = System.currentTimeMillis(); private List<String> users = new ArrayList<String>(); private List<String> rooms = new ArrayList<String>(); private String uuid = UUID.randomUUID().toString(); public ChatProtocol() { this("", ""); } public ChatProtocol(String author, String message) { this.author = author; this.message = message; this.time = new Date().getTime(); } public ChatProtocol(String author, String message, Collection<String> users, Collection<String> rooms) { this(author, message); this.users.addAll(users); this.rooms.addAll(rooms); } public ChatProtocol(Collection<String> users, Collection<String> rooms) { this.users.addAll(users); this.rooms.addAll(rooms); } public String getMessage() { return message; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public void setMessage(String message) { this.message = message; } public long getTime() { return time; } public void setTime(long time) { this.time = time; } public List<String> getUsers() { return users; } public void setUsers(Collection<String> users) { this.users.addAll(users); } public void setUsers(List<String> users) { this.users = users; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public List<String> getRooms() { return rooms; } public void setRooms(List<String> rooms) { this.rooms = rooms; } }
[ "jfarcand@apache.org" ]
jfarcand@apache.org
e7faa5dfea77f3b08128d2cf956bf872d4dae383
81b0bb3cfb2e9501f53451e7f03ec072ee2b0e13
/src/com/google/android/gms/internal/zzfm$6$1.java
4f28a2f204b9d954ba07236ecf72bdb49a4c87bc
[]
no_license
reverseengineeringer/me.lyft.android
48bb85e8693ce4dab50185424d2ec51debf5c243
8c26caeeb54ffbde0711d3ce8b187480d84968ef
refs/heads/master
2021-01-19T02:32:03.752176
2016-07-19T16:30:00
2016-07-19T16:30:00
63,710,356
3
0
null
null
null
null
UTF-8
Java
false
false
494
java
package com.google.android.gms.internal; import android.os.RemoteException; import com.google.android.gms.ads.internal.reward.client.zzd; class zzfm$6$1 implements zzfm.zza { zzfm$6$1(zzfm.6 param6) {} public void zzb(zzfn paramzzfn) throws RemoteException { if (zzbkp != null) { zzbkp.onRewardedVideoAdLoaded(); } } } /* Location: * Qualified Name: com.google.android.gms.internal.zzfm.6.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
4d8313b70d19bfa0c54189879c913413b9f21a47
6a7e623b589e2b2b4903cecac796e0641d452a81
/asn4j-runtime/src/main/java/ch/eskaton/asn4j/runtime/utils/ToString.java
8222113de07ef2a41d510351626482b4d872a344
[]
no_license
eskaton/asn4j
516d43f571d2863a49462d39548a2b63ea6d2278
024d3f6fdf7b220388b58a31519d931fbd269e99
refs/heads/master
2021-09-25T09:40:20.936540
2021-09-16T22:33:21
2021-09-16T22:33:21
49,749,392
0
0
null
2021-04-27T21:23:10
2016-01-15T22:53:00
Java
UTF-8
Java
false
false
5,522
java
/* * Copyright (c) 2015, Adrian Moser * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the author nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL AUTHOR BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package ch.eskaton.asn4j.runtime.utils; import ch.eskaton.commons.collections.Tuple2; import ch.eskaton.commons.utils.ReflectionUtils; import java.util.LinkedList; import java.util.List; import java.util.Objects; import java.util.Set; import java.util.Stack; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import static ch.eskaton.commons.utils.CollectionUtils.asHashSet; public class ToString { private static ThreadLocal<Stack<Object>> visited = new ThreadLocal<>(); private ToString() { } public static String get(Object object) { try { String properties = buildPropertiesString(ReflectionUtils.getProperties(object).stream()); return buildString(object, properties); } catch (IllegalAccessException e) { return object.getClass().getSimpleName(); } } public static String get(Object object, String... fields) { Set<String> fieldSet = asHashSet(fields); try { String properties = buildPropertiesString(ReflectionUtils.getProperties(object).stream() .filter(property -> fieldSet.contains(property.get_1()))); return buildString(object, properties); } catch (IllegalAccessException e) { return object.getClass().getSimpleName(); } } public static String getExcept(Object object, String... fields) { Set<String> fieldSet = asHashSet(fields); try { String properties = buildPropertiesString(ReflectionUtils.getProperties(object).stream() .filter(property -> !fieldSet.contains(property.get_1()))); return buildString(object, properties); } catch (IllegalAccessException e) { return object.getClass().getSimpleName(); } } private static String buildString(Object object, String properties) { return object.getClass().getSimpleName() + '[' + properties + ']'; } private static String buildPropertiesString(Stream<Tuple2<String, Object>> stream) { return stream.filter(property -> Objects.nonNull(property.get_2())) .map(tuple -> tuple.get_1() + "=" + getValue(tuple.get_2())) .collect(Collectors.joining(", ")); } private static String getValue(Object object) { var stack = visited.get(); if (stack == null) { stack = new Stack<>(); visited.set(stack); } if (stack.contains(object)) { return "..."; } stack.push(object); try { return object.toString(); } finally { stack.pop(); if (stack.isEmpty()) { visited.remove(); } } } public static Builder builder(Object object) { return new Builder(object); } public static class Builder { private Object object; private List<Tuple2<String, Object>> properties = new LinkedList<>(); public Builder(Object object) { this.object = object; } public Builder add(String name, Object value) { properties.add(Tuple2.of(name, value)); return this; } public Builder addAll() { try { properties.addAll(ReflectionUtils.getProperties(object)); } catch (IllegalAccessException ignore) { // empty } return this; } public Builder map(String name, Function<Object, String> mapper) { properties.stream() .filter(property -> name.equals(property.get_1())) .forEach(property -> property.set_2(mapper.apply(property.get_2()))); return this; } public String build() { return buildString(object, buildPropertiesString(properties.stream())); } } }
[ "me@eskaton.ch" ]
me@eskaton.ch
ad17bda3445fb476cba14165dacd96254a9883ea
029cd79b19ffaea87aa55fde74b890008e5c4bfe
/sales_management/src/test/java/com/bankwithmint/data/repository/CustomerRepositoryTest.java
d9a03238aafac78e6ecd713dc59ad7c107d32f12
[]
no_license
tboydv1/kafka-order-reporting
89e355f16417b6f99215fb552df5d16aa0c25ccd
60b6611ba49a9af152e01b718c1d41f634f8702d
refs/heads/main
2023-06-24T23:52:27.631592
2021-07-15T05:10:27
2021-07-15T05:10:27
386,099,883
2
0
null
null
null
null
UTF-8
Java
false
false
460
java
package com.bankwithmint.data.repository; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeEach; import org.springframework.boot.test.context.SpringBootTest; import static org.junit.jupiter.api.Assertions.*; /** * @author oluwatobi * @version 1.0 * @date on 12/07/2021 * inside the package - com.bankwithmint.sales.data.repository */ @SpringBootTest @Slf4j class CustomerRepositoryTest { @BeforeEach void setUp() { } }
[ "tboydv1@gmail.com" ]
tboydv1@gmail.com
f5a3df165a62c891ccf4bfdbf558e06cb1726684
58f9ed107e610a612af459d8231fbe97dd0c814f
/src/main/java/com/ht/extra/dao/PmiMergedLogMapper.java
812a598915b30c69544048e03d266fac87d5383c
[]
no_license
tangguoqiang/htwebExtra
3bee6434a87e9333d80eeb391f80dfb72178675d
ca9d50a66586905d5164f6087b7778f233a1fd13
refs/heads/master
2020-03-15T13:13:57.645083
2018-08-22T12:54:44
2018-08-22T12:54:44
132,161,700
0
0
null
null
null
null
UTF-8
Java
false
false
464
java
package com.ht.extra.dao; import com.ht.extra.pojo.medrec.PmiMergedLog; import com.ht.extra.pojo.medrec.PmiMergedLogKey; public interface PmiMergedLogMapper { int deleteByPrimaryKey(PmiMergedLogKey key); int insert(PmiMergedLog record); int insertSelective(PmiMergedLog record); PmiMergedLog selectByPrimaryKey(PmiMergedLogKey key); int updateByPrimaryKeySelective(PmiMergedLog record); int updateByPrimaryKey(PmiMergedLog record); }
[ "ttang11@its.jnj.com" ]
ttang11@its.jnj.com
2e64394a7d7793b11c01f8c3e1fcf286ac70a526
b4da4982b8158d0f9d5080719738085d9c69aeae
/src/test/java/org/assertj/core/api/iterable/Iterable_generics_with_varargs_Test.java
45027762a5a8d4ea75bf5895d0583f465b4daf46
[ "Apache-2.0" ]
permissive
ssmyth2/assertj-core
1c3158e6b5ffcc8df776b6877b7e4b090835bec9
83bb09124bc920285139ec7c395e86a6397b5efb
refs/heads/master
2020-04-21T23:07:14.086877
2019-02-07T06:31:18
2019-02-10T03:03:28
169,935,602
0
0
NOASSERTION
2019-02-10T02:28:33
2019-02-10T02:28:32
null
UTF-8
Java
false
false
2,106
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * Copyright 2012-2018 the original author or authors. */ package org.assertj.core.api.iterable; import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.tuple; import java.util.List; import java.util.function.Function; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** * @author Johannes Schneider (<a href="mailto:js@cedarsoft.com">js@cedarsoft.com</a>) */ public class Iterable_generics_with_varargs_Test { @SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testWithoutGenerics() { List strings = asList("a", "b", "c"); assertThat(strings).contains("a", "b"); } @Test public void testConcreteType() { List<String> strings = asList("a", "b", "c"); assertThat(strings).contains("a", "b"); } @Test @Disabled public void testListAssertWithGenerics() { // List<? extends String> strings = asList("a", "b", "c"); // does not compile as Java 8 is stricter with generics ... // assertThat(strings).contains("a", "b"); } @Test public void testListAssertWithGenericsAndExtracting() { List<? extends String> strings = asList("a", "b", "c"); Function<? super String, String> doubleFunction = new Function<String, String>() { @Override public String apply(String s) { return s + s; } }; assertThat(strings) .extracting(doubleFunction, doubleFunction) .contains( tuple("aa", "aa"), tuple("bb", "bb") ); } }
[ "joel.costigliola@gmail.com" ]
joel.costigliola@gmail.com
93524be6556123d65a1d243beb469c92f0789a5a
5a474257353b9bbf88c30688fab17a618b154c22
/snHose-Server/src/main/java/net/minecraft/server/BlockWood.java
ae87fa6c89d6679b2b1dae1c9f2919319b40de38
[]
no_license
RealKezuk/snHose
7e5424cd3edbf99bb6a586b9592943b11cd9d549
8c89453218621426f394fae44625f97b2a57840c
refs/heads/master
2020-07-22T14:24:17.936438
2019-09-09T03:39:21
2019-09-09T03:39:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
package net.minecraft.server.v1_7_R4; public class BlockWood extends Block { public static final String[] a; public BlockWood() { super(Material.WOOD); this.a(CreativeModeTab.b); } @Override public int getDropData(final int n) { return n; } static { a = new String[] { "oak", "spruce", "birch", "jungle", "acacia", "big_oak" }; } }
[ "sathonaypro@gmail.com" ]
sathonaypro@gmail.com
f2327c77fd22f4a04406d4e41d719c341da8b902
3623990f9cbb8b996dce1ff0c5d6b763766b821c
/common/app/common/utils/UrlUtils.java
8db261b6928442efce5d9ae0c8de3ee2e4d2b49b
[ "Apache-2.0" ]
permissive
gavioto/commercetools-sunrise-java
5769b4175e06270b3e2f763785f5681d0ea24ecb
3687c4a7caa81f5e392e511160f3af7b98aad387
refs/heads/master
2021-01-21T07:53:31.344650
2016-03-04T10:19:11
2016-03-04T10:19:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,023
java
package common.utils; import java.util.List; import java.util.Map; import java.util.stream.Stream; import static java.util.stream.Collectors.joining; public final class UrlUtils { private UrlUtils() { } public static String buildUrl(final String path, final Map<String, List<String>> queryString) { return buildUrl(path, buildQueryString(queryString)); } public static String buildUrl(final String path, final String queryString) { return path + (queryString.isEmpty() ? "" : "?" + queryString); } public static String buildQueryString(final Map<String, List<String>> queryString) { return queryString.entrySet().stream() .map(parameter -> buildQueryStringOfParameter(parameter.getKey(), parameter.getValue())) .collect(joining("&")); } private static String buildQueryStringOfParameter(final String key, final List<String> values) { return values.stream().collect(joining("&" + key + "=", key + "=", "")); } }
[ "laura.luiz@commercetools.de" ]
laura.luiz@commercetools.de
57f936be2525cce3c77ad9738ece96a24805c7fb
3110623cedd6c09a1584f65401b8461f43bce1e7
/app/src/main/java/com/yiluote/yiluote_v2/UserTieziActivity.java
0a0b98c8d7c9b8e83a6a3898bdd3f37fb161c911
[]
no_license
drduan/Yiluote_v2
34f93888d311186e780a668c16ba488febfa4b83
77e1dea8525e8c6095954a0ab917d30af2ebac6b
refs/heads/master
2021-01-10T12:28:00.621792
2015-12-17T04:04:11
2015-12-17T04:04:11
48,151,339
1
0
null
2018-08-20T07:37:40
2015-12-17T03:59:28
Java
UTF-8
Java
false
false
3,471
java
package com.yiluote.yiluote_v2; import com.yiluote.fragment.UserTieziGridFragment; import com.yiluote.fragment.UserTieziListFragment; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentTransaction; import android.view.View.OnClickListener; import android.widget.ImageView; import android.widget.LinearLayout; public class UserTieziActivity extends FragmentActivity implements OnClickListener { private Intent intent; private LinearLayout back; private ImageView gridview; private ImageView listview; private UserTieziGridFragment gridfragment; private UserTieziListFragment listfragment; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user_tiezi); this.back = (LinearLayout) super.findViewById(R.id.title_back); this.gridview = (ImageView) super.findViewById(R.id.grid_on); this.listview = (ImageView) super.findViewById(R.id.list_off); this.back = (LinearLayout) findViewById(R.id.title_back); this.gridview.setOnClickListener(this); this.listview.setOnClickListener(this); back.setOnClickListener(this); initFragment(); } public void initFragment() { if (gridfragment == null) { gridfragment = new UserTieziGridFragment(); addFragment(gridfragment); showFragment(gridfragment); } else { showFragment(gridfragment); } gridview.setImageResource(R.drawable.user_tiezi_show1); } public void addFragment(Fragment fragment) { FragmentTransaction ft = this.getSupportFragmentManager() .beginTransaction(); ft.add(R.id.fragment, fragment); ft.commit(); } /** 删除Fragment **/ public void removeFragment(Fragment fragment) { FragmentTransaction ft = this.getSupportFragmentManager() .beginTransaction(); ft.remove(fragment); ft.commit(); } /** 显示Fragment **/ public void showFragment(Fragment fragment) { FragmentTransaction ft = getSupportFragmentManager() .beginTransaction(); // 判断页面是否已经创建,如果已经创建,那么就隐藏掉 if (gridfragment != null) { ft.hide(gridfragment); } if (listfragment != null) { ft.hide(listfragment); } ft.show(fragment); ft.commitAllowingStateLoss(); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.grid_on: if (gridfragment == null) { gridfragment = new UserTieziGridFragment(); addFragment(gridfragment); showFragment(gridfragment); } else { if (gridfragment.isHidden()) { showFragment(gridfragment); } } gridview.setImageResource(R.drawable.user_tiezi_show1); listview.setImageResource(R.drawable.user_tiezi_show2_gray); break; case R.id.list_off: if (listfragment == null) { listfragment = new UserTieziListFragment(); addFragment(listfragment); showFragment(listfragment); } else { if (listfragment.isHidden()) { showFragment(listfragment); } } gridview.setImageResource(R.drawable.user_tiezi_show1_gray); listview.setImageResource(R.drawable.user_tiezi_show2); break; case R.id.title_back: intent = new Intent(); intent.setClass(UserTieziActivity.this, UserActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent); finish(); } } }
[ "drduan@vip.qq.com" ]
drduan@vip.qq.com
efc484dd38fcb8b9c89bc01a71ca78366fb0860b
5979994b215fabe125cd756559ef2166c7df7519
/aimir-mdms-iesco/src/main/java/com/oracle/xmlns/ssys/nurieventsproxy/nurieventsproxy/NuriEventsServerOld.java
f624364fce661108dcaa4d00dbe06259521b795d
[]
no_license
TechTinkerer42/Haiti
91c45cb1b784c9afc61bf60d43e1d5623aeba888
debaea96056d1d4611b79bd846af8f7484b93e6e
refs/heads/master
2023-04-28T23:39:43.176592
2021-05-03T10:49:42
2021-05-03T10:49:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,517
java
package com.oracle.xmlns.ssys.nurieventsproxy.nurieventsproxy; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.GregorianCalendar; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; import org.apache.catalina.Context; import org.apache.catalina.Wrapper; import org.apache.catalina.startup.Tomcat; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.cxf.Bus; import org.apache.cxf.transport.servlet.CXFNonSpringServlet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.aimir.fep.util.DataUtil; import ch.iec.tc57._2011.enddeviceevents.EndDeviceEvent; import ch.iec.tc57._2011.enddeviceevents.EndDeviceEventDetail; import ch.iec.tc57._2011.enddeviceeventsmessage.EndDeviceEventsEventMessageType; import ch.iec.tc57._2011.enddeviceeventsmessage.EndDeviceEventsPayloadType; import ch.iec.tc57._2011.schema.message.HeaderType; @Service(value = "nuriEventsServer") public class NuriEventsServerOld implements ExecutePtt { private static Log log = LogFactory.getLog(NuriEventsServerOld.class); @Autowired private JdbcTemplate jdbcTemplate; @Override @Transactional("transactionManager") public XMLGregorianCalendar execute(EndDeviceEventsEventMessageType part1) { log.debug(part1); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); String sql = "insert into ip_ev_receive(TS,MRID,ASSETMRID,CREATEDDATETIME,SEVERITY, \n" + " ISSUREID, EVENTDETAIL) values(?,?,?,?,?,?,?) "; String ts = null; HeaderType header = part1.getHeader(); if (header != null) { ts = sdf.format( header.getTimestamp().toGregorianCalendar().getTime()); } EndDeviceEventsPayloadType payload = part1.getPayload(); if (payload != null && payload.getEndDeviceEvents() != null && payload.getEndDeviceEvents().getEndDeviceEvent() != null && payload.getEndDeviceEvents().getEndDeviceEvent() .size() > 0) { String MRID = ""; String ASSETMRID = ""; String CREATEDDATETIME = ""; String SEVERITY = ""; String ISSUREID = ""; String EVENTDETAIL = ""; for(EndDeviceEvent event : payload.getEndDeviceEvents().getEndDeviceEvent()) { CREATEDDATETIME = sdf.format(event.getCreatedDateTime().toGregorianCalendar().getTime()); SEVERITY = event.getSeverity(); ISSUREID = event.getIssuerID(); MRID = event.getMRID(); ASSETMRID = event.getAssets().getMRID(); if (event.getEndDeviceEventDetails() != null && event.getEndDeviceEventDetails().size() > 0) { StringBuilder sb = new StringBuilder(); sb.append("{ "); for(int i = 0 ; i< event.getEndDeviceEventDetails().size();i++) { EndDeviceEventDetail ed = event.getEndDeviceEventDetails().get(i); sb.append(ed.getName()).append(" : '").append(ed.getValue()).append("' "); if(i != event.getEndDeviceEventDetails().size() -1) { sb.append(", "); } } sb.append(" }"); EVENTDETAIL = sb.toString(); } jdbcTemplate.update(sql, new Object[] { ts, MRID, ASSETMRID, CREATEDDATETIME, SEVERITY, ISSUREID, EVENTDETAIL }); } } GregorianCalendar cal = new GregorianCalendar(); cal.setTime(new Date()); XMLGregorianCalendar date = null; try { date = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal); } catch (DatatypeConfigurationException e) { e.printStackTrace(); } return date; } public void init() { log.info("NuriEvent MultiSpeak SERVICE is Ready for Service...\n"); } public static void main( String[] args ) { try { String servicePort = null; String configFile = null; if (args.length < 3 ) { log.info("Usage:"); log.info("NuriEventsServer -port CommunicationPort -config /config/spring-ev-integration-ws-test.xml"); return; } for (int i=0; i < args.length; i+=2) { String nextArg = args[i]; if (nextArg.startsWith("-port")) { servicePort = new String(args[i+1]); } if (nextArg.startsWith("-configFile")) { configFile = new String(args[i+1]); } } log.info("Event SERVICE START=SERVICE PORT["+servicePort+"]"); ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[]{configFile}); DataUtil.setApplicationContext(applicationContext); Tomcat tomcat = new Tomcat(); tomcat.setPort(Integer.parseInt(servicePort)); Context context = tomcat.addContext("", ""); Wrapper servletWrap = context.createWrapper(); servletWrap.setName("cxf"); CXFNonSpringServlet servlet = new CXFNonSpringServlet(); // Wire the bus that endpoint uses with the Servlet servlet.setBus((Bus)applicationContext.getBean("cxf")); servletWrap.setServlet(servlet); servletWrap.setLoadOnStartup(1); context.addChild(servletWrap); context.addServletMapping("/services/*", "cxf"); File webapps = new File(context.getCatalinaBase().getAbsolutePath() + File.separator + "webapps"); if (!webapps.exists()) webapps.mkdir(); tomcat.start(); tomcat.getServer().await(); } catch (Exception e) { log.error(e, e); } } }
[ "marsr0913@nuritelecom.com" ]
marsr0913@nuritelecom.com
db46a2c9d858027c1c8613aa899c81816db6a187
f8e503a715f1dd890b0409716d6ca8f2f6962e76
/src/main/java/com/my/blog/website/crawler/ocr/OCR.java
af114f055bdaf33c673add593b7cb5b05d1da6c6
[ "Apache-2.0" ]
permissive
hackpros/My-Blog
0377debf04fd70392e46a056961b35ef86c8b74d
d44ee3b49921ba810766affe0f1d5bfaa36e61a6
refs/heads/master
2022-08-31T18:52:36.234923
2020-05-21T03:38:01
2020-05-21T03:38:01
125,001,022
1
0
null
2018-03-13T06:08:16
2018-03-13T06:08:16
null
UTF-8
Java
false
false
3,075
java
package com.my.blog.website.crawler.ocr; import java.io.*; import java.util.ArrayList; import java.util.List; import java.util.Properties; public class OCR { private final String LANG_OPTION = "-l"; // 英文字母小写l,并非数字1 private final String EOL = System.getProperty("line.separator"); private String tessPath = "D://Tesseract-OCR";//Tesseract安装路径 public String recognizeText(File imageFile, String imageFormat) throws Exception { File tempImage = ImageIOHelper.createImage(imageFile, imageFormat); File outputFile = new File(imageFile.getParentFile(), "output"); StringBuffer strB = new StringBuffer(); List<String> cmd = new ArrayList<String>(); if (isOSLinux()) { cmd.add("tesseract"); } else { cmd.add(tessPath + "//tesseract"); } cmd.add(""); cmd.add(outputFile.getName()); ProcessBuilder pb = new ProcessBuilder(); pb.directory(imageFile.getParentFile()); cmd.set(1, tempImage.getName()); pb.command(cmd); pb.redirectErrorStream(true); Process process = pb.start(); int w = process.waitFor(); // 删除临时正在工作文件 tempImage.delete(); if (w == 0) { BufferedReader in = new BufferedReader(new InputStreamReader( new FileInputStream(outputFile.getAbsolutePath() + ".txt"), "UTF-8")); String str; while ((str = in.readLine()) != null) { strB.append(str).append(EOL); } in.close(); } else { String msg; switch (w) { case 1: msg = "Errors accessing files.There may be spaces in your image's filename."; break; case 29: msg = "Cannot recongnize the image or its selected region."; break; case 31: msg = "Unsupported image format."; break; default: msg = "Errors occurred."; } tempImage.delete(); } new File(outputFile.getAbsolutePath() + ".txt").delete(); return strB.toString(); } public static boolean isOSLinux() { Properties prop = System.getProperties(); String os = prop.getProperty("os.name"); if (os != null && os.toLowerCase().indexOf("linux") > -1) { return true; } else { return false; } } public static void main(String[] args) { String valCode = null; String path = "D:\\captcha\\yha68rf2bnwgz7v5k4cxe90s3iqtpduom.png"; try { valCode = new OCR().recognizeText(new File(path), "png"); System.out.println("验证码为:" + valCode); } catch (IOException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } }
[ "fans_2046@126.com" ]
fans_2046@126.com
26108dbbfe865d2dbf7bb1ec7e4e37de2c2738a7
5ed4aeb318685ae964f305452826be3fa61d88e8
/src/com/board/mini/controller/UserController.java
406e941b953c159902a26f2adf97da484faec2db
[]
no_license
ChoeSH/mini-board
638f4ed687b9399395794e2845d6ec0f44e2abff
bce50e5d1ebab7436cf0cb88c28f68d44bd36d38
refs/heads/master
2020-08-30T02:48:22.346702
2019-11-01T00:46:54
2019-11-01T00:46:54
218,239,319
0
0
null
null
null
null
UTF-8
Java
false
false
1,913
java
package com.board.mini.controller; import java.io.IOException; import java.util.Map; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.board.mini.service.UserService; public class UserController extends HttpServlet { private static final long serialVersionUID = 1L; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.getWriter().append("Served at: ").append(request.getContextPath()); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("utf-8"); String uiName=request.getParameter("uiName"); String uiId=request.getParameter("uiId"); String uiPwd=request.getParameter("uiPwd"); UserService us = new UserService(); String uri= request.getRequestURI(); uri=uri.substring(6); String url = "/views/user/login"; String msg="아이디, 비밀번호를 확인해주세요"; if("login".equals(uri)) { Map<String,Object> user = us.doLogin(uiId, uiPwd); if(user!=null) { HttpSession hs = request.getSession(); hs.setAttribute("user", user); url = "/views/index"; msg = user.get("uiName")+"님 환영합니다"; } }else if("signup".equals(uri)) { Map<String,Object> rMap = us.doSignup(uiName,uiId, uiPwd); if(rMap!=null) { url=(String)rMap.get("url"); msg=(String)rMap.get("msg"); }else { url="/views/user/signup"; msg="뭔가 잘못되었다"; } } request.setAttribute("msg", msg); RequestDispatcher rd = request.getRequestDispatcher(url); rd.forward(request, response); } }
[ "Administrator@koitt03a-PC" ]
Administrator@koitt03a-PC
b16187f5118e1396237dabbfa1f07205fd2ccf39
59a28030b9bbfce8b6c7ad51a9e5cbb7aadc36b9
/QdmKnimeTranslator/src/main/java/edu/phema/jaxb/ihe/svs/SubcutaneousRoute.java
9d6ab1a7d3621de5da19dd0ba7303a7ac33d51ca
[]
no_license
PheMA/qdm-knime
c3970566c7fe529eefe94a9311d7beeed6d39dc8
fb3e2925a6cd15ebba83ba5fc95bb604a54ff564
refs/heads/master
2020-12-24T14:27:42.708153
2016-05-25T21:42:57
2016-05-25T21:42:57
29,319,651
1
0
null
null
null
null
UTF-8
Java
false
false
1,202
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.12.15 at 03:09:44 PM CST // package edu.phema.jaxb.ihe.svs; import javax.xml.bind.annotation.XmlEnum; /** * <p>Java class for SubcutaneousRoute. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="SubcutaneousRoute"> * &lt;restriction base="{urn:ihe:iti:svs:2008}cs"> * &lt;enumeration value="SQIMPLNT"/> * &lt;enumeration value="SQINFUS"/> * &lt;enumeration value="IPUMPINJ"/> * &lt;enumeration value="SQ"/> * &lt;enumeration value="SQSURGINS"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlEnum public enum SubcutaneousRoute { SQIMPLNT, SQINFUS, IPUMPINJ, SQ, SQSURGINS; public String value() { return name(); } public static SubcutaneousRoute fromValue(String v) { return valueOf(v); } }
[ "thompsow@r1001-lt-100-f.enhnet.org" ]
thompsow@r1001-lt-100-f.enhnet.org
0b8bf27d47f5af3275d1f3441cb428e8e0c8cc75
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/no_seeding/79_twfbplayer-de.outstare.fortbattleplayer.statistics.Counter-1.0-8/de/outstare/fortbattleplayer/statistics/Counter_ESTest_scaffolding.java
73dd224ad3c4a9839add797be7b59391047112c3
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Oct 28 22:08:17 GMT 2019 */ package de.outstare.fortbattleplayer.statistics; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class Counter_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
0df238f8f7206d4086d6cb6454e44fcb67f7e0f8
2eddd124dea3e76fbdf5f1318ec67f16f9d36f89
/app/src/main/java/com/example/administrator/newsdf/activity/work/PushAdapter/PushAdapter.java
b20013c0bb73d9023399e051208620c810a94a3d
[]
no_license
winelx/newsdf
ffe86b73598229d9b4f7239a4f6a92381f9baab3
a1c0eaffb69013e6707ca9647fe842a4e7bde602
refs/heads/master
2021-01-25T12:49:34.687706
2018-03-02T01:47:25
2018-03-02T01:47:25
111,790,845
0
0
null
null
null
null
UTF-8
Java
false
false
1,083
java
package com.example.administrator.newsdf.activity.work.PushAdapter; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import java.util.ArrayList; /** * 作者:winelx * 时间:2017/12/2 0002:下午 16:49 * 说明: */ public class PushAdapter extends FragmentPagerAdapter { public static ArrayList<String> mData; public static String Content; public PushAdapter(FragmentManager fm, ArrayList<String> mData) { super(fm); this.mData = mData; } @Override public Fragment getItem(int arg0) { PushFrgment fragment = new PushFrgment(arg0); return fragment; } @Override public int getCount() { return mData.size(); } @Override public CharSequence getPageTitle(int position) { return mData.get(position); } public void getID(String Content) { this.Content = Content; } @Override public int getItemPosition(Object object) { return POSITION_NONE; } }
[ "1094290855@qq.com" ]
1094290855@qq.com
4610454e3eebc96f230c717aabbe1e658d4a798a
b8743f5f3d3c8754eba595d3c9a8a4de8259b68a
/bitcamp-java-application2-server/v32_11/src/main/java/com/eomcs/lms/dao/BoardSerialDao.java
f633e9d66f8384cf88621bfd14c4909be4f230d7
[]
no_license
ryong890314/bitcamp-java-20190527
bb68333bca72e5acc6268ff1ec31f8f22ee3529d
a55614799700fd2ee99d8e2070562a2a4680826f
refs/heads/master
2020-06-13T20:14:36.797757
2020-04-20T06:59:10
2020-04-20T06:59:10
194,775,345
0
0
null
2020-04-30T11:48:02
2019-07-02T02:41:02
Java
UTF-8
Java
false
false
2,423
java
package com.eomcs.lms.dao; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.ArrayList; import java.util.List; import com.eomcs.lms.domain.Board; public class BoardSerialDao { ArrayList<Board> list = new ArrayList<>(); File file; public BoardSerialDao(String file) throws ClassNotFoundException { this.file = new File(file); try { loadData(); } catch (IOException e) { System.out.println("게시물 데이터 로딩 중 오류 발생!"); } } @SuppressWarnings("unchecked") private void loadData() throws IOException, ClassNotFoundException { File file = new File("./board.ser"); try (ObjectInputStream in = new ObjectInputStream(new FileInputStream(file))) { list = (ArrayList<Board>) in.readObject(); System.out.println("게시물 데이터 로드 완료!"); } } public void saveData() { // file의 정보를 준비 File file = new File("./board.ser"); try ( ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file))){ out.writeObject(list); System.out.println("게시물 데이터 저장 완료!"); } catch (FileNotFoundException e) { System.out.println("파일을 생성할 수 없습니다.(board)"); } catch (IOException e) { System.out.println("파일에 데이터를 출력하는 중에 오류 발생!"); e.printStackTrace(); } } public int insert(Board board) throws Exception { list.add(board); return 1; } public List<Board> findAll() throws Exception { return list; } public Board findBy(int no) throws Exception { int index = indexOf(no); if (index == -1) return null; return list.get(index); } public int update(Board board) throws Exception { int index = indexOf(board.getNo()); if (index == -1) return 0; list.set(index, board); return 1; } public int delete(int no) throws Exception { int index = indexOf(no); if (index == -1) return 0; list.remove(index); return 1; } private int indexOf(int no) { int i = 0; for (Board obj : list) { if (obj.getNo() == no) { return i; } i++; } return -1; } }
[ "syamsyalla@naver.com" ]
syamsyalla@naver.com
3d9e533c9b38477400f338514fab5d601fbe77fb
5d6d2e6ab733a9dd8913f44232ce53e01e5c99e7
/rt-gateway-impl-ctp/src/main/java/xyz/redtorch/gateway/ctp/x64v6v3v16v/api/CThostFtdcEWarrantOffsetField.java
580a51714a3622c61aab7f38a5e239bdbe26bd5a
[ "MIT" ]
permissive
fj8542758/redtorch
53953366e5303538397c3c64ee4de03adbed1475
216446e883598f247044070e9c478bf2b7e01a83
refs/heads/master
2021-05-18T09:51:21.279710
2020-06-06T10:23:32
2020-06-06T10:23:32
251,198,412
0
0
MIT
2020-03-30T04:09:16
2020-03-30T04:09:16
null
UTF-8
Java
false
false
3,692
java
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 4.0.0 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package xyz.redtorch.gateway.ctp.x64v6v3v16v.api; public class CThostFtdcEWarrantOffsetField { private transient long swigCPtr; protected transient boolean swigCMemOwn; protected CThostFtdcEWarrantOffsetField(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected static long getCPtr(CThostFtdcEWarrantOffsetField obj) { return (obj == null) ? 0 : obj.swigCPtr; } @SuppressWarnings("deprecation") protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; jctpv6v3v16x64apiJNI.delete_CThostFtdcEWarrantOffsetField(swigCPtr); } swigCPtr = 0; } } public void setTradingDay(String value) { jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_TradingDay_set(swigCPtr, this, value); } public String getTradingDay() { return jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_TradingDay_get(swigCPtr, this); } public void setBrokerID(String value) { jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_BrokerID_set(swigCPtr, this, value); } public String getBrokerID() { return jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_BrokerID_get(swigCPtr, this); } public void setInvestorID(String value) { jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_InvestorID_set(swigCPtr, this, value); } public String getInvestorID() { return jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_InvestorID_get(swigCPtr, this); } public void setExchangeID(String value) { jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_ExchangeID_set(swigCPtr, this, value); } public String getExchangeID() { return jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_ExchangeID_get(swigCPtr, this); } public void setInstrumentID(String value) { jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_InstrumentID_set(swigCPtr, this, value); } public String getInstrumentID() { return jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_InstrumentID_get(swigCPtr, this); } public void setDirection(char value) { jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_Direction_set(swigCPtr, this, value); } public char getDirection() { return jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_Direction_get(swigCPtr, this); } public void setHedgeFlag(char value) { jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_HedgeFlag_set(swigCPtr, this, value); } public char getHedgeFlag() { return jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_HedgeFlag_get(swigCPtr, this); } public void setVolume(int value) { jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_Volume_set(swigCPtr, this, value); } public int getVolume() { return jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_Volume_get(swigCPtr, this); } public void setInvestUnitID(String value) { jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_InvestUnitID_set(swigCPtr, this, value); } public String getInvestUnitID() { return jctpv6v3v16x64apiJNI.CThostFtdcEWarrantOffsetField_InvestUnitID_get(swigCPtr, this); } public CThostFtdcEWarrantOffsetField() { this(jctpv6v3v16x64apiJNI.new_CThostFtdcEWarrantOffsetField(), true); } }
[ "sun0x00@gmail.com" ]
sun0x00@gmail.com
42e44916a13c2113f44472a37654aa31d064d71f
8b63633abc440b921dd8074ceb4957b18326da8f
/benchmarks/Bess/bessy1/Eq/oldV.java
97975a43078af9eec311c80138b003c5e1db72c6
[ "MIT" ]
permissive
dah-fari7009/ARDiff_Equiv_Checking
bce8b9943dfdc23f10b0868ffbe8d2b6591d00a4
0f9a79925c30ca7c6f30edb5976076d8731495fd
refs/heads/master
2022-12-22T17:09:54.859543
2020-09-12T07:34:58
2020-09-12T07:34:58
292,966,062
0
0
null
2020-09-04T23:32:43
2020-09-04T23:32:42
null
UTF-8
Java
false
false
2,048
java
package demo.benchmarks.Bess.bessy1.Eq; public class oldV { public static double snippet (double x) { double z = 0; double xx = 0; double y = 0; double ans = 0; double ans1 = 0; double ans2 = 0; if (x < 8.0) { if(x!=0){ y=x*x; ans1=x*(-0.4900604943e13+y*(0.1275274390e13 +y*(-0.5153438139e11+y*(0.7349264551e9 +y*(-0.4237922726e7+y*0.8511937935e4))))); ans2=0.2499580570e14+y*(0.4244419664e12 +y*(0.3733650367e10+y*(0.2245904002e8 +y*(0.1020426050e6+y*(0.3549632885e3+y))))); ans=(ans1/ans2)+0.636619772*(bessj1(x)*Math.log(x)-(1.0/x)); } } else { z=8.0/x; y=z*z; xx=x-2.356194491; ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4 +y*(0.2457520174e-5+y*(-0.240337019e-6)))); ans2=0.04687499995+y*(-0.2002690873e-3 +y*(0.8449199096e-5+y*(-0.88228987e-6 +y*0.105787412e-6))); ans=Math.sqrt(0.636619772/x)*(Math.sin(xx)*ans1+z*Math.cos(xx)*ans2); } return ans; } private static double bessj1(double x){ double ax,z,xx,y,ans,ans1,ans2; if ((ax=Math.abs(x)) < 8.0) { y=x*x; ans1=x*(72362614232.0+y*(-7895059235.0+y*(242396853.1 +y*(-2972611.439+y*(15704.48260+y*(-30.16036606)))))); ans2=144725228442.0+y*(2300535178.0+y*(18583304.74 +y*(99447.43394+y*(376.9991397+y*1.0)))); ans=ans1/ans2; } else { z=8.0/ax; y=z*z; xx=ax-2.356194491; ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4 +y*(0.2457520174e-5+y*(-0.240337019e-6)))); ans2=0.04687499995+y*(-0.2002690873e-3 +y*(0.8449199096e-5+y*(-0.88228987e-6 +y*0.105787412e-6))); ans=Math.sqrt(0.636619772/ax)*(Math.cos(xx)*ans1-z*Math.sin(xx)*ans2); if (x < 0.0) ans = -ans; } return ans; } }
[ "shr.badihi@gmail.com" ]
shr.badihi@gmail.com
242f96fedd3c0c8f65db19b96e60b22aca27162d
3dc9be9a24ef90ed16ad01c25875b4d3283d81b6
/core/src/main/java/com/melody/vo/AuthVo.java
7e2da689144c34483ed571c54e230f96eebfd807
[]
no_license
rogerlzp/melody-project
740fa48738c2cc7dfdde4e69ed8d531df8e00694
f3a281084c312fdfccd846813d006cbbb41bf26b
refs/heads/master
2020-03-27T04:37:31.670463
2018-09-20T09:36:42
2018-09-20T09:36:42
145,955,577
0
0
null
null
null
null
UTF-8
Java
false
false
1,268
java
package com.melody.vo; import com.alibaba.fastjson.JSON; import java.io.Serializable; import java.util.Objects; /** * created by CaiBaoHong at 2018/5/14 16:14<br> * 用于存储角色或权限的值 */ public class AuthVo implements Serializable{ private static final long serialVersionUID = -7393642292018081900L; private String name;//显示名 private String val;//值 public AuthVo() { } public AuthVo(String val) { this.val = val; } public AuthVo(String name, String val) { this.name = name; this.val = val; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getVal() { return val; } public void setVal(String val) { this.val = val; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AuthVo authVo = (AuthVo) o; return Objects.equals(val, authVo.val); } @Override public int hashCode() { return Objects.hash(val); } @Override public String toString() { return JSON.toJSONString(this); } }
[ "rogerlzp@gmail.com" ]
rogerlzp@gmail.com
38492cc607e4b5ee27c397ed0cb099a75ce39f16
80c66cca63cebffdd1f397d79bfc040ed188c1c8
/gomint-server/src/main/java/io/gomint/server/world/block/CraftingTable.java
80b02be404b8a8e45e59f1ebc4cb89b4e7c6c2fb
[ "BSD-3-Clause" ]
permissive
severinkehding/GoMint
0902df4f3612cd9dd3d1b01a2e80636449e712fa
a70aeae53dc03803fb37241123b602da027844d5
refs/heads/master
2021-07-02T08:45:25.673228
2017-06-09T12:22:18
2017-06-09T12:22:18
104,562,044
0
0
null
2017-09-23T11:17:00
2017-09-23T11:17:00
null
UTF-8
Java
false
false
272
java
package io.gomint.server.world.block; /** * @author geNAZt * @version 1.0 */ public class CraftingTable extends Block { @Override public int getBlockId() { return 58; } @Override public long getBreakTime() { return 3750; } }
[ "fabian.fassbender42@googlemail.com" ]
fabian.fassbender42@googlemail.com
d9f7ff9b1eae56ec69c1de36153df184c404fb5b
be050d75de3a8bfc33b5fa95bf70ee73ff652f5a
/weixin_app_oaserver/app-producer/src/main/java/com/ProducerApplication.java
e92a62b429c86baeddd4c32b8f949ed9e6fe5258
[ "Apache-2.0" ]
permissive
yirentech/jun_weixin
43d6bb84eb2bd92e6f6c67342bad8f017a445f1a
8d4b48a4efc93f8399abeb7eb57141213e7d466f
refs/heads/master
2023-08-04T19:20:18.836148
2021-06-27T17:29:15
2021-06-27T17:29:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,358
java
package com; import javax.servlet.MultipartConfigElement; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.MultipartConfigFactory; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.context.annotation.Bean; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.transaction.annotation.EnableTransactionManagement; @SpringBootApplication @EnableDiscoveryClient @EnableTransactionManagement//启注解事务管理,等同于xml配置方式的 <tx:annotation-driven /> @EnableScheduling public class ProducerApplication { public static void main(String[] args) { System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(ProducerApplication.class, args); } /** * 文件上传配置 * @return */ @Bean public MultipartConfigElement multipartConfigElement() { MultipartConfigFactory factory = new MultipartConfigFactory(); //单个文件最大 factory.setMaxFileSize("102400KB");//KB,MB 100MB //设置总上传数据总大小 factory.setMaxRequestSize("1024000KB");// 1000MB return factory.createMultipartConfig(); } }
[ "wujun728@hotmail.com" ]
wujun728@hotmail.com
d0a27c9f7fc7f45437deb7e7b6116000afbed02b
7bba33c60ee70760347661c4bcc31b3a08b7ed65
/components/jdownloader/src/main/java/org/appwork/txtresource/Description.java
5f427a7bb3cc0d336241eadf447baad22a849441
[]
no_license
shai1334/frostwire-desktop
38769be4d8899e8cb9bc48cdc7ae042b1e43f5c7
8bdfc6340dfdc33bdf3b79c9276f43265f374fd4
refs/heads/master
2020-12-25T21:13:22.936841
2013-11-05T18:15:44
2013-11-05T18:15:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
682
java
/** * Copyright (c) 2009 - 2011 AppWork UG(haftungsbeschränkt) <e-mail@appwork.org> * * This file is part of org.appwork.txtresource * * This software is licensed under the Artistic License 2.0, * see the LICENSE file or http://www.opensource.org/licenses/artistic-license-2.0.php * for details */ package org.appwork.txtresource; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * @author thomas * */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.METHOD }) public @interface Description { String value(); }
[ "aldenml@gmail.com" ]
aldenml@gmail.com
be84622ed6007d6c2515414e3dc9396bf71e8cc8
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE190_Integer_Overflow/s05/CWE190_Integer_Overflow__short_rand_square_51b.java
a95f8cfc34666554cd53e68c41136a5360426f83
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
2,062
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE190_Integer_Overflow__short_rand_square_51b.java Label Definition File: CWE190_Integer_Overflow.label.xml Template File: sources-sinks-51b.tmpl.java */ /* * @description * CWE: 190 Integer Overflow * BadSource: rand Set data to result of rand() * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: square * GoodSink: Ensure there will not be an overflow before squaring data * BadSink : Square data, which can lead to overflow * Flow Variant: 51 Data flow: data passed as an argument from one function to another in different classes in the same package * * */ package testcases.CWE190_Integer_Overflow.s05; import testcasesupport.*; import javax.servlet.http.*; public class CWE190_Integer_Overflow__short_rand_square_51b { public void badSink(short data ) throws Throwable { /* POTENTIAL FLAW: if (data*data) > Short.MAX_VALUE, this will overflow */ short result = (short)(data * data); IO.writeLine("result: " + result); } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(short data ) throws Throwable { /* POTENTIAL FLAW: if (data*data) > Short.MAX_VALUE, this will overflow */ short result = (short)(data * data); IO.writeLine("result: " + result); } /* goodB2G() - use badsource and goodsink */ public void goodB2GSink(short data ) throws Throwable { /* FIX: Add a check to prevent an overflow from occurring */ /* NOTE: Math.abs of the minimum int or long will return that same value, so we must check for it */ if ((data != Integer.MIN_VALUE) && (data != Long.MIN_VALUE) && (Math.abs(data) <= (long)Math.sqrt(Short.MAX_VALUE))) { short result = (short)(data * data); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too large to perform squaring."); } } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
896d830159d16f26ffb5410af5a8dbcdc9b88d48
a1f9c390703c613f0ba91f2a065cb6c99de22de5
/src/_03_array_java/exercise/AddElement.java
fd1e34cf04cbcd1a77318642d14a99d17c54a3d3
[]
no_license
thanhtai18021994/C1220G2_BuiThanhTai_Module2
b85010f3ffa274cb583773a48406c6c60cc033c3
9cd6d69d0e341e2fb26300da31cfb98993305192
refs/heads/main
2023-03-24T09:41:35.398648
2021-03-16T10:14:22
2021-03-16T10:14:22
334,828,733
0
0
null
null
null
null
UTF-8
Java
false
false
1,066
java
import java.util.Scanner; public class AddElement { public static void main(String[] args) { int num; Scanner sc = new Scanner(System.in); int[] arr; System.out.println("Nhap chieu dai mang"); int n = sc.nextInt(); arr = new int[n]; for (int i = 0; i < arr.length - 1; i++) { System.out.println("Nhap phan tu thu " + (i + 1) + ":"); arr[i] = sc.nextInt(); } System.out.println("Nhap Phan tu can chen:"); num = sc.nextInt(); System.out.println("Nhap vi tri can chen:"); int k = sc.nextInt(); if (k >= 0 && k < arr.length - 2) { for (int i = arr.length - 1; i > k; i--) { arr[i] = arr[i - 1]; } arr[k] = num; }else if(k==arr.length-1){ arr[k]=num; }else { System.out.println("khong thoa man"); } for (int i = 0; i < arr.length; i++) { System.out.println("phan tu thu " + (i + 1) + ": " + arr[i]); } } }
[ "taibui18021994@gmail.com" ]
taibui18021994@gmail.com
427df5686d287e42780682c27afdfc0071c1b7fc
926a628796557c976c4a558a8999b3c1925f62d5
/domino-core/src/main/java/com/jule/core/utils/GenericValidator.java
3274c3182659748cee300f8c8ba1ab81564fffdb
[]
no_license
cubemoon/domino
7f4557b04ae5730be92edbd9b19389dd180c5d89
c7c490e8f7547e13ac6cd8fa344819a4d8625667
refs/heads/master
2023-04-15T22:36:18.587446
2019-08-01T03:15:43
2019-08-01T03:15:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
578
java
package com.jule.core.utils; import java.util.Collection; import java.util.Map; public class GenericValidator { public static boolean isBlankOrNull(String s) { return s == null || s.isEmpty(); } public static boolean isBlankOrNull(Collection<?> c) { return c == null || c.isEmpty(); } public static boolean isBlankOrNull(Map<?, ?> m) { return m == null || m.isEmpty(); } public static boolean isBlankOrNull(Number n) { return n == null || n.doubleValue() == 0; } public static boolean isBlankOrNull(Object[] a) { return a == null || a.length == 0; } }
[ "xiaokang_0826@163.com" ]
xiaokang_0826@163.com
d3ce2f9d84d976964300060135939298388b0e1c
95e944448000c08dd3d6915abb468767c9f29d3c
/sources/kotlin/jvm/p357a/C7563m.java
694fb8825198025b9e71c711022f69c030a9e3a4
[]
no_license
xrealm/tiktok-src
261b1faaf7b39d64bb7cb4106dc1a35963bd6868
90f305b5f981d39cfb313d75ab231326c9fca597
refs/heads/master
2022-11-12T06:43:07.401661
2020-07-04T20:21:12
2020-07-04T20:21:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
170
java
package kotlin.jvm.p357a; import kotlin.C7504c; /* renamed from: kotlin.jvm.a.m */ public interface C7563m<P1, P2, R> extends C7504c<R> { R invoke(P1 p1, P2 p2); }
[ "65450641+Xyzdesk@users.noreply.github.com" ]
65450641+Xyzdesk@users.noreply.github.com
dee285c4bab139f3d82ae4cb4a3bf170476dc78c
83dbd433aeed1f15f6501f39fe152abc0dc803d9
/src/spring-security-oauth2/2.1.1/spring-security-oauth2/AuthorizationServerTokenServices.java
93c82d4c3ba46f03f70f066a489c7f2bf0ef6ca3
[]
no_license
pylrichard/web_service_study
d0d42ea0c511b9b15a235a99cde5b4b025c33c6d
c1bd8753c6aee69c87707db7f3fb8e0d7f5ddbc0
refs/heads/master
2021-09-14T23:31:12.454640
2018-05-22T06:26:14
2018-05-22T06:26:14
104,879,563
1
0
null
null
null
null
UTF-8
Java
false
false
1,816
java
package org.springframework.security.oauth2.provider.token; import org.springframework.security.core.AuthenticationException; import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.TokenRequest; /** * @author Ryan Heaton * @author Dave Syer */ public interface AuthorizationServerTokenServices { /** * Create an access token associated with the specified credentials. * * @param authentication The credentials associated with the access token. * @return The access token. * @throws AuthenticationException If the credentials are inadequate. */ OAuth2AccessToken createAccessToken(OAuth2Authentication authentication) throws AuthenticationException; /** * Refresh an access token. The authorization request should be used for 2 things (at least): to validate that the * client id of the original access token is the same as the one requesting the refresh, and to narrow the scopes * (if provided). * * @param refreshToken The details about the refresh token. * @param tokenRequest The incoming token request. * @return The (new) access token. * @throws AuthenticationException If the refresh token is invalid or expired. */ OAuth2AccessToken refreshAccessToken(String refreshToken, TokenRequest tokenRequest) throws AuthenticationException; /** * Retrieve an access token stored against the provided authentication key, if it exists. * * @param authentication the authentication key for the access token * @return the access token or null if there was none */ OAuth2AccessToken getAccessToken(OAuth2Authentication authentication); }
[ "pylrichard@qq.com" ]
pylrichard@qq.com
954c2afd2295efb0686d17a4dbeca38171daf5ee
20eb62855cb3962c2d36fda4377dfd47d82eb777
/newEvaluatedBugs/Jsoup_44_buggy/mutated/93/NodeTraversor.java
50811f18af60833508dfcf2006ed052df85e7e21
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,400
java
package org.jsoup.select; import org.jsoup.nodes.Node; /** * Depth-first node traversor. Use to iterate through all nodes under and including the specified root node. * <p/> * This implementation does not use recursion, so a deep DOM does not risk blowing the stack. */ public class NodeTraversor { private NodeVisitor visitor; /** * Create a new traversor. * @param visitor a class implementing the {@link NodeVisitor} interface, to be called when visiting each node. */ public NodeTraversor(NodeVisitor visitor) { this.visitor = visitor; } /** * Start a depth-first traverse of the root and all of its descendants. * @param root the root node point to traverse. */ public void traverse(Node root) { Node node = root; int depth = 0; while (node != null) { visitor.head(node, depth); if (node != null) { node = node.childNode(0); depth++; } else { while (node.nextSibling() == null && depth > 0) { visitor.tail(node, depth); node = node.parent(); depth--; } visitor.tail(node, depth); if (node == root) break; node = node.nextSibling(); } } } }
[ "justinwm@163.com" ]
justinwm@163.com
58384ab6717502807f9f631beda2eacc4f734ade
0d14f64fc90f9024fecdb1d6ad5d0f7708da3326
/src/com/caihong/common/security/AccountExpiredException.java
5f76dd0d9fec15fa6523b6abfa275fcd9b4b819a
[]
no_license
xrogzu/caihongcms
1efd0d2c2079978d0b616a4b5e92c53f4565bb9a
1c9f3227bc2a30ed85d406149b0c41490d427331
refs/heads/master
2020-04-06T04:13:56.511727
2017-02-24T07:01:51
2017-02-24T07:01:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
450
java
package com.caihong.common.security; /** * 账号过期异常。如:改账号只缴纳了一年的费用,一年后没有续费。 */ @SuppressWarnings("serial") public class AccountExpiredException extends AccountStatusException { public AccountExpiredException() { } public AccountExpiredException(String msg) { super(msg); } public AccountExpiredException(String msg, Object extraInformation) { super(msg, extraInformation); } }
[ "qianfo_713@163.com" ]
qianfo_713@163.com
274401b1a141050a2d3d8d41eb765567198c6ea8
f95b2c0343990472cab4f4ae576dfa840b46106a
/PartOne/MethodsAndClasses/src/com/courtney/Overload.java
68d215b0585ad01f4c77648669e6d57f43626965
[]
no_license
CourtneyBritney/JavaCompleteReference11
c5bb53260c7405d01ff269841fa55bc00991a8b8
19e21544e3cbb8b3b2e865955b85848111f99074
refs/heads/master
2023-02-16T00:36:51.094237
2021-01-02T17:07:29
2021-01-02T17:07:29
316,416,000
0
0
null
null
null
null
UTF-8
Java
false
false
315
java
package com.courtney; class Overload { public static void main(String args[]) { OverloadDemo ob = new OverloadDemo(); int i = 88; ob.test(); ob.test(10, 20); ob.test(i); // this will invoke test(double) ob.test(123.2); // this will invoke test(double) } }
[ "courtney02alexander@gmail.com" ]
courtney02alexander@gmail.com
bdb80a5005afbced3955abfcc0e467fc7b386232
a610c7e9f803129a295864a534c32951714b5e63
/app/src/main/java/com/project/kashan/localvigilante/MyPetitionsActivity.java
b47be1c0ba22018f638c35c64c3170bbf5c7d73c
[]
no_license
kashann/local-vigilante
4d1cdd9af7672acbde4ce3f6ecdee02ed07b4a53
9c77dd18b3eab5a4d6268e3bdbeed3acdda3bb66
refs/heads/master
2020-06-11T00:31:03.632365
2019-06-26T01:13:30
2019-06-26T01:13:30
193,803,988
0
0
null
null
null
null
UTF-8
Java
false
false
1,762
java
package com.project.kashan.localvigilante; import android.database.Cursor; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ListView; import android.widget.Toast; import java.util.ArrayList; import java.util.List; public class MyPetitionsActivity extends AppCompatActivity { private int userId; DatabaseHelper myDb; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my_petitions); userId = getIntent().getIntExtra("userId", -1); myDb = new DatabaseHelper(this); List<PetitionInfo> list = getPetitions(); ListView lv = findViewById(R.id.lvPetitions); PetitionCustomAdapter adapter = new PetitionCustomAdapter(getApplicationContext(), list); lv.setAdapter(adapter); } public ArrayList<PetitionInfo> getPetitions(){ ArrayList<PetitionInfo> list = new ArrayList<PetitionInfo>(); Cursor res = myDb.getPetitionsByUserId(userId); if(res.getCount() == 0) Toast.makeText(this, "No petitions found!", Toast.LENGTH_LONG).show(); StringBuffer buffer = new StringBuffer(); while(res.moveToNext()){ PetitionInfo pet = new PetitionInfo(); pet.setId(res.getInt(0)); pet.setName(res.getString(1)); pet.setBody(res.getString(2)); pet.setNoSignatures(res.getInt(3)); pet.setImg(res.getBlob(4)); pet.setAddress(res.getString(5)); pet.setLat(res.getFloat(6)); pet.setLng(res.getFloat(7)); pet.setUser_id(res.getInt(8)); list.add(pet); } return list; } }
[ "kashi_nadim@yahoo.com" ]
kashi_nadim@yahoo.com
6075965f786ea807a2625f974a6e4cc170aee55f
0fd4f55b08bf6cee6a505f2346926a1e4c9bde24
/Effective Java - 3rd Edition/Chapter 4 - Classes and Interfaces/Item 17 - Minimize mutability/Immutable Classes/Complex.java
6d6522d409035bb283766d7a4955b4247dbb26da
[]
no_license
david2999999/Advanced-Java
1d7089a050fa1b8e1b574aa4855b10363b1ad383
78f17038c75be8c5d3456d92ac81841fb502bf56
refs/heads/master
2021-07-19T19:03:06.061598
2020-04-08T19:37:40
2020-04-08T19:37:40
128,837,674
1
0
null
null
null
null
UTF-8
Java
false
false
1,539
java
public final class Complex { private final double real; private final double imaginary; public Complex(double real, double imaginary) { this.real = real; this.imaginary = imaginary; } public double realPart() { return real; } public double imaginaryPart() { return imaginary; } public Complex plus(Complex c) { return new Complex(real + c.real, imaginary + c.imaginary); } public Complex minus(Complex c) { return new Complex(real - c.real, imaginary - c.imaginary); } public Complex times(Complex c) { return new Complex(real * c.real - imaginary * c.imaginary, real * c.imaginary + imaginary * c.real); } public Complex dividedBy(Complex c) { double tmp = c.real * c.real + c.imaginary * c.imaginary; return new Complex((real * c.real + imaginary * c.imaginary) / tmp, (imaginary * c.real - real * c.imaginary) / tmp); } @Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Complex)) return false; Complex c = (Complex) o; return Double.compare(c.real, real) == 0 && Double.compare(c.imaginary, imaginary) == 0; } @Override public int hashCode() { return 31 * Double.hashCode(real) + Double.hashCode(imaginary); } @Override public String toString() { return "(" + real + " + " + imaginary + "i)"; } }
[ "djiang86@binghamton.edu" ]
djiang86@binghamton.edu
54b09e6a9fd6ea60b2e248581e8094ee39cc71f8
8cd17c6e7169fc4a63eaa715209150cdd2cf71bc
/1084/Seminar6/src/ro/ase/csie/cts/g1084/seminar6/Student.java
4f8d367785872645d7202270d62d3f6120de392e
[ "MIT" ]
permissive
Software-Quality-and-Testing/cts-2020
ce6e0f2856fdad84642315e13b77475444ffeedf
87e2b2d403bd13adfb92805668a03f9cb078aac0
refs/heads/master
2022-12-24T22:04:49.177163
2020-05-27T11:19:32
2020-05-27T11:19:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
894
java
package ro.ase.csie.cts.g1084.seminar6; import java.util.ArrayList; /* * * varsta are valori in [14, 90] * numele are minim 3 caractere si maxim 255 * nota are valori in [1, 10] * */ public class Student { String nume; int varsta; ArrayList<Integer> note; public Student(String nume, int varsta, ArrayList<Integer> note) { super(); this.nume = nume; this.varsta = varsta; this.note = note; } public String getNume() { return nume; } public void setNume(String nume) { this.nume = nume; } public int getVarsta() { return varsta; } public void setVarsta(int varsta) { this.varsta = varsta; } public void setNote(ArrayList<Integer> note) { this.note = note; } public int getNrNote() { return this.note.size(); } public int getNota(int index) { return this.note.get(index); } public float getMedie2Zecimale() { return 0; } }
[ "catalin.boja@hotmail.com" ]
catalin.boja@hotmail.com
8d058cdf699c13f6b03d47fcd50eec2074d4a222
e561d6ea521a4d7eee9c96eca671ae6212406309
/Java/src/BJ/No1495.java
3cc5d5ea9591175d1b52639d968164678a5941f4
[]
no_license
Seungpang/Algorithms
02a9a9dc3225caf8651c03208334082024deb65f
f7e6c5f28ce3b6509cb91d7aca162f36ae837b82
refs/heads/master
2023-08-19T03:30:24.346606
2023-08-17T15:50:18
2023-08-17T15:50:18
176,178,409
0
0
null
null
null
null
UTF-8
Java
false
false
1,393
java
package BJ; // 기타리스트 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class No1495 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextToken()); int S = Integer.parseInt(st.nextToken()); int M = Integer.parseInt(st.nextToken()); int[] V = new int[N + 1]; st = new StringTokenizer(br.readLine()); for (int i = 1; i <= N; i++) { V[i] = Integer.parseInt(st.nextToken()); } boolean[][] dp = new boolean[N + 1][M + 1]; dp[0][S] = true; for (int i = 1; i <= N; i++) { for (int j = 0; j <= M; j++) { if (dp[i - 1][j]) { if (j - V[i] >= 0) { dp[i][j - V[i]] = true; } if (j + V[i] <= M) { dp[i][j + V[i]] = true; } } } } int ans = -1; for (int i = M; i >= 0; i--) { if (dp[N][i]) { ans = i; break; } } System.out.println(ans); } }
[ "obey1342@gmail.com" ]
obey1342@gmail.com
2e1b21ca0f70e5bb78a169b2cca3c707613c4cab
fd86787089d9d74d83c4f2cde3ad92ecb95e1bc1
/src/test/java/com/deveficiente/blblioteca/emprestimo/VerificacaoBasicaEmprestimoValidatorTest.java
0e2b61ecdf15598f2b3d32526acc931a770f6e93
[]
no_license
rochards/biblioteca-cdd
13efb478515800eaf1194ad5b85e40299a55f712
73ac652d04f5ce5a0afd7e1cc676abc1e435fe4a
refs/heads/master
2023-03-19T05:03:06.908223
2021-03-14T23:06:40
2021-03-14T23:06:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,595
java
package com.deveficiente.blblioteca.emprestimo; import java.math.BigDecimal; import java.util.ArrayList; import javax.persistence.EntityManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.validation.BeanPropertyBindingResult; import org.springframework.validation.Errors; import com.deveficiente.blblioteca.novoexemplar.Tipo; import com.deveficiente.blblioteca.novolivro.Livro; import com.deveficiente.blblioteca.novousuario.TipoUsuario; import com.deveficiente.blblioteca.novousuario.Usuario; public class VerificacaoBasicaEmprestimoValidatorTest { @DisplayName("deveria interromper a validação já exista um erro anterior") @Test void teste1() throws Exception { EntityManager manager = Mockito.mock(EntityManager.class); VerificacaoBasicaEmprestimoValidator validador = new VerificacaoBasicaEmprestimoValidator( manager); Object target = new Object(); Errors errors = new BeanPropertyBindingResult(target, "target"); errors.reject("codigoErro"); validador.validate(target, errors); Assertions.assertEquals(1, errors.getErrorCount()); } @DisplayName("deveria garantir que todo usuario regular definiu o tempo de emprestimo") @Test void teste2() throws Exception { EntityManager manager = Mockito.mock(EntityManager.class); VerificacaoBasicaEmprestimoValidator validador = new VerificacaoBasicaEmprestimoValidator( manager); Livro livro = new Livro("titulo", BigDecimal.TEN, "897452386534"); livro.novoExemplar(Tipo.LIVRE); Usuario usuario = new Usuario(TipoUsuario.PADRAO); Mockito.when(manager.find(Usuario.class, 1l)).thenReturn(usuario); Mockito.when(manager.find(Livro.class, 1l)).thenReturn(livro); NovoEmprestimoRequest request = new NovoEmprestimoRequest(1l, 1l); Errors errors = new BeanPropertyBindingResult(request, "target"); validador.validate(request, errors); Assertions.assertEquals(1, errors.getErrorCount()); Assertions.assertEquals("Você precisa definir o tempo do emprestimo", errors.getGlobalErrors().get(0).getDefaultMessage()); } @DisplayName("deveria validar o número máximo de emprestimos de um determinado usuário") @Test void teste3() throws Exception { EntityManager manager = Mockito.mock(EntityManager.class); VerificacaoBasicaEmprestimoValidator validador = new VerificacaoBasicaEmprestimoValidator( manager); Livro livro = new Livro("titulo", BigDecimal.TEN, "897452386534"); //cria instancias para serem emprestadas for(int i=0;i<6;i++) { livro.novoExemplar(Tipo.LIVRE); } Usuario usuario = new Usuario(TipoUsuario.PADRAO); ReflectionTestUtils.setField(usuario, "id", 1l); //cria o máximo de empréstimos permitidos neste momento, 5. for(int i=0;i<5;i++) { usuario.criaEmprestimo(livro, 40); } //ReflectionTestUtils.setField(usuario, "emprestimos", emprestimosCriados); Mockito.when(manager.find(Usuario.class, 1l)).thenReturn(usuario); Mockito.when(manager.find(Livro.class, 1l)).thenReturn(livro); NovoEmprestimoRequest request = new NovoEmprestimoRequest(1l, 1l); request.setTempo(40); Errors errors = new BeanPropertyBindingResult(request, "target"); validador.validate(request, errors); Assertions.assertEquals(1, errors.getErrorCount()); Assertions.assertEquals("Você já está no limite de emprestimos. O limite atual é 5", errors.getGlobalErrors().get(0).getDefaultMessage()); } }
[ "alots.ssa@gmail.com" ]
alots.ssa@gmail.com
c056742af37ecb06d803ada42cee78292d482dac
f7f9d7fa841e856927e02513ecc74dc00c935f8a
/server/src/main/java/org/codelibs/fesen/common/util/concurrent/RunOnce.java
40c4746b7eef73537996542c6898cc2e267106d4
[ "CDDL-1.0", "MIT", "BSD-3-Clause", "LGPL-2.0-or-later", "LGPL-2.1-only", "NAIST-2003", "LicenseRef-scancode-generic-export-compliance", "ICU", "SunPro", "Python-2.0", "CC-BY-SA-3.0", "MPL-1.1", "GPL-2.0-only", "CPL-1.0", "LicenseRef-scancode-other-copyleft", "Apache-2.0", "LicenseRef-scancode-public-domain", "CC-PDDC", "BSD-2-Clause", "LicenseRef-scancode-unicode-mappings", "LicenseRef-scancode-unicode", "CC0-1.0", "Apache-1.1", "EPL-1.0", "Classpath-exception-2.0" ]
permissive
codelibs/fesen
3f949fd3533e8b25afc3d3475010d1b1a0d95c09
b2440fbda02e32f7abe77d2be95ead6a16c8af06
refs/heads/main
2022-07-27T21:14:02.455938
2021-12-21T23:54:20
2021-12-21T23:54:20
330,334,670
4
0
Apache-2.0
2022-05-17T01:54:31
2021-01-17T07:07:56
Java
UTF-8
Java
false
false
1,532
java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.codelibs.fesen.common.util.concurrent; import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; /** * Runnable that can only be run one time. */ public class RunOnce implements Runnable { private final Runnable delegate; private final AtomicBoolean hasRun; public RunOnce(final Runnable delegate) { this.delegate = Objects.requireNonNull(delegate); this.hasRun = new AtomicBoolean(false); } @Override public void run() { if (hasRun.compareAndSet(false, true)) { delegate.run(); } } /** * {@code true} if the {@link RunOnce} has been executed once. */ public boolean hasRun() { return hasRun.get(); } }
[ "shinsuke@apache.org" ]
shinsuke@apache.org
f9b5afb0957648f405dbc1921afd341f9b9c6d8e
7e7497d07edfa8c0dde64d7bef4d144873b12425
/service/src/test/java/com/networknt/service/IntegrationData.java
c209ad5df6dfdac71490f4691b81c9c0168fd824
[ "Apache-2.0", "LicenseRef-scancode-free-unknown" ]
permissive
zmyer/light-4j
43f5eb87c487893274ecc1ae715382058bc19273
5642a851283473449738e6fcb8699765c93b3a46
refs/heads/master
2020-03-24T13:29:58.331685
2018-10-30T00:53:05
2018-10-30T00:53:05
142,745,572
0
0
Apache-2.0
2018-08-25T15:10:44
2018-07-29T08:57:48
Java
UTF-8
Java
false
false
730
java
package com.networknt.service; public class IntegrationData { private long now = System.currentTimeMillis(); private String commandDispatcherId = "command-dispatcher-" + now; private String commandChannel = "command-channel-" + now; private String aggregateDestination = "aggregate-destination-" + now; private String eventDispatcherId = "event-dispatcher-" + now; public String getAggregateDestination() { return aggregateDestination; } public String getCommandDispatcherId() { return commandDispatcherId; } public String getCommandChannel() { return commandChannel; } public String getEventDispatcherId() { return eventDispatcherId; } }
[ "stevehu@gmail.com" ]
stevehu@gmail.com
84f9671a6a5d06328834882bef125d43a9575b63
75950d61f2e7517f3fe4c32f0109b203d41466bf
/modules/tags/fabric3-modules-parent-pom-0.7/extension/other/fabric3-jpa-core/src/main/java/org/fabric3/jpa/runtime/Fabric3JpaRuntimeException.java
137fc263f50b8797773b875085a3d2fd59488bc7
[]
no_license
codehaus/fabric3
3677d558dca066fb58845db5b0ad73d951acf880
491ff9ddaff6cb47cbb4452e4ddbf715314cd340
refs/heads/master
2023-07-20T00:34:33.992727
2012-10-31T16:32:19
2012-10-31T16:32:19
36,338,853
0
0
null
null
null
null
MacCentralEurope
Java
false
false
1,352
java
/* * Fabric3 * Copyright © 2008 Metaform Systems Limited * * This proprietary software may be used only connection with the Fabric3 license * (the “License”), a copy of which is included in the software or may be * obtained at: http://www.metaformsystems.com/licenses/license.html. * Software distributed under the License is distributed on an “as is” basis, * without warranties or conditions of any kind. See the License for the * specific language governing permissions and limitations of use of the software. * This software is distributed in conjunction with other software licensed under * different terms. See the separate licenses for those programs included in the * distribution for the permitted and restricted uses of such software. * */ package org.fabric3.jpa.runtime; import org.fabric3.host.Fabric3RuntimeException; /** * * @version $Revision$ $Date$ */ public class Fabric3JpaRuntimeException extends Fabric3RuntimeException { private static final long serialVersionUID = 2897143398279023346L; /** * @param cause Root cause of the exception. */ public Fabric3JpaRuntimeException(Throwable cause) { super(cause); } /** * @param message Message for the exception. */ public Fabric3JpaRuntimeException(String message) { super(message); } }
[ "meerajk@83866bfc-822f-0410-aa35-bd5043b85eaf" ]
meerajk@83866bfc-822f-0410-aa35-bd5043b85eaf
70b345bfaf6de2a94b46b8ffeb19c8f5b8d0d102
d1fd7de283425854c802c4808785ae4593e0a06a
/combo/ContextFileSpec.java
8c15a93304c83e9d9b85008095928a4f58fb2929
[]
no_license
jamespharaoh/jpstack-console
c349e5fad9b98419f43d21386676eeae7edcb053
19fb0942a7ab28c4f3c6b899606b93cb361b8a26
refs/heads/master
2020-12-08T08:57:52.706196
2017-08-17T12:04:12
2017-08-17T12:04:12
99,678,477
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
package wbs.console.combo; import lombok.Data; import lombok.experimental.Accessors; import wbs.console.module.ConsoleModuleSpec; import wbs.console.module.ConsoleSpec; import wbs.framework.component.annotations.PrototypeComponent; import wbs.framework.data.annotations.DataAncestor; import wbs.framework.data.annotations.DataAttribute; import wbs.framework.data.annotations.DataClass; @Accessors (fluent = true) @Data @DataClass ("context-file") @PrototypeComponent ("contextFileSpec") public class ContextFileSpec implements ConsoleSpec { // tree attributes @DataAncestor ConsoleModuleSpec consoleSpec; // attributes @DataAttribute ( required = true) String name; @DataAttribute ( name = "file") String fileName; @DataAttribute ( name = "get-responder") String getResponderName; @DataAttribute ( name = "get-action") String getActionName; @DataAttribute ( name = "post-action") String postActionName; }
[ "james@pharaoh.uk" ]
james@pharaoh.uk
74d15acee222e7622ff7b96801c55c7e89a50cde
0def550140cac54bd38137a22bca2c98c2f2c03a
/app/src/main/java/appewtc/masterung/broadcastertest/DetailListView.java
952276657df24f82ce129ab8c9736f187c730ad9
[]
no_license
masterUNG/BroadcasterTest
2a4d3d4fbf459052e0f784adf1abaaec7df905a6
05f266cff54fb45ffb3a7f2a43e8c9f63657f41a
refs/heads/master
2021-01-21T13:41:51.518243
2016-04-24T10:47:25
2016-04-24T10:47:25
49,179,610
0
0
null
null
null
null
UTF-8
Java
false
false
2,223
java
package appewtc.masterung.broadcastertest; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; public class DetailListView extends AppCompatActivity { //Explicit private String[] titleStrings, detailStrings; private int iconAnInt; private int[] videoInts; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail_list_view); //Receive Value From Intent receiveValue(); //Create ListView createListView(); } // Main Method public void clickBackListView(View view) { finish(); } private void createListView() { MyAdapter objMyAdapter = new MyAdapter(DetailListView.this, titleStrings, iconAnInt); ListView myListView = (ListView) findViewById(R.id.listView); myListView.setAdapter(objMyAdapter); myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { //Intent to ShowVideoActivity Intent objIntent = new Intent(DetailListView.this, ShowVideoActivity.class); objIntent.putExtra("Title", titleStrings[i]); objIntent.putExtra("Detail", detailStrings[i]); objIntent.putExtra("Video", videoInts[i]); startActivity(objIntent); } // event }); } // createListView private void receiveValue() { titleStrings = getIntent().getStringArrayExtra("Title"); detailStrings = getIntent().getStringArrayExtra("Detail"); iconAnInt = getIntent().getIntExtra("Icon", R.drawable.nameread); videoInts = getIntent().getIntArrayExtra("Video"); for (int i = 0; i < titleStrings.length; i++) { Log.d("Test", "titleString[" + Integer.toString(i) + "] = " + titleStrings[i]); } // for } // receiveValue } // Main Class
[ "phrombutr@gmail.com" ]
phrombutr@gmail.com
b4a45d862bfff3025dc4be1c910db2fe55d519f5
d06f031a2c7cb37895d0dea7e1f49070a018f298
/src/main/java/okjiaoyu/qa/middle/auto/testcase/crm/studentFiles/Api1_6.java
77562aada65b8cf07f0e478302c0dab5258d1559
[]
no_license
mylove132/monitor_middle_whole
398124830f96996f8acea63d21a0f135eb68fd61
4f8279a29b0351ddba3dc69116ae879ebf5a7820
refs/heads/master
2022-07-17T05:31:38.950432
2019-11-06T08:17:00
2019-11-06T08:17:00
219,944,397
0
0
null
2022-06-21T02:14:56
2019-11-06T08:10:23
Java
UTF-8
Java
false
false
1,168
java
package okjiaoyu.qa.middle.auto.testcase.crm.studentFiles; import okjiaoyu.qa.middle.auto.testcase.crm.Crm; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.testng.annotations.Test; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * 学生档案--运营列表--获取会员操作记录 * Created by zhangchenglin on 2018/8/28. */ public class Api1_6 extends Crm { @Override public void getParams(Map<String, String> param) { List<NameValuePair> getRequestParams = new ArrayList<>(); //parms // getRequestParams.add(new BasicNameValuePair("order_type", param.get("order_type"))); getRequestParams.add(new BasicNameValuePair("student_id", param.get("student_id"))); requestSampler.setGetRequsetParams(getRequestParams); } @Test(dataProvider = "providerMethod", groups = {"normal"}) public void test(Map<String, String> param) { getRequest(param); } @Test(dataProvider = "providerMethod", groups = {"exception"}) public void exceptionTest(Map<String, String> param) { getRequest(param); } }
[ "liuzhanhui@okay.cn" ]
liuzhanhui@okay.cn
d40bf62e122e88fc162534fc529a71f5ef76958d
499faea013ee326417e5725ac80eb1a54ef6e802
/wf-base/src/main/java/org/igov/service/controller/RelationCommonController.java
bca458d5f2388a06a0b71d9f201e772401bf6fab
[]
no_license
dolinets/iDoc
03ff38313f137d440e7568b214a8dc6ebf50fc59
9d0383c00149af94441cc62692aad1204395be87
refs/heads/master
2021-04-28T20:48:48.062254
2018-02-24T12:15:44
2018-02-24T12:15:44
121,933,992
0
0
null
null
null
null
UTF-8
Java
false
false
3,685
java
package org.igov.service.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import java.util.List; import org.igov.model.action.vo.Relation_VO; import org.igov.model.relation.ObjectGroup; import org.igov.service.business.relation.RelationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.transaction.annotation.Transactional; /** * * @author Kovilin */ @Controller @Api(tags = {"RelationController — Обработка Relation"}) @RequestMapping(value = "/relation") public class RelationCommonController { private static final Logger LOG = LoggerFactory.getLogger(RelationCommonController.class); @Autowired RelationService oRelationService; @ApiOperation(value = "Обработка Relation", notes = "##### Пример:\n" + "https://alpha.test.region.igov.org.ua/wf/service/relation/getRelations?sID_Relation=1&sFindChild=gro \n") @RequestMapping(value = "/getRelations", method = RequestMethod.GET) @Transactional public @ResponseBody List<Relation_VO> getRelations (@RequestParam(value = "sID_Relation", required = true) String sID_Relation, @RequestParam(value = "sFindChild", required = false) String sFindChild, @RequestParam(value = "nID_Parent", required = false) Long nID_Parent) throws Exception { LOG.info("getRelations started"); return oRelationService.getRelations(sID_Relation, nID_Parent, sFindChild); } @ApiOperation(value = "Обработка Relation", notes = "##### Пример:\n" + "https://alpha.test.region.igov.org.ua/wf/service/relation/getObjectGroupByPrivate_Source?sID_Private_Source=1 \n") @RequestMapping(value = "/getObjectGroupByPrivate_Source", method = RequestMethod.GET) @Transactional public @ResponseBody ObjectGroup getObjectGroupByPrivate_Source (@RequestParam(value = "sID_Private_Source", required = true) String sID_Private_Source) throws Exception { LOG.info("getObjectGroupByPrivate_Source"); return oRelationService.getObjectGroupBySubject_Source(sID_Private_Source); } @ApiOperation(value = "Обработка Relation", notes = "##### Пример:\n" + "https://alpha.test.region.igov.org.ua/wf/service/relation/getObjectGroup?sLogin=1 \n") @RequestMapping(value = "/getObjectGroup", method = RequestMethod.GET) @Transactional public @ResponseBody ObjectGroup getObjectGroup (@RequestParam(value = "sLogin", required = true) String sLogin) throws Exception { LOG.info("getObjectGroup"); return oRelationService.getCompany(sLogin); } @ApiOperation(value = "Обработка Relation", notes = "##### Пример:\n" + "https://alpha.test.region.igov.org.ua/wf/service/relation/getObjectGroupParent?sLogin=1 \n") @RequestMapping(value = "/getObjectGroupParent", method = RequestMethod.GET) @Transactional public @ResponseBody ObjectGroup getObjectGroupParent (@RequestParam(value = "sLogin", required = true) String sLogin) throws Exception { LOG.info("getObjectGroupParent"); return oRelationService.getObjectGroupParent(sLogin); } }
[ "dolinets123@gmail.com" ]
dolinets123@gmail.com
e5405971536f7de0750f453a9607741728007322
fafd731284e687702ef38906477ba035a17ddde4
/java-basic/HeadFirstDesignPatterns/src/patterns/observer/weather/WeatherStation.java
35c163bb1cd9d948b9c1a9d9fef0baa67e7a3c1c
[]
no_license
danhnguyen-agilityio/spring-boot
3d358f9b15b48609fca8624be56927f119253e7c
b55da182a2f6d9950d06489c8233920fdd2ca268
refs/heads/feature/apache-maven
2022-06-23T19:18:25.040092
2019-12-23T08:04:09
2019-12-23T08:04:09
229,703,200
1
1
null
2022-06-21T02:30:17
2019-12-23T07:48:11
Java
UTF-8
Java
false
false
428
java
package patterns.observer.weather; public class WeatherStation { public static void main(String[] args) { WeatherData weatherData = new WeatherData(); CurrentConditionDisplay currentConditionDisplay = new CurrentConditionDisplay(weatherData); ForecastDisplay forcastDisplay = new ForecastDisplay(weatherData); weatherData.setMeasurements(80, 65, 30.4f); weatherData.setMeasurements(5, 15, 25.4f); } }
[ "danhnguyentk@gmail.com" ]
danhnguyentk@gmail.com
68c5e619d4a586bbfacb92b61dd8c66abf00aa8f
94dc8347acbe6b2481e6a29c8db66d21fa147a27
/src/main/java/br/com/qualitytecnologia/service/mapper/EmployeeMapper.java
83d90f4009e4bf71443b7bbc219c498da0f66f62
[]
no_license
KamusTiago/curso
ca579c04aeed4493bbb6002792df53eb86064585
2f4d3bb3da3f2b8c8f313ed92c39ab7816454ff9
refs/heads/main
2023-04-22T23:14:04.864105
2021-05-04T23:55:46
2021-05-04T23:55:46
362,197,234
0
0
null
2021-04-27T22:47:57
2021-04-27T17:31:41
Java
UTF-8
Java
false
false
748
java
package br.com.qualitytecnologia.service.mapper; import br.com.qualitytecnologia.domain.*; import br.com.qualitytecnologia.service.dto.EmployeeDTO; import org.mapstruct.*; /** * Mapper for the entity {@link Employee} and its DTO {@link EmployeeDTO}. */ @Mapper(componentModel = "spring", uses = { DepartmentMapper.class }) public interface EmployeeMapper extends EntityMapper<EmployeeDTO, Employee> { @Mapping(target = "manager", source = "manager", qualifiedByName = "id") @Mapping(target = "department", source = "department", qualifiedByName = "id") EmployeeDTO toDto(Employee s); @Named("id") @BeanMapping(ignoreByDefault = true) @Mapping(target = "id", source = "id") EmployeeDTO toDtoId(Employee employee); }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
8e62a61e1453bf6c6b92c1b26087b584953e51fa
26394d0446ddcf0bc15c85f1ea188d133780fe77
/C2002LDoiCan/ADF2/25-03-2021/src/main/java/App.java
676d6ba3afb88d0a63d8f45dace635945d27a321
[]
no_license
sunlight3d/Aptech
608a18c6ea72f9248da91d205a194b6ceb247187
b6246d83c8d876d69b6a22f5ec52a802d5d5173b
refs/heads/master
2023-08-16T18:18:23.189028
2023-08-16T13:46:19
2023-08-16T13:46:19
297,259,105
14
28
null
2022-08-25T06:45:45
2020-09-21T07:17:07
JavaScript
UTF-8
Java
false
false
249
java
import java.io.File; public class App { public static void main(String args[]) { System.out.println("Hello"); FileManager fileManager = new FileManager("c:\\temp\\main.c"); fileManager.removeComments(); } }
[ "sunlight4d@gmail.com" ]
sunlight4d@gmail.com
0f09666c3f6928b43ea057a8cec8841212c62250
30ee9f52bb05060e09f07088e4a75fd38725c9a0
/J2EEWEB/src/main/java/xml/demo/Xpath.java
b7af0f569fd96979a0b48baa8abef10a902b2f9f
[]
no_license
childnn/childone
be3b67c0aac4e89ed1305efd5b1f79f390974306
6c6ac01cb2130581c85e5514f6fcf9712e9d1e2d
refs/heads/master
2023-06-25T03:45:22.285934
2023-06-07T08:46:33
2023-06-07T08:46:33
218,492,936
0
0
null
2023-06-14T22:55:25
2019-10-30T09:42:18
Java
UTF-8
Java
false
false
1,560
java
package xml.demo; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Node; import org.dom4j.io.SAXReader; import org.junit.Test; import java.util.List; /** * @author child * 2019/5/1 13:49 */ public class Xpath { @Test //获取单个 public void test1() throws DocumentException { //获取 dom 树 SAXReader reader = new SAXReader(); Document document = reader.read(Xpath.class.getClassLoader().getResourceAsStream("dom4j.xml")); //使用 xpath api: 根据标签路径获取标签 // Node node = document.selectSingleNode("/persons/person/name"); //绝对路径方式: 默认获取第一个 // Node node = document.selectSingleNode("//name"); //相对路径: 默认获取第一个 Node node = document.selectSingleNode("//person[@id='p2']/name"); //条件筛选,指定 获取哪一个 String text = node.getText(); System.out.println(text); } @Test //获取多个 public void test2() throws DocumentException { SAXReader reader = new SAXReader(); Document document = reader.read(getClass().getClassLoader().getResourceAsStream("dom4j.xml")); // List<Element> nodes = document.selectNodes("/persons/person/name"); //绝对路径 List<Node> nodes = document.selectNodes("//name"); for (Node element : nodes) { String name = element.getName(); String text = element.getText(); System.out.println(name + ":" + text); } } }
[ "13163249276@163.com" ]
13163249276@163.com
4ddcc4a4965ee0695e2a77c8438cd0033a53b00a
d1e27692c858fbd3a2433fd6e8ed15f86050a642
/Renowalk_Backup_09292016/HomeDepot_Renowalk/src-botched/com/qc/IBaseFactory3.java
aa6728b33f53f81750eb07812f560ebd17400e81
[]
no_license
saikrishna89/IndeedProject
7d734aebd18713e48f2db7460503a7892d1b19a1
e68d284e5f0294af42c3247905e98909269018de
refs/heads/master
2021-01-23T03:34:35.490743
2017-12-21T06:07:07
2017-12-21T06:07:07
86,095,699
0
0
null
null
null
null
UTF-8
Java
false
false
640
java
package com.qc ; import com4j.*; /** * Provides basic object basic factory services, such as adding and removing factory child objects and creating lists of child objects. */ @IID("{07365BD7-C297-449C-889C-3B734B4B657C}") public interface IBaseFactory3 extends com.qc.IBaseFactory2 { // Methods: /** * <p> * For HP use. Initialize the factory with project data. * </p> * @param vRemApi Mandatory java.lang.Object parameter. */ @DISPID(3) //= 0x3. The runtime will prefer the VTID if present @VTID(9) void initializeFactoryEx( @MarshalAs(NativeType.VARIANT) java.lang.Object vRemApi); // Properties: }
[ "abhi.madhireddy@gmail.com" ]
abhi.madhireddy@gmail.com
35b66d3a49c9cfc263785d5bcf004671c8dc502e
4a1501142e6e7feec0ec514a59cb447c5be3df51
/src/NodeInfo.java
fd5cacc245434f53d94de58b1a64b0d6888e6c6e
[]
no_license
wuperry563/distributed-mutual-exclusion
10c72d7a3250141469dd17c1453f4c5581a9092c
7b00ae1f53f2256374e1ec8f096869a6e0774d54
refs/heads/master
2022-12-09T00:52:53.704124
2020-08-05T02:23:46
2020-08-05T02:23:46
283,581,084
0
0
null
null
null
null
UTF-8
Java
false
false
413
java
public class NodeInfo { Integer listenPort; String hostName; public String getHostName() { return hostName; } public void setHostName(String hostName) { this.hostName = hostName; } public Integer getListenPort() { return listenPort; } public void setListenPort(Integer listenPort) { this.listenPort = listenPort; } }
[ "you@example.com" ]
you@example.com
ee6bd301cd8aeb09149a83147a923af209f9c216
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdasApi21/applicationModule/src/test/java/applicationModulepackageJava1/Foo185Test.java
5af7de60a037c36a32c5fe756db3a7044c9b653e
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
package applicationModulepackageJava1; import org.junit.Test; public class Foo185Test { @Test public void testFoo0() { new Foo185().foo0(); } @Test public void testFoo1() { new Foo185().foo1(); } @Test public void testFoo2() { new Foo185().foo2(); } @Test public void testFoo3() { new Foo185().foo3(); } @Test public void testFoo4() { new Foo185().foo4(); } @Test public void testFoo5() { new Foo185().foo5(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
d3b72b30658e4f5a8c2636a5e564fe4aae8edf7e
ead5a617b23c541865a6b57cf8cffcc1137352f2
/decompiled/sources/p091b/p092a/p097e/C1541f.java
dd05a27d162d598b38f4fb54919e70755b181e6b
[]
no_license
erred/uva-ssn
73a6392a096b38c092482113e322fdbf9c3c4c0e
4fb8ea447766a735289b96e2510f5a8d93345a8c
refs/heads/master
2022-02-26T20:52:50.515540
2019-10-14T12:30:33
2019-10-14T12:30:33
210,376,140
1
0
null
null
null
null
UTF-8
Java
false
false
7,220
java
package p091b.p092a.p097e; import com.google.common.net.HttpHeaders; import java.io.IOException; import java.net.ProtocolException; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.concurrent.TimeUnit; import p091b.C1590aa; import p091b.C1596ac; import p091b.C1596ac.C1597a; import p091b.C1598ad; import p091b.C1640s; import p091b.C1640s.C1641a; import p091b.C1645u.C1646a; import p091b.C1651x; import p091b.C1654y; import p091b.p092a.C1483a; import p091b.p092a.C1508c; import p091b.p092a.p094b.C1506g; import p091b.p092a.p095c.C1514c; import p091b.p092a.p095c.C1517e; import p091b.p092a.p095c.C1520h; import p091b.p092a.p095c.C1521i; import p091b.p092a.p095c.C1523k; import p102c.C1672c; import p102c.C1677f; import p102c.C1679h; import p102c.C1683l; import p102c.C1694r; import p102c.C1695s; /* renamed from: b.a.e.f */ /* compiled from: Http2Codec */ public final class C1541f implements C1514c { /* renamed from: b */ private static final C1677f f4681b = C1677f.m6985a("connection"); /* renamed from: c */ private static final C1677f f4682c = C1677f.m6985a("host"); /* renamed from: d */ private static final C1677f f4683d = C1677f.m6985a("keep-alive"); /* renamed from: e */ private static final C1677f f4684e = C1677f.m6985a("proxy-connection"); /* renamed from: f */ private static final C1677f f4685f = C1677f.m6985a("transfer-encoding"); /* renamed from: g */ private static final C1677f f4686g = C1677f.m6985a("te"); /* renamed from: h */ private static final C1677f f4687h = C1677f.m6985a("encoding"); /* renamed from: i */ private static final C1677f f4688i = C1677f.m6985a("upgrade"); /* renamed from: j */ private static final List<C1677f> f4689j = C1508c.m6079a((T[]) new C1677f[]{f4681b, f4682c, f4683d, f4684e, f4686g, f4685f, f4687h, f4688i, C1536c.f4650c, C1536c.f4651d, C1536c.f4652e, C1536c.f4653f}); /* renamed from: k */ private static final List<C1677f> f4690k = C1508c.m6079a((T[]) new C1677f[]{f4681b, f4682c, f4683d, f4684e, f4686g, f4685f, f4687h, f4688i}); /* renamed from: a */ final C1506g f4691a; /* renamed from: l */ private final C1651x f4692l; /* renamed from: m */ private final C1646a f4693m; /* renamed from: n */ private final C1543g f4694n; /* renamed from: o */ private C1561i f4695o; /* renamed from: b.a.e.f$a */ /* compiled from: Http2Codec */ class C1542a extends C1679h { /* renamed from: a */ boolean f4696a = false; /* renamed from: b */ long f4697b = 0; C1542a(C1695s sVar) { super(sVar); } /* renamed from: a */ public long mo6185a(C1672c cVar, long j) throws IOException { try { long a = mo6907b().mo6185a(cVar, j); if (a > 0) { this.f4697b += a; } return a; } catch (IOException e) { m6230a(e); throw e; } } public void close() throws IOException { super.close(); m6230a(null); } /* renamed from: a */ private void m6230a(IOException iOException) { if (!this.f4696a) { this.f4696a = true; C1541f.this.f4691a.mo6259a(false, C1541f.this, this.f4697b, iOException); } } } public C1541f(C1651x xVar, C1646a aVar, C1506g gVar, C1543g gVar2) { this.f4692l = xVar; this.f4693m = aVar; this.f4691a = gVar; this.f4694n = gVar2; } /* renamed from: a */ public C1694r mo6272a(C1590aa aaVar, long j) { return this.f4695o.mo6370h(); } /* renamed from: a */ public void mo6274a(C1590aa aaVar) throws IOException { if (this.f4695o == null) { this.f4695o = this.f4694n.mo6320a(m6222b(aaVar), aaVar.mo6459d() != null); this.f4695o.mo6367e().mo6912a((long) this.f4693m.mo6283c(), TimeUnit.MILLISECONDS); this.f4695o.mo6368f().mo6912a((long) this.f4693m.mo6284d(), TimeUnit.MILLISECONDS); } } /* renamed from: a */ public void mo6273a() throws IOException { this.f4694n.mo6333b(); } /* renamed from: b */ public void mo6275b() throws IOException { this.f4695o.mo6370h().close(); } /* renamed from: a */ public C1597a mo6270a(boolean z) throws IOException { C1597a a = m6221a(this.f4695o.mo6366d()); if (!z || C1483a.f4446a.mo6174a(a) != 100) { return a; } return null; } /* renamed from: b */ public static List<C1536c> m6222b(C1590aa aaVar) { C1640s c = aaVar.mo6458c(); ArrayList arrayList = new ArrayList(c.mo6643a() + 4); arrayList.add(new C1536c(C1536c.f4650c, aaVar.mo6456b())); arrayList.add(new C1536c(C1536c.f4651d, C1521i.m6148a(aaVar.mo6454a()))); String a = aaVar.mo6455a(HttpHeaders.HOST); if (a != null) { arrayList.add(new C1536c(C1536c.f4653f, a)); } arrayList.add(new C1536c(C1536c.f4652e, aaVar.mo6454a().mo6661b())); int a2 = c.mo6643a(); for (int i = 0; i < a2; i++) { C1677f a3 = C1677f.m6985a(c.mo6644a(i).toLowerCase(Locale.US)); if (!f4689j.contains(a3)) { arrayList.add(new C1536c(a3, c.mo6647b(i))); } } return arrayList; } /* renamed from: a */ public static C1597a m6221a(List<C1536c> list) throws IOException { C1641a aVar = new C1641a(); int size = list.size(); C1641a aVar2 = aVar; C1523k kVar = null; for (int i = 0; i < size; i++) { C1536c cVar = (C1536c) list.get(i); if (cVar != null) { C1677f fVar = cVar.f4654g; String a = cVar.f4655h.mo6888a(); if (fVar.equals(C1536c.f4649b)) { StringBuilder sb = new StringBuilder(); sb.append("HTTP/1.1 "); sb.append(a); kVar = C1523k.m6160a(sb.toString()); } else if (!f4690k.contains(fVar)) { C1483a.f4446a.mo6180a(aVar2, fVar.mo6888a(), a); } } else if (kVar != null && kVar.f4608b == 100) { aVar2 = new C1641a(); kVar = null; } } if (kVar != null) { return new C1597a().mo6503a(C1654y.HTTP_2).mo6496a(kVar.f4608b).mo6504a(kVar.f4609c).mo6502a(aVar2.mo6654a()); } throw new ProtocolException("Expected ':status' header not present"); } /* renamed from: a */ public C1598ad mo6271a(C1596ac acVar) throws IOException { this.f4691a.f4547c.mo6627f(this.f4691a.f4546b); return new C1520h(acVar.mo6478a(HttpHeaders.CONTENT_TYPE), C1517e.m6115a(acVar), C1683l.m7033a((C1695s) new C1542a(this.f4695o.mo6369g()))); } /* renamed from: c */ public void mo6276c() { if (this.f4695o != null) { this.f4695o.mo6362b(C1535b.CANCEL); } } }
[ "seankhliao@gmail.com" ]
seankhliao@gmail.com
51f125b5a42dd7d7245036824d4ccac6936cd6ee
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/99/486.java
ec45be8c92857860fe6ddb37a2e0e3dd8a502c99
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,024
java
package <missing>; public class GlobalMembers { public static int Main() { int n; int[] s = new int[100]; int i; int a = 0; int b = 0; int c = 0; int d = 0; double n1; double n2; double n3; double n4; String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { n = Integer.parseInt(tempVar); } for (i = 0;i < n;i++) { String tempVar2 = ConsoleInput.scanfRead(); if (tempVar2 != null) { s[i] = Integer.parseInt(tempVar2); } } for (i = 0;i < n;i++) { if (s[i] < 19) { a += 1; } else if (s[i] > 18 && s[i] < 36) { b += 1; } else if (s[i] > 35 && s[i] < 61) { c += 1; } else if (s[i] > 60) { d += 1; } } n1 = (double)a * 100 / n; n2 = (double)b * 100 / n; n3 = (double)c * 100 / n; n4 = (double)d * 100 / n; System.out.printf("1-18: %.2lf%%\n",n1); System.out.printf("19-35: %.2lf%%\n",n2); System.out.printf("36-60: %.2lf%%\n",n3); System.out.printf("60??: %.2lf%%",n4); return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
9d9438cb5d5e8fbbfb558e1f901ab312769e8690
d5515553d071bdca27d5d095776c0e58beeb4a9a
/src/net/sourceforge/plantuml/command/regex/RegexPartialMatch.java
ad9e3694c0b757fc82f287926bb465127b6cc0b9
[]
no_license
ccamel/plantuml
29dfda0414a3dbecc43696b63d4dadb821719489
3100d49b54ee8e98537051e071915e2060fe0b8e
refs/heads/master
2022-07-07T12:03:37.351931
2016-12-14T21:01:03
2016-12-14T21:01:03
77,067,872
1
0
null
2022-05-30T09:56:21
2016-12-21T16:26:58
Java
UTF-8
Java
false
false
1,747
java
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2017, Arnaud Roques * * Project Info: http://plantuml.com * * This file is part of PlantUML. * * PlantUML is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PlantUML distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * * * Original Author: Arnaud Roques * * */ package net.sourceforge.plantuml.command.regex; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; public class RegexPartialMatch implements Iterable<String> { private final List<String> data = new ArrayList<String>(); public RegexPartialMatch(String name) { } public void add(String group) { data.add(group); } public int size() { return data.size(); } public String get(int i) { return data.get(i); } public Iterator<String> iterator() { return Collections.unmodifiableCollection(data).iterator(); } @Override public String toString() { return "{" + data + "}"; } }
[ "plantuml@gmail.com" ]
plantuml@gmail.com
217dbfc5c0515c0cbd2fab6b0aaa3e097b937792
dffad0ee2972fccecefb894b876034563729f74e
/dynatrace/src/main/java/de/tsystems/mms/apm/performancesignature/dynatracesaas/rest/ApiException.java
36e2aa67e419319c5f7b1c8fea1cdbb15478728f
[ "Apache-2.0" ]
permissive
T-Systems-MMS/perfsig-jenkins
5224425310845ffa7253f22a2062171f812ab82f
b1a7dc2b3da5466f019cced70dc18e7f53f9baf3
refs/heads/master
2023-04-06T03:52:00.874578
2021-07-01T07:57:47
2021-07-01T07:58:08
52,352,133
3
0
Apache-2.0
2023-04-04T00:28:45
2016-02-23T10:51:28
Java
UTF-8
Java
false
false
2,807
java
/* * Copyright (c) 2014-2018 T-Systems Multimedia Solutions GmbH * * 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 de.tsystems.mms.apm.performancesignature.dynatracesaas.rest; import java.util.List; import java.util.Map; public class ApiException extends Exception { private int code; private Map<String, List<String>> responseHeaders; private String responseBody; public ApiException() { } public ApiException(Throwable throwable) { super(throwable); } public ApiException(String message) { super(message); } public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) { super(message, throwable); this.code = code; this.responseHeaders = responseHeaders; this.responseBody = responseBody; } public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) { this(message, null, code, responseHeaders, responseBody); } public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) { this(message, throwable, code, responseHeaders, null); } public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) { this(null, null, code, responseHeaders, responseBody); } public ApiException(int code, String message) { super(message); this.code = code; } public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) { this(code, message); this.responseHeaders = responseHeaders; this.responseBody = responseBody; } /** * Get the HTTP status code. * * @return HTTP status code */ public int getCode() { return code; } /** * Get the HTTP response headers. * * @return A map of list of string */ public Map<String, List<String>> getResponseHeaders() { return responseHeaders; } /** * Get the HTTP response body. * * @return Response body in the form of string */ public String getResponseBody() { return responseBody; } }
[ "Raphael.Pionke@t-systems.com" ]
Raphael.Pionke@t-systems.com
e5bdc58557c89565144f4bb6bb59e8810b575c12
09960b68707da3891f45ac2eda90e177a742b28d
/web/wxyd/src/main/java/com/szty/wxyd/controller/WeiXinToKenController.java
a5cf32253d9459e6915c96d3f1cbcebc7a069d83
[]
no_license
jiangyiman/szty
a72434d586f836f8a9039b3a5a293f614a1e4b99
9087733b2b88b6ac0e0cd7d13652f02b42cdb848
refs/heads/master
2021-05-30T22:03:01.114487
2016-03-25T06:25:18
2016-03-25T06:25:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,970
java
package com.szty.wxyd.controller; import java.util.Map; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.szty.wxyd.model.WeiXinResModel; import com.szty.wxyd.service.WeiXinDoPostService; import com.szty.wxyd.util.MessageCodeUtil; import com.szty.wxyd.util.MessageUtil; import com.szty.wxyd.util.WeiXinConfing; import com.szty.wxyd.util.WeiXinUtil; @Controller @RequestMapping(value="/getToken") public class WeiXinToKenController { private static final Logger log = Logger.getLogger(WeiXinToKenController.class); private static final String msgKey = "MsgType"; @Autowired private WeiXinConfing wxConfig; @Autowired private WeiXinDoPostService wxDoPostService; /** * @Title: getLocalHostToKen * @author mao.ru * @Description: TODO(微信获取本地ToKen) * @param @param signature * @param @param timestamp * @param @param nonce * @param @param echostr * @param @return 设定文件 * @return String 返回类型 * @throws */ @RequestMapping(method = { RequestMethod.GET }) public @ResponseBody String getLocalHostToKen( @RequestParam("signature") String signature, @RequestParam("timestamp") String timestamp, @RequestParam("nonce") String nonce, @RequestParam("echostr") String echostr, HttpServletResponse response) { WeiXinResModel wxm = new WeiXinResModel(signature, timestamp, nonce, echostr, wxConfig.loctoken); log.info("微信验证请求接入,请求参数:" + wxm.toString()); String res = wxm.getSequenceFiles(); if (signature.equals(WeiXinUtil.SHA1(res))) { log.info("签名:{" + signature + "},本地加签:{" + WeiXinUtil.getHashSHA(res) + "}"); return echostr; } else { } return "error"; } /** * * @Title: doPostHandle * @author mao.ru * @Description: TODO(微信借口主动回调) * @param @param requestBody * @param @return 设定文件 * @return String 返回类型 * @throws Exception */ @RequestMapping(method = { RequestMethod.POST },produces="text/xml;charset=UTF-8") public @ResponseBody String doPostHandle(@RequestBody String requestBody) throws Exception { log.info("<===============微信回调======start=======================>"); log.info("微信回调请求参数:=====>" + requestBody); Map<String, String> map = MessageUtil.parseStringToXml(requestBody); if (!map.isEmpty()) { // 依据消息类型调用不同接口 int key = MessageCodeUtil.getName(map.get(msgKey)); log.info("微信回调事件:=====[>>>>>>>>>" + key+"]===["+map.get(msgKey)+"]"); String rspStr = ""; switch (key) { case 1: rspStr = wxDoPostService.doPostTextHandle(map); break; case 2: rspStr = wxDoPostService.doPostImageHandle(map); break; case 3: rspStr = wxDoPostService.doPostLinkHandle(map); break; case 4: rspStr = wxDoPostService.doPostLocationHandle(map); break; case 5: rspStr = wxDoPostService.doPostVoiceHandle(map); break; case 6: rspStr = wxDoPostService.doPostEventHandle(map); break; case 7: rspStr = wxDoPostService.doPostDeviceEvent(map); break; case 8: rspStr = wxDoPostService.doPostDeviceText(map); break; default: rspStr = wxDoPostService.doPostErrorHandle(map); break; } log.info("微信回调=》返回参数:==>["+rspStr+"]"); log.info("<===============微信回调======end=======================>"); return rspStr; } else { // 返回错误文本接口 log.info("<===============微信回调======end=============错误接口=========>"); return wxDoPostService.doPostErrorHandle(map); } } /** * @Title: getLocalHostToKen * @author mao.ru * @Description: TODO(微信获取本地ToKen) * @param @param signature * @param @param timestamp * @param @param nonce * @param @param echostr * @param @return 设定文件 * @return String 返回类型 * @throws */ @RequestMapping(value="/getBind" ,method = { RequestMethod.GET }) public @ResponseBody String getLocalHostToKenBind( @RequestParam("signature") String signature, @RequestParam("timestamp") String timestamp, @RequestParam("nonce") String nonce, @RequestParam("echostr") String echostr, HttpServletResponse response) { WeiXinResModel wxm = new WeiXinResModel(signature, timestamp, nonce, echostr, wxConfig.loctoken); log.info("微信验证请求接入,请求参数:" + wxm.toString()); String res = wxm.getSequenceFiles(); if (signature.equals(WeiXinUtil.SHA1(res))) { log.info("签名:{" + signature + "},本地加签:{" + WeiXinUtil.getHashSHA(res) + "}"); return echostr; } else { } return "error"; } /** * * @Title: doPostHandle * @author mao.ru * @Description: TODO(微信借口主动回调) * @param @param requestBody * @param @return 设定文件 * @return String 返回类型 * @throws Exception */ @RequestMapping(value="/getBind" ,method = { RequestMethod.POST }) public @ResponseBody String doPostHandleJson(String START_OBJECT) throws Exception { log.info("<===============微信回调======start=======================>"); log.info("微信回调请求参数:=====>" + START_OBJECT); Map<String, String> map = MessageUtil.parseStringToXml(START_OBJECT); if (!map.isEmpty()) { // 依据消息类型调用不同接口 int key = MessageCodeUtil.getName(map.get(msgKey)); log.info("微信回调事件:=====[>>>>>>>>>" + key+"]===["+map.get(msgKey)+"]"); String rspStr = ""; switch (key) { case 1: rspStr = wxDoPostService.doPostTextHandle(map); break; case 2: rspStr = wxDoPostService.doPostImageHandle(map); break; case 3: rspStr = wxDoPostService.doPostLinkHandle(map); break; case 4: rspStr = wxDoPostService.doPostLocationHandle(map); break; case 5: rspStr = wxDoPostService.doPostVoiceHandle(map); break; case 6: rspStr = wxDoPostService.doPostEventHandle(map); break; case 7: rspStr = wxDoPostService.doPostEventHandle(map); break; case 8: rspStr = wxDoPostService.doPostDeviceText(map); break; default: rspStr = wxDoPostService.doPostDeviceEvent(map); break; } log.info("微信回调=》返回参数:==>["+rspStr+"]"); log.info("<===============微信回调======end=======================>"); return rspStr; } else { // 返回错误文本接口 log.info("<===============微信回调======end=============错误接口=========>"); return wxDoPostService.doPostErrorHandle(map); } } }
[ "279941737@qq.com" ]
279941737@qq.com
a526ae7fa16a0cc75ecfefe0fe13ce54033e1f17
52c36ce3a9d25073bdbe002757f08a267abb91c6
/src/main/java/com/alipay/api/domain/AlipayOpenMiniMorphoAppOfflineModel.java
0dd0582e56e6283a89f64a148b66e12209255375
[ "Apache-2.0" ]
permissive
itc7/alipay-sdk-java-all
d2f2f2403f3c9c7122baa9e438ebd2932935afec
c220e02cbcdda5180b76d9da129147e5b38dcf17
refs/heads/master
2022-08-28T08:03:08.497774
2020-05-27T10:16:10
2020-05-27T10:16:10
267,271,062
0
0
Apache-2.0
2020-05-27T09:02:04
2020-05-27T09:02:04
null
UTF-8
Java
false
false
801
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 下线应用 * * @author auto create * @since 1.0, 2019-12-26 15:04:41 */ public class AlipayOpenMiniMorphoAppOfflineModel extends AlipayObject { private static final long serialVersionUID = 1614718853534211533L; /** * 闪蝶应用ID */ @ApiField("id") private String id; /** * 闪蝶身份验证信息 */ @ApiField("identity") private MorphoIdentity identity; public String getId() { return this.id; } public void setId(String id) { this.id = id; } public MorphoIdentity getIdentity() { return this.identity; } public void setIdentity(MorphoIdentity identity) { this.identity = identity; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
9049d4956bef29c0c61cde1c782af05cf2c25c9e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_1dd84dd9be95f675d3f85187cc016b107c597214/APIUser/16_1dd84dd9be95f675d3f85187cc016b107c597214_APIUser_t.java
6fb0983f12f7877ac7857424342977922ce2a594
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
5,192
java
package com.testdroid.api.model; import com.testdroid.api.APIEntity; import com.testdroid.api.APIException; import com.testdroid.api.APIListResource; import com.testdroid.api.APISort; import javax.xml.bind.annotation.XmlRootElement; import org.codehaus.jackson.annotate.JsonIgnore; /** * * @author kajdus */ @XmlRootElement public class APIUser extends APIEntity { private String email; private String name; private String state; private String country; private String city; private String code; private String address; private String phone; private String organization; private String vatID; private String timeZone; private boolean enabled; private APIRole[] roles; public APIUser() {} public APIUser(Long id, String email, String name, String state, String country, String city, String code, String address, String phone, String organization, String vatID, String timeZone, boolean enabled, APIRole... roles) { super(id); this.email = email; this.name = name; this.state = state; this.country = country; this.city = city; this.code = code; this.address = address; this.phone = phone; this.organization = organization; this.vatID = vatID; this.timeZone = timeZone; this.enabled = enabled; this.roles = roles; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getOrganization() { return organization; } public void setOrganization(String organization) { this.organization = organization; } public String getVatID() { return vatID; } public void setVatID(String vatID) { this.vatID = vatID; } public String getTimeZone() { return timeZone; } public void setTimeZone(String timeZone) { this.timeZone = timeZone; } public boolean isEnabled() { return enabled; } public void setEnabled(boolean enabled) { this.enabled = enabled; } public APIRole[] getRoles() { return roles; } public void setRoles(APIRole[] roles) { this.roles = roles; } private String getProjectsURI() { return selfURI + "/projects"; }; public APIProject createProject(APIProject.Type type) throws APIException { return postResource(getProjectsURI(), String.format("type=%s", type.name()), APIProject.class); } public APIProject createProject(APIProject.Type type, String name) throws APIException { return postResource(getProjectsURI(), String.format("type=%s&name=%s", type.name(), encodeURL(name)), APIProject.class); } @JsonIgnore public APIListResource<APIProject> getProjectsResource() throws APIException { return getListResource(getProjectsURI(), APIProject.class); } @JsonIgnore public APIListResource<APIProject> getProjectsResource(long offset, long limit, String search, APISort sort) throws APIException { return getListResource(getProjectsURI(), offset, limit, search, sort, APIProject.class); } public APIProject getProject(Long id) throws APIException { return getResource(selfURI + "/projects/" + id, APIProject.class).getEntity(); } @JsonIgnore public APIListResource<APIDeviceGroup> getClustersResource() throws APIException { return getListResource(getProjectsURI(), APIDeviceGroup.class); } @JsonIgnore public APIListResource<APIDeviceGroup> getClustersResource(long offset, long limit, String search, APISort sort) throws APIException { return getListResource(getProjectsURI(), offset, limit, search, sort, APIDeviceGroup.class); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
cc1125c773219e0cb0bfa61fa2018740ef6ebcba
f98002d6186eb2079730f6a41782a808b15fa407
/src/meshi/geometry/DistanceList.java
f1f084d3f0a4775b52d1358ce20c75a4c7cc0909
[]
no_license
ZivBA/CrysHomModeling
7d6a79fbbdd9d0c0191cd41bc01b679534bf1feb
3df2ec6dcd35586568d190497af6a4d9e40535fd
refs/heads/master
2021-06-28T18:35:24.297893
2017-07-31T07:16:36
2017-07-31T07:16:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,043
java
package meshi.geometry; import meshi.util.SortableMeshiList; import meshi.util.filters.Filter; public class DistanceList extends SortableMeshiList { protected DistanceList(int capacity) { super(new IsDistance(), capacity); } public DistanceList() { super(new IsDistance()); } public DistanceList(Filter fi) { super(fi); } public final Distance distanceAt(int i) { return (Distance) elementAt(i);} private static class IsDistance implements Filter { public boolean accept(Object obj) { return (obj instanceof Distance); } } private final IsDistance filter = new IsDistance(); public boolean selectionAdd(Object object){ return this.selectionAdd(object,filter); } protected boolean selectionAdd(Object object, Filter filter){ if (filter.accept(object)) { fastAdd(object); return true; } else return false; } public Object[] internalArray() {return internalArray;} }
[ "ziv.benaharon1@mai.huji.ac.il" ]
ziv.benaharon1@mai.huji.ac.il
92879d03bf41ee5047e910b2da0ac3bfc366b925
545336aa548dcc6cdbbefa93c0436e1ffbb5f81d
/exercises_student_idea/Replace Implicit Language with Interpreter/test/exercise/TagTest.java
c03b48411bcec02f84db48c06e6e1bf206b026c9
[]
no_license
tomekl007/refactoring
994ca81617735fd70574656ac46620c144713502
744fbb04c4d2e29b69a5a9232141946a426c57ab
refs/heads/master
2020-03-30T04:58:10.390352
2013-05-18T20:14:54
2013-05-18T20:14:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,035
java
package exercise; import org.junit.Assert; import org.junit.Test; public class TagTest { private String SAMPLE_PRICE = "8.95"; @Test public void testSimpleTagWithOneAttributeAndValue() throws Exception { //given TagNode priceTag = new TagNode("price"); priceTag.addAttribute("currency", "USD"); priceTag.addValue(SAMPLE_PRICE); //when String result = priceTag.toString(); //then String expected = "<price currency='USD'>"+SAMPLE_PRICE+"</price>"; Assert.assertEquals(expected, result); } @Test public void testCompositeTagOneChild() throws Exception { //given TagNode productNode = new TagNode("product"); productNode.add(new TagNode("price")); //when String result = productNode.toString(); //then String expected = "<product><price></price></product>"; Assert.assertEquals(expected, result); } @Test public void testAddingChildrenAndGrandchildren() throws Exception { //given TagNode ordersNode = new TagNode("orders"); TagNode orderNode = new TagNode("order"); TagNode productNode = new TagNode("product"); ordersNode.add(orderNode); orderNode.add(productNode); //when String result = ordersNode.toString(); //then String expected = "<orders><order><product></product></order></orders>"; Assert.assertEquals(expected, result); } @Test public void testAddingManyChildren() throws Exception { //given TagNode orderNode = new TagNode("order"); TagNode productNode = new TagNode("product"); orderNode.add(productNode); orderNode.add(productNode); //when String actual = orderNode.toString(); //then String expected = "<order><product></product><product></product></order>"; Assert.assertEquals(expected, actual); } }
[ "tomekl007@gmail.com" ]
tomekl007@gmail.com
2eab2ae7dd395ec61fe36b457582948540a08546
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_38be5ee2db9a6be7b1e74243b14894c5f38fd253/PitchSpeedSensorDisplay/9_38be5ee2db9a6be7b1e74243b14894c5f38fd253_PitchSpeedSensorDisplay_s.java
d9c9ceaa3d6b23d341710b6b771a024522c68f69
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,299
java
package fi.leif.java.kindlet.sailersensor.sensordisplay; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.util.Map; import com.amazon.kindle.kindlet.ui.KBox; import com.amazon.kindle.kindlet.ui.KBox.Filler; import com.amazon.kindle.kindlet.ui.KLabel; import com.amazon.kindle.kindlet.ui.KPanel; import fi.leif.java.kindlet.sailersensor.Config; public class PitchSpeedSensorDisplay extends SensorDisplay { private static final long serialVersionUID = 1L; KLabel pitchLabel; KLabel speedLabel; KLabel knLabel; private final String MSG_PITCH_ID = "AP"; private final String MSG_GPS_SPEED_ID = "GS"; public PitchSpeedSensorDisplay(Config config) { super(config); setLayout(new BorderLayout()); // Pitch KPanel pitchBox = new KPanel(); pitchBox.setLayout(new BorderLayout()); addHeader(" PITCH", pitchBox); pitchLabel = new KLabel(" ", KLabel.CENTER); pitchLabel.setFont(new Font(config.FONTFAMILY, Font.BOLD, config.DATA_FONT_SIZE_2)); pitchBox.add( pitchLabel, BorderLayout.CENTER ); add(pitchBox, BorderLayout.WEST); // Center (crap solution, but will do for now) KPanel center = new KPanel(); center.setLayout(new BorderLayout()); addHeader(" ",center); add(center, BorderLayout.CENTER); // Speed KPanel speedBox = new KPanel(); speedBox.setLayout(new BorderLayout()); addHeader("SPEED ", speedBox); speedLabel = new KLabel(" ", KLabel.CENTER ); speedLabel.setFont(new Font(config.FONTFAMILY, Font.BOLD, config.DATA_FONT_SIZE_2)); speedBox.add( speedLabel, BorderLayout.WEST ); knLabel = new KLabel(" kn ", KLabel.CENTER ); knLabel.setFont(new Font(config.FONTFAMILY, Font.BOLD, config.DATA_FONT_SIZE_3)); speedBox.add( knLabel, BorderLayout.EAST ); add(speedBox, BorderLayout.EAST); } public void messageRetrieved(Map m) throws Exception { if(m.get(MSG_PITCH_ID) != null) { Double d = (Double)m.get(MSG_PITCH_ID); pitchLabel.setText(" " + d.intValue() + "\u00B0"); pitchLabel.repaint(); } if(m.get(MSG_GPS_SPEED_ID) != null) { Double d = (Double)m.get(MSG_GPS_SPEED_ID); speedLabel.setText("" + d.intValue()); speedLabel.repaint(); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
f54fd3b3f585704e6d84bd55b9934e269ca69cd9
79e2e3347aaaac76f771beebdf4a50bcb9804e9f
/app/src/main/java/com/windmillsteward/jukutech/litepal/parser/LitePalParser.java
a0a77b2f28b6f746a20a40a8c3afc786ad81bf0c
[]
no_license
inyuo/shunfengche
2b3d5ecda7703c8414ad483326a8c05998b4201d
a8c2668f43db962b9b0def531c3fe87cc1f0119d
refs/heads/master
2020-07-13T13:26:44.196536
2019-08-06T07:43:38
2019-08-06T07:43:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,213
java
/* * Copyright (C) Tony Green, LitePal Framework Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.windmillsteward.jukutech.litepal.parser; import android.content.res.AssetManager; import android.content.res.Resources.NotFoundException; import com.windmillsteward.jukutech.litepal.LitePalApplication; import com.windmillsteward.jukutech.litepal.exceptions.ParseConfigurationFileException; import com.windmillsteward.jukutech.litepal.util.Const; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import java.io.IOException; import java.io.InputStream; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; /** * The class is used to parse the litepal.xml file. There're three usual ways to * parse XML in android, SAX, Pull and DOM. LitePal use SAX as umeng_push_notification_default_sound.mp3otification_default_sound.mp3 option, * and DOM parser will be added soon. * * @author Tony Green * @since 1.0 */ public class LitePalParser { /** * Node name dbname. */ static final String NODE_DB_NAME = "dbname"; /** * Node name version. */ static final String NODE_VERSION = "version"; /** * Node name list. Currently not used. */ static final String NODE_LIST = "list"; /** * Node name mapping. */ static final String NODE_MAPPING = "mapping"; /** * Node name column case. */ static final String NODE_CASES = "cases"; /** * Node name column storage. */ static final String NODE_STORAGE = "storage"; /** * Attribute name value, for dbname and version node. */ static final String ATTR_VALUE = "value"; /** * Attribute name class, for mapping node. */ static final String ATTR_CLASS = "class"; /** * Store the parsed value of litepal.xml. */ private static LitePalParser parser; /** * Analyze litepal.xml, and store the analyzed result in LitePalParser. Use * DomParse to parse the configuration file as umeng_push_notification_default_sound.mp3otification_default_sound.mp3. SAXParser and * XmlPullParser is also optional, but not visible to developers. */ public static LitePalConfig parseLitePalConfiguration() { if (parser == null) { parser = new LitePalParser(); } return parser.usePullParse(); } /** * Use SAXParser to parse the litepal.xml file. It will get the parsed * result from LitePalContentHandler and stored in the instance of * LitePalAttr. * * Note while analyzing litepal.xml file, ParseConfigurationFileException * could be thrown. Be careful of writing litepal.xml file, or developer's * application may be crash. */ private void useSAXParser() { LitePalContentHandler handler; try { SAXParserFactory factory = SAXParserFactory.newInstance(); XMLReader xmlReader = factory.newSAXParser().getXMLReader(); handler = new LitePalContentHandler(); xmlReader.setContentHandler(handler); xmlReader.parse(new InputSource(getConfigInputStream())); } catch (NotFoundException e) { throw new ParseConfigurationFileException( ParseConfigurationFileException.CAN_NOT_FIND_LITEPAL_FILE); } catch (SAXException e) { throw new ParseConfigurationFileException( ParseConfigurationFileException.FILE_FORMAT_IS_NOT_CORRECT); } catch (ParserConfigurationException e) { throw new ParseConfigurationFileException( ParseConfigurationFileException.PARSE_CONFIG_FAILED); } catch (IOException e) { throw new ParseConfigurationFileException(ParseConfigurationFileException.IO_EXCEPTION); } } /** * Use XmlPullParser to parse the litepal.xml file. It will store the result * in the instance of LitePalAttr. * * Note while analyzing litepal.xml file, ParseConfigurationFileException * could be thrown. Be careful of writing litepal.xml file, or developer's * application may be crash. */ private LitePalConfig usePullParse() { try { LitePalConfig litePalConfig = new LitePalConfig(); XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); XmlPullParser xmlPullParser = factory.newPullParser(); xmlPullParser.setInput(getConfigInputStream(), "UTF-8"); int eventType = xmlPullParser.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { String nodeName = xmlPullParser.getName(); switch (eventType) { case XmlPullParser.START_TAG: { if (NODE_DB_NAME.equals(nodeName)) { String dbName = xmlPullParser.getAttributeValue("", ATTR_VALUE); litePalConfig.setDbName(dbName); } else if (NODE_VERSION.equals(nodeName)) { String version = xmlPullParser.getAttributeValue("", ATTR_VALUE); litePalConfig.setVersion(Integer.parseInt(version)); } else if (NODE_MAPPING.equals(nodeName)) { String className = xmlPullParser.getAttributeValue("", ATTR_CLASS); litePalConfig.addClassName(className); } else if (NODE_CASES.equals(nodeName)) { String cases = xmlPullParser.getAttributeValue("", ATTR_VALUE); litePalConfig.setCases(cases); } else if (NODE_STORAGE.equals(nodeName)) { String storage = xmlPullParser.getAttributeValue("", ATTR_VALUE); litePalConfig.setStorage(storage); } break; } default: break; } eventType = xmlPullParser.next(); } return litePalConfig; } catch (XmlPullParserException e) { throw new ParseConfigurationFileException( ParseConfigurationFileException.FILE_FORMAT_IS_NOT_CORRECT); } catch (IOException e) { throw new ParseConfigurationFileException(ParseConfigurationFileException.IO_EXCEPTION); } } /** * Iterates all files in the root of assets folder. If find litepal.xml, * open this file and return the input stream. Or throw * ParseConfigurationFileException. * * @return The input stream of litepal.xml. * @throws IOException */ private InputStream getConfigInputStream() throws IOException { AssetManager assetManager = LitePalApplication.getContext().getAssets(); String[] fileNames = assetManager.list(""); if (fileNames != null && fileNames.length > 0) { for (String fileName : fileNames) { if (Const.Config.CONFIGURATION_FILE_NAME.equalsIgnoreCase(fileName)) { return assetManager.open(fileName, AssetManager.ACCESS_BUFFER); } } } throw new ParseConfigurationFileException( ParseConfigurationFileException.CAN_NOT_FIND_LITEPAL_FILE); } }
[ "mxnzp_life@163.com" ]
mxnzp_life@163.com
ddae271e727037692f607a94c92e4de8cc6d4abd
9757b9287eaac2478fd93c4a5ff1272250c54ab2
/org.schema/src/main/java/org/schema/Periodical.java
b08549259c682106b68419969dfbd4b3bd7f07aa
[]
no_license
schwichti/astro
2d24e0310967cde7b5b2d19f2abf4405288f07a9
ac550bf483579d78dc2cedba1d5b8fbf8f1cf22e
refs/heads/master
2021-05-05T15:15:39.769858
2018-11-26T20:28:21
2018-11-26T20:28:21
117,298,133
1
0
null
null
null
null
UTF-8
Java
false
false
408
java
package org.schema; /** * A publication in any medium issued in successive parts bearing numerical or chronological designations and intended, such as a magazine, scholarly journal, or newspaper to continue indefinitely.</p> <p>See also <a href="http://blog.schema.org/2014/09/schemaorg-support-for-bibliographic_2.html">blog post</a>. */ public class Periodical extends CreativeWorkSeries{ }
[ "schwicht@mail.upb.de" ]
schwicht@mail.upb.de
a8b28bcead6d393b319cade73391e0484c2dfe2c
e63363389e72c0822a171e450a41c094c0c1a49c
/Mate20_9_0_0/src/main/java/gov/nist/javax/sip/NistSipMessageFactoryImpl.java
94cda956d99b8afc230d04168af6fe111f5395fb
[]
no_license
solartcc/HwFrameWorkSource
fc23ca63bcf17865e99b607cc85d89e16ec1b177
5b92ed0f1ccb4bafc0fdb08b6fc4d98447b754ad
refs/heads/master
2022-12-04T21:14:37.581438
2020-08-25T04:30:43
2020-08-25T04:30:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,714
java
package gov.nist.javax.sip; import gov.nist.core.Separators; import gov.nist.core.StackLogger; import gov.nist.javax.sip.message.SIPRequest; import gov.nist.javax.sip.message.SIPResponse; import gov.nist.javax.sip.stack.MessageChannel; import gov.nist.javax.sip.stack.SIPTransaction; import gov.nist.javax.sip.stack.ServerRequestInterface; import gov.nist.javax.sip.stack.ServerResponseInterface; import gov.nist.javax.sip.stack.StackMessageFactory; import javax.sip.TransactionState; class NistSipMessageFactoryImpl implements StackMessageFactory { private SipStackImpl sipStack; public ServerRequestInterface newSIPServerRequest(SIPRequest sipRequest, MessageChannel messageChannel) { if (messageChannel == null || sipRequest == null) { throw new IllegalArgumentException("Null Arg!"); } DialogFilter retval = new DialogFilter((SipStackImpl) messageChannel.getSIPStack()); if (messageChannel instanceof SIPTransaction) { retval.transactionChannel = (SIPTransaction) messageChannel; } retval.listeningPoint = messageChannel.getMessageProcessor().getListeningPoint(); if (retval.listeningPoint == null) { return null; } if (this.sipStack.isLoggingEnabled()) { StackLogger stackLogger = this.sipStack.getStackLogger(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("Returning request interface for "); stringBuilder.append(sipRequest.getFirstLine()); stringBuilder.append(Separators.SP); stringBuilder.append(retval); stringBuilder.append(" messageChannel = "); stringBuilder.append(messageChannel); stackLogger.logDebug(stringBuilder.toString()); } return retval; } public ServerResponseInterface newSIPServerResponse(SIPResponse sipResponse, MessageChannel messageChannel) { StackLogger stackLogger; SIPTransaction tr = messageChannel.getSIPStack().findTransaction(sipResponse, null); if (this.sipStack.isLoggingEnabled()) { stackLogger = this.sipStack.getStackLogger(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("Found Transaction "); stringBuilder.append(tr); stringBuilder.append(" for "); stringBuilder.append(sipResponse); stackLogger.logDebug(stringBuilder.toString()); } if (tr != null) { if (tr.getState() == null) { if (this.sipStack.isLoggingEnabled()) { this.sipStack.getStackLogger().logDebug("Dropping response - null transaction state"); } return null; } else if (TransactionState.COMPLETED == tr.getState() && sipResponse.getStatusCode() / 100 == 1) { if (this.sipStack.isLoggingEnabled()) { stackLogger = this.sipStack.getStackLogger(); StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.append("Dropping response - late arriving "); stringBuilder2.append(sipResponse.getStatusCode()); stackLogger.logDebug(stringBuilder2.toString()); } return null; } } DialogFilter retval = new DialogFilter(this.sipStack); retval.transactionChannel = tr; retval.listeningPoint = messageChannel.getMessageProcessor().getListeningPoint(); return retval; } public NistSipMessageFactoryImpl(SipStackImpl sipStackImpl) { this.sipStack = sipStackImpl; } }
[ "lygforbs0@gmail.com" ]
lygforbs0@gmail.com
601dbdd3849520a8db12bd1bcdd9e95afebcbcb8
29159bc4c137fe9104d831a5efe346935eeb2db5
/mmj-cloud-third/src/main/java/com/qianmi/open/api/request/UnitsListRequest.java
d6b842daf95449eb11293a52abfa8b23dc9230e0
[]
no_license
xddpool/mmj-cloud
bfb06d2ef08c9e7b967c63f223fc50b1a56aac1c
de4bcb35db509ce929d516d83de765fdc2afdac5
refs/heads/master
2023-06-27T11:16:38.059125
2020-07-24T03:23:48
2020-07-24T03:23:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,595
java
package com.qianmi.open.api.request; import com.qianmi.open.api.ApiRuleException; import com.qianmi.open.api.QianmiRequest; import com.qianmi.open.api.response.UnitsListResponse; import com.qianmi.open.api.tool.util.QianmiHashMap; import com.qianmi.open.api.tool.util.RequestCheckUtils; import java.util.Map; /** * API: qianmi.elife.units.list request * * @author auto * @since 1.0 */ public class UnitsListRequest implements QianmiRequest<UnitsListResponse> { private Map<String, String> headerMap = new QianmiHashMap(); private QianmiHashMap udfParams; // add user-defined text parameters private Long timestamp; /** * 市属性V编号 */ private String cityVid; /** * 缴费项目编号,接口查询返回,多个时以','分隔 :<br>水费-c2670<br>电费-c2680<br>燃气费-c2681<br>有线电视费-c2682 */ private String projectIds; /** * 省属性V编号 */ private String provinceVid; public void setCityVid(String cityVid) { this.cityVid = cityVid; } public String getCityVid() { return this.cityVid; } public void setProjectIds(String projectIds) { this.projectIds = projectIds; } public String getProjectIds() { return this.projectIds; } public void setProvinceVid(String provinceVid) { this.provinceVid = provinceVid; } public String getProvinceVid() { return this.provinceVid; } public Long getTimestamp() { return this.timestamp; } public void setTimestamp(Long timestamp) { this.timestamp = timestamp; } public String getApiMethodName() { return "qianmi.elife.units.list"; } public Map<String, String> getTextParams() { QianmiHashMap txtParams = new QianmiHashMap(); txtParams.put("cityVid", this.cityVid); txtParams.put("projectIds", this.projectIds); txtParams.put("provinceVid", this.provinceVid); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new QianmiHashMap(); } this.udfParams.put(key, value); } public Class<UnitsListResponse> getResponseClass() { return UnitsListResponse.class; } public void check() throws ApiRuleException { RequestCheckUtils.checkNotEmpty(cityVid, "cityVid"); RequestCheckUtils.checkNotEmpty(projectIds, "projectIds"); RequestCheckUtils.checkNotEmpty(provinceVid, "provinceVid"); } public Map<String, String> getHeaderMap() { return headerMap; } }
[ "shenfuding@shenfudingdeMacBook-Pro.local" ]
shenfuding@shenfudingdeMacBook-Pro.local
26a4067a263dbfd701d19e0aa51b21f12b50d2fc
210c66c696a399cce427e7681a6e7c2269fccc11
/app/src/main/java/com/zhjydy/presenter/contract/AccountSafeContract.java
92231022e58ec67df82fb2c52e52aa8a809bfa06
[]
no_license
henryliu1988/zjydy
e2d2c5e6e27118ddf03c6a379374623e477d4194
9a665cfa3fa707c0dde012c5dff78c4b7ff64c1f
refs/heads/master
2020-09-13T08:43:37.871726
2017-06-21T12:13:54
2017-06-21T12:13:54
67,607,730
0
1
null
null
null
null
UTF-8
Java
false
false
402
java
package com.zhjydy.presenter.contract; import com.zhjydy.presenter.BasePresenter; import com.zhjydy.presenter.BaseView; /** * Created by Administrator on 2016/9/20 0020. */ public interface AccountSafeContract { interface View extends BaseView<Presenter> { void updatePhoneNum(String phoneNum); } interface Presenter extends BasePresenter { void reloadData(); } }
[ "lytao123sc@126.com" ]
lytao123sc@126.com
820591619485f7aa0280b71f4dd8eea429c35440
f822e4abb0ca705bb0ed3d4cf0ed4a3bf9be11ed
/src/main/java/org/zmlx/hg4idea/status/ui/HgIncomingOutgoingWidgetFactory.java
f2c65a6f5d655a246eaf54f74666245218e1ee3f
[ "Apache-2.0" ]
permissive
consulo/consulo-mercurial
4c642efb28bb7ef2809df1d3bd827d75221cf40e
58bc2eb6353f348254be1e716c05156040e6acae
refs/heads/master
2023-07-20T06:35:47.330892
2023-06-05T13:32:57
2023-06-05T13:32:57
19,280,973
0
0
null
2015-02-20T22:20:22
2014-04-29T15:14:40
Python
UTF-8
Java
false
false
1,649
java
package org.zmlx.hg4idea.status.ui; import consulo.project.Project; import consulo.project.ui.wm.StatusBar; import consulo.project.ui.wm.StatusBarWidget; import consulo.project.ui.wm.StatusBarWidgetFactory; import jakarta.annotation.Nonnull; import org.jetbrains.annotations.Nls; import org.zmlx.hg4idea.HgProjectSettings; import org.zmlx.hg4idea.HgVcs; import org.zmlx.hg4idea.HgVcsMessages; import java.util.Objects; abstract class HgIncomingOutgoingWidgetFactory implements StatusBarWidgetFactory { private final boolean myIsIncoming; HgIncomingOutgoingWidgetFactory(boolean isIncoming) { myIsIncoming = isIncoming; } @Override public boolean isAvailable(@Nonnull Project project) { return HgProjectSettings.getInstance(project).isCheckIncomingOutgoing(); } @Override @Nonnull public StatusBarWidget createWidget(@Nonnull Project project) { HgVcs hgVcs = Objects.requireNonNull(HgVcs.getInstance(project)); return new HgIncomingOutgoingWidget(hgVcs, myIsIncoming); } @Override public void disposeWidget(@Nonnull StatusBarWidget widget) { consulo.disposer.Disposer.dispose(widget); } @Override public boolean canBeEnabledOn(@Nonnull StatusBar statusBar) { return true; } @Override public @Nonnull String getId() { return myIsIncoming ? HgIncomingOutgoingWidget.INCOMING_WIDGET_ID : HgIncomingOutgoingWidget.OUTGOING_WIDGET_ID; } @Override public @Nls @Nonnull String getDisplayName() { return myIsIncoming ? HgVcsMessages.message("hg4idea.status.bar.incoming.widget.name") : HgVcsMessages.message("hg4idea.status.bar.outgoing.widget.name"); } }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
87a7a67406fa385e52dacf33a59022f3d5c270fb
3dd35c0681b374ce31dbb255b87df077387405ff
/generated/com/guidewire/_generated/entity/GL7CoverageFormInternal.java
2c634de77c2fd84e46704dc60e202218bd49a963
[]
no_license
walisashwini/SBTBackup
58b635a358e8992339db8f2cc06978326fed1b99
4d4de43576ec483bc031f3213389f02a92ad7528
refs/heads/master
2023-01-11T09:09:10.205139
2020-11-18T12:11:45
2020-11-18T12:11:45
311,884,817
0
0
null
null
null
null
UTF-8
Java
false
false
982
java
package com.guidewire._generated.entity; @javax.annotation.Generated(value = "com.guidewire.pl.metadata.codegen.Codegen", comments = "GL7CoverageForm.eti;GL7CoverageForm.eix;GL7CoverageForm.etx") @java.lang.SuppressWarnings(value = {"deprecation", "unchecked"}) public interface GL7CoverageFormInternal extends com.guidewire._generated.entity.RetireableInternal, com.guidewire._generated.entity.SimpleEffDatedInternal { /** * Gets the value of the Jurisdiction field. * Jurisdiction */ @gw.internal.gosu.parser.ExtendedProperty public typekey.Jurisdiction getJurisdiction(); /** * Gets the value of the Value field. * Value */ @gw.internal.gosu.parser.ExtendedProperty public java.lang.String getValue(); /** * Sets the value of the Jurisdiction field. */ public void setJurisdiction(typekey.Jurisdiction value); /** * Sets the value of the Value field. */ public void setValue(java.lang.String value); }
[ "ashwini@cruxxtechnologies.com" ]
ashwini@cruxxtechnologies.com
15a891f25f088476b0d6e2723ec78be81509a6ed
8f6c45187c3c514a81f6b654796cfc7ae2a4e4ee
/booster-android-gradle-v3_0/src/main/java/com/didiglobal/booster/gradle/VariantScopeV30.java
76a2c7f4f3a158ca432fb33aa8bf9b9e913032f9
[ "Apache-2.0" ]
permissive
Chumfuchiu/booster
48a4893ca3fe394422d8449d141587b498a02c5e
e1424246b4db27b1240e4584ffb81ea747443578
refs/heads/master
2022-10-06T21:22:33.710919
2020-06-09T03:28:27
2020-06-09T03:28:27
263,555,881
0
0
null
2020-05-13T07:24:23
2020-05-13T07:24:22
null
UTF-8
Java
false
false
4,653
java
package com.didiglobal.booster.gradle; import com.android.build.gradle.BaseExtension; import com.android.build.gradle.internal.scope.TaskOutputHolder.AnchorOutputType; import com.android.build.gradle.internal.scope.TaskOutputHolder.OutputType; import com.android.build.gradle.internal.scope.TaskOutputHolder.TaskOutputType; import com.android.build.gradle.internal.scope.VariantScope; import com.android.build.gradle.tasks.MergeResources; import com.android.ide.common.res2.ResourceSet; import com.android.sdklib.BuildToolInfo; import org.jetbrains.annotations.NotNull; import java.io.File; import java.lang.reflect.Method; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; class VariantScopeV30 { @NotNull static BaseExtension getExtension(@NotNull final VariantScope scope) { return (BaseExtension) scope.getGlobalScope().getExtension(); } /** * The merged AndroidManifest.xml */ @NotNull static Collection<File> getMergedManifests(@NotNull final VariantScope scope) { return scope.getOutput(TaskOutputType.MERGED_MANIFESTS).getFiles(); } /** * The merged resources */ @NotNull static Collection<File> getMergedRes(@NotNull final VariantScope scope) { return scope.getOutput(TaskOutputType.MERGED_RES).getFiles(); } /** * The merged assets */ @NotNull static Collection<File> getMergedAssets(@NotNull final VariantScope scope) { return scope.getOutput(TaskOutputType.MERGED_ASSETS).getFiles(); } /** * The processed resources */ @NotNull static Collection<File> getProcessedRes(@NotNull final VariantScope scope) { return scope.getOutput(TaskOutputType.PROCESSED_RES).getFiles(); } /** * All of classes */ @NotNull static Collection<File> getAllClasses(@NotNull final VariantScope scope) { return scope.getOutput(AnchorOutputType.ALL_CLASSES).getFiles(); } @NotNull static Collection<File> getSymbolList(@NotNull final VariantScope scope) { return getOutput(scope, TaskOutputType.SYMBOL_LIST); } @NotNull static Collection<File> getSymbolListWithPackageName(@NotNull final VariantScope scope) { return getOutput(scope, TaskOutputType.SYMBOL_LIST_WITH_PACKAGE_NAME); } @NotNull static Collection<File> getAar(@NotNull final VariantScope scope) { return getOutput(scope, TaskOutputType.AAR); } @NotNull static Collection<File> getApk(@NotNull final VariantScope scope) { return getOutput(scope, TaskOutputType.APK); } @NotNull static Collection<File> getJavac(@NotNull final VariantScope scope) { return getOutput(scope, TaskOutputType.JAVAC); } @NotNull static Map<String, Collection<File>> getAllArtifacts(@NotNull final VariantScope scope) { return Stream.concat(Arrays.stream(TaskOutputType.values()), Arrays.stream(AnchorOutputType.values())) .collect(Collectors.toMap(Enum::name, v -> getOutput(scope, v))); } @NotNull static Collection<File> getOutput(@NotNull final VariantScope scope, @NotNull final OutputType type) { try { return scope.getOutput(type).getFiles(); } catch (final RuntimeException e) { return Collections.emptySet(); } } @NotNull static BuildToolInfo getBuildTools(@NotNull final VariantScope scope) { return scope.getGlobalScope().getAndroidBuilder().getBuildToolInfo(); } @NotNull @SuppressWarnings("unchecked") static Collection<File> getRawAndroidResources(@NotNull final VariantScope scope) { try { final Method computeResourceSetList = MergeResources.class.getDeclaredMethod("computeResourceSetList"); computeResourceSetList.setAccessible(true); final List<ResourceSet> resources = (List<ResourceSet>) computeResourceSetList.invoke(scope.getVariantData().mergeResourcesTask); return resources.stream().map(it -> it.getSourceFiles()).flatMap(Collection::stream).collect(Collectors.toSet()); } catch (final Throwable e) { return Collections.emptySet(); } } /** * DataBindingBuilder#getBRFilePackages() */ @NotNull static File getDataBindingDependencyArtifacts(@NotNull final VariantScope scope) { File file = scope.getBuildFolderForDataBindingCompiler(); return new File(file, "dependent-lib-artifacts"); } }
[ "g.johnsonlee@gmail.com" ]
g.johnsonlee@gmail.com
63c64fa4713477716f3deb388aed6a8ca7f071e0
57e49d5426680d6aebf67e159de448236e5d83bc
/health-care/src/net/healthcare/dao/ReportDAO.java
916bd444e3af7ad584b9c8c32ce8d1c9d0d7bb8f
[]
no_license
rushikesh-19/Java
3b890f055002c1b9a43cdf8a86ac35eaef52d9c7
8e44c056fa694ac52066875a7830df2e15cb706f
refs/heads/master
2023-01-25T00:45:50.749055
2020-11-29T06:21:24
2020-11-29T06:21:24
316,889,215
0
0
null
null
null
null
UTF-8
Java
false
false
1,618
java
package net.healthcare.dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import net.healthcare.model.Report; public class ReportDAO { String user = "root"; String pwd = "root"; String connUrl = "jdbc:mysql://localhost:3306/healthcare"; Connection con = null; Statement stmt = null; public int showReport (Report report) { try { Class.forName("com.mysql.cj.jdbc.Driver"); con = DriverManager.getConnection(connUrl, user, pwd); String showReport = "update report set reportStatus = true where reportId = " + report.getReportId(); stmt = con.createStatement(); stmt.executeUpdate(showReport); stmt.close(); con.close(); } catch (Exception e) { e.printStackTrace(); } return 0; } public int hideReport (Report report) { try { Class.forName("com.mysql.cj.jdbc.Driver"); con = DriverManager.getConnection(connUrl, user, pwd); String hideReport = "update report set reportStatus = false where reportId = " + report.getReportId(); stmt = con.createStatement(); stmt.executeUpdate(hideReport); stmt.close(); con.close(); } catch (Exception e) { e.printStackTrace(); } return 0; } public int deleteReport(Report report) { try { Class.forName("com.mysql.cj.jdbc.Driver"); con = DriverManager.getConnection(connUrl, user, pwd); String deleteReport = "delete from report where reportId = " + report.getReportId(); stmt = con.createStatement(); stmt.executeUpdate(deleteReport); stmt.close(); con.close(); } catch (Exception e) { e.printStackTrace(); } return 0; } }
[ "you@example.com" ]
you@example.com
e83aef45affa364a32e5ff4b5ae9249bf06d73f2
e0f13e1839adb80398fa8fd1b2df9d2d24b7fcfa
/chaos-design/src/main/java/com/amos/design/behavior/iterator/IteratorImpl.java
56a30995c18b67393c3dfd34605efca8784eede0
[]
no_license
AmosWang0626/chaos
617d41490d62bb7c7ac1743148b452bf17480842
4736fb9dc89d3ebd25ebbba4c377da9434a6d1ed
refs/heads/master
2023-06-23T09:23:18.242936
2023-02-23T14:44:58
2023-02-23T14:44:58
118,746,909
1
0
null
2023-06-14T22:32:56
2018-01-24T10:01:04
Java
UTF-8
Java
false
false
858
java
package com.amos.design.behavior.iterator; /** * DESCRIPTION: 迭代器实现类 * * @author <a href="mailto:amos.wang@xiaoi.com">amos.wang</a> * @date 2/28/2020 */ public class IteratorImpl<T> extends BaseIterator<T> { private int current = 0; public IteratorImpl(BaseCluster<T> cluster) { super(cluster); } @Override public T first() { return getCluster().get(0); } @Override public T current() { return getCluster().get(current); } @Override public T next() { return getCluster().get(++current); } @Override public Boolean hasNext() { return current < getCluster().size(); } @Override public void range() { System.out.println(first()); do { System.out.println(next()); } while (hasNext()); } }
[ "1833063210@qq.com" ]
1833063210@qq.com
8e428a6d090353c7104aba514aca90e2ec54ae40
3389348b101e48c482476ffb8c172712981286a8
/src/CL7/IOStream/BufferedStream/Demo3BufferedWriter.java
7ec2505491c831872829f55d20d931390813b59d
[]
no_license
7IsEnough/workspace4Java
2b78c0d11acc181f85642b5131959e0b9bd88843
154871364907aadb7f70ccd9d606e9c1b2b0b021
refs/heads/master
2023-03-09T20:17:28.867838
2021-02-20T11:44:48
2021-02-20T11:44:48
340,636,805
0
0
null
null
null
null
UTF-8
Java
false
false
805
java
package CL7.IOStream.BufferedStream; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; /** * @author Promise * @create 2019-08-20-20:45 */ public class Demo3BufferedWriter { public static void main(String[] args) throws IOException { //创建字符缓冲输出流对象,构造方法中传递字符输出流 BufferedWriter bw = new BufferedWriter(new FileWriter("G:\\workspace4Java\\c.txt")); //使用write方法,把数据写入内存缓冲区中 for (int i = 0; i < 10; i++) { bw.write("明凯"); // bw.write("\r\n"); bw.newLine(); } //使用flush方法将内存缓冲区的数据,刷新到文件中 bw.flush(); //释放资源 bw.close(); } }
[ "976949689@qq.com" ]
976949689@qq.com
145661e8ad8202d37ffa0cc87f6ad7a0bde045f4
8dc84558f0058d90dfc4955e905dab1b22d12c08
/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationTestRule.java
74ecbf1449fcc6b90108db8eddc15273bdacdf75
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
meniossin/src
42a95cc6c4a9c71d43d62bc4311224ca1fd61e03
44f73f7e76119e5ab415d4593ac66485e65d700a
refs/heads/master
2022-12-16T20:17:03.747113
2020-09-03T10:43:12
2020-09-03T10:43:12
263,710,168
1
0
BSD-3-Clause
2020-05-13T18:20:09
2020-05-13T18:20:08
null
UTF-8
Java
false
false
6,327
java
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.notifications; import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; import android.app.Notification; import android.support.test.InstrumentationRegistry; import org.junit.Assert; import org.junit.runner.Description; import org.junit.runners.model.Statement; import org.chromium.base.ThreadUtils; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.preferences.website.ContentSetting; import org.chromium.chrome.browser.preferences.website.NotificationInfo; import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.util.browser.notifications.MockNotificationManagerProxy; import org.chromium.chrome.test.util.browser.notifications.MockNotificationManagerProxy.NotificationEntry; import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.net.test.EmbeddedTestServer; import java.util.List; import java.util.concurrent.TimeoutException; /** * Base class for instrumentation tests using Web Notifications on Android. * * Web Notifications are only supported on Android JellyBean and beyond. */ public class NotificationTestRule extends ChromeActivityTestRule<ChromeTabbedActivity> { /** The maximum time to wait for a criteria to become valid. */ private static final long MAX_TIME_TO_POLL_MS = scaleTimeout(6000); /** The polling interval to wait between checking for a satisfied criteria. */ private static final long POLLING_INTERVAL_MS = 50; private MockNotificationManagerProxy mMockNotificationManager; private EmbeddedTestServer mTestServer; public NotificationTestRule() { super(ChromeTabbedActivity.class); } private void setUp() throws Exception { // The NotificationPlatformBridge must be overriden prior to the browser process starting. mMockNotificationManager = new MockNotificationManagerProxy(); NotificationPlatformBridge.overrideNotificationManagerForTesting(mMockNotificationManager); startMainActivityFromLauncher(); mTestServer = EmbeddedTestServer.createAndStartServer( InstrumentationRegistry.getInstrumentation().getContext()); } private void tearDown() throws Exception { NotificationPlatformBridge.overrideNotificationManagerForTesting(null); mTestServer.stopAndDestroyServer(); } /** Returns the test server. */ public EmbeddedTestServer getTestServer() { return mTestServer; } /** * Returns the origin of the HTTP server the test is being ran on. */ public String getOrigin() { return mTestServer.getURL("/"); } /** * Sets the permission to use Web Notifications for the test HTTP server's origin to |setting|. */ public void setNotificationContentSettingForCurrentOrigin(final ContentSetting setting) throws InterruptedException, TimeoutException { final String origin = getOrigin(); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { // The notification content setting does not consider the embedder origin. NotificationInfo notificationInfo = new NotificationInfo(origin, "", false); notificationInfo.setContentSetting(setting); } }); String permission = runJavaScriptCodeInCurrentTab("Notification.permission"); if (setting == ContentSetting.ALLOW) { Assert.assertEquals("\"granted\"", permission); } else if (setting == ContentSetting.BLOCK) { Assert.assertEquals("\"denied\"", permission); } else { Assert.assertEquals("\"default\"", permission); } } /** * Shows a notification with |title| and |options|, waits until it has been displayed and then * returns the Notification object to the caller. Requires that only a single notification is * being displayed in the notification manager. * * @param title Title of the Web Notification to show. * @param options Optional map of options to include when showing the notification. * @return The Android Notification object, as shown in the framework. */ public Notification showAndGetNotification(String title, String options) throws InterruptedException, TimeoutException { runJavaScriptCodeInCurrentTab("showNotification(\"" + title + "\", " + options + ");"); return waitForNotification().notification; } /** * Waits until a notification has been displayed and then returns a NotificationEntry object to * the caller. Requires that only a single notification is displayed. * * @return The NotificationEntry object tracked by the MockNotificationManagerProxy. */ public NotificationEntry waitForNotification() { waitForNotificationManagerMutation(); List<NotificationEntry> notifications = getNotificationEntries(); Assert.assertEquals(1, notifications.size()); return notifications.get(0); } public List<NotificationEntry> getNotificationEntries() { return mMockNotificationManager.getNotifications(); } /** * Waits for a mutation to occur in the mocked notification manager. This indicates that Chrome * called into Android to notify or cancel a notification. */ public void waitForNotificationManagerMutation() { CriteriaHelper.pollUiThread(new Criteria() { @Override public boolean isSatisfied() { return mMockNotificationManager.getMutationCountAndDecrement() > 0; } }, MAX_TIME_TO_POLL_MS, POLLING_INTERVAL_MS); } @Override public Statement apply(final Statement base, Description description) { return super.apply(new Statement() { @Override public void evaluate() throws Throwable { setUp(); base.evaluate(); tearDown(); } }, description); } }
[ "arnaud@geometry.ee" ]
arnaud@geometry.ee
4a6d2a62993c0930ddf6fb68ad954dba638cb867
27940e6113e54f8c66eb951af1f35e8ec4c3884c
/app/src/main/java/com/wrk/myshoppingmall/utils/zxing/encoding/EncodingUtils.java
8900c17f69d5bedfbb22c11a983cc5cfa9755f9b
[]
no_license
tsj123/ShoppingMall
bd8373ab97127104848503a11b57c8c658bed33a
dd4b99d71bb82c2af0f5d2688660dd0993fe6425
refs/heads/master
2021-06-08T13:45:00.837656
2016-11-28T10:47:09
2016-11-28T10:47:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,901
java
package com.wrk.myshoppingmall.utils.zxing.encoding; import android.graphics.Bitmap; import android.graphics.Canvas; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.QRCodeWriter; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; import java.util.HashMap; import java.util.Map; /** * 二维码生成工具类 */ public class EncodingUtils { /** * 创建二维码 * * @param content content * @param widthPix widthPix * @param heightPix heightPix * @param logoBm logoBm * @return 二维码 */ public static Bitmap createQRCode(String content, int widthPix, int heightPix, Bitmap logoBm) { try { if (content == null || "".equals(content)) { return null; } // 配置参数 Map<EncodeHintType, Object> hints = new HashMap<EncodeHintType, Object>(); hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); // 容错级别 hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 图像数据转换,使用了矩阵转换 BitMatrix bitMatrix = new QRCodeWriter().encode(content, BarcodeFormat.QR_CODE, widthPix, heightPix, hints); int[] pixels = new int[widthPix * heightPix]; // 下面这里按照二维码的算法,逐个生成二维码的图片, // 两个for循环是图片横列扫描的结果 for (int y = 0; y < heightPix; y++) { for (int x = 0; x < widthPix; x++) { if (bitMatrix.get(x, y)) { pixels[y * widthPix + x] = 0xff000000; } else { pixels[y * widthPix + x] = 0xffffffff; } } } // 生成二维码图片的格式,使用ARGB_8888 Bitmap bitmap = Bitmap.createBitmap(widthPix, heightPix, Bitmap.Config.ARGB_8888); bitmap.setPixels(pixels, 0, widthPix, 0, 0, widthPix, heightPix); if (logoBm != null) { bitmap = addLogo(bitmap, logoBm); } //必须使用compress方法将bitmap保存到文件中再进行读取。直接返回的bitmap是没有任何压缩的,内存消耗巨大! return bitmap; } catch (WriterException e) { e.printStackTrace(); } return null; } /** * 在二维码中间添加Logo图案 */ private static Bitmap addLogo(Bitmap src, Bitmap logo) { if (src == null) { return null; } if (logo == null) { return src; } //获取图片的宽高 int srcWidth = src.getWidth(); int srcHeight = src.getHeight(); int logoWidth = logo.getWidth(); int logoHeight = logo.getHeight(); if (srcWidth == 0 || srcHeight == 0) { return null; } if (logoWidth == 0 || logoHeight == 0) { return src; } //logo大小为二维码整体大小的1/5 float scaleFactor = srcWidth * 1.0f / 5 / logoWidth; Bitmap bitmap = Bitmap.createBitmap(srcWidth, srcHeight, Bitmap.Config.ARGB_8888); try { Canvas canvas = new Canvas(bitmap); canvas.drawBitmap(src, 0, 0, null); canvas.scale(scaleFactor, scaleFactor, srcWidth / 2, srcHeight / 2); canvas.drawBitmap(logo, (srcWidth - logoWidth) / 2, (srcHeight - logoHeight) / 2, null); canvas.save(Canvas.ALL_SAVE_FLAG); canvas.restore(); } catch (Exception e) { bitmap = null; e.getStackTrace(); } return bitmap; } }
[ "1024057635@qq.com" ]
1024057635@qq.com
1d7e443b1281541593b73ef72d1818021bc6b39a
072216667ef59e11cf4994220ea1594538db10a0
/googleplay/com/google/gson/internal/Primitives.java
f6143f0d0b4459f141c5a8a0b844f04ecdf1c0a1
[]
no_license
jackTang11/REMIUI
896037b74e90f64e6f7d8ddfda6f3731a8db6a74
48d65600a1b04931a510e1f036e58356af1531c0
refs/heads/master
2021-01-18T05:43:37.754113
2015-07-03T04:01:06
2015-07-03T04:01:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,889
java
package com.google.gson.internal; import java.lang.reflect.Type; import java.util.Collections; import java.util.HashMap; import java.util.Map; public final class Primitives { private static final Map<Class<?>, Class<?>> PRIMITIVE_TO_WRAPPER_TYPE; private static final Map<Class<?>, Class<?>> WRAPPER_TO_PRIMITIVE_TYPE; static { Map<Class<?>, Class<?>> primToWrap = new HashMap(16); Map<Class<?>, Class<?>> wrapToPrim = new HashMap(16); add(primToWrap, wrapToPrim, Boolean.TYPE, Boolean.class); add(primToWrap, wrapToPrim, Byte.TYPE, Byte.class); add(primToWrap, wrapToPrim, Character.TYPE, Character.class); add(primToWrap, wrapToPrim, Double.TYPE, Double.class); add(primToWrap, wrapToPrim, Float.TYPE, Float.class); add(primToWrap, wrapToPrim, Integer.TYPE, Integer.class); add(primToWrap, wrapToPrim, Long.TYPE, Long.class); add(primToWrap, wrapToPrim, Short.TYPE, Short.class); add(primToWrap, wrapToPrim, Void.TYPE, Void.class); PRIMITIVE_TO_WRAPPER_TYPE = Collections.unmodifiableMap(primToWrap); WRAPPER_TO_PRIMITIVE_TYPE = Collections.unmodifiableMap(wrapToPrim); } private static void add(Map<Class<?>, Class<?>> forward, Map<Class<?>, Class<?>> backward, Class<?> key, Class<?> value) { forward.put(key, value); backward.put(value, key); } public static boolean isPrimitive(Type type) { return PRIMITIVE_TO_WRAPPER_TYPE.containsKey(type); } public static boolean isWrapperType(Type type) { return WRAPPER_TO_PRIMITIVE_TYPE.containsKey(C$Gson$Preconditions.checkNotNull(type)); } public static <T> Class<T> wrap(Class<T> type) { Class<T> wrapped = (Class) PRIMITIVE_TO_WRAPPER_TYPE.get(C$Gson$Preconditions.checkNotNull(type)); return wrapped == null ? type : wrapped; } }
[ "songjd@putao.com" ]
songjd@putao.com
aca18d897b47b28da46ea1b1afa86ee11b09c12f
16435878ec235617cce6b6422eeaeb27d3009131
/src/test/java/com/opencart/test/service/OcUploadServiceTest.java
e02bcef0145f3d6a97dcc89a1dfa7742f4f0f97c
[]
no_license
gmai2006/opencarttest
fa2207f35046ba636ffef8107a4a6e9ffc57b1bb
b73df234af5bd431b56d038c4aec7aa5383ff1ce
refs/heads/main
2023-09-02T20:01:51.767075
2021-10-16T07:40:18
2021-10-16T07:40:18
417,754,843
0
0
null
null
null
null
UTF-8
Java
false
false
2,777
java
/** * %% Copyright (C) 2021 DataScience 9 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 * * <p>http://www.apache.org/licenses/LICENSE-2.0 * * <p>Unless required by applicable law or agreed to in writing, software distributed under the * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing permissions and * limitations under the License. #L% * * <p>This code is 100% AUTO generated. Please do not modify it DIRECTLY If you need new features or * function or changes please update the templates then submit the template through our web * interface. */ package com.opencart.test.service; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.opencart.test.entity.OcUpload; import com.opencart.test.utils.ByteArrayToBase64TypeAdapter; import com.opencart.test.utils.FileUtils; import java.io.IOException; import java.nio.charset.Charset; import org.junit.BeforeClass; import org.junit.Test; public class OcUploadServiceTest { private static DefaultOcUploadService serviceMock; private static OcUpload[] records; static Gson gson = new GsonBuilder() .registerTypeHierarchyAdapter(byte[].class, new ByteArrayToBase64TypeAdapter()) .setDateFormat("yyyy-MM-dd HH:mm:ss.S") .create(); /** Run when the class is loaded. */ @BeforeClass public static void setUp() { serviceMock = mock(DefaultOcUploadService.class); String inputFile = "OcUpload.json"; try { String json = FileUtils.readFileFromResource2String(inputFile, Charset.defaultCharset()); records = gson.fromJson(json, OcUpload[].class); } catch (IOException ex) { ex.printStackTrace(); } // test data when(serviceMock.find(records[0].getUploadId())).thenReturn(records[0]); } @Test public void testFind_success() { OcUpload testResult = serviceMock.find(records[0].getUploadId()); org.junit.Assert.assertNotNull(testResult); org.junit.Assert.assertEquals( "expect equals name ", records[0].getName(), testResult.getName()); org.junit.Assert.assertEquals( "expect equals filename ", records[0].getFilename(), testResult.getFilename()); org.junit.Assert.assertEquals( "expect equals code ", records[0].getCode(), testResult.getCode()); } }
[ "gmai2006@gmail.com" ]
gmai2006@gmail.com
54dda5edd9719b344c19a957e31b0f0e1471972a
273117f18ecbb9b89f13fe1a088f0423708e8162
/src/main/java/com/maimeng/jd/global/exception/NoLoginException.java
2d2e77caedea910aeac5f582d59cfd17680a78e5
[]
no_license
haoguoji123456/mm_jd
0dc587d4bef1222c119ac9dac0cfd3d38d1aff71
92b21656f7fd3237912fb29b8ff983796cb84f7c
refs/heads/master
2020-05-25T02:53:34.834440
2019-05-20T07:00:29
2019-05-20T07:00:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
285
java
package com.maimeng.jd.global.exception; /** * @author wuweifeng wrote on 2017/10/27. */ public class NoLoginException extends RuntimeException { public NoLoginException() { super(); } public NoLoginException(String message) { super(message); } }
[ "272551766@qq.com" ]
272551766@qq.com
85812ee21d47b45e1814a94a067fa93052635f23
44c957da8735439b1262c33b8cb4e0bcf8e1e67b
/Crystal/src/com/xinlan/crystal/role/Dump.java
3e68c0705e561fde46c8e450fb26cd70e1c3d04b
[]
no_license
siwangqishiq/Crystal
9c3f3247cac8cdaace34e4818ef1919b5a1258d2
6e4220f1863af6f9c1930a309421c9bdb5703fd5
refs/heads/master
2020-04-05T23:26:44.870290
2014-07-23T09:43:15
2014-07-23T09:43:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
948
java
package com.xinlan.crystal.role; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector2; import com.xinlan.crystal.Resource; import com.xinlan.crystal.screen.GameScreen; public class Dump extends Sprite { private GameScreen mContext; private Vector2 pos = new Vector2(); public Dump(GameScreen context) { this.mContext = context; this.set(Resource.getInstance().dumpPink); pos.x = 100; pos.y = 400; this.setPosition(pos.x, pos.y); } public void draw(SpriteBatch batch) { super.draw(batch); //this.setColor(1f, 1f, 1f, 1f); //this.setOrigin(getWidth()/2, getHeight()/2); // this.rotate(1); // this.scale(0.01f); //this.setSize(this.getHeight(), this.getWidth()+1); } }//end class
[ "525647740@qq.com" ]
525647740@qq.com
caacd3caf7fec45afe1be2a71d875487b39d7a18
46ef04782c58b3ed1d5565f8ac0007732cddacde
/app/xmi/src/org/modelio/xmi/model/objing/OPropertyType.java
a61f35f182d0074b8db416b6849f5c079c9a8440
[]
no_license
daravi/modelio
844917412abc21e567ff1e9dd8b50250515d6f4b
1787c8a836f7e708a5734d8bb5b8a4f1a6008691
refs/heads/master
2020-05-26T17:14:03.996764
2019-05-23T21:30:10
2019-05-23T21:30:45
188,309,762
0
1
null
null
null
null
UTF-8
Java
false
false
2,184
java
/* * Copyright 2013-2018 Modeliosoft * * This file is part of Modelio. * * Modelio is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Modelio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Modelio. If not, see <http://www.gnu.org/licenses/>. * */ package org.modelio.xmi.model.objing; import com.modeliosoft.modelio.javadesigner.annotations.objid; import org.modelio.metamodel.uml.infrastructure.properties.PropertyType; import org.modelio.xmi.generation.GenerationProperties; import org.modelio.xmi.plugin.Xmi; @objid ("4ae742cf-75a4-4a00-a96c-f72bc8fe5ce2") public class OPropertyType extends OElement implements IOElement { @objid ("4dd28ae9-c61a-4acb-a67b-4ab4085077f4") @Override public org.eclipse.uml2.uml.Element createEcoreElt() { // TODO Auto-generated method stub String metaClassName = this.getClass().getSimpleName(); // String packagingStr = "org.modelio.xmi.model.objing"; metaClassName = metaClassName.substring(1); String message = Xmi.I18N.getMessage("logFile.warning.elementNotMapped", metaClassName); GenerationProperties.getInstance().addWarning(message, getObjingElement()); return null; } @objid ("fe0111c7-8ba6-4efb-a68d-bef91f969cd3") public OPropertyType(PropertyType param) { super(param); } @objid ("45c0467b-f433-44ce-9132-d9579ac548d4") @Override public void attach(org.eclipse.uml2.uml.Element ecoreElt) { // TODO Auto-generated method stub } @objid ("258ec8ac-c6dc-48c5-9917-6f68993781ee") @Override public void setProperties(org.eclipse.uml2.uml.Element ecoreElt) { // TODO Auto-generated method stub } }
[ "puya@motionmetrics.com" ]
puya@motionmetrics.com
9461763da6c5c91a4960bc93937ae21a489bb8b8
a280aa9ac69d3834dc00219e9a4ba07996dfb4dd
/regularexpress/home/weilaidb/work/app/hadoop-2.7.3-src/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSInputStream.java
1bd1d869b749485f3fd3a20799d329afb14dccad
[]
no_license
weilaidb/PythonExample
b2cc6c514816a0e1bfb7c0cbd5045cf87bd28466
798bf1bdfdf7594f528788c4df02f79f0f7827ce
refs/heads/master
2021-01-12T13:56:19.346041
2017-07-22T16:30:33
2017-07-22T16:30:33
68,925,741
4
2
null
null
null
null
UTF-8
Java
false
false
414
java
package org.apache.hadoop.fs; import java.io.*; import java.nio.ByteBuffer; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.fs.ZeroCopyUnavailableException; @InterfaceAudience.LimitedPrivate() @InterfaceStability.Unstable public abstract class FSInputStream extends InputStream implements Seekable, PositionedReadable
[ "weilaidb@localhost.localdomain" ]
weilaidb@localhost.localdomain
d7aa61b79119603cdf82dcb243f1565f7d6fc2c8
7e1511cdceeec0c0aad2b9b916431fc39bc71d9b
/flakiness-predicter/input_data/original_tests/apache-hbase/nonFlakyMethods/org.apache.hadoop.hbase.regionserver.TestStoreScanner-testWildCardOneVersionScan.java
c8f9b003af45c8ffc70e7fabbe238fd69b826ce3
[ "BSD-3-Clause" ]
permissive
Taher-Ghaleb/FlakeFlagger
6fd7c95d2710632fd093346ce787fd70923a1435
45f3d4bc5b790a80daeb4d28ec84f5e46433e060
refs/heads/main
2023-07-14T16:57:24.507743
2021-08-26T14:50:16
2021-08-26T14:50:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
public void testWildCardOneVersionScan() throws IOException { KeyValue[] kvs=new KeyValue[]{KeyValueTestUtil.create("R1","cf","a",2,KeyValue.Type.Put,"dont-care"),KeyValueTestUtil.create("R1","cf","b",1,KeyValue.Type.Put,"dont-care"),KeyValueTestUtil.create("R1","cf","a",1,KeyValue.Type.DeleteColumn,"dont-care")}; KeyValueScanner[] scanners=new KeyValueScanner[]{new KeyValueScanFixture(KeyValue.COMPARATOR,kvs)}; StoreScanner scan=new StoreScanner(new Scan(Bytes.toBytes("R1")),CF,Long.MAX_VALUE,KeyValue.COMPARATOR,null,scanners); List<KeyValue> results=new ArrayList<KeyValue>(); assertEquals(true,scan.next(results)); assertEquals(2,results.size()); assertEquals(kvs[0],results.get(0)); assertEquals(kvs[1],results.get(1)); }
[ "aalsha2@masonlive.gmu.edu" ]
aalsha2@masonlive.gmu.edu
8aa970f35ac9dc8d64557dc5c7ab7bc3df1ca2ab
2b8c47031dddd10fede8bcf16f8db2b52521cb4f
/subject SPLs and test cases/BerkeleyDB(5)/BerkeleyDB_P5/evosuite-tests4/com/sleepycat/je/txn/WriteLockInfo_ESTest4.java
5e3812b51c60c7c5dc533449910545db10f3cf79
[]
no_license
psjung/SRTST_experiments
6f1ff67121ef43c00c01c9f48ce34f31724676b6
40961cb4b4a1e968d1e0857262df36832efb4910
refs/heads/master
2021-06-20T04:45:54.440905
2019-09-06T04:05:38
2019-09-06T04:05:38
206,693,757
1
0
null
2020-10-13T15:50:41
2019-09-06T02:10:06
Java
UTF-8
Java
false
false
2,120
java
/* * This file was automatically generated by EvoSuite * Sat Apr 22 16:39:48 KST 2017 */ package com.sleepycat.je.txn; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVNET = true) public class WriteLockInfo_ESTest4 extends WriteLockInfo_ESTest_scaffolding4 { @Test public void test0() throws Throwable { WriteLockInfo writeLockInfo0 = new WriteLockInfo((Lock) null); long long0 = writeLockInfo0.getAbortLsn(); assertEquals((-1L), long0); assertFalse(writeLockInfo0.getAbortKnownDeleted()); } @Test public void test1() throws Throwable { Long long0 = new Long(9223372036854775807L); Lock lock0 = new Lock(long0); WriteLockInfo writeLockInfo0 = new WriteLockInfo(lock0); assertEquals((-1L), writeLockInfo0.getAbortLsn()); assertFalse(writeLockInfo0.getAbortKnownDeleted()); } @Test public void test2() throws Throwable { WriteLockInfo writeLockInfo0 = new WriteLockInfo((Lock) null); assertFalse(writeLockInfo0.getAbortKnownDeleted()); writeLockInfo0.abortKnownDeleted = true; boolean boolean0 = writeLockInfo0.getAbortKnownDeleted(); assertTrue(boolean0); } @Test public void test3() throws Throwable { WriteLockInfo writeLockInfo0 = new WriteLockInfo(); assertTrue(writeLockInfo0.getAbortKnownDeleted()); assertEquals((-1L), writeLockInfo0.getAbortLsn()); } @Test public void test4() throws Throwable { WriteLockInfo writeLockInfo0 = WriteLockInfo.basicWriteLockInfo; boolean boolean0 = writeLockInfo0.getAbortKnownDeleted(); assertTrue(boolean0); } @Test public void test5() throws Throwable { WriteLockInfo writeLockInfo0 = WriteLockInfo.basicWriteLockInfo; long long0 = writeLockInfo0.getAbortLsn(); assertEquals((-1L), long0); } }
[ "psjung@kaist.ac.kr" ]
psjung@kaist.ac.kr
7fc4fd7539d10a3523ae01177f5c5fd96a6a799a
279bffecb84102ab7a91726607a5e4c1d18e961f
/marketing/marketing-web/src/main/java/com/qcloud/component/marketing/web/form/MerchandiseCustomClassificationForm.java
449fcd3612630627c186398b858cfd96815a96ba
[]
no_license
ChiRains/forest
8b71de51c477f66a134d9b515b58039a8c94c2ee
cf0b41ff83e4cee281078afe338bba792de05052
refs/heads/master
2021-01-19T07:13:19.597344
2016-08-18T01:35:54
2016-08-18T01:35:54
65,869,894
0
2
null
null
null
null
UTF-8
Java
false
false
970
java
package com.qcloud.component.marketing.web.form; import java.util.ArrayList; import java.util.List; public class MerchandiseCustomClassificationForm { private long classifyId; private List<Long> unifiedMerchandiseIds = new ArrayList<Long>(); private List<Integer> orderNums = new ArrayList<Integer>(); public List<Long> getUnifiedMerchandiseIds() { return unifiedMerchandiseIds; } public void setUnifiedMerchandiseIds(List<Long> unifiedMerchandiseIds) { this.unifiedMerchandiseIds = unifiedMerchandiseIds; } public List<Integer> getOrderNums() { return orderNums; } public void setOrderNums(List<Integer> orderNums) { this.orderNums = orderNums; } public long getClassifyId() { return classifyId; } public void setClassifyId(long classifyId) { this.classifyId = classifyId; } }
[ "dengfei@ed19df75-bd51-b445-9863-9e54940520a8" ]
dengfei@ed19df75-bd51-b445-9863-9e54940520a8
8cfa7a23ede25a585591d2c377db8927f346cc5b
6552244c7ef44150ea74cef7ec801d5a9f7171e9
/app/src/main/java/com/google/android/gms/location/reporting/Reporting.java
079ab0e748b2b290d81a1a9c85235b80559b2d95
[]
no_license
amithbm/cbskeep
c9469156efd307fb474d817760a0b426af8f7c5c
a800f00ab617cba49d1a1bea1f0282c0cde525e7
refs/heads/master
2016-09-06T12:42:33.824977
2015-08-24T15:33:50
2015-08-24T15:33:50
41,311,235
0
0
null
null
null
null
UTF-8
Java
false
false
559
java
package com.google.android.gms.location.reporting; public abstract interface Reporting { public static final class Setting { public static boolean isOn(int paramInt) { return paramInt > 0; } public static int sanitize(int paramInt) { int i = paramInt; switch (paramInt) { default: if (!isOn(paramInt)) break; case -2: case -1: case 0: case 1: } for (paramInt = 99; ; paramInt = -3) { i = paramInt; return i; } } } }
[ "amithbm@gmail.com" ]
amithbm@gmail.com
569b811f20d031b652ca18c5c7cf191a30ce6807
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_63c7827b704fe8a7d1600711bfaa75be9f52fcbd/CeylonDocModelLoader/9_63c7827b704fe8a7d1600711bfaa75be9f52fcbd_CeylonDocModelLoader_s.java
5c64cf9b9be8ee81ddfdcf53bab4b73d16e7c684
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,776
java
/* * Copyright Red Hat Inc. and/or its affiliates and other contributors * as indicated by the authors tag. All rights reserved. * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU General Public License version 2. * * This particular file is subject to the "Classpath" exception as provided in the * LICENSE file that accompanied this code. * * This program is distributed in the hope that it will be useful, but WITHOUT A * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License, * along with this distribution; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ package com.redhat.ceylon.ceylondoc; import java.io.File; import java.util.List; import com.redhat.ceylon.cmr.api.ArtifactResult; import com.redhat.ceylon.cmr.impl.JULLogger; import com.redhat.ceylon.compiler.loader.impl.reflect.ReflectionModelLoader; import com.redhat.ceylon.compiler.loader.model.LazyModule; import com.redhat.ceylon.compiler.typechecker.analyzer.ModuleManager; import com.redhat.ceylon.compiler.typechecker.model.Module; import com.redhat.ceylon.compiler.typechecker.model.Modules; /** * A model loader which uses Java reflection. * * @author Stéphane Épardaud <stef@epardaud.fr> */ public class CeylonDocModelLoader extends ReflectionModelLoader { ModulesClassLoader classLoader = new ModulesClassLoader(); public CeylonDocModelLoader(ModuleManager moduleManager, Modules modules){ super(moduleManager, modules, new JULLogger()); } @Override protected Class<?> loadClass(String name) { Class<?> klass = null; try { klass = classLoader.loadClass(name); } catch (ClassNotFoundException e) { // ignore } return klass; } @Override public void addModuleToClassPath(final Module module, ArtifactResult artifact) { if(artifact == null) return; File file = artifact.artifact(); classLoader.addJar(file); if(module instanceof LazyModule){ ((LazyModule) module).loadPackageList(artifact); } } @Override protected List<String> getPackageList(String packageName) { return classLoader.getPackageList(packageName); } @Override protected boolean packageExists(String packageName) { return classLoader.packageExists(packageName); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
574e385163b10767ee88c180be07d1c1afbd58a2
366f0c1f5ae80ba013a1960cd00a1c74a07becb3
/Sample/src/main/java/la/xiong/androidquick/demo/MyApplication.java
0d5a24d3f171fee3f842f5cb26d5d5f2e13a9a36
[ "Apache-2.0", "MIT" ]
permissive
jkabcd/AndroidQuick-master
8bd392b8a2fa095618216486b6ff422dbe31b43d
73e51404c86cab204d04a2eeca6ce34dd3494204
refs/heads/master
2020-04-12T06:14:14.663091
2018-12-18T21:30:19
2018-12-18T21:30:19
162,347,076
0
0
null
null
null
null
UTF-8
Java
false
false
2,077
java
package la.xiong.androidquick.demo; import android.app.Application; import com.blankj.utilcode.util.Utils; import la.xiong.androidquick.demo.db.DBManager; import la.xiong.androidquick.demo.injector.component.ApplicationComponent; import la.xiong.androidquick.demo.injector.component.DaggerApplicationComponent; import la.xiong.androidquick.demo.injector.module.ApplicationModule; import la.xiong.androidquick.demo.tool.Density; import la.xiong.androidquick.network.RetrofitManager; import la.xiong.androidquick.tool.SpUtil; import la.xiong.androidquick.tool.ToastUtil; import spa.lyh.cn.statusbarlightmode.ImmersionConfiguration; import spa.lyh.cn.statusbarlightmode.ImmersionMode; /** * @author ddnosh * @website http://blog.csdn.net/ddnosh */ public class MyApplication extends Application { private static MyApplication INSTANCE; @Override public void onCreate() { super.onCreate(); //获取全局变量Application if (INSTANCE == null) { INSTANCE = this; } //初始化ToastUtil ToastUtil.register(this); //初始化SpUtil SpUtil.init(this); //初始化greendao DBManager.getInstance().init(getApplicationContext()); //初始化url RetrofitManager.initBaseUrl("http://gank.io/api/"); //沉浸式标题栏 ImmersionConfiguration configuration = new ImmersionConfiguration.Builder(this) .enableImmersionMode(ImmersionConfiguration.ENABLE) .setColor(R.color.base_bg)//默认标题栏颜色 .build(); ImmersionMode.getInstance().init(configuration); //初始化AndroidUtilCode Utils.init(this); Density.setDensity(this,360); } public static synchronized MyApplication getInstance() { return INSTANCE; } //dagger2:get ApplicationComponent public static ApplicationComponent getApplicationComponent() { return DaggerApplicationComponent.builder().applicationModule(new ApplicationModule(INSTANCE)).build(); } }
[ "610184089@qq.com" ]
610184089@qq.com
797d38d0154b8744e8e64a18d6f90f24f4486760
ebff4108ace2fcbfbd2bc3dea924f8da88654149
/app/src/main/java/douya/ui/ArrayAdapterCompat.java
d4bba08121d4afcc3b6ad48355d1c1fe2fdf63be
[]
no_license
447857062/client_douban
9b046512a84bee48b343f77ff3d214c672450888
4e0b677e3e6e5cee8d2922e0cdf67d6129276351
refs/heads/master
2020-03-19T06:01:10.211955
2018-06-14T01:47:54
2018-06-14T01:47:54
135,983,473
1
0
null
null
null
null
UTF-8
Java
false
false
5,086
java
/* * Copyright (c) 2018 Zhang Hai <Dreaming.in.Code.ZH@Gmail.com> * All Rights Reserved. */ package douya.ui; import android.content.Context; import android.content.res.Resources; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.ThemedSpinnerAdapter; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import java.util.List; public class ArrayAdapterCompat<T> extends ArrayAdapter<T> implements ThemedSpinnerAdapter { /* * @see ArrayAdapter#mDropDownResource */ private int mDropDownResource; /* * @see ArrayAdapter#mFieldId */ private int mFieldId; private ThemedSpinnerAdapter.Helper mHelper; /** * {@inheritDoc} */ public ArrayAdapterCompat(@NonNull Context context, int resource) { super(context, resource); init(resource, 0); } /** * {@inheritDoc} */ public ArrayAdapterCompat(@NonNull Context context, int resource, int textViewResourceId) { super(context, resource, textViewResourceId); init(resource, textViewResourceId); } /** * {@inheritDoc} */ public ArrayAdapterCompat(@NonNull Context context, int resource, @NonNull T[] objects) { super(context, resource, objects); init(resource, 0); } /** * {@inheritDoc} */ public ArrayAdapterCompat(@NonNull Context context, int resource, int textViewResourceId, @NonNull T[] objects) { super(context, resource, textViewResourceId, objects); init(resource, textViewResourceId); } /** * {@inheritDoc} */ public ArrayAdapterCompat(@NonNull Context context, int resource, @NonNull List<T> objects) { super(context, resource, objects); init(resource, 0); } /** * {@inheritDoc} */ public ArrayAdapterCompat(@NonNull Context context, int resource, int textViewResourceId, @NonNull List<T> objects) { super(context, resource, textViewResourceId, objects); init(resource, textViewResourceId); } private void init(int resource, int textViewResourceId) { mDropDownResource = resource; mFieldId = textViewResourceId; mHelper = new ThemedSpinnerAdapter.Helper(getContext()); } /** * {@inheritDoc} */ @Override public void setDropDownViewResource(int resource) { super.setDropDownViewResource(resource); mDropDownResource = resource; } /** * {@inheritDoc} */ @Override public void setDropDownViewTheme(@Nullable Resources.Theme theme) { mHelper.setDropDownViewTheme(theme); } /** * {@inheritDoc} */ @Nullable @Override public Resources.Theme getDropDownViewTheme() { return mHelper.getDropDownViewTheme(); } /** * {@inheritDoc} */ @Override public View getDropDownView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { LayoutInflater inflater = mHelper.getDropDownViewInflater(); return createViewFromResource(inflater, position, convertView, parent, mDropDownResource); } /* * @see ArrayAdapter#createViewFromResource(LayoutInflater, int, View, ViewGroup, int) */ @NonNull private View createViewFromResource(@NonNull LayoutInflater inflater, int position, @Nullable View convertView, @NonNull ViewGroup parent, int resource) { final View view; final TextView text; if (convertView == null) { view = inflater.inflate(resource, parent, false); } else { view = convertView; } try { if (mFieldId == 0) { // If no custom field is assigned, assume the whole resource is a TextView text = (TextView) view; } else { // Otherwise, find the TextView field within the layout text = view.findViewById(mFieldId); if (text == null) { throw new RuntimeException("Failed to find view with ID " + getContext().getResources().getResourceName(mFieldId) + " in item layout"); } } } catch (ClassCastException e) { Log.e("ArrayAdapter", "You must supply a resource ID for a TextView"); throw new IllegalStateException( "ArrayAdapter requires the resource ID to be a TextView", e); } final T item = getItem(position); if (item instanceof CharSequence) { text.setText((CharSequence) item); } else { text.setText(item.toString()); } return view; } }
[ "447857062@qq.com" ]
447857062@qq.com
cca0420326f76e7697e6e30552d65af40ff87b3f
d250381386ee9be47fb67fa6c7cc451c5cbe2e55
/services/hrdb/src/com/sample1/hrdb/Department.java
0a4db841f172d0b7aa2bd4818d149c2c376992b7
[]
no_license
wavemakerapps/Rest_With_Server_calls
2f50e2e46a4951a5521072d598cbd15ada62fb50
9ee4d729ff0b2ace4ac468b949d0071e944ef215
refs/heads/master
2021-05-13T15:42:49.334469
2018-01-09T06:34:36
2018-01-09T06:34:36
116,776,198
0
0
null
null
null
null
UTF-8
Java
false
false
4,438
java
/*Copyright (c) 2016-2017 wavemaker.com All Rights Reserved. This software is the confidential and proprietary information of wavemaker.com You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the source code license agreement you entered into with wavemaker.com*/ package com.sample1.hrdb; /*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/ import java.io.Serializable; import java.util.List; import java.util.Objects; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.UniqueConstraint; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; /** * Department generated by WaveMaker Studio. */ @Entity @Table(name = "`DEPARTMENT`", uniqueConstraints = { @UniqueConstraint(name = "`SYS_IDX_UK_DEPARTMENT_DEPT_CODE_10095`", columnNames = {"`DEPT_CODE`"})}) public class Department implements Serializable { private Integer deptId; private String name; private Integer budget; private Integer q1; private Integer q2; private Integer q3; private Integer q4; private String deptCode; private String location; private Integer tenantId; private List<Employee> employees; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "`DEPT_ID`", nullable = false, scale = 0, precision = 10) public Integer getDeptId() { return this.deptId; } public void setDeptId(Integer deptId) { this.deptId = deptId; } @Column(name = "`NAME`", nullable = true, length = 255) public String getName() { return this.name; } public void setName(String name) { this.name = name; } @Column(name = "`BUDGET`", nullable = true, scale = 0, precision = 10) public Integer getBudget() { return this.budget; } public void setBudget(Integer budget) { this.budget = budget; } @Column(name = "`Q1`", nullable = true, scale = 0, precision = 10) public Integer getQ1() { return this.q1; } public void setQ1(Integer q1) { this.q1 = q1; } @Column(name = "`Q2`", nullable = true, scale = 0, precision = 10) public Integer getQ2() { return this.q2; } public void setQ2(Integer q2) { this.q2 = q2; } @Column(name = "`Q3`", nullable = true, scale = 0, precision = 10) public Integer getQ3() { return this.q3; } public void setQ3(Integer q3) { this.q3 = q3; } @Column(name = "`Q4`", nullable = true, scale = 0, precision = 10) public Integer getQ4() { return this.q4; } public void setQ4(Integer q4) { this.q4 = q4; } @Column(name = "`DEPT_CODE`", nullable = true, length = 20) public String getDeptCode() { return this.deptCode; } public void setDeptCode(String deptCode) { this.deptCode = deptCode; } @Column(name = "`LOCATION`", nullable = true, length = 255) public String getLocation() { return this.location; } public void setLocation(String location) { this.location = location; } @Column(name = "`TENANT_ID`", nullable = true, scale = 0, precision = 10) public Integer getTenantId() { return this.tenantId; } public void setTenantId(Integer tenantId) { this.tenantId = tenantId; } @JsonInclude(Include.NON_EMPTY) @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE, mappedBy = "department") public List<Employee> getEmployees() { return this.employees; } public void setEmployees(List<Employee> employees) { this.employees = employees; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Department)) return false; final Department department = (Department) o; return Objects.equals(getDeptId(), department.getDeptId()); } @Override public int hashCode() { return Objects.hash(getDeptId()); } }
[ "appTest1@wavemaker.com" ]
appTest1@wavemaker.com
484e6e23b54761248d6479d2110d14a1fcaa47d0
a820f8f4637876480c967dd4669862bb67734647
/aliyun-java-sdk-alidns/src/main/java/com/aliyuncs/alidns/model/v20150109/CheckDomainRecordResponse.java
31e2138ff5d6a0a80904e5c60d1ecc4d3cbebb26
[ "Apache-2.0" ]
permissive
remgoo/aliyun-openapi-java-sdk
6c0128ed1f51bfb395f3022105996c9e9fa5aa09
546e6887d88a5c3a8a9964aa990f8229ca7f9797
refs/heads/master
2020-12-03T09:21:30.460238
2016-04-01T09:31:27
2016-04-01T09:31:27
55,586,102
1
0
null
2016-04-06T07:47:52
2016-04-06T07:47:52
null
UTF-8
Java
false
false
1,627
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.aliyuncs.alidns.model.v20150109; import com.aliyuncs.AcsResponse; import com.aliyuncs.alidns.transform.v20150109.CheckDomainRecordResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CheckDomainRecordResponse extends AcsResponse { private String requestId; private Boolean isExist; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public Boolean getIsExist() { return this.isExist; } public void setIsExist(Boolean isExist) { this.isExist = isExist; } @Override public CheckDomainRecordResponse getInstance(UnmarshallerContext context) { return CheckDomainRecordResponseUnmarshaller.unmarshall(this, context); } }
[ "346340936@qq.com" ]
346340936@qq.com
96c505f00a5dc04049bb7fde141cd0c5a8fb4950
4fb0e1f0d013a346d8e72975599bf2e809d14f1d
/src/main/java/com/guohuai/ams/supplement/order/MechanismOrderController.java
181be41eb8ccc6f6776469ee38a96406518c122e
[]
no_license
soldiers1989/baofeng.mimosa
86af96bb1638c6b15713c00ed4c29f8efe3bd66c
477296925b6e8d1a7b8fc1400921e12bb35696ce
refs/heads/master
2020-03-28T23:54:35.805684
2018-04-24T06:27:57
2018-04-24T06:27:57
149,315,065
0
1
null
2018-09-18T15:57:01
2018-09-18T15:57:01
null
UTF-8
Java
false
false
6,691
java
package com.guohuai.ams.supplement.order; import java.util.Date; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort.Direction; import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.domain.Specifications; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.guohuai.ams.product.Product; import com.guohuai.ams.product.ProductService; import com.guohuai.ams.supplement.mechanism.Mechanism; import com.guohuai.ams.supplement.mechanism.MechanismController; import com.guohuai.ams.supplement.mechanism.MechanismForm; import com.guohuai.ams.supplement.mechanism.MechanismRep; import com.guohuai.ams.supplement.mechanism.MechanismService; import com.guohuai.basic.common.SeqGenerator; import com.guohuai.basic.component.ext.web.BaseController; import com.guohuai.component.util.DateUtil; import com.guohuai.component.web.view.BaseResp; import com.guohuai.component.web.view.PageResp; import com.guohuai.mmp.sys.CodeConstants; import com.guohuai.operate.api.AdminSdk; import lombok.extern.slf4j.Slf4j; import net.kaczmarzyk.spring.data.jpa.domain.Equal; import net.kaczmarzyk.spring.data.jpa.domain.Like; import net.kaczmarzyk.spring.data.jpa.web.annotation.Spec; /**补单机构管理 * @author qiuliang * */ @RestController @RequestMapping(value = "/mimosa/boot/mechanismOrder", produces = "application/json;charset=UTF-8") @Slf4j public class MechanismOrderController extends BaseController{ @Autowired private MechanismOrderService mechanismOrderService; @Autowired private MechanismService mechanismService; @Autowired private ProductService productService; @Autowired private SeqGenerator seqGenerator; @RequestMapping(name = "保存补单机构", value = "create", method = RequestMethod.POST) public ResponseEntity<BaseResp> save(@Valid MechanismOrderForm mechanismOrderForm) { String loginId = super.getLoginUser(); String productOid = mechanismOrderForm.getProductOid(); String mechanismOid = mechanismOrderForm.getMechanismOid(); Product p = this.productService.findByOid(productOid); Mechanism m = this.mechanismService.detail(mechanismOid); MechanismOrder mo = MechanismOrder.builder().mechanism(m).product(p) .orderAmount(mechanismOrderForm.getOrderAmount()) .productName(mechanismOrderForm.getProductName()) .fictitiousTime(new Date(mechanismOrderForm.getFictitiousTime().getTime())) .orderCode(this.seqGenerator.next(CodeConstants.PAYMENT_supplement)) .orderStatus(MechanismOrder.Order_Status_Created) .orderType(MechanismOrder.Order_Type_Supplement) .operator(loginId) .operateTime(new Date()) .createTime(new Date()) .build(); BaseResp response = mechanismOrderService.create(mo); return new ResponseEntity<BaseResp>(response, HttpStatus.OK); } // @RequestMapping(name = "新建补单机构订单", value = "create", method = RequestMethod.POST) // public ResponseEntity<BaseResp> save(@RequestBody List<MechanismOrderForm> mechanismOrderForms) { // List<MechanismOrder> mechanismOrders = new ArrayList<MechanismOrder>(); // String productOid = mechanismOrderForms.get(0).getProductOid(); // String mechanismOid = mechanismOrderForms.get(0).getMechanismOid(); // Product p = this.productService.findByOid(productOid); // Mechanism m = this.mechanismService.detail(mechanismOid); // String loginId = super.getLoginUser(); // for(MechanismOrderForm mof : mechanismOrderForms){ // MechanismOrder mo = MechanismOrder.builder().mechanism(m).product(p) // .orderAmount(mof.getOrderAmount()) // .productName(mof.getProductName()) // .fictitiousTime(new Date(mof.getFictitiousTime().getTime())) // .orderCode(this.seqGenerator.next(CodeConstants.PAYMENT_supplement)) // .orderStatus(MechanismOrder.Order_Status_Created) // .orderType(MechanismOrder.Order_Type_Supplement) // .operator(loginId) // .operateTime(new Date()) // .createTime(new Date()) // .build(); // mechanismOrders.add(mo); // } // BaseResp response = mechanismOrderService.create(mechanismOrders); // return new ResponseEntity<BaseResp>(response, HttpStatus.OK); // } @RequestMapping(name = "查询补单列表", value = "orderlist", method = { RequestMethod.POST, RequestMethod.GET }) public @ResponseBody ResponseEntity<PageResp<MechanismOrderRep>> orderlist( @RequestParam String productOid, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "50") int rows, @RequestParam(defaultValue = "desc") String sort, @RequestParam(defaultValue = "createTime") String sortField) { if (page < 1) { page = 1; } if (rows <= 0) { rows = 50; } Direction sortDirection = Direction.DESC; if("asc".equals(sort)){ sortDirection = Direction.ASC; } Specification<MechanismOrder> spec = Specifications.where(new Specification<MechanismOrder>() { @Override public Predicate toPredicate(Root<MechanismOrder> root, CriteriaQuery<?> query, CriteriaBuilder cb) { return cb.equal(root.get("product").get("oid").as(String.class), productOid); } }); PageResp<MechanismOrderRep> pageResp = mechanismOrderService.list(spec,page, rows, sortDirection, sortField); return new ResponseEntity<PageResp<MechanismOrderRep>>(pageResp, HttpStatus.OK); } @RequestMapping(name = "非新手标的定期产品列表", value = "tnproductlist", method = { RequestMethod.POST, RequestMethod.GET }) public @ResponseBody ResponseEntity<TnProductRep> tnproductlist() { TnProductRep tns = this.productService.findTnProductAndNotFreashman(); return new ResponseEntity<TnProductRep>(tns, HttpStatus.OK); } @RequestMapping(name = "剩余订单金额", value = "restOrderAmount", method = { RequestMethod.POST, RequestMethod.GET }) public @ResponseBody ResponseEntity<RestOrderAmountRep> restOrderAmount(@RequestParam String productOid) { RestOrderAmountRep rep = this.productService.findMaxScaleAmountByProduct(productOid); return new ResponseEntity<RestOrderAmountRep>(rep, HttpStatus.OK); } }
[ "jiangjianmin@baofeng.com" ]
jiangjianmin@baofeng.com
21dec955f349992d131a763d182e2faf9202d1b1
06eb59d91495a2b9568d21019e4dcb61ff236b7a
/izpack-src/tags/4.2.0/src/lib/com/izforge/izpack/panels/TargetPanelAutomationHelper.java
373d4d9341a718cce71b9723832814afa806e468
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jponge/izpack-full-svn-history-copy
8fa773fb3f9f4004e762d29f708273533ba0ff1f
7a521ccd6ce0dd1a0664eaae12fd5bba5571d231
refs/heads/master
2016-09-01T18:24:14.656773
2010-03-01T07:38:22
2010-03-01T07:38:22
551,191
1
1
null
null
null
null
UTF-8
Java
false
false
2,624
java
/* * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved. * * http://izpack.org/ * http://izpack.codehaus.org/ * * Copyright 2003 Jonathan Halliday * * 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.izforge.izpack.panels; import com.izforge.izpack.installer.AutomatedInstallData; import com.izforge.izpack.installer.PanelAutomation; import com.izforge.izpack.util.VariableSubstitutor; import net.n3.nanoxml.XMLElement; /** * Functions to support automated usage of the TargetPanel * * @author Jonathan Halliday * @author Julien Ponge */ public class TargetPanelAutomationHelper implements PanelAutomation { /** * Asks to make the XML panel data. * * @param idata The installation data. * @param panelRoot The tree to put the data in. */ public void makeXMLData(AutomatedInstallData idata, XMLElement panelRoot) { // Installation path markup XMLElement ipath = new XMLElement("installpath"); // check this writes even if value is the default, // because without the constructor, default does not get set. ipath.setContent(idata.getInstallPath()); // Checkings to fix bug #1864 XMLElement prev = panelRoot.getFirstChildNamed("installpath"); if (prev != null) { panelRoot.removeChild(prev); } panelRoot.addChild(ipath); } /** * Asks to run in the automated mode. * * @param idata The installation data. * @param panelRoot The XML tree to read the data from. * @return always true. */ public boolean runAutomated(AutomatedInstallData idata, XMLElement panelRoot) { // We set the installation path XMLElement ipath = panelRoot.getFirstChildNamed("installpath"); // Allow for variable substitution of the installpath value VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables()); String path = ipath.getContent(); path = vs.substitute(path, null); idata.setInstallPath(path); return true; } }
[ "jponge@7d736ef5-cfd4-0310-9c9a-b52d5c14b761" ]
jponge@7d736ef5-cfd4-0310-9c9a-b52d5c14b761
a9a995c91cf6897e41e8ce7c96b216f869a5ee8b
0b77f6a2a96a19929c3e815d47641719b33648ec
/app/src/main/java/com/naiqiao/mall/fragment/AddressContentFragment.java
9c2d2fd78e94e9bf8cec18c89c9bab2ee3ba5ec5
[]
no_license
dmz1024/NaiQiaoICmall
cab55e6a9e3bffa759ddac1077b692fb895b3914
feb1016ba3e0659290555298ed95d7884c9716ff
refs/heads/master
2020-07-23T20:07:47.653804
2017-02-13T10:28:34
2017-02-13T10:28:34
73,801,893
0
0
null
null
null
null
UTF-8
Java
false
false
942
java
package com.naiqiao.mall.fragment; import android.view.View; import com.naiqiao.mall.R; import base.bean.rxbus.AddFragmentBean; import base.fragment.NotNetWorkBaseFragment; import butterknife.OnClick; import rx.Observable; import rx.functions.Action1; import util.RxBus; /** * Created by dengmingzhi on 2016/12/8. */ public class AddressContentFragment extends NotNetWorkBaseFragment { @Override protected void initData() { getChildFragmentManager().beginTransaction().add(R.id.fg_content, addressFragment = new AddressFragment()).commit(); } private AddressFragment addressFragment; @Override protected int getRId() { return R.layout.fragment_address_content; } @Override protected View getTitleBarView() { return null; } @OnClick(R.id.bt_add) void add() { RxBus.get().post("addFragment", new AddFragmentBean(new AddressEditFragment())); } }
[ "894350911@qq.com" ]
894350911@qq.com
41c8ebb3138476c09f6a4b5834fe747e8bb63c11
aae49c4e518bb8cb342044758c205a3e456f2729
/GeogebraiOS/javasources/org/geogebra/common/move/views/BaseView.java
39240c185b775e0970bf4eb202a3546b4a290061
[]
no_license
kwangkim/GeogebraiOS
00919813240555d1f2da9831de4544f8c2d9776d
ca3b9801dd79a889da6cb2fdf24b761841fd3f05
refs/heads/master
2021-01-18T05:29:52.050694
2015-10-04T02:29:03
2015-10-04T02:29:03
45,118,575
4
2
null
2015-10-28T14:36:32
2015-10-28T14:36:31
null
UTF-8
Java
false
false
928
java
package org.geogebra.common.move.views; import java.util.ArrayList; /** * @author gabor Base of all views * @param <T> * type of handlers this view contains * */ public abstract class BaseView<T> { /** * */ protected ArrayList<T> viewComponents = null; /** * called from child objects. */ protected BaseView() { } /** * @param view * Renderable view * * Removes a view from the views list */ public void remove(T view) { if (viewComponents != null) { if (viewComponents.contains(view)) { viewComponents.remove(view); } } } /** * @param view * Renderable view * * Adds new view to the view's list */ public final void add(T view) { if (this.viewComponents == null) { this.viewComponents = new ArrayList<T>(); } if (!this.viewComponents.contains(view)) { this.viewComponents.add(view); } } }
[ "kuoyichun1102@gmail.com" ]
kuoyichun1102@gmail.com
d2b50fbdfb428d3f42dc4203f1b74a7793585d98
f9e5e888e1c2f64c2716b3683598ad7485bd1881
/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/pc/impl/StoredIdConnectorParser.java
18ea4cf7748666e2ae652a08a3f17609425a81a4
[]
no_license
nagyistge/shibboleth-idp-v3
cc53646106761727f26941d9358e84520dcc6212
e3fbf872a8e5fc74657bfc89cabd584751e92336
refs/heads/master
2021-05-02T12:14:18.926237
2015-11-19T20:26:49
2015-11-19T20:26:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,959
java
/* * Licensed to the University Corporation for Advanced Internet Development, * Inc. (UCAID) under one or more contributor license agreements. See the * NOTICE file distributed with this work for additional information regarding * copyright ownership. The UCAID licenses this file to You under the Apache * License, Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.shibboleth.idp.attribute.resolver.spring.pc.impl; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.xml.namespace.QName; import net.shibboleth.idp.authn.context.SubjectCanonicalizationContext; import net.shibboleth.idp.saml.attribute.resolver.impl.StoredIDDataConnector; import net.shibboleth.idp.saml.nameid.NameDecoderException; import net.shibboleth.idp.saml.nameid.NameIdentifierDecoder; import net.shibboleth.idp.saml.nameid.impl.StoredPersistentIdDecoder; import net.shibboleth.utilities.java.support.primitive.StringSupport; import org.opensaml.saml.saml1.core.NameIdentifier; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.ParserContext; import org.w3c.dom.Element; /** * Parser for StoredId Principal Connector<br/> * &lt;PrincipalConnector xsi:type="pc:StoredId"&gt;. */ public class StoredIdConnectorParser extends AbstractPrincipalConnectorParser { /** Schema type name. */ @Nonnull public static final QName TYPE_NAME = new QName(PrincipalConnectorNamespaceHandler.NAMESPACE, "StoredId"); /** {@inheritDoc} */ @Override protected void addSAMLDecoders(@Nonnull final Element config, @Nonnull final ParserContext parserContext, @Nonnull final BeanDefinitionBuilder builder) { BeanDefinitionBuilder subBuilder = BeanDefinitionBuilder.genericBeanDefinition(EmbeddedStoredPersistentIdDecoder.class); final String dataConnector = StringSupport.trimOrNull(config.getAttributeNS(null, "storedIdDataConnectorRef")); subBuilder.addConstructorArgReference(dataConnector); subBuilder.setInitMethodName("initialize"); subBuilder.setDestroyMethodName("destroy"); final String id = StringSupport.trimOrNull(config.getAttributeNS(null, "id")); subBuilder.addPropertyValue("id", id); builder.addConstructorArgValue(subBuilder.getBeanDefinition()); subBuilder = BeanDefinitionBuilder.genericBeanDefinition(NotImplementedNameIdentifierDecoder.class); builder.addConstructorArgValue(subBuilder.getBeanDefinition()); } /** Helper class to allow us to inject in a StoredIdStore into StoredIdStore. */ public static class EmbeddedStoredPersistentIdDecoder extends StoredPersistentIdDecoder { /** * Constructor. * * @param connector the data connector of interest */ public EmbeddedStoredPersistentIdDecoder(StoredIDDataConnector connector) { setPersistentIdStore(connector.getStoredIDStore()); } } /** Helper class to allow us to put *something* into a the principalConnector. */ public static class NotImplementedNameIdentifierDecoder implements NameIdentifierDecoder { /** {@inheritDoc} */ @Override @Nullable public String decode(@Nonnull SubjectCanonicalizationContext c14nContext, @Nonnull NameIdentifier nameID) throws NameDecoderException { throw new NameDecoderException("Name Decoding for SAML1?"); } } }
[ "tzeller@03af267c-bfd3-464a-89ef-4aea903fec54" ]
tzeller@03af267c-bfd3-464a-89ef-4aea903fec54