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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ffed427fef9569552bdacc3fbf252fdd42dd510e
|
84b25978472f9de4774bd18b77c9cae2e4bce96a
|
/src/main/java/modularmachines/common/plugins/cofh/ModuleRFBatteryProperties.java
|
b38c47d60974fd5bf706c411a612334a9a05b5ae
|
[
"MIT"
] |
permissive
|
Nedelosk/Modular-Machines
|
34f507ecbbc32d1463390b0cbfe518e692004140
|
68cca6f76d34087c9289230810d77745b1d62937
|
refs/heads/dev-1.10.2
| 2021-01-19T04:31:57.783518
| 2016-11-13T13:14:04
| 2016-11-13T13:14:04
| 35,362,688
| 6
| 1
| null | 2016-11-12T23:02:20
| 2015-05-10T08:10:58
|
Java
|
UTF-8
|
Java
| false
| false
| 517
|
java
|
package modularmachines.common.plugins.cofh;
import modularmachines.api.modules.storage.energy.ModuleBatteryProperties;
public class ModuleRFBatteryProperties extends ModuleBatteryProperties {
public ModuleRFBatteryProperties(int complexity, int capacity, int maxTransfer, int tier) {
super(complexity, capacity, maxTransfer, tier);
}
public ModuleRFBatteryProperties(int complexity, int capacity, int maxReceive, int maxExtract, int tier) {
super(complexity, capacity, maxReceive, maxExtract, tier);
}
}
|
[
"nedelosk@gmail.com"
] |
nedelosk@gmail.com
|
e6f1e5cc3e9632c2875f6de9163e83d9a14c16ea
|
94c021ac664b338a19a0ff828b91ec1bfbbbfe0a
|
/src/main/java/com/faceye/feature/util/shell/Shell.java
|
b7ceadb3dd15cb443577463cebd8cf1fed1d39ec
|
[] |
no_license
|
haipenge/faceye-util-manager
|
f95a8a5db5fa9a72f93c7d7c8b154f60f77a805b
|
0c474c6391b6020aaf8fcc09c42d167c1419524b
|
refs/heads/master
| 2020-04-06T04:53:21.599067
| 2018-12-05T06:10:20
| 2018-12-05T06:10:20
| 73,765,611
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,397
|
java
|
package com.faceye.feature.util.shell;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Shell调用工具
* @author @haipenge
* @联系:haipenge@gmail.com
* 创建时间:2015年4月17日
*/
public class Shell {
private static Logger logger = LoggerFactory.getLogger(Shell.class);
/**
* 运行shell
* @todo
* @param scriptUri
* @return
* @author:@haipenge
* 联系:haipenge@gmail.com
* 创建时间:2015年4月17日
*/
public static String runShell(String scriptUri) {
String res = "";
try {
exec(scriptUri);
} catch (IOException e) {
logger.error(">>FaceYe throws Exception: --->", e);
} catch (InterruptedException e) {
logger.error(">>FaceYe throws Exception: --->", e);
}
return res;
}
public static String runCommand(String command) {
StringBuilder sb = new StringBuilder();
String res = "";
Process process;
try {
process = Runtime.getRuntime().exec(command);
InputStreamReader ir = new InputStreamReader(process.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
String line;
process.waitFor();
while ((line = input.readLine()) != null) {
sb.append(line);
sb.append("\r\n");
}
} catch (IOException e) {
logger.error(">>FaceYe throws Exception: --->", e);
} catch (InterruptedException e) {
logger.error(">>FaceYe throws Exception: --->", e);
}
res = sb.toString();
logger.debug(">>Command :" + command + ",result is:" + res);
return res;
}
private static String exec(String scriptUrl) throws IOException, InterruptedException {
StringBuilder sb = new StringBuilder();
String res = "";
Process process;
String command = "/bin/sh " + scriptUrl;
process = Runtime.getRuntime().exec(new String[] { "/bin/sh", "-c", "sh " + scriptUrl }, null, null);
// process=Runtime.getRuntime().exec("java -version");
// process=Runtime.getRuntime().exec(command);
// process.waitFor();
InputStreamReader ir = new InputStreamReader(process.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
String line;
process.waitFor();
while ((line = input.readLine()) != null) {
sb.append(line);
sb.append("\r\n");
}
res = sb.toString();
logger.debug(">>Command " + scriptUrl + ",exec result is:" + res);
return res;
}
}
|
[
"haipenge@gmail.com"
] |
haipenge@gmail.com
|
9df34df30402d9f6c622d7cbeaee173094f91f70
|
4798eda6f574db7bc30d6fa5284fa532420c8725
|
/src/main/java/com/example/computerrepair/controller/ReportController.java
|
5fdb6d7f55ea74ca0847a81fd1a59971418069e6
|
[] |
no_license
|
Partynin/computer-repair7
|
6b4f901c5eb1b0c65c45bdea0095263149c6906e
|
48864e50512fed58160c19c6f71b66a4c82f4b76
|
refs/heads/master
| 2022-07-22T17:02:11.977584
| 2020-05-06T20:08:04
| 2020-05-06T20:08:04
| 260,771,300
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,983
|
java
|
package com.example.computerrepair.controller;
import com.example.computerrepair.domain.Client;
import com.example.computerrepair.domain.Service;
import com.example.computerrepair.repos.ClientRepository;
import com.example.computerrepair.repos.ServiceRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@Controller
@PreAuthorize("hasAuthority('ADMIN')")
public class ReportController {
@Autowired
private ServiceRepository serviceRepository;
@Autowired
private ClientRepository clientRepository;
@GetMapping("/report")
public String getReport(Model model) {
model.addAttribute("clients", new HashSet<>());
return "reports";
}
@PostMapping("/reportAboutClientsContactingASpecifiedNumberOfTimes")
public String getReportAboutClientsContactingASpecifiedNumberOfTimes(Integer amount, Model model) {
Iterable<Service> services = serviceRepository.findAll();
Map<Client, Integer> clientAndCount = new HashMap<>();
for (Service service: services) {
Client client = service.getClient();
if (!clientAndCount.containsKey(client)) {
clientAndCount.put(client, 1);
} else {
clientAndCount.put(client, clientAndCount.get(client) + 1);
}
}
Set<Client> clients = new HashSet<>();
for (Client key : clientAndCount.keySet()) {
if (clientAndCount.get(key) == amount){
clients.add(key);
}
}
model.addAttribute("clients", clients);
return "reports";
}
}
|
[
"partinin@bk.ru"
] |
partinin@bk.ru
|
28d896889cf764eaefaa7b8de1c79b8503f58977
|
3cfffef6873f6e15baeb3839a32920d677fe0956
|
/src/main/java/com/zxs/ApplicationBootApp.java
|
d20e2e571943e95ed6e8bee21f02744f0a6b72ff
|
[] |
no_license
|
jayzc1234/learngit
|
2ba4c8bf939ea82b7bc73d17c6f1dc5fb09139f8
|
804d6bb3317acf23477b044a841b0ebf7c10a966
|
refs/heads/master
| 2022-07-16T16:53:45.645407
| 2021-08-05T13:15:17
| 2021-08-05T13:15:17
| 158,473,801
| 0
| 0
| null | 2022-06-21T03:38:42
| 2018-11-21T01:33:25
|
Java
|
UTF-8
|
Java
| false
| false
| 841
|
java
|
package com.zxs;
import com.zxs.config.ApolloConfigBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;
@EnableAspectJAutoProxy
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class ApplicationBootApp {
public static void main(String[] args) {
ConfigurableApplicationContext contextc = SpringApplication.run(ApplicationBootApp.class, args);
ApolloConfigBean bean = contextc.getBean(ApolloConfigBean.class);
}
@Component
class Fly{
}
}
|
[
"zhuchuang@app315.net"
] |
zhuchuang@app315.net
|
998bf23362433cd449fec2b7a83bd6b1c2868bea
|
69a91b17c867a52fd899f2e4a9d7a386ac543ad6
|
/src/main/java/org/kitteh/irc/client/library/event/ActorMessageEvent.java
|
1b703036451c086aa817786ef6ab7d7935572eaa
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
jamierocks/KittehIRCClientLib
|
990cb1e49c694bd75ded25bd737918303f170bcf
|
d8487cd0406999f8aa507da3084f1bf07944ae6e
|
refs/heads/master
| 2021-01-24T23:40:47.462973
| 2015-03-29T21:55:04
| 2015-03-29T21:55:04
| 33,152,383
| 0
| 0
| null | 2015-03-30T22:46:55
| 2015-03-30T22:46:54
|
Java
|
UTF-8
|
Java
| false
| false
| 1,804
|
java
|
/*
* * Copyright (C) 2013-2015 Matt Baxter http://kitteh.org
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.kitteh.irc.client.library.event;
import org.kitteh.irc.client.library.Client;
import org.kitteh.irc.client.library.element.Actor;
/**
* Abstract event describing an {@link Actor} performing an action with a
* message.
*/
public abstract class ActorMessageEvent<A extends Actor> extends ActorEvent<A> {
private final String message;
protected ActorMessageEvent(Client client, A actor, String message) {
super(client, actor);
this.message = message;
}
/**
* Gets the sent message.
*
* @return the sent message
*/
public final String getMessage() {
return this.message;
}
}
|
[
"matt@phozop.net"
] |
matt@phozop.net
|
7b06dc218f93e46e5f49632994ee79310714361a
|
3637342fa15a76e676dbfb90e824de331955edb5
|
/2s/pojo/src/main/java/com/bcgogo/user/VehicleHistoryResponse.java
|
7a87b8fa4be73c7adb6d5445c73d24900d2be4fe
|
[] |
no_license
|
BAT6188/bo
|
6147f20832263167101003bea45d33e221d0f534
|
a1d1885aed8cf9522485fd7e1d961746becb99c9
|
refs/heads/master
| 2023-05-31T03:36:26.438083
| 2016-11-03T04:43:05
| 2016-11-03T04:43:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,261
|
java
|
package com.bcgogo.user;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by IntelliJ IDEA.
* User: monrove
* Date: 11-12-16
* Time: 上午9:46
* To change this template use File | Settings | File Templates.
*/
public class VehicleHistoryResponse {
private Long customerId;
private Long vehicleId;
private Long orderType; // 1--维修单 2--销售单
private Long orderId;
private String statusStr;
public String getStatusStr() {
return statusStr;
}
public void setStatusStr(String statusStr) {
this.statusStr = statusStr;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
private Long comsuDate; //消费日期
private String comsuDateStr;
private String licenceNo;
private String content;
private String repair; //施工
private String cailiao;
private double totalMoney;
private Long endDate; //出厂
private String endDateStr;
private Long status;
private double arrears;
private Long repayDate;
private String repayDateStr;
public Long getVehicleId() {
return vehicleId;
}
public void setVehicleId(Long vehicleId) {
this.vehicleId = vehicleId;
}
public Long getOrderType() {
return orderType;
}
public void setOrderType(Long orderType) {
this.orderType = orderType;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Long getComsuDate() {
return comsuDate;
}
public void setComsuDate(Long comsuDate) {
this.comsuDate = comsuDate;
}
public String getComsuDateStr() {
if(this.getComsuDate()==null){
return comsuDateStr;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date d = new Date(this.getComsuDate());
return sdf.format(d);
}
public void setComsuDateStr(String comsuDateStr) {
this.comsuDateStr = comsuDateStr;
}
public String getLicenceNo() {
return licenceNo;
}
public void setLicenceNo(String licenceNo) {
this.licenceNo = licenceNo;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getRepair() {
return repair;
}
public void setRepair(String repair) {
this.repair = repair;
}
public String getCailiao() {
return cailiao;
}
public void setCailiao(String cailiao) {
this.cailiao = cailiao;
}
public double getTotalMoney() {
return totalMoney;
}
public void setTotalMoney(double totalMoney) {
this.totalMoney = totalMoney;
}
public Long getEndDate() {
return endDate;
}
public void setEndDate(Long endDate) {
this.endDate = endDate;
}
public String getEndDateStr() {
if(this.getEndDate()==null){
return endDateStr;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date d = new Date(this.getEndDate());
return sdf.format(d);
}
public void setEndDateStr(String endDateStr) {
this.endDateStr = endDateStr;
}
public Long getStatus() {
return status;
}
public void setStatus(Long status) {
this.status = status;
}
public double getArrears() {
return arrears;
}
public void setArrears(double arrears) {
this.arrears = arrears;
}
public Long getRepayDate() {
return repayDate;
}
public void setRepayDate(Long repayDate) {
this.repayDate = repayDate;
}
public String getRepayDateStr() {
if(this.getRepayDate()==null){
return "";
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date d = new Date(this.getRepayDate());
return sdf.format(d);
}
public void setRepayDateStr(String repayDateStr) {
this.repayDateStr = repayDateStr;
}
}
|
[
"ndong211@163.com"
] |
ndong211@163.com
|
2b19374198ca67f1fd0755cdca2517522189668d
|
b4cc861bf70792e1e587efe827dfdb0157442e95
|
/mcp62/temp/src/minecraft/net/minecraft/src/BlockSign.java
|
4fb274456207ff8d38fe982047d8651d608521e4
|
[] |
no_license
|
popnob/ooptest
|
8c61729343bf0ed113c3038b5a0f681387805ef7
|
856b396adfe5bb3a2dbdca0e22ea724776d2ce8a
|
refs/heads/master
| 2021-01-23T08:04:35.318303
| 2012-05-30T18:05:25
| 2012-05-30T18:05:25
| 4,483,121
| 4
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,061
|
java
|
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// BlockContainer, Material, IBlockAccess, TileEntity,
// Item, World, AxisAlignedBB
public class BlockSign extends BlockContainer
{
private Class field_455_a;
private boolean field_454_b;
protected BlockSign(int p_i501_1_, Class p_i501_2_, boolean p_i501_3_)
{
super(p_i501_1_, Material.field_1335_c);
field_454_b = p_i501_3_;
field_378_bb = 4;
field_455_a = p_i501_2_;
float f = 0.25F;
float f1 = 1.0F;
func_213_a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
}
public AxisAlignedBB func_221_d(World p_221_1_, int p_221_2_, int p_221_3_, int i)
{
return null;
}
public AxisAlignedBB func_246_f(World p_246_1_, int p_246_2_, int p_246_3_, int p_246_4_)
{
func_238_a(p_246_1_, p_246_2_, p_246_3_, p_246_4_);
return super.func_246_f(p_246_1_, p_246_2_, p_246_3_, p_246_4_);
}
public void func_238_a(IBlockAccess p_238_1_, int p_238_2_, int p_238_3_, int p_238_4_)
{
if(field_454_b)
{
return;
}
int i = p_238_1_.func_602_e(p_238_2_, p_238_3_, p_238_4_);
float f = 0.28125F;
float f1 = 0.78125F;
float f2 = 0.0F;
float f3 = 1.0F;
float f4 = 0.125F;
func_213_a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
if(i == 2)
{
func_213_a(f2, f, 1.0F - f4, f3, f1, 1.0F);
}
if(i == 3)
{
func_213_a(f2, f, 0.0F, f3, f1, f4);
}
if(i == 4)
{
func_213_a(1.0F - f4, f, f2, 1.0F, f1, f3);
}
if(i == 5)
{
func_213_a(0.0F, f, f2, f4, f1, f3);
}
}
public int func_210_f()
{
return -1;
}
public boolean func_242_c()
{
return false;
}
public boolean func_48204_b(IBlockAccess p_48204_1_, int p_48204_2_, int p_48204_3_, int i)
{
return true;
}
public boolean func_217_b()
{
return false;
}
public TileEntity func_283_a_()
{
try
{
return (TileEntity)field_455_a.newInstance();
}
catch(Exception exception)
{
throw new RuntimeException(exception);
}
}
public int func_240_a(int p_240_1_, Random p_240_2_, int p_240_3_)
{
return Item.field_267_as.field_291_aS;
}
public void func_226_a(World p_226_1_, int p_226_2_, int p_226_3_, int p_226_4_, int p_226_5_)
{
boolean flag = false;
if(field_454_b)
{
if(!p_226_1_.func_599_f(p_226_2_, p_226_3_ - 1, p_226_4_).func_878_a())
{
flag = true;
}
} else
{
int i = p_226_1_.func_602_e(p_226_2_, p_226_3_, p_226_4_);
flag = true;
if(i == 2 && p_226_1_.func_599_f(p_226_2_, p_226_3_, p_226_4_ + 1).func_878_a())
{
flag = false;
}
if(i == 3 && p_226_1_.func_599_f(p_226_2_, p_226_3_, p_226_4_ - 1).func_878_a())
{
flag = false;
}
if(i == 4 && p_226_1_.func_599_f(p_226_2_ + 1, p_226_3_, p_226_4_).func_878_a())
{
flag = false;
}
if(i == 5 && p_226_1_.func_599_f(p_226_2_ - 1, p_226_3_, p_226_4_).func_878_a())
{
flag = false;
}
}
if(flag)
{
func_259_b_(p_226_1_, p_226_2_, p_226_3_, p_226_4_, p_226_1_.func_602_e(p_226_2_, p_226_3_, p_226_4_), 0);
p_226_1_.func_690_d(p_226_2_, p_226_3_, p_226_4_, 0);
}
super.func_226_a(p_226_1_, p_226_2_, p_226_3_, p_226_4_, p_226_5_);
}
}
|
[
"dicks@negro.com"
] |
dicks@negro.com
|
c9aa374a6d901dca83158d5ec3224f80654c1ed1
|
3c4763922cda3f3a990b74cdba6f8a30b07467de
|
/src/main/java/students/vitaly_porsev/lesson_15/level_6/allTasks/Customer.java
|
aa5dcf116886a233f8b44c3e7f0f5e6612f6c5ef
|
[] |
no_license
|
VitalyPorsev/JavaGuru1
|
07db5a0cc122b097a20e56c9da431cd49d3c01ea
|
f3c25b6357309d4e9e8ac0047e51bb8031d14da8
|
refs/heads/main
| 2023-05-10T15:35:55.419713
| 2021-05-15T18:48:12
| 2021-05-15T18:48:12
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,103
|
java
|
package students.vitaly_porsev.lesson_15.level_6.allTasks;
import students.vitaly_porsev.lesson_15.level_6.allTasks.processors.ChildrenProcessor;
import students.vitaly_porsev.lesson_15.level_6.allTasks.processors.NewReleaseProcessor;
import students.vitaly_porsev.lesson_15.level_6.allTasks.processors.RegularProcessor;
import java.util.LinkedList;
import java.util.List;
public class Customer {
private final String name;
private final List<Rental> rentals = new LinkedList<>();
private String getName() {
return name;
}
public Customer(String name) {
this.name = name;
}
public void addRental(Rental rental) {
rentals.add(rental);
}
public String statement() {
MovieProcessor[] processors = {new ChildrenProcessor(), new NewReleaseProcessor(), new RegularProcessor()};
for (Rental rental : rentals) {
for (MovieProcessor processor : processors)
if (processor.canProcess(rental)) {
return processor.process(getName(), rental);
}
}
return "";
}
}
|
[
"pointofview88@gmail.com"
] |
pointofview88@gmail.com
|
b49dd2728f5d1643887d4ea39be3617a7604e3c3
|
996fd51a83c84dc496e6fb90fb04108f397a8a54
|
/test-framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/test/framework/FSCrawlerReproduceInfoPrinter.java
|
53464d0f475da0a26b0010d53d727586170e2dc9
|
[
"Apache-2.0",
"CC-BY-4.0"
] |
permissive
|
charlesfair/fscrawler
|
49a9ff5f2adfa52e6425757887713f6b11a77fa4
|
eeae46867bb508defadb19586ffd22d36cf27994
|
refs/heads/master
| 2021-04-28T03:56:42.679275
| 2018-02-19T20:21:27
| 2018-02-19T20:21:27
| 122,151,371
| 1
| 0
|
Apache-2.0
| 2018-02-20T03:35:02
| 2018-02-20T03:35:02
| null |
UTF-8
|
Java
| false
| false
| 6,411
|
java
|
/*
* Licensed to David Pilato (the "Author") under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Author 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 fr.pilato.elasticsearch.crawler.fs.test.framework;
import com.carrotsearch.randomizedtesting.ReproduceErrorMessageBuilder;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.util.Strings;
import org.junit.AssumptionViolatedException;
import org.junit.runner.Description;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunListener;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import static com.carrotsearch.randomizedtesting.SysGlobals.SYSPROP_ITERATIONS;
import static com.carrotsearch.randomizedtesting.SysGlobals.SYSPROP_PREFIX;
import static com.carrotsearch.randomizedtesting.SysGlobals.SYSPROP_TESTMETHOD;
public class FSCrawlerReproduceInfoPrinter extends RunListener {
private static final Logger logger = LogManager.getLogger();
@Override
public void testStarted(Description description) throws Exception {
logger.trace("Test {} started", description.getDisplayName());
}
@Override
public void testFinished(Description description) throws Exception {
logger.trace("Test {} finished", description.getDisplayName());
}
@Override
public void testFailure(Failure failure) throws Exception {
// Ignore assumptions.
if (failure.getException() instanceof AssumptionViolatedException) {
return;
}
final StringBuilder b = new StringBuilder();
b.append("REPRODUCE WITH:\n");
b.append("mvn integration-test");
MavenMessageBuilder mavenMessageBuilder = new MavenMessageBuilder(b);
mavenMessageBuilder.appendAllOpts(failure.getDescription());
System.err.println(b.toString());
}
/**
* Declared on test classes to add extra properties to the reproduction
* info. Note that this is scanned from all superclasses.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Properties {
String[] value();
}
static class MavenMessageBuilder extends ReproduceErrorMessageBuilder {
public MavenMessageBuilder(StringBuilder b) {
super(b);
}
@Override
public ReproduceErrorMessageBuilder appendAllOpts(Description description) {
super.appendAllOpts(description);
if (description.getMethodName() != null) {
//prints out the raw method description instead of methodName(description) which filters out the parameters
super.appendOpt(SYSPROP_TESTMETHOD(), "\"" + description.getMethodName() + "\"");
}
List<String> properties = new ArrayList<>();
scanProperties(description.getTestClass(), properties);
appendProperties(properties.toArray(new String[properties.size()]));
return appendESProperties();
}
/**
* Scans c and its superclasses for the {@linkplain Properties}
* annotations, copying all the listed properties in order from
* superclass to subclass.
*/
private void scanProperties(Class<?> c, List<String> properties) {
if (Object.class.equals(c) == false) {
scanProperties(c.getSuperclass(), properties);
}
Properties extraParameterAnnotation = c.getAnnotation(Properties.class);
if (extraParameterAnnotation != null) {
Collections.addAll(properties, extraParameterAnnotation.value());
}
}
@Override
public ReproduceErrorMessageBuilder appendEnvironmentSettings() {
// we handle our own environment settings
return this;
}
/**
* Append a single VM option.
*/
@Override
public ReproduceErrorMessageBuilder appendOpt(String sysPropName, String value) {
if (sysPropName.equals(SYSPROP_ITERATIONS())) { // we don't want the iters to be in there!
return this;
}
if (sysPropName.equals(SYSPROP_TESTMETHOD())) {
//don't print out the test method, we print it ourselves in appendAllOpts
//without filtering out the parameters (needed for REST tests)
return this;
}
if (sysPropName.equals(SYSPROP_PREFIX())) {
// we always use the default prefix
return this;
}
if (!Strings.isBlank(value)) {
if (value.indexOf(' ') >= 0) {
return super.appendOpt(sysPropName, '"' + value + '"');
}
return super.appendOpt(sysPropName, value);
}
return this;
}
public ReproduceErrorMessageBuilder appendESProperties() {
appendOpt("tests.locale", Locale.getDefault().toLanguageTag());
appendOpt("tests.timezone", TimeZone.getDefault().getID());
return this;
}
ReproduceErrorMessageBuilder appendProperties(String... properties) {
for (String sysPropName : properties) {
if (!Strings.isBlank(System.getProperty(sysPropName))) {
appendOpt(sysPropName, System.getProperty(sysPropName));
}
}
return this;
}
}
}
|
[
"david@pilato.fr"
] |
david@pilato.fr
|
11abaecc1e528e5a1a9d071ca7298f6579b84575
|
43ea6b8fd54f76e49f6e8ed8ec443336cf7db8ac
|
/topcoder/TravellingPurchasingMan.java
|
b7b2288a28b755e8f1ce2c487674a1d9936a1209
|
[] |
no_license
|
mirzainayat92/competitive-programming
|
68f6c0a5a10cf8d8f14040a385e22e53d03beb70
|
2d737fb6f69256f62ea5454888f5687f1814ea7b
|
refs/heads/master
| 2020-12-22T20:45:48.789657
| 2018-03-15T03:52:48
| 2018-03-15T03:52:48
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,613
|
java
|
package topcoder;
import java.util.*;
class Store {
int open, close, duration;
public Store(int open, int close, int duration) {
this.open = open;
this.close = close;
this.duration = duration;
}
}
public class TravellingPurchasingMan {
public int maxStores(int N, String[] is, String[] roads) {
int M = is.length;
Store[] stores = new Store[M];
for (int i = 0; i < M; ++i) {
String[] parts = is[i].split("[ ]");
int open = Integer.parseInt(parts[0]);
int close = Integer.parseInt(parts[1]);
int duration = Integer.parseInt(parts[2]);
stores[i] = new Store(open, close, duration);
}
int[][] adj = new int[N][N];
for (int i = 0; i < roads.length; ++i) {
String[] parts = is[i].split("[ ]");
int A = Integer.parseInt(parts[0]);
int B = Integer.parseInt(parts[1]);
int length = Integer.parseInt(parts[2]);
adj[A][B] = adj[B][A] = length;
}
}
// BEGIN CUT HERE
public static void main(String[] args) {
RETester.test(TravellingPurchasingMan.class, "test.*");
}
public void test0() {
RETester.eq(maxStores(3, new String[] {"1 10 10" , "1 55 31", "10 50 100" }, new String[] {"1 2 10"}), 1);
}
public void test1() {
RETester.eq(maxStores(3, new String[] {"1 10 10" , "1 55 30", "10 50 100" }, new String[] {"1 2 10"}), 2);
}
public void test2() {
RETester.eq(maxStores(5, new String[] {"0 1000 17"}, new String[] {"2 3 400", "4 1 500", "4 3 300", "1 0 700", "0 2 400"}), 0);
}
// END CUT HERE
}
|
[
"sfmunera@gmail.com"
] |
sfmunera@gmail.com
|
05cd553906e78a0e11e7368e7eb1caad7597ca59
|
1d366fd8a29238c014b88b9ad8b0cbaef8bb62b7
|
/web/src/main/java/stu/napls/copdmanage/core/exception/BaseException.java
|
5eb74471d3a4fa6e1a05902dcd728ba63cbbf445
|
[
"Apache-2.0"
] |
permissive
|
teimichael/COPDIdentifyManagement
|
983c7fd104f1f589e5fa60d6ca373e6f3e6a8332
|
a66e099e0257566194d203e627b4e17491cc2f69
|
refs/heads/master
| 2020-08-26T11:26:56.813118
| 2019-10-23T11:28:03
| 2019-10-23T11:28:03
| 217,004,434
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 304
|
java
|
package stu.napls.copdmanage.core.exception;
/**
* @author Yepeng Ding
*/
public class BaseException extends RuntimeException {
public BaseException(String message) {
super(message);
}
public BaseException(String message, Throwable cause) {
super(message, cause);
}
}
|
[
"teimichael@outlook.com"
] |
teimichael@outlook.com
|
5dbf5b30471fc3fb64541311d9aa3cf51c64f4fc
|
0010b5b85355231f0ee1fb2702dc3a554381b62d
|
/app/src/main/java/com/bukhmastov/cdoitmo/firebase/FirebaseConfigProvider.java
|
fbdf9f42cd33574a3f6b5d44caa5839e566fe25b
|
[
"MIT"
] |
permissive
|
bukhmastov/CDOITMO
|
e361fe4c8b43df5dfe2671a8d7bf908a9366f390
|
f881f1ed8bf9fa9fecc907901a310d8ff31bd507
|
refs/heads/master
| 2021-01-13T16:43:00.036479
| 2020-01-12T13:00:05
| 2020-01-12T13:00:05
| 77,790,484
| 11
| 4
|
MIT
| 2018-07-21T11:48:01
| 2017-01-01T18:08:58
|
Java
|
UTF-8
|
Java
| false
| false
| 683
|
java
|
package com.bukhmastov.cdoitmo.firebase;
import android.content.Context;
import androidx.annotation.NonNull;
import com.bukhmastov.cdoitmo.model.firebase.config.FBConfigMessage;
public interface FirebaseConfigProvider {
String MESSAGE_LOGIN = "message_login";
String MESSAGE_MENU = "message_menu";
String PERFORMANCE_ENABLED = "performance_enabled";
interface Result {
void onResult(String value);
}
interface ResultMessage {
void onResult(FBConfigMessage configMessage);
}
void getString(@NonNull Context context, String key, Result result);
void getMessage(@NonNull Context context, String key, ResultMessage result);
}
|
[
"bukhmastov-alex@ya.ru"
] |
bukhmastov-alex@ya.ru
|
c3e460f10027b2f6c93eacd9d6f56949d23311a4
|
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
|
/genny_JavaWithoutLambdasApi21_ReducedClassCount/applicationModule/src/test/java/applicationModulepackageJava2/Foo674Test.java
|
279b7a82e9940e7f8673bae8626811fa1f833ce8
|
[] |
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
| 741
|
java
|
package applicationModulepackageJava2;
import org.junit.Test;
public class Foo674Test {
@Test
public void testFoo0() {
new Foo674().foo0();
}
@Test
public void testFoo1() {
new Foo674().foo1();
}
@Test
public void testFoo2() {
new Foo674().foo2();
}
@Test
public void testFoo3() {
new Foo674().foo3();
}
@Test
public void testFoo4() {
new Foo674().foo4();
}
@Test
public void testFoo5() {
new Foo674().foo5();
}
@Test
public void testFoo6() {
new Foo674().foo6();
}
@Test
public void testFoo7() {
new Foo674().foo7();
}
@Test
public void testFoo8() {
new Foo674().foo8();
}
@Test
public void testFoo9() {
new Foo674().foo9();
}
}
|
[
"nikita.e.kozlov@gmail.com"
] |
nikita.e.kozlov@gmail.com
|
ed174049180f52999eb474655add1d1fb24a5309
|
0ca356dbb1db04f6a5f52904db05fbcebc0c8522
|
/streampipes-pipeline-elements-shared/src/main/java/org/streampipes/pe/shared/PlaceholderExtractor.java
|
7ea852226051fad84d3576e039ccee484f7103c0
|
[
"Apache-2.0"
] |
permissive
|
doemski/streampipes-pipeline-elements
|
4d07264cb5d3505bcd6fb6867afed89ab48cd5fe
|
7246d9e98940a0197ceb8aec041f360c0c94f5c4
|
refs/heads/master
| 2020-08-07T22:00:26.491109
| 2019-09-19T12:12:18
| 2019-09-19T12:12:18
| 213,598,832
| 0
| 0
|
Apache-2.0
| 2019-10-08T09:16:10
| 2019-10-08T09:16:10
| null |
UTF-8
|
Java
| false
| false
| 2,435
|
java
|
/*
* Copyright 2018 FZI Forschungszentrum Informatik
*
* 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.streampipes.pe.shared;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class PlaceholderExtractor {
private static final Pattern pattern = Pattern.compile("#[^#]*#");
public static String replacePlaceholders(String content, String json) {
List<String> placeholders = getPlaceholders(content);
JsonParser parser = new JsonParser();
JsonObject jsonObject = parser.parse(json).getAsJsonObject();
for(String placeholder : placeholders) {
String replacedValue = getPropertyValue(jsonObject, placeholder);
content = content.replaceAll(placeholder, replacedValue);
}
return content;
}
public static String replacePlaceholders(String content, Map<String, Object> event) {
List<String> placeholders = getPlaceholders(content);
for(String placeholder : placeholders) {
String replacedValue = getPropertyValue(event, placeholder);
content = content.replaceAll(placeholder, replacedValue);
}
return content;
}
private static String getPropertyValue(Map<String, Object> event, String placeholder) {
String key = placeholder.replaceAll("#", "");
return String.valueOf(event.get(key));
}
private static String getPropertyValue(JsonObject jsonObject, String placeholder) {
String jsonKey = placeholder.replaceAll("#", "");
return String.valueOf(jsonObject.get(jsonKey).getAsString());
}
private static List<String> getPlaceholders(String content) {
List<String> results = new ArrayList<>();
Matcher matcher = pattern.matcher(content);
while (matcher.find()) {
results.add(matcher.group());
}
return results;
}
}
|
[
"riemer@fzi.de"
] |
riemer@fzi.de
|
ecbb2bbe8626210d918c058e230c9dbf2c453335
|
91f71eb339be3627acb62291f4a79afbb611d026
|
/src/main/java/me/brunosantana/exam5/package1/Test16.java
|
fe2db0203e5ce13e5c4ab5487c96fdce2e251a29
|
[] |
no_license
|
brunosantanati/1Z0-808
|
69ba0fe553e752df163bcea1649411a29418420c
|
4b3b251d016d046f765c6e45e2975f499a0ca50b
|
refs/heads/master
| 2022-03-16T15:18:18.823311
| 2022-02-17T13:35:44
| 2022-02-17T13:35:44
| 242,811,666
| 0
| 0
| null | 2020-10-13T19:48:48
| 2020-02-24T18:30:04
|
Java
|
UTF-8
|
Java
| false
| false
| 452
|
java
|
package me.brunosantana.exam5.package1;
import java.sql.SQLException;
public class Test16 {
private static void m() throws SQLException {
try {
throw new SQLException();
} catch (Exception e) {
throw e;
}
}
public static void main(String[] args) {
try {
m();
} catch(SQLException e) {
System.out.println("CAUGHT SUCCESSFULLY");
}
}
}
|
[
"bruno.santana.ti@gmail.com"
] |
bruno.santana.ti@gmail.com
|
59467edb5db1d972efa13f9730c4341bd8fd2c7c
|
83d781a9c2ba33fde6df0c6adc3a434afa1a7f82
|
/MarketBusinessInterface/src/main/java/com/newco/marketplace/vo/downloadsignedcopy/SignedCopyVO.java
|
0c5bbf36ad57d8af7b2f5efd859ab493ee150b2d
|
[] |
no_license
|
ssriha0/sl-b2b-platform
|
71ab8ef1f0ccb0a7ad58b18f28a2bf6d5737fcb6
|
5b4fcafa9edfe4d35c2dcf1659ac30ef58d607a2
|
refs/heads/master
| 2023-01-06T18:32:24.623256
| 2020-11-05T12:23:26
| 2020-11-05T12:23:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,799
|
java
|
package com.newco.marketplace.vo.downloadsignedcopy;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.lang.StringUtils;
public class SignedCopyVO {
private SimpleDateFormat fmtDate = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
private String soId;
private String filePath;
private String docTitle;
private String fileName;
private String fileSize;
private String uploadedBy;
private String uploadedDateString;
private Date uploadedDate;
public String getSoId() {
return soId;
}
public void setSoId(String soId) {
this.soId = soId;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getFileSize() {
return fileSize;
}
public void setFileSize(String fileSize) {
this.fileSize = fileSize;
}
public String getUploadedBy() {
return uploadedBy;
}
public void setUploadedBy(String uploadedBy) {
this.uploadedBy = uploadedBy;
}
public String getUploadedDateString() {
Date uploadedDate = getUploadedDate();
String formattedDate = fmtDate.format(uploadedDate);
if(StringUtils.isNotBlank(formattedDate)){
this.uploadedDateString = formattedDate;
}
return uploadedDateString;
}
public Date getUploadedDate() {
return uploadedDate;
}
public void setUploadedDate(Date uploadedDate) {
this.uploadedDate = uploadedDate;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getDocTitle() {
return docTitle;
}
public void setDocTitle(String docTitle) {
this.docTitle = docTitle;
}
}
|
[
"Kunal.Pise@transformco.com"
] |
Kunal.Pise@transformco.com
|
4baa250aea360f8ca69de5bbca7231d7964ea0d5
|
fa434f50e76ce484c1f9ccdc542a612e123e926e
|
/testing/archtestsupport/applib/src/test/java/org/apache/isis/testing/archtestsupport/applib/entity/jpa/JpaEntityArchTests.java
|
f7d05b785638edce216456f29e69bb0014147065
|
[
"Apache-2.0"
] |
permissive
|
dp-glitch/isis
|
264c6bf89045a0545ab0ec3c63e7f9f39727d3e7
|
1b8d43d92289d2d4bd6753108e73f3e697797235
|
refs/heads/master
| 2023-06-29T16:31:47.212508
| 2021-07-23T07:59:46
| 2021-07-23T07:59:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,743
|
java
|
package org.apache.isis.testing.archtestsupport.applib.entity.jpa;
import com.tngtech.archunit.core.importer.ImportOption;
import com.tngtech.archunit.junit.AnalyzeClasses;
import com.tngtech.archunit.junit.ArchTest;
import com.tngtech.archunit.lang.ArchRule;
import org.apache.isis.testing.archtestsupport.applib.classrules.ArchitectureJpaRules;
import org.apache.isis.testing.archtestsupport.applib.entity.jpa.dom.JpaDomModule;
@AnalyzeClasses(
packagesOf = {
JpaDomModule.class
},
importOptions = {ImportOption.OnlyIncludeTests.class})
public class JpaEntityArchTests {
@ArchTest
public static ArchRule classes_annotated_with_Entity_must_also_be_an_IsisEntityListener =
ArchitectureJpaRules.classes_annotated_with_Entity_must_also_be_an_IsisEntityListener();
@ArchTest
public static ArchRule classes_annotated_with_Entity_must_also_implement_Comparable =
ArchitectureJpaRules.classes_annotated_with_Entity_must_also_implement_Comparable();
@ArchTest
public static ArchRule classes_annotated_with_Entity_must_also_be_annotated_with_DomainObject_nature_of_ENTITY =
ArchitectureJpaRules.classes_annotated_with_Entity_must_also_be_annotated_with_DomainObject_nature_of_ENTITY();
@ArchTest
public static ArchRule classes_annotated_with_Entity_must_also_be_annotated_with_XmlJavaAdapter_PersistentEntityAdapter =
ArchitectureJpaRules.classes_annotated_with_Entity_must_also_be_annotated_with_XmlJavaAdapter_PersistentEntityAdapter();
@ArchTest
public static ArchRule classes_annotated_with_Entity_must_also_be_annotated_with_Table_with_uniqueConstraints =
ArchitectureJpaRules.classes_annotated_with_Entity_must_also_be_annotated_with_Table_with_uniqueConstraints();
}
|
[
"dan@haywood-associates.co.uk"
] |
dan@haywood-associates.co.uk
|
f3962cc276c01d64fc0ce477808d9a3da8aba6fa
|
99c03face59ec13af5da080568d793e8aad8af81
|
/hom_classifier/2om_classifier/scratch/AOIS44AOIS7/Pawn.java
|
80adec55e3b91cacf03d0b38a00a6335c9aa7903
|
[] |
no_license
|
fouticus/HOMClassifier
|
62e5628e4179e83e5df6ef350a907dbf69f85d4b
|
13b9b432e98acd32ae962cbc45d2f28be9711a68
|
refs/heads/master
| 2021-01-23T11:33:48.114621
| 2020-05-13T18:46:44
| 2020-05-13T18:46:44
| 93,126,040
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,761
|
java
|
// This is a mutant program.
// Author : ysma
import java.util.ArrayList;
public class Pawn extends ChessPiece
{
public Pawn( ChessBoard board, ChessPiece.Color color )
{
super( board, color );
}
public java.lang.String toString()
{
if (color == ChessPiece.Color.WHITE) {
return "♙";
} else {
return "♟";
}
}
public java.util.ArrayList<String> legalMoves()
{
java.util.ArrayList<String> returnList = new java.util.ArrayList<String>();
if (this.getColor().equals( ChessPiece.Color.WHITE )) {
int currentCol = this.getColumn();
int nextRow = this.getRow() + 1;
if (nextRow <= 7) {
if (board.getPiece( onePossibleMove( nextRow++, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextRow, currentCol ) );
}
}
if (this.getRow() == 1) {
int nextNextRow = this.getRow() + 2;
if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null && board.getPiece( onePossibleMove( nextNextRow, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextNextRow, currentCol ) );
}
}
int leftColumn = currentCol - 1;
int rightColumn = currentCol-- + 1;
if (leftColumn >= 0) {
if (board.getPiece( onePossibleMove( nextRow, leftColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, leftColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, leftColumn ) );
}
}
}
if (rightColumn <= 7) {
if (board.getPiece( onePossibleMove( nextRow, rightColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, rightColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, rightColumn ) );
}
}
}
} else {
int currentCol = this.getColumn();
int nextRow = this.getRow() - 1;
if (nextRow >= 0) {
if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextRow, currentCol ) );
}
}
if (this.getRow() == 6) {
int nextNextRow = this.getRow() - 2;
if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null && board.getPiece( onePossibleMove( nextNextRow, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextNextRow, currentCol ) );
}
}
int leftColumn = currentCol - 1;
int rightColumn = currentCol + 1;
if (leftColumn >= 0) {
if (board.getPiece( onePossibleMove( nextRow, leftColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, leftColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, leftColumn ) );
}
}
}
if (rightColumn <= 7) {
if (board.getPiece( onePossibleMove( nextRow, rightColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, rightColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, rightColumn ) );
}
}
}
}
return returnList;
}
}
|
[
"fout.alex@gmail.com"
] |
fout.alex@gmail.com
|
ba0dde64fcc37cb1967d18e208db4dd3322932eb
|
4abab33500b1b7bdb6124a467ae05c3c083dacfd
|
/src/efungame/efg_user/src/main/java/com/efun/game/user/dao/UserSignInLogMapper.java
|
5834a5a9e0431cf306ca8c907fdf739f7673341c
|
[] |
no_license
|
easyfun/efungame
|
245a2987746c87ec5d2d9d144175abb82acd6265
|
80cde77f8c4f414798f20f5655e3bd2b66772152
|
refs/heads/master
| 2021-01-01T15:45:42.179303
| 2018-09-29T08:17:31
| 2018-09-29T08:17:31
| 97,691,286
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 405
|
java
|
package com.efun.game.user.dao;
import com.efun.game.user.entity.UserSignInLog;
public interface UserSignInLogMapper {
int deleteByPrimaryKey(Long id);
int insert(UserSignInLog record);
int insertSelective(UserSignInLog record);
UserSignInLog selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(UserSignInLog record);
int updateByPrimaryKey(UserSignInLog record);
}
|
[
"ywd979@foxmail.com"
] |
ywd979@foxmail.com
|
b129b74e197ab0ba171ca4e93a41182e456911e1
|
8bee469632180c979e232808e161f17a4b5d6d18
|
/Mage.Sets/src/mage/sets/magic2015/JaliraMasterPolymorphist.java
|
089edf281c6da39d8b1ae6a2aafe17742a917c18
|
[] |
no_license
|
TGower/mage
|
14483dc5daa9e0d3412a57511c3bdf0119b245f1
|
19f6148c6dafbee1550b284a384a1bb9b35a7e97
|
refs/heads/master
| 2020-12-26T02:49:37.814683
| 2015-05-25T19:57:41
| 2015-05-25T19:57:41
| 35,901,804
| 0
| 0
| null | 2015-05-19T18:51:15
| 2015-05-19T18:51:14
| null |
UTF-8
|
Java
| false
| false
| 6,640
|
java
|
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2015;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.players.Library;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LevelX2
*/
public class JaliraMasterPolymorphist extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public JaliraMasterPolymorphist(UUID ownerId) {
super(ownerId, 64, "Jalira, Master Polymorphist", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.expansionSetCode = "M15";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Wizard");
this.color.setBlue(true);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// {2}{U}, {T}, Sacrifice another creature: Reveal cards from the top of your library until you reveal a nonlegendary creature card.
// Put that card onto the battlefield and the rest on the bottom of your library in a random order.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JaliraMasterPolymorphistEffect(), new ManaCostsImpl("{2}{U}"));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true)));
this.addAbility(ability);
}
public JaliraMasterPolymorphist(final JaliraMasterPolymorphist card) {
super(card);
}
@Override
public JaliraMasterPolymorphist copy() {
return new JaliraMasterPolymorphist(this);
}
}
class JaliraMasterPolymorphistEffect extends OneShotEffect {
private static final FilterCreatureCard filter = new FilterCreatureCard("nonlegendary creature card");
static {
filter.add(Predicates.not(new SupertypePredicate("Legendary")));
}
public JaliraMasterPolymorphistEffect() {
super(Outcome.PutCardInPlay);
this.staticText = "Reveal cards from the top of your library until you reveal a nonlegendary creature card. Put that card onto the battlefield and the rest on the bottom of your library in a random order";
}
public JaliraMasterPolymorphistEffect(final JaliraMasterPolymorphistEffect effect) {
super(effect);
}
@Override
public JaliraMasterPolymorphistEffect copy() {
return new JaliraMasterPolymorphistEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && controller.getLibrary().size() > 0) {
CardsImpl cards = new CardsImpl();
Library library = controller.getLibrary();
Card card = null;
do {
card = library.removeFromTop(game);
if (card != null) {
cards.add(card);
}
} while (library.size() > 0 && card != null && !filter.match(card, game));
// reveal cards
if (!cards.isEmpty()) {
controller.revealCards(sourceObject.getName(), cards, game);
}
// put nonlegendary creature card to battlefield
controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
// remove it from revealed card list
cards.remove(card);
// Put the rest on the bottom of your library in a random order
while (cards.size() > 0) {
card = cards.getRandom(game);
if (card != null) {
cards.remove(card);
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, false, false);
}
}
return true;
}
return false;
}
}
|
[
"ludwig.hirth@online.de"
] |
ludwig.hirth@online.de
|
54df1e72edd780207e59886ecc9db6505cbda55a
|
fea17fbc7aba563c0a8bd2d782ade8d0eb8dfe6b
|
/gmall-sms/src/main/java/com/atguigu/gmall/sms/mapper/CouponSpuMapper.java
|
f1fcad474f510752df4dc49782e9bb0284c6f94e
|
[] |
no_license
|
jianjianxiguan/gmall
|
bc4133c2a201ab1cd9725f5b3d738dd55b52e61d
|
0a4fd417734b162e2beeb4a7070c0e520f1380c3
|
refs/heads/main
| 2023-01-12T22:22:10.696631
| 2020-11-19T07:51:20
| 2020-11-19T07:51:20
| 307,663,155
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 389
|
java
|
package com.atguigu.gmall.sms.mapper;
import com.atguigu.gmall.sms.entity.CouponSpuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 优惠券与产品关联
*
* @author zl
* @email fengge@atguigu.com
* @date 2020-10-28 19:03:03
*/
@Mapper
public interface CouponSpuMapper extends BaseMapper<CouponSpuEntity> {
}
|
[
"user@user.com"
] |
user@user.com
|
5cc1a182c3d00a4ec51e7ef002b2648d98c1b238
|
b3f58deae474db9035cd340b4e66b3e6bdafdeca
|
/android_webview/java/src/org/chromium/android_webview/AwMessagePortService.java
|
d9057a901f83a64377bd802671101311b861929a
|
[
"BSD-3-Clause"
] |
permissive
|
quanxinglong/chromium
|
0c45f232254c056e27f35e00da8472ff3ac49fd9
|
16dda055c8799052d45a593059b614ea682d4f6c
|
refs/heads/master
| 2021-01-24T17:58:29.213579
| 2015-08-10T19:39:07
| 2015-08-10T19:39:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,201
|
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.android_webview;
import android.util.SparseArray;
import org.chromium.base.ObserverList;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
/**
* Provides the Message Channel functionality for Android Webview. Specifically
* manages the message ports that are associated with a message channel and
* handles posting/receiving messages to/from them.
* See https://html.spec.whatwg.org/multipage/comms.html#messagechannel for
* further information on message channels.
*
* The message ports have unique IDs. In Android webview implementation,
* the message ports are only known by their IDs at the native side.
* At the java side, the embedder deals with MessagePort objects. The mapping
* from an ID to an object is in AwMessagePortService. AwMessagePortService
* keeps a strong ref to MessagePort objects until they are closed.
*
* Ownership: The Java AwMessagePortService is owned by Java AwBrowserContext.
* The native AwMessagePortService is owned by native AwBrowserContext. The
* native peer maintains a weak ref to the java object and deregisters itself
* before being deleted.
*
* All methods are called on UI thread except as noted.
*/
@JNINamespace("android_webview")
public class AwMessagePortService {
private static final String TAG = "AwMessagePortService";
/**
* Observer for MessageChannel events.
*/
public static interface MessageChannelObserver {
void onMessageChannelCreated();
}
// A thread safe storage for Message Ports.
private static class MessagePortStorage {
private SparseArray<AwMessagePort> mMessagePorts = new SparseArray<AwMessagePort>();
private Object mLock = new Object();
public void remove(int portId) {
synchronized (mLock) {
mMessagePorts.remove(portId);
}
}
public void put(int portId, AwMessagePort m) {
synchronized (mLock) {
mMessagePorts.put(portId, m);
}
}
public AwMessagePort get(int portId) {
synchronized (mLock) {
return mMessagePorts.get(portId);
}
}
}
private long mNativeMessagePortService;
private MessagePortStorage mPortStorage = new MessagePortStorage();
private ObserverList<MessageChannelObserver> mObserverList =
new ObserverList<MessageChannelObserver>();
AwMessagePortService() {
mNativeMessagePortService = nativeInitAwMessagePortService();
}
public void addObserver(MessageChannelObserver observer) {
mObserverList.addObserver(observer);
}
public void removeObserver(MessageChannelObserver observer) {
mObserverList.removeObserver(observer);
}
public void closePort(int messagePortId) {
mPortStorage.remove(messagePortId);
if (mNativeMessagePortService == 0) return;
nativeClosePort(mNativeMessagePortService, messagePortId);
}
public void postMessage(int senderId, String message, int[] sentPorts) {
// verify that webview still owns the port (not transferred)
if (mPortStorage.get(senderId) == null) {
throw new IllegalStateException("Cannot post to unknown port " + senderId);
}
if (mNativeMessagePortService == 0) return;
nativePostAppToWebMessage(mNativeMessagePortService, senderId, message, sentPorts);
}
public void removeSentPorts(int[] sentPorts) {
// verify that webview owns all the ports that are transferred
if (sentPorts != null) {
for (int port : sentPorts) {
AwMessagePort p = mPortStorage.get(port);
if (p == null) {
throw new IllegalStateException("Cannot transfer unknown port " + port);
}
mPortStorage.remove(port);
}
}
}
public AwMessagePort[] createMessageChannel() {
return new AwMessagePort[]{new AwMessagePort(this), new AwMessagePort(this)};
}
// Called on UI thread.
public void releaseMessages(int portId) {
if (mNativeMessagePortService == 0) return;
nativeReleaseMessages(mNativeMessagePortService, portId);
}
private AwMessagePort addPort(AwMessagePort m, int portId) {
if (mPortStorage.get(portId) != null) {
throw new IllegalStateException("Port already exists");
}
m.setPortId(portId);
mPortStorage.put(portId, m);
return m;
}
@CalledByNative
private void onMessageChannelCreated(int portId1, int portId2,
AwMessagePort[] ports) {
ThreadUtils.assertOnUiThread();
addPort(ports[0], portId1);
addPort(ports[1], portId2);
for (MessageChannelObserver observer : mObserverList) {
observer.onMessageChannelCreated();
}
}
// Called on IO thread.
@CalledByNative
private void onReceivedMessage(int portId, String message, int[] ports) {
AwMessagePort[] messagePorts = null;
for (int i = 0; i < ports.length; i++) {
if (messagePorts == null) {
messagePorts = new AwMessagePort[ports.length];
}
messagePorts[i] = addPort(new AwMessagePort(this), ports[i]);
}
mPortStorage.get(portId).onReceivedMessage(message, messagePorts);
}
@CalledByNative
private void unregisterNativeAwMessagePortService() {
mNativeMessagePortService = 0;
}
private native long nativeInitAwMessagePortService();
private native void nativePostAppToWebMessage(long nativeAwMessagePortServiceImpl,
int senderId, String message, int[] portIds);
private native void nativeClosePort(long nativeAwMessagePortServiceImpl,
int messagePortId);
private native void nativeReleaseMessages(long nativeAwMessagePortServiceImpl,
int messagePortId);
}
|
[
"commit-bot@chromium.org"
] |
commit-bot@chromium.org
|
a3f72401d720665ea41f6accf704ae12025cfc35
|
e69fbe41b7f347d59c5c11580af5721688407378
|
/app/src/main/java/com/mobi/overseas/clearsafe/ui/clear/entity/CleanRewardBean.java
|
c869b1ec96797d9097503977c72077a147167922
|
[] |
no_license
|
ZhouSilverBullet/mobiclearsafe-overseas
|
578fa39a3a320e41c68e9c6f6703647b5f6d4fc8
|
f885469217c1942eb680da712f083bede8ee4fd7
|
refs/heads/master
| 2022-07-03T13:06:38.407425
| 2020-05-11T02:58:22
| 2020-05-11T02:58:22
| 261,681,978
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,231
|
java
|
package com.mobi.overseas.clearsafe.ui.clear.entity;
/**
* @author zhousaito
* @version 1.0
* @date 2020/3/24 20:22
* @Dec 略
*/
public class CleanRewardBean {
/**
* points : 40
* pop_type : 1000
* pop_up_msg :
* total_points : 2080
* totol_cash : 0.21
*/
private int points;
private int pop_type;
private String pop_up_msg;
private int total_points;
private double totol_cash;
public int getPoints() {
return points;
}
public void setPoints(int points) {
this.points = points;
}
public int getPop_type() {
return pop_type;
}
public void setPop_type(int pop_type) {
this.pop_type = pop_type;
}
public String getPop_up_msg() {
return pop_up_msg;
}
public void setPop_up_msg(String pop_up_msg) {
this.pop_up_msg = pop_up_msg;
}
public int getTotal_points() {
return total_points;
}
public void setTotal_points(int total_points) {
this.total_points = total_points;
}
public double getTotol_cash() {
return totol_cash;
}
public void setTotol_cash(double totol_cash) {
this.totol_cash = totol_cash;
}
}
|
[
"zhousaito@163.com"
] |
zhousaito@163.com
|
c2c0a4391bd39811e529e7c9542a45eb0823f542
|
a048507c1807397329a558e84a5b0f69e66437d3
|
/boot/iot-master-webjars - 2.0/src/main/java/com/cimr/demo/dao/ExampleDao.java
|
68fd36b4c90ea88a2b07bea9245b3c62682daeff
|
[] |
no_license
|
jlf1997/learngit
|
0ffd6fec5c6e9ad10ff14ff838396e1ef53a06f3
|
d6d7eba1c0bf6c76f49608dd2537594af2cd4ee9
|
refs/heads/master
| 2021-01-17T07:10:30.004555
| 2018-11-08T09:15:13
| 2018-11-08T09:15:13
| 59,822,610
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 322
|
java
|
package com.cimr.demo.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.cimr.comm.base.BaseDao;
import com.cimr.demo.model.Example;
/**
* Created by liqi on 2017/11/24.
* liqiwork@qq.com
*/
public interface ExampleDao {
List<Example> selectList(@Param("title") String title);
}
|
[
"675866753@qq.com"
] |
675866753@qq.com
|
12d8873927955f3f5cae553d37d62e42a9bd0b4b
|
40d844c1c780cf3618979626282cf59be833907f
|
/src/testcases/CWE190_Integer_Overflow/s02/CWE190_Integer_Overflow__int_getQueryString_Servlet_add_81_bad.java
|
53b63fd33c99f2918b59db02408e4cf6f3a312e1
|
[] |
no_license
|
rubengomez97/juliet
|
f9566de7be198921113658f904b521b6bca4d262
|
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
|
refs/heads/master
| 2023-06-02T00:37:24.532638
| 2021-06-23T17:22:22
| 2021-06-23T17:22:22
| 379,676,259
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,231
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE190_Integer_Overflow__int_getQueryString_Servlet_add_81_bad.java
Label Definition File: CWE190_Integer_Overflow__int.label.xml
Template File: sources-sinks-81_bad.tmpl.java
*/
/*
* @description
* CWE: 190 Integer Overflow
* BadSource: getQueryString_Servlet Parse id param out of the URL query string (without using getParameter())
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: add
* GoodSink: Ensure there will not be an overflow before adding 1 to data
* BadSink : Add 1 to data, which can cause an overflow
* Flow Variant: 81 Data flow: data passed in a parameter to an abstract method
*
* */
package testcases.CWE190_Integer_Overflow.s02;
import testcasesupport.*;
import javax.servlet.http.*;
public class CWE190_Integer_Overflow__int_getQueryString_Servlet_add_81_bad extends CWE190_Integer_Overflow__int_getQueryString_Servlet_add_81_base
{
public void action(int data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
/* POTENTIAL FLAW: if data == Integer.MAX_VALUE, this will overflow */
int result = (int)(data + 1);
IO.writeLine("result: " + result);
}
}
|
[
"you@example.com"
] |
you@example.com
|
99d64085d42cabd20c099163b85faad986eeca88
|
03e234eccd1545935583b4a34b2e3efc9128375c
|
/authz/authz-batch/src/main/java/com/att/authz/reports/NSDump.java
|
bfed2a3f5de3a6285e3f62470efe48a5b69dc865
|
[
"BSD-3-Clause"
] |
permissive
|
charanm1985/AAF
|
32bda688be0e2534dc9c6c4def21df8c35dd8287
|
090562e956c0035db972aafba844dc6d3fc948ee
|
refs/heads/master
| 2020-05-15T22:34:31.435564
| 2017-10-24T21:19:52
| 2017-10-24T21:19:52
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,701
|
java
|
/*******************************************************************************
* Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
*******************************************************************************/
package com.att.authz.reports;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Date;
import java.util.List;
import com.att.authz.Batch;
import com.att.authz.env.AuthzTrans;
import com.att.authz.helpers.Cred;
import com.att.authz.helpers.NS;
import com.att.authz.helpers.Perm;
import com.att.authz.helpers.Role;
import com.att.authz.helpers.UserRole;
import com.att.inno.env.APIException;
import com.att.inno.env.Env;
import com.att.inno.env.TimeTaken;
public class NSDump extends Batch{
private PrintStream out = System.out;
private final String ns, admin, owner;
public NSDump(AuthzTrans trans) throws APIException, IOException {
super(trans.env());
if(args().length>0) {
ns = args()[0];
} else {
throw new APIException("NSDump requires \"NS\" parameter");
}
admin = ns + "|admin";
owner = ns + "|owner";
TimeTaken tt = trans.start("Connect to Cluster", Env.REMOTE);
try {
session = cluster.connect();
} finally {
tt.done();
}
NS.loadOne(trans, session,NS.v2_0_11,ns);
Role.loadOneNS(trans, session, ns);
if(Role.data.keySet().size()>5) {
UserRole.load(trans, session,UserRole.v2_0_11);
} else {
for(Role r : Role.data.keySet()) {
UserRole.loadOneRole(trans, session, UserRole.v2_0_11, r.fullName());
}
}
Perm.loadOneNS(trans,session,ns);
Cred.loadOneNS(trans, session, ns);
}
@Override
protected void run(AuthzTrans trans) {
Date now = new Date();
for(NS ns : NS.data.values()) {
out.format("# Data for Namespace [%s] - %s\n",ns.name,ns.description);
out.format("ns create %s",ns);
boolean first = true;
List<UserRole> owners = UserRole.byRole.get(owner);
if(owners!=null)for(UserRole ur : owners) {
if(first) {
out.append(' ');
first = false;
} else {
out.append(',');
}
out.append(ur.user);
}
first = true;
List<UserRole> admins = UserRole.byRole.get(admin);
if(admins!=null)for(UserRole ur : admins) {
if(first) {
out.append(' ');
first = false;
} else {
out.append(',');
}
out.append(ur.user);
}
out.println();
// Load Creds
Date last;
for(Cred c : Cred.data.values()) {
for(int i : c.types()) {
last = c.last(i);
if(last!=null && now.before(last)) {
switch(i) {
case 1:
out.format(" user cred add %s %s\n", c.id,"new2you!");
break;
case 200:
out.format(" # CERT needs registering for %s\n", c.id);
break;
default:
out.format(" # Unknown Type for %s\n", c.id);
}
}
}
}
// Load Roles
for(Role r : Role.data.keySet()) {
if(!"admin".equals(r.name) && !"owner".equals(r.name)) {
out.format(" role create %s\n",r.fullName());
List<UserRole> lur = UserRole.byRole.get(r.fullName());
if(lur!=null)for(UserRole ur : lur) {
if(ur.expires.after(now)) {
out.format(" request role user add %s %s\n", ur.role,ur.user);
}
}
}
}
// Load Perms
for(Perm r : Perm.data.keySet()) {
out.format(" perm create %s.%s %s %s\n",r.ns,r.type,r.instance,r.action);
for(String role : r.roles) {
out.format(" request perm grant %s.%s %s %s %s\n", r.ns,r.type,r.instance,r.action,Role.fullName(role));
}
}
}
}
@Override
protected void _close(AuthzTrans trans) {
session.close();
aspr.info("End " + this.getClass().getSimpleName() + " processing" );
}
}
|
[
"sv8675@att.com"
] |
sv8675@att.com
|
8902c3907de4cdbbd9f70f61759f50966d83c9e6
|
0da4ede0f251508c4a6c0cd8b8956679b8802c16
|
/app/src/main/java/com/ingic/ezhalbatek/technician/ui/binders/NavigationBinder.java
|
c4c458ff80d0f8cdc538c3992cd9cb70a003621d
|
[] |
no_license
|
SaeedHyder/DohaMart_Technicain_Android
|
b02d2f71aa6bba501cbb678eff059a221af35336
|
5de60aed7c4fde845a1c5861f2a961deb1a8cc17
|
refs/heads/master
| 2022-03-17T06:30:56.066511
| 2019-11-11T18:48:33
| 2019-11-11T18:48:33
| 168,325,718
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,838
|
java
|
package com.ingic.ezhalbatek.technician.ui.binders;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import com.ingic.ezhalbatek.technician.R;
import com.ingic.ezhalbatek.technician.entities.NavigationEnt;
import com.ingic.ezhalbatek.technician.interfaces.RecyclerItemListener;
import com.ingic.ezhalbatek.technician.ui.viewbinders.abstracts.RecyclerViewBinder;
import com.ingic.ezhalbatek.technician.ui.views.AnyTextView;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created on 12/15/2017.
*/
public class NavigationBinder extends RecyclerViewBinder<NavigationEnt> {
private RecyclerItemListener listener;
public NavigationBinder(RecyclerItemListener listener) {
super(R.layout.row_item_nav);
this.listener = listener;
}
@Override
public BaseViewHolder createViewHolder(View view) {
return new ViewHolder(view);
}
@Override
public void bindView(final NavigationEnt entity, final int position, Object viewHolder, Context context) {
ViewHolder holder = (ViewHolder) viewHolder;
holder.imgSelected.setImageResource(entity.getResId());
holder.txtHome.setText(entity.getTitle());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null) {
listener.onItemClicked(entity, position,view.getId());
}
}
});
}
static class ViewHolder extends BaseViewHolder {
@BindView(R.id.img_selected)
ImageView imgSelected;
@BindView(R.id.txt_home)
AnyTextView txtHome;
ViewHolder(View view) {
super(view);
ButterKnife.bind(this, view);
}
}
}
|
[
"saeedhyder@axact.com"
] |
saeedhyder@axact.com
|
10f15e21d3b006e3a4a0343d7b360c586f17841f
|
e209f7535e2b7ad796d63ae09ca31f4fb759d27c
|
/azkarra-api/src/main/java/io/streamthoughts/azkarra/api/query/internal/WindowFetchQuery.java
|
f349fd9afc2eb19c8ee578e54d967225225bb7a8
|
[
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] |
permissive
|
savulchik/azkarra-streams
|
0a1e91eeb05beacf5533eb407dddb72204763d45
|
340564f2d88800f04ad48425ea44ab6e6e348220
|
refs/heads/master
| 2020-12-15T22:23:31.061244
| 2020-01-15T18:10:06
| 2020-01-15T18:28:08
| 235,272,616
| 0
| 0
|
Apache-2.0
| 2020-01-21T06:38:19
| 2020-01-21T06:38:18
| null |
UTF-8
|
Java
| false
| false
| 3,199
|
java
|
/*
* Copyright 2019 StreamThoughts.
*
* 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 io.streamthoughts.azkarra.api.query.internal;
import io.streamthoughts.azkarra.api.model.KV;
import io.streamthoughts.azkarra.api.monad.Reader;
import io.streamthoughts.azkarra.api.monad.Try;
import io.streamthoughts.azkarra.api.query.LocalStoreAccessor;
import io.streamthoughts.azkarra.api.query.StoreOperation;
import io.streamthoughts.azkarra.api.query.Queried;
import io.streamthoughts.azkarra.api.query.StoreType;
import io.streamthoughts.azkarra.api.streams.KafkaStreamsContainer;
import org.apache.kafka.common.serialization.Serializer;
import org.apache.kafka.streams.state.ReadOnlyWindowStore;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
public class WindowFetchQuery<K, V> extends KeyedLocalStoreQuery<K, K, V> {
private final long time;
/**
* Creates a new {@link WindowFetchQuery} instance.
*
* @param storeName the storeName name.
* @param key the record key.
* @param keySerializer the key serializer.
*/
WindowFetchQuery(final String storeName,
final K key,
final Serializer<K> keySerializer,
final long time) {
super(storeName, key, keySerializer);
this.time = time;
}
/**
* {@inheritDoc}
*/
@Override
public StoreType storeType() {
return StoreType.WINDOW;
}
/**
* {@inheritDoc}
*/
@Override
public StoreOperation operationType() {
return StoreOperation.FETCH;
}
/**
* {@inheritDoc}
*/
@Override
public Try<List<KV<K, V>>> execute(final KafkaStreamsContainer container,
final Queried queried) {
final LocalStoreAccessor<ReadOnlyWindowStore<K, V>> accessor = container.getLocalWindowStore(storeName());
final Reader<ReadOnlyWindowStore<K, V>, List<KV<K, V>>> reader =
reader(key(), time).map(value -> Optional.ofNullable(value)
.map(v -> Collections.singletonList(new KV<>(key(), v)))
.orElse(Collections.emptyList()));
return new LocalStoreQueryExecutor<>(accessor).execute(reader, queried);
}
private Reader<ReadOnlyWindowStore<K, V>, V> reader(final K key, final long time) {
return Reader.of(store -> store.fetch(key, time));
}
}
|
[
"florian.hussonnois@gmail.com"
] |
florian.hussonnois@gmail.com
|
59b6cb1790936472354d835760ef32ca3fe78e16
|
24a32bc2aafcca19cf5e5a72ee13781387be7f0b
|
/src/framework/tags/gwt-test-utils-parent-0.25.8/gwt-test-utils/src/main/java/com/googlecode/gwt/test/uibinder/widget/UiCellPanelTagFactory.java
|
b05d94a9ae51461ddd168db83f9074174a3a2182
|
[] |
no_license
|
google-code-export/gwt-test-utils
|
27d6ee080f039a8b4111e04f32ba03e5396dced5
|
0391347ea51b3db30c4433566a8985c4e3be240e
|
refs/heads/master
| 2016-09-09T17:24:59.969944
| 2012-11-20T07:13:03
| 2012-11-20T07:13:03
| 32,134,062
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,232
|
java
|
package com.googlecode.gwt.test.uibinder.widget;
import java.util.List;
import java.util.Map;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.CellPanel;
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant;
import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
import com.google.gwt.user.client.ui.IsWidget;
import com.googlecode.gwt.test.uibinder.UiBinderXmlUtils;
import com.googlecode.gwt.test.uibinder.UiObjectTag;
import com.googlecode.gwt.test.uibinder.UiObjectTagFactory;
/**
* Handles subclasses of CellPanel (which declare <g:cell> tags).
*
* @author Gael Lazzari
*
*/
public class UiCellPanelTagFactory implements UiObjectTagFactory<CellPanel> {
private static class UiCellPanelTag extends UiObjectTag<CellPanel> {
private static final String CELL_TAG = "cell";
@Override
protected void appendElement(CellPanel wrapped, Element element,
String namespaceURI, List<IsWidget> childWidgets) {
if (!CELL_TAG.equals(element.getTagName())
|| !UiBinderXmlUtils.CLIENTUI_NSURI.equals(namespaceURI)) {
super.appendElement(wrapped, element, namespaceURI, childWidgets);
} else {
// hanle cell's attributes
String width = element.getAttribute("width");
if (width == null || width.trim().length() == 0) {
width = null;
}
String horizontalAlignment = element.getAttribute("horizontalAlignment");
HorizontalAlignmentConstant hConstant = null;
if (horizontalAlignment != null
&& horizontalAlignment.trim().length() > 0) {
hConstant = UiBinderXmlUtils.parseHorizontalAlignment(horizontalAlignment.trim());
}
String verticalAlignment = element.getAttribute("verticalAlignment");
VerticalAlignmentConstant vConstant = null;
if (verticalAlignment != null && verticalAlignment.trim().length() > 0) {
vConstant = UiBinderXmlUtils.parseVerticalAlignment(verticalAlignment.trim());
}
// handle cell's child widget and set cell's attributes
for (IsWidget widget : childWidgets) {
wrapped.add(widget);
if (width != null) {
wrapped.setCellWidth(widget.asWidget(), width);
}
if (hConstant != null) {
wrapped.setCellHorizontalAlignment(widget.asWidget(), hConstant);
}
if (vConstant != null) {
wrapped.setCellVerticalAlignment(widget.asWidget(), vConstant);
}
}
}
}
@Override
protected void finalizeObject(CellPanel widget) {
// nothing to do
}
@Override
protected void initializeObject(CellPanel wrapped,
Map<String, Object> attributes, Object owner) {
// nothing to do
}
}
/*
* (non-Javadoc)
*
* @see com.googlecode.gwt.test.uibinder.UiObjectTagFactory#createUiObjectTag
* (java.lang.Class, java.util.Map)
*/
public UiObjectTag<CellPanel> createUiObjectTag(Class<?> clazz,
Map<String, Object> attributes) {
if (!CellPanel.class.isAssignableFrom(clazz)) {
return null;
}
return new UiCellPanelTag();
}
}
|
[
"gael.lazzari@d9eb14d4-a931-11de-b950-3d5b5f4ea0aa"
] |
gael.lazzari@d9eb14d4-a931-11de-b950-3d5b5f4ea0aa
|
c370be4f151c1bc09a39a1b25737f956e5f5a6c6
|
de01945b0eb01cfcb73ba85883452ab2d309ea88
|
/centerCore/src/main/java/com/bithealth/centCore/sms/enmu/SmsTypeEnmu.java
|
599dd7acf87778375db527250eaf959adc48533d
|
[] |
no_license
|
liustefan/secondProject
|
27df367b28205056fa7add2b63eeb7ceafc70fde
|
fa083e854737eb50315ad2097a61136fd0d4d458
|
refs/heads/master
| 2021-01-23T05:14:19.161634
| 2017-03-27T03:20:55
| 2017-03-27T03:20:55
| 86,282,804
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 879
|
java
|
package com.bithealth.centCore.sms.enmu;
/**
* 类名称: CareAuthorityEnmu
* 功能描述: 关注权限枚举类型
* 日期: 2016年8月27日 下午4:38:25
*
* @author 谢美团
* @version
*/
public enum SmsTypeEnmu {
CONTENT_TYPE_TEXT("1", "优先级-文本"),
CONTENT_TYPE_VOICE("2", "优先级-语音");
private String value;
private String desc;
private SmsTypeEnmu(String value, String desc) {
this.value = value;
this.desc = desc;
}
public SmsTypeEnmu getEnmuByVal(int value) {
for(SmsTypeEnmu enmu : SmsTypeEnmu.values()) {
if(enmu.getValue().equals(value)) {
return enmu;
}
}
return null;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
|
[
"liustefan@163.com"
] |
liustefan@163.com
|
572d3566bb2daabdfab210ee7c6ac8c8b7ff6a1e
|
0735d7bb62b6cfb538985a278b77917685de3526
|
/kotlin/reflect/jvm/internal/impl/storage/NullableLazyValue.java
|
d37a3551595e89b4a5db4680c6a6be40d7d5ce69
|
[] |
no_license
|
Denoah/personaltrackerround
|
e18ceaad910f1393f2dd9f21e9055148cda57837
|
b38493ccc7efff32c3de8fe61704e767e5ac62b7
|
refs/heads/master
| 2021-05-20T03:34:17.333532
| 2020-04-02T14:47:31
| 2020-04-02T14:51:01
| 252,166,069
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 164
|
java
|
package kotlin.reflect.jvm.internal.impl.storage;
import kotlin.jvm.functions.Function0;
public abstract interface NullableLazyValue<T>
extends Function0<T>
{}
|
[
"ivanov.a@i-teco.ru"
] |
ivanov.a@i-teco.ru
|
8d293d258759e8e6f1f7ddabfc796087454cabce
|
e5eb9b46162725d6152c3a80fbd25a3aa8935477
|
/lesson_3/homework/src/test/java/TestCalc.java
|
bd5492be5213bbccb17d7fbcb3c47cc950e86968
|
[] |
no_license
|
Lomovskoy/java_course
|
2cb3bb381bb4f58bec1a921b1ab6c6e7de6eb0eb
|
9b82a4bdc967e101d62035583a4e5eb731df2bf4
|
refs/heads/master
| 2021-04-06T00:19:26.937471
| 2018-08-12T13:32:21
| 2018-08-12T13:32:21
| 125,352,177
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,665
|
java
|
import implement.Calculate;
import org.junit.Test;
import static org.junit.Assert.*;
public class TestCalc {
/**
* Тест сложения
*/
@Test
public void testSumm(){
Calculate calc = new Calculate();
Integer summ = calc.summ(2, 2);
Integer res = 4;
assertEquals(summ, res);
//fail("Тест сложения не пройден.");
}
/**
* Темст вычитания
*/
@Test
public void testSubtract(){
Calculate calc = new Calculate();
Integer summ = calc.subtract(2, 2);
Integer res = 0;
assertEquals(summ, res);
//fail("Тест сложения не пройден.");
}
/**
* Тест умножения
*/
@Test
public void testMultiply(){
Calculate calc = new Calculate();
Integer summ = calc.multiply(2, 3);
Integer res = 6;
assertEquals(summ, res);
//fail("Тест сложения не пройден.");
}
/**
* Тест деления
*/
@Test
public void testShare(){
Calculate calc = new Calculate();
Double summ = calc.share(6, 3);
Double res = 2.0;
assertEquals(summ, res);
//fail("Тест сложения не пройден.");
}
/**
* Тест возведения в степень
*/
@Test
public void testDegreeOf(){
Calculate calc = new Calculate();
Double summ = calc.degreeOf(6, 2);
Double res = 36.0;
assertEquals(summ, res);
//fail("Тест сложения не пройден.");
}
}
|
[
"lomovskoy.kirill@yandex.ru"
] |
lomovskoy.kirill@yandex.ru
|
bc829b95a83779689e299cc087e1742d07e20243
|
e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f
|
/DungeonDiver4/src/com/puttysoftware/dungeondiver4/items/combat/predefined/Rope.java
|
fbfc9d9efcf6a0d2dd68955603522d97198070c9
|
[
"Unlicense"
] |
permissive
|
retropipes/older-java-games
|
777574e222f30a1dffe7936ed08c8bfeb23a21ba
|
786b0c165d800c49ab9977a34ec17286797c4589
|
refs/heads/master
| 2023-04-12T14:28:25.525259
| 2021-05-15T13:03:54
| 2021-05-15T13:03:54
| 235,693,016
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,245
|
java
|
/* DungeonDiver4: An RPG
Copyright (C) 2011-2012 Eric Ahnell
Any questions should be directed to the author via email at: products@puttysoftware.com
*/
package com.puttysoftware.dungeondiver4.items.combat.predefined;
import com.puttysoftware.dungeondiver4.battle.BattleTarget;
import com.puttysoftware.dungeondiver4.creatures.StatConstants;
import com.puttysoftware.dungeondiver4.effects.Effect;
import com.puttysoftware.dungeondiver4.items.combat.CombatItem;
import com.puttysoftware.dungeondiver4.resourcemanagers.SoundConstants;
public class Rope extends CombatItem {
public Rope() {
super("Rope", 50, BattleTarget.ONE_ENEMY);
}
@Override
protected void defineFields() {
this.sound = SoundConstants.SOUND_BIND;
this.e = new Effect("Roped", 2);
this.e.setEffect(Effect.EFFECT_MULTIPLY, StatConstants.STAT_AGILITY, 0,
Effect.DEFAULT_SCALE_FACTOR, StatConstants.STAT_NONE);
this.e.setMessage(Effect.MESSAGE_INITIAL,
"You wind a rope around the enemy!");
this.e.setMessage(Effect.MESSAGE_SUBSEQUENT,
"The enemy is tied up, and unable to act!");
this.e.setMessage(Effect.MESSAGE_WEAR_OFF, "The rope falls off!");
}
}
|
[
"eric.ahnell@puttysoftware.com"
] |
eric.ahnell@puttysoftware.com
|
8b02c3039acca78ee9247319042b9c00f6e85aa6
|
bc67bd70aaa83b0c8c902defbb928838f5e9b668
|
/java/1.x/nanocontainer-remoting/trunk/remoting/src/test/org/nanocontainer/remoting/jmx/TypedObjectNameFactoryTest.java
|
58196fa54ed2664b8f57f8a332929e24c6a6cd32
|
[
"BSD-3-Clause"
] |
permissive
|
codehaus/picocontainer
|
b07475fe034384926579e2b4f6f25e68f057cae2
|
7be6b8b0eb33421dc7a755817628e06b79bd879d
|
refs/heads/master
| 2023-07-20T01:30:02.348980
| 2014-10-08T04:44:44
| 2014-10-08T04:44:44
| 36,501,409
| 2
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,810
|
java
|
/*****************************************************************************
* Copyright (C) NanoContainer Organization. All rights reserved. *
* ------------------------------------------------------------------------- *
* The software in this package is published under the terms of the BSD *
* style license a copy of which has been included with this distribution in *
* the LICENSE.txt file. *
* *
* Original code by Joerg Schaible *
*****************************************************************************/
package org.nanocontainer.remoting.jmx;
import javax.management.MalformedObjectNameException;
import javax.management.NotCompliantMBeanException;
import javax.management.ObjectName;
import org.nanocontainer.remoting.jmx.testmodel.DynamicMBeanPerson;
import junit.framework.TestCase;
/**
* @author Jörg Schaible
*/
public class TypedObjectNameFactoryTest extends TestCase {
public void testSpecifiedDomain() throws MalformedObjectNameException, NotCompliantMBeanException {
final ObjectNameFactory factory = new TypedObjectNameFactory("JUnit");
final ObjectName objectName = factory.create(null, new DynamicMBeanPerson());
assertEquals("JUnit:type=DynamicMBeanPerson", objectName.getCanonicalName());
}
public void testDefaultDomain() throws MalformedObjectNameException, NotCompliantMBeanException {
final ObjectNameFactory factory = new TypedObjectNameFactory();
final ObjectName objectName = factory.create(null, new DynamicMBeanPerson());
assertEquals(":type=DynamicMBeanPerson", objectName.getCanonicalName());
}
}
|
[
"mauro@ac66bb80-72f5-0310-8d68-9f556cfffb23"
] |
mauro@ac66bb80-72f5-0310-8d68-9f556cfffb23
|
5ccc71f2247bafc541fba549b82ca78f96b5cb1a
|
d36d5ba4d8d1df1ad4494c94bd39252e128c5b5b
|
/com.jaspersoft.studio/src/com/jaspersoft/studio/editor/style/command/CreateStyleCommand.java
|
5e8c67338633a11825b208f4db0507aa6b2a6088
|
[] |
no_license
|
xviakoh/jaspersoft-xvia-plugin
|
6dfca36eb27612f136edc4c206e631d8dd8470f0
|
c037a0568a518e858a201fda257a8fa416af3908
|
refs/heads/master
| 2021-01-01T19:35:32.905460
| 2015-06-18T15:21:11
| 2015-06-18T15:21:11
| 37,666,261
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,254
|
java
|
/*******************************************************************************
* Copyright (C) 2005 - 2014 TIBCO Software Inc. All rights reserved.
* http://www.jaspersoft.com.
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
package com.jaspersoft.studio.editor.style.command;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRSimpleTemplate;
import net.sf.jasperreports.engine.JRStyle;
import net.sf.jasperreports.engine.design.JRDesignStyle;
import org.eclipse.gef.commands.Command;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.swt.widgets.Display;
import com.jaspersoft.studio.messages.Messages;
import com.jaspersoft.studio.model.style.MStyle;
import com.jaspersoft.studio.model.style.MStylesTemplate;
/*
* link nodes & together.
*
* @author Chicu Veaceslav
*/
public class CreateStyleCommand extends Command {
private JRDesignStyle jrStyle;
private JRSimpleTemplate jrDesign;
/** The index. */
private int index;
/**
* Instantiates a new creates the style command.
*
* @param destNode
* the dest node
* @param srcNode
* the src node
* @param index
* the index
*/
public CreateStyleCommand(MStylesTemplate destNode, MStyle srcNode, int index) {
super();
this.jrDesign = (JRSimpleTemplate) destNode.getValue();
this.index = index;
if (srcNode != null && srcNode.getValue() != null)
this.jrStyle = (JRDesignStyle) srcNode.getValue();
}
private final static String DEFAULTNAME = "Style";
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.commands.Command#execute()
*/
@Override
public void execute() {
if (jrStyle == null) {
this.jrStyle = new JRDesignStyle();
jrStyle.setName(DEFAULTNAME);
}
if (jrStyle != null) {
try {
if (index < 0 || index > jrDesign.getStylesList().size())
jrDesign.addStyle(jrStyle);
else
jrDesign.addStyle(index, jrStyle);
} catch (JRException e) {
e.printStackTrace();
if (e.getMessage().startsWith("Duplicate declaration")) { //$NON-NLS-1$
String name = null;
for (int i = 1; i < 1000; i++) {
JRStyle style = jrDesign.getStyle(DEFAULTNAME + i);
if (style == null) {
name = DEFAULTNAME + i;
break;
}
}
InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(),
Messages.CreateStyleCommand_style_name, Messages.CreateStyleCommand_style_name_dialog_text, name, null);
if (dlg.open() == InputDialog.OK) {
jrStyle.setName(dlg.getValue());
execute();
}
}
}
}
}
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.commands.Command#canUndo()
*/
@Override
public boolean canUndo() {
return true;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.commands.Command#undo()
*/
@Override
public void undo() {
jrDesign.removeStyle(jrStyle);
}
}
|
[
"kyungseog.oh@trackvia.com"
] |
kyungseog.oh@trackvia.com
|
7301e6fe889220e4d9e3999a5062a05753b2c392
|
0bd701dc8aefab3484fafb469a7c11ba5cc956e0
|
/app/src/main/java/com/dagger/todo/adapters/TodoAdapter.java
|
557ac0e8b2728d8ae2ad57e6dc056dd885af436c
|
[
"Apache-2.0"
] |
permissive
|
suigumu/ToDue
|
9a58275e3eec1c5701ec1eab6b936dbf9f97a1a9
|
14efbf4f9bf08c24cd822be9697d652580d3c626
|
refs/heads/master
| 2021-05-03T10:58:32.278957
| 2017-02-13T06:45:18
| 2017-02-13T06:45:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,563
|
java
|
package com.dagger.todo.adapters;
import android.content.Context;
import android.support.design.widget.Snackbar;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.dagger.todo.R;
import com.dagger.todo.data.ToDo;
import com.dagger.todo.data.ToDoItemDatabase;
import com.dagger.todo.helper.ItemTouchHelperAdapter;
import com.dagger.todo.helper.UpdateItem;
import java.util.ArrayList;
/**
* Created by Harshit on 05/12/16
*/
public class TodoAdapter extends RecyclerView.Adapter<TodoAdapter.ViewHolder> implements ItemTouchHelperAdapter {
private ArrayList<ToDo> arrayList = new ArrayList<>();
private UpdateItem updateItem;
private Context context;
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.single_todo, parent, false);
return new ViewHolder(view);
}
public TodoAdapter(ArrayList<ToDo> arrayList, Context context) {
this.arrayList = arrayList;
this.context = context;
updateItem = (UpdateItem) context;
}
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
holder.todoTitle.setText(arrayList.get(position).getTitle());
holder.todoContent.setText(arrayList.get(position).getContent());
holder.dueDate.setText(arrayList.get(position).getDueDate());
holder.dueDate.setText(arrayList.get(position).getDueDate());
switch (arrayList.get(position).getPriority()) {
case 0:
holder.cardView.setBackgroundColor(ContextCompat.getColor(context, R.color.priorityLow));
break;
case 1:
holder.cardView.setBackgroundColor(ContextCompat.getColor(context, R.color.priorityMedium));
break;
case 2:
holder.cardView.setBackgroundColor(ContextCompat.getColor(context, R.color.priorityHigh));
break;
}
holder.cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
updateItem.displayItem(arrayList.get(holder.getAdapterPosition()), holder.getAdapterPosition());
}
});
}
@Override
public int getItemCount() {
return arrayList.size();
}
@Override
public void onDismiss(final int position) {
ToDoItemDatabase.getToDoItemDatabase(context).deleteToDoFromDatabase(arrayList.get(position));
ToDo removed = arrayList.get(position);
updateItem.displayUndoSnackbar(position, removed);
arrayList.remove(position);
notifyItemRemoved(position);
updateItem.itemDeleted(arrayList);
}
class ViewHolder extends RecyclerView.ViewHolder {
CardView cardView;
TextView dueDate;
TextView todoTitle;
TextView todoContent;
ViewHolder(View itemView) {
super(itemView);
cardView = (CardView) itemView.findViewById(R.id.single_item_card);
todoContent = (TextView) itemView.findViewById(R.id.todo_content);
todoTitle = (TextView) itemView.findViewById(R.id.todo_title);
dueDate = (TextView) itemView.findViewById(R.id.due_date);
cardView.setRadius(4);
}
}
}
|
[
"harshithdwivedi@gmail.com"
] |
harshithdwivedi@gmail.com
|
270fc3cd42ce4e9a80e6a57b1018ebd08273de62
|
3c0844c81057d2ea743d7d42d22923e54b0f1619
|
/src/leetCode/LinkedList/addTwoNumbersII445/Solution.java
|
d3dedcc161c788dd5c2b5f2ba37008ef64d25227
|
[] |
no_license
|
gcczuis/DataStructureAndAlgorithm
|
75ce455479e3cfc764f8dbe2ccbe2edbc83d3dbb
|
37270dc236f904228f74072ec947270e0bac292f
|
refs/heads/master
| 2020-03-28T15:28:57.747085
| 2019-07-12T12:49:47
| 2019-07-12T12:49:47
| 148,598,337
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,410
|
java
|
package leetCode.LinkedList.addTwoNumbersII445;
import java.util.Stack;
/**
* @author: gcc
* @Date: 2018/9/11 18:39
* @Description: 给定两个非空链表来代表两个非负整数。数字最高位位于链表开始位置。它们的每个节点只存储单个数字。将这两数相加会返回一个新的链表。
*
*
*
* 你可以假设除了数字 0 之外,这两个数字都不会以零开头。
*
* 进阶:
*
* 如果输入链表不能修改该如何处理?换句话说,你不能对列表中的节点进行翻转。
*
* 示例:
*
* 输入: (7 -> 2 -> 4 -> 3) + (5 -> 6 -> 4)
* 输出: 7 -> 8 -> 0 -> 7
*/
public class Solution {
public static class ListNode {
int val;
ListNode next;
ListNode(int x) {
val = x;
}
}
public static ListNode addTwoNumbers(ListNode l1, ListNode l2) {
if(l1 == null && l2 == null){
return null;
}
Stack<Integer> stack1 = new Stack<>();
Stack<Integer> stack2 = new Stack<>();
ListNode dummyHead = new ListNode(0);
ListNode cur = dummyHead;
boolean flag = false;
while(l1 != null){
stack1.push(l1.val);
l1 = l1.next;
}
while(l2 != null){
stack2.push(l2.val);
l2 = l2.next;
}
while(!stack1.isEmpty() || !stack2.isEmpty()){
int sum = 0;
if(!stack1.isEmpty()){
sum += stack1.pop();
}
if(!stack2.isEmpty()){
sum += stack2.pop();
}
if(flag){
sum += 1;
flag = false;
}
if(sum >= 10){
sum -= 10;
flag = true;
}
cur.next = new ListNode(sum);
cur = cur.next;
}
if(flag){
cur.next = new ListNode(1);
}
return reverseList(dummyHead.next);
}
public static ListNode reverseList(ListNode head) {
if(head == null) {
return null;
}
ListNode pre = null;
ListNode cur = head;
ListNode nextNode = cur.next;
while(cur != null){
nextNode = cur.next;
cur.next = pre;
pre = cur;
cur = nextNode;
}
return pre;
}
public static ListNode createLinkedList(int[] arr, int n) {
if (arr.length < n && n == 0) {
return null;
}
ListNode dummyhead = new ListNode(Integer.MAX_VALUE);
ListNode cur = dummyhead;
for (int i = 0; i < n; i++) {
cur.next = new ListNode(arr[i]);
cur = cur.next;
}
return dummyhead.next;
}
public static String linkedListToString(ListNode head) {
ListNode cur = head;
StringBuilder sb = new StringBuilder();
while (cur != null) {
sb.append(cur.val + " -> ");
cur = cur.next;
}
sb.append("NULL");
return sb.toString();
}
public static void main(String[] args){
int[] arr = {7,2,4,3};
int[] arr2 = {5,6,4};
ListNode head = createLinkedList(arr,arr.length);
ListNode head2 = createLinkedList(arr2,arr2.length);
head = addTwoNumbers(head,head2);
System.out.println(linkedListToString(head));
}
}
|
[
"gcc950226@outlook.com"
] |
gcc950226@outlook.com
|
45449fdf0a65915f8e0df2c71139a75d29069c6f
|
30ed65975c43057c4e5929819620265bef1a1927
|
/src/main/java/com/jinyu/fdxc/model/service/XzzqService.java
|
e5ef4475b591c169d6f71884ca80d90ef2b2c2a4
|
[] |
no_license
|
JuJieCo/fdxc_website
|
0bc813ddd0ecb01a317ed0e4d72bf97bc5351801
|
ce4cb3cb3ffab9456bd3362c3b7f639f75cf45fc
|
refs/heads/master
| 2021-06-21T16:49:48.527845
| 2017-04-20T16:38:09
| 2017-04-20T16:38:09
| 88,876,679
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,215
|
java
|
package com.jinyu.fdxc.model.service;
import java.util.List;
import com.jinyu.fdxc.model.dao.XzzqDAO;
import com.jinyu.fdxc.model.utils.Page;
import com.jinyu.fdxc.struts.bean.SysUser;
import com.jinyu.fdxc.struts.bean.Xzzq;
public class XzzqService {
private XzzqDAO xzzqDAO;
public void setXzzqDAO(XzzqDAO xzzqDAO) {
this.xzzqDAO = xzzqDAO;
}
/**
*默认列表查询
*/
public List<Xzzq> queryDefaultXzzqList(Xzzq xzzq , Page page ) throws Exception {
Object[] objs = new Object[2];
if (null != xzzq && !"".equals(xzzq)) {
objs[0] = xzzq.getXzzqID();
}
return xzzqDAO.queryXzzqList(objs,page);
}
/**
*列表查询
*/
public List<Xzzq> queryXzzqList(Xzzq xzzq , Page page ) throws Exception {
Object[] objs = new Object[2];
if (null != xzzq && !"".equals(xzzq)) {
objs[1] = xzzq.getXzzqTitle();
}
return xzzqDAO.queryXzzqList(objs,page);
}
/**
*查一条
*/
public Xzzq findXzzqByID(String xzzqID) throws Exception {
int id = 0;
if(null!=xzzqID&&!"".equals(xzzqID)){
id = Integer.valueOf(xzzqID);
}
SysUser user = xzzqDAO.findUserByID(id);
Xzzq xzzq = xzzqDAO.findXzzqByID(id);
xzzq.getSysUser().setLoginName(user.getLoginName());
return xzzq;
}
/**
*修改 新增
*/
public void modifyXzzq(Xzzq xzzq, Integer xzzqID) throws Exception {
if (null != xzzq.getXzzqID() && !"".equals(xzzq.getXzzqID())) {
xzzqDAO.editXzzq(xzzq);
} else {
if(null!=xzzqID&&!"".equals(xzzqID)){//说明已经有附件了
int id = Integer.valueOf(xzzqID); //获得已经保存的附件的ID
xzzq.setXzzqID(id);
xzzqDAO.editAsFJ(xzzq); //保存 = 修改已经上传附件件的记录
}else{//如果没有附件 直接保存了
xzzqDAO.saveXzzq(xzzq);
}
}
}
/**
*删除
*/
public void deleteXzzqByID(String xzzqID) throws Exception {
int id = 0;
if(null!=xzzqID&&!"".equals(xzzqID)){
id = Integer.valueOf(xzzqID);
xzzqDAO.deleteXzzqByID(id);
}
}
/**
*保存附件
*/
public int saveFJ(Xzzq xzzq) throws Exception {
return xzzqDAO.saveFJ(xzzq);
}
}
|
[
"whm029@126.com"
] |
whm029@126.com
|
06853dfac3036e84a55808c0e7e29b4e77b18647
|
9483067d771c8f8b148cfadb5b2247069ee03698
|
/src/probs2017/prob22b.java
|
251a56f76c9334a5011c465dd97c0553efc3afc9
|
[
"MIT"
] |
permissive
|
hidny/adventofcode
|
96a241bbb6c41f9613af0867f079d5e5fdd44754
|
16aa54cebb16a9d6e684d797035ecd70f013f5bd
|
refs/heads/master
| 2023-01-04T07:13:39.857451
| 2022-12-25T19:31:17
| 2022-12-25T19:31:17
| 75,837,443
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,246
|
java
|
package probs2017;
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;
import utils.Mapping;
public class prob22b {
public static void main(String[] args) {
Scanner in;
try {
in = new Scanner(new File("in2017/prob2017in22.txt"));
int count = 0;
String line = "";
ArrayList <String>lines = new ArrayList<String>();
int LIMIT = 40000;
byte table[][] = new byte[LIMIT][LIMIT];
byte CLEAN = 0;
byte WEAK = 1;
byte INF = 2;
byte FLAG = 3;
//dir: 0 up
//1 right
//2 down
//3 left
while(in.hasNextLine()) {
line = in.nextLine();
lines.add(line);
}
for(int i=0; i<lines.size(); i++) {
for(int j=0; j<lines.get(i).length(); j++) {
if(lines.get(i).charAt(j) == '#') {
table[i][j] = INF;
} else {
table[i][j] = CLEAN;
}
}
}
int posX = (lines.size()/2);
int posY = (lines.size()/2);
int dir =0;
for(int burst=0; burst<10000000; burst++) {
if(table[posY][posX] == CLEAN) {
dir = (4 + dir - 1) % 4;
} else if(table[posY][posX] == WEAK) {
} else if(table[posY][posX] == INF) {
dir = (4 + dir + 1) % 4;
} else if(table[posY][posX] == FLAG) {
dir = (4 + dir + 2) % 4;
} else {
System.out.println("AAHH!");
System.exit(1);
}
if(table[posY][posX] == WEAK) {
count++;
}
table[posY][posX] =(byte) (( table[posY][posX]+1) %4);
if(dir == 0) {
posY--;
if(posY < 0) {
posY += LIMIT;
}
} else if(dir == 1) {
posX++;
if(posX >= LIMIT) {
posX -= LIMIT;
}
} else if(dir == 2) {
posY++;
if(posY >= LIMIT) {
posY -= LIMIT;
}
} else if(dir == 3) {
posX--;
if(posX < 0) {
posX += LIMIT;
}
} else {
System.out.println("AAAH!!");
System.exit(1);
}
}
sop("ehllo");
System.out.println("Answer: " + count);
in.close();
} catch(Exception e) {
e.printStackTrace();
} finally {
}
}
public static void sop(String output) {
System.out.println(output);
}
}
|
[
"mtardibuono@gmail.com"
] |
mtardibuono@gmail.com
|
5643de6cc85277beb7f8b90fe2768ee90c54f994
|
7585bbcfad09b1236d00f0d62cd0109b9b27e706
|
/lishiMobile/src/main/java/com/lis99/mobile/entry/LsShaiCommentActivity.java
|
03edfaddec4386c5f1dab7379214cf8e127e1743
|
[] |
no_license
|
xiaxiao1/Lis99Test
|
d7c943e25456bf341b43cd9da1a67bfe29fc55b2
|
43c3b2bb0b53dcee80d990a7ef8b5de44b5e9144
|
refs/heads/master
| 2020-06-30T23:44:50.990863
| 2016-11-21T09:41:37
| 2016-11-21T09:41:37
| 74,347,642
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,673
|
java
|
package com.lis99.mobile.entry;
import android.os.Bundle;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.lis99.mobile.R;
import com.lis99.mobile.application.data.CommentBean;
import com.lis99.mobile.application.data.DataManager;
import com.lis99.mobile.engine.base.IEvent;
import com.lis99.mobile.engine.base.Task;
import com.lis99.mobile.entry.view.AsyncLoadImageView;
import com.lis99.mobile.util.C;
import com.lis99.mobile.util.RequestParamUtil;
import com.lis99.mobile.util.StatusUtil;
import java.util.HashMap;
import java.util.List;
public class LsShaiCommentActivity extends ActivityPattern {
ImageView iv_back;
ListView lv_comment_list;
EditText et_comment;
Button bt_comment;
String id,comment,type;
private static final int SHOW_COMMENTLIST = 203;
private static final int REFRESH_COMMENT = 204;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ls_shai_comment);
StatusUtil.setStatusBar(this);
id = getIntent().getStringExtra("id");
type = getIntent().getStringExtra("type");
setView();
setListener();
postMessage(POPUP_PROGRESS,getString(R.string.sending));
getCommentList(id);
}
private void getCommentList(String id) {
String url = C.MAIN_COMMENTLIST_URL + type + "/" +id+ "/" +"0" +"/"+10+"/" + "desc";
Task task = new Task(null, url, null, "MAIN_COMMENTLIST_URL", this);
publishTask(task, IEvent.IO);
}
@Override
public void handleTask(int initiator, Task task, int operation) {
super.handleTask(initiator, task, operation);
String result;
switch (initiator) {
case IEvent.IO:
if (task.getData() instanceof byte[]) {
result = new String((byte[]) task.getData());
if(((String) task.getParameter()).equals("MAIN_COMMENTLIST_URL")){
parserCommentList(result);
}else if(((String) task.getParameter()).equals("MAIN_COMMENT_URL")){
parserComment(result);
}
}
break;
default:
break;
}
}
private void parserComment(String params) {
String result = DataManager.getInstance().validateResult(params);
if (result != null) {
if("OK".equals(result)){
DataManager.getInstance().jsonParse(params, DataManager.TYPE_MAIN_COMMENT);
postMessage(REFRESH_COMMENT);
}else{
postMessage(POPUP_TOAST, result);
postMessage(DISMISS_PROGRESS);
}
}else{
postMessage(DISMISS_PROGRESS);
}
}
List<CommentBean> list_cb;
private void parserCommentList(String params) {
String result = DataManager.getInstance().validateResult(params);
if (result != null) {
if("OK".equals(result)){
list_cb = (List<CommentBean>) DataManager.getInstance().jsonParse(params, DataManager.TYPE_MAIN_COMMENTLIST);
postMessage(SHOW_COMMENTLIST);
}else{
postMessage(DISMISS_PROGRESS);
}
}else{
postMessage(DISMISS_PROGRESS);
}
}
CommentListAdapter adapter;
@Override
public boolean handleMessage(Message msg) {
if (super.handleMessage(msg))
return true;
switch (msg.what) {
case SHOW_COMMENTLIST:
if(list_cb !=null && list_cb.size()>0){
adapter = new CommentListAdapter();
lv_comment_list.setAdapter(adapter);
}else{
}
postMessage(DISMISS_PROGRESS);
break;
case REFRESH_COMMENT:
postMessage(POPUP_TOAST, "评论成功");
getCommentList(id);
break;
}
return true;
}
private void setView() {
iv_back = (ImageView) findViewById(R.id.iv_back);
lv_comment_list = (ListView) findViewById(R.id.lv_comment_list);
et_comment = (EditText) findViewById(R.id.et_comment);
bt_comment = (Button) findViewById(R.id.bt_comment);
}
private void setListener() {
iv_back.setOnClickListener(this);
bt_comment.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(v.getId() == iv_back.getId()){
finish();
}else if(v.getId() == bt_comment.getId()){
comment = et_comment.getText().toString();
if(comment==null || "".equals(comment)){
Toast.makeText(this, "评论内容不能为空", 0).show();
}else{
postMessage(POPUP_PROGRESS,getString(R.string.sending));
sendCommentTask();
}
}
}
private void sendCommentTask() {
String url = C.MAIN_COMMENT_URL;
Task task = new Task(null, url, null, "MAIN_COMMENT_URL", this);
task.setPostData(getLoginParams().getBytes());
publishTask(task, IEvent.IO);
}
private String getLoginParams() {
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("pid", "0");
params.put("rid", "0");
params.put("type", type);
params.put("comment", comment);
params.put("id", id);
params.put("touser", "0");
params.put("user_id", DataManager.getInstance().getUser().getUser_id());
return RequestParamUtil.getInstance(this).getRequestParams(params);
}
private static class ViewHolder{
AsyncLoadImageView item_comment_head;
TextView item_comment_nickname,item_comment_date,item_comment;
}
private class CommentListAdapter extends BaseAdapter {
LayoutInflater inflater;
public CommentListAdapter() {
inflater = LayoutInflater.from(LsShaiCommentActivity.this);
}
@Override
public int getCount() {
return list_cb.size();
}
@Override
public Object getItem(int arg0) {
return list_cb.get(arg0);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
CommentBean cb = list_cb.get(position);
final int pos = position;
if(convertView==null){
convertView = inflater.inflate(R.layout.ls_zhuangbei_comment_item, null);
holder=new ViewHolder();
holder.item_comment_head = (AsyncLoadImageView) convertView.findViewById(R.id.item_comment_head);
holder.item_comment_nickname = (TextView) convertView.findViewById(R.id.item_comment_nickname);
holder.item_comment_date = (TextView) convertView.findViewById(R.id.item_comment_date);
holder.item_comment = (TextView) convertView.findViewById(R.id.item_comment);
convertView.setTag(holder);
}else{
holder=(ViewHolder) convertView.getTag();
}
holder.item_comment_head.setImage(cb.getHeadicon(), null, null,"zhuangbei_detail");
holder.item_comment_nickname.setText(cb.getNickname());
holder.item_comment_date.setText(cb.getCreatedate());
holder.item_comment.setText(cb.getComment());
return convertView;
}
}
}
|
[
"yangyang@lis99.com"
] |
yangyang@lis99.com
|
cb6cda2f64e6a3faa6b567a8f69fd9699ecbc405
|
e6b0b6351f984a863249e689d007096e0ad77562
|
/study-action-rabbitmq/src/main/java/com/study/rabbitmq/amqp/demo2/MQConsumer.java
|
5bb4c3de116e4da888d38595b715366ccd44c32a
|
[] |
no_license
|
valiantzh/study-javademo
|
c5f7e4bd6fe1c932474b6463dc426e9730b921d6
|
01b4f26beb900948e1203bca308e7a02205d2f9c
|
refs/heads/master
| 2022-11-26T21:51:04.667879
| 2020-01-17T02:40:28
| 2020-01-17T02:40:28
| 152,394,665
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,674
|
java
|
package com.study.rabbitmq.amqp.demo2;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.SerializationUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.rabbitmq.client.AMQP.BasicProperties;
import com.rabbitmq.client.Consumer;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.client.ShutdownSignalException;
public class MQConsumer extends EndPoint implements Runnable, Consumer{
private static Logger log = LoggerFactory.getLogger(MQConsumer.class);
private long cuntmerId = 0l;
/**
*
* @param endpointName
* @throws IOException
*/
public MQConsumer(String endpointName) throws IOException {
super(endpointName);
}
/* (non Javadoc)
* @Title: handleConsumeOk
* @Description: TODO
* @param consumerTag
* @see com.rabbitmq.client.Consumer#handleConsumeOk(java.lang.String)
*/
@Override
public void handleConsumeOk(String consumerTag) {
// TODO Auto-generated method stub
}
/* (non Javadoc)
* @Title: handleCancelOk
* @Description: TODO
* @param consumerTag
* @see com.rabbitmq.client.Consumer#handleCancelOk(java.lang.String)
*/
@Override
public void handleCancelOk(String consumerTag) {
log.info("[Customer"+cuntmerId+"] "+consumerTag +" registered");
}
/* (non Javadoc)
* @Title: handleCancel
* @Description: TODO
* @param consumerTag
* @throws IOException
* @see com.rabbitmq.client.Consumer#handleCancel(java.lang.String)
*/
@Override
public void handleCancel(String consumerTag) throws IOException {
log.info("[Customer"+cuntmerId+"] "+consumerTag +" Cancel");
}
/* (non Javadoc)
* @Title: handleDelivery
* @Description: TODO
* @param arg0
* @param arg1
* @param arg2
* @param arg3
* @throws IOException
* @see com.rabbitmq.client.Consumer#handleDelivery(java.lang.String, com.rabbitmq.client.Envelope, com.rabbitmq.client.AMQP.BasicProperties, byte[])
*/
@Override
public void handleDelivery(String arg0, Envelope arg1, BasicProperties arg2,
byte[] arg3) throws IOException {
Map map = (HashMap)SerializationUtils.deserialize(arg3);
log.info("[Customer"+cuntmerId+"] Message Received: "+ map.get("message"));
}
/* (non Javadoc)
* @Title: handleShutdownSignal
* @Description: TODO
* @param consumerTag
* @param sig
* @see com.rabbitmq.client.Consumer#handleShutdownSignal(java.lang.String, com.rabbitmq.client.ShutdownSignalException)
*/
@Override
public void handleShutdownSignal(String consumerTag,
ShutdownSignalException sig) {
log.info("[Customer"+cuntmerId+"] "+consumerTag +" ShutdownSignal "+sig.getMessage());
}
/* (non Javadoc)
* @Title: handleRecoverOk
* @Description: TODO
* @param consumerTag
* @see com.rabbitmq.client.Consumer#handleRecoverOk(java.lang.String)
*/
@Override
public void handleRecoverOk(String consumerTag) {
// TODO Auto-generated method stub
log.info("[Customer"+cuntmerId+"] "+consumerTag +" RecoverOk");
}
/* (non Javadoc)
* @Title: run
* @Description: TODO
* @see java.lang.Runnable#run()
*/
@Override
public void run() {
try {
cuntmerId = Thread.currentThread().getId();
log.debug("Customer-"+cuntmerId+" Waiting Received messages!");
//start consuming messages. Auto acknowledge messages.
channel.basicConsume(endPointName, true,this);
} catch (IOException e) {
e.printStackTrace();
log.error(e.getMessage());
}
}
}
|
[
"zhengxiaoyong@hzdongcheng.com"
] |
zhengxiaoyong@hzdongcheng.com
|
73bc3c1d880d87962663f54a8b2e3326617454f1
|
eb1343219a925101de1b4ca4aadae71b51dfffd2
|
/mnis/core/src/main/java/com/lachesis/mnis/core/util/BarcodeUtil.java
|
020ee2789ec4f889c2f03465e79d9c50f7b50e3e
|
[
"Apache-2.0"
] |
permissive
|
gavin2lee/incubator
|
b961c23c63fc88c059e74e427b665125115717db
|
c95623af811195c3e89513ec30e52862d6562add
|
refs/heads/master
| 2020-12-13T20:52:26.951484
| 2017-01-25T00:31:59
| 2017-01-25T00:31:59
| 58,938,038
| 4
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,902
|
java
|
package com.lachesis.mnis.core.util;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import com.lachesis.mnis.core.order.entity.BarCodeSet;
import com.lachesis.mnis.core.util.OrderUtil.OrderType;
public final class BarcodeUtil {
//条码设置参数
public static List<BarCodeSet> barParams;
private BarcodeUtil(){}
public enum BarcodeType {
DRUG_INFUSION,
DRUG_ORAL,
LAB_TEST,
PATIENT_ID,
PATIENT_BEDCODE,
}
static final String[] BARCODE_TYPE_PREFIXES = {
"I",
"O",
"L",
"P",
"B",
"C",
"N"
};
public static String[] barcodeTypes() {
return Arrays.copyOf( BARCODE_TYPE_PREFIXES, BARCODE_TYPE_PREFIXES.length);
}
public static String makePatientBarcodeFromPatId(String patientId) {
if(patientId == null) {
return null;
} else {
return "P"+patientId;
}
}
public static String makeOrderBarcodeFrom(String orderExecId, String usage, String classCode) {
if( orderExecId == null || (usage==null&&classCode==null) ) {
return null;
} else {
OrderType orderType = OrderUtil.parseOrderType(usage, classCode);
if(orderType == null) {
return null;
}
switch(orderType) {
case DRUG_INFUSION:
case CURE_BLOOD:
return "I"+orderExecId;
case DRUG_ORAL:
return "O"+orderExecId;
case LAB_TEST:
return "L"+orderExecId;
case CURE:
return "C" + orderExecId;
case INSPECTION:
return "N" + orderExecId;
default:
return null;
}
}
}
/**
* 获取条码配置
* @param barCode 数据配置
* @param resultType 1:返回条码截取后字段 2:返回条码类型
* @return
*/
public static BarCodeVo getBarCodeSet(String barCodeSets,String barCode){
if(!StringUtils.isEmpty(barCodeSets)
&& !StringUtils.isEmpty(barCode)){
String[] barCodes = barCodeSets.split(";");
initBarParams(barCodes);
int len= barCode.length();
String resultBarCode=null;
String barType = null;
BarCodeVo vo = null;
for (BarCodeSet bar : barParams) {
vo = new BarCodeVo();
if(bar.getIssub()==1
&& len>=bar.getBarlens()
&& len<=bar.getBarlene()){ //条码需截取
resultBarCode = barCode.substring(bar.getSubstart(), bar.getSubend());
barType = bar.getBarType();
}else if(bar.getIssub()==0
&& len>=bar.getBarlens()
&& len<=bar.getBarlene()){
resultBarCode = barCode;
barType = bar.getBarType();
}
vo.setBarCode(resultBarCode);
vo.setBarType(barType);
//先查找特殊字符
if(StringUtil.hasValue(bar.getIndex())){
int i = barCode.indexOf(bar.getIndex());
if(i>0){
barType =bar.getBarType();
vo.setBarCode(barCode);
vo.setBarType(barType);
break;
}
}
}
return vo;
/*if("1".equals(resultType)){
return resultBarCode; //返回截取后的条码
}else if("2".equals(resultType)){
return barType; //返回条码类型
}*/
}
return null;
}
private static void initBarParams(String[] barCodes) {
String[] vals = null;
String[] fields = null;
BarCodeSet barCodeSet = null;
if(barParams==null){ //判断静态缓存是否为空
barParams = new ArrayList<BarCodeSet>();
//根据
for (String bars : barCodes) {
barCodeSet = new BarCodeSet();
vals = bars.split(",");
for (String val : vals) {
fields = val.split("=");
try {
if(fields.length==2){
setFieldValue(fields[0],fields[1], barCodeSet);
}
} catch (Exception e) {
e.printStackTrace();
}
}
barParams.add(barCodeSet);
}
}
}
/**
* 设置bean 属性值
* @param map
* @param bean
* @throws Exception
*/
public static void setFieldValue(String name,Object objValue,Object bean) throws Exception{
Class<?> cls = bean.getClass();
Field field = cls.getDeclaredField(name);
String fldtype = field.getType().getSimpleName();
String setMethod = pareSetName(name);
Method method = cls.getMethod(setMethod, field.getType());
if(null != objValue){
if("String".equals(fldtype)){
method.invoke(bean, (String)objValue);
}else if("int".equals(fldtype)){
int val = Integer.valueOf((String)objValue);
method.invoke(bean, val);
}
}
/* Class<?> cls = bean.getClass();
Method methods[] = cls.getDeclaredMethods();
Field fields[] = cls.getDeclaredFields();
for(Field field:fields){
String fldtype = field.getType().getSimpleName();
String fldSetName = field.getName();
String setMethod = pareSetName(fldSetName);
if(!checkMethod(methods, setMethod)){
continue;
}
Method method = cls.getMethod(setMethod, field.getType());
System.out.println(method.getName());
if(null != objValue){
if("String".equals(fldtype)){
method.invoke(bean, (String)objValue);
}else if("int".equals(fldtype)){
int val = Integer.valueOf((String)objValue);
method.invoke(bean, val);
}
}
} */
}
/**
* 判断该方法是否存在
* @param methods
* @param met
* @return
*/
public static boolean checkMethod(Method methods[],String met){
if(null != methods ){
for(Method method:methods){
if(met.equals(method.getName())){
return true;
}
}
}
return false;
}
/**
* 拼接某属性set 方法
* @param fldname
* @return
*/
public static String pareSetName(String fldname){
if(null == fldname || "".equals(fldname)){
return null;
}
String pro = "set"+fldname.substring(0,1).toUpperCase()+fldname.substring(1);
return pro;
}
public static void main(String[] args) {
String barParams = "barType=INFUSION,issub=1,len=13,sublen=12,substart=0,subend=12,barlens=12,barlene=14,index=;barType=INFUSION,issub=0,len=0,sublen=0,substart=0,subend=0,barlens=8,barlene=9,index=;barType=LAB,issub=0,len=0,sublen=0,substart=0,subend=0,barlens=10,barlene=11,index=;barType=ORAL,issub=0,len=0,sublen=0,substart=0,subend=0,barlens=6,barlene=7,index=;";
String barCode ="2000004654371";
System.out.println(getBarCodeSet(barParams, barCode));
}
}
|
[
"gavin2lee@163.com"
] |
gavin2lee@163.com
|
7ce7e5ae1bb25cc22b4bdac52791458f118cf94e
|
7b3a2098402493db6dc01d3930399fa27dff4399
|
/src/test/java/com/eep/wo/config/WebConfigurerTestController.java
|
6cb622242cea16fb62d8ecba7e7c75d03aa721f5
|
[] |
no_license
|
domocles/WorksOrderBook
|
1f90902c2deec674ff6984d4cff56c1a38cda839
|
0132415de0ad30443fe5fa734ed1c3878663c7ed
|
refs/heads/master
| 2020-03-18T13:02:30.652125
| 2018-05-27T14:07:32
| 2018-05-27T14:07:32
| 134,757,586
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 373
|
java
|
package com.eep.wo.config;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class WebConfigurerTestController {
@GetMapping("/api/test-cors")
public void testCorsOnApiPath() {
}
@GetMapping("/test/test-cors")
public void testCorsOnOtherPath() {
}
}
|
[
"jhipster-bot@users.noreply.github.com"
] |
jhipster-bot@users.noreply.github.com
|
205ed8ba955837ce635f58e5b48aba96891eafd5
|
6790d5e2fd4b4d9fdecb3a2b033026a676f5d5f0
|
/BopZZ/src/com/bop/zz/widget/AndroidSpringLooperFactory.java
|
10cce4beafd6c1cceeccf7c5a8fc83e5d69cd7da
|
[
"Apache-2.0"
] |
permissive
|
xmutzlq/ZZ
|
bcfd28dcd83aed27773828e2c2d6d73eeac6d1ff
|
5ac74f815790884686cdc750748187a2288bd0eb
|
refs/heads/master
| 2021-09-10T05:51:53.621709
| 2018-03-21T09:18:28
| 2018-03-21T09:18:28
| 126,114,416
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,145
|
java
|
/*
* Copyright (c) 2013, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
package com.bop.zz.widget;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.Handler;
import android.os.SystemClock;
import android.view.Choreographer;
/**
* Android version of the spring looper that uses the most appropriate frame callback mechanism
* available. It uses Android's {@link Choreographer} when available, otherwise it uses a
* {@link Handler}.
*/
abstract class AndroidSpringLooperFactory {
/**
* Create an Android {@link com.facebook.rebound.SpringLooper} for the detected Android platform.
* @return a SpringLooper
*/
public static SpringLooper createSpringLooper() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
return ChoreographerAndroidSpringLooper.create();
} else {
return LegacyAndroidSpringLooper.create();
}
}
/**
* The base implementation of the Android spring looper, using a {@link Handler} for the
* frame callbacks.
*/
private static class LegacyAndroidSpringLooper extends SpringLooper {
private final Handler mHandler;
private final Runnable mLooperRunnable;
private boolean mStarted;
private long mLastTime;
/**
* @return an Android spring looper using a new {@link Handler} instance
*/
public static SpringLooper create() {
return new LegacyAndroidSpringLooper(new Handler());
}
public LegacyAndroidSpringLooper(Handler handler) {
mHandler = handler;
mLooperRunnable = new Runnable() {
@Override
public void run() {
if (!mStarted || mSpringSystem == null) {
return;
}
long currentTime = SystemClock.uptimeMillis();
mSpringSystem.loop(currentTime - mLastTime);
mHandler.post(mLooperRunnable);
}
};
}
@Override
public void start() {
if (mStarted) {
return;
}
mStarted = true;
mLastTime = SystemClock.uptimeMillis();
mHandler.removeCallbacks(mLooperRunnable);
mHandler.post(mLooperRunnable);
}
@Override
public void stop() {
mStarted = false;
mHandler.removeCallbacks(mLooperRunnable);
}
}
/**
* The Jelly Bean and up implementation of the spring looper that uses Android's
* {@link Choreographer} instead of a {@link Handler}
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private static class ChoreographerAndroidSpringLooper extends SpringLooper {
private final Choreographer mChoreographer;
private final Choreographer.FrameCallback mFrameCallback;
private boolean mStarted;
private long mLastTime;
/**
* @return an Android spring choreographer using the system {@link Choreographer}
*/
public static ChoreographerAndroidSpringLooper create() {
return new ChoreographerAndroidSpringLooper(Choreographer.getInstance());
}
public ChoreographerAndroidSpringLooper(Choreographer choreographer) {
mChoreographer = choreographer;
mFrameCallback = new Choreographer.FrameCallback() {
@Override
public void doFrame(long frameTimeNanos) {
if (!mStarted || mSpringSystem == null) {
return;
}
long currentTime = SystemClock.uptimeMillis();
mSpringSystem.loop(currentTime - mLastTime);
mLastTime = currentTime;
mChoreographer.postFrameCallback(mFrameCallback);
}
};
}
@Override
public void start() {
if (mStarted) {
return;
}
mStarted = true;
mLastTime = SystemClock.uptimeMillis();
mChoreographer.removeFrameCallback(mFrameCallback);
mChoreographer.postFrameCallback(mFrameCallback);
}
@Override
public void stop() {
mStarted = false;
mChoreographer.removeFrameCallback(mFrameCallback);
}
}
}
|
[
"380233376@qq.com"
] |
380233376@qq.com
|
cf4539c507126276b51630af8c600c15e16ad881
|
cb67a01c3b4f997f5dca3cb0dd7e1e9f18b77e3c
|
/rubbish_classification_parent/rubbish_classification_web/src/main/java/com/zp/rubbish/config/MySrpingMVCConfig.java
|
4cd592a5f112e252e9f309e4dedde06f3e9de284
|
[] |
no_license
|
ZengPengW/RubbishClass
|
65f90e3ebcb3ed2847d03ec65bceb69d76808327
|
3ef4179ba084bf6f06baa20cbba9d1bbc8262ae1
|
refs/heads/master
| 2022-12-08T21:39:40.490292
| 2019-08-05T12:17:49
| 2019-08-05T12:17:49
| 199,889,021
| 0
| 0
| null | 2022-12-06T00:32:50
| 2019-07-31T16:07:15
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 725
|
java
|
package com.zp.rubbish.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.nio.charset.Charset;
import java.util.List;
@Configuration
public class MySrpingMVCConfig extends WebMvcConfigurerAdapter {
//自定义消息转换器
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
StringHttpMessageConverter converter=new StringHttpMessageConverter(Charset.forName("utf-8"));
converters.add(converter);
}
}
|
[
"44264584+ZengPengW@users.noreply.github.com"
] |
44264584+ZengPengW@users.noreply.github.com
|
b871ff48b7ba86c292402c29ef099a2f704e2ed0
|
36fe74c8853e5d122525816191c8b55ce6050f7a
|
/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
32c3e9da8eaae07f51e53dba6eeb423c1490b41d
|
[] |
no_license
|
NicholasBlackburn1/Blackburn-1.18
|
07e8ddc20835f948959b022c5f74fcc0641f3baf
|
0e51f6e11590a747a2f33a0518c7abf79d5ef56e
|
refs/heads/main
| 2022-11-06T10:55:34.045865
| 2021-12-25T16:09:24
| 2021-12-25T16:09:24
| 441,702,689
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,239
|
java
|
package net.minecraft.world.entity.ai.targeting;
import java.util.function.Predicate;
import javax.annotation.Nullable;
import net.minecraft.world.Difficulty;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
public class TargetingConditions {
public static final TargetingConditions DEFAULT = forCombat();
private static final double MIN_VISIBILITY_DISTANCE_FOR_INVISIBLE_TARGET = 2.0D;
private final boolean isCombat;
private double range = -1.0D;
private boolean checkLineOfSight = true;
private boolean testInvisible = true;
@Nullable
private Predicate<LivingEntity> selector;
private TargetingConditions(boolean p_148351_) {
this.isCombat = p_148351_;
}
public static TargetingConditions forCombat() {
return new TargetingConditions(true);
}
public static TargetingConditions forNonCombat() {
return new TargetingConditions(false);
}
public TargetingConditions copy() {
TargetingConditions targetingconditions = this.isCombat ? forCombat() : forNonCombat();
targetingconditions.range = this.range;
targetingconditions.checkLineOfSight = this.checkLineOfSight;
targetingconditions.testInvisible = this.testInvisible;
targetingconditions.selector = this.selector;
return targetingconditions;
}
public TargetingConditions range(double p_26884_) {
this.range = p_26884_;
return this;
}
public TargetingConditions ignoreLineOfSight() {
this.checkLineOfSight = false;
return this;
}
public TargetingConditions ignoreInvisibilityTesting() {
this.testInvisible = false;
return this;
}
public TargetingConditions selector(@Nullable Predicate<LivingEntity> p_26889_) {
this.selector = p_26889_;
return this;
}
public boolean test(@Nullable LivingEntity p_26886_, LivingEntity p_26887_) {
if (p_26886_ == p_26887_) {
return false;
} else if (!p_26887_.canBeSeenByAnyone()) {
return false;
} else if (this.selector != null && !this.selector.test(p_26887_)) {
return false;
} else {
if (p_26886_ == null) {
if (this.isCombat && (!p_26887_.canBeSeenAsEnemy() || p_26887_.level.getDifficulty() == Difficulty.PEACEFUL)) {
return false;
}
} else {
if (this.isCombat && (!p_26886_.canAttack(p_26887_) || !p_26886_.canAttackType(p_26887_.getType()) || p_26886_.isAlliedTo(p_26887_))) {
return false;
}
if (this.range > 0.0D) {
double d0 = this.testInvisible ? p_26887_.getVisibilityPercent(p_26886_) : 1.0D;
double d1 = Math.max(this.range * d0, 2.0D);
double d2 = p_26886_.distanceToSqr(p_26887_.getX(), p_26887_.getY(), p_26887_.getZ());
if (d2 > d1 * d1) {
return false;
}
}
if (this.checkLineOfSight && p_26886_ instanceof Mob) {
Mob mob = (Mob)p_26886_;
if (!mob.getSensing().hasLineOfSight(p_26887_)) {
return false;
}
}
}
return true;
}
}
}
|
[
"nickblackburn02@gmail.com"
] |
nickblackburn02@gmail.com
|
56eaa8699fe4949a5349b38febb887cab775f431
|
3229b5789cf7686d84851a16950ef0f237c656be
|
/gmall-wms/src/main/java/com/atguigu/gmall/wms/controller/FeightTemplateController.java
|
7bde85f522ac30cf515dc3840eb2ee6e51c1c61c
|
[
"Apache-2.0"
] |
permissive
|
asucantuz/gmall-0722
|
40f745566a286d23acef0239edc8cceeaebf1d3e
|
ddb432a33ee2b1ca6593cc34d3afc5be2d6be775
|
refs/heads/master
| 2022-07-11T06:39:13.181492
| 2020-05-19T19:43:31
| 2020-05-19T19:43:31
| 265,339,558
| 0
| 0
|
Apache-2.0
| 2020-05-19T19:08:11
| 2020-05-19T19:08:10
| null |
UTF-8
|
Java
| false
| false
| 2,505
|
java
|
package com.atguigu.gmall.wms.controller;
import java.util.Arrays;
import java.util.Map;
import com.atguigu.core.bean.PageVo;
import com.atguigu.core.bean.QueryCondition;
import com.atguigu.core.bean.Resp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.atguigu.gmall.wms.entity.FeightTemplateEntity;
import com.atguigu.gmall.wms.service.FeightTemplateService;
/**
* 运费模板
*
* @author fengge
* @email lxf@atguigu.com
* @date 2019-12-04 10:34:01
*/
@Api(tags = "运费模板 管理")
@RestController
@RequestMapping("wms/feighttemplate")
public class FeightTemplateController {
@Autowired
private FeightTemplateService feightTemplateService;
/**
* 列表
*/
@ApiOperation("分页查询(排序)")
@GetMapping("/list")
@PreAuthorize("hasAuthority('wms:feighttemplate:list')")
public Resp<PageVo> list(QueryCondition queryCondition) {
PageVo page = feightTemplateService.queryPage(queryCondition);
return Resp.ok(page);
}
/**
* 信息
*/
@ApiOperation("详情查询")
@GetMapping("/info/{id}")
@PreAuthorize("hasAuthority('wms:feighttemplate:info')")
public Resp<FeightTemplateEntity> info(@PathVariable("id") Long id){
FeightTemplateEntity feightTemplate = feightTemplateService.getById(id);
return Resp.ok(feightTemplate);
}
/**
* 保存
*/
@ApiOperation("保存")
@PostMapping("/save")
@PreAuthorize("hasAuthority('wms:feighttemplate:save')")
public Resp<Object> save(@RequestBody FeightTemplateEntity feightTemplate){
feightTemplateService.save(feightTemplate);
return Resp.ok(null);
}
/**
* 修改
*/
@ApiOperation("修改")
@PostMapping("/update")
@PreAuthorize("hasAuthority('wms:feighttemplate:update')")
public Resp<Object> update(@RequestBody FeightTemplateEntity feightTemplate){
feightTemplateService.updateById(feightTemplate);
return Resp.ok(null);
}
/**
* 删除
*/
@ApiOperation("删除")
@PostMapping("/delete")
@PreAuthorize("hasAuthority('wms:feighttemplate:delete')")
public Resp<Object> delete(@RequestBody Long[] ids){
feightTemplateService.removeByIds(Arrays.asList(ids));
return Resp.ok(null);
}
}
|
[
"joedy23@aliyun.com"
] |
joedy23@aliyun.com
|
3c11c5a241341fd284c17b6ee271fd0d2dc25c16
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/training/org/hibernate/test/annotations/formula/JoinFormulaOneToManyNotIgnoreLazyFetchingTest.java
|
4b4fa132f2f53c3a54386e1492e024caf174e150
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 3,963
|
java
|
/**
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.annotations.formula;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import org.hibernate.LazyInitializationException;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.cfg.AnnotationBinder;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.logger.LoggerInspectionRule;
import org.hibernate.testing.logger.Triggerable;
import org.hibernate.testing.transaction.TransactionUtil;
import org.jboss.logging.Logger;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
@TestForIssue(jiraKey = "HHH-12770")
public class JoinFormulaOneToManyNotIgnoreLazyFetchingTest extends BaseEntityManagerFunctionalTestCase {
@Rule
public LoggerInspectionRule logInspection = new LoggerInspectionRule(Logger.getMessageLogger(CoreMessageLogger.class, AnnotationBinder.class.getName()));
private Triggerable triggerable = logInspection.watchForLogMessages("HHH000491");
@Test
public void testLazyLoading() {
Assert.assertFalse(triggerable.wasTriggered());
List<JoinFormulaOneToManyNotIgnoreLazyFetchingTest.Stock> stocks = TransactionUtil.doInJPA(this::entityManagerFactory, ( entityManager) -> {
return entityManager.createQuery("SELECT s FROM Stock s", .class).getResultList();
});
Assert.assertEquals(2, stocks.size());
try {
Assert.assertEquals("ABC", stocks.get(0).getCodes().get(0).getRefNumber());
Assert.fail("Should have thrown LazyInitializationException");
} catch (LazyInitializationException expected) {
}
}
@Entity(name = "Stock")
public static class Stock implements Serializable {
@Id
@Column(name = "ID")
private Long id;
@OneToMany
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name = "CODE_ID", referencedColumnName = "ID")
private List<JoinFormulaOneToManyNotIgnoreLazyFetchingTest.StockCode> codes = new ArrayList<>();
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public List<JoinFormulaOneToManyNotIgnoreLazyFetchingTest.StockCode> getCodes() {
return codes;
}
}
@Entity(name = "StockCode")
public static class StockCode implements Serializable {
@Id
@Column(name = "ID")
private Long id;
@Id
@Enumerated(EnumType.STRING)
@Column(name = "TYPE")
private JoinFormulaOneToManyNotIgnoreLazyFetchingTest.CodeType copeType;
private String refNumber;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public JoinFormulaOneToManyNotIgnoreLazyFetchingTest.CodeType getCopeType() {
return copeType;
}
public void setCopeType(JoinFormulaOneToManyNotIgnoreLazyFetchingTest.CodeType copeType) {
this.copeType = copeType;
}
public String getRefNumber() {
return refNumber;
}
public void setRefNumber(String refNumber) {
this.refNumber = refNumber;
}
}
public enum CodeType {
TYPE_A,
TYPE_B;}
}
|
[
"benjamin.danglot@inria.fr"
] |
benjamin.danglot@inria.fr
|
5287647f4241c47a1b106670a5e37b1e6c0603eb
|
5aa4d6e75dff32e54ccaa4b10709e7846721af05
|
/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/activities/rest/GetMyActivities.java
|
83e6d76bda03fcbd4a035de458a0936183fc64ff
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
gnuhub/SocialSDK
|
6bc49880e34c7c02110b7511114deb8abfdee924
|
02cc3ac4d131b7a094f6983202c1b5e0043b97eb
|
refs/heads/master
| 2021-01-16T20:08:07.509051
| 2014-07-09T08:53:03
| 2014-07-09T08:53:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,083
|
java
|
/*
* � Copyright IBM Corp. 2013
*
* 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.ibm.sbt.test.js.connections.activities.rest;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.ibm.sbt.automation.core.test.BaseAuthServiceTest;
/**
* @author mwallace
*
* @date 6 Mar 2013
*/
public class GetMyActivities extends BaseAuthServiceTest {
@Test
public void testNoError() {
boolean result = checkNoError("Social_Activities_REST_Get_My_Activities");
assertTrue(getNoErrorMsg(), result);
}
}
|
[
"LORENZOB@ie.ibm.com"
] |
LORENZOB@ie.ibm.com
|
b8570bbeb9ee2fa5405c1ff17696a32e8e5b2466
|
12fe67a59df1b8199dfc87fc52670ca57dbd8a1f
|
/test/test-common/src/main/java/org/linkeddatafragments/streamsparqlcommon/irail/Graph.java
|
f9ca3efc338cfeaa1db74b895c5b815ed2fcd052
|
[
"MIT"
] |
permissive
|
rubensworks/TPFStreamingQueryExecutor-experiments
|
f6a6c63f138e0934286b1be79d66f56a6871eb0b
|
f1122db77e2705713653f720158dccc7f9471f3f
|
refs/heads/master
| 2021-01-13T14:21:10.519869
| 2016-02-03T09:50:01
| 2016-02-03T09:50:01
| 34,907,497
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 253
|
java
|
package org.linkeddatafragments.streamsparqlcommon.irail;
import com.google.gson.annotations.SerializedName;
/**
* @author rubensworks
*/
public class Graph extends DataBase {
@SerializedName("@id") public String id;
public String stop;
}
|
[
"rubensworks@gmail.com"
] |
rubensworks@gmail.com
|
715f66d12ecddaffd7f61c5c2c168b55002b4d40
|
cb30f68e27b226b9d6dccd36d373fe45db18b0d9
|
/ais2/src/com/xbwl/entity/EDIOprHistory.java
|
19268485b41b52548e5e185ba1f9574ddf37a118
|
[] |
no_license
|
czltx224/ais2
|
81ab0b92073ae7fa22923c7be104446b4c39cc23
|
348e5f8d8aee735b2fe9a3d81d1d73ab02672675
|
refs/heads/master
| 2021-01-10T12:42:10.015359
| 2016-01-07T01:32:57
| 2016-01-07T01:32:57
| 49,176,839
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 3,296
|
java
|
package com.xbwl.entity;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.apache.struts2.json.annotations.JSON;
/**
* OprHistory entity.
*
* @author MyEclipse Persistence Tools
*/
@Entity
@Table(name = "EDI_OPR_HISTORY",schema = "AISUSER")
public class EDIOprHistory implements java.io.Serializable {
// Fields
private Long id;
private String oprName;//节点名称
private Long oprNode;//节点编号
private String oprComment;//操作内容
private Date oprTime;//操作时间
private String oprMan;//操作人
private String oprDepart;//操作部门
private Long dno;//配送单号
private Long oprType;//节点类型
// Constructors
/** default constructor */
public EDIOprHistory() {
}
/** minimal constructor */
public EDIOprHistory(Long id) {
this.id = id;
}
/** full constructor */
public EDIOprHistory(Long id, String oprName, Long oprNode, String oprComment,
Date oprTime, String oprMan, String oprDepart, Long dno,
Long oprType) {
this.id = id;
this.oprName = oprName;
this.oprNode = oprNode;
this.oprComment = oprComment;
this.oprTime = oprTime;
this.oprMan = oprMan;
this.oprDepart = oprDepart;
this.dno = dno;
this.oprType = oprType;
}
// Property accessors
@Id
@Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0)
@SequenceGenerator(name = "generator", sequenceName = "LXY.SEQ_OPR_HISTORY_ID ")
@GeneratedValue(strategy = javax.persistence.GenerationType.SEQUENCE, generator = "generator")
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
@Column(name = "OPR_NAME")
public String getOprName() {
return this.oprName;
}
public void setOprName(String oprName) {
this.oprName = oprName;
}
@Column(name = "OPR_NODE", precision = 22, scale = 0)
public Long getOprNode() {
return this.oprNode;
}
public void setOprNode(Long oprNode) {
this.oprNode = oprNode;
}
@Column(name = "OPR_COMMENT")
public String getOprComment() {
return this.oprComment;
}
public void setOprComment(String oprComment) {
this.oprComment = oprComment;
}
@JSON(format = "yyyy-MM-dd HH:mm")
@Column(name = "OPR_TIME")
public Date getOprTime() {
return this.oprTime;
}
public void setOprTime(Date oprTime) {
this.oprTime = oprTime;
}
@Column(name = "OPR_MAN")
public String getOprMan() {
return this.oprMan;
}
public void setOprMan(String oprMan) {
this.oprMan = oprMan;
}
@Column(name = "OPR_DEPART")
public String getOprDepart() {
return this.oprDepart;
}
public void setOprDepart(String oprDepart) {
this.oprDepart = oprDepart;
}
@Column(name = "D_NO", precision = 22, scale = 0)
public Long getDno() {
return this.dno;
}
public void setDno(Long dno) {
this.dno = dno;
}
@Column(name = "OPR_TYPE", precision = 22, scale = 0)
public Long getOprType() {
return this.oprType;
}
public void setOprType(Long oprType) {
this.oprType = oprType;
}
}
|
[
"czltx224@163.com"
] |
czltx224@163.com
|
30eadae288814519fcf91b60830c5d4d33b0c171
|
46fbecdd951f6738e37feb2fc1afbe58bd4dd9fa
|
/src/main/java/tk/ocb/main/exception/ExceptionResponse.java
|
61bae3073f1cf5b5f535b37fbdf138e6ad9f1cfa
|
[] |
no_license
|
tkNbgL/personalTrainer
|
b630b47dcc42b3656e14faa72ad8dd552277b9c2
|
de9460bd64ac7741a30e481007cc230768e01d71
|
refs/heads/master
| 2020-12-09T05:08:20.893590
| 2020-02-06T07:22:43
| 2020-02-06T07:22:43
| 233,201,801
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 761
|
java
|
package tk.ocb.main.exception;
import java.util.Date;
public class ExceptionResponse {
private Date timestamp;
private String message;
private String details;
public ExceptionResponse(){
}
public ExceptionResponse(Date timestamp, String message, String details) {
super();
this.timestamp = timestamp;
this.message = message;
this.details = details;
}
public Date getTimestamp() {
return timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
}
|
[
"apple@Apples-MacBook-Pro.local"
] |
apple@Apples-MacBook-Pro.local
|
aa3c9f9e61e39ebb0d04680419822bf139ece35b
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/33/33_43fa5fc90bbb81f3c241e63139ed0290b6d60180/UIMembershipManagement/33_43fa5fc90bbb81f3c241e63139ed0290b6d60180_UIMembershipManagement_s.java
|
acd3fe76353e751d6c8a5b29857302fc0918fb34
|
[] |
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,638
|
java
|
/**
* Copyright (C) 2009 eXo Platform SAS.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.exoplatform.organization.webui.component;
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.UIContainer;
import java.io.Writer;
/**
* Created by The eXo Platform SARL
* Author : chungnv
* nguyenchung136@yahoo.com
* Jun 23, 2006
* 10:07:15 AM
*/
@ComponentConfig()
public class UIMembershipManagement extends UIContainer
{
public UIMembershipManagement() throws Exception
{
addChild(UIListMembershipType.class, null, null);
addChild(UIMembershipTypeForm.class, null, null);
}
public UIGroupMembershipForm getGroupMembershipForm()
{
UIOrganizationPortlet uiParent = getParent();
UIGroupManagement groupManagement = uiParent.getChild(UIGroupManagement.class);
UIGroupDetail groupDetail = groupManagement.getChild(UIGroupDetail.class);
UIGroupInfo groupInfo = groupDetail.getChild(UIGroupInfo.class);
UIUserInGroup userIngroup = groupInfo.getChild(UIUserInGroup.class);
return userIngroup.getChild(UIGroupMembershipForm.class);
}
public void addOptions(MembershipType option)
{
getGroupMembershipForm().addOptionMembershipType(option);
}
public void deleteOptions(MembershipType option)
{
getGroupMembershipForm().removeOptionMembershipType(option);
}
@SuppressWarnings("unused")
public void processRender(WebuiRequestContext context) throws Exception
{
Writer w = context.getWriter();
w.write("<div id=\"UIMembershipManagement\" class=\"UIMembershipManagement\">");
renderChildren();
w.write("</div>");
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
5c7dccc6cae8568cab69bf495f93230fa23cbb47
|
7f773eb62d415be5b9612687522641d0c307e5a7
|
/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/debug/RobotModelPresentationTest.java
|
3139000b686781efc3bc3800f1c384550c4f7dfc
|
[
"Apache-2.0"
] |
permissive
|
Naveennani777/RED
|
c649e874f283f12c63c08c5cac7097396853abf4
|
a43a6eb64b535aa7c19bae8360ca18f5faa02916
|
refs/heads/master
| 2020-12-02T22:59:57.636134
| 2017-06-29T11:32:44
| 2017-06-29T11:32:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,175
|
java
|
/*
* Copyright 2017 Nokia Solutions and Networks
* Licensed under the Apache License, Version 2.0,
* see license.txt file for details.
*/
package org.robotframework.ide.eclipse.main.plugin.debug;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.ILineBreakpoint;
import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.core.model.IValue;
import org.eclipse.debug.ui.IValueDetailListener;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.junit.Test;
import org.robotframework.ide.eclipse.main.plugin.debug.model.RobotDebugTarget;
import org.robotframework.ide.eclipse.main.plugin.debug.model.RobotDebugValueOfDictionary;
import org.robotframework.ide.eclipse.main.plugin.debug.model.RobotDebugValueOfList;
import org.robotframework.ide.eclipse.main.plugin.debug.model.RobotDebugValueOfScalar;
import org.robotframework.ide.eclipse.main.plugin.debug.model.RobotDebugVariable;
import org.robotframework.ide.eclipse.main.plugin.debug.model.RobotLineBreakpoint;
import org.robotframework.ide.eclipse.main.plugin.tableeditor.RobotFormEditor;
public class RobotModelPresentationTest {
@Test
public void setAttributeDoesNothing() {
final RobotModelPresentation presentation = spy(new RobotModelPresentation());
final Object someObject = mock(Object.class);
presentation.setAttribute("attr", someObject);
verifyZeroInteractions(someObject);
verify(presentation).setAttribute("attr", someObject);
verifyNoMoreInteractions(presentation);
}
@Test
public void imageIsAlwaysNull() {
final RobotModelPresentation presentation = new RobotModelPresentation();
final Object someObject = mock(Object.class);
assertThat(presentation.getImage(someObject)).isNull();
verifyZeroInteractions(someObject);
}
@Test
public void threadNameIsProvided_whenThreadIsGiven() throws CoreException {
final RobotModelPresentation presentation = new RobotModelPresentation();
final IThread thread = mock(IThread.class);
when(thread.getName()).thenReturn("robot thread");
assertThat(presentation.getText(thread)).isEqualTo("robot thread");
}
@Test
public void debugTargetNameIsProvided_whenDebugTargetIsGiven() throws CoreException {
final RobotModelPresentation presentation = new RobotModelPresentation();
final IDebugTarget target = mock(IDebugTarget.class);
when(target.getName()).thenReturn("target");
assertThat(presentation.getText(target)).isEqualTo("target");
}
@Test
public void stackframeNameIsProvided_whenStackframeIsGiven() throws CoreException {
final RobotModelPresentation presentation = new RobotModelPresentation();
final IStackFrame frame = mock(IStackFrame.class);
when(frame.getName()).thenReturn("frame");
assertThat(presentation.getText(frame)).isEqualTo("frame");
}
@Test
public void breakpointLabelIsProvided_whenRobotLineBreakpointIsGiven() throws CoreException {
final RobotModelPresentation presentation = new RobotModelPresentation();
final RobotLineBreakpoint breakpoint = mock(RobotLineBreakpoint.class);
when(breakpoint.getLabel()).thenReturn("breakpoint [line: 3]");
assertThat(presentation.getText(breakpoint)).isEqualTo("breakpoint [line: 3]");
}
@Test
public void redNameIsProvided_whenArbitraryObjectIsGiven() throws CoreException {
final RobotModelPresentation presentation = new RobotModelPresentation();
assertThat(presentation.getText(new Object())).isEqualTo("RED");
}
@Test
public void robotSuiteEditorIdIsProvided_whenFileIsGiven() {
final RobotModelPresentation presentation = new RobotModelPresentation();
final IFile file = mock(IFile.class);
final String id = presentation.getEditorId(mock(IEditorInput.class), file);
assertThat(id).isEqualTo(RobotFormEditor.ID);
}
@Test
public void fileEditorInputIsProvided_whenFileIsGiven() {
final RobotModelPresentation presentation = new RobotModelPresentation();
final IFile file = mock(IFile.class);
final IEditorInput input = presentation.getEditorInput(file);
assertThat(input).isInstanceOf(IFileEditorInput.class);
assertThat(((IFileEditorInput) input).getFile()).isSameAs(file);
}
@Test
public void robotSuiteEditorIdIsProvided_whenLineBreakpointIsGiven() {
final RobotModelPresentation presentation = new RobotModelPresentation();
final ILineBreakpoint breakpoint = mock(ILineBreakpoint.class);
final String id = presentation.getEditorId(mock(IEditorInput.class), breakpoint);
assertThat(id).isEqualTo(RobotFormEditor.ID);
}
@Test
public void fileEditorInputIsProvided_whenLineBreakpointIsGiven() {
final RobotModelPresentation presentation = new RobotModelPresentation();
final IFile file = mock(IFile.class);
final IMarker marker = mock(IMarker.class);
when(marker.getResource()).thenReturn(file);
final ILineBreakpoint breakpoint = mock(ILineBreakpoint.class);
when(breakpoint.getMarker()).thenReturn(marker);
final IEditorInput input = presentation.getEditorInput(breakpoint);
assertThat(input).isInstanceOf(IFileEditorInput.class);
assertThat(((IFileEditorInput) input).getFile()).isSameAs(file);
}
@Test
public void nullEditorIdIsProvided_whenArbitraryObjectIsGiven() {
final RobotModelPresentation presentation = new RobotModelPresentation();
final String id = presentation.getEditorId(mock(IEditorInput.class), new Object());
assertThat(id).isNull();
}
@Test
public void nullEditorInputIsProvided_whenArbitraryObjectIsGiven() {
final RobotModelPresentation presentation = new RobotModelPresentation();
final IEditorInput input = presentation.getEditorInput(new Object());
assertThat(input).isNull();
}
@Test
public void whenRobotDebugValueIsComputed_listenerIsNotifiedAboutIt() {
final RobotModelPresentation presentation = new RobotModelPresentation();
final IValueDetailListener listener = mock(IValueDetailListener.class);
final IValue value1 = new RobotDebugValueOfScalar(null, "val");
final IValue value2 = new RobotDebugValueOfList(null, newArrayList(
new RobotDebugVariable((RobotDebugTarget) null, "1", "x"),
new RobotDebugVariable((RobotDebugTarget) null, "2", "y"),
new RobotDebugVariable((RobotDebugTarget) null, "3", "z")));
final IValue value3 = new RobotDebugValueOfDictionary(null, newArrayList(
new RobotDebugVariable((RobotDebugTarget) null, "k1", "x"),
new RobotDebugVariable((RobotDebugTarget) null, "k2", "y"),
new RobotDebugVariable((RobotDebugTarget) null, "k3", "z")));
presentation.computeDetail(value1, listener);
presentation.computeDetail(value2, listener);
presentation.computeDetail(value3, listener);
verify(listener).detailComputed(value1, "val");
verify(listener).detailComputed(value2, "[x, y, z]");
verify(listener).detailComputed(value3, "{k1=x, k2=y, k3=z}");
}
}
|
[
"test009@nsn.com.not.available"
] |
test009@nsn.com.not.available
|
91f604433b8e9ddee504c1e30e6962f12679dce8
|
a0e4f155a7b594f78a56958bca2cadedced8ffcd
|
/plugin/vip/src/main/java/org/zstack/network/service/vip/ModifyVipAttributesReply.java
|
b8c219c641655efc8ff039d61a175e393427d0b4
|
[
"Apache-2.0"
] |
permissive
|
zhao-qc/zstack
|
e67533eabbbabd5ae9118d256f560107f9331be0
|
b38cd2324e272d736f291c836f01966f412653fa
|
refs/heads/master
| 2020-08-14T15:03:52.102504
| 2019-10-14T03:51:12
| 2019-10-14T03:51:12
| 215,187,833
| 3
| 0
|
Apache-2.0
| 2019-10-15T02:27:17
| 2019-10-15T02:27:16
| null |
UTF-8
|
Java
| false
| false
| 421
|
java
|
package org.zstack.network.service.vip;
import org.zstack.header.message.MessageReply;
/**
* Created by xing5 on 2016/11/30.
*/
public class ModifyVipAttributesReply extends MessageReply {
private ModifyVipAttributesStruct struct;
public ModifyVipAttributesStruct getStruct() {
return struct;
}
public void setStruct(ModifyVipAttributesStruct struct) {
this.struct = struct;
}
}
|
[
"xin.zhang@mevoco.com"
] |
xin.zhang@mevoco.com
|
1e49882b5313a952dd8134f5fe29d8a37fa9e025
|
d4d1013d3215088f7ec445b393b58fb30249ca1b
|
/jonix-common/src/main/java/com/tectonica/jonix/common/codelist/TradeCategorys.java
|
fbbf3fee0584af3db90bb25bea04ca1af5cd60f2
|
[
"Apache-2.0"
] |
permissive
|
miyewd/jonix
|
70de3ba4b2054e0a66f688185834c9b0c73a101f
|
2ce4c9d7fddd453c4c76cf2a4bfae17b98e9b91d
|
refs/heads/master
| 2022-11-28T18:00:52.049749
| 2020-08-06T09:21:47
| 2020-08-06T09:21:47
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,385
|
java
|
/*
* Copyright (C) 2012-2020 Zach Melamed
*
* Latest version available online at https://github.com/zach-m/jonix
* Contact me at zach@tectonica.co.il
*
* 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.tectonica.jonix.common.codelist;
import com.tectonica.jonix.common.OnixCodelist;
import java.util.HashMap;
import java.util.Map;
/*
* NOTE: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT MANUALLY
*/
/**
* marker interface to assist in IDE navigation to code-list 12 (Trade category)
*/
interface CodeList12 {
}
/**
* <code>Enum</code> that corresponds to ONIX <b>Codelist 12</b>
* <p>
* Description: Trade category
*
* @see <a href="https://www.editeur.org/14/Code-Lists/">About ONIX Codelists</a>
* @see <a href=
* "https://www.editeur.org/files/ONIX%20for%20books%20-%20code%20lists/ONIX_BookProduct_Codelists_Issue_49.html#codelist12">ONIX
* Codelist 12 in Reference Guide</a>
*/
public enum TradeCategorys implements OnixCodelist, CodeList12 {
/**
* An edition from a UK publisher sold only in territories where exclusive rights are not held. Rights details
* should be carried in PR.21 (ONIX 2.1) OR P.21 (ONIX 3.0) as usual
*/
UK_open_market_edition("01", "UK open market edition"),
/**
* In UK, an edition intended primarily for airside sales in UK airports, though it may be available for sale in
* other territories where exclusive rights are not held. Rights details should be carried in PR.21 (ONIX 2.1) OR
* P.21 (ONIX 3.0) as usual
*/
Airport_edition("02", "Airport edition"),
/**
* In Germany, a special printing sold at a lower price than the regular hardback
*/
Sonderausgabe("03", "Sonderausgabe"),
/**
* In countries where recognised as a distinct trade category, eg France « livre de poche », Germany
* ,Taschenbuch', Italy «tascabile», Spain «libro de bolsillo»
*/
Pocket_book("04", "Pocket book"),
/**
* Edition produced solely for sale in designated export markets
*/
International_edition_US("05", "International edition (US)"),
/**
* Audio product sold in special durable packaging and with a replacement guarantee for the contained cassettes or
* CDs for a specified shelf-life
*/
Library_audio_edition("06", "Library audio edition"),
/**
* An edition from a US publisher sold only in territories where exclusive rights are not held. Rights details
* should be carried in PR.21 (ONIX 2.1) OR P.21 (ONIX 3.0) as usual
*/
US_open_market_edition("07", "US open market edition"),
/**
* In France, a category of book that has a particular legal status, claimed by the publisher
*/
Livre_scolaire_d_clar_par_l_diteur("08", "Livre scolaire, déclaré par l’éditeur"),
/**
* In France, a category of book that has a particular legal status, designated independently of the publisher
*/
Livre_scolaire_non_sp_cifi_("09", "Livre scolaire (non spécifié)"),
/**
* Edition published for sale only with a newspaper or periodical
*/
Supplement_to_newspaper("10", "Supplement to newspaper"),
/**
* In Spain, a school textbook for which there is no fixed or suggested retail price and which is supplied by the
* publisher on terms individually agreed with the bookseller
*/
Precio_libre_textbook("11", "Precio libre textbook"),
/**
* For editions sold only through newsstands/newsagents
*/
News_outlet_edition("12", "News outlet edition"),
/**
* In the US and Canada, a book that is published primarily for use by students in school or college education as a
* basis for study. Textbooks published for the elementary and secondary school markets are generally purchased by
* school districts for the use of students. Textbooks published for the higher education market are generally
* adopted for use in particular classes by the instructors of those classes. Textbooks are usually not marketed to
* the general public, which distinguishes them from trade books. Note that trade books adopted for course use are
* not considered to be textbooks (though a specific education edition of a trade title may be)
*/
US_textbook("13", "US textbook"),
/**
* 'Short' e-book (sometimes also called a 'single'), typically containing a single short story, an essay or piece
* of long-form journalism
*/
E_book_short("14", "E-book short"),
/**
* In countries where recognised as a distinct trade category, eg Italy «supertascabile». For use in ONIX
* 3.0 only
* <p>
* Jonix-Comment: Introduced in Onix3
*/
Superpocket_book("15", "Superpocket book"),
/**
* Category of books, usually hardcover and of a large format (A4 or larger) and printed on high-quality paper,
* where the primary features are illustrations, and these are more important than text. Sometimes called
* 'coffee-table books' or 'art books' in English. For use in ONIX 3.0 only
* <p>
* Jonix-Comment: Introduced in Onix3
*/
Beau_livre("16", "Beau-livre"),
/**
* Category of audio products typically distinguished by being free of charge (but which may be monetised through
* advertising content) and episodic. For use in ONIX 3.0 only
* <p>
* Jonix-Comment: Introduced in Onix3
*/
Podcast("17", "Podcast"),
/**
* Category of books or e-books which are single issues of a periodical publication, sold as independent products.
* For use in ONIX 3.0 only
* <p>
* Jonix-Comment: Introduced in Onix3
*/
Periodical("18", "Periodical");
public final String code;
public final String description;
TradeCategorys(String code, String description) {
this.code = code;
this.description = description;
}
@Override
public String getCode() {
return code;
}
@Override
public String getDescription() {
return description;
}
private static volatile Map<String, TradeCategorys> map;
private static Map<String, TradeCategorys> map() {
Map<String, TradeCategorys> result = map;
if (result == null) {
synchronized (TradeCategorys.class) {
result = map;
if (result == null) {
result = new HashMap<>();
for (TradeCategorys e : values()) {
result.put(e.code, e);
}
map = result;
}
}
}
return result;
}
public static TradeCategorys byCode(String code) {
if (code == null || code.isEmpty()) {
return null;
}
return map().get(code);
}
}
|
[
"zach@tectonica.co.il"
] |
zach@tectonica.co.il
|
4f3784c8c9168b717982628257298560fcac2972
|
fda2f41ff66ff6eeae2b94ef98e88a9ee3c8ff4c
|
/lib/src/main/java/com/qflbai/mvvm/utils/time/TimeConstants.java
|
043f4e88d3f2fbd202cc16dbf893308aa1686f76
|
[] |
no_license
|
qflbai/AndroidJetpack
|
04847dfb53b6949c9ec85fae9bc3a7c7b40d12bc
|
edd0375b98950e3675acf2bb1c25b8c63780fb8b
|
refs/heads/master
| 2020-03-27T15:09:16.204116
| 2018-12-07T09:53:15
| 2018-12-07T09:53:15
| 146,700,639
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 813
|
java
|
package com.qflbai.mvvm.utils.time;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import androidx.annotation.IntDef;
/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2017/03/13
* desc : The constants of time.
* </pre>
*/
public final class TimeConstants {
/**
* 毫秒
*/
public static final int MSEC = 1;
/**
* 秒
*/
public static final int SEC = 1000;
/**
* 分钟
*/
public static final int MIN = 60000;
/**
* 小时
*/
public static final int HOUR = 3600000;
/**
* 天
*/
public static final int DAY = 86400000;
@IntDef({MSEC, SEC, MIN, HOUR, DAY})
@Retention(RetentionPolicy.SOURCE)
public @interface Unit {
}
}
|
[
"qflbai@163.com"
] |
qflbai@163.com
|
9ccde46364d3d6faf7dfe02e8b84acaaa97f14d1
|
ac8029acd3eaa2ebbfe292d3b625db7212c3e355
|
/src/com/proschedule/core/persistence/view/set/SetComponentSearchAdapter.java
|
f6cb3efe3882e17d21b36db0c7aa4476161b8dfd
|
[
"Apache-2.0"
] |
permissive
|
mayconbordin/proschedule
|
6821b4248a750857e68cb61ced04f5c41548736b
|
288ceaddc2bc007121a3a7c34082629e6b8a41c4
|
refs/heads/master
| 2020-12-25T19:14:57.356852
| 2017-01-04T09:01:31
| 2017-01-04T09:01:31
| 3,091,485
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 776
|
java
|
package com.proschedule.core.persistence.view.set;
import com.proschedule.core.persistence.model.Component;
import com.proschedule.util.search.ISearchDialog;
/**
* Adaptador para busca de componentes do conjunto
*
* @author Maycon Bordin
* @version 1.0
* @created 04-out-2010 13:24:50
*/
public class SetComponentSearchAdapter implements ISearchDialog {
private NewSetComponentDialog dialog;
/**
* Construtor da Classe
*
* @param dialog Diálogo que receberá o código do componente
*/
public SetComponentSearchAdapter(NewSetComponentDialog dialog) {
this.dialog = dialog;
}
public void selectItem(Object obj) {
Component o = (Component) obj;
dialog.getJtfComponent().setText( o.getId() );
}
}
|
[
"mayconbordin@gmail.com"
] |
mayconbordin@gmail.com
|
29ae89a5473d997e7ce5eb8de3cf335c392598f5
|
9d0edb92d5b07016149b8716928291e876ca6a18
|
/plugins/org.brainwy.liclipsetext.editor/tests/org/brainwy/liclipsetext/editor/outline/XmlOutlineTest.java
|
0e11d32929af259469d20c9b1816646768442a9f
|
[] |
no_license
|
fabioz/LiClipseText
|
0481f568e02fbc36f5b023f4a9b8c5d241477fd3
|
c91ce64b07e58d0b96204ea9fbfc8695ce748fee
|
refs/heads/master
| 2023-08-22T15:42:58.260192
| 2023-07-22T14:02:18
| 2023-07-22T14:02:18
| 58,862,369
| 21
| 12
| null | 2018-10-30T10:39:59
| 2016-05-15T13:14:45
|
Java
|
UTF-8
|
Java
| false
| false
| 1,290
|
java
|
package org.brainwy.liclipsetext.editor.outline;
import junit.framework.TestCase;
import org.brainwy.liclipsetext.editor.common.partitioning.LiClipseDocumentPartitioner;
import org.brainwy.liclipsetext.editor.common.partitioning.TestUtils;
import org.brainwy.liclipsetext.editor.languages.LiClipseLanguage;
import org.brainwy.liclipsetext.editor.languages.outline.LanguageOutline.LiClipseNode;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
public class XmlOutlineTest extends TestCase {
public void testOutline() throws Exception {
IDocument document = new Document(""
+ "<test><test>"
+ "</test></test>");
TestUtils.connectDocumentToLanguage(document, "xml.liclipse");
LiClipseDocumentPartitioner partitioner = (LiClipseDocumentPartitioner) document.getDocumentPartitioner();
LiClipseLanguage language = partitioner.language;
LiClipseNode outline = language.getOutline().createOutline(document);
assertEquals(outline.toStringRepr(), ""
+ "TreeNode:null\n"
+ " TreeNode:test offset:1 len:4 beginLine:1 icon:class\n"
+ " TreeNode:test offset:7 len:4 beginLine:1 icon:class\n"
+ "");
}
}
|
[
"fabiofz@gmail.com"
] |
fabiofz@gmail.com
|
2a10962ca505249bc5422565ea1ce9073709ec14
|
2fcac318ce9cad695910f58d074ddcae6a9bba65
|
/app/src/main/java/com/msjf/fentuan/member_info/ShenFenView.java
|
b19146c66e8db3ad71065b97db93c59e4235d160
|
[] |
no_license
|
leeowenowen/app_base
|
fb3fe3159f71b23a538875aa88669a7f5d0753d5
|
237c2381121b113472ab2ed17133f712daa8af78
|
refs/heads/master
| 2021-01-10T18:51:17.733247
| 2015-06-27T14:22:43
| 2015-06-27T14:22:43
| 38,162,632
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,662
|
java
|
package com.msjf.fentuan.member_info;
import android.content.Context;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.view.Gravity;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.msjf.fentuan.ui.util.LU;
import com.msjf.fentuan.ui.util.TU;
import com.owo.app.language.LanguageObserver;
import com.owo.app.theme.ColorId;
import com.owo.app.theme.Theme;
import com.owo.app.theme.ThemeObserver;
import com.owo.base.pattern.Singleton;
import com.owo.base.util.DimensionUtil;
public class ShenFenView extends LinearLayout implements ThemeObserver, LanguageObserver {
private TextView mTitle;
private ItemText mZhuGuan;
private ItemText mShouXiXinWenGuan;
private ItemText mShouXiXingGuaZhuChiRen;
private TextView mAttention;
public ShenFenView(Context context) {
super(context);
initComponents(context);
onLanguageChanged();
onThemeChanged();
}
private void initComponents(Context context) {
mTitle = new TextView(context);
mZhuGuan = new ItemText(context);
mShouXiXinWenGuan = new ItemText(context);
mShouXiXingGuaZhuChiRen = new ItemText(context);
mAttention = new TextView(context);
setOrientation(VERTICAL);
setGravity(Gravity.CENTER_HORIZONTAL);
addView(mTitle);
LU.setMargin(mTitle, 0, 30, 0, 70);
addView(mZhuGuan);
addView(mShouXiXinWenGuan);
LU.setMargin(mShouXiXinWenGuan, 0, 30, 0, 30);
addView(mShouXiXingGuaZhuChiRen);
addView(mAttention);
LU.setMargin(mAttention, 0, 30, 0, 30);
setPadding(DimensionUtil.w(30), 0, DimensionUtil.w(30), 0);
}
@Override
public void onLanguageChanged() {
mTitle.setText("粉丝身份权利义务说明");
mTitle.setGravity(Gravity.CENTER_HORIZONTAL);
mZhuGuan.setText("粉丝主管:", " 已成功申请成为一线明星俱乐部会员,并累计消费该偶像相关点映等明星产品大于300元,同时"
+ "给三位粉友发布最新星闻不少于3条.主管有资格享受粉团每月最基本粉丝专场权益1场/月");
mShouXiXinWenGuan.setText("粉团首席星闻官:", " 已成功申请成为一线明星俱乐部会员,并且累计消费该偶像相关点映等明星产品大于"
+ "2000元,并且给三位粉友发布最新星闻不少于两条:.有资格享受明星任何福利1份/月,有资格删除所有虚假星闻");
mShouXiXingGuaZhuChiRen.setText("粉团首席星话主持人:", " 已成功申请成为一线明星俱乐部会员,并在粉丝平台累计消费该偶像相关电影"
+ "等明星产品总计大于100元, 并给3位粉友发布最新星闻不少于1条,并且至少三次受邀主持星话.有资格享受粉团补贴" + "1次/月");
mAttention.setText("注意:每单次明星粉团上述三个职位分别只有1个名额,每两周更换一次");
}
@Override
public void onThemeChanged() {
TU.setTextColor(ColorId.highlight_color, mTitle);
TU.setTextColor(ColorId.main_text_color, mZhuGuan, mShouXiXinWenGuan,
mShouXiXingGuaZhuChiRen, mAttention);
TU.setTextSize(32, mTitle);
TU.setTextSize(27, mZhuGuan, mShouXiXinWenGuan, mShouXiXingGuaZhuChiRen, mAttention);
}
private class ItemText extends TextView {
public ItemText(Context context) {
super(context);
}
public void setText(String title, String content) {
String value = title + content;
SpannableStringBuilder builder = new SpannableStringBuilder();
builder.append(value);
builder.setSpan(
new ForegroundColorSpan(Singleton.of(Theme.class)
.color(ColorId.highlight_color)), 0, title.length(),
Spannable.SPAN_INCLUSIVE_INCLUSIVE);
setText(builder);
}
}
}
|
[
"leeowenowen@gmail.com"
] |
leeowenowen@gmail.com
|
4fc4821a563cd5a94a01c37e0e40bb8c8ab66979
|
3894ed92a170f22055f5c946bce5df806865e0b3
|
/app/src/main/java/com/ex/ltech/led/my_view/swipemenulistview/SwipeMenuListView.java
|
8bb6aefc81507f97a5aedb655e4fc1a1a59499cb
|
[] |
no_license
|
scofieldhhl/sh
|
18341bf538ed2f13e6c790808d79640c1957bd82
|
7581f5c5c24072c1372848126b6e069e8d1dcec8
|
refs/heads/master
| 2021-08-20T07:46:23.399586
| 2017-11-07T10:33:23
| 2017-11-07T10:33:23
| 109,274,621
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,706
|
java
|
package com.ex.ltech.led.my_view.swipemenulistview;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.support.v4.view.MotionEventCompat;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Interpolator;
import android.widget.ListAdapter;
import com.ex.ltech.led.my_view.pullfresh.PullableListView;
public class SwipeMenuListView extends PullableListView
{
private static final int TOUCH_STATE_NONE = 0;
private static final int TOUCH_STATE_X = 1;
private static final int TOUCH_STATE_Y = 2;
private int MAX_X = 3;
private int MAX_Y = 5;
private Interpolator mCloseInterpolator;
private float mDownX;
private float mDownY;
private SwipeMenuCreator mMenuCreator;
private OnMenuItemClickListener mOnMenuItemClickListener;
private OnSwipeListener mOnSwipeListener;
private Interpolator mOpenInterpolator;
private int mTouchPosition;
private int mTouchState;
private SwipeMenuLayout mTouchView;
public SwipeMenuListView(Context paramContext)
{
super(paramContext);
init();
}
public SwipeMenuListView(Context paramContext, AttributeSet paramAttributeSet)
{
super(paramContext, paramAttributeSet);
init();
}
public SwipeMenuListView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
init();
}
private void init()
{
this.MAX_X = dp2px(this.MAX_X);
this.MAX_Y = dp2px(this.MAX_Y);
this.mTouchState = 0;
}
public int dp2px(int paramInt)
{
return (int)TypedValue.applyDimension(1, paramInt, getContext().getResources().getDisplayMetrics());
}
public Interpolator getCloseInterpolator()
{
return this.mCloseInterpolator;
}
public Interpolator getOpenInterpolator()
{
return this.mOpenInterpolator;
}
public boolean onInterceptTouchEvent(MotionEvent paramMotionEvent)
{
return super.onInterceptTouchEvent(paramMotionEvent);
}
public boolean onTouchEvent(MotionEvent paramMotionEvent)
{
if ((paramMotionEvent.getAction() != 0) && (this.mTouchView == null))
return super.onTouchEvent(paramMotionEvent);
MotionEventCompat.getActionMasked(paramMotionEvent);
switch (paramMotionEvent.getAction())
{
default:
case 0:
case 2:
case 1:
}
do
while (true)
{
return super.onTouchEvent(paramMotionEvent);
int i = this.mTouchPosition;
this.mDownX = paramMotionEvent.getX();
this.mDownY = paramMotionEvent.getY();
this.mTouchState = 0;
this.mTouchPosition = pointToPosition((int)paramMotionEvent.getX(), (int)paramMotionEvent.getY());
if ((this.mTouchPosition == i) && (this.mTouchView != null) && (this.mTouchView.isOpen()))
{
this.mTouchState = 1;
this.mTouchView.onSwipe(paramMotionEvent);
return true;
}
View localView = getChildAt(this.mTouchPosition - getFirstVisiblePosition());
if ((this.mTouchView != null) && (this.mTouchView.isOpen()))
{
this.mTouchView.smoothCloseMenu();
this.mTouchView = null;
MotionEvent localMotionEvent = MotionEvent.obtain(paramMotionEvent);
localMotionEvent.setAction(3);
onTouchEvent(localMotionEvent);
return true;
}
if ((localView instanceof SwipeMenuLayout))
this.mTouchView = ((SwipeMenuLayout)localView);
if (this.mTouchView == null)
continue;
this.mTouchView.onSwipe(paramMotionEvent);
continue;
float f1 = Math.abs(paramMotionEvent.getY() - this.mDownY);
float f2 = Math.abs(paramMotionEvent.getX() - this.mDownX);
if (this.mTouchState == 1)
{
if (this.mTouchView != null)
this.mTouchView.onSwipe(paramMotionEvent);
getSelector().setState(new int[] { 0 });
paramMotionEvent.setAction(3);
super.onTouchEvent(paramMotionEvent);
return true;
}
if (this.mTouchState != 0)
continue;
if (Math.abs(f1) > this.MAX_Y)
{
this.mTouchState = 2;
continue;
}
if (f2 <= this.MAX_X)
continue;
this.mTouchState = 1;
if (this.mOnSwipeListener == null)
continue;
this.mOnSwipeListener.onSwipeStart(this.mTouchPosition);
}
while (this.mTouchState != 1);
if (this.mTouchView != null)
{
this.mTouchView.onSwipe(paramMotionEvent);
if (!this.mTouchView.isOpen())
{
this.mTouchPosition = -1;
this.mTouchView = null;
}
}
if (this.mOnSwipeListener != null)
this.mOnSwipeListener.onSwipeEnd(this.mTouchPosition);
paramMotionEvent.setAction(3);
super.onTouchEvent(paramMotionEvent);
return true;
}
public void setAdapter(ListAdapter paramListAdapter)
{
super.setAdapter(new SwipeMenuAdapter(getContext(), paramListAdapter)
{
public void createMenu(SwipeMenu paramSwipeMenu)
{
if (SwipeMenuListView.this.mMenuCreator != null)
SwipeMenuListView.this.mMenuCreator.create(paramSwipeMenu);
}
public void onItemClick(SwipeMenuView paramSwipeMenuView, SwipeMenu paramSwipeMenu, int paramInt)
{
SwipeMenuListView.OnMenuItemClickListener localOnMenuItemClickListener = SwipeMenuListView.this.mOnMenuItemClickListener;
boolean bool = false;
if (localOnMenuItemClickListener != null)
bool = SwipeMenuListView.this.mOnMenuItemClickListener.onMenuItemClick(paramSwipeMenuView.getPosition(), paramSwipeMenu, paramInt);
if ((SwipeMenuListView.this.mTouchView != null) && (!bool))
SwipeMenuListView.this.mTouchView.smoothCloseMenu();
}
});
}
public void setCloseInterpolator(Interpolator paramInterpolator)
{
this.mCloseInterpolator = paramInterpolator;
}
public void setMenuCreator(SwipeMenuCreator paramSwipeMenuCreator)
{
this.mMenuCreator = paramSwipeMenuCreator;
}
public void setOnMenuItemClickListener(OnMenuItemClickListener paramOnMenuItemClickListener)
{
this.mOnMenuItemClickListener = paramOnMenuItemClickListener;
}
public void setOnSwipeListener(OnSwipeListener paramOnSwipeListener)
{
this.mOnSwipeListener = paramOnSwipeListener;
}
public void setOpenInterpolator(Interpolator paramInterpolator)
{
this.mOpenInterpolator = paramInterpolator;
}
public void smoothOpenMenu(int paramInt)
{
if ((paramInt >= getFirstVisiblePosition()) && (paramInt <= getLastVisiblePosition()))
{
View localView = getChildAt(paramInt - getFirstVisiblePosition());
if ((localView instanceof SwipeMenuLayout))
{
this.mTouchPosition = paramInt;
if ((this.mTouchView != null) && (this.mTouchView.isOpen()))
this.mTouchView.smoothCloseMenu();
this.mTouchView = ((SwipeMenuLayout)localView);
this.mTouchView.smoothOpenMenu();
}
}
}
public static abstract interface OnMenuItemClickListener
{
public abstract boolean onMenuItemClick(int paramInt1, SwipeMenu paramSwipeMenu, int paramInt2);
}
public static abstract interface OnSwipeListener
{
public abstract void onSwipeEnd(int paramInt);
public abstract void onSwipeStart(int paramInt);
}
}
/* Location: E:\android逆向助手2——2\com.ex.ltech.led_1.9.7_197_dex2jar.jar
* Qualified Name: com.ex.ltech.led.my_view.swipemenulistview.SwipeMenuListView
* JD-Core Version: 0.6.0
*/
|
[
"scofield.hhl@gmail.com"
] |
scofield.hhl@gmail.com
|
2dc0e193db29dacab4327fba25a40b0603a8609b
|
77fb90c41fd2844cc4350400d786df99e14fa4ca
|
/com/google/android/android/internal/zzdck.java
|
fbfdb7a62f29ef56a583eeae01e9723ce4b8b712
|
[] |
no_license
|
highnes7/umaang_decompiled
|
341193b25351188d69b4413ebe7f0cde6525c8fb
|
bcfd90dffe81db012599278928cdcc6207632c56
|
refs/heads/master
| 2020-06-19T07:47:18.630455
| 2019-07-12T17:16:13
| 2019-07-12T17:16:13
| 196,615,053
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,477
|
java
|
package com.google.android.android.internal;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.android.vision.Frame;
import com.google.android.android.vision.Frame.Metadata;
public final class zzdck
extends zzbck
{
public static final Parcelable.Creator<com.google.android.gms.internal.zzdck> CREATOR = new zzdcl();
public int height;
public int id;
public int rotation;
public int width;
public long zzhyv;
public zzdck() {}
public zzdck(int paramInt1, int paramInt2, int paramInt3, long paramLong, int paramInt4)
{
width = paramInt1;
height = paramInt2;
id = paramInt3;
zzhyv = paramLong;
rotation = paramInt4;
}
public static zzdck get(Frame paramFrame)
{
zzdck localZzdck = new zzdck();
width = paramFrame.getMetadata().getWidth();
height = paramFrame.getMetadata().getHeight();
rotation = paramFrame.getMetadata().getRotation();
id = paramFrame.getMetadata().getId();
zzhyv = paramFrame.getMetadata().getTimestampMillis();
return localZzdck;
}
public final void writeToParcel(Parcel paramParcel, int paramInt)
{
paramInt = zzbcn.writeValue(paramParcel);
zzbcn.setCustomVar(paramParcel, 2, width);
zzbcn.setCustomVar(paramParcel, 3, height);
zzbcn.setCustomVar(paramParcel, 4, id);
zzbcn.writeHeader(paramParcel, 5, zzhyv);
zzbcn.setCustomVar(paramParcel, 6, rotation);
zzbcn.zzah(paramParcel, paramInt);
}
}
|
[
"highnes.7@gmail.com"
] |
highnes.7@gmail.com
|
3540bc45648230adba1eb01caf2e8de610291521
|
d736fc72b21e648a287869c0d67e0b1b96cb1475
|
/Ex07Method/src/Student.java
|
71909991f42de555c32a2c4f06d0294371893ece
|
[] |
no_license
|
saythename17/Java
|
6653c2970d60f4e7d415344866ae1490e5be92fd
|
d05a94cc54a98316e0d05140ce4a62ae9573cd0c
|
refs/heads/master
| 2022-12-11T07:05:14.074425
| 2020-08-28T08:43:09
| 2020-08-28T08:43:09
| 290,993,434
| 0
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 509
|
java
|
public class Student {
//filed 정의(멤버 변수, 연관있는 데이터를 저장할수 있는 변수)
String name;
int kor;
int eng;
double aver;
//Method 정의(기능)
void calAverage() {
aver=(double)(kor+eng)/2;
}
void output() {
//class 안 멤버변수(Method 입장에선 전역변수) 사용
System.out.println("이름 : "+name);
System.out.println("국어 : "+kor);
System.out.println("영어 : "+eng);
System.out.println("평균 : "+aver);
System.out.println();}
}
|
[
"zion.h719@gmail.com"
] |
zion.h719@gmail.com
|
6cba67e59b9c68fc46fe7a3b6f88b60463d780e7
|
e4b03112b44193d938be07a7e48e07de9c75ad03
|
/src/main/java/com/tencent/sms/common/intercept/GlobalExceptionHandler.java
|
0b8c15290ea66e63035b076d1b0cd37dc138bb58
|
[
"Apache-2.0"
] |
permissive
|
arraycto/tencent-sms
|
82aa7d8faa9ad6b2b2e07ea9d92a5fa1893a259d
|
b2b256ba97fc090c80af153184c4ea9f8348fab2
|
refs/heads/master
| 2023-02-08T19:46:33.021753
| 2020-12-30T05:57:11
| 2020-12-30T05:57:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,257
|
java
|
package com.tencent.sms.common.intercept;
import com.tencent.sms.common.domain.BusinessException;
import com.tencent.sms.common.domain.CommonErrorCode;
import com.tencent.sms.common.domain.RestResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.lang.Nullable;
import org.springframework.web.HttpMediaTypeNotSupportedException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.NoHandlerFoundException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author yuelimin
* @software IntelliJ IDEA
* @description 异常信息拦截
* @since JDK 8
*/
@ControllerAdvice
public class GlobalExceptionHandler {
private final static Logger LOGGER = LoggerFactory.getLogger(GlobalExceptionHandler.class);
@ExceptionHandler(value = Exception.class)
@ResponseBody
public RestResponse<Nullable> exceptionGet(HttpServletRequest req, HttpServletResponse response, Exception e) {
if (e instanceof BusinessException) {
BusinessException be = (BusinessException) e;
if (CommonErrorCode.CUSTOM.equals(be.getErrorCode())) {
return new RestResponse<Nullable>(be.getErrorCode().getCode(), be.getMessage());
} else {
return new RestResponse<Nullable>(be.getErrorCode().getCode(), be.getErrorCode().getDesc());
}
} else if (e instanceof NoHandlerFoundException) {
return new RestResponse<Nullable>(404, "找不到资源");
} else if (e instanceof HttpRequestMethodNotSupportedException) {
return new RestResponse<Nullable>(405, "method 方法不支持");
} else if (e instanceof HttpMediaTypeNotSupportedException) {
return new RestResponse<Nullable>(415, "不支持媒体类型");
}
LOGGER.error("【系统异常】{}", e);
return new RestResponse<Nullable>(CommonErrorCode.UNKNOWN.getCode(), CommonErrorCode.UNKNOWN.getDesc());
}
}
|
[
"yueliminvc@outlook.com"
] |
yueliminvc@outlook.com
|
6cf2c060660d857a553ca0c37ddd998f50aafc3f
|
9573f936174ccbcda704e1b83d596a3f093f727c
|
/OPERAcraft New/temp/src/minecraft/net/minecraft/src/BlockEndPortal.java
|
9e92cd039a065c211e91ae39b100c3de5b84e0d2
|
[] |
no_license
|
operacraft/Minecraft
|
17466d8538be6253f4d689926d177614c6accf5b
|
89c4012b11cf5fa118cd5e63b0f51d03ee1ddc09
|
refs/heads/master
| 2021-01-10T05:54:10.056575
| 2016-02-24T15:54:29
| 2016-02-24T15:54:49
| 51,405,369
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,989
|
java
|
package net.minecraft.src;
import java.util.List;
import java.util.Random;
import net.minecraft.src.AxisAlignedBB;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.Entity;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.IconRegister;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntityEndPortal;
import net.minecraft.src.World;
public class BlockEndPortal extends BlockContainer {
public static boolean field_72275_a = false;
protected BlockEndPortal(int p_i4003_1_, Material p_i4003_2_) {
super(p_i4003_1_, p_i4003_2_);
this.func_71900_a(1.0F);
}
public TileEntity func_72274_a(World p_72274_1_) {
return new TileEntityEndPortal();
}
public void func_71902_a(IBlockAccess p_71902_1_, int p_71902_2_, int p_71902_3_, int p_71902_4_) {
float var5 = 0.0625F;
this.func_71905_a(0.0F, 0.0F, 0.0F, 1.0F, var5, 1.0F);
}
public boolean func_71877_c(IBlockAccess p_71877_1_, int p_71877_2_, int p_71877_3_, int p_71877_4_, int p_71877_5_) {
return p_71877_5_ != 0?false:super.func_71877_c(p_71877_1_, p_71877_2_, p_71877_3_, p_71877_4_, p_71877_5_);
}
public void func_71871_a(World p_71871_1_, int p_71871_2_, int p_71871_3_, int p_71871_4_, AxisAlignedBB p_71871_5_, List p_71871_6_, Entity p_71871_7_) {}
public boolean func_71926_d() {
return false;
}
public boolean func_71886_c() {
return false;
}
public int func_71925_a(Random p_71925_1_) {
return 0;
}
public void func_71869_a(World p_71869_1_, int p_71869_2_, int p_71869_3_, int p_71869_4_, Entity p_71869_5_) {
if(p_71869_5_.field_70154_o == null && p_71869_5_.field_70153_n == null && !p_71869_1_.field_72995_K) {
p_71869_5_.func_71027_c(1);
}
}
public void func_71862_a(World p_71862_1_, int p_71862_2_, int p_71862_3_, int p_71862_4_, Random p_71862_5_) {
double var6 = (double)((float)p_71862_2_ + p_71862_5_.nextFloat());
double var8 = (double)((float)p_71862_3_ + 0.8F);
double var10 = (double)((float)p_71862_4_ + p_71862_5_.nextFloat());
double var12 = 0.0D;
double var14 = 0.0D;
double var16 = 0.0D;
p_71862_1_.func_72869_a("smoke", var6, var8, var10, var12, var14, var16);
}
public int func_71857_b() {
return -1;
}
public void func_71861_g(World p_71861_1_, int p_71861_2_, int p_71861_3_, int p_71861_4_) {
if(!field_72275_a) {
if(p_71861_1_.field_73011_w.field_76574_g != 0) {
p_71861_1_.func_94571_i(p_71861_2_, p_71861_3_, p_71861_4_);
}
}
}
public int func_71922_a(World p_71922_1_, int p_71922_2_, int p_71922_3_, int p_71922_4_) {
return 0;
}
public void func_94332_a(IconRegister p_94332_1_) {
this.field_94336_cN = p_94332_1_.func_94245_a("portal");
}
}
|
[
"operacraft@googlegroups.com"
] |
operacraft@googlegroups.com
|
e4e4af4c993f99927ded7f6953b226a222a16f50
|
5095b037518edb145fbecbe391fd14757f16c9b9
|
/gameserver/src/main/java/l2s/gameserver/skills/effects/EffectThrowHorizontal.java
|
bc70ca8b196874b35bb5eba1119e7d2c039b2e8b
|
[] |
no_license
|
merlin-tribukait/lindvior
|
ce7da0da95c3367b05e0230379411f3544f4d9f3
|
21a3138a43cc03c7d6b8922054b4663db8e63a49
|
refs/heads/master
| 2021-05-28T20:58:13.697507
| 2014-10-09T15:58:04
| 2014-10-09T15:58:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,261
|
java
|
package l2s.gameserver.skills.effects;
import l2s.gameserver.model.Player;
import l2s.gameserver.model.entity.events.impl.SiegeEvent;
import l2s.gameserver.model.instances.SummonInstance;
import l2s.gameserver.network.l2.components.SystemMsg;
import l2s.gameserver.network.l2.s2c.FlyToLocation;
import l2s.gameserver.network.l2.s2c.FlyToLocation.FlyType;
import l2s.gameserver.stats.Env;
import l2s.gameserver.templates.skill.EffectTemplate;
import l2s.gameserver.utils.Location;
/**
* @author Bonux
**/
public class EffectThrowHorizontal extends EffectFlyAbstract
{
private Location _flyLoc = null;
public EffectThrowHorizontal(Env env, EffectTemplate template)
{
super(env, template);
}
@Override
public boolean checkCondition()
{
if(getEffected().isThrowAndKnockImmune())
{
getEffected().sendPacket(SystemMsg.THAT_IS_AN_INCORRECT_TARGET);
return false;
}
// Тычок/отброс нельзя наложить на осадных саммонов
Player player = getEffected().getPlayer();
if(player != null)
{
SiegeEvent<?, ?> siegeEvent = player.getEvent(SiegeEvent.class);
if(getEffected().isSummon() && siegeEvent != null && siegeEvent.containsSiegeSummon((SummonInstance) getEffected()))
{
getEffector().sendPacket(SystemMsg.THAT_IS_AN_INCORRECT_TARGET);
return false;
}
}
if(getEffected().isInZonePeace())
{
getEffector().sendPacket(SystemMsg.YOU_MAY_NOT_ATTACK_IN_A_PEACEFUL_ZONE);
return false;
}
_flyLoc = getEffected().getFlyLocation(_effector, getSkill());
if(_flyLoc == null)
return false;
return true;
}
@Override
public void onStart()
{
getEffected().abortAttack(true, true);
getEffected().abortCast(true, true);
getEffected().stopMove();
getEffected().block();
getEffected().broadcastPacket(new FlyToLocation(getEffected(), _flyLoc, FlyType.THROW_HORIZONTAL, getFlySpeed(), getFlyDelay(), getFlyAnimationSpeed()));
getEffected().setLoc(_flyLoc);
getEffected().validateLocation(1);
super.onStart();
}
@Override
public void onExit()
{
getEffected().unblock();
super.onExit();
}
@Override
public boolean onActionTime()
{
return false;
}
}
|
[
"namlehong@gmail.com"
] |
namlehong@gmail.com
|
b88f070f20d35a1f642c6611aeff4291c1b3f616
|
070b9e745c5aad76fb310f5c9111ed77a1036291
|
/Drona-Package/com/bumptech/glide/load/data/BufferedOutputStream.java
|
cd7e8fb85189b3105eb34b232d501d9c656a02fd
|
[] |
no_license
|
Drona-team/Drona
|
0f057e62e7f77babf112311734ee98c5824f166c
|
e33a9d92011ef7790c7547cc5a5380083f0dbcd7
|
refs/heads/master
| 2022-11-18T06:38:57.404528
| 2020-07-18T09:35:57
| 2020-07-18T09:35:57
| 280,390,561
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,368
|
java
|
package com.bumptech.glide.load.data;
import androidx.annotation.NonNull;
import com.bumptech.glide.load.engine.bitmap_recycle.ArrayPool;
import java.io.IOException;
import java.io.OutputStream;
public final class BufferedOutputStream
extends OutputStream
{
private ArrayPool arrayPool;
private byte[] buffer;
private int index;
@NonNull
private final OutputStream out;
public BufferedOutputStream(OutputStream paramOutputStream, ArrayPool paramArrayPool)
{
this(paramOutputStream, paramArrayPool, 65536);
}
BufferedOutputStream(OutputStream paramOutputStream, ArrayPool paramArrayPool, int paramInt)
{
out = paramOutputStream;
arrayPool = paramArrayPool;
buffer = ((byte[])paramArrayPool.w(paramInt, [B.class));
}
private void flushBuffer()
throws IOException
{
if (index > 0)
{
out.write(buffer, 0, index);
index = 0;
}
}
private void maybeFlushBuffer()
throws IOException
{
if (index == buffer.length) {
flushBuffer();
}
}
private void release()
{
if (buffer != null)
{
arrayPool.put(buffer);
buffer = null;
}
}
public void close()
throws IOException
{
try
{
flush();
out.close();
release();
return;
}
catch (Throwable localThrowable)
{
out.close();
throw localThrowable;
}
}
public void flush()
throws IOException
{
flushBuffer();
out.flush();
}
public void write(int paramInt)
throws IOException
{
byte[] arrayOfByte = buffer;
int i = index;
index = (i + 1);
arrayOfByte[i] = ((byte)paramInt);
maybeFlushBuffer();
}
public void write(byte[] paramArrayOfByte)
throws IOException
{
write(paramArrayOfByte, 0, paramArrayOfByte.length);
}
public void write(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
throws IOException
{
int i = 0;
int j;
do
{
int k = paramInt2 - i;
j = paramInt1 + i;
if ((index == 0) && (k >= buffer.length))
{
out.write(paramArrayOfByte, j, k);
return;
}
k = Math.min(k, buffer.length - index);
System.arraycopy(paramArrayOfByte, j, buffer, index, k);
index += k;
j = i + k;
maybeFlushBuffer();
i = j;
} while (j < paramInt2);
}
}
|
[
"samridh6759@gmail.com"
] |
samridh6759@gmail.com
|
8641effbbc254041512f03d5034609bd455b0832
|
aa9b39c681f65079d36d072abfb43a12dc686efa
|
/jsoagger-jfxcore-engine/src/main/java/io/github/jsoagger/jfxcore/components/actions/ModelByOidDoActionAndUpdateCurrentSCHandler.java
|
6cd5b1ddcb7248c904cc479b7ab4b0f84b0f3d87
|
[
"Apache-2.0"
] |
permissive
|
HuyaAuto/jsoagger-fx
|
1da426f4bbd864fcc302b472c94db1dc4a2ef2cd
|
97012d09e58ea2486c68762f121dc9fcd52e5e9d
|
refs/heads/master
| 2023-04-18T06:12:09.741134
| 2020-04-25T12:03:14
| 2020-04-25T12:03:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,951
|
java
|
/*-
* ========================LICENSE_START=================================
* JSoagger
* %%
* Copyright (C) 2019 JSOAGGER
* %%
* 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.
* =========================LICENSE_END==================================
*/
package io.github.jsoagger.jfxcore.components.actions;
import java.util.Optional;
import io.github.jsoagger.jfxcore.engine.client.apiimpl.AbstractAction;
import io.github.jsoagger.jfxcore.engine.client.apiimpl.ActionResult;
import io.github.jsoagger.core.bridge.operation.IOperation;
import io.github.jsoagger.core.bridge.operation.IOperationResult;
import io.github.jsoagger.core.bridge.result.OperationData;
import io.github.jsoagger.core.bridge.result.SingleResult;
import io.github.jsoagger.jfxcore.api.IAction;
import io.github.jsoagger.jfxcore.api.IActionRequest;
import io.github.jsoagger.jfxcore.api.IActionResult;
import io.github.jsoagger.jfxcore.engine.components.dialog.impl.ErrorDialog;
import io.github.jsoagger.jfxcore.engine.controller.AbstractViewController;
import io.github.jsoagger.jfxcore.engine.controller.roostructure.content.event.PushStructureContentEvent;
import com.google.gson.JsonObject;
/**
* Execute referenced action on the controller model.
* <p>
* If the action is success, forward model to given view. The current view will still in list of
* visited view. This means that if the user clicks to back action, the current view is diplayed.
* <p>
*
* @author Ramilafananana VONJISOA
*
*/
public class ModelByOidDoActionAndUpdateCurrentSCHandler extends AbstractAction implements IAction {
protected AbstractViewController controller;
protected String viewId;
/**
* Default Constructor
*/
public ModelByOidDoActionAndUpdateCurrentSCHandler() {}
/**
* @{inheritedDoc}
*/
@Override
public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) {
this.controller = (AbstractViewController) actionRequest.getController();
this.viewId = (String) actionRequest.getProperty("viewId");
try {
IOperation operation = getOperation(actionRequest);
if (operation != null) {
JsonObject query = new JsonObject();
query.addProperty("fullId", this.controller.getModelFullId());
operation.doOperation(query, r -> handleResult(r, actionRequest), this::handleException);
}
} catch (Exception e) {
e.printStackTrace();
ErrorDialog d = new ErrorDialog.Builder().message("Error").title("Error").buildAccent(controller);
d.show();
}
}
protected void handleResult(IOperationResult r, IActionRequest actionRequest) {
if (r.hasBusinessError()) {
resultProperty.set(ActionResult.error());
ErrorDialog d = new ErrorDialog.Builder().message(r.getMessages().get(0).getDetail()).title("Error").buildAccent(controller);
d.show();
} else {
resultProperty.set(ActionResult.success());
SingleResult sr = (SingleResult) r;
forwardToViewAction(sr.getData(), isForwardAndReplaceView(actionRequest));
}
}
protected void handleException(Throwable ex) {
resultProperty.set(ActionResult.error());
ex.printStackTrace();
ErrorDialog d = new ErrorDialog.Builder().message(ex.getMessage()).title("Error").buildAccent(controller);
d.show();
}
public void forwardToViewAction(OperationData operationData, boolean replaceCurrentView) {
PushStructureContentEvent ev =
new PushStructureContentEvent.Builder().viewId(viewId).modelFullId((String) operationData.getAttributes().get("fullId")).model(operationData).replace(replaceCurrentView).build();
controller.dispatchEvent(ev);
}
/**
* @{inheritedDoc}
*/
@Override
public String getId() {
return "ModelByOidDoActionAndForwardToViewHandler";
}
/**
* Getter of controller
*
* @return the controller
*/
public AbstractViewController getController() {
return controller;
}
/**
* Setter of controller
*
* @param controller the controller to set
*/
public void setController(AbstractViewController controller) {
this.controller = controller;
}
/**
* Getter of viewId
*
* @return the viewId
*/
public String getRedirectToView() {
return viewId;
}
/**
* Setter of viewId
*
* @param viewId the viewId to set
*/
public void setRedirectToView(String viewId) {
this.viewId = viewId;
}
}
|
[
"rmvonji@gmail.com"
] |
rmvonji@gmail.com
|
524f3a52f581a6afd159d8751a9e61d56a8426be
|
fd8fadf30b2e357c1f432a303115ce5bf30ff57c
|
/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
|
29bb5e77670d2b7fe15d084ff1b3521a348e7d9a
|
[] |
no_license
|
lixinlin/plantuml-code
|
6642e452ae8e6834942593a7ecd42f44418b8b6b
|
f558a8ec50f9ec617528dede774c3f46f1aac5ae
|
refs/heads/master
| 2021-06-28T02:24:29.085869
| 2019-09-22T11:20:25
| 2019-09-22T11:20:25
| 214,447,468
| 0
| 0
| null | 2021-02-03T19:33:31
| 2019-10-11T13:45:25
|
Java
|
UTF-8
|
Java
| false
| false
| 7,334
|
java
|
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* 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.graphic;
import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.Shadowable;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public class USymbolFolder extends USymbol {
private final static int marginTitleX1 = 3;
private final static int marginTitleX2 = 3;
private final static int marginTitleX3 = 7;
private final static int marginTitleY0 = 0;
private final static int marginTitleY1 = 3;
private final static int marginTitleY2 = 3;
private final SkinParameter skinParameter;
private final boolean showTitle;
public USymbolFolder(SkinParameter skinParameter, boolean showTitle) {
this.skinParameter = skinParameter;
this.showTitle = showTitle;
}
@Override
public SkinParameter getSkinParameter() {
return skinParameter;
}
private void drawFolder(UGraphic ug, double width, double height, Dimension2D dimTitle, boolean shadowing,
double roundCorner) {
final double wtitle;
if (dimTitle.getWidth() == 0) {
wtitle = Math.max(30, width / 4);
} else {
wtitle = dimTitle.getWidth() + marginTitleX1 + marginTitleX2;
}
final double htitle = getHTitle(dimTitle);
final Shadowable shape;
if (roundCorner == 0) {
final UPolygon poly = new UPolygon();
poly.addPoint(0, 0);
poly.addPoint(wtitle, 0);
poly.addPoint(wtitle + marginTitleX3, htitle);
poly.addPoint(width, htitle);
poly.addPoint(width, height);
poly.addPoint(0, height);
poly.addPoint(0, 0);
shape = poly;
} else {
final UPath path = new UPath();
path.moveTo(roundCorner / 2, 0);
path.lineTo(wtitle - roundCorner / 2, 0);
// path.lineTo(wtitle, roundCorner / 2);
path.arcTo(new Point2D.Double(wtitle, roundCorner / 2), roundCorner / 2 * 1.5, 0, 1);
path.lineTo(wtitle + marginTitleX3, htitle);
path.lineTo(width - roundCorner / 2, htitle);
path.arcTo(new Point2D.Double(width, htitle + roundCorner / 2), roundCorner / 2, 0, 1);
path.lineTo(width, height - roundCorner / 2);
path.arcTo(new Point2D.Double(width - roundCorner / 2, height), roundCorner / 2, 0, 1);
path.lineTo(roundCorner / 2, height);
path.arcTo(new Point2D.Double(0, height - roundCorner / 2), roundCorner / 2, 0, 1);
path.lineTo(0, roundCorner / 2);
path.arcTo(new Point2D.Double(roundCorner / 2, 0), roundCorner / 2, 0, 1);
path.closePath();
shape = path;
}
if (shadowing) {
shape.setDeltaShadow(3.0);
}
ug.draw(shape);
ug.apply(new UTranslate(0, htitle)).draw(new ULine(wtitle + marginTitleX3, 0));
}
private double getHTitle(Dimension2D dimTitle) {
final double htitle;
if (dimTitle.getWidth() == 0) {
htitle = 10;
} else {
htitle = dimTitle.getHeight() + marginTitleY1 + marginTitleY2;
}
return htitle;
}
private Margin getMargin() {
return new Margin(10, 10 + 10, 10 + 3, 10);
}
@Override
public TextBlock asSmall(final TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) {
if (name == null) {
throw new IllegalArgumentException();
}
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke());
ug = symbolContext.apply(ug);
final Dimension2D dimName = showTitle ? name.calculateDimension(ug.getStringBounder())
: new Dimension2DDouble(40, 15);
drawFolder(ug, dim.getWidth(), dim.getHeight(), dimName, symbolContext.isShadowing(),
symbolContext.getRoundCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
if (showTitle) {
name.drawU(ug.apply(new UTranslate(4, 3)));
}
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1() + dimName.getHeight())));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
final Dimension2D dimName = name.calculateDimension(stringBounder);
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder);
return getMargin().addDimension(Dimension2DDouble.mergeTB(dimName, dimStereo, dimLabel));
}
};
}
@Override
public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
final double width, final double height, final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D dim = calculateDimension(stringBounder);
ug = symbolContext.apply(ug);
final Dimension2D dimTitle = title.calculateDimension(stringBounder);
drawFolder(ug, dim.getWidth(), dim.getHeight(), dimTitle, symbolContext.isShadowing(),
symbolContext.getRoundCorner());
title.drawU(ug.apply(new UTranslate(4, 2)));
final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder);
final double posStereo = (width - dimStereo.getWidth()) / 2;
stereotype.drawU(ug.apply(new UTranslate(4 + posStereo, 2 + getHTitle(dimTitle))));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
return new Dimension2DDouble(width, height);
}
};
}
@Override
public boolean manageHorizontalLine() {
return true;
}
}
|
[
"arnaud_roques@2bfd43ce-aac2-44f9-bcbc-61bf0d4e0ab5"
] |
arnaud_roques@2bfd43ce-aac2-44f9-bcbc-61bf0d4e0ab5
|
33a8b192992899a96fe21d9ea4b01f145bf04c88
|
20eb62855cb3962c2d36fda4377dfd47d82eb777
|
/IntroClassJava/dataset/smallest/c9d718f379a877bd04e4544ee830a1c4c256bb4f104f214afd1ccaf81e7b25dea689895678bb1e6f817d8b0939eb175f8e847130f30a9a22e980d38125933516/000/mutations/358/smallest_c9d718f3_000.java
|
ef84c8bc93dbd85603417ad9ed23682495428073
|
[] |
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
| 2,435
|
java
|
package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class smallest_c9d718f3_000 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
smallest_c9d718f3_000 mainClass = new smallest_c9d718f3_000 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
DoubleObj num1 = new DoubleObj (), num2 = new DoubleObj (), num3 =
new DoubleObj (), num4 = new DoubleObj ();
output +=
(String.format ("Please enter 4 numbers separated by spaces > "));
num1.value = scanner.nextDouble ();
num2.value = scanner.nextDouble ();
num3.value = scanner.nextDouble ();
num4.value = scanner.nextDouble ();
if (((num2.value) < (num1.value)) && ((num2.value) < (num3.value))) {
output += (String.format ("%.0f is the smallest\n", num1.value));
}
if (num2.value < num1.value && num2.value < num3.value
&& num2.value < num4.value) {
output += (String.format ("%.0f is the smallest\n", num2.value));
}
if (num3.value < num1.value && num3.value < num2.value
&& num3.value < num4.value) {
output += (String.format ("%.0f is the smallest\n", num3.value));
}
if (num4.value < num1.value && num4.value < num2.value
&& num4.value < num4.value) {
output += (String.format ("%.0f is the smallest\n", num4.value));
}
if (true)
return;;
}
}
|
[
"justinwm@163.com"
] |
justinwm@163.com
|
fc40407952d7a5dc10ee3bde3e287e4fb9dc67bd
|
15c72dbfe0bb7320f4f6f32f370b30e99d31ed23
|
/app/src/main/java/cube/ware/ui/chat/panel/input/EllipsizedTextView.java
|
06da7269fd51bb1fac2a59f128e508438aec0658
|
[
"MIT"
] |
permissive
|
yukunkun/CubeWare-Android
|
671c18be72924b2c993853f2a09cc73ff1c01233
|
d15c546db8d187dc77d90128a346c396d9861648
|
refs/heads/master
| 2022-03-30T14:17:08.892774
| 2019-05-29T06:06:37
| 2019-05-29T06:06:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,997
|
java
|
package cube.ware.ui.chat.panel.input;
/**
* @author CloudZhang
* @date 2018/1/29 11:13
*/
import android.content.Context;
import android.util.AttributeSet;
/**
* 超过一定行数显示固定行数时末尾添加 "..."的TextView(适配图文混排)
*/
public class EllipsizedTextView extends android.support.v7.widget.AppCompatTextView {
private int mMaxLines;
public EllipsizedTextView(Context context) {
this(context, null);
}
public EllipsizedTextView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public EllipsizedTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mMaxLines = 1;
}
public void setMyText(CharSequence text, int measuredWidth) {
setSingleLine();//默认单行
//sp2px(getContext(), textsize) 单个中文的宽度,sp转换成px适应不同手机
int textWidth = sp2px(getContext(), 14) * (getChineseNums(text.toString()) + (getNoChineseNums(text.toString()) + 1) / 2);
int tempWidth = 0;
int n = measuredWidth / sp2px(getContext(), 14);
char[] chars = text.toString().toCharArray();
for (int i = 0; i < chars.length; i++) {
char aChar = chars[i];
tempWidth += sp2px(getContext(), 7) * (isChinese(aChar) ? 2 : 1);
if (tempWidth > measuredWidth) {
n = i - 2;
break;
}
}
if (textWidth > measuredWidth) {
if (n - 1 < text.length()) {
setText(text.toString().substring(0, n - 1) + "...");
}
else {
setText(text);
}
}
else {
setText(text);
}
}
public String getAdaptString(String text, int measuredWidth){
//sp2px(getContext(), textsize) 单个中文的宽度,sp转换成px适应不同手机
int textWidth = sp2px(getContext(), 14) * (getChineseNums(text.toString()) + (getNoChineseNums(text.toString()) + 1) / 2);
int tempWidth = 0;
int n = measuredWidth / sp2px(getContext(), 14);
char[] chars = text.toString().toCharArray();
for (int i = 0; i < chars.length; i++) {
char aChar = chars[i];
tempWidth += sp2px(getContext(), 7) * (isChinese(aChar) ? 2 : 1);
if (tempWidth > measuredWidth) {
n = i - 2;
break;
}
}
if (textWidth > measuredWidth) {
if (n - 1 < text.length()) {
return text.toString().substring(0, n - 1) + "...";
}
}
return text.toString();
}
public static boolean isChinese(char c) {
return c >= 0x4E00 && c <= 0x9FA5;// 根据字节码判断
}
/**
* 字符串中,中文的字数
*
* @param str
*
* @return
*/
private int getChineseNums(String str) {
int byteLength = str.getBytes().length;
int strLength = str.length();
return (byteLength - strLength) / 2;
}
/**
* 字符串中,非中文的字数
*
* @param str
*
* @return
*/
private int getNoChineseNums(String str) {
int byteLength = str.getBytes().length;
int strLength = str.length();
return strLength - (byteLength - strLength) / 2;
}
/**
* 将sp值转换为px值,保证文字大小不变
*
* @param spValue (DisplayMetrics类中属性scaledDensity)
*
* @return
*/
public static int sp2px(Context context, float spValue) {
final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
return (int) (spValue * fontScale + 0.5f);
}
@Override
public int getMaxLines() {
return mMaxLines;
}
@Override
public void setMaxLines(int maxLines) {
super.setMaxLines(maxLines);
mMaxLines = maxLines;
}
}
|
[
"120146859@qq.com"
] |
120146859@qq.com
|
31bdf8b7236f9d978a0c33b66d86ac2ce7c8b65b
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/CHART-13b-5-23-FEMO-WeightedSum:TestLen:CallDiversity/org/jfree/chart/block/BorderArrangement_ESTest.java
|
7cc00000780eb286c665ffcfcb142fa41895a5e1
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 568
|
java
|
/*
* This file was automatically generated by EvoSuite
* Mon Jan 20 12:51:52 GMT+00:00 2020
*/
package org.jfree.chart.block;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class BorderArrangement_ESTest extends BorderArrangement_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
1b8c17cd517ddf65baf277fe7da3c0cd6ac4438c
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Chart/24/org/jfree/chart/entity/PieSectionEntity_setSectionIndex_161.java
|
f9b8b3c203a02acb5db6aa9f782deb565cf59a8e
|
[] |
no_license
|
hvdthong/NetML
|
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
|
9bb103da21327912e5a29cbf9be9ff4d058731a5
|
refs/heads/master
| 2021-06-30T15:03:52.618255
| 2020-10-07T01:58:48
| 2020-10-07T01:58:48
| 150,383,588
| 1
| 1
| null | 2018-09-26T07:08:45
| 2018-09-26T07:08:44
| null |
UTF-8
|
Java
| false
| false
| 418
|
java
|
org jfree chart entiti
chart entiti repres section pie plot
pie section entiti piesectionent chart entiti chartent
set section index
param index section index
set section index setsectionindex index
section index sectionindex index
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
8731ed2f3313a32ec3d9f4a1020f278d300cc9f5
|
5eae683a6df0c4b97ab1ebcd4724a4bf062c1889
|
/bin/platform/bootstrap/gensrc/de/hybris/platform/commercewebservicescommons/dto/order/CartModificationListWsDTO.java
|
ad92523c0ae83e89e3720f4fd61014b890b3b224
|
[] |
no_license
|
sujanrimal/GiftCardProject
|
1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb
|
e0398eec9f4ec436d20764898a0255f32aac3d0c
|
refs/heads/master
| 2020-12-11T18:05:17.413472
| 2020-01-17T18:23:44
| 2020-01-17T18:23:44
| 233,911,127
| 0
| 0
| null | 2020-06-18T15:26:11
| 2020-01-14T18:44:18
| null |
UTF-8
|
Java
| false
| false
| 1,545
|
java
|
/*
* ----------------------------------------------------------------
* --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN!
* --- Generated at Jan 17, 2020 11:49:28 AM
* ----------------------------------------------------------------
*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package de.hybris.platform.commercewebservicescommons.dto.order;
import java.io.Serializable;
import de.hybris.platform.commercewebservicescommons.dto.order.CartModificationWsDTO;
import java.util.List;
public class CartModificationListWsDTO implements Serializable
{
/** Default serialVersionUID value. */
private static final long serialVersionUID = 1L;
/** <i>Generated property</i> for <code>CartModificationListWsDTO.cartModifications</code> property defined at extension <code>commercewebservicescommons</code>. */
private List<CartModificationWsDTO> cartModifications;
public CartModificationListWsDTO()
{
// default constructor
}
public void setCartModifications(final List<CartModificationWsDTO> cartModifications)
{
this.cartModifications = cartModifications;
}
public List<CartModificationWsDTO> getCartModifications()
{
return cartModifications;
}
}
|
[
"travis.d.crawford@accenture.com"
] |
travis.d.crawford@accenture.com
|
80691495057b00c067ec7636b0958f34aea8664e
|
a4a51084cfb715c7076c810520542af38a854868
|
/src/main/java/com/shopee/app/ui/chat/cell/c.java
|
b14889576252ab342cd366b16eae2d831eff10fa
|
[] |
no_license
|
BharathPalanivelu/repotest
|
ddaf56a94eb52867408e0e769f35bef2d815da72
|
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
|
refs/heads/master
| 2020-09-30T18:55:04.802341
| 2019-12-02T10:52:08
| 2019-12-02T10:52:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,742
|
java
|
package com.shopee.app.ui.chat.cell;
import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import com.shopee.id.R;
import org.a.a.b.a;
import org.a.a.b.b;
public final class c extends b implements a, b {
/* renamed from: g reason: collision with root package name */
private boolean f20081g = false;
private final org.a.a.b.c h = new org.a.a.b.c();
public c(Context context) {
super(context);
c();
}
public static b a(Context context) {
c cVar = new c(context);
cVar.onFinishInflate();
return cVar;
}
public void onFinishInflate() {
if (!this.f20081g) {
this.f20081g = true;
inflate(getContext(), R.layout.chat_chat_order_item_layout, this);
this.h.a((a) this);
}
super.onFinishInflate();
}
private void c() {
org.a.a.b.c a2 = org.a.a.b.c.a(this.h);
org.a.a.b.c.a((b) this);
this.f20075a = androidx.core.content.b.c(getContext(), R.color.white);
this.f20076b = androidx.core.content.b.c(getContext(), R.color.black87);
org.a.a.b.c.a(a2);
}
public <T extends View> T internalFindViewById(int i) {
return findViewById(i);
}
public void onViewChanged(a aVar) {
this.f20077c = (ImageView) aVar.internalFindViewById(R.id.icon);
this.f20078d = (Button) aVar.internalFindViewById(R.id.goto_cart);
if (this.f20078d != null) {
this.f20078d.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
c.this.b();
}
});
}
a();
}
}
|
[
"noiz354@gmail.com"
] |
noiz354@gmail.com
|
208c06b063523395312759e22d678c362e2f90ca
|
4cf85792f1be8a3a910c7959998a9d8c95c2122f
|
/faculty_service/src/main/java/sv/iuh/faculty_service/service/FacultyService.java
|
a3d3a470f37becb5db5fd8b32bf77b1f097ecbf4
|
[] |
no_license
|
TuanKhang-KTMT/18040321_letuankhang_exam
|
ef0da0e07297750ce628bd5e24633717f0bd921a
|
83ab2eb33e256847999c52baff8131461363da3b
|
refs/heads/main
| 2023-09-05T00:33:26.698562
| 2021-11-01T12:08:46
| 2021-11-01T12:08:46
| 423,441,425
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 636
|
java
|
package sv.iuh.faculty_service.service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sv.iuh.faculty_service.entity.Faculty;
import sv.iuh.faculty_service.repository.FacultyRepository;
@Service
@Slf4j
//@RequiredArgsConstructor
public class FacultyService {
@Autowired
private FacultyRepository facultyRepository;
public Faculty saveFaculty(Faculty faculty) {
return facultyRepository.save(faculty);
}
public Faculty findById(Long id) {
return facultyRepository.findById(id).get();
}
}
|
[
"you@example.com"
] |
you@example.com
|
1d7706d35471db19f78f573b97d2e4bed7c68f5a
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/XWIKI-12798-91-29-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/com/xpn/xwiki/api/XWiki_ESTest.java
|
f9e330b1fc58d143ed067b7b5af1bd5f701b0075
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 534
|
java
|
/*
* This file was automatically generated by EvoSuite
* Mon Apr 06 22:17:58 UTC 2020
*/
package com.xpn.xwiki.api;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class XWiki_ESTest extends XWiki_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
51c15d4b0be5cd2b3c6313299d8dc02929417380
|
9683569af72561f725e77977929ea7b57897ab64
|
/Java-master/JavaTest/src/test1/JavaTest10.java
|
d022530583ff83fa725ad8e8f1a7f85abc6c0d24
|
[] |
no_license
|
HJCHOI910828/emergency
|
61da559ccbfad7e78548f15f1c02c2736bd83148
|
331d9ffa2fe5cf7fd2383cfb8fa44402368c9694
|
refs/heads/master
| 2023-06-26T20:41:34.006819
| 2021-07-30T06:25:23
| 2021-07-30T06:25:23
| 390,955,121
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 312
|
java
|
package test1;
public class JavaTest10 {
public static void main(String[] args) {
int n1 = 1;
int n2 = 2;
int n3;
System.out.print(n1+", ");
System.out.print(n2+", ");
for(int i=1 ; i<=10 ; i++) {
n3 = n1 + n2;
System.out.print(n3+", ");
n1 = n2;
n2 = n3;
}
}
}
|
[
"hungry44therock@gmail.com"
] |
hungry44therock@gmail.com
|
1d0003abb33a2a63b3de396075e0c36879ac53ad
|
7ced4b8259a5d171413847e3e072226c7a5ee3d2
|
/Workspace/PEP-IP/BinaryTree/vertexCover.java
|
b79eeb32eacf5d8ec5328dcc1c314ca57094122a
|
[] |
no_license
|
tanishq9/Data-Structures-and-Algorithms
|
8d4df6c8a964066988bcf5af68f21387a132cd4d
|
f6f5dec38d5e2d207fb29ad4716a83553924077a
|
refs/heads/master
| 2022-12-13T03:57:39.447650
| 2020-09-05T13:16:55
| 2020-09-05T13:16:55
| 119,425,479
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,424
|
java
|
package BinaryTree;
import java.util.HashMap;
public class vertexCover {
public static class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) {
val = x;
left = null;
right = null;
}
// No need to override hashCode and equals
public boolean equals(Object obj) {
TreeNode o = (TreeNode) obj;
if (this.left == o.left && this.right == o.right) {
return true;
} else {
return false;
}
}
}
// This is a functional problem. You have to complete this function.
// It takes as input the root of the given tree. It should return the minimum
// number of cameras required.
public static int minCameraCover(TreeNode root) {
// write your code here
HashMap<TreeNode, Integer> map = new HashMap<>();
return count(root, map);
}
static int count(TreeNode root, HashMap<TreeNode, Integer> map) {
if (root == null) {
return 0;
}
if (root.left == null && root.right == null) {
return 0;
}
if (map.containsKey(root)) {
return map.get(root);
}
// +1 isliye kyuki ek khudka bhi toh lagega
int f1 = 1 + count(root.left, map) + count(root.right, map);
int f2 = 0;
if (root.left != null) {
f2 += 1 + count(root.left.left, map) + count(root.left.right, map);
}
if (root.right != null) {
f2 += 1 + count(root.right.left, map) + count(root.right.right, map);
}
int f = Math.min(f1, f2);
map.put(root, f);
return f;
}
}
|
[
"tanishqsaluja18@gmail.com"
] |
tanishqsaluja18@gmail.com
|
035bf2bdeacf38a7769b5fd2ecebe665812a269e
|
2989a983c67c90a88a19755a709913acfc01687f
|
/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/test/java/org/kie/workbench/common/stunner/bpmn/backend/query/FindBpmnProcessIdsQueryTest.java
|
9e66f6a8512f9d4d2de84a8352787a725690eda7
|
[
"Apache-2.0"
] |
permissive
|
adrielparedes/kie-wb-common
|
bdf15b7b3ccf567ef5791bce69993c148c9cecf1
|
5ad3a677600b1e6a593e5e663ef2ed5fa7ecdf3a
|
refs/heads/master
| 2021-07-18T21:55:58.726217
| 2019-10-01T14:28:42
| 2019-10-01T14:28:42
| 68,020,127
| 0
| 0
|
Apache-2.0
| 2019-08-01T14:49:03
| 2016-09-12T15:09:12
|
Java
|
UTF-8
|
Java
| false
| false
| 1,109
|
java
|
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
* 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.kie.workbench.common.stunner.bpmn.backend.query;
import org.junit.Test;
import org.kie.workbench.common.services.refactoring.service.ResourceType;
import static org.junit.Assert.assertEquals;
public class FindBpmnProcessIdsQueryTest {
private FindBpmnProcessIdsQuery tested = new FindBpmnProcessIdsQuery();
@Test
public void testGetProcessIdResourceType() throws Exception {
assertEquals(tested.getProcessIdResourceType(), ResourceType.BPMN2);
}
}
|
[
"roger600@gmail.com"
] |
roger600@gmail.com
|
19bd7500d3181ccfe1acc3db76111f3020fc2a56
|
7707b1d1d63198e86a0b8a7ae27c00e2f27a8831
|
/tests/com.netxforge.netxstudio.common.tests/src/com/netxforge/netxstudio/common/tests/JCATest.java
|
e342b8e8a0e02660b219d5bc6d67c9f97448dce1
|
[] |
no_license
|
dzonekl/netxstudio
|
20535f66e5bbecd1cdd9c55a4d691fc48a1a83aa
|
f12c118b1ef08fe770e5ac29828653a93fea9352
|
refs/heads/master
| 2016-08-04T17:28:38.486076
| 2015-10-02T16:20:00
| 2015-10-02T16:20:00
| 6,561,565
| 2
| 0
| null | 2014-10-27T06:49:59
| 2012-11-06T12:18:44
|
Java
|
UTF-8
|
Java
| false
| false
| 2,305
|
java
|
/*******************************************************************************
* Copyright (c) May 22, 2011 NetXForge.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>
*
* Contributors: Christophe Bouhier - initial API and implementation and/or
* initial documentation
*******************************************************************************/
package com.netxforge.netxstudio.common.tests;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import com.netxforge.netxstudio.common.CommonService;
import com.netxforge.netxstudio.common.jca.JCAService;
/**
*/
public class JCATest extends TestCase {
private String STRING_TO_ENCRYPT = "The quick red fox jumps over the wire";
JCAService jcaService = new JCAService();
public void testCipherJCA() {
CommonService commonService = new CommonService(jcaService);
try {
Key k = commonService.getJcasService().generateRandomKey();
String encrypted = commonService.getJcasService().encrypt(
STRING_TO_ENCRYPT, k);
String decrypt = commonService.getJcasService().decrypt(encrypted,
k);
assertEquals("Should be equal", STRING_TO_ENCRYPT, decrypt);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
public void testDigestJCA() {
CommonService commonService = new CommonService(jcaService);
String digest = commonService.getJcasService()
.digest(STRING_TO_ENCRYPT);
String digest2 = commonService.getJcasService().digest(
STRING_TO_ENCRYPT);
assertEquals("Should be equal", digest, digest2);
}
public static void main(String[] args) {
TestRunner.run(JCATest.class);
}
}
|
[
"dzonekl@gmail.com"
] |
dzonekl@gmail.com
|
66b0fc08298a89862eef40a249de963a1ea34a82
|
cbb4be96d055ccaac7eb63551386fe9eec7850b4
|
/src/main/java/com/glistre/glistremod/worldgen/WorldGenRudLiquids.java
|
59ed44f06bfc5534e9ff0829571a2cc37cb6d4b7
|
[] |
no_license
|
Glistre/GlistreMod3.1
|
b9379cdc072f567ef1b1689f053a45ada5442ef7
|
af73698885390c96426b372ddddb84d1da5b6df9
|
refs/heads/master
| 2020-07-30T02:57:59.221777
| 2016-11-13T19:20:37
| 2016-11-13T19:20:37
| 73,637,655
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,390
|
java
|
package com.glistre.glistremod.worldgen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenLiquids;
public class WorldGenRudLiquids extends WorldGenLiquids
{
private Block something;
private static final String __OBFID = "CL_00000434";
public WorldGenRudLiquids(Block block)
{
super(block);
this.something = block;
}
public boolean generate(World worldIn, Random rand, BlockPos blockpos)
{
if (worldIn.getBlockState(blockpos.up()).getBlock() != Blocks.stone)
{
return false;
}
else if (worldIn.getBlockState(blockpos.down()).getBlock() != Blocks.stone)
{
return false;
}
else if (worldIn.getBlockState(blockpos).getBlock().getMaterial() != Material.air && worldIn.getBlockState(blockpos).getBlock() != Blocks.stone)
{
return false;
}
else
{
int i = 0;
if (worldIn.getBlockState(blockpos.west()).getBlock() == Blocks.stone)
{
++i;
}
if (worldIn.getBlockState(blockpos.east()).getBlock() == Blocks.stone)
{
++i;
}
if (worldIn.getBlockState(blockpos.north()).getBlock() == Blocks.stone)
{
++i;
}
if (worldIn.getBlockState(blockpos.south()).getBlock() == Blocks.stone)
{
++i;
}
int j = 0;
if (worldIn.isAirBlock(blockpos.west()))
{
++j;
}
if (worldIn.isAirBlock(blockpos.east()))
{
++j;
}
if (worldIn.isAirBlock(blockpos.north()))
{
++j;
}
if (worldIn.isAirBlock(blockpos.south()))
{
++j;
}
if (i == 3 && j == 1)
{
worldIn.setBlockState(blockpos, this.something.getDefaultState(), 2);
worldIn.forceBlockUpdateTick(this.something, blockpos, rand);
}
return true;
}
}
}
|
[
"unconfigured@null.spigotmc.org"
] |
unconfigured@null.spigotmc.org
|
ff5087363a8ad1ad6efc62811fbc655e2e787ad8
|
9885db9dd0eeda0507535afb529a3c9d5ac891ae
|
/app/src/main/java/com/campray/lesswalletmerchant/SystemConfig.java
|
51ef3e100498608b62804553edbe74009574857b
|
[] |
no_license
|
CampRay/LessWalletMerchant
|
83ca65beb7c66dccb03c3cc877d11ce3b13ae9d7
|
0320c9be08594cccc39cac2c38368611ae116558
|
refs/heads/master
| 2020-03-23T12:28:53.116005
| 2018-08-02T14:50:45
| 2018-08-02T14:50:45
| 141,561,620
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 629
|
java
|
package com.campray.lesswalletmerchant;
import android.os.Environment;
/**
* @author :Phills
* @project:Config
* @date :2016-01-15-18:23
*/
public class SystemConfig {
//是否是debug模式
public static final boolean DEBUG=true;
public static final int REQUESTCODE_TAKE_CAMERA = 0x000001;//拍照
public static final int REQUESTCODE_TAKE_LOCAL = 0x000002;//本地图片
public static final int REQUESTCODE_TAKE_VEDIO = 0x000003;//錄像
/**
* 存放发送图片的目录
*/
public static String PICTURE_PATH = Environment.getExternalStorageDirectory() + "/lesswallet/image/";
}
|
[
"phills.li@campray.com"
] |
phills.li@campray.com
|
5d926823d97c74fac56418b602b8e18b784deefd
|
4f4f84152b04246be5c323d20083ea3d00319ffc
|
/app/neuralnet/engine/network/activation/ActivationElliottSymmetric.java
|
e9c0480ad0dc44e9e8bf03396f099814aba0c93a
|
[
"Apache-2.0"
] |
permissive
|
GeorgeIwu/breast-cancer-prognosis
|
0d2f1d63b02c23e9afec1176d4bfe6e3e4feab58
|
98ef64dbe049bc2866386a8f8eebdff473ef9f9c
|
refs/heads/master
| 2021-08-11T05:01:49.585167
| 2017-11-13T06:16:30
| 2017-11-13T06:16:30
| 110,506,755
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,246
|
java
|
/*
* Encog(tm) Core v3.3 - Java Version
* http://www.heatonresearch.com/encog/
* https://github.com/encog/encog-java-core
* Copyright 2008-2014 Heaton Research, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information on Heaton Research copyrights, licenses
* and trademarks visit:
* http://www.heatonresearch.com/copyright
*/
package neuralnet.engine.network.activation;
/**
* Computationally efficient alternative to ActivationTANH.
* Its output is in the range [-1, 1], and it is derivable.
*
* It will approach the -1 and 1 more slowly than Tanh so it
* might be more suitable to classification tasks than predictions tasks.
*
* Elliott, D.L. "A better activation function for artificial neural networks", 1993
* <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.46.7204&rep=rep1&type=pdf"></a>
*/
public class ActivationElliottSymmetric implements ActivationFunction {
/**
* The parameters.
*/
private final double[] params;
/**
* Construct a basic HTAN activation function, with a slope of 1.
*/
public ActivationElliottSymmetric() {
this.params = new double[1];
this.params[0] = 1.0;
}
/**
* {@inheritDoc}
*/
@Override
public final void activationFunction(final double[] x, final int start,
final int size) {
for (int i = start; i < start + size; i++) {
double s = params[0];
x[i] = (x[i]*s) / (1 + Math.abs(x[i]*s));
}
}
/**
* @return The object cloned;
*/
@Override
public final ActivationFunction clone() {
return new ActivationElliottSymmetric();
}
/**
* {@inheritDoc}
*/
@Override
public final double derivativeFunction(final double b, final double a) {
double s = params[0];
double d = (1.0+Math.abs(b*s));
return (s*1.0)/(d*d);
}
/**
* {@inheritDoc}
*/
@Override
public final String[] getParamNames() {
final String[] result = { "Slope" };
return result;
}
/**
* {@inheritDoc}
*/
@Override
public final double[] getParams() {
return this.params;
}
/**
* @return Return true, Elliott activation has a derivative.
*/
@Override
public final boolean hasDerivative() {
return true;
}
/**
* {@inheritDoc}
*/
@Override
public final void setParam(final int index, final double value) {
this.params[index] = value;
}
/**
* {@inheritDoc}
*/
@Override
public String getFactoryCode() {
return null;
}
@Override
public String getLabel() {
return "elliottsymmetric";
}
}
|
[
"c.georgeiwu@gmail.com"
] |
c.georgeiwu@gmail.com
|
39430cac03ce1a7ae9f7e66bfe7b9f611dd3d94b
|
ffa381ea7c7619d08e85e122701c71d20f49f63c
|
/src/线程的通信/Bread.java
|
2263b559433bf3e03ffa6417c33f422cf76c0f9c
|
[] |
no_license
|
javaobjects/demo521
|
c69870ea52218c0a09fe537d98988f89e66c87ea
|
1be08bd0507fbecb6a9b572db2c1d0bf05df885f
|
refs/heads/master
| 2020-06-21T02:41:10.336107
| 2019-08-01T07:28:44
| 2019-08-01T07:28:44
| 197,325,313
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,209
|
java
|
package 线程的通信;
public class Bread {
private boolean flag = false;//默认没有面包
//生产面包的方法
public synchronized void produce(int i) {
//如果没有面包那么就生产面包,生产完后通知所有线程
if(!flag) {
System.out.println(Thread.currentThread().getName() + i +" 生产面包");
flag = true;
this.notifyAll();//生产完后通知所有监视当前对象的线程
}else {
//如果有面包,就等待
try {
System.out.println(Thread.currentThread().getName() + i + " 阻塞");
this.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
//消费面包的方法
public synchronized void consumer(int i) {
//如果有面包那么就消费面包,消费完后通知所有线程,消费面包
if(flag) {
System.out.println(Thread.currentThread().getName() + i + " 消费面包");
flag = false;
this.notifyAll();//消费完后通知所有监视当前对象的线程
}else {
//如果没有面包,就等待
try {
System.out.println(Thread.currentThread().getName() + i + " 阻塞");
this.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
|
[
"yanbo0039@yeah.net"
] |
yanbo0039@yeah.net
|
5d303b5eb6d9590123a57ed6cf462843e3ffa787
|
25baed098f88fc0fa22d051ccc8027aa1834a52b
|
/src/main/java/com/ljh/service/impl/UsageCodeServiceImpl.java
|
b489b340fe0d5d18744d58f79966f2f7f11d3d5c
|
[] |
no_license
|
woai555/ljh
|
a5015444082f2f39d58fb3e38260a6d61a89af9f
|
17cf8f4415c9ae7d9fedae46cd9e9d0d3ce536f9
|
refs/heads/master
| 2022-07-11T06:52:07.620091
| 2022-01-05T06:51:27
| 2022-01-05T06:51:27
| 132,585,637
| 0
| 0
| null | 2022-06-17T03:29:19
| 2018-05-08T09:25:32
|
Java
|
UTF-8
|
Java
| false
| false
| 478
|
java
|
package com.ljh.service.impl;
import com.ljh.bean.UsageCode;
import com.ljh.daoMz.UsageCodeMapper;
import com.ljh.service.UsageCodeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 用法代码档 服务实现类
* </p>
*
* @author ljh
* @since 2020-10-26
*/
@Service
public class UsageCodeServiceImpl extends ServiceImpl<UsageCodeMapper, UsageCode> implements UsageCodeService {
}
|
[
"37681193+woai555@users.noreply.github.com"
] |
37681193+woai555@users.noreply.github.com
|
d8aa405e6e8eb9845e109334d1785ce7753b5b57
|
20657e89da643aa74b9a637686b7db16cf4483ca
|
/2.JavaCore/src/com/javarush/task/task16/task1629/Solution.java
|
e12391062790d58f54940496ceeaa83477634e9f
|
[] |
no_license
|
ValentinKiselev/StudyJava_ru
|
383009754dadc7966bd96768c803531fe2b9f626
|
2631a6d9c50f7e773708ec9a9d9bb8faefe802a8
|
refs/heads/master
| 2021-06-26T07:39:52.632439
| 2020-11-03T10:22:26
| 2020-11-03T10:22:26
| 165,408,181
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,284
|
java
|
package com.javarush.task.task16.task1629;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Solution {
public static volatile BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws InterruptedException {
Read3Strings t1 = new Read3Strings();
Read3Strings t2 = new Read3Strings();
t1.start();
t1.join();
t2.start();
t2.join();
t1.printResult();
t2.printResult();
}
public static class Read3Strings extends Thread{
int count = 0;
List<String> list1 = new ArrayList<>();
public void run(){
try {
if (Solution.reader.ready()) {
while (true){
String h = Solution.reader.readLine();
list1.add(h);
if(list1.size() > 2) break;
}
}
}
catch (IOException g){
}
}
public void printResult() {
for(int i = 0; i < list1.size(); i++) {
System.out.print(list1.get(i)+" ");
}
}
}
}
|
[
"valentin_kiselev@iszf.irk.ru"
] |
valentin_kiselev@iszf.irk.ru
|
8ab6f1fe6ee3c2b6438dd79f8781db431283256e
|
993a4b71475061978574f361a703204fc37f5138
|
/phoneme_advanced-mr1-rel-b06/src/share/basis/classes/common/java/awt/event/ContainerListener.java
|
a8dc34c8c39c79fa40051c33fd70ce538594b56d
|
[] |
no_license
|
PhoneJ2ME/releases
|
1d93e51e0081a1d331ea0cf1c1f1e5d55f0914cc
|
6585f23149f090e0ff3a94ee61cae6bf2394e78b
|
refs/heads/master
| 2021-01-19T10:39:17.955758
| 2008-12-17T20:32:36
| 2008-12-17T20:32:36
| 82,216,780
| 4
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,707
|
java
|
/*
* Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included at /legal/license.txt).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 or visit www.sun.com if you need additional information or have
* any questions.
*/
package java.awt.event;
import java.util.EventListener;
/**
* The listener interface for receiving container events.
* Container events are provided for notification purposes ONLY;
* The AWT will automatically handle add and remove operations
* internally.
*
* @version 1.6 08/19/02
* @author Tim Prinzing
* @author Amy Fowler
*/
public interface ContainerListener extends EventListener {
/**
* Invoked when a component has been added to the container.
*/
public void componentAdded(ContainerEvent e);
/**
* Invoked when a component has been removed from the container.
*/
public void componentRemoved(ContainerEvent e);
}
|
[
"hinkmond@6dfe35fe-931f-0410-af5f-a91b034811cd"
] |
hinkmond@6dfe35fe-931f-0410-af5f-a91b034811cd
|
eddbe754b011ae9846f81bafa85b5712ceaeb859
|
ff2683777d02413e973ee6af2d71ac1a1cac92d3
|
/src/main/java/com/alipay/api/response/KoubeiRetailWmsOutboundworkDeleteResponse.java
|
bdb9bf66530c321d28f88a64db7bd4cb1cf165bf
|
[
"Apache-2.0"
] |
permissive
|
weizai118/alipay-sdk-java-all
|
c30407fec93e0b2e780b4870b3a71e9d7c55ed86
|
ec977bf06276e8b16c4b41e4c970caeaf21e100b
|
refs/heads/master
| 2020-05-31T21:01:16.495008
| 2019-05-28T13:14:39
| 2019-05-28T13:14:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 385
|
java
|
package com.alipay.api.response;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: koubei.retail.wms.outboundwork.delete response.
*
* @author auto create
* @since 1.0, 2019-01-07 20:51:15
*/
public class KoubeiRetailWmsOutboundworkDeleteResponse extends AlipayResponse {
private static final long serialVersionUID = 5547145281816761152L;
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
3b2bef042c9c973f91770cdf5f70921b1884af64
|
fc6c869ee0228497e41bf357e2803713cdaed63e
|
/weixin6519android1140/src/sourcecode/com/tencent/mm/plugin/remittance/c/q.java
|
0790c452dce2cba22336992a24be25d744b136f3
|
[] |
no_license
|
hyb1234hi/reverse-wechat
|
cbd26658a667b0c498d2a26a403f93dbeb270b72
|
75d3fd35a2c8a0469dbb057cd16bca3b26c7e736
|
refs/heads/master
| 2020-09-26T10:12:47.484174
| 2017-11-16T06:54:20
| 2017-11-16T06:54:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,116
|
java
|
package com.tencent.mm.plugin.remittance.c;
import com.tencent.gmtrace.GMTrace;
import com.tencent.mm.sdk.platformtools.bg;
import com.tencent.mm.sdk.platformtools.w;
import com.tencent.mm.wallet_core.b.a.a;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;
public final class q
extends a
{
public int jWC;
public String omY;
public int omZ;
public String omc;
public int omi;
public q(double paramDouble, String paramString1, String paramString2, String paramString3, String paramString4, int paramInt)
{
GMTrace.i(10796742475776L, 80442);
this.jWC = 0;
this.omc = "";
this.omY = "";
w.i("MicroMsg.NetSceneTenpayh5Pay", "NetSceneTenpayh5Pay create");
HashMap localHashMap = new HashMap();
try
{
localHashMap.put("transfer_amount", Math.round(100.0D * paramDouble));
localHashMap.put("pay_nickname", URLEncoder.encode(paramString1, "utf-8"));
localHashMap.put("rcvd_username", paramString2);
localHashMap.put("rcvd_nickname", URLEncoder.encode(paramString3, "utf-8"));
localHashMap.put("reason", URLEncoder.encode(bg.aq(paramString4, ""), "utf-8"));
localHashMap.put("currency", String.valueOf(paramInt));
x(localHashMap);
GMTrace.o(10796742475776L, 80442);
return;
}
catch (Exception paramString1)
{
for (;;)
{
w.e("MicroMsg.NetSceneTenpayh5Pay", "error " + paramString1.getMessage());
}
}
}
public final void a(int paramInt, String paramString, JSONObject paramJSONObject)
{
GMTrace.i(10797010911232L, 80444);
w.i("MicroMsg.NetSceneTenpayh5Pay", "errCode " + paramInt + " errMsg: " + paramString);
if (paramInt != 0)
{
w.i("MicroMsg.NetSceneTenpayh5Pay", "NetSceneTenpayh5Pay request error");
GMTrace.o(10797010911232L, 80444);
return;
}
paramString = new StringBuffer();
this.omc = paramJSONObject.optString("payurl");
this.omY = paramJSONObject.optString("tradeurl");
this.omi = paramJSONObject.optInt("transfering_num");
this.omZ = paramJSONObject.optInt("transfering_type");
paramString.append("payurl:" + this.omc);
paramString.append(" tradeurl:" + this.omY);
paramString.append(" transfering_num:" + this.omi);
paramString.append(" transfering_type:" + this.omZ);
w.i("MicroMsg.NetSceneTenpayh5Pay", "resp " + paramString.toString());
GMTrace.o(10797010911232L, 80444);
}
public final String aoA()
{
GMTrace.i(10797279346688L, 80446);
GMTrace.o(10797279346688L, 80446);
return "/cgi-bin/mmpay-bin/h5requesttransfer";
}
public final int aoB()
{
GMTrace.i(10796876693504L, 80443);
GMTrace.o(10796876693504L, 80443);
return 1;
}
public final int getType()
{
GMTrace.i(10797145128960L, 80445);
GMTrace.o(10797145128960L, 80445);
return 1622;
}
}
/* Location: D:\tools\apktool\weixin6519android1140\jar\classes3-dex2jar.jar!\com\tencent\mm\plugin\remittance\c\q.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"robert0825@gmail.com"
] |
robert0825@gmail.com
|
d4200f90d5e4fbebc85b2b079edbdafa4bb941ba
|
0a6336496abdb49a8fbcbbbcad581c850356f018
|
/src/test/java/org/openapitools/client/model/ListLatestMinedBlocksRIBSECTest.java
|
513cde8f2eb1f573dd43666f3c58caac96bea953
|
[] |
no_license
|
Crypto-APIs/Crypto_APIs_2.0_SDK_Java
|
8afba51f53a7a617d66ef6596010cc034a48c17d
|
29bac849e4590c4decfa80458fce94a914801019
|
refs/heads/main
| 2022-09-24T04:43:37.066099
| 2022-09-12T17:38:13
| 2022-09-12T17:38:13
| 360,245,136
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,973
|
java
|
/*
* CryptoAPIs
* Crypto APIs is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of their blockchain applications. Crypto APIs provides unified endpoints and data, raw data, automatic tokens and coins forwardings, callback functionalities, and much more.
*
* The version of the OpenAPI document: 2021-03-20
* Contact: developers@cryptoapis.io
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for ListLatestMinedBlocksRIBSEC
*/
public class ListLatestMinedBlocksRIBSECTest {
private final ListLatestMinedBlocksRIBSEC model = new ListLatestMinedBlocksRIBSEC();
/**
* Model tests for ListLatestMinedBlocksRIBSEC
*/
@Test
public void testListLatestMinedBlocksRIBSEC() {
// TODO: test ListLatestMinedBlocksRIBSEC
}
/**
* Test the property 'difficulty'
*/
@Test
public void difficultyTest() {
// TODO: test difficulty
}
/**
* Test the property 'extraData'
*/
@Test
public void extraDataTest() {
// TODO: test extraData
}
/**
* Test the property 'gasLimit'
*/
@Test
public void gasLimitTest() {
// TODO: test gasLimit
}
/**
* Test the property 'gasUsed'
*/
@Test
public void gasUsedTest() {
// TODO: test gasUsed
}
/**
* Test the property 'minedInSeconds'
*/
@Test
public void minedInSecondsTest() {
// TODO: test minedInSeconds
}
/**
* Test the property 'nonce'
*/
@Test
public void nonceTest() {
// TODO: test nonce
}
/**
* Test the property 'sha3Uncles'
*/
@Test
public void sha3UnclesTest() {
// TODO: test sha3Uncles
}
/**
* Test the property 'size'
*/
@Test
public void sizeTest() {
// TODO: test size
}
/**
* Test the property 'totalDifficulty'
*/
@Test
public void totalDifficultyTest() {
// TODO: test totalDifficulty
}
/**
* Test the property 'uncles'
*/
@Test
public void unclesTest() {
// TODO: test uncles
}
}
|
[
"kristiyan.ivanov@menasoftware.com"
] |
kristiyan.ivanov@menasoftware.com
|
6bebc74fdd1346a5a111f32427d8c2b6f7603282
|
2f7c818ead049a0688e0a279ba127333cacd8674
|
/PullToRefreshView/src/com/meten/imanager/pulltorefresh/library/internal/IndicatorLayout.java
|
7d0ed8747a747e335acd10f1f4e24e7ec26393f8
|
[] |
no_license
|
wxianing/PlantBox
|
30b8e3f359da1996e8a82f62cdf5d05a24379242
|
b721d700dee06875d653a802e63b370ea459fdd8
|
refs/heads/master
| 2020-12-24T21:01:27.350001
| 2016-06-01T11:02:41
| 2016-06-01T11:02:41
| 58,519,428
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,798
|
java
|
/*******************************************************************************
* Copyright 2011, 2012 Chris Banes.
*
* 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.meten.imanager.pulltorefresh.library.internal;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import com.meten.imanager.pulltorefresh.library.PullToRefreshBase;
import com.meten.imanager.pulltorefresh.library.R;
@SuppressLint("ViewConstructor")
public class IndicatorLayout extends FrameLayout implements AnimationListener {
static final int DEFAULT_ROTATION_ANIMATION_DURATION = 150;
private Animation mInAnim, mOutAnim;
private ImageView mArrowImageView;
private final Animation mRotateAnimation, mResetRotateAnimation;
public IndicatorLayout(Context context, PullToRefreshBase.Mode mode) {
super(context);
mArrowImageView = new ImageView(context);
Drawable arrowD = getResources().getDrawable(R.drawable.indicator_arrow);
mArrowImageView.setImageDrawable(arrowD);
final int padding = getResources().getDimensionPixelSize(R.dimen.indicator_internal_padding);
mArrowImageView.setPadding(padding, padding, padding, padding);
addView(mArrowImageView);
int inAnimResId, outAnimResId;
switch (mode) {
case PULL_FROM_END:
inAnimResId = R.anim.slide_in_from_bottom;
outAnimResId = R.anim.slide_out_to_bottom;
setBackgroundResource(R.drawable.indicator_bg_bottom);
// Rotate Arrow so it's pointing the correct way
mArrowImageView.setScaleType(ScaleType.MATRIX);
Matrix matrix = new Matrix();
matrix.setRotate(180f, arrowD.getIntrinsicWidth() / 2f, arrowD.getIntrinsicHeight() / 2f);
mArrowImageView.setImageMatrix(matrix);
break;
default:
case PULL_FROM_START:
inAnimResId = R.anim.slide_in_from_top;
outAnimResId = R.anim.slide_out_to_top;
setBackgroundResource(R.drawable.indicator_bg_top);
break;
}
mInAnim = AnimationUtils.loadAnimation(context, inAnimResId);
mInAnim.setAnimationListener(this);
mOutAnim = AnimationUtils.loadAnimation(context, outAnimResId);
mOutAnim.setAnimationListener(this);
final Interpolator interpolator = new LinearInterpolator();
mRotateAnimation = new RotateAnimation(0, -180, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
mRotateAnimation.setInterpolator(interpolator);
mRotateAnimation.setDuration(DEFAULT_ROTATION_ANIMATION_DURATION);
mRotateAnimation.setFillAfter(true);
mResetRotateAnimation = new RotateAnimation(-180, 0, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mResetRotateAnimation.setInterpolator(interpolator);
mResetRotateAnimation.setDuration(DEFAULT_ROTATION_ANIMATION_DURATION);
mResetRotateAnimation.setFillAfter(true);
}
public final boolean isVisible() {
Animation currentAnim = getAnimation();
if (null != currentAnim) {
return mInAnim == currentAnim;
}
return getVisibility() == View.VISIBLE;
}
public void hide() {
startAnimation(mOutAnim);
}
public void show() {
mArrowImageView.clearAnimation();
startAnimation(mInAnim);
}
@Override
public void onAnimationEnd(Animation animation) {
if (animation == mOutAnim) {
mArrowImageView.clearAnimation();
setVisibility(View.GONE);
} else if (animation == mInAnim) {
setVisibility(View.VISIBLE);
}
clearAnimation();
}
@Override
public void onAnimationRepeat(Animation animation) {
// NO-OP
}
@Override
public void onAnimationStart(Animation animation) {
setVisibility(View.VISIBLE);
}
public void releaseToRefresh() {
mArrowImageView.startAnimation(mRotateAnimation);
}
public void pullToRefresh() {
mArrowImageView.startAnimation(mResetRotateAnimation);
}
}
|
[
"wxianing@163.com"
] |
wxianing@163.com
|
7217063744a0748b895a1ba67504e97b3faa0f46
|
f1abd627b38dcec1f5d551b3ce4302da2a0f81ae
|
/src/main/java/mySpring/JavaConfig.java
|
90d273b7228a79dc0832375daf526df905a157a8
|
[] |
no_license
|
Jeka1978/spring-training-2016-ebay
|
f1e30869b031e004c01dc9b595fa7ea0afec1b34
|
40981255ee3567430f7b568af3d4de48d4c7c204
|
refs/heads/master
| 2021-01-17T19:51:58.521578
| 2016-07-27T12:04:13
| 2016-07-27T12:04:13
| 63,233,022
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 486
|
java
|
package mySpring;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Evegeny on 13/07/2016.
*/
public class JavaConfig implements Config {
private Map<Class, Class> ifc2ImplClass = new HashMap<>();
public JavaConfig() {
ifc2ImplClass.put(Speaker.class, ConsoleSpeaker.class);
ifc2ImplClass.put(Cleaner.class, CleanerImpl.class);
}
@Override
public Class getImplClass(Class ifc) {
return ifc2ImplClass.get(ifc);
}
}
|
[
"papakita2009"
] |
papakita2009
|
cd70b53a59d66b2450de04d636e8cfde7d413518
|
74d44bd702d59d4b02f9aaf461c09a7fe3f84f23
|
/blade.migrate.liferay70/src/blade/migrate/core/WorkspaceHelper.java
|
5e674e81717316c7d71da08f6341a6090884308d
|
[
"Apache-2.0"
] |
permissive
|
AndyWu2015/blade.tools
|
cf6c7cad6e8e025d764a8c5c1d891dd3661ce3ce
|
70a4940dd8b02a2a0caf3ea23b0c21a73ab0ea16
|
refs/heads/master
| 2021-01-15T09:34:12.851321
| 2015-09-22T18:52:17
| 2015-09-22T18:52:17
| 37,909,979
| 0
| 0
| null | 2015-07-31T00:49:49
| 2015-06-23T09:33:05
|
Java
|
UTF-8
|
Java
| false
| false
| 2,366
|
java
|
package blade.migrate.core;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import aQute.lib.io.IO;
public class WorkspaceHelper {
private void addNaturesToProject( IProject proj, String[] natureIds, IProgressMonitor monitor )
throws CoreException {
IProjectDescription description = proj.getDescription();
String[] prevNatures = description.getNatureIds();
String[] newNatures = new String[prevNatures.length + natureIds.length];
System.arraycopy( prevNatures, 0, newNatures, 0, prevNatures.length );
for( int i = prevNatures.length; i < newNatures.length; i++ ) {
newNatures[i] = natureIds[i - prevNatures.length];
}
description.setNatureIds( newNatures );
proj.setDescription( description, monitor );
}
public IFile createIFile(String projectName, File file) throws CoreException, IOException {
IJavaProject project = getJavaProject(projectName);
IFile projectFile = project.getProject().getFile(file.getName());
final IProgressMonitor npm = new NullProgressMonitor();
if (projectFile.exists()) {
projectFile.delete(IFile.FORCE, npm);
}
projectFile.create(new ByteArrayInputStream(IO.read(file)), IFile.FORCE, npm);
return projectFile;
}
private IJavaProject getJavaProject(String projectName) throws CoreException {
IProject javaProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IProgressMonitor monitor = new NullProgressMonitor();
if (!javaProject.exists()) {
IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(projectName);
javaProject.create(monitor);
javaProject.open(monitor);
javaProject.setDescription(description, monitor);
}
javaProject.open(monitor);
addNaturesToProject(javaProject, new String[] { JavaCore.NATURE_ID }, monitor);
return JavaCore.create(javaProject);
}
}
|
[
"gregory.amerson@liferay.com"
] |
gregory.amerson@liferay.com
|
0c9699b61c6c760d7ecf2eb1a09eb0c44d20abfa
|
acf49024173e1a9df107003b8bf2b4d7925fb762
|
/AndroidSoccer_2.3/src/com/epp/soccer/Referee.java
|
2f8eec386b014fa947a0e2cc7b0032938058f58d
|
[] |
no_license
|
tsoglani/Soccer2D
|
a7c51efb7fc498333ed129ea54f408e2a7bbbe43
|
597b7bdb38d2513bb4b7f0bad7e7da3be7096faf
|
refs/heads/master
| 2020-12-24T17:36:28.576492
| 2015-07-08T15:45:37
| 2015-07-08T15:45:37
| 33,503,121
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,863
|
java
|
package com.epp.soccer;
import java.util.ArrayList;
import android.graphics.Point;
public class Referee extends Thread {
private Ball ball;
private SoccerField field;
private SoccerActivity context;
private int time=0;
public Referee(Ball ball, SoccerField field, SoccerActivity context) {
this.ball = ball;
this.field = field;
this.context = context;
}
@Override
public void run() {
while (true) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
time ++;
if (ball.getRectangle().intersect(field.getTeamPlaysAwayNets())) {
context.runOnUiThread(new Runnable() {
@Override
public void run() {
Ball.isGoal=true;
if(time >100){
// rithmizw to anagrafon score
if (field.getTeam1().isPlayingHome()) {
field.getTeam1().setScore(field.getTeam1().getScore() + 1);
} else {
field.getTeam2().setScore(field.getTeam2().getScore() + 1);
}
}
field.getBall().setX(field.getWidth() / 2);
field.getBall().setY(field.getHeight() / 2);
removePlayerMoves();
startingPlayersPositions();
}
});
try {
sleep(1500);
Ball.isGoal=false;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
// an mpei sto panw terma
if (ball.getRectangle().intersect(field.getTeamPlaysHomeNets())) {
ball.setIsGoal(true);
context.runOnUiThread(new Runnable() {
@Override
public void run() {
if(time >100){
if (!field.getTeam1().isPlayingHome()) {
field.getTeam1().setScore(field.getTeam1().getScore() + 1);
field.getTeam2().setHaveKickOffBall(true);
field.getTeam1().setHaveKickOffBall(false);
} else {
field.getTeam2().setScore(field.getTeam2().getScore() + 1);
field.getTeam1().setHaveKickOffBall(true);
field.getTeam2().setHaveKickOffBall(false);
}
}
field.getBall().setX(field.getWidth() / 2);
field.getBall().setY(field.getHeight() / 2);
removePlayerMoves();
startingPlayersPositions();
}
});
try {
Thread.sleep(200);
ball.setIsGoal(false);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
public void removePlayerMoves(){
for(Player p:(Player[])field.getTeam1().getTeamPlayers()){
// p.getMoves().removeAll(p.getMoves());
p.setMoves(new ArrayList<Point>());
}
for(Player p:(Player[])field.getTeam2().getTeamPlayers()){
p.setMoves(new ArrayList<Point>());
}
}
public void startingPlayersPositions(){
for(Player p:(Player[])field.getTeam1().getTeamPlayers()){
p.generateStartPositions();
}
for(Player p:(Player[])field.getTeam2().getTeamPlayers()){
p.generateStartPositions();
}
}
}
|
[
"mrtsoglanakos@hotmail.com"
] |
mrtsoglanakos@hotmail.com
|
1a498fb047d19e06117704fa4b3d4051abc30e36
|
41a5ce39648523be781f35cdc5b69f93d57829a5
|
/src/main/java/org/webguitoolkit/ui/http/resourceprocessor/IResourceProcessor.java
|
4475c040067df582438b07b7ed88d2b2e5d36eb2
|
[
"Apache-2.0"
] |
permissive
|
webguitoolkit/wgt-ui
|
455dd35bbfcb6835e3834a4537e3ffc668f15389
|
747530b462e9377a0ece473b97ce2914fb060cb5
|
refs/heads/master
| 2020-04-06T05:46:43.511525
| 2012-03-02T08:40:44
| 2012-03-02T08:40:44
| 1,516,251
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,095
|
java
|
/*
Copyright 2008 Endress+Hauser Infoserve GmbH&Co KG
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.webguitoolkit.ui.http.resourceprocessor;
import java.io.IOException;
import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author i102415
*
*/
public interface IResourceProcessor {
public boolean canHandle( String fileName );
public void send( String filename, HttpServletRequest req, HttpServletResponse resp ) throws IOException;
public void init(ServletConfig config);
}
|
[
"peter@17sprints.de"
] |
peter@17sprints.de
|
bb11a47fca4310923f6e5dfe01831f0d9689782f
|
26ce2e5d791da69b0c88821320631a4daaa5228c
|
/src/main/java/br/com/swconsultoria/efd/contribuicoes/registros/blocoD/RegistroD601.java
|
58c540a51cd5b2c65d7ad84d30b30045b0d03cc2
|
[
"MIT"
] |
permissive
|
Samuel-Oliveira/Java-Efd-Contribuicoes
|
b3ac3b76f82a29e22ee37c3fb0334d801306c1d4
|
da29df5694e27024df3aeda579936c792fac0815
|
refs/heads/master
| 2023-08-04T06:39:32.644218
| 2023-07-28T00:39:59
| 2023-07-28T00:39:59
| 94,896,966
| 8
| 6
|
MIT
| 2022-04-06T15:30:13
| 2017-06-20T13:55:12
|
Java
|
UTF-8
|
Java
| false
| false
| 2,371
|
java
|
/**
*
*/
package br.com.swconsultoria.efd.contribuicoes.registros.blocoD;
/**
* @author Yuri Lemes
*
*/
public class RegistroD601 {
private final String reg = "D601";
private String cod_class;
private String vl_item;
private String vl_desc;
private String cst_pis;
private String vl_bc_pis;
private String aliq_pis_percentual;
private String vl_pis;
private String cod_cta;
/**
* @return the reg
*/
public String getReg() {
return reg;
}
/**
* @return the cod_class
*/
public String getCod_class() {
return cod_class;
}
/**
* @return the vl_item
*/
public String getVl_item() {
return vl_item;
}
/**
* @return the vl_desc
*/
public String getVl_desc() {
return vl_desc;
}
/**
* @return the cst_pis
*/
public String getCst_pis() {
return cst_pis;
}
/**
* @return the vl_bc_pis
*/
public String getVl_bc_pis() {
return vl_bc_pis;
}
/**
* @return the aliq_pis_percentual
*/
public String getAliq_pis_percentual() {
return aliq_pis_percentual;
}
/**
* @return the vl_pis
*/
public String getVl_pis() {
return vl_pis;
}
/**
* @return the cod_cta
*/
public String getCod_cta() {
return cod_cta;
}
/**
* @param cod_class
* the cod_class to set
*/
public void setCod_class(String cod_class) {
this.cod_class = cod_class;
}
/**
* @param vl_item
* the vl_item to set
*/
public void setVl_item(String vl_item) {
this.vl_item = vl_item;
}
/**
* @param vl_desc
* the vl_desc to set
*/
public void setVl_desc(String vl_desc) {
this.vl_desc = vl_desc;
}
/**
* @param cst_pis
* the cst_pis to set
*/
public void setCst_pis(String cst_pis) {
this.cst_pis = cst_pis;
}
/**
* @param vl_bc_pis
* the vl_bc_pis to set
*/
public void setVl_bc_pis(String vl_bc_pis) {
this.vl_bc_pis = vl_bc_pis;
}
/**
* @param aliq_pis_percentual
* the aliq_pis_percentual to set
*/
public void setAliq_pis_percentual(String aliq_pis_percentual) {
this.aliq_pis_percentual = aliq_pis_percentual;
}
/**
* @param vl_pis
* the vl_pis to set
*/
public void setVl_pis(String vl_pis) {
this.vl_pis = vl_pis;
}
/**
* @param cod_cta
* the cod_cta to set
*/
public void setCod_cta(String cod_cta) {
this.cod_cta = cod_cta;
}
}
|
[
"samuk.exe@hotmail.com"
] |
samuk.exe@hotmail.com
|
033a00ff2b5e52c84c6302f5ea201ab43d5a8950
|
5dc117078cd8447a5a3867e808748d62135ea1d9
|
/src/main/java/org/talend/component/api/service/Action.java
|
891460e9fdba5d4ddac88eae369a4f1433060706
|
[
"Apache-2.0"
] |
permissive
|
rmannibucau/component-api
|
cf8758a5a1209c1267fab3446a45daf796560e3c
|
38726d7bec841433fa5ce1704ad58d2b7be9eafe
|
refs/heads/master
| 2021-05-15T12:05:16.999953
| 2017-10-25T13:39:12
| 2017-10-25T13:39:12
| 108,393,008
| 0
| 0
| null | 2017-10-26T09:50:48
| 2017-10-26T09:50:47
| null |
UTF-8
|
Java
| false
| false
| 1,228
|
java
|
/**
* Copyright (C) 2006-2017 Talend Inc. - www.talend.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.talend.component.api.service;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@ActionType("user")
@Target({ METHOD, ANNOTATION_TYPE })
@Retention(RUNTIME)
public @interface Action {
/**
* @return the value of the component this action relates to.
*/
String family() default "";
/**
* @return the value of the action.
*/
String value();
}
|
[
"rmannibucau@gmail.com"
] |
rmannibucau@gmail.com
|
ceecaffd768d4db41d0704dcff3406f0a6934d0b
|
7c46a44f1930b7817fb6d26223a78785e1b4d779
|
/soap/src/java/com/zimbra/soap/admin/message/CreateZimletRequest.java
|
49c04159bc75283a353c63a210cde50d57f2bb2a
|
[] |
no_license
|
Zimbra/zm-mailbox
|
20355a191c7174b1eb74461a6400b0329907fb02
|
8ef6538e789391813b65d3420097f43fbd2e2bf3
|
refs/heads/develop
| 2023-07-20T15:07:30.305312
| 2023-07-03T06:44:00
| 2023-07-06T10:09:53
| 85,609,847
| 67
| 128
| null | 2023-09-14T10:12:10
| 2017-03-20T18:07:01
|
Java
|
UTF-8
|
Java
| false
| false
| 1,875
|
java
|
/*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2011, 2012, 2013, 2014, 2016 Synacor, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software Foundation,
* version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
* ***** END LICENSE BLOCK *****
*/
package com.zimbra.soap.admin.message;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import com.zimbra.common.soap.AdminConstants;
import com.zimbra.soap.admin.type.AdminAttrsImpl;
/**
* @zm-api-command-auth-required true
* @zm-api-command-admin-auth-required true
* @zm-api-command-description Create a Zimlet
*/
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name=AdminConstants.E_CREATE_ZIMLET_REQUEST)
public class CreateZimletRequest extends AdminAttrsImpl {
/**
* @zm-api-field-tag zimlet-name
* @zm-api-field-description Zimlet name
*/
@XmlAttribute(name=AdminConstants.A_NAME, required=true)
private final String name;
/**
* no-argument constructor wanted by JAXB
*/
@SuppressWarnings("unused")
private CreateZimletRequest() {
this((String) null);
}
public CreateZimletRequest(String name) {
this.name = name;
}
public String getName() { return name; }
}
|
[
"shriram.vishwanathan@synacor.com"
] |
shriram.vishwanathan@synacor.com
|
a11c4ae51f3e0bfcc02a87db0bd5d04ac2ddef89
|
962a6192bbbadcd1a314026406670d8e87db83f5
|
/videoPlayerLibrary_line/src/main/java/com/sumavision/talktv/videoplayer/ui/PhoneReceiver.java
|
7fcadf9c25eed58e17136cb88d60bf94d705f219
|
[] |
no_license
|
sharpayzara/TalkTV3.0_Studio_yy
|
1aa09c1b5ba697514535a507fd017faf1db81b06
|
801afa091aa41835873f466655872190745a9d93
|
refs/heads/master
| 2021-01-19T16:04:12.195817
| 2017-04-13T21:00:19
| 2017-04-13T21:00:19
| 88,245,487
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,832
|
java
|
package com.sumavision.talktv.videoplayer.ui;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;
public class PhoneReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
System.out.println("action"+intent.getAction());
//如果是去电
if(intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)){
String phoneNumber = intent
.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
Log.d("phoneReceiver", "call OUT:" + phoneNumber);
}else{
//查了下android文档,貌似没有专门用于接收来电的action,所以,非去电即来电.
//如果我们想要监听电话的拨打状况,需要这么几步 :
// * 第一:获取电话服务管理器TelephonyManager manager = this.getSystemService(TELEPHONY_SERVICE);
// * 第二:通过TelephonyManager注册我们要监听的电话状态改变事件。manager.listen(new MyPhoneStateListener(),
// * PhoneStateListener.LISTEN_CALL_STATE);这里的PhoneStateListener.LISTEN_CALL_STATE就是我们想要
// * 监听的状态改变事件,初次之外,还有很多其他事件哦。
// * 第三步:通过extends PhoneStateListener来定制自己的规则。将其对象传递给第二步作为参数。
// * 第四步:这一步很重要,那就是给应用添加权限。android.permission.READ_PHONE_STATE
TelephonyManager tm = (TelephonyManager)context.getSystemService(Service.TELEPHONY_SERVICE);
tm.listen(listener, PhoneStateListener.LISTEN_CALL_STATE);
//设置一个监听器
}
}
PhoneStateListener listener=new PhoneStateListener(){
@Override
public void onCallStateChanged(int state, String incomingNumber) {
//注意,方法必须写在super方法后面,否则incomingNumber无法获取到值。
super.onCallStateChanged(state, incomingNumber);
switch(state){
case TelephonyManager.CALL_STATE_IDLE:
System.out.println("挂断");
// PlayerActivity.isPhoneCalled = true;
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
System.out.println("接听");
break;
case TelephonyManager.CALL_STATE_RINGING:
System.out.println("响铃:来电号码"+incomingNumber);
//输出来电号码
break;
}
}
};
}
|
[
"864064269@qq.com"
] |
864064269@qq.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.