blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b11cd7ed462d873de33f6e438693015aaf32189c | 82fe3e7b758cf24b2fc9f3d71c2ea5bf5b1acaa9 | /src/test/java/com/example/Mockito/SomeBusinessMockSpringContextTest.java | 59ad6f7af976a7982c01707acd29cfaada539497 | [] | no_license | Piratheepan/MockitoBasic | 929679b6c7851c1670551d67db7c343338f3f710 | d52b97ea083042be1f7f768262e2c9c4d2d13d7d | refs/heads/master | 2020-07-12T07:44:09.914139 | 2019-08-27T17:44:58 | 2019-08-27T17:44:58 | 204,757,336 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 772 | java | package com.example.Mockito;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SomeBusinessMockSpringContextTest {
@MockBean
DataService dataServiceMock;
@Autowired
SomeBusinessmpl businessImpl;
@Test
public void test() {
when(dataServiceMock.retrieveAllData()).thenReturn(new int[] {24,15,4});
assertEquals(24,businessImpl.findTheGreatestFormAllData());
}
}
| [
"[email protected]"
] | |
68d77fc7c65214ad80d63ac47235433354779aac | d3420713bc61f15a97bcf6adc735f6c14d36e90f | /book_ThisIsJava/src/CHAPTER14_Lambda/example03_FunctionalInterface/Student2.java | 2fc4ce6f6c89d1f491e1b50c6049723db6c0e7a3 | [] | no_license | feelsocold/book_ThisIsJava | 44f1a74dae52c32703f5da683c1cc26c1860dfc8 | c2ddda630a8112a5bd2ea0fb1d9b5b003f9cf6f1 | refs/heads/master | 2020-12-05T05:40:52.946034 | 2020-01-12T13:03:12 | 2020-01-12T13:03:12 | 232,023,326 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | package CHAPTER14_Lambda.example03_FunctionalInterface;
public class Student2 {
private String name;
private String sex;
private int score;
public Student2(String name, String sex, int score) {
this.name = name;
this.sex = sex;
this.score = score;
}
public String getSex() {
return sex;
}
public int getScore() {
return score;
}
public String getName() {
return name;
}
}
| [
"[email protected]"
] | |
5f5f7da0b037aaa891a3bff8a7e901eaef18e950 | a84dc55c8820cd47cc79fce95d469903252225ab | /src/main/java/com/learning/practice/utils/Helper.java | 25a56ec767f51c36fe2bbd5ec2bd694fe3e415a7 | [] | no_license | qiufeng001/learning-practice | 160eee5fdd11e4e53daab85e0f226f22797b4fe0 | 0b68336fe0ae2d49883497bc9b66fa563836183f | refs/heads/master | 2020-05-04T19:44:43.859643 | 2019-05-20T02:44:51 | 2019-05-20T02:44:51 | 179,406,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,221 | java | package com.learning.practice.utils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.util.ResourceUtils;
import java.beans.PropertyDescriptor;
import java.io.*;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.JarURLConnection;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Date;
import java.util.Enumeration;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Helper {
static Pattern camelPattern = Pattern.compile("([A-Z])");
public static String templatePath;
{
templatePath = System.getProperty("java.io.tmpdir");
}
public static void extend(Object desc, Object src) {
BeanWrapper w1 = new BeanWrapperImpl(desc);
BeanWrapper w2 = new BeanWrapperImpl(src);
PropertyDescriptor[] ps = w1.getPropertyDescriptors();
for (PropertyDescriptor p : ps) {
try {
Object v1 = w2.getPropertyValue(p.getName());
w1.setPropertyValue(p.getName(), v1);
} catch (Exception e) {
}
}
}
/**
* 从包package中获取所有的Class
*
* @param pack
* @return
*/
public static Set<Class<?>> getClasses(String pack) {
// 第一个class类的集合
Set<Class<?>> classes = new LinkedHashSet<Class<?>>();
// 是否循环迭代
boolean recursive = true;
// 获取包的名字 并进行替换
String packageName = pack;
String packageDirName = packageName.replace('.', '/');
// 定义一个枚举的集合 并进行循环来处理这个目录下的things
Enumeration<URL> dirs;
try {
dirs = Thread.currentThread().getContextClassLoader().getResources(packageDirName);
// 循环迭代下去
while (dirs.hasMoreElements()) {
// 获取下一个元素
URL url = dirs.nextElement();
// 得到协议的名称
String protocol = url.getProtocol();
// 如果是以文件的形式保存在服务器上
if ("file".equals(protocol)) {
// System.err.println("file类型的扫描");
// 获取包的物理路径
String filePath = URLDecoder.decode(url.getFile(), "UTF-8");
// 以文件的方式扫描整个包下的文件 并添加到集合中
findAndAddClassesInPackageByFile(packageName, filePath, recursive, classes);
} else if ("jar".equals(protocol)) {
// 如果是jar包文件
// 定义一个JarFile
// System.err.println("jar类型的扫描");
JarFile jar;
try {
// 获取jar
jar = ((JarURLConnection) url.openConnection()).getJarFile();
// 从此jar包 得到一个枚举类
Enumeration<JarEntry> entries = jar.entries();
// 同样的进行循环迭代
while (entries.hasMoreElements()) {
// 获取jar里的一个实体 可以是目录 和一些jar包里的其他文件 如META-INF等文件
JarEntry entry = entries.nextElement();
String name = entry.getName();
// 如果是以/开头的
if (name.charAt(0) == '/') {
// 获取后面的字符串
name = name.substring(1);
}
// 如果前半部分和定义的包名相同
if (name.startsWith(packageDirName)) {
int idx = name.lastIndexOf('/');
// 如果以"/"结尾 是一个包
if (idx != -1) {
// 获取包名 把"/"替换成"."
packageName = name.substring(0, idx).replace('/', '.');
}
// 如果可以迭代下去 并且是一个包
if ((idx != -1) || recursive) {
// 如果是一个.class文件 而且不是目录
if (name.endsWith(".class") && !entry.isDirectory()) {
// 去掉后面的".class" 获取真正的类名
String className = name.substring(packageName.length() + 1, name.length() - 6);
try {
// 添加到classes
classes.add(Class.forName(packageName + '.' + className));
} catch (ClassNotFoundException e) {
// log
// .error("添加用户自定义视图类错误
// 找不到此类的.class文件");
e.printStackTrace();
}
}
}
}
}
} catch (IOException e) {
// log.error("在扫描用户定义视图时从jar包获取文件出错");
e.printStackTrace();
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
return classes;
}
/**
* 以文件的形式来获取包下的所有Class
*
* @param packageName
* @param packagePath
* @param recursive
* @param classes
*/
public static void findAndAddClassesInPackageByFile(String packageName, String packagePath, final boolean recursive,
Set<Class<?>> classes) {
// 获取此包的目录 建立一个File
File dir = new File(packagePath);
// 如果不存在或者 也不是目录就直接返回
if (!dir.exists() || !dir.isDirectory()) {
// log.warn("用户定义包名 " + packageName + " 下没有任何文件");
return;
}
// 如果存在 就获取包下的所有文件 包括目录
File[] dirfiles = dir.listFiles(new FileFilter() {
// 自定义过滤规则 如果可以循环(包含子目录) 或则是以.class结尾的文件(编译好的java类文件)
public boolean accept(File file) {
return (recursive && file.isDirectory()) || (file.getName().endsWith(".class"));
}
});
// 循环所有文件
for (File file : dirfiles) {
// 如果是目录 则继续扫描
if (file.isDirectory()) {
findAndAddClassesInPackageByFile(packageName + "." + file.getName(), file.getAbsolutePath(), recursive,
classes);
} else {
// 如果是java类文件 去掉后面的.class 只留下类名
String className = file.getName().substring(0, file.getName().length() - 6);
try {
// 添加到集合中去
// classes.add(Class.forName(packageName + '.' +
// className));
// 经过回复同学的提醒,这里用forName有一些不好,会触发static方法,没有使用classLoader的load干净
classes.add(
Thread.currentThread().getContextClassLoader().loadClass(packageName + '.' + className));
} catch (ClassNotFoundException e) {
// log.error("添加用户自定义视图类错误 找不到此类的.class文件");
e.printStackTrace();
}
}
}
}
public static Class<?> getSuperClassGenricType(final Class<?> clazz, final int index) {
// 返回表示此 Class 所表示的实体(类、接口、基本类型或 void)的直接超类的 Type。
Type genType = clazz.getGenericSuperclass();
if (!(genType instanceof ParameterizedType)) {
return Object.class;
}
// 返回表示此类型实际类型参数的 Type 对象的数组。
Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
if (index >= params.length || index < 0) {
return Object.class;
}
if (!(params[index] instanceof Class)) {
return Object.class;
}
return (Class<?>) params[index];
}
/**
* 将pascal命名格式化为db命名
*
* @param val
* @return
*/
public static String camel2DbFormat(String val) {
String v = val.replaceAll("([a-z])([A-Z])", "$1_$2");
return v.toLowerCase();
}
private static boolean isMatch(String regex, String orginal) {
if (orginal == null || orginal.trim().equals("")) {
return false;
}
Pattern pattern = Pattern.compile(regex);
Matcher isNum = pattern.matcher(orginal);
return isNum.matches();
}
public static boolean isInteger(String orginal) {
return isMatch("^-?\\d+$", orginal);
}
public static boolean isPositiveInteger(String orginal) {
return isMatch("^\\+{0,1}[1-9]\\d*", orginal);
}
public static boolean isNegativeInteger(String orginal) {
return isMatch("^-[1-9]\\d*", orginal);
}
public static boolean isWholeNumber(String orginal) {
return isMatch("[+-]{0,1}0", orginal) || isPositiveInteger(orginal) || isNegativeInteger(orginal);
}
public static boolean isPositiveDecimal(String orginal) {
return isMatch("\\+{0,1}[0]\\.[1-9]*|\\+{0,1}[1-9]\\d*\\.\\d*", orginal);
}
public static boolean isNegativeDecimal(String orginal) {
return isMatch("^-[0]\\.[1-9]*|^-[1-9]\\d*\\.\\d*", orginal);
}
public static boolean isDecimal(String orginal) {
return isMatch("[-+]{0,1}\\d+\\.\\d*|[-+]{0,1}\\d*\\.\\d+", orginal);
}
public static boolean isRealNumber(String orginal) {
return isWholeNumber(orginal) || isDecimal(orginal);
}
public static String combine(String... strings) {
if (strings == null || strings.length == 0)
throw new NullPointerException("strings");
String path = strings[0];
if (strings.length == 1)
return path;
for (int i = 1; i < strings.length; i++) {
String str = strings[i];
if (strings[i].endsWith(File.separator)) {
str = str.substring(0, str.length() - 2);
}
if (strings[i].startsWith(File.separator)) {
str = str.substring(1, str.length() - 1);
}
path += File.separator + str;
}
return path;
}
public static String readFile(File file) throws IOException {
FileReader reader = new FileReader(file);
int fileLen = (int) file.length();
char[] chars = new char[fileLen];
try {
reader.read(chars);
String txt = String.valueOf(chars);
return txt;
} finally {
reader.close();
}
}
public static String readFile(String path) throws IOException {
File file = new File(path);
return readFile(file);
}
public static void createTemplateFolder(String destDirName) {
destDirName = System.getProperty("java.io.tmpdir") + File.separator + destDirName;
if (!destDirName.endsWith(File.separator)) {
destDirName = destDirName + File.separator;
}
File dir = new File(destDirName);
if (dir.exists())
return;
// 创建目录
dir.mkdirs();
}
public static String getResourcesAsString(String resourceLocation) throws FileNotFoundException {
File file = ResourceUtils.getFile(resourceLocation);
return readFileAsText(file);
}
public static String readFileAsText(File file) {
StringBuilder result = new StringBuilder();
try {
BufferedReader br = new BufferedReader(new FileReader(file));// 构造一个BufferedReader类来读取文件
String s = null;
while ((s = br.readLine()) != null) {// 使用readLine方法,一次读一行
result.append(System.lineSeparator() + s);
}
br.close();
} catch (Exception e) {
e.printStackTrace();
}
return result.toString();
}
public static String readString(InputStream stream) throws IOException {
StringBuilder result = new StringBuilder();
BufferedReader br = new BufferedReader(new InputStreamReader(stream));// 构造一个BufferedReader类来读取文件
String s = null;
while ((s = br.readLine()) != null) {// 使用readLine方法,一次读一行
result.append(s + System.lineSeparator());
}
br.close();
return result.toString();
}
public static void copyStream(InputStream in, OutputStream out) throws IOException {
byte[] chunk = new byte[1024];
int count;
while ((count = in.read(chunk)) >= 0) {
out.write(chunk, 0, count);
}
}
public static String convert36(int num) {
String str = "", digit = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
if (num == 0) {
return "";
} else {
str = convert36(num / 36);
return str + digit.charAt(num % 36);
}
}
public static String convert10(String str) {
String result = "";
String digit = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int len = str.length();
for (int i = len; i > 0; i--) {
Double a = digit.indexOf(str, i - 1) * (Math.pow(36, len - i));
result += a.intValue();
}
return result;
}
public static boolean isBaseDataType(Class<?> clazz) {
return (clazz.equals(String.class) || clazz.equals(Integer.class) || clazz.equals(Byte.class)
|| clazz.equals(Long.class) || clazz.equals(Double.class) || clazz.equals(Float.class)
|| clazz.equals(Character.class) || clazz.equals(Short.class) || clazz.equals(BigDecimal.class)
|| clazz.equals(BigInteger.class) || clazz.equals(Boolean.class) || clazz.equals(Date.class)
|| clazz.equals(Number.class) || clazz.isPrimitive());
}
}
| [
"[email protected]"
] | |
41b6629874f06aeea315fe8aa32aed98f1de07d3 | fbce982ae209b0672454b6611489b6ba81e162f9 | /src/main/java/com/neo/ticketingapp/common/discount/LocalCustomer.java | 458326f988cfe63d0ed39ab2e25a5aeb7b6f73da | [] | no_license | sathiraguruge/Ticketing-Back-End | b0bdf8c41f629bb9d6df2a5133f50cc39a9d2058 | a1992269dbc28b799e917b5bd629a61bf70b5360 | refs/heads/master | 2023-01-21T06:18:52.329971 | 2020-10-09T06:21:33 | 2020-10-09T06:21:33 | 210,547,913 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 404 | java | package com.neo.ticketingapp.common.discount;
import com.neo.ticketingapp.common.constants.CommonConstants;
import com.neo.ticketingapp.common.discount.interfaces.Discount;
public class LocalCustomer implements Discount {
@Override
public Double handleDiscount(Double originalPrice) {
return ((originalPrice * CommonConstants.NEW_LOCAL_DISCOUNT) / CommonConstants.ONE_HUNDRED);
}
}
| [
"[email protected]"
] | |
876f9cf084a879eeab51cb81a24067049a7c742b | 5168ef2911634e97356d85d6cc015734e3fc1aa6 | /src/main/java/com/roamtech/uc/jainsip/rxevent/BaseMessageEvent.java | d6a294377c80971ca571f443e7d551036ea9b6c5 | [
"Apache-2.0"
] | permissive | caibinglong1987/ucserver | 5056eac12fdb2f13b50e2e4fabe5bd3e744fd450 | 68075a9e275bf26c17bf7a39305196803d572918 | refs/heads/master | 2021-01-22T07:42:41.211856 | 2017-05-27T05:48:03 | 2017-05-27T05:48:03 | 92,573,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,235 | java | package com.roamtech.uc.jainsip.rxevent;
/**
* Created by admin03 on 2016/8/31.
*/
public class BaseMessageEvent {
protected String message;
protected String from;
protected String to;
protected String displayname;
protected String userid;
public BaseMessageEvent(String from, String to, String message, String displayname, String userid) {
this.from = from;
this.to = to;
this.message = message;
this.displayname = displayname;
this.userid = userid;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public String getDisplayname() {
return displayname;
}
public void setDisplayname(String displayname) {
this.displayname = displayname;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
}
| [
"[email protected]"
] | |
26d3687569ae63fae8c4bd730f149ca85e8c6b87 | 70d7849f92e8d794e2b5ac22eeda846fa55e0d14 | /app/src/main/java/com/wiselap/accounts/expense/ExpensePackage/ExpenseReturnModel.java | 8c9dfabc80b0e8550062515156c2ffd647fa5970 | [] | no_license | shivamtripathii/WiseAccounts | 9ea1cce53b7bebd7e80143372af6b421157b75b0 | cb2792a3af30e0dc6461bb759fa1834f61b1ccb1 | refs/heads/master | 2020-06-04T14:37:59.174659 | 2020-02-11T09:31:32 | 2020-02-11T09:31:32 | 192,064,695 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,900 | java | package com.wiselap.accounts.expense.ExpensePackage;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
public class ExpenseReturnModel implements Serializable {
private Long expenseId;
private String statusChangeTime;
private Long expenseTypeId;
private String remarks;
private Long balanceAmount;
private Long expenseAmount;
private String expenseName;
private String date;
private String currentStatus;
private Long appDenyByShopAgentId;
public ExpenseReturnModel(Long expenseId, String statusChangeTime, Long expenseTypeId, String remarks, Long balanceAmount, Long expenseAmount, String expenseName, String date, String currentStatus, Long appDenyByShopAgentId) {
this.expenseId = expenseId;
this.statusChangeTime = statusChangeTime;
this.expenseTypeId = expenseTypeId;
this.remarks = remarks;
this.balanceAmount = balanceAmount;
this.expenseAmount = expenseAmount;
this.expenseName = expenseName;
this.date = date;
this.currentStatus = currentStatus;
this.appDenyByShopAgentId = appDenyByShopAgentId;
}
public Long getExpenseId() {
return expenseId;
}
public String getStatusChangeTime() {
return statusChangeTime;
}
public Long getExpenseTypeId() {
return expenseTypeId;
}
public String getRemarks() {
return remarks;
}
public Long getBalanceAmount() {
return balanceAmount;
}
public Long getExpenseAmount() {
return expenseAmount;
}
public String getExpenseName() {
return expenseName;
}
public String getDate() {
return date;
}
public String getCurrentStatus() {
return currentStatus;
}
public Long getAppDenyByShopAgentId() {
return appDenyByShopAgentId;
}
}
| [
"[email protected]"
] | |
699e6de28e8ef9679ea6581b9b6ef99f3444b94e | 3a47d7d1d6968daea4f2154de479ac18b17ad7db | /com.sg.vim/src/com/sg/vim/service/vidc/DataObjectBase.java | dd9869aa40d24362b796d8e9f3ae552855491f12 | [] | no_license | sgewuhan/vim | ef64fce49f9ab481521a21901157c81910e57e5e | d7d193f5be3b357bace4e0f7b703281ade15ae7f | refs/heads/master | 2021-01-19T03:12:56.079503 | 2013-06-26T00:51:24 | 2013-06-26T00:51:24 | 9,443,167 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,527 | java | package com.sg.vim.service.vidc;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>
* Java class for DataObjectBase complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType name="DataObjectBase">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="WZHGZBH" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DataObjectBase", namespace = "http://www.vidc.info/certificate/operation/", propOrder = { "wzhgzbh" })
public class DataObjectBase {
@XmlElement(name = "WZHGZBH")
protected String wzhgzbh;
/**
* Gets the value of the wzhgzbh property.
*
* @return possible object is {@link String }
*
*/
public String getWZHGZBH() {
return wzhgzbh;
}
/**
* Sets the value of the wzhgzbh property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setWZHGZBH(String value) {
this.wzhgzbh = value;
}
}
| [
"[email protected]"
] | |
20a930ee94f47748dab5c08ff6618c6fcc3d80a3 | 4623d60dc8f485f7a2fa199b09bc5b0b5785449c | /common-ebxml3/src/main/java/org/openhealthtools/ihe/common/ebxml/_3/_0/cms/impl/ContentManagementServiceRequestTypeImpl.java | 250e6e341a46499d158e2db818f8d1bfa02e2fe4 | [] | no_license | RSNA/isn-edge-server-oht | af454969de280b533679de1b63952992b324600b | 8ed6282479e97cd61ed26d0d0ee60ebb696070d7 | refs/heads/master | 2021-01-18T16:23:22.205738 | 2017-03-31T14:10:55 | 2017-03-31T14:10:55 | 86,742,075 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,328 | java | /**
* <copyright>
* </copyright>
*
* $Id: ContentManagementServiceRequestTypeImpl.java,v 1.1 2006/10/19 20:16:36 sknoop Exp $
*/
package org.openhealthtools.ihe.common.ebxml._3._0.cms.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.openhealthtools.ihe.common.ebxml._3._0.cms.CMSPackage;
import org.openhealthtools.ihe.common.ebxml._3._0.cms.ContentManagementServiceRequestType;
import org.openhealthtools.ihe.common.ebxml._3._0.rim.ExtrinsicObjectType;
import org.openhealthtools.ihe.common.ebxml._3._0.rim.RegistryObjectListType;
import org.openhealthtools.ihe.common.ebxml._3._0.rs.impl.RegistryRequestTypeImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Content Management Service Request Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.openhealthtools.ihe.common.ebxml._3._0.cms.impl.ContentManagementServiceRequestTypeImpl#getOriginalContent <em>Original Content</em>}</li>
* <li>{@link org.openhealthtools.ihe.common.ebxml._3._0.cms.impl.ContentManagementServiceRequestTypeImpl#getInvocationControlFile <em>Invocation Control File</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ContentManagementServiceRequestTypeImpl extends RegistryRequestTypeImpl implements ContentManagementServiceRequestType {
/**
* The cached value of the '{@link #getOriginalContent() <em>Original Content</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOriginalContent()
* @generated
* @ordered
*/
protected RegistryObjectListType originalContent = null;
/**
* The cached value of the '{@link #getInvocationControlFile() <em>Invocation Control File</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInvocationControlFile()
* @generated
* @ordered
*/
protected EList invocationControlFile = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ContentManagementServiceRequestTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return CMSPackage.Literals.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RegistryObjectListType getOriginalContent() {
return originalContent;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOriginalContent(RegistryObjectListType newOriginalContent, NotificationChain msgs) {
RegistryObjectListType oldOriginalContent = originalContent;
originalContent = newOriginalContent;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__ORIGINAL_CONTENT, oldOriginalContent, newOriginalContent);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOriginalContent(RegistryObjectListType newOriginalContent) {
if (newOriginalContent != originalContent) {
NotificationChain msgs = null;
if (originalContent != null)
msgs = ((InternalEObject)originalContent).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__ORIGINAL_CONTENT, null, msgs);
if (newOriginalContent != null)
msgs = ((InternalEObject)newOriginalContent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__ORIGINAL_CONTENT, null, msgs);
msgs = basicSetOriginalContent(newOriginalContent, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__ORIGINAL_CONTENT, newOriginalContent, newOriginalContent));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList getInvocationControlFile() {
if (invocationControlFile == null) {
invocationControlFile = new EObjectContainmentEList(ExtrinsicObjectType.class, this, CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__INVOCATION_CONTROL_FILE);
}
return invocationControlFile;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__ORIGINAL_CONTENT:
return basicSetOriginalContent(null, msgs);
case CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__INVOCATION_CONTROL_FILE:
return ((InternalEList)getInvocationControlFile()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__ORIGINAL_CONTENT:
return getOriginalContent();
case CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__INVOCATION_CONTROL_FILE:
return getInvocationControlFile();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__ORIGINAL_CONTENT:
setOriginalContent((RegistryObjectListType)newValue);
return;
case CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__INVOCATION_CONTROL_FILE:
getInvocationControlFile().clear();
getInvocationControlFile().addAll((Collection)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__ORIGINAL_CONTENT:
setOriginalContent((RegistryObjectListType)null);
return;
case CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__INVOCATION_CONTROL_FILE:
getInvocationControlFile().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__ORIGINAL_CONTENT:
return originalContent != null;
case CMSPackage.CONTENT_MANAGEMENT_SERVICE_REQUEST_TYPE__INVOCATION_CONTROL_FILE:
return invocationControlFile != null && !invocationControlFile.isEmpty();
}
return super.eIsSet(featureID);
}
} //ContentManagementServiceRequestTypeImpl
| [
"[email protected]"
] | |
32e2dac40b9813f7437548044432b58f7820b866 | 8e6a1be9a03463d8e65865dd862c695ac87a083f | /src/main/java/com/sxd/swapping/mybatis/pojo/HuaYangArea.java | f4e6e15c6be3b4d972c594cc4eff6c92f66794de | [] | no_license | AngelSXD/swapping | a8d03c3d30fb8a1e8a8364490de27ac4123c3158 | f25aad92df11de18fbf0f4ddd537e9d7a4c2854e | refs/heads/master | 2022-07-14T17:35:27.672342 | 2021-11-12T03:13:35 | 2021-11-12T03:13:35 | 133,493,819 | 1 | 1 | null | 2022-06-17T01:43:19 | 2018-05-15T09:35:54 | Java | UTF-8 | Java | false | false | 1,936 | java | package com.sxd.swapping.mybatis.pojo;
import com.sxd.swapping.mybatis.base.BaseBean;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.jpa.domain.Specification;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.io.Serializable;
import java.util.*;
@Entity
@Table
@Getter
@Setter
public class HuaYangArea extends BaseBean implements Serializable {
private static final long serialVersionUID = -1851783771574739215L;
@Column(nullable = false)
private String areaName;
@Column(nullable = false)
private Long areaPerson;
public static Specification<HuaYangArea> where(HuaYangArea huaYangArea){
return new Specification<HuaYangArea>() {
@Override
public Predicate toPredicate(Root<HuaYangArea> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
//创建查询列表
List<Predicate> predicates = new ArrayList<>();
//字段areaName是否查询
String areaName = huaYangArea.getAreaName();
if (StringUtils.isNotBlank(areaName)){
predicates.add(criteriaBuilder.like(root.get("areaName"),"%"+areaName+"%"));
}
//字段areaPerson是否查询
Long areaPerson = huaYangArea.getAreaPerson();
if (areaPerson != null) {
predicates.add(criteriaBuilder.equal(root.get("areaPerson"),areaPerson));
}
return criteriaQuery.where(predicates.toArray(new Predicate[predicates.size()])).getRestriction();
}
};
}
}
| [
"[email protected]"
] | |
bf6e6a7c051f3dcedd805baa89c91a32b99ae6e8 | 74b47b895b2f739612371f871c7f940502e7165b | /aws-java-sdk-sesv2/src/main/java/com/amazonaws/services/simpleemailv2/model/GetBlacklistReportsResult.java | 8045cf0a19def97fcad8fb14fb320c913b85f421 | [
"Apache-2.0"
] | permissive | baganda07/aws-sdk-java | fe1958ed679cd95b4c48f971393bf03eb5512799 | f19bdb30177106b5d6394223a40a382b87adf742 | refs/heads/master | 2022-11-09T21:55:43.857201 | 2022-10-24T21:08:19 | 2022-10-24T21:08:19 | 221,028,223 | 0 | 0 | Apache-2.0 | 2019-11-11T16:57:12 | 2019-11-11T16:57:11 | null | UTF-8 | Java | false | false | 5,681 | java | /*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.simpleemailv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
* <p>
* An object that contains information about blacklist events.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/sesv2-2019-09-27/GetBlacklistReports" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetBlacklistReportsResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/**
* <p>
* An object that contains information about a blacklist that one of your dedicated IP addresses appears on.
* </p>
*/
private java.util.Map<String, java.util.List<BlacklistEntry>> blacklistReport;
/**
* <p>
* An object that contains information about a blacklist that one of your dedicated IP addresses appears on.
* </p>
*
* @return An object that contains information about a blacklist that one of your dedicated IP addresses appears on.
*/
public java.util.Map<String, java.util.List<BlacklistEntry>> getBlacklistReport() {
return blacklistReport;
}
/**
* <p>
* An object that contains information about a blacklist that one of your dedicated IP addresses appears on.
* </p>
*
* @param blacklistReport
* An object that contains information about a blacklist that one of your dedicated IP addresses appears on.
*/
public void setBlacklistReport(java.util.Map<String, java.util.List<BlacklistEntry>> blacklistReport) {
this.blacklistReport = blacklistReport;
}
/**
* <p>
* An object that contains information about a blacklist that one of your dedicated IP addresses appears on.
* </p>
*
* @param blacklistReport
* An object that contains information about a blacklist that one of your dedicated IP addresses appears on.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetBlacklistReportsResult withBlacklistReport(java.util.Map<String, java.util.List<BlacklistEntry>> blacklistReport) {
setBlacklistReport(blacklistReport);
return this;
}
/**
* Add a single BlacklistReport entry
*
* @see GetBlacklistReportsResult#withBlacklistReport
* @returns a reference to this object so that method calls can be chained together.
*/
public GetBlacklistReportsResult addBlacklistReportEntry(String key, java.util.List<BlacklistEntry> value) {
if (null == this.blacklistReport) {
this.blacklistReport = new java.util.HashMap<String, java.util.List<BlacklistEntry>>();
}
if (this.blacklistReport.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.blacklistReport.put(key, value);
return this;
}
/**
* Removes all the entries added into BlacklistReport.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetBlacklistReportsResult clearBlacklistReportEntries() {
this.blacklistReport = null;
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getBlacklistReport() != null)
sb.append("BlacklistReport: ").append(getBlacklistReport());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetBlacklistReportsResult == false)
return false;
GetBlacklistReportsResult other = (GetBlacklistReportsResult) obj;
if (other.getBlacklistReport() == null ^ this.getBlacklistReport() == null)
return false;
if (other.getBlacklistReport() != null && other.getBlacklistReport().equals(this.getBlacklistReport()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getBlacklistReport() == null) ? 0 : getBlacklistReport().hashCode());
return hashCode;
}
@Override
public GetBlacklistReportsResult clone() {
try {
return (GetBlacklistReportsResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
5938a4e21731b72da4e4432320e9c40cecd39c2f | 9579308b40a5ef17bd90c3cce5fbdb00e9dc7514 | /app/src/androidTest/java/com/example/seana/notesapp/ExampleInstrumentedTest.java | 88b424db4cab5ba6316c4ea8ecbafb6da2df6dd9 | [] | no_license | sagi0035/NoteBasedApp | 5dc47b8d0bf0e9b0c9e55060801f9524d1418e2d | 58a4823f12d26f7afdec4487992b0164fe574f06 | refs/heads/master | 2023-02-08T23:17:26.524558 | 2020-12-31T15:12:24 | 2020-12-31T15:12:24 | 320,836,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 753 | java | package com.example.seana.notesapp;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.seana.notesapp", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
65e88eb4032fd34f316fc707cf3e35222fd9e04a | 71e009fb7538e77df93cff860c5a2312670e3682 | /Contact List/src/EditAddPhoneGUI.java | 32ef42e36b229795b6847054792e5415af27edbf | [] | no_license | tade10/ContactList | 7a40df8b66903bc2fc15ac6ce07fe2397d1b8680 | 96d124fefcbd04a0e7a198be5b9d9b44856e851e | refs/heads/main | 2023-03-02T03:06:11.080951 | 2021-02-08T05:59:10 | 2021-02-08T05:59:10 | 336,970,576 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,679 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//import GUI.*;
//import contactlist.ContactList;
//import contactlist.connector;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
/**
*
* @author nadat
*/
public class EditAddPhoneGUI extends javax.swing.JFrame {
int contact_id;
String phoneType, areaCode, number;
/**
* Creates new form EditAddPhoneGUI
*/
public EditAddPhoneGUI() {
initComponents();
}
public EditAddPhoneGUI(int contact_id) {
this.contact_id = contact_id;
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
phoneTypeTf = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
areaCodeTf = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
numberTf = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
editAddPhoneBtn = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
phoneTypeTf.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
phoneTypeTfActionPerformed(evt);
}
});
jLabel1.setText("Phone Type");
areaCodeTf.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
areaCodeTfActionPerformed(evt);
}
});
jLabel2.setText("Area Code");
jLabel4.setText("format: 'must be 3-digit numeric'");
numberTf.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
numberTfActionPerformed(evt);
}
});
jLabel3.setText("Number");
jLabel5.setText("format: 'must be 7-digit numeric'");
editAddPhoneBtn.setText("Add Phone");
editAddPhoneBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
editAddPhoneBtnActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(phoneTypeTf, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(34, 34, 34)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(areaCodeTf, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel4))
.addGroup(layout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(36, 36, 36)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(numberTf, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(editAddPhoneBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(29, 29, 29)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(numberTf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(phoneTypeTf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(areaCodeTf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))))
.addGap(53, 53, 53)
.addComponent(editAddPhoneBtn)
.addContainerGap(37, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void phoneTypeTfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_phoneTypeTfActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_phoneTypeTfActionPerformed
private void areaCodeTfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_areaCodeTfActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_areaCodeTfActionPerformed
private void numberTfActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numberTfActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_numberTfActionPerformed
private void editAddPhoneBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editAddPhoneBtnActionPerformed
// TODO add your handling code here:
try{
if(!ContactList.isNumeric(areaCodeTf.getText())){
JOptionPane.showMessageDialog(null, "Areacode must be numeric");
}
else if(areaCodeTf.getText().length() != 3){
JOptionPane.showMessageDialog(null, "Areacode must be 3-digit");
}
else if(!ContactList.isNumeric(numberTf.getText())){
JOptionPane.showMessageDialog(null, "Number must be numeric");
}
else if(numberTf.getText().length() != 7){
JOptionPane.showMessageDialog(null, "Number must be 7-digit");
}
else{
this.phoneType = phoneTypeTf.getText();
this.areaCode = areaCodeTf.getText();
this.number = numberTf.getText();
Connection con = connector.get();
String sqlPhone = "insert into phone (contact_id, Phone_type, Area_code, Number) values (?,?,?,?)";
PreparedStatement psPhone = con.prepareStatement(sqlPhone);
psPhone.setInt(1, this.contact_id);
psPhone.setString(2, this.phoneType);
psPhone.setString(3, this.areaCode);
psPhone.setString(4, this.number);
psPhone.execute();
String sqlPhone2 = "select * from phone where contact_id = '"+this.contact_id+"' AND Phone_type = '"+this.phoneType+"' AND Area_code = '"+this.areaCode+"' AND Number = '"+this.number+"'";
PreparedStatement psPhone2 = con.prepareStatement(sqlPhone2);
ResultSet rsPhone = psPhone2.executeQuery();
String phoneId = null;
while(rsPhone.next())
{
phoneId = String.valueOf(rsPhone.getInt("Phone_id"));
}
EditContactGUI.editAddPhone(phoneId, this.phoneType, this.areaCode, this.number);
dispose();
}
}
catch(Exception e){
e.printStackTrace();
}
}//GEN-LAST:event_editAddPhoneBtnActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(EditAddPhoneGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(EditAddPhoneGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(EditAddPhoneGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(EditAddPhoneGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new EditAddPhoneGUI().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField areaCodeTf;
private javax.swing.JButton editAddPhoneBtn;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField numberTf;
private javax.swing.JTextField phoneTypeTf;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
9ed8f8ec675326f5f2ec6b55d8f46facc8cdb4c9 | c474b03758be154e43758220e47b3403eb7fc1fc | /apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/com/google/android/m4b/maps/p102b/C6424g.java | b597a8f58a08ee55fe4447b8b53ce0139209be35 | [] | no_license | EstebanDalelR/tinderAnalysis | f80fe1f43b3b9dba283b5db1781189a0dd592c24 | 941e2c634c40e5dbf5585c6876ef33f2a578b65c | refs/heads/master | 2020-04-04T09:03:32.659099 | 2018-11-23T20:41:28 | 2018-11-23T20:41:28 | 155,805,042 | 0 | 0 | null | 2018-11-18T16:02:45 | 2018-11-02T02:44:34 | null | UTF-8 | Java | false | false | 5,490 | java | package com.google.android.m4b.maps.p102b;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;
import android.widget.ImageView.ScaleType;
import com.facebook.ads.AdError;
import com.google.android.m4b.maps.p101a.C4522h;
import com.google.android.m4b.maps.p101a.C4525k;
import com.google.android.m4b.maps.p101a.C4525k.C4524a;
import com.google.android.m4b.maps.p101a.C4529m;
import com.google.android.m4b.maps.p101a.C4529m.C4527a;
import com.google.android.m4b.maps.p101a.C4529m.C4528b;
import com.google.android.m4b.maps.p101a.C4531o;
import com.google.android.m4b.maps.p101a.C4535s;
import com.google.android.m4b.maps.p101a.C6304j;
/* renamed from: com.google.android.m4b.maps.b.g */
public class C6424g extends C4525k<Bitmap> {
/* renamed from: f */
private static final Object f23835f = new Object();
/* renamed from: a */
private final C4528b<Bitmap> f23836a;
/* renamed from: b */
private final Config f23837b;
/* renamed from: c */
private final int f23838c;
/* renamed from: d */
private final int f23839d;
/* renamed from: e */
private ScaleType f23840e;
/* renamed from: a */
protected final /* synthetic */ void mo4886a(Object obj) {
this.f23836a.mo4906a((Bitmap) obj);
}
private C6424g(String str, C4528b<Bitmap> c4528b, int i, int i2, ScaleType scaleType, Config config, C4527a c4527a) {
super(0, str, c4527a);
m20426a((C4531o) new C4531o(AdError.NETWORK_ERROR_CODE, 2, 2.0f));
this.f23836a = c4528b;
this.f23837b = config;
this.f23838c = i;
this.f23839d = i2;
this.f23840e = scaleType;
}
@Deprecated
public C6424g(String str, C4528b<Bitmap> c4528b, int i, int i2, Config config, C4527a c4527a) {
this(str, c4528b, 0, 0, ScaleType.CENTER_INSIDE, config, c4527a);
}
/* renamed from: m */
public final C4524a mo4904m() {
return C4524a.LOW;
}
/* renamed from: a */
private static int m28068a(int i, int i2, int i3, int i4, ScaleType scaleType) {
if (i == 0 && i2 == 0) {
return i3;
}
if (scaleType == ScaleType.FIT_XY) {
return i == 0 ? i3 : i;
} else {
if (i == 0) {
return (int) (((double) i3) * (((double) i2) / ((double) i4)));
} else if (i2 == 0) {
return i;
} else {
double d = ((double) i4) / ((double) i3);
double d2;
if (scaleType == ScaleType.CENTER_CROP) {
d2 = (double) i2;
if (((double) i) * d < d2) {
i = (int) (d2 / d);
}
return i;
}
d2 = (double) i2;
if (((double) i) * d > d2) {
i = (int) (d2 / d);
}
return i;
}
}
}
/* renamed from: a */
protected final C4529m<Bitmap> mo4885a(C4522h c4522h) {
C4529m<Bitmap> a;
synchronized (f23835f) {
try {
Object decodeByteArray;
byte[] bArr = c4522h.f16797b;
Options options = new Options();
if (this.f23838c == 0 && this.f23839d == 0) {
options.inPreferredConfig = this.f23837b;
decodeByteArray = BitmapFactory.decodeByteArray(bArr, 0, bArr.length, options);
} else {
options.inJustDecodeBounds = true;
BitmapFactory.decodeByteArray(bArr, 0, bArr.length, options);
int i = options.outWidth;
int i2 = options.outHeight;
int a2 = C6424g.m28068a(this.f23838c, this.f23839d, i, i2, this.f23840e);
int a3 = C6424g.m28068a(this.f23839d, this.f23838c, i2, i, this.f23840e);
options.inJustDecodeBounds = false;
options.inSampleSize = C6424g.m28067a(i, i2, a2, a3);
decodeByteArray = BitmapFactory.decodeByteArray(bArr, 0, bArr.length, options);
if (decodeByteArray != null && (decodeByteArray.getWidth() > a2 || decodeByteArray.getHeight() > a3)) {
Bitmap createScaledBitmap = Bitmap.createScaledBitmap(decodeByteArray, a2, a3, true);
decodeByteArray.recycle();
decodeByteArray = createScaledBitmap;
}
}
if (decodeByteArray == null) {
a = C4529m.m20454a(new C6304j(c4522h));
} else {
a = C4529m.m20455a(decodeByteArray, C4738d.m21079a(c4522h));
}
} catch (Throwable e) {
C4535s.m20470c("Caught OOM for %d byte image, url=%s", Integer.valueOf(c4522h.f16797b.length), m20434c());
return C4529m.m20454a(new C6304j(e));
}
}
return a;
}
/* renamed from: a */
private static int m28067a(int i, int i2, int i3, int i4) {
i = Math.min(((double) i) / ((double) i3), ((double) i2) / ((double) i4));
i3 = 1065353216;
while (true) {
i4 = 1073741824 * i3;
if (((double) i4) > i) {
return (int) i3;
}
i3 = i4;
}
}
}
| [
"[email protected]"
] | |
0f42b2e4ef5ecdc8b13ab88e61232f9ea638da36 | 5e54a0ba1f44d202417d4d94313fb8e288a3cdb8 | /gaeatools-sortvcf/src/main/java/htsjdk/samtools/util/AbstractAsyncWriter.java | f69578c072da748a59a921fd559e54b4117de626 | [] | no_license | huangzhibo/gaeatools | d79fc0917df92ace95c060a112e3340e183e6a78 | fb0b99255ad6cf9f206fb3ca0bc0baa44730dac6 | refs/heads/master | 2020-12-30T16:27:57.908467 | 2018-09-04T08:14:23 | 2018-09-04T08:14:23 | 90,990,518 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,876 | java | package htsjdk.samtools.util;
import java.io.Closeable;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
/**
* Abstract class that is designed to be extended and specialized to provide an asynchronous
* wrapper around any kind of Writer class that takes an object and writes it out somehow.
*
* NOTE: Objects of subclasses of this class are not intended to be shared between threads.
* In particular there must be only one thread that calls {@link #write} and {@link #close}.
*
* NOTE: Any exception thrown by the underlying Writer will be propagated back to the caller
* during the next available call to {@link #write} or {@link #close}. After the exception
* has been thrown to the caller, it is not safe to attempt further operations on the instance.
*
* @author Tim Fennell
*/
public abstract class AbstractAsyncWriter<T> implements Closeable {
private static volatile int threadsCreated = 0; // Just used for thread naming.
public static final int DEFAULT_QUEUE_SIZE = 2000;
private final AtomicBoolean isClosed = new AtomicBoolean(false);
private final BlockingQueue<T> queue;
private final Thread writer;
private final WriterRunnable writerRunnable;
private final AtomicReference<Throwable> ex = new AtomicReference<Throwable>(null);
/** Returns the prefix to use when naming threads. */
protected abstract String getThreadNamePrefix();
protected abstract void synchronouslyWrite(final T item);
protected abstract void synchronouslyClose();
/**
* Creates an AbstractAsyncWriter that will use the provided WriterRunnable to consume from the
* internal queue and write records into the synchronous writer.
*/
protected AbstractAsyncWriter(final int queueSize) {
this.queue = new ArrayBlockingQueue<T>(queueSize);
this.writerRunnable = new WriterRunnable();
this.writer = new Thread(writerRunnable, getThreadNamePrefix() + threadsCreated++);
this.writer.setDaemon(true);
this.writer.start();
}
/**
* Public method for sub-classes or ultimately consumers to put an item into the queue
* to be written out.
*/
public void write(final T item) {
if (this.isClosed.get()) throw new RuntimeIOException("Attempt to add record to closed writer.");
checkAndRethrow();
try { this.queue.put(item); }
catch (final InterruptedException ie) { throw new RuntimeException("Interrupted queueing item for writing.", ie); }
checkAndRethrow();
}
/**
* Attempts to finish draining the queue and then calls synchronouslyClose() to allow implementation
* to do any one time clean up.
*/
@Override
public void close() {
checkAndRethrow();
if (!this.isClosed.getAndSet(true)) {
try {
if (this.queue.isEmpty()) this.writer.interrupt(); // signal to writer clean up
this.writer.join();
} catch (final InterruptedException ie) {
throw new RuntimeException("Interrupted waiting on writer thread.", ie);
}
//The queue should be empty but if it's not, we'll drain it here to protect against any lost data.
//There's no need to timeout on poll because poll is called only when queue is not empty and
// at this point the writer thread is definitely dead and noone is removing items from the queue.
//The item pulled will never be null (same reasoning).
while (!this.queue.isEmpty()) {
final T item = queue.poll();
synchronouslyWrite(item);
}
synchronouslyClose();
checkAndRethrow();
}
}
/**
* Checks to see if an exception has been raised in the writer thread and if so rethrows it as an Error
* or RuntimeException as appropriate.
*/
private final void checkAndRethrow() {
final Throwable t = this.ex.getAndSet(null);
if (t != null) {
this.isClosed.set(true); // Ensure no further attempts to write
if (t instanceof Error) throw (Error) t;
if (t instanceof RuntimeException) throw (RuntimeException) t;
else throw new RuntimeException(t);
}
}
/**
* Small Runnable implementation that simply reads from the blocking queue and writes to the
* synchronous writer.
*/
private class WriterRunnable implements Runnable {
@Override
public void run() {
try {
//The order of the two conditions is important, see https://github.com/samtools/htsjdk/issues/564
//because we want to make sure that emptiness status of the queue does not change after we have evaluated isClosed
//as it is now (isClosed checked before queue.isEmpty),
//the two operations are effectively atomic if isClosed returns true
while (!isClosed.get() || !queue.isEmpty()) {
try {
final T item = queue.poll(2, TimeUnit.SECONDS);
if (item != null) synchronouslyWrite(item);
}
catch (final InterruptedException ie) {
/* Do Nothing */
}
}
}
catch (final Throwable t) {
ex.compareAndSet(null, t);
// In case a writer was blocking on a full queue before ex has been set, clear the queue
// so that the writer will no longer be blocked so that it can see the exception.
queue.clear();
}
}
}
}
| [
"[email protected]"
] | |
a494633f41c2663d65e004a386b6533d5c02ca62 | ac60f4e0aebd61b2d0892ffebdf9182b0f7b2daa | /pgn/poo/pgn/poo/examenMarzoSevillanoVegaVictoriano/TrianguloRectangulo.java | e7735a9edc71b7236c56fe56459b3553e6781d5c | [] | no_license | Vsevillano/Figuras | c9af0852ec745648fb3b716b9da1ee673025a8fb | 2970d84b7f5914e578269cafccfd85ec8eb517d2 | refs/heads/master | 2021-01-19T04:07:27.322105 | 2017-04-06T14:37:13 | 2017-04-06T14:37:13 | 87,351,046 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,011 | java | package pgn.poo.examenMarzoSevillanoVegaVictoriano;
/**
*
* @author Victoriano Sevillano Vega
* @version 1.0
*/
public class TrianguloRectangulo extends Figura {
/**
* Bade del rectangulo
*/
private double base;
/**
* Altura del rectangulo
*/
private double altura;
/**
* Constructor del rectangulo
*
* @param base
* @param altura
* @throws DimensionMenorQueCeroException
*/
public TrianguloRectangulo(double base, double altura) throws DimensionMenorQueCeroException {
super();
setBase(base);
setAltura(altura);
}
/**
* Obtiene la base del rectangulo
*
* @return
*/
public double getBase() {
return base;
}
/**
* Asigna la base al rectangulo
*
* @param base
* @throws DimensionMenorQueCeroException
*/
public void setBase(double base) throws DimensionMenorQueCeroException {
comprobarDimension(base);
this.base = base;
}
/**
* Obtiene la altura del rectangulo
*
* @return
*/
public double getAltura() {
return altura;
}
/**
* Asigna la altura al rectangulo
*
* @param altura
* @throws DimensionMenorQueCeroException
*/
public void setAltura(double altura) throws DimensionMenorQueCeroException {
comprobarDimension(altura);
this.altura = altura;
}
/*
* (non-Javadoc)
*
* @see pgn.poo.examenMarzoSevillanoVegaVictoriano.Figura#area()
*/
@Override
double area() {
return (base * altura) / 2;
}
/*
* (non-Javadoc)
*
* @see pgn.poo.examenMarzoSevillanoVegaVictoriano.Figura#perimetro()
*/
@Override
double perimetro() {
return base + altura + Math.sqrt((Math.pow(base, 2) + Math.pow(altura, 2)));
}
/*
* (non-Javadoc)
*
* @see pgn.poo.examenMarzoSevillanoVegaVictoriano.Figura#toString()
*/
@Override
public String toString() {
return getClass().getSimpleName() + "\t" + super.toString() + "[base=" + getBase() + ", altura=" + getAltura()
+ "]\n";
}
}
| [
"[email protected]"
] | |
d5ccf80df9e50bdd0db98b728fc5e4dd3dced157 | 564599a9af37e1161c69e33501ea5358d614e067 | /OCCS-android/app/build/generated/source/buildConfig/androidTest/debug/com/occs/ldsoft/occs/test/BuildConfig.java | c92863635b4bc582e99f8a1fab10154f09fc010c | [] | no_license | gitoccs/OCCSAPP | 331d84dab97bfd783cbe33def1c77136a775b38f | 152076d3bad32d5164a19e966180ff05bd427bae | refs/heads/master | 2021-01-10T10:46:38.627622 | 2016-01-16T10:19:59 | 2016-01-16T10:19:59 | 49,765,302 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 461 | java | /**
* Automatically generated file. DO NOT MODIFY
*/
package com.occs.ldsoft.occs.test;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.occs.ldsoft.occs.test";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 212;
public static final String VERSION_NAME = "2.1.2";
}
| [
"[email protected]"
] | |
adc56bbe8b5b1e88ce418a0edb4388724832432d | 128eb90ce7b21a7ce621524dfad2402e5e32a1e8 | /laravel-converted/src/main/java/com/project/convertedCode/includes/vendor/nikic/php_parser/lib/PhpParser/Node/Scalar/MagicConst/file_Function__php.java | 29ada24862d41a873fa274df027c11a77d3addbd | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | RuntimeConverter/RuntimeConverterLaravelJava | 657b4c73085b4e34fe4404a53277e056cf9094ba | 7ae848744fbcd993122347ffac853925ea4ea3b9 | refs/heads/master | 2020-04-12T17:22:30.345589 | 2018-12-22T10:32:34 | 2018-12-22T10:32:34 | 162,642,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,121 | java | package com.project.convertedCode.includes.vendor.nikic.php_parser.lib.PhpParser.Node.Scalar.MagicConst;
import com.runtimeconverter.runtime.RuntimeStack;
import com.runtimeconverter.runtime.interfaces.ContextConstants;
import com.runtimeconverter.runtime.includes.RuntimeIncludable;
import com.runtimeconverter.runtime.includes.IncludeEventException;
import com.runtimeconverter.runtime.classes.RuntimeClassBase;
import com.runtimeconverter.runtime.RuntimeEnv;
import com.runtimeconverter.runtime.interfaces.UpdateRuntimeScopeInterface;
import com.runtimeconverter.runtime.arrays.ZPair;
/*
Converted with The Runtime Converter (runtimeconverter.com)
vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php
*/
public class file_Function__php implements RuntimeIncludable {
public static final file_Function__php instance = new file_Function__php();
public final void include(RuntimeEnv env, RuntimeStack stack) throws IncludeEventException {
Scope2156 scope = new Scope2156();
stack.pushScope(scope);
this.include(env, stack, scope);
stack.popScope();
}
public final void include(RuntimeEnv env, RuntimeStack stack, Scope2156 scope)
throws IncludeEventException {
// Namespace import was here
// Conversion Note: class named Function_ was here in the source code
env.addManualClassLoad("PhpParser\\Node\\Scalar\\MagicConst\\Function_");
}
private static final ContextConstants runtimeConverterContextContantsInstance =
new ContextConstants()
.setDir("/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst")
.setFile(
"/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php");
public ContextConstants getContextConstants() {
return runtimeConverterContextContantsInstance;
}
private static class Scope2156 implements UpdateRuntimeScopeInterface {
public void updateStack(RuntimeStack stack) {}
public void updateScope(RuntimeStack stack) {}
}
}
| [
"[email protected]"
] | |
663615c3e7787b491e89f02ae7504ca4cf541013 | a11912089c130f091f08efdb153a830c3c88338d | /src/BookTester.java | 2b60b3b15a34fe3dec694e176f0460909bebded3 | [] | no_license | RU-ITI202/fall17-assignment-1-jjz92 | f3a611fecddacff799e008d55f9a9936f1c7f16e | 4d8eae05adaace711600a46ee38b1e133d6db81a | refs/heads/master | 2021-07-15T09:20:30.493203 | 2017-10-22T03:20:19 | 2017-10-22T03:20:19 | 107,825,474 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 548 | java | /**
*
*/
/**
* @author
*
*/
public class BookTester {
/**
* @param args
*/
public static void main(String[] args) {
Book example = new Book("The Da Vinci Code");
System.out.println("Title (should be The Da Vinci Code): " + example.getTitle());
System.out.println("Borrowed? (should be false): " + example.isBorrowed());
example.rented();
System.out.println("Borrowed? (should be true): " + example.isBorrowed());
example.returned();
System.out.println("Borrowed? (should be false): " + example.isBorrowed());
}
}
| [
"[email protected]"
] | |
5a17ee1207bdd59d0a65b42ba33647df702230ba | 146f83fce82ba05242f7bfa9bbaa838a66bcb392 | /CheckPrimeNum.java | 71e9837d75ba8e95b107a867f9e74f43cfc4ae5b | [] | no_license | Navjoban/javaproblems | ca953bf32d8bc00d8933238df4aadc8e90271a8d | bc6c5d34e50b44cb770ec3c1f39df98a9233e35f | refs/heads/main | 2023-05-02T17:44:24.720052 | 2021-05-25T03:49:30 | 2021-05-25T03:49:30 | 370,546,877 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 795 | java | // check whether a number can be expressed as sum of two prime numbers
public class CheckPrimeNum {
public static void main(String[] args) {
int num = 34;
for (int i=2;i<=num/2;i++){ //check from 2 --> number/2 to look for pairs, that will be i and num - i
if( CheckPrime(i)){
if(CheckPrime(num-i)){
System.out.println(i + " "+(num -i));
}
}
}
}
public static boolean CheckPrime(int num){
boolean isPrime = true;
for (int i = 2;i<=num/2;i++){
if(num%i==0){
isPrime = false;
break;
}
}
return isPrime;
}
}
| [
"[email protected]"
] | |
1276988a56c33303ba4ecb9386a992543201b3d8 | a1b380e1e15304b654637c3c83fe49b47affb608 | /fwb-cli/src/test/java/sub/fwb/MainTest.java | d277b337c93c8d501b9a61202fe8ddebe9e5295d | [] | no_license | subugoe/fwb-index-creator | 4c0ac97e7eb927a6d0cf38d4f22c1a5e31e4a64e | 1658ddb4aec86711abedf088d4da7ac85f3c333a | refs/heads/master | 2021-05-22T07:48:07.952537 | 2018-04-09T09:52:12 | 2018-04-09T09:52:12 | 52,072,489 | 0 | 1 | null | 2021-05-12T00:16:46 | 2016-02-19T08:18:49 | Java | UTF-8 | Java | false | false | 2,787 | java | package sub.fwb;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class MainTest {
private Main main = new Main();
private ByteArrayOutputStream baos;
private Importer importerMock = mock(Importer.class);
@Before
public void setUp() throws Exception {
baos = new ByteArrayOutputStream();
PrintStream out = new PrintStream(baos);
main.setLogOutput(out);
main.setImporter(importerMock);
}
@After
public void tearDown() throws Exception {
}
@Test
public void shouldExecuteAllStages() throws Exception {
String[] args = { "-convert", "-compare", "-upload", "-test", "-excel", "target/sources.xls", "-teidir",
"target/teis", "-solrxmldir", "target/output", "-solr", "http://localhost/solr", "-core", "mycore" };
main.execute(args);
verify(importerMock).convertAll("target/sources.xls", "target/teis", "target/output");
verify(importerMock).compareAll("target/teis", "target/output");
verify(importerMock).uploadAll("target/output", "http://localhost/solr", "mycore");
verify(importerMock).runTests("http://localhost/solr", "mycore");
assertThat(mainOutput(), containsString("minutes"));
}
@Test
public void shouldExecuteConversion() throws Exception {
String[] args = { "-convert", "-excel", "target/sources.xls", "-teidir", "target/teis", "-solrxmldir",
"target/output" };
main.execute(args);
verify(importerMock).convertAll("target/sources.xls", "target/teis", "target/output");
verify(importerMock, times(0)).uploadAll(anyString(), anyString(), anyString());
}
@Test
public void shouldExecuteUpload() throws Exception {
String[] args = { "-upload", "-solrxmldir", "target/output", "-solr", "http://localhost/solr", "-core", "mycore" };
main.execute(args);
verify(importerMock, times(0)).convertAll(anyString(), anyString(), anyString());
verify(importerMock).uploadAll("target/output", "http://localhost/solr", "mycore");
}
@Test
public void shouldComplainAboutWrongArgument() throws Exception {
String[] args = { "-somethingwrong" };
main.execute(args);
verify(importerMock, times(0)).convertAll(anyString(), anyString(), anyString());
verify(importerMock, times(0)).uploadAll(anyString(), anyString(), anyString());
assertThat(mainOutput(), containsString("Illegal arguments"));
}
@Test
public void shouldComplainAboutMissingArgument() throws Exception {
String[] args = { "-convert" };
main.execute(args);
assertThat(mainOutput(), containsString("Missing required arguments"));
}
private String mainOutput() {
return new String(baos.toByteArray());
}
}
| [
"[email protected]"
] | |
56f1402c959162363ccf7c1ad570f1dd5b8f0613 | 1a08320eb2f4b51bb696e2b8db9cf7bf7862f04f | /app/src/main/java/justynachrustna/justjava/MainActivity.java | 8fb8f62f1cac0f5fe698f24343edd3e852cde4db | [] | no_license | JustynaChrustna/JustJava | 22365f07b4acc1ed32d3a9a2d0e7f0fdec7d65e3 | 4c7b8093c7dbcfb5a07e3073bcafc29fb88c3430 | refs/heads/master | 2021-05-15T15:36:20.965940 | 2017-10-18T12:07:57 | 2017-10-18T12:07:57 | 107,402,129 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,561 | java | package justynachrustna.justjava;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.CheckBox;
import android.widget.Checkable;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import java.text.NumberFormat;
/**
* This app displays an order form to order coffee.
*/
public class MainActivity extends AppCompatActivity {
int quantity = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
/**
* This method is called when the order button is clicked.
*/
public void submitOrder(View view) {
CheckBox whippedCreamCheckBox = (CheckBox) findViewById(R.id.whipped_cream);
boolean hasWhippedCream = whippedCreamCheckBox.isChecked();
CheckBox chocolateCheckBox = (CheckBox) findViewById(R.id.chocolate);
boolean hasChocolate = chocolateCheckBox.isChecked();
EditText nameCheckBox = (EditText) findViewById(R.id.edit_text_name);
String name = nameCheckBox.getText().toString();
int price = calculatePrice(hasChocolate, hasWhippedCream);
String message = crateOrderSummary(price, hasWhippedCream, hasChocolate, name);
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("mailto:")); // only email apps should handle this
intent.putExtra(Intent.EXTRA_SUBJECT, "Just Java order for " + name);
intent.putExtra(Intent.EXTRA_TEXT, message);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
private int calculatePrice(boolean hasChocolate, boolean hasWhippedCream) {
int basePrice = 5;
if (hasWhippedCream) {
basePrice = basePrice + 1;
}
if (hasChocolate) {
basePrice = basePrice + 2;
}
return basePrice * quantity;
}
public void decrement(View view) {
if (quantity > 0) {
quantity = quantity - 1;
displayQuantity(quantity);
} else {
quantity = 1;
Toast.makeText(this, R.string.toast_less, Toast.LENGTH_SHORT).show();
}
}
public void increment(View view) {
if (quantity < 100) {
quantity = quantity + 1;
displayQuantity(quantity);
} else {
quantity = 100;
Toast.makeText(this, R.string.toast_more, Toast.LENGTH_SHORT).show();
}
}
private String crateOrderSummary(int price, boolean hasWhippedCream, boolean hasChocolate, String name) {
String priceMessage = getString(R.string.order_sumary_name)+name;
priceMessage+="\n"+getString(R.string.add_whipped_cream)+hasWhippedCream;
priceMessage+="\n"+ getString(R.string.add_chocolate)+hasChocolate;
priceMessage+="\n"+ getString(R.string.order_quantity)+quantity;
priceMessage+="\n"+getString(R.string.total)+NumberFormat.getCurrencyInstance().format(price);
priceMessage+="\n"+getString(R.string.thank_you);
return priceMessage;
}
/**
* This method displays the given quantity value on the screen.
*/
private void displayQuantity(int number) {
TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
}
| [
"[email protected]"
] | |
a901647a99279ee29f07aa1df52f934441cb264f | c48248101bcb703be1a5c450641bd958a6180177 | /src/main/java/Utils/CustomHashSet.java | 43c27d8d8ce30f8dc27802ca5bf1d15b32bf9b00 | [] | no_license | Bergiel195561/Projekt_zaaw_java | 1f8823310cba95147f60b9ae3fc66901f21c6312 | 4b8e0b6a9f84adba109ecb53b3882125b63272e1 | refs/heads/develop | 2021-01-20T00:30:02.057322 | 2017-06-13T14:21:05 | 2017-06-13T14:21:05 | 89,143,090 | 0 | 0 | null | 2017-06-13T14:21:06 | 2017-04-23T13:16:17 | Java | UTF-8 | Java | false | false | 745 | java | package Utils;
import java.util.Iterator;
import java.util.LinkedHashSet;
/**
* Klasa generyczna rozszerzająca LinkedHashSet
* @author krystian
*/
public class CustomHashSet<T> extends LinkedHashSet<T> {
/**
* Pobieranie elementu o danym indeksie
* @param index - index elemenu
* @return Obiekt typu T
*/
public T get(int index) {
Iterator iterator = this.iterator();
T elementAtIndex = null;
if (index >= this.size() || index < 0){
throw new ArrayIndexOutOfBoundsException();
}
int i = 0;
while (iterator.hasNext() && i <= index) {
elementAtIndex = (T) iterator.next();
i++;
}
return elementAtIndex;
}
}
| [
"[email protected]"
] | |
f8c59d0e85756b0dd46f3584fa8f67853638a462 | 72cd7ec994cdab67edb00c662a1a075ca5ed629d | /src/main/java/com/onlineshopping/sample/OnlineShopping/ProductService.java | 6cfaac24bc7722698495e6c45f861cf649eb8250 | [] | no_license | srinaththota/ShopBackEnd | 4f19c521f545457187f03c0426e01769a9c940b1 | 98c0222afb75464718acc26874bcbd1aa80926c5 | refs/heads/master | 2021-07-05T03:20:51.912593 | 2017-09-27T08:40:03 | 2017-09-27T08:40:03 | 104,992,517 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,181 | java | package com.onlineshopping.sample.OnlineShopping;
import java.util.Arrays;
import java.util.List;
public class ProductService {
List getProductsfromMongo(){
List<Product> l=Arrays.asList(
new Product(1001,"http://media.istockphoto.com/photos/the-carefree-days-picture-id488027919","iStock"),
new Product(1002,"http://www.hs-ltd.com/wp-content/uploads/2016/07/The-Men%E2%80%99s-Fashion-Basics.jpg","in USA"),
new Product(1003,"http://st1.bollywoodlife.com/wp-content/uploads/photos/katrina-kaif-in-a-fashion-show-201602-673123.jpg","Bollywood dress"),
new Product(1004,"http://media.santabanta.com/gal/Fashion/Aditya-and-Katrina-at-Tarun-Tahiliani-Fashion-Show/aditya-and-katrina-at-tarun-tahiliani-fashion-show-16.jpg","Modelling dress"),
new Product(1005,"http://cdn1.chitramala.in/wp-content/uploads/2017/05/Raasi-Khanna.jpg","South heroine dress"),
new Product(1006,"https://2.bp.blogspot.com/--vCy4X2bLvk/V18Io8ckXjI/AAAAAAAF450/ClXjpH2XJL4karHKCg5WDFGz9GTFktUVwCLcB/s1600/CineMaa-Awards-2016-Red-carpet-043.jpg","South saree"));
return l;
}
public List getMenProductsfromMongo() {
// TODO Auto-generated method stub
List<Product> l=Arrays.asList(
new Product(1001,"http://media.istockphoto.com/photos/the-carefree-days-picture-id488027919","iStock"),
new Product(1002,"http://www.hs-ltd.com/wp-content/uploads/2016/07/The-Men%E2%80%99s-Fashion-Basics.jpg","in USA"));
return l;
}
public List getWomenProductsfromMongo() {
List<Product> l=Arrays.asList(
new Product(1003,"http://st1.bollywoodlife.com/wp-content/uploads/photos/katrina-kaif-in-a-fashion-show-201602-673123.jpg","Bollywood dress"),
new Product(1004,"http://media.santabanta.com/gal/Fashion/Aditya-and-Katrina-at-Tarun-Tahiliani-Fashion-Show/aditya-and-katrina-at-tarun-tahiliani-fashion-show-16.jpg","Modelling dress"),
new Product(1005,"http://cdn1.chitramala.in/wp-content/uploads/2017/05/Raasi-Khanna.jpg","South heroine dress"),
new Product(1006,"https://2.bp.blogspot.com/--vCy4X2bLvk/V18Io8ckXjI/AAAAAAAF450/ClXjpH2XJL4karHKCg5WDFGz9GTFktUVwCLcB/s1600/CineMaa-Awards-2016-Red-carpet-043.jpg","South saree"));
return l;
}
}
| [
"[email protected]"
] | |
ca450a4ada769afc53877a50ec5710ed4633407d | 00cedfde875754e4cf0574e838661fd40ef0ce1c | /SeleniumJava/src/JavaBasic/WrapperCLASS.java | 319e9c967e1c347ae7ff76d2a541cbb2ea7f98e7 | [] | no_license | jashangunike/Selenium-with-Java-basic | 6ef1f813bc1cb90bff6ca9608a5b34a55f1877ee | 60c17e378e37c5b30eb7532f4b5df92adcd1dae8 | refs/heads/master | 2020-03-12T07:04:35.668137 | 2018-10-02T21:05:03 | 2018-10-02T21:05:03 | 130,499,216 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 768 | java | package JavaBasic;
public class WrapperCLASS {
public static void main(String[] args) {
//String to int
String x = "100";
System.out.println(x+20); //10020
int y = Integer.parseInt(x);
System.out.println(y+20); // 120
//String to double
String p = "12.33";
System.out.println(p+20); // 12.3320
double p1 = Double.parseDouble(p);
System.out.println(p1+20); // 32.33
//int to string
int l = 20;
System.out.println(l+20); // 40
String j = String.valueOf(l);
System.out.println(j+10); // 2010
//double to string
double g = 12.02 ;
String h = String.valueOf(g);
System.out.println(h+05); //12.025
}
}
| [
"[email protected]"
] | |
ea788308d4e8e4ab856d2e9caa385fd9257e10fe | b234c815ff7fc8a468f8ed5582b24474cf8d4ef3 | /src/main/java/com/guilhermepisco/cursospring/resources/ClientResource.java | c31c5902cc3ea77d6a629084977a4ea5afdfca65 | [] | no_license | guilhermepisco19/curso_spring_ionic | 363ed149a0ca2624a97e77d94fc6ff34bb5d1b22 | ecef83b2cb6af135da7bfb4b89d42b3ca0f97630 | refs/heads/master | 2021-06-22T20:41:53.400260 | 2020-10-20T20:38:54 | 2020-10-20T20:38:54 | 214,268,181 | 0 | 0 | null | 2021-04-26T20:24:25 | 2019-10-10T19:26:52 | Java | UTF-8 | Java | false | false | 3,889 | java | package com.guilhermepisco.cursospring.resources;
import java.net.URI;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import com.guilhermepisco.cursospring.domain.Client;
import com.guilhermepisco.cursospring.dto.ClientDTO;
import com.guilhermepisco.cursospring.dto.ClientNewDTO;
import com.guilhermepisco.cursospring.services.ClientService;
@RestController
@RequestMapping(value="/clients")
public class ClientResource {
@Autowired
private ClientService service;
@RequestMapping(value= "/{id}", method=RequestMethod.GET)
public ResponseEntity<Client> find(@PathVariable Integer id) {
Client obj = service.find(id);
return ResponseEntity.ok().body(obj);
}
@RequestMapping(value = "/email", method=RequestMethod.GET)
public ResponseEntity<Client> findByEmail(@RequestParam(value="value") String email){
Client obj = service.findByEmail(email);
return ResponseEntity.ok().body(obj);
}
@PreAuthorize("hasAnyRole('ADMIN')")
@RequestMapping( method=RequestMethod.GET)
public ResponseEntity<List<ClientDTO>> findAll() {
List<Client> list = service.findAll();
List<ClientDTO> listDTO = list.stream().map(obj -> new ClientDTO(obj)).collect(Collectors.toList());
return ResponseEntity.ok().body(listDTO);
}
@PreAuthorize("hasAnyRole('ADMIN')")
@RequestMapping(value= "/page", method=RequestMethod.GET)
public ResponseEntity<Page<ClientDTO>> findPage(
@RequestParam(value="page", defaultValue="0") Integer page,
@RequestParam(value="linesPerPage", defaultValue="24") Integer linesPerPage, //24 its a good value because its multiple of 1,2,3
@RequestParam(value="orderBy", defaultValue="name") String orderBy,
@RequestParam(value="direction", defaultValue="ASC") String direction) {
Page<Client> list = service.findPage(page, linesPerPage, orderBy, direction);
Page<ClientDTO> listDTO = list.map(obj -> new ClientDTO(obj));
return ResponseEntity.ok().body(listDTO);
}
@RequestMapping(method=RequestMethod.POST)
public ResponseEntity<Void> insert(@Valid @RequestBody ClientNewDTO objDTO){
Client obj = service.fromDTO(objDTO);
obj = service.insert(obj);
URI uri = ServletUriComponentsBuilder.fromCurrentRequest()
.path("/{id}").buildAndExpand(obj.getId()).toUri();
return ResponseEntity.created(uri).build();
}
@RequestMapping(value= "/{id}", method=RequestMethod.PUT)
public ResponseEntity<Void> update(@Valid @RequestBody ClientDTO objDTO, @PathVariable Integer id){
Client obj = service.fromDTO(objDTO);
obj.setId(id);
obj = service.update(obj);
return ResponseEntity.noContent().build();
}
@PreAuthorize("hasAnyRole('ADMIN')")
@RequestMapping(value= "/{id}", method=RequestMethod.DELETE)
public ResponseEntity<Void> delete(@PathVariable Integer id) {
service.delete(id);
return ResponseEntity.noContent().build();
}
@RequestMapping(value= "/picture",method=RequestMethod.POST)
public ResponseEntity<Void> uploadProfilePicture(@RequestParam(name="file") MultipartFile multipartFile){
URI uri = service.uploadProfilePicture(multipartFile);
return ResponseEntity.created(uri).build();
}
}
| [
"[email protected]"
] | |
e26753f0490d7e69cdb36efe1b616a5985fb2375 | f06396f5a1dff61e8e80dee12c95ccf1309a6f99 | /Java basic advanced/Day01Demo/src/com/feng/_17引用类型作为成员变量的类型/Address.java | 4d86059abfa295fa2e74b8f48ef795c773d45272 | [] | no_license | Anthony-bird/javaSE | 2ef0d4ae56d5141df37e70e705b42c6a1c740ce3 | 38e3514742180e1bb36da949f6796a575ec7bd24 | refs/heads/master | 2022-12-13T07:05:37.823721 | 2020-09-07T13:33:32 | 2020-09-07T13:33:32 | 289,448,456 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 860 | java | package com.feng._17引用类型作为成员变量的类型;
public class Address {
private String code;
private String name;
private double x;
private double y;
public Address() {
}
public Address(String code, String name, double x, double y) {
this.code = code;
this.name = name;
this.x = x;
this.y = y;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getX() {
return x;
}
public void setX(double x) {
this.x = x;
}
public double getY() {
return y;
}
public void setY(double y) {
this.y = y;
}
} | [
"[email protected]"
] | |
35efa71f5c39da3ef4871ecaf4fc0e4858d51d6a | 4ebbd07f16f4829361345f35329e588712312032 | /core/src/com/mygdx/game/States/LostGameState.java | bc70a789cbec229ec47bf35632980365036e8bce | [] | no_license | sklepis/Haunted | 26d56865529bc77f76d68ea2b4878f30298b71e9 | e5c668bb41e22877980dff0310a497cc252cf8ac | refs/heads/master | 2021-08-28T15:34:50.515425 | 2017-12-12T16:42:02 | 2017-12-12T16:42:02 | 106,100,539 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 573 | java | package com.mygdx.game.States;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
/**
* Created by cheapsoft on 10/11/2017.
*/
public class LostGameState extends State {
public LostGameState(com.mygdx.game.Managers.GameStateManager gsm) {
super(gsm);
}
@Override
protected void handleInput() {
}
@Override
public void update(float dt) {
}
@Override
public void render(SpriteBatch sb) {
}
@Override
public void dispose() {
}
@Override
public void resize(int width, int height) {
}
}
| [
"[email protected]"
] | |
25a79f00d2ac471768b93394afa1f10814aeb4a8 | 65f234039e8a2d1862a279d89a0017b2c96e2b90 | /app/src/main/java/com/del/flc/CMValue.java | 7c6f54865f354243e2459c6119b4f36161af6ccc | [] | no_license | johni5/colormusic | 0eb0c01905bb80e5802f27ccbaf2fe44cf948992 | 18366b86d696ff48a9f8abbfb49cd9c2ddd05f05 | refs/heads/master | 2023-04-05T05:22:05.042027 | 2021-03-23T10:14:14 | 2021-03-23T10:14:14 | 350,630,555 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,941 | java | package com.del.flc;
import com.del.flc.rxtx.Connection;
import com.del.flc.rxtx.Session;
import javax.swing.*;
abstract public class CMValue {
protected String title;
protected int cmd;
protected Connection connectionManager;
private CMValueChangeListener listener;
private volatile boolean ignoreUpdate;
public CMValue(String title, int cmd) {
this.title = title;
this.cmd = cmd;
}
public Connection getConnectionManager() {
return connectionManager;
}
public void setConnectionManager(Connection connectionManager) {
this.connectionManager = connectionManager;
}
abstract void setEditable(boolean editable);
abstract public int getValue();
abstract public boolean setValue(String value);
abstract public boolean equalsValue(String value);
public void addChangeValueListener(CMValueChangeListener listener) {
this.listener = listener;
}
public void setVisible(boolean v) {
getComponent().setVisible(v);
}
public boolean isVisible() {
return getComponent().isVisible();
}
public int getCmd() {
return cmd;
}
public String getTitle() {
return title;
}
abstract public JComponent getComponent();
protected void notifyListeners() {
if (listener != null) listener.actionPerformed(new CMValueChangeEvent(this, null));
}
public void readState() {
if (isVisible())
this.connectionManager.send(new Session(
3,
cmd,
-1,
data -> {
if (!equalsValue(data)) {
return setValue(data);
}
return true;
},
rxtx -> {
setEditable(false);
return true;
},
rxtx -> {
setEditable(true);
return true;
}
));
}
public boolean isIgnoreUpdate() {
return ignoreUpdate;
}
public void setIgnoreUpdate(boolean ignoreUpdate) {
this.ignoreUpdate = ignoreUpdate;
}
public void writeState(boolean force) {
if (!ignoreUpdate)
this.connectionManager.send(new Session(
3,
cmd,
getValue(),
data -> force || equalsValue(data),
rxtx -> {
setEditable(false);
return true;
},
rxtx -> {
setEditable(true);
notifyListeners();
return true;
}
)); // если getValue() == -1 то не отсылал
}
}
| [
"[email protected]"
] | |
4b9a2140d457734f1f18912b67bf3d32b24a1ad4 | 7c70687e82b86bde4330c7766164b4bc372cf9bb | /mobile/src/main/java/com/longngohoang/twitter/mobile/ui/base/defaultfragment/DefaultFragment.java | 885624330797302ac57c7e89ea9c01f94466287f | [
"Apache-2.0"
] | permissive | beyonderVN/TwitterClient | 957ad5938e8f34628f13ccd813d5d9294144af2e | 21a030f564ae605f42612a17d9cb88fe9f97089a | refs/heads/master | 2021-01-12T15:41:09.574586 | 2016-11-07T09:50:08 | 2016-11-07T09:50:08 | 71,850,782 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,988 | java | package com.longngohoang.twitter.mobile.ui.base.defaultfragment;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import android.widget.ViewAnimator;
import com.longngohoang.twitter.appcore.common.recyclerviewhelper.InfiniteScrollListener;
import com.longngohoang.twitter.mobile.R;
import com.longngohoang.twitter.mobile.ui.base.BaseFragment;
import butterknife.BindInt;
import butterknife.BindView;
import butterknife.ButterKnife;
public abstract class DefaultFragment extends BaseFragment<DefaultPresentationModel, DefaultView, DefaultPresenter>
implements DefaultView {
private static final String TAG = "DefaultFragment";
private static final int POSITION_CONTENT_VIEW = 0;
private static final int POSITION_PROGRESS_VIEW = 1;
View view;
@BindInt(R.integer.column_num_news)
int columnNum;
@BindView(R.id.rvTweetList)
RecyclerView listRV;
@BindView(R.id.srRefresh)
SwipeRefreshLayout swipeRefresh;
@BindView(R.id.vaStateControl)
ViewAnimator resultAnimator;
private DefaultAdapter defaultAdapter;
@Override
public void onResume() {
super.onResume();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
if (view == null) {
view = inflater.inflate(R.layout.fragment_tweet, container, false);
ButterKnife.bind(this, view);
setupUI();
}
return view;
}
void setupUI() {
setupRV();
setupSwipeRefreshLayout();
}
void setupRV() {
final StaggeredGridLayoutManager staggeredGridLayoutManagerVertical =
new StaggeredGridLayoutManager(
columnNum, //The number of Columns in the grid
LinearLayoutManager.VERTICAL);
staggeredGridLayoutManagerVertical.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS);
staggeredGridLayoutManagerVertical.invalidateSpanAssignments();
listRV.setLayoutManager(staggeredGridLayoutManagerVertical);
listRV.setHasFixedSize(true);
RecyclerView.ItemAnimator itemAnimator = new DefaultItemAnimator();
itemAnimator.setAddDuration(3000);
itemAnimator.setRemoveDuration(3000);
listRV.setItemAnimator(itemAnimator);
listRV.addOnScrollListener(new InfiniteScrollListener(staggeredGridLayoutManagerVertical) {
@Override
public void onLoadMore() {
Log.d(TAG, "onLoadMore: ");
try {
presenter.fetchMore();
} catch (Exception e) {
e.getStackTrace();
}
}
@Override
public boolean isLoading() {
return presenter.getPresentationModel().isLoadingMore();
}
@Override
public boolean isNoMore() {
return presenter.getPresentationModel().isNoMore();
}
});
}
private void setupSwipeRefreshLayout() {
swipeRefresh.setColorSchemeResources(R.color.colorPrimaryDark);
swipeRefresh.setOnRefreshListener(() -> {
listRV.setLayoutFrozen(true);
swipeRefresh.setRefreshing(true);
(new Handler()).postDelayed(() -> {
Log.d("Swipe", "Refreshing Number");
refresh();
}, 500);
});
}
void refresh() {
presenter.fetchRepositoryFirst(columnNum);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
@Override
public void onStart() {
Log.d(TAG, "onStart: ");
super.onStart();
presenter.fetchRepository(columnNum);
}
@Override
public void onDetach() {
super.onDetach();
}
@NonNull
@Override
protected DefaultPresentationModel createPresentationModel() {
return new DefaultPresentationModel();
}
@Override
public void onDestroyView() {
if (view.getParent() != null) {
((ViewGroup) view.getParent()).removeView(view);
}
super.onDestroyView();
}
@Override
public void showProcess() {
if (resultAnimator.getDisplayedChild() == POSITION_PROGRESS_VIEW) return;
resultAnimator.setDisplayedChild(POSITION_PROGRESS_VIEW);
swipeRefresh.setRefreshing(false);
}
@Override
public void showContent() {
if (resultAnimator.getDisplayedChild() == POSITION_CONTENT_VIEW) return;
resultAnimator.setDisplayedChild(POSITION_CONTENT_VIEW);
}
@Override
public void updateView() {
if (defaultAdapter == null) {
defaultAdapter = new DefaultAdapter(getContext(), presenter.getPresentationModel());
listRV.setAdapter(defaultAdapter);
} else {
defaultAdapter.notifyDataSetChanged();
}
listRV.setLayoutFrozen(false);
swipeRefresh.setRefreshing(false);
showContent();
}
@Override
public void showError(String s) {
Toast.makeText(getContext(), "Error: "+s , Toast.LENGTH_SHORT).show();
}
}
| [
"[email protected]"
] | |
2895f0654f324a1c32657b01f026501f97a0494a | 177f9ce4ddb3a70f638a768ec7e2a86c1d417555 | /app/src/main/java/com/journals/interesjournals/ui/adapter/ArchiveHeadAdapter.java | b5a83d85aeeff7b4f67e764eef0bb44bd1339b70 | [] | no_license | suresh429/interesjournals | f5da31612373843fe2447149527070d511913c4e | 65efebcaeed4d421a9a177f2e11ce37ab44ef637 | refs/heads/master | 2023-01-07T02:35:19.552815 | 2020-11-06T07:50:24 | 2020-11-06T07:50:24 | 310,528,310 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,249 | java | package com.journals.interesjournals.ui.adapter;
import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.journals.interesjournals.databinding.ArchiveHeadListItemBinding;
import com.journals.interesjournals.model.ArchiveResponse;
import java.util.List;
public class ArchiveHeadAdapter extends RecyclerView.Adapter<ArchiveHeadAdapter.ViewHolder> {
List<ArchiveResponse.ArchiveYearsBean> modelList;
public ArchiveHeadAdapter(List<ArchiveResponse.ArchiveYearsBean> modelList) {
this.modelList = modelList;
}
@NonNull
@Override
public ArchiveHeadAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(ArchiveHeadListItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
}
@SuppressLint("SetTextI18n")
@Override
public void onBindViewHolder(@NonNull ArchiveHeadAdapter.ViewHolder holder, int position) {
holder.rowItemBinding.txtArchiveHeadName.setText(modelList.get(position).getYear());
/* for (ArchiveChildItem item : modelList.get(position).getChildItemList()){
if (item.getYear().equalsIgnoreCase(modelList.get(position).getHeaderItemTitle())){
Log.d(TAG, "onBindViewHolder: "+item.getYear());
}
}*/
ArchiveChildAdapter archiveChildAdapter = new ArchiveChildAdapter(modelList.get(position).getArchive_details());
holder.rowItemBinding.recyclerviewChildList.setAdapter(archiveChildAdapter);
}
@Override
public int getItemCount() {
return modelList.size();
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public int getItemViewType(int position) {
return position;
}
public static class ViewHolder extends RecyclerView.ViewHolder {
ArchiveHeadListItemBinding rowItemBinding;
public ViewHolder(@NonNull ArchiveHeadListItemBinding rowItemBinding) {
super(rowItemBinding.getRoot());
this.rowItemBinding = rowItemBinding;
}
}
}
| [
"[email protected]"
] | |
e2bd26c4171f90cd85aba3dd6ec5f0b6df5c12e7 | 196a0bd943944389a938550af70964087ec74908 | /src/java/dao/GastosDao.java | 86edb6edb96b6407ec33079038c51ced74756c52 | [] | no_license | ander3324/MisFinanzas | a9d14b4b2e825ae7265d30223957b6aa32e1abae | 6bfdd436a79024546e4810724d17d9e17feb6334 | refs/heads/master | 2016-08-12T05:17:59.419651 | 2015-12-18T00:46:29 | 2015-12-18T00:46:29 | 48,205,963 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,996 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package dao;
import java.math.BigDecimal;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import orm.Gastos;
/**
*
* @author ander
*/
@Stateless
public class GastosDao {
// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")
@PersistenceContext
EntityManager em;
public List<Gastos> selectGastos(){
Query q = em.createQuery("Select g From Gastos g");
return q.getResultList();
}
public List<Gastos> selectGastos(String descripcion){
Query q = em.createQuery("Select g From Gastos g WHERE g.gas LIKE :descripcion");
q.setParameter("descripcion", "%" + descripcion + "%");
return q.getResultList();
}
public List<Gastos> selectUltimosGastos(){
Query q = em.createQuery("Select g From Gastos g Order By g.pkIdGas Desc");
q.setMaxResults(5);
return q.getResultList();
}
public BigDecimal selectTotalGastos(){
Query q = em.createQuery("Select SUM(g.val) From Gastos g");
return (BigDecimal)q.getSingleResult();
}
public Gastos selectGastoPorID(int id){
Query q = em.createQuery("Select g From Gastos g Where g.pkIdGas = :id");
q.setParameter("id", id);
return (Gastos)q.getSingleResult();
}
/*
*
* ABMs
*
*/
public void insertGasto(Gastos g){
//em.getTransaction().begin();
em.persist(g);
//em.getTransaction().commit();
}
public void updateGasto(Gastos g){
em.merge(g);
}
public void deleteGasto(Gastos g){
em.remove(em.merge(g));
}
}
| [
"[email protected]"
] | |
332bec1c1cc15ffd0e07c96ac210b4331563276a | 49b29d0cc72c5bbcbaeb6a26c2dedb4d0c22ae09 | /src/test/java/tw/ymeng/algorithm/proposition/histogram/VerticalBitRectangleTest.java | 4ae70fc12f8d16dd99af77ad4a8660a0b80e5bfb | [] | no_license | ymeng-think/AlgorithmImplementation | d12c12e41a5d3b10315d297d487e6579ea2e5a7b | cccd5ac04274406a46d96f6ed6f87816d69841e2 | refs/heads/master | 2021-01-16T19:34:05.793966 | 2013-07-14T01:48:38 | 2013-07-14T01:48:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,220 | java | package tw.ymeng.algorithm.proposition.histogram;
import org.junit.Test;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static tw.ymeng.algorithm.proposition.histogram.BitmapBuilder.O;
import static tw.ymeng.algorithm.proposition.histogram.BitmapBuilder.X;
public class VerticalBitRectangleTest {
@Test
public void should_get_area_of_bit_rectangle() {
VerticalBitRectangle bitRectangle = new VerticalBitRectangle(0, 2, 3);
assertThat(bitRectangle.area(), is(6L));
}
@Test
public void should_build_vertical_bit_rectangle_object_with_bit_array() {
boolean[] bitArray = {X, O, O, X};
VerticalBitRectangle bitRectangle = VerticalBitRectangle.convertFrom(bitArray);
assertThat(bitRectangle.area(), is(2L));
}
@Test
public void should_intersect_bit_rectangle_with_larger_bit_array() {
boolean[] bitArray = {X, O, O, X};
VerticalBitRectangle bitRectangle = VerticalBitRectangle.convertFrom(bitArray);
VerticalBitRectangle intersected = bitRectangle.intersect(new boolean[]{O, O, O, O});
assertThat(intersected.area(), is(4L));
}
@Test
public void should_intersect_bit_rectangle_with_smaller_bit_array() {
boolean[] bitArray = {X, O, O, O, X};
VerticalBitRectangle bitRectangle = VerticalBitRectangle.convertFrom(bitArray);
VerticalBitRectangle intersected = bitRectangle.intersect(new boolean[]{X, O, X, X, X});
assertThat(intersected.area(), is(2L));
}
@Test
public void should_intersect_without_intersection_region() {
boolean[] bitArray = {X, O, O, X};
VerticalBitRectangle bitRectangle = VerticalBitRectangle.convertFrom(bitArray);
VerticalBitRectangle intersected = bitRectangle.intersect(new boolean[]{O, X, X, O});
assertThat(intersected.area(), is(0L));
}
@Test
public void should_compare_area_size() {
VerticalBitRectangle bitRectangle1 = VerticalBitRectangle.convertFrom(new boolean[]{O, O, O, X});
VerticalBitRectangle bitRectangle2 = VerticalBitRectangle.convertFrom(new boolean[]{X, O, O, X});
assertTrue(bitRectangle1.isLargerThan(bitRectangle2));
}
@Test
public void should_intersect_bit_rectangles_even_though_they_have_no_intersection() {
VerticalBitRectangle bitRectangle1 = new VerticalBitRectangle(0, 2, 2);
VerticalBitRectangle bitRectangle2 = new VerticalBitRectangle(2, 2, 2);
VerticalBitRectangle intersected = bitRectangle1.intersect(bitRectangle2);
assertThat(intersected.area(), is(0L));
}
@Test
public void should_intersect_bit_rectangles_that_has_same_region() {
VerticalBitRectangle bitRectangle1 = new VerticalBitRectangle(1, 2, 2);
VerticalBitRectangle bitRectangle2 = new VerticalBitRectangle(1, 2, 2);
VerticalBitRectangle intersected = bitRectangle1.intersect(bitRectangle2);
assertThat(intersected.area(), is(8L));
}
@Test
public void should_intersect_bit_rectangle_with_the_other_which_is_smaller() {
VerticalBitRectangle bitRectangle1 = new VerticalBitRectangle(0, 2, 4);
VerticalBitRectangle bitRectangle2 = new VerticalBitRectangle(1, 2, 2);
VerticalBitRectangle intersected = bitRectangle1.intersect(bitRectangle2);
assertThat(intersected.area(), is(8L));
}
@Test
public void should_build_a_bit_rectangle_as_place_holder() {
assertThat(VerticalBitRectangle.holder(5).area(), is(0L));
}
@Test
public void should_intersect_holder_with_bit_array_that_start_with_1() {
VerticalBitRectangle holder = VerticalBitRectangle.holder(3);
VerticalBitRectangle intersected = holder.intersect(new boolean[]{O, X, X});
assertThat(intersected.area(), is(1L));
}
@Test
public void should_intersect_holder_with_bit_array_that_start_with_0() {
VerticalBitRectangle holder = VerticalBitRectangle.holder(3);
VerticalBitRectangle intersected = holder.intersect(new boolean[]{X, X, O});
assertThat(intersected.area(), is(1L));
}
}
| [
"[email protected]"
] | |
1e1c60eaae325be25f19fa582cacae837c81b3d5 | 9563d9452a8f013be5e47954fd1fe10f4d0416e9 | /src/Gopher.java | 87dc18af45887efae219c2b9eb36ed0fd30fee1c | [] | no_license | Putin200/newFolder | c747c9cbdc65b6d4593cf39dee98b2385ddba8e4 | 98aed06a7847f59a1d2f51ef4f16c35e0d0ace77 | refs/heads/master | 2020-09-02T19:27:12.244531 | 2019-11-03T11:30:44 | 2019-11-03T11:30:44 | 219,288,472 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 889 | java | public class Gopher{
private String color;
private String weight;
private String size;
public void east(){
}
public void all_data(String color,String weight,String size) {
setColor(color);
setWeight(weight);
setSize(size);
}
public String getall_data() {
return "окрас суслика:" + getColor() + " вес суcлика:" + getWeight() + "размер суслика: " + getSize();}
public void setColor(String color) {
this.color = color;
}
public String getColor() {
return color;
}
public void setWeight(String weight) {
this.weight = weight;
}
public String getWeight() {
return weight;
}
public void setSize(String size) {
this.size = size;
}
public String getSize() {
return size;
}
//dfggadfku
}
| [
"[email protected]"
] | |
08d5a973fca5adb577c408226dc47ca228d6aef5 | 58f9928a4d2ae213e59a5c128cc23576fff7b3b0 | /app/src/main/java/inm5001/rapidoservices/service/EvaluationService.java | b49d0da664bdd137280b980fe1760a0e17b185d2 | [] | no_license | FrancisBernier/RapidoServices | 161ea938a56d96eec1da52064795614fbae7005e | ebad5cfbe2e1d4d55833368c8c1b50cf96395958 | refs/heads/master | 2021-01-11T00:21:34.057655 | 2016-12-12T18:51:52 | 2016-12-12T18:51:52 | 70,541,178 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,740 | java | package inm5001.rapidoservices.service;
import inm5001.rapidoservices.MyException;
import static inm5001.rapidoservices.service.ConstanteEvaluationService.MESSAGE_COTESERVICE_ENTREZEROETCINQ;
/**
* Created by Francis Bernier on 2016-11-17.
*/
public class EvaluationService {
public float coteService;
public int nombreDEvaluationService;
public EvaluationService(){
}
public EvaluationService(float coteService, int nombreDEvaluationService) throws MyException {
traiterCoteService(coteService);
traiterNombreDEvaluationService(nombreDEvaluationService);
}
//premier niveau d'abstraction
private void traiterCoteService(float coteService) throws MyException {
validerValeurCoteServiceEntreZeroEtCent(coteService);
affecterValeurCoteService(coteService);
}
private void traiterNombreDEvaluationService(int nombreDEvaluationService) {
affecterValeurNombreDEvaluationService(nombreDEvaluationService);
}
//deuxième niveau d'abstraction
private void validerValeurCoteServiceEntreZeroEtCent(float coteService) throws MyException {
if (coteService < 0 || coteService > 5) {
MyException e = new MyException(MESSAGE_COTESERVICE_ENTREZEROETCINQ);
throw e;
}
}
private void affecterValeurCoteService(float coteService) {
this.coteService = coteService;
}
private void affecterValeurNombreDEvaluationService(int nombreDEvaluationService) {
this.nombreDEvaluationService = nombreDEvaluationService;
}
//MÉTHODES PUBLIC
public float validationCoteService(float coteService) throws MyException {
traiterCoteService(coteService);
return coteService;
}
}
| [
"[email protected]"
] | |
607d48fd0301ce2ee5f3c8fef1d1d934dba57b4b | be56c6b085555ac3e4a23a75a2897d0785e77d85 | /src/main/java/com/imooc/sell/enums/EnumUtil.java | 9f1d82cb8dcf2be101c918e464aaaa1e4afb3dcf | [] | no_license | chenf24k/OrderSystem | d6c5210399d427f0b3a7eef707325c3d18f96010 | 7ea1603682aff7b4015098a1d8103515d9612b86 | refs/heads/master | 2021-02-07T12:09:57.256988 | 2020-03-20T14:58:06 | 2020-03-20T14:58:06 | 244,024,346 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 310 | java | package com.imooc.sell.enums;
public class EnumUtil {
public static <T extends CodeEnum> T getByCode(Integer code, Class<T> enumClass) {
for (T each : enumClass.getEnumConstants()) {
if (code.equals(each.getCode()))
return each;
}
return null;
}
}
| [
"[email protected]"
] | |
5b14c20f64934fec53d25597c959b6ee076cf534 | 0084631aa52eb0d1d886ff6c35e57d8ea80b399b | /src/main/java/br/gov/pi/fapepi/extrator/view/Index.java | ff0c10d76dda7031f22e3a21e1da441524d36315 | [] | no_license | ctifapepi/br.gov.pi.fapepi.extrator | 2f71f00e50166859317a8bd25db921bc5841fe15 | 229c4ced24a26af5df933e4cc7589fe37a55bbaa | refs/heads/master | 2020-04-11T03:27:21.266238 | 2019-01-04T11:35:37 | 2019-01-04T11:35:37 | 160,830,466 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 187 | java | package br.gov.pi.fapepi.extrator.view;
import javax.inject.Named;
import br.gov.pi.fapepi.extrator.model.cv.CURRICULOVITAE;
@Named
public class Index {
CURRICULOVITAE cv;
}
| [
"[email protected]"
] | |
0fe789017983fd35b37308b0e7c59262b0aed9f0 | 344a5775c7b973e354d0af35522a2ca67c450519 | /app/src/main/java/com/yuntian/youth/register/view/callback/RegisterDetailsView.java | e420f555e62d136e17e8b2bf1fce48322b0f40d5 | [] | no_license | xianguangHu/Youth1 | d107f8656ecf48119775833552a683a35fb676ed | 15bbb9867bb13f885bb49e5aa0e6026da6bc7e10 | refs/heads/master | 2021-01-20T02:05:13.664570 | 2017-05-26T16:33:53 | 2017-05-26T16:33:53 | 89,370,701 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 264 | java | package com.yuntian.youth.register.view.callback;
import com.hannesdorfmann.mosby3.mvp.MvpView;
/**
* Created by huxianguang on 2017/4/18.
*/
public interface RegisterDetailsView extends MvpView{
void RegisterSuccess();
void RegisterErro(String e);
}
| [
"[email protected]"
] | |
df14809d6e55a4ea229aed969a9e04e558a73193 | bfc70c13f6226ec42443923006b419aa19d4e5c0 | /PASCAL.java | 0cdeffb072e97c4947595db88e7a711ab050d759 | [] | no_license | sachdevnitin19/ds-algo-practice | 44e1baad6fa54133f9c36f0aa8bbfa42e481ede8 | 8423153495b5f28c3e1ebdcc80f56aa185febb87 | refs/heads/master | 2021-07-07T22:34:10.441412 | 2020-09-23T15:47:35 | 2020-09-23T15:47:35 | 188,852,693 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,081 | java | import java.io.*;
import java.util.*;
class PASCAL{
public static void main(String args[]) throws IOException{
BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
int length=Integer.parseInt(br.readLine());
int [][] pascalTriangle=generatePascal(length);
for(int i=0;i<pascalTriangle.length;i++){
for(int j=0;j<pascalTriangle[i].length;j++){
System.out.print(pascalTriangle[i][j]+" ");
}
System.out.println();
}
System.out.println("ArrayList");
List<List<Integer>> output=generatePascalList(length);
Iterator <List<Integer>> outerItr=output.iterator();
while(outerItr.hasNext()){
List<Integer> innerList=(List<Integer>)outerItr.next();
Iterator<Integer> innerItr=innerList.iterator();
while(innerItr.hasNext()){
System.out.print((Integer)innerItr.next()+" ");
}
System.out.println();
}
}
public static int[][] generatePascal(int length) {
int [][] pascalTriangle=new int[length][];
for(int i=0;i<pascalTriangle.length;i++){
pascalTriangle[i]=new int[i+1];
for(int j=0;j<=i;j++){
if(j==0||j==i){
pascalTriangle[i][j]=1;
}else{
pascalTriangle[i][j]=pascalTriangle[i-1][j-1]+pascalTriangle[i-1][j];
}
}
}
return pascalTriangle;
}
public static List<List<Integer>> generatePascalList(int length) {
List<List<Integer>> l1=new ArrayList<List<Integer>>();
for(int i=0;i<length;i++){
List <Integer>l2=new ArrayList<Integer>();
for(int j=0;j<=i;j++){
if(j==0||j==i){
l2.add(j,1);
}else{
List<Integer> prev=l1.get(i-1);
l2.add(j,(prev.get(j-1)+prev.get(j)));
}
}
l1.add(i,l2);
}
return l1;
}
} | [
"[email protected]"
] | |
0394a0903e13bee09be24dc06851c88794be7a4d | 739b9290f6d59e4e9fc15a9447c6b5fd7d7f507b | /mylibrary/src/main/java/com/pashley/mylibrary/utils/DisplayUtils.java | f78b2f961b29d5541beed1673be2ed110d139d54 | [] | no_license | zbcloading/TieMoBoy | 16d3e074954fddaf077a5432707df0b4a2955da1 | 7d0b44d27dc5c65af3ea47dd0be495432e5daaf6 | refs/heads/master | 2021-01-11T02:20:16.777783 | 2016-10-15T10:30:58 | 2016-10-15T10:30:58 | 70,978,310 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 916 | java | package com.pashley.mylibrary.utils;
import android.app.Activity;
import android.util.DisplayMetrics;
/**
* 屏幕工具类
*
* @author Jeff
* @date 2014-8-31
* @version 1.0
*/
public class DisplayUtils {
private static DisplayUtils instance;
private Activity mActivity;
private DisplayUtils(Activity mActivity){
this.mActivity=mActivity;
}
public static DisplayUtils getInstance(Activity mActivity){
if(instance==null){
instance=new DisplayUtils(mActivity);
}
return instance;
}
public final static int getWindowWidth(Activity mActivity) {
DisplayMetrics dm = new DisplayMetrics();
mActivity.getWindowManager().getDefaultDisplay().getMetrics(dm);
return dm.widthPixels;
}
public final static int getWindowHeight(Activity mActivity) {
DisplayMetrics dm = new DisplayMetrics();
mActivity.getWindowManager().getDefaultDisplay().getMetrics(dm);
return dm.heightPixels;
}
}
| [
"[email protected]"
] | |
782b86fa4ce63d07945e9a7814a62703e5cf30a7 | 2388e5ccc8e81e7a68cbaa05b88cbe6e6fece975 | /src/main/java/com/robertnorthard/api/layer/services/UserService.java | da255d3094cebc1ebb325b55fbe82abb1c584226 | [] | no_license | RobertNorthard/robertnorthard.com-api | 8ed48fac0d435366bc76fa9d46d6ffefe6d019f6 | 0d8cb7d329f8f091f78e6f105e7d90cf85fc9c0a | refs/heads/develop | 2020-12-24T06:24:12.942908 | 2016-09-17T21:24:02 | 2016-09-17T21:24:38 | 41,969,627 | 1 | 2 | null | 2016-06-22T22:10:36 | 2015-09-05T17:27:19 | Java | UTF-8 | Java | false | false | 2,275 | java | package com.robertnorthard.api.layer.services;
import org.apache.log4j.Logger;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import com.robertnorthard.api.layer.persistence.dao.UserDAO;
import com.robertnorthard.api.layer.persistence.entities.User;
import com.robertnorthard.api.util.AuthenticationUtils;
/**
* Implementation for User Service
*
* @author robertnorthard
*
*/
public class UserService implements UserFacade {
private static final Logger LOGGER = Logger.getLogger(UserService.class);
private UserDAO dao;
public UserService() {
dao = new UserDAO();
}
public UserService(UserDAO dao) {
this.dao = dao;
}
/**
* Find user with specified name
*
* @param username user to find
* @return user, null if user not found.
*/
public User findByUsername(String username) {
if (username == null) {
throw new IllegalArgumentException("Username cannot be null");
} else {
return this.dao.findByUsername(username);
}
}
/**
* Return user if authenticated else null
*
* @param user user to authenticate with
* @return user if authenticated else null
*/
public User authenticate(User user) {
User usr = this.dao.findByUsername(user.getUsername());
if (usr != null && AuthenticationUtils.checkPassword(user.getPassword(), usr.getPassword())) {
return usr;
} else {
LOGGER.debug(String.format("Authentication failed for user - [%s]", user.getUsername()));
return null;
}
}
/**
* Find user with specified username
*
* @param username username of user to find
* @return user if exists
* @exception UsernameNotFoundException user not found
*/
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException {
User user = this.findByUsername(username);
if (user == null) {
LOGGER.debug(String.format("User not found - [%s]", username));
throw new UsernameNotFoundException(username);
}
return user;
}
}
| [
"[email protected]"
] | |
28a81601e4f3147d7672f15c38dc761864ce867a | 2d70ce37cc47e17250bf051abea51fde7188596e | /src/ch/epfl/codimsd/connection/TransactionObject.java | 4a7b64c7720b732c3b6cf9e9dc955c870c794731 | [] | no_license | rodrigothread/NaCluster | 5e58f849b56efd190df229aff6c01470589d84d2 | e2fbfcef81b5a42da5b166861760c8d4b7e164d4 | refs/heads/master | 2021-01-10T04:23:28.103905 | 2016-02-12T13:53:01 | 2016-02-12T13:53:01 | 51,847,326 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,515 | java | /*
* CoDIMS version 1.0
* Copyright (C) 2006 Othman Tajmouati
*
* This library 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 library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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
*/
package ch.epfl.codimsd.connection;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import ch.epfl.codimsd.exceptions.transactionMonitor.TransactionMonitorException;
import ch.epfl.codimsd.exceptions.transactionMonitor.TransactionMonitorSQLException;
/**
* The TransactionObject class defines a transaction within CODIMS. Each transaction has an IRI,
* a timeStamp, an sql connection object and an sql statement object.
*
* @author Othman Tajmouati.
*
*/
public class TransactionObject {
/**
* The timeStamp associated to this transaction. It represents the transaction idle time.
*/
private long timeStamp;
/**
* The database IRI.
*/
private String IRI;
/**
* The sql connection.
*/
private Connection con;
/**
* The sql statement.
*/
private Statement stmt;
/**
* Default constructor.
*
* @param con - The sql connection.
* @param IRI - The database IRI.
* @param timeStamp - The timeStamp.
* @param stmt - The sql Statement.
*/
public TransactionObject(Connection con, String IRI, long timeStamp, Statement stmt) {
this.con = con;
this.timeStamp = timeStamp;
this.IRI = IRI;
this.stmt = stmt;
}
/**
* Retunrs the sql connection.
* @return - The connection.
*/
public Connection getConnection() {
return con;
}
/**
* Returns the timeStamp.
* @return - The timeStamp.
*/
public long getTimeStamp() {
return timeStamp;
}
/**
* Retunrs the database IRI.
* @return - The database IRI.
*/
public String getIRI() {
return IRI;
}
/**
* Returns the sql statement.
* @return - The statement.
*/
public Statement getSQLStatement() {
return stmt;
}
/**
* Set the IRI.
* @param IRI - The database IRI.
*/
public void setIRI(String IRI) {
this.IRI = IRI;
}
/**
* Set the timeStamp.
* @param timeStamp - The timeStamp.
*/
public void setTimeStamp(long timeStamp) {
this.timeStamp = timeStamp;
}
/**
* Set the sql connection.
* @param con - The sql connection.
*/
public void setConnection(Connection con) {
this.con = con;
}
/**
* Set the sql statement.
* @param stmt - The sql statement.
*/
public void setSQLStatement(Statement stmt) {
this.stmt = stmt;
}
/**
* Closes the sql statement.
*
* @throws TransactionMonitorException
*/
public void closeSQLStatement() throws TransactionMonitorException {
try {
stmt.close();
} catch (SQLException ex) {
throw new TransactionMonitorSQLException("SQLException : " + ex.getMessage());
}
}
}
| [
"rodrigob@mnmaster"
] | rodrigob@mnmaster |
af55bc33f908eea944f1da16e24d6a2ca11edd95 | 09dd43ff5702ddf7254ae41158410d41355954ce | /src/main/java/com/ynz/university/UniversityApplication.java | 76aee998408688fcfa8b69c878d3cce0aec49166 | [] | no_license | yichunzhao/University | bb5705b6ba924edd4d29815537bc804d906df806 | 773c147b65a322a11dd7c709be3afce18bcb460e | refs/heads/master | 2021-03-02T19:31:10.138729 | 2020-03-13T22:26:33 | 2020-03-13T22:26:33 | 245,898,557 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,126 | java | package com.ynz.university;
import com.ynz.university.domain.*;
import com.ynz.university.repo.CourseRepository;
import com.ynz.university.repo.DepartmentRepository;
import com.ynz.university.repo.StaffRepository;
import com.ynz.university.repo.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class UniversityApplication implements CommandLineRunner {
@Autowired
private StudentRepository studentRepository;
@Autowired
private StaffRepository staffRepository;
@Autowired
private CourseRepository courseRepository;
@Autowired
private DepartmentRepository departmentRepository;
public static void main(String[] args) {
SpringApplication.run(UniversityApplication.class, args);
}
@Override
public void run(String... args) throws Exception {
//Students
studentRepository.save(new Student("jane", "doe", true, 20));
studentRepository.save(new Student("john", "doe", true, 22));
studentRepository.save(new Student("mike", "smith", true, 18));
studentRepository.save(new Student("ally", "kim", false, 19));
//Staff
Staff deanJones = staffRepository.save(new Staff(new Person("John","Jones")));
Staff deanMartin = staffRepository.save(new Staff(new Person("Matthew","Martin")));
Staff profBrown = staffRepository.save(new Staff(new Person ("James", "Brown")));
Staff profMiller = staffRepository.save(new Staff(new Person ("Judy", "Miller")));
Staff profDavis = staffRepository.save(new Staff(new Person ("James", "Davis")));
Staff profMoore = staffRepository.save(new Staff(new Person ("Allison", "Moore")));
Staff profThomas = staffRepository.save(new Staff(new Person ("Tom", "Thomas")));
Staff profGreen = staffRepository.save(new Staff(new Person ("Graham", "Green")));
Staff profWhite= staffRepository.save(new Staff(new Person ("Whitney", "White")));
Staff profBlack = staffRepository.save(new Staff(new Person ("Jack", "Black")));
Staff profKing = staffRepository.save(new Staff(new Person ("Queen", "King")));
//Departments
Department humanities = departmentRepository.save(new Department("Humanities", deanJones));
Department naturalSciences = departmentRepository.save(new Department("Natural Sciences", deanMartin));
Department socialSciences = departmentRepository.save(new Department("Social Sciences", deanJones));
//Humanities Courses
Course english101 = courseRepository.save(new Course("English 101", 3, profBlack, humanities));
Course english202 = courseRepository.save(new Course("English 202", 3, profBlack, humanities));
courseRepository.save(english202.addPrerequisite(english101));
Course english201 = courseRepository.save(new Course("English 201", 3, profBrown, humanities));
courseRepository.save(english201.addPrerequisite(english101));
//Natural Science Courses
Course chemistry = courseRepository.save(new Course("Chemistry",3, profDavis, naturalSciences));
Course physics = courseRepository.save(new Course("Physics",3, profDavis, naturalSciences));
courseRepository.save(physics.addPrerequisite(chemistry));
Course cProgramming = courseRepository.save(new Course("C Programming",3, profMoore, naturalSciences));
Course jProgramming = courseRepository.save(new Course("Java Programming",3, profMoore, naturalSciences));
//Social Science Courses
Course history101 = courseRepository.save(new Course("History 101",3, profMiller, socialSciences));
Course anthro = courseRepository.save(new Course("Anthropology ",3, profKing, socialSciences));
courseRepository.save(anthro.addPrerequisite(history101));
Course sociology = courseRepository.save(new Course("Sociology",3, profKing, socialSciences));
courseRepository.save(sociology.addPrerequisite(history101));
Course psych = courseRepository.save(new Course("Psychology",3, profWhite, socialSciences));
courseRepository.save(psych.addPrerequisite(history101).addPrerequisite(english101));
}
}
| [
"[email protected]"
] | |
850df4d43632d67f76da75043d8c93e8a99b7e4b | 0277e82a3264b6a68a5e2996f37b632d79c984a3 | /app/app/src/main/java/com/aksm/android/entity/UserRating.java | bde3fac6af4f0b20833789b4a861ec4ff2bb4700 | [
"Apache-2.0"
] | permissive | ashwanikumar04/sequoia-hackathon | b6610f3b8b68c9b708b951a7e8d7b0449bfd6bec | 7c146a4f7d396db7c9cba01d823f733352a700dc | refs/heads/master | 2020-04-18T15:35:13.536349 | 2017-01-09T13:30:40 | 2017-01-09T13:30:40 | 67,861,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 674 | java | package com.aksm.android.entity;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Builder;
/**
* Created by AshwaniK on 9/10/2016.
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor(suppressConstructorProperties = true)
@Builder
public class UserRating {
@SerializedName("aggregate_rating")
private String aggregateRating;
@SerializedName("rating_text")
private String ratingText;
@SerializedName("rating_color")
private String ratingColor;
@SerializedName("votes")
private String votes;
} | [
"[email protected]"
] | |
21165c5c5bae3133f8f3d923b4f675f3d95895fe | 387457422d426b4013b097883e8a7500e8d00122 | /src/main/java/com/command/ToggleCommand.java | 2ff3aa9c836795f4ef3b0dbf5c5a5f6f1a80e792 | [] | no_license | kateMoscoso/patrones | 1786f2f8af470a5c2abe56d260c68d0fd406bf0c | fe660828087733c3387a4b0b050d95ee5afd30be | refs/heads/master | 2022-11-25T05:40:20.566467 | 2020-07-26T15:25:08 | 2020-07-26T15:25:08 | 274,412,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 254 | java | package main.java.com.command;
public class ToggleCommand implements Command {
private Light light;
public ToggleCommand(Light light){
this.light = light;
}
@Override
public void execute() {
light.toggle();
}
}
| [
"[email protected]"
] | |
83815335cdef8f03986c68daff68f80a771e8cab | b157916e4214d0521e221d9b2b27fe80e37a801b | /src/main/java/com/wr/controller/PageController.java | a4a15ffdece2869eccff098be7777898d7c329fd | [] | no_license | WillZ22/wr | 43d28f527619c46be6837afc390ef70bda19ea71 | bbfa002a186cd6d2cb32e8a0521e8c357d443558 | refs/heads/master | 2020-04-01T10:15:59.610012 | 2019-01-18T12:24:36 | 2019-01-18T12:24:36 | 153,110,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,330 | java | package com.wr.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.tomcat.util.http.RequestUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/page")
public class PageController {
@RequestMapping(value = "/mainpage", method = RequestMethod.GET)
public String mainDo(HttpServletRequest request, HttpServletResponse response) {
HttpSession session = request.getSession(false);
if (session == null) {
return "ErorrPage";
}
String role = (String) session.getAttribute("role");
switch (role) {
case "admin":
return "redirect:admin";
case "groupmember":
return "redirect:gmember";
case "groupleader":
return "redirect:gleader";
case "teacher":
return "redirect:teacher";
case "secretary":
return "redirect:secretary";
default:
break;
}
return "ErorrPage";
}
@RequestMapping(value = "/gmember")
public String group_member() {
return "GroupMember";
}
@RequestMapping(value = "/gleader")
public String group_leader() {
return "GroupLeader";
}
@RequestMapping(value = "/teacher")
public String teacher() {
return "Boss";
}
@RequestMapping(value = "/admin")
public String admin() {
return "Admin";
}
@RequestMapping(value = "/secretary")
public String secretary() {
return "Secretary";
}
@RequestMapping(value = "/writereport")
public String writereport() {
return "WriteReport";
}
@RequestMapping(value="/writesign")
public String checksign() {
return "WriteSign";
}
@RequestMapping(value = "/signcollect")
public String signcollect() {
return "SignCollect";
}
@RequestMapping(value = "/reportcollect")
public String reportcollect() {
return "RepCollect";
}
@RequestMapping(value = "/signinput")
public String signinput() {
return "SignInput";
}
@RequestMapping(value = "/usermanage")
public String uesrmanager() {
return "UserManage";
}
@RequestMapping(value = "/datamanage")
public String datamanager() {
return "DataManage";
}
@RequestMapping(value = "/changepw")
public String changePW() {
return "ChangePW";
}
@RequestMapping(value = "/systemcontrol")
public String systemControl() {
return "SystemControl";
}
@RequestMapping(value = "/reportsearch")
public String reportSearch() {
return "RepSearch";
}
@RequestMapping(value = "/reportreview")
public String reportReview() {
return "RepReview";
}
@RequestMapping(value = "/signreview")
public String signReview() {
return "SignReview";
}
@RequestMapping(value = "/summaryexport")
public String summaryExport() {
return "SummaryExport";
}
@RequestMapping(value = "/meetingrecord")
public String meetingRecord() {
return "MeetingRecord";
}
@RequestMapping(value = "/notification")
public String notification() {
return "Notification";
}
@RequestMapping(value = "/personalinfo")
public String personalInfo() {
return "PersonalInfo";
}
}
| [
"[email protected]"
] | |
c85d599d691871b17e94dc09ec659d28b32d4f11 | 3f5cc8cc0dd02e1219f4d2df21fd09695d2638ce | /others/cert00fundamentals/src/operaciones/OperacionesBasicas.java | 019bcbc77151f6574faf6f667ee4d75e33a3b7b6 | [] | no_license | elascano/ObjectOrientedProgrammingJavaFundamentals | 13d4d09b87d97576ed3f929d46da632ee7bfccd2 | ab2c84becdbd73ff5b5846765525200e168dc0c0 | refs/heads/master | 2020-04-10T13:32:06.842659 | 2019-12-03T16:51:55 | 2019-12-03T16:51:55 | 161,053,109 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 254 | java | /** Copyright ESPE-DECC
*/
package operaciones;
/**
*
* @author edisonlascano
*/
public class OperacionesBasicas {
private int a;
public int getA(){
return a;
}
public void setA(int a) {
this.a = a;
}
}
| [
"[email protected]"
] | |
04ee8dad6702ea00a490d0fc80976b03806795f0 | 665c61ff9483df41134e726290f2afb7bc6a31c9 | /Demo11_SimpleDateFormat.java | 13add7cbf10fc76d2656c2d9191ebef52c58d5b7 | [] | no_license | wangjnns/Javase-Self-Culture | a27d358c12a0443c32f8a61e4f36ce4720e58cc4 | 7e951e7c2485eaf200c6a80d71c4fc504ca3f73a | refs/heads/master | 2022-01-28T08:23:25.605431 | 2019-08-06T06:17:48 | 2019-08-06T06:17:48 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 993 | java | package com.ujiuye.demos;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
public class Demo11_SimpleDateFormat {
public static void main(String[] args) throws ParseException {
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat();//默认的格式
System.out.println(sdf);
System.out.println(sdf.format(d));
//2019 07 18; 17:05:39
//yyyy MM dd; kk:mm:ss
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy MM dd; kk:mm:ss");
System.out.println(sdf2.format(d));
//键盘录入字符串,获取该时间的毫秒值
Scanner sc = new Scanner(System.in);
System.out.println("请录入一个字符串,计算该字符串表示的时间的毫秒值,字符串格式如:2019-09-01 00:00:00");
String timeStr = sc.nextLine();
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date result = sdf3.parse(timeStr);
System.out.println(result.getTime());
}
}
| [
"[email protected]"
] | |
319fe1fdbb038d49a69e50a670b82dcb7883968e | f54b9ec4cf02c89d0577064059eafe8262e2f16f | /urule-springboot/src/main/java/com/paul/urule/springboot/utils/ResponseStatus.java | ab3f0389b68abc7eaa57cbf631ae596e39895481 | [
"Apache-2.0"
] | permissive | crawford123/urule | 9e178bed249b34771490659f3a47b2a383019a8a | 01fa7714eeced4c5f12c901e1178944647318d6f | refs/heads/master | 2021-06-23T04:20:40.930426 | 2021-04-03T02:26:51 | 2021-04-03T02:26:51 | 200,999,588 | 1 | 0 | null | 2019-08-07T07:44:48 | 2019-08-07T07:44:47 | null | UTF-8 | Java | false | false | 4,519 | java | package com.paul.urule.springboot.utils;
/**
* @ClassName ResponseStatus
* @Description TODO
* @Author [email protected]
* @Date2019/7/31 10:16
* @Version v1.0
**/
public class ResponseStatus {
/**
* HTTP Status-Code 200: OK.
*/
public static final int HTTP_OK = 200;
/**
* HTTP Status-Code 201: Created.
*/
public static final int HTTP_CREATED = 201;
/**
* HTTP Status-Code 202: Accepted.
*/
public static final int HTTP_ACCEPTED = 202;
/**
* HTTP Status-Code 203: Non-Authoritative Information.
*/
public static final int HTTP_NOT_AUTHORITATIVE = 203;
/**
* HTTP Status-Code 204: No Content.
*/
public static final int HTTP_NO_CONTENT = 204;
/**
* HTTP Status-Code 205: Reset Content.
*/
public static final int HTTP_RESET = 205;
/**
* HTTP Status-Code 206: Partial Content.
*/
public static final int HTTP_PARTIAL = 206;
/* 3XX: relocation/redirect */
/**
* HTTP Status-Code 300: Multiple Choices.
*/
public static final int HTTP_MULT_CHOICE = 300;
/**
* HTTP Status-Code 301: Moved Permanently.
*/
public static final int HTTP_MOVED_PERM = 301;
/**
* HTTP Status-Code 302: Temporary Redirect.
*/
public static final int HTTP_MOVED_TEMP = 302;
/**
* HTTP Status-Code 303: See Other.
*/
public static final int HTTP_SEE_OTHER = 303;
/**
* HTTP Status-Code 304: Not Modified.
*/
public static final int HTTP_NOT_MODIFIED = 304;
/**
* HTTP Status-Code 305: Use Proxy.
*/
public static final int HTTP_USE_PROXY = 305;
/* 4XX: client error */
/**
* HTTP Status-Code 400: Bad Request.
*/
public static final int HTTP_BAD_REQUEST = 400;
/**
* HTTP Status-Code 401: Unauthorized.
*/
public static final int HTTP_UNAUTHORIZED = 401;
/**
* HTTP Status-Code 402: Payment Required.
*/
public static final int HTTP_PAYMENT_REQUIRED = 402;
/**
* HTTP Status-Code 403: Forbidden.
*/
public static final int HTTP_FORBIDDEN = 403;
/**
* HTTP Status-Code 404: Not Found.
*/
public static final int HTTP_NOT_FOUND = 404;
/**
* HTTP Status-Code 405: Method Not Allowed.
*/
public static final int HTTP_BAD_METHOD = 405;
/**
* HTTP Status-Code 406: Not Acceptable.
*/
public static final int HTTP_NOT_ACCEPTABLE = 406;
/**
* HTTP Status-Code 407: Proxy Authentication Required.
*/
public static final int HTTP_PROXY_AUTH = 407;
/**
* HTTP Status-Code 408: Request Time-Out.
*/
public static final int HTTP_CLIENT_TIMEOUT = 408;
/**
* HTTP Status-Code 409: Conflict.
*/
public static final int HTTP_CONFLICT = 409;
/**
* HTTP Status-Code 410: Gone.
*/
public static final int HTTP_GONE = 410;
/**
* HTTP Status-Code 411: Length Required.
*/
public static final int HTTP_LENGTH_REQUIRED = 411;
/**
* HTTP Status-Code 412: Precondition Failed.
*/
public static final int HTTP_PRECON_FAILED = 412;
/**
* HTTP Status-Code 413: Request Entity Too Large.
*/
public static final int HTTP_ENTITY_TOO_LARGE = 413;
/**
* HTTP Status-Code 414: Request-URI Too Large.
*/
public static final int HTTP_REQ_TOO_LONG = 414;
/**
* HTTP Status-Code 415: Unsupported Media Type.
*/
public static final int HTTP_UNSUPPORTED_TYPE = 415;
/* 5XX: server error */
/**
* HTTP Status-Code 500: Internal Server Error.
* @deprecated it is misplaced and shouldn't have existed.
*/
@Deprecated
public static final int HTTP_SERVER_ERROR = 500;
/**
* HTTP Status-Code 500: Internal Server Error.
*/
public static final int HTTP_INTERNAL_ERROR = 500;
/**
* HTTP Status-Code 501: Not Implemented.
*/
public static final int HTTP_NOT_IMPLEMENTED = 501;
/**
* HTTP Status-Code 502: Bad Gateway.
*/
public static final int HTTP_BAD_GATEWAY = 502;
/**
* HTTP Status-Code 503: Service Unavailable.
*/
public static final int HTTP_UNAVAILABLE = 503;
/**
* HTTP Status-Code 504: Gateway Timeout.
*/
public static final int HTTP_GATEWAY_TIMEOUT = 504;
/**
* HTTP Status-Code 505: HTTP Version Not Supported.
*/
public static final int HTTP_VERSION = 505;
}
| [
"[email protected]"
] | |
b2b6f7da30fd6f1a7bc70b687ae7839b61f590db | 8edee90cb9610c51539e0e6b126de7c9145c57bc | /datastructures-json-dsl/src/test/java/com/dslplatform/json/generated/types/Rectangle/NullableSetOfOneRectanglesDefaultValueTurtle.java | 2cf95edf5eaa42598e1219d3ababd462a976a0c1 | [
"Apache-2.0"
] | permissive | jprante/datastructures | 05f3907c2acba8f743639bd8b64bde1e771bb074 | efbce5bd1c67a09b9e07d2f0d4e795531cdc583b | refs/heads/main | 2023-08-14T18:44:35.734136 | 2023-04-25T15:47:23 | 2023-04-25T15:47:23 | 295,021,623 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,624 | java | package com.dslplatform.json.generated.types.Rectangle;
import com.dslplatform.json.generated.ocd.javaasserts.RectangleAsserts;
import com.dslplatform.json.generated.types.StaticJson;
import java.io.IOException;
public class NullableSetOfOneRectanglesDefaultValueTurtle {
private static StaticJson.JsonSerialization jsonSerialization;
@org.junit.BeforeClass
public static void initializeJsonSerialization() throws IOException {
jsonSerialization = StaticJson.getSerialization();
}
@org.junit.Test
public void testDefaultValueEquality() throws IOException {
final java.util.Set<java.awt.geom.Rectangle2D> defaultValue = null;
final StaticJson.Bytes defaultValueJsonSerialized = jsonSerialization.serialize(defaultValue);
final java.util.List<java.awt.geom.Rectangle2D> deserializedTmpList = jsonSerialization.deserializeList(java.awt.geom.Rectangle2D.class, defaultValueJsonSerialized.content, defaultValueJsonSerialized.length);
final java.util.Set<java.awt.geom.Rectangle2D> defaultValueJsonDeserialized = deserializedTmpList == null ? null : new java.util.HashSet<java.awt.geom.Rectangle2D>(deserializedTmpList);
RectangleAsserts.assertNullableSetOfOneEquals(defaultValue, defaultValueJsonDeserialized);
}
@org.junit.Test
public void testBorderValue1Equality() throws IOException {
final java.util.Set<java.awt.geom.Rectangle2D> borderValue1 = new java.util.HashSet<java.awt.geom.Rectangle2D>(java.util.Arrays.asList(new java.awt.geom.Rectangle2D.Float()));
final StaticJson.Bytes borderValue1JsonSerialized = jsonSerialization.serialize(borderValue1);
final java.util.List<java.awt.geom.Rectangle2D> deserializedTmpList = jsonSerialization.deserializeList(java.awt.geom.Rectangle2D.class, borderValue1JsonSerialized.content, borderValue1JsonSerialized.length);
final java.util.Set<java.awt.geom.Rectangle2D> borderValue1JsonDeserialized = deserializedTmpList == null ? null : new java.util.HashSet<java.awt.geom.Rectangle2D>(deserializedTmpList);
RectangleAsserts.assertNullableSetOfOneEquals(borderValue1, borderValue1JsonDeserialized);
}
@org.junit.Test
public void testBorderValue2Equality() throws IOException {
final java.util.Set<java.awt.geom.Rectangle2D> borderValue2 = new java.util.HashSet<java.awt.geom.Rectangle2D>(java.util.Arrays.asList(new java.awt.geom.Rectangle2D.Double(-1.000000000000001, -1.000000000000001, 1.000000000000001, 1.000000000000001)));
final StaticJson.Bytes borderValue2JsonSerialized = jsonSerialization.serialize(borderValue2);
final java.util.List<java.awt.geom.Rectangle2D> deserializedTmpList = jsonSerialization.deserializeList(java.awt.geom.Rectangle2D.class, borderValue2JsonSerialized.content, borderValue2JsonSerialized.length);
final java.util.Set<java.awt.geom.Rectangle2D> borderValue2JsonDeserialized = deserializedTmpList == null ? null : new java.util.HashSet<java.awt.geom.Rectangle2D>(deserializedTmpList);
RectangleAsserts.assertNullableSetOfOneEquals(borderValue2, borderValue2JsonDeserialized);
}
@org.junit.Test
public void testBorderValue3Equality() throws IOException {
final java.util.Set<java.awt.geom.Rectangle2D> borderValue3 = new java.util.HashSet<java.awt.geom.Rectangle2D>(java.util.Arrays.asList(new java.awt.geom.Rectangle2D.Float(), new java.awt.Rectangle(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE), new java.awt.Rectangle(-1000000000, -1000000000, 1000000000, 1000000000), new java.awt.geom.Rectangle2D.Float(Float.MIN_VALUE, Float.MIN_VALUE, Float.MAX_VALUE, Float.MAX_VALUE), new java.awt.geom.Rectangle2D.Float(-1.0000001f, -1.0000001f, 1.0000001f, 1.0000001f), new java.awt.geom.Rectangle2D.Double(Double.MIN_VALUE, Double.MIN_VALUE, Double.MAX_VALUE, Double.MAX_VALUE), new java.awt.geom.Rectangle2D.Double(-1.000000000000001, -1.000000000000001, 1.000000000000001, 1.000000000000001)));
final StaticJson.Bytes borderValue3JsonSerialized = jsonSerialization.serialize(borderValue3);
final java.util.List<java.awt.geom.Rectangle2D> deserializedTmpList = jsonSerialization.deserializeList(java.awt.geom.Rectangle2D.class, borderValue3JsonSerialized.content, borderValue3JsonSerialized.length);
final java.util.Set<java.awt.geom.Rectangle2D> borderValue3JsonDeserialized = deserializedTmpList == null ? null : new java.util.HashSet<java.awt.geom.Rectangle2D>(deserializedTmpList);
RectangleAsserts.assertNullableSetOfOneEquals(borderValue3, borderValue3JsonDeserialized);
}
}
| [
"[email protected]"
] | |
8ef41ac6ecb1c8249721a51f905594532a46cee9 | d78a6ad8687f9216cfbc5a3aaf55c43d6b202fa7 | /src/main/java/com/sri/ai/praisewm/web/ws/package-info.java | 42b654dd3d6642f1568258e2ba5c494433f0ca47 | [] | no_license | aic-sri-international/praise-wm | 829e8fa737b3ee3809878c616422868d5ef4a967 | b264721b330b9fbb80cbb79b9ffcf5b61e13e3b3 | refs/heads/master | 2022-12-13T17:32:21.557997 | 2019-11-01T22:07:12 | 2019-11-01T22:07:12 | 189,464,692 | 0 | 0 | null | 2022-12-10T17:48:15 | 2019-05-30T18:40:01 | Java | UTF-8 | Java | false | false | 73 | java | /** Classes related to Websocket. */
package com.sri.ai.praisewm.web.ws;
| [
"[email protected]"
] | |
0ce6435dadb2b6a2dd2707cf5b85f0b9c7b8612d | 4e1a136e98a1ff418f30e4e61592acb872ff8c43 | /app/src/main/java/com/abbsolute/ma_livu/Community/CommunityComment/CommunityCommentComment/CommuCommentCommentOnItemClick.java | 7be8c1b4e1cfaabec6c63e308e16f2a75b73c2d0 | [
"MIT"
] | permissive | appsoluteTeam/MaLive_org | 7fca87edba8115c7a59d8d9bcc86120130772f63 | 1f67666692fb1af8901c864797b6e76a48330fb5 | refs/heads/master | 2023-01-12T06:40:41.615988 | 2020-11-08T15:58:45 | 2020-11-08T15:58:45 | 268,241,653 | 2 | 10 | MIT | 2020-11-08T15:54:39 | 2020-05-31T08:45:58 | Java | UTF-8 | Java | false | false | 317 | java | package com.abbsolute.ma_livu.Community.CommunityComment.CommunityCommentComment;
public interface CommuCommentCommentOnItemClick {
void commentLike(int position);
void commentDislike(int position);
void deleteItem(int position);
void reportItem(int position);
boolean checkUser(int position);
}
| [
"[email protected]"
] | |
0cdd4c4e5c543b3f22e52704ce252347ffc1543b | 8947c6aeb2955aad00f41a57d8772583411ee05f | /Assignment4/Assignment4/src/servletHttpSessionLoginLogout/LoginServlet.java | 291ab748641ef46f0038a5c8fff92a220688eef2 | [] | no_license | Erdaulet2000/Assigment4 | 6ba0aae0a32d133b9b78e6b71fdc2c962e954f1b | 60df213ed32c92525e5b2ffd54ea3824fbc97e6a | refs/heads/master | 2023-03-10T21:16:40.204037 | 2021-02-28T12:44:55 | 2021-02-28T12:44:55 | 343,102,848 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,161 | java | package servletHttpSessionLoginLogout;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class LoginServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out=response.getWriter();
request.getRequestDispatcher("link.html").include(request, response);
String name=request.getParameter("name");
String password=request.getParameter("password");
if(password.equals("admin123")){
out.print("Welcome, "+name);
HttpSession session=request.getSession();
session.setAttribute("name",name);
}
else{
out.print("Sorry, username or password error!");
request.getRequestDispatcher("login.html").include(request, response);
}
out.close();
}
}
| [
"[email protected]"
] | |
5032bfbfca73bad5f08dd7fdc8843fa2d0e4de0b | a15e6062d97bd4e18f7cefa4fe4a561443cc7bc8 | /src/Irony/CharHashSet.java | d4523dde7e97baec98f85af5f473929325a247ec | [] | no_license | Javonet-io-user/e66e9f78-68be-483d-977e-48d29182c947 | 017cf3f4110df45e8ba4a657ba3caba7789b5a6e | 02ec974222f9bb03a938466bd6eb2421bb3e2065 | refs/heads/master | 2020-04-15T22:55:05.972920 | 2019-01-10T16:01:59 | 2019-01-10T16:01:59 | 165,089,187 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,172 | java | package Irony;
import Common.Activation;
import static Common.Helper.Convert;
import static Common.Helper.getGetObjectName;
import static Common.Helper.getReturnObjectName;
import static Common.Helper.ConvertToConcreteInterfaceImplementation;
import Common.Helper;
import com.javonet.Javonet;
import com.javonet.JavonetException;
import com.javonet.JavonetFramework;
import com.javonet.api.NObject;
import com.javonet.api.NEnum;
import com.javonet.api.keywords.NRef;
import com.javonet.api.keywords.NOut;
import com.javonet.api.NControlContainer;
import java.util.concurrent.atomic.AtomicReference;
import java.util.Iterator;
import java.lang.*;
import jio.System.Collections.Generic.*;
import Irony.*;
import jio.System.Collections.*;
import jio.System.Runtime.Serialization.*;
import jio.System.*;
public class CharHashSet extends HashSet<java.lang.Character>
implements jio.System.Collections.Generic.ICollection<java.lang.Character>,
jio.System.Collections.Generic.IEnumerable<java.lang.Character>,
jio.System.Collections.IEnumerable,
ISerializable,
IDeserializationCallback,
ISet<java.lang.Character>,
IReadOnlyCollection<java.lang.Character> {
protected NObject javonetHandle;
public CharHashSet(java.lang.Boolean caseSensitive) {
super((NObject) null);
try {
javonetHandle = Javonet.New("Irony.CharHashSet", caseSensitive);
super.setJavonetHandle(javonetHandle);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
public CharHashSet(NObject handle) {
super(handle);
this.javonetHandle = handle;
}
public void setJavonetHandle(NObject handle) {
this.javonetHandle = handle;
}
/** Method */
public void CharHashSet___Add(java.lang.Character ch) {
try {
javonetHandle.invoke("Add", ch);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
static {
try {
Activation.initializeJavonet();
} catch (java.lang.Exception e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
b6cf14e755bb7bb45b4d60a7483deeb08ad1ec53 | 4ce2ba393712da29cbc212ec92b8049cb69783b4 | /src/main/java/net/bither/network/ReplayTask.java | db845d1164fbcb057ed721e41b9beac7b78daa75 | [
"Apache-2.0"
] | permissive | bitwolaiye/bither-desktop-java | 11a5172c17a154101fcafdfdf5dae2dfb375b1f6 | b3847a4766c49d96859cc62f199ab5bfd350ab4f | refs/heads/master | 2020-12-28T21:05:20.688228 | 2015-01-07T05:34:49 | 2015-01-07T05:34:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,423 | java | package net.bither.network;
import net.bither.bitherj.core.Address;
import net.bither.message.Message;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* A class encapsulating a request on one or more wallets to perform a
* blockchain replay
*/
public class ReplayTask {
public static final int UNKNOWN_START_HEIGHT = -1;
private final List<Address> perWalletModelDataToReplay;
/**
* The start date of the replay task.
*/
private final Date startDate;
/**
* The height the blockchain needs to be truncated to.
*/
private int startHeight;
/**
* A UUID identifying this replay task.
*/
private final UUID uuid;
/**
* The percent complete as reported by the downloadlistener.
*/
private long percentComplete;
public ReplayTask(List<Address> perWalletModelDataToReplay, Date startDate, int startHeight) {
this.perWalletModelDataToReplay = perWalletModelDataToReplay;
this.startDate = startDate;
this.startHeight = startHeight;
this.percentComplete = Message.NOT_RELEVANT_PERCENTAGE_COMPLETE;
this.uuid = UUID.randomUUID();
}
public List<Address> getPerWalletModelDataToReplay() {
return perWalletModelDataToReplay;
}
public Date getStartDate() {
return startDate;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((perWalletModelDataToReplay == null) ? 0 : perWalletModelDataToReplay.hashCode());
result = prime * result + (int) (percentComplete ^ (percentComplete >>> 32));
result = prime * result + ((startDate == null) ? 0 : startDate.hashCode());
result = prime * result + startHeight;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof ReplayTask))
return false;
ReplayTask other = (ReplayTask) obj;
if (perWalletModelDataToReplay == null) {
if (other.perWalletModelDataToReplay != null)
return false;
} else if (!perWalletModelDataToReplay.equals(other.perWalletModelDataToReplay))
return false;
if (percentComplete != other.percentComplete)
return false;
if (startDate == null) {
if (other.startDate != null)
return false;
} else if (!startDate.equals(other.startDate))
return false;
if (startHeight != other.startHeight)
return false;
return true;
}
@Override
public String toString() {
return "ReplayTask [perWalletModelDataToReplay=" + perWalletModelDataToReplay + ", startDate=" + startDate
+ ", startHeight=" + startHeight + ", uuid=" + uuid
+ ", percentComplete=" + percentComplete + "]";
}
public UUID getUuid() {
return uuid;
}
public long getPercentComplete() {
return percentComplete;
}
public void setPercentComplete(long percentComplete) {
this.percentComplete = percentComplete;
}
public int getStartHeight() {
return startHeight;
}
public void setStartHeight(int startHeight) {
this.startHeight = startHeight;
}
}
| [
"[email protected]"
] | |
159dfd39b36b5463840ce9ae7c64d1fc1795945f | 09c086e88df1062658da09276814c752b727e935 | /src/main/java/myproject/demo/ws/Fonctionws.java | d740168b57da10cbb9ebe63269d11d9278a362ed | [] | no_license | fatimaaitboujja2021/webProject | 52c2bb181f2f63cd8985ac85f2c94006b8d97648 | b6337657707317eeb2fb76fa992842c53952b283 | refs/heads/master | 2023-06-11T01:01:23.124686 | 2021-07-04T17:19:38 | 2021-07-04T17:19:38 | 365,803,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,323 | java | package myproject.demo.ws;
import myproject.demo.bean.Fonction;
import myproject.demo.service.FonctionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/CHU/fonction")
public class Fonctionws {
@Autowired
private FonctionService fonctionService;
@GetMapping("fonction/MatriculeSub/{MatriculeSub}")
public Fonction findByFonctionnaire_MatriculeSub(@PathVariable String MatriculeSub){
return fonctionService.findByFonctionnaire_MatriculeSub(MatriculeSub);
}
@GetMapping("/ref/{ref}")
public Fonction findByRef(@PathVariable String ref){
return fonctionService.findByRef(ref);
}
@GetMapping("fonction/intitule/{intitule}")
public Fonction findByintitule(@PathVariable String intitule) {
return fonctionService.findByintitule(intitule);
}
@DeleteMapping("/intitule/{intitule}")
public int deleteByintitule(@PathVariable String intitule) {
return fonctionService.deleteByintitule(intitule);
}
@PostMapping("/")
public int save(@RequestBody Fonction fonction) {
if (fonction.getIntitule() == null)
return -1;
else
fonctionService.save(fonction);
return 1;
}
}
| [
"[email protected]"
] | |
fb223b5b27dc0d5a1bc63a53c4065c7e6fedc6df | 8867e625b4bc82aec6990152ac81f37a31a60b72 | /src/main/java/com/solactive/stats/service/SlidingWindowService.java | 02f9cdd51d865dbf9283f3b0c5aaa3d936277f56 | [] | no_license | bzb0/stats-api | fd72acdf979516d018dafddadb307dac3da44207 | 5bc40ad04995ec43371b16272efbb11204ecda73 | refs/heads/main | 2023-05-14T10:16:00.099844 | 2021-05-31T23:39:10 | 2021-05-31T23:39:10 | 372,652,498 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,486 | java | /*
* Copyright 2017-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.solactive.stats.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
/**
* The sole purpose of this service is to move the sliding window of the {@link InstrumentAggregator every second}.
*/
@Service
public class SlidingWindowService {
private final InstrumentAggregator instrumentAggregator;
@Autowired
public SlidingWindowService(InstrumentAggregator instrumentAggregator) {
this.instrumentAggregator = instrumentAggregator;
}
/**
* Moves the {@link InstrumentAggregator}'s sliding window every second. By doing this the sliding window will not contain expired partial
* aggregations.
*/
@Scheduled(fixedRate = 1000L)
public void moveWindow() {
instrumentAggregator.moveWindow();
}
}
| [
"[email protected]"
] | |
197e3216519d3a54153748d2e3cffb3dbc2540e2 | e977e24743365697f84eb5589874a0510265b49a | /forgerock-openbanking-uk-aspsp-rs/forgerock-openbanking-uk-aspsp-rs-mock-store/forgerock-openbanking-uk-aspsp-rs-mock-store-server/src/main/java/com/forgerock/openbanking/aspsp/rs/store/api/openbanking/account/v3_1_8/beneficiaries/BeneficiariesApiController.java | 4054dfdead1bd06e84b8e545e89121937e98f3d7 | [
"Apache-2.0"
] | permissive | OpenBankingToolkit/openbanking-aspsp | 6cc8fb7428e35f70e38f3e250380b3a2e8532dd4 | 9469cc031d3842b5153cf0eae16231f50c68fad1 | refs/heads/master | 2023-04-05T10:42:50.442805 | 2023-03-23T15:54:54 | 2023-03-23T15:54:54 | 226,305,127 | 3 | 4 | Apache-2.0 | 2023-09-06T14:24:24 | 2019-12-06T10:35:37 | Java | UTF-8 | Java | false | false | 1,869 | java | /**
* Copyright 2019 ForgeRock AS.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.forgerock.openbanking.aspsp.rs.store.api.openbanking.account.v3_1_8.beneficiaries;
import com.forgerock.openbanking.aspsp.rs.store.repository.accounts.beneficiaries.FRBeneficiaryRepository;
import com.forgerock.openbanking.aspsp.rs.store.utils.AccountDataInternalIdFilter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
@Controller("BeneficiariesApiV3.1.8")
public class BeneficiariesApiController extends com.forgerock.openbanking.aspsp.rs.store.api.openbanking.account.v3_1_7.beneficiaries.BeneficiariesApiController implements BeneficiariesApi {
public BeneficiariesApiController(@Value("${rs.page.default.beneficiaries.size}") int pageLimitBeneficiaries,
FRBeneficiaryRepository frBeneficiaryRepository,
AccountDataInternalIdFilter accountDataInternalIdFilter) {
super(pageLimitBeneficiaries, frBeneficiaryRepository, accountDataInternalIdFilter);
}
}
| [
"[email protected]"
] | |
26543af7fe408dd2e790e1dca80212ae1af530df | 08863d698ac9f4c103e756a9d60d378911e99602 | /src/main/java/com/chen/model/Account.java | 93194757c8d7f0e03cb43a207e195cdf6f194b38 | [] | no_license | chenhenggithub/fastReosotory | c362ddb9777b14729ae03cc4a3bd89660c1ce859 | 78527b5e2cd261cc74d96104652bbf594097eb43 | refs/heads/master | 2020-12-02T09:58:38.731251 | 2017-07-09T08:53:41 | 2017-07-09T08:53:44 | 96,669,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,628 | java | package com.chen.model;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
public class Account {
private Profile profile;
@NotEmpty
private String username;
@NotEmpty
private String repassword;
@NotEmpty
private String password;
@NotEmpty
@Email
private String email;
@NotEmpty
private String xm;
@NotEmpty
private String address;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username == null ? null : username.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
public String getXm() {
return xm;
}
public void setXm(String xm) {
this.xm = xm == null ? null : xm.trim();
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address == null ? null : address.trim();
}
public String getRepassword() {
return repassword;
}
public void setRepassword(String repassword) {
this.repassword = repassword;
}
public Profile getProfile() {
return profile;
}
public void setProfile(Profile profile) {
this.profile = profile;
}
} | [
"[email protected]"
] | |
cc676d816dd90ed4127e7245ee7f0428bae1250c | 408814fac5c000bfb5e951d702acf79a61ccf49d | /Problem 1/src/com/ai/problem1/PriorityQueue.java | dc928bee89fd3b416a3c10b0cc499e0223ff0503 | [] | no_license | sandeep0412/Intro-to-AI---520-problems | dba84759bec52a9da00fa05d8dccc35bb9c457d4 | b796cce2dc18b295ce58ea3eebec8cbdd5d90950 | refs/heads/master | 2021-09-06T23:03:15.016154 | 2018-02-13T05:02:26 | 2018-02-13T05:02:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,858 | java | package com.ai.problem1;
public class PriorityQueue<T extends Comparable<T>> {
private static int DEFAULT_CAPACITY = 10;
private T[] t;
private static int capacity = 0;
private int size = 0;
public PriorityQueue() {
this(DEFAULT_CAPACITY);
}
@SuppressWarnings("unchecked")
public PriorityQueue(int capacity) {
t = (T[]) new Comparable[capacity + 1];
capacity = 0;
}
@SuppressWarnings("unchecked")
public PriorityQueue(T[] objects) {
capacity = objects.length;
t = (T[]) new Comparable[capacity * 2 + 1];
int i = 1;
for (T object : objects) {
t[i++] = object;
size++;
}
buildHeap();
}
public void buildHeap() {
for (int i = capacity / 2; i >= 1; i--) {
heapify(i);
}
}
public void heapify(int i) { // max_heap
int index = i;
int left = 2 * i;
int right = 2 * i + 1;
if (left <= capacity && t[left].compareTo(t[i]) < 0) {
index = left;
} else {
index = i;
}
if (right <= capacity && t[right].compareTo(t[index]) < 0) {
index = right;
}
if (index != i) {
T temp = t[index];
t[index] = t[i];
t[i] = temp;
heapify(index);
}
}
public void insert(T object) {
if (capacity == t.length - 1) {
increaseCapacity(capacity * 2 + 1);
}
}
@SuppressWarnings("unchecked")
public void increaseCapacity(int size) {
T[] old = t;
t = (T[]) new Comparable[size];
for (int i = 0; i < old.length; i++) {
t[i] = old[i];
}
size++;
}
public T poll() {
if (capacity == 0) {
return null;
}
return t[1];
}
public T remove() {
if (capacity == 0) {
return null;
}
T max = poll();
t[1] = t[capacity--];
heapify(1);
return max;
}
public boolean isEmpty() {
return size == 0;
}
public int size() {
return size;
}
}
| [
"[email protected]"
] | |
eb1d9d8a8ce49fd94920485515ea1d67f90ce886 | 10c53980778e455351e89754bc90b71378c07a2b | /annotations/kubernetes-annotations/src/main/java/io/dekorate/kubernetes/decorator/AddIngressRuleDecorator.java | 54ca298869247780eb7305cca21079a8c3bf5dcc | [
"Apache-2.0"
] | permissive | dswiecki/dekorate | f54156a9777c7eab24f6854c6a4aa0248406af04 | c43d2719794364161a59835688789178aa2f9590 | refs/heads/master | 2023-04-11T09:46:53.947176 | 2021-04-20T22:02:46 | 2021-04-20T22:02:46 | 298,585,345 | 0 | 0 | Apache-2.0 | 2020-09-25T13:46:55 | 2020-09-25T13:46:55 | null | UTF-8 | Java | false | false | 3,542 | java | /**
* Copyright 2018 The original authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.dekorate.kubernetes.decorator;
import io.dekorate.kubernetes.config.Port;
import io.dekorate.utils.Strings;
import java.util.function.Predicate;
import io.fabric8.kubernetes.api.builder.TypedVisitor;
import io.fabric8.kubernetes.api.model.ObjectMeta;
import io.fabric8.kubernetes.api.model.networking.v1.HTTPIngressPathBuilder;
import io.fabric8.kubernetes.api.model.networking.v1.IngressRuleBuilder;
import io.fabric8.kubernetes.api.model.networking.v1.IngressSpecBuilder;
public class AddIngressRuleDecorator extends NamedResourceDecorator<IngressSpecBuilder> {
private final String host;
private final Port port;
public AddIngressRuleDecorator(String name, String host, Port port) {
super(name);
this.host = host;
this.port = port;
}
@Override
public void andThenVisit(IngressSpecBuilder spec, ObjectMeta meta) {
Predicate<IngressRuleBuilder> matchingHost = r -> r.getHost() != null && r.getHost().equals(host);
if (!spec.hasMatchingRule(matchingHost)) {
spec.addNewRule().withHost(host).withNewHttp().addNewPath().withPathType("Prefix").withPath(port.getPath()).withNewBackend()
.withNewService()
.withName(name)
.withNewPort().withName(port.getName())
.withNumber(Strings.isNullOrEmpty(port.getName()) ? port.getHostPort() : null).endPort()
.endService()
.endBackend()
.endPath()
.endHttp()
.endRule();
} else {
spec.accept(new HostVisitor(meta));
}
}
private class HostVisitor extends TypedVisitor<IngressRuleBuilder> {
private final ObjectMeta meta;
public HostVisitor(ObjectMeta meta) {
this.meta = meta;
}
@Override
public void visit(IngressRuleBuilder rule) {
Predicate<HTTPIngressPathBuilder> mathcingPath = r -> r.getPath() != null && r.getPath().equals(port.getPath());
if (rule.getHost().equals(host)) {
if (!rule.editOrNewHttp().hasMatchingPath(mathcingPath)) {
rule.editHttp().addNewPath().withNewBackend()
.withNewService()
.withName(name)
.withNewPort().withName(port.getName())
.withNumber(Strings.isNullOrEmpty(port.getName()) ? port.getHostPort() : null).endPort()
.endService()
.endBackend()
.endPath().endHttp();
} else {
rule.accept(new PathVisitor(meta));
}
}
}
}
private class PathVisitor extends TypedVisitor<HTTPIngressPathBuilder> {
private final ObjectMeta meta;
public PathVisitor(ObjectMeta meta) {
this.meta = meta;
}
public void visit(HTTPIngressPathBuilder path) {
path.withNewBackend()
.withNewService()
.withName(name)
.withNewPort().withName(port.getName())
.withNumber(Strings.isNullOrEmpty(port.getName()) ? port.getHostPort() : null).endPort()
.endService()
.endBackend();
}
}
}
| [
"[email protected]"
] | |
86257be6a973030fb5ce918e2665c8168ee6d29a | dae84973b9fab4a675b666a7cd23b6f4a5855a2f | /boot/module-system/src/main/java/work/framework/modules/demo/test/vo/JeecgOrderMainPage.java | c077d049cff4ca57c4f5542253007bba2f716856 | [] | no_license | wang-yan-github/ufo | 1482d21c0c4200f4dcb06816a608908a6a35a6d4 | 182e684cd8615ad8575eca6706c2b54ce56c5af8 | refs/heads/master | 2022-01-27T17:29:44.894865 | 2019-07-05T10:05:23 | 2019-07-05T10:05:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,228 | java | package work.framework.modules.demo.test.vo;
import java.util.List;
import work.framework.modules.demo.test.entity.JeecgOrderCustomer;
import work.framework.modules.demo.test.entity.JeecgOrderTicket;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import lombok.Data;
@Data
public class JeecgOrderMainPage {
/**主键*/
private java.lang.String id;
/**订单号*/
@Excel(name="订单号",width=15)
private java.lang.String orderCode;
/**订单类型*/
private java.lang.String ctype;
/**订单日期*/
@Excel(name="订单日期",width=15,format = "yyyy-MM-dd")
private java.util.Date orderDate;
/**订单金额*/
@Excel(name="订单金额",width=15)
private java.lang.Double orderMoney;
/**订单备注*/
private java.lang.String content;
/**创建人*/
private java.lang.String createBy;
/**创建时间*/
private java.util.Date createTime;
/**修改人*/
private java.lang.String updateBy;
/**修改时间*/
private java.util.Date updateTime;
@ExcelCollection(name="客户")
private List<JeecgOrderCustomer> jeecgOrderCustomerList;
@ExcelCollection(name="机票")
private List<JeecgOrderTicket> jeecgOrderTicketList;
}
| [
"[email protected]"
] | |
24d1d19007cb0d7ce548111d902b3a578bd3261f | f59f1209c241c13db70fd324754e472c3b11a475 | /src/main/java/TeraNether/Providers/TNCeilingProvider.java | 0824bcf956682cd8e960e350f0b8e1f992d695cb | [] | no_license | MKDEVELOPEMENT/TeraNether | 35174d3ad6fe966d8103cc0e0e9038edb2724bce | ef2466608c9486dcc64b89cddc552d9dd5dbd66d | refs/heads/master | 2020-12-19T10:24:26.896441 | 2020-01-23T02:13:26 | 2020-01-23T02:13:26 | 235,706,770 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,313 | java | /*
* Copyright 2019 MovingBlocks
*
* 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 TeraNether.Providers;
import TeraNether.Facets.TNCeilingHeightFacet;
import TeraNether.Facets.TNSurfaceHeightFacet;
import org.terasology.math.geom.BaseVector2i;
import org.terasology.math.geom.Rect2i;
import org.terasology.math.geom.Vector2f;
import org.terasology.utilities.procedural.Noise;
import org.terasology.utilities.procedural.SimplexNoise;
import org.terasology.utilities.procedural.SubSampledNoise;
import org.terasology.world.generation.*;
@Produces(TNCeilingHeightFacet.class)
@Requires(@Facet(TNSurfaceHeightFacet.class))
public class TNCeilingProvider implements FacetProvider {
private Noise surfaceNoise;
private int infernoHeight;
public TNCeilingProvider(int height) {
this.infernoHeight = height;
}
@Override
public void setSeed(long seed) {
surfaceNoise = new SubSampledNoise(new SimplexNoise(seed + 1), new Vector2f(0.003f, 0.003f), 1);
}
@Override
public void process(GeneratingRegion region) {
Border3D border = region.getBorderForFacet(TNCeilingHeightFacet.class);
TNCeilingHeightFacet ceilingHeightFacet = new TNCeilingHeightFacet(region.getRegion(), border);
TNSurfaceHeightFacet surfaceHeightFacet = region.getRegionFacet(TNSurfaceHeightFacet.class);
int baseSurfaceHeight = surfaceHeightFacet.getBaseSurfaceHeight();
Rect2i processRegion = ceilingHeightFacet.getWorldRegion();
for (BaseVector2i position : processRegion.contents()) {
ceilingHeightFacet.setWorld(position, surfaceNoise.noise(position.x(), position.y()) * 20 - baseSurfaceHeight + infernoHeight);
}
region.setRegionFacet(TNCeilingHeightFacet.class, ceilingHeightFacet);
}
}
| [
"[email protected]"
] | |
cf83c20a8768be4a6204e9ff9e55ff727a8fe1a3 | 705f413393842481874ca4397320e33ba568bfa8 | /src/main/java/com/trs/commodity/dao/CountryDictMapper.java | fad6005977c1c119c5a7ac851c1e9d773d864e1e | [] | no_license | TRSFinance/ssmExim | d4b189d5913f51480aafc1101088ca602c38b7c7 | 5af5108f359070f9843605697cf57c2f37cc1a77 | refs/heads/master | 2021-01-11T23:36:13.422226 | 2017-01-17T02:28:07 | 2017-01-17T02:28:07 | 78,609,167 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 949 | java | package com.trs.commodity.dao;
import java.util.List;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import com.trs.commodity.model.CountryDict;
public interface CountryDictMapper {
int deleteByPrimaryKey(String countryCode);
int insert(CountryDict record);
int insertSelective(CountryDict record);
CountryDict selectByPrimaryKey(String countryCode);
int updateByPrimaryKeySelective(CountryDict record);
int updateByPrimaryKey(CountryDict record);
@Select("select * from country_dict where is_reporter='1'")
@ResultMap("BaseResultMap")
public List<CountryDict> findReporters();
@Select("select * from country_dict where is_partner='1'")
@ResultMap("BaseResultMap")
public List<CountryDict> findPartners();
@Select("select * from country_dict")
@ResultMap("BaseResultMap")
List<CountryDict> findAll();
} | [
"[email protected]"
] | |
f7059d7ebe4aa9c082b0d174da072d7e2bf957c7 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project98/src/main/java/org/gradle/test/performance98_3/Production98_225.java | ac93aed895132bbda2ee0e669b4b816ff8f59d8c | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 305 | java | package org.gradle.test.performance98_3;
public class Production98_225 extends org.gradle.test.performance17_3.Production17_225 {
private final String property;
public Production98_225() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"[email protected]"
] | |
78cc32c917cf44fad6cbcf1f2c06df5726aa4ce1 | f5ef8d136c21416a99f8d04c5ade8f5048fb474f | /test/java/ldt/run/CompareStackTraces.java | a391b3a8680985da730c2feec0177a160953f2ae | [] | no_license | michaelschuetz/ldt | aea01d8588b6d972e7ce35b4ae0d5636650ee00d | ff620bf3a369b9e4c2c95e62c6aa7a91c6fb64f9 | refs/heads/master | 2021-01-16T19:50:20.195676 | 2013-02-06T23:06:54 | 2013-02-06T23:06:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 838 | java | package ldt.run;
import ldt.threads.ThreadDumpReader;
/**
* TODO comment this class
*
* @author lrosenberg
* @since 06.02.13 23:29
*/
public class CompareStackTraces {
public static void main(String a[]) throws Exception{
ThreadDumpReader.compare("2013-02-06/jstack-2013-02-06-11-45.txt","2013-02-06/jstack-2013-02-06-10-44.txt");
ThreadDumpReader.compare("2013-02-06/jstack-2013-02-06-11-55.txt","2013-02-06/jstack-2013-02-06-11-45.txt");
ThreadDumpReader.compare("2013-02-06/jstack-2013-02-06-11-57-syncstarted.txt", "2013-02-06/jstack-2013-02-06-11-55.txt");
ThreadDumpReader.compare("2013-02-06/jstack-2013-02-06-12-01-updatefinished.txt", "2013-02-06/jstack-2013-02-06-11-57-syncstarted.txt");
ThreadDumpReader.compare("2013-02-06/jstack-2013-02-06-14-07.txt", "2013-02-06/jstack-2013-02-06-10-44.txt");
}
}
| [
"[email protected]"
] | |
fb331a6d4ed38b3e488776ad91409466b3e7e925 | 84aa414f615392d168f24dd3b75eb5ca9bbcfe48 | /src/com/company/Penguin.java | 98eaf86d5c0b3c39cc3df65272df39ba7347630a | [] | no_license | lucas-salmons/Abstraction | 673d963d1685eaa3046f3d7d033f1fe7694baf2c | 38910ff5a9725d7c95053ff373189303567937bd | refs/heads/master | 2023-02-09T08:21:12.985475 | 2020-12-31T22:11:58 | 2020-12-31T22:11:58 | 325,880,550 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java | package com.company;
public class Penguin extends Bird{
public Penguin(String name) {
super(name);
}
@Override
public void fly() {
super.fly();
System.out.println("I would rather swim");
}
}
| [
"[email protected]"
] | |
9d508f3ae113a10f905e01e7f55d367023394d0e | 103f3f68fcf7e57fda576da69f0251643c42c3a3 | /Mediseen/app/src/main/java/mediseen/login/CheckStart.java | 7284e10dcf9c5d34b5e62dcd3e63a95524664c04 | [] | no_license | ElysiaVilladarez/Mediseen | 3a5d0a23d7eba57414db134f5da297786cbc39e1 | e2afdc316917c2a7499fc0436c1830de7b677658 | refs/heads/master | 2020-04-10T06:05:15.147624 | 2018-02-23T10:44:29 | 2018-02-23T10:44:29 | 52,143,335 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,242 | java | package mediseen.login;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import mediseen.work.pearlsantos.mediseen.BuildConfig;
/**
* Created by elysi on 3/28/2016.
*/
public class CheckStart extends AsyncTask<Void, Void, Integer> {
private Context c;
public static final String PREFS_NAME = "USER DATA";
final String PREF_VERSION_CODE_KEY = "version_code";
final int DOESNT_EXIST = -1;
private Activity act;
final static String WHAT_TO_DO = "NEXT_ACTION";
public CheckStart(Context context, Activity a) {
c = context;
act = a;
}
public void onPreExecute() {
}
@Override
protected Integer doInBackground(Void... params) {
final int currentVersionCode = BuildConfig.VERSION_CODE;
SharedPreferences prefs = c.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
// Get current version code
if (prefs == null || prefs.getInt(PREF_VERSION_CODE_KEY, DOESNT_EXIST) == DOESNT_EXIST) {
// TODO This is a new install (or the user cleared the shared preferences)
// return new Intent(c, InstructionSlides.class);
prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).apply();
return 0;
} else if (currentVersionCode == prefs.getInt(PREF_VERSION_CODE_KEY, DOESNT_EXIST)) {
//Normal run
return 1;
} else if (currentVersionCode > prefs.getInt(PREF_VERSION_CODE_KEY, DOESNT_EXIST)) {
prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).apply();
return -1;
// TODO This is an upgrade
} else return -1;
}
@Override
public void onPostExecute(Integer i) {
Intent next = new Intent(act, CreateAccount.class);;
if(i == 0) {
next = new Intent(act, CreateAccount.class);
} else if(i == 1){
next = new Intent(act, LoginPage.class);
}
act.startActivity(next);
// act.overridePendingTransition(R.anim.pull_in_right,
// R.anim.push_out_left);
act.finish();
}
}
| [
"[email protected]"
] | |
f5e347885672ccb3f7bd801f00c2bc2dbcf42d3d | edbdea4feed4f39977215eb11bb0f0d877b53996 | /springWenjsAutoConfiguration/src/main/java/com/wjs/entity/package-info.java | 3824ef43c32dec1b002f1245e1d02998685049ca | [] | no_license | wjs1989/mycore | b787b44f41635ef6bcf8db6f98fa206eb68b6996 | 0050c96ab14c23940ca462d7f6b6b59631cff06c | refs/heads/master | 2022-06-27T18:27:31.262146 | 2020-09-02T07:53:15 | 2020-09-02T07:53:15 | 252,192,157 | 0 | 0 | null | 2022-06-21T03:06:57 | 2020-04-01T14:04:55 | Java | UTF-8 | Java | false | false | 132 | java | /**
* @ClassName package-info
* @Description: TODO
* @Author wjs
* @Date 2020/3/26
* @Version V1.0
**/
package com.wjs.entity; | [
"[email protected]"
] | |
1c9ec854f4b2f9f78133ac8850dd9d42a3aa45a1 | ba9214af2ca65e9f3d245b8f4ac658652d00993e | /Primzahlen_dreidimensional/src/ch/noseryoung/plj/Cube.java | f5e6a80e4a2a24871d4acae1d38f67b6645e9fe5 | [] | no_license | sinablattmann/TestRepo | 479e8c9cb54d1844cae8c687427f6cd606a65d2c | b3d9b5000a7726ebdc457ca0315ac909864d0bae | refs/heads/master | 2020-07-05T05:20:46.403110 | 2019-08-15T12:51:06 | 2019-08-15T12:51:06 | 202,535,150 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,124 | java | package ch.noseryoung.plj;
import java.math.BigInteger;
public class Cube {
private int[][][] threeDimensional;
public Cube() {
this.threeDimensional = new int[20][20][20];
}
public void fillCube() {
int max = 9;
int min = 1;
int range = max - min + 1;
for (int i = 0; i < 20; i++) {
for (int j = 0; j < 20; j++) {
for (int k = 0; k < 20; k++) {
this.threeDimensional[i][j][k] = (int) (Math.random() * range) + min;
}
}
}
}
public boolean isNumberPrime(int number) {
BigInteger bigInt = BigInteger.valueOf(number);
return bigInt.isProbablePrime(100);
}
public boolean isSquareFilledWithPrimes(int x, int y, int z) {
boolean isFilled = false;
if (this.isNumberPrime(this.threeDimensional[x][y][z]) && this.isNumberPrime(this.threeDimensional[x + 1][y][z])
&& this.isNumberPrime(this.threeDimensional[x][y + 1][z])
&& this.isNumberPrime(this.threeDimensional[x + 1][y + 1][z])) {
isFilled = true;
}
return isFilled;
}
public void printPrimeCube(int x, int y, int z) {
System.out.println(
threeDimensional[x][y][z] + " " + threeDimensional[x][y + 1][z] + " " + threeDimensional[x + 1][y + 1][z] + " "
+ threeDimensional[x + 1][y][z] + " " + threeDimensional[x + 1][y][z] + " " + threeDimensional[x][y][z + 1]
+ " " + threeDimensional[x][y + 1][z + 1] + " " + threeDimensional[x + 1][y + 1][z + 1]);
}
public void checkForPrimeCubes() {
for (int x = 0; x < 19; x++) {
for (int y = 0; y < 19; y++) {
for (int z = 0; z < 19; z++) {
if (this.isSquareFilledWithPrimes(x, y, z) && this.isSquareFilledWithPrimes(x, y, z + 1)) {
System.out.println("X-Coordinate: " + x + ", Y-Coordinate: " + y + ", Z-Coordinate: " + z);
this.printPrimeCube(x, y, z);
return;
}
}
}
}
}
public int[][][] getThreeDimensional() {
return threeDimensional;
}
public void setThreeDimensional(int[][][] threeDimensional) {
this.threeDimensional = threeDimensional;
}
}
| [
"[email protected]"
] | |
3cd826370d9202774ad6c74f92fce81c3c81d849 | 0a57b5c0495eae502ad6a9e21bf2ff24b502514f | /app/src/main/java/com/mhraju/deviceinfo/MainActivity.java | 3c6618de9f14a3c5575fbd4aeaceb056f741c177 | [] | no_license | mhraju/DeviceInfo | 94fbac1e5d005009bdc13e7d11d6d5a334ea18ee | acc8aaf017ed288b5e6343ded4c004087c78dbe8 | refs/heads/master | 2020-12-30T15:42:43.317669 | 2017-05-15T13:02:12 | 2017-05-15T13:02:12 | 91,171,614 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,630 | java | package com.mhraju.deviceinfo;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.FragmentManager;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.InterstitialAd;
import com.mhraju.deviceinfo.Adapter.PagerAdapter;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;
import com.mhraju.deviceinfo.Adapter.ViewPagerAdapter;
import com.mhraju.deviceinfo.Fragment.DeviceFragment;
import com.mhraju.deviceinfo.Fragment.MemoryFragment;
import com.mhraju.deviceinfo.Fragment.OSFragment;
import com.mhraju.deviceinfo.Fragment.ScreenFragment;
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
private String mReport = "Write your Report...";
private String mAppName = "Device info";
private InterstitialAd mInterstitialAd;
private FloatingActionButton fab;
private static final String[] SEND_TO_EMAIL = new String[]{
"[email protected]"
};
private ViewPager viewPager;
private DrawerLayout drawer;
private TabLayout tabLayout;
private Menu menu;
private String[] pageTitle = {"Device", "OS", "Screen", "Memory", "Battery"};
private TextView tv1,tv2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
viewPager = (ViewPager)findViewById(R.id.view_pager);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
drawer = (DrawerLayout) findViewById(R.id.drawerLayout);
setSupportActionBar(toolbar);
//create default navigation drawer toggle
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar,
R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.addDrawerListener(toggle);
toggle.syncState();
//setting Tab layout (number of Tabs = number of ViewPager pages)
tabLayout = (TabLayout) findViewById(R.id.tab_layout);
for (int i = 0; i < 5; i++) {
tabLayout.addTab(tabLayout.newTab().setText(pageTitle[i]));
}
//set gravity for tab bar
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
//handling navigation view item event
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
assert navigationView != null;
navigationView.setNavigationItemSelectedListener(this);
FragmentManager manager=getSupportFragmentManager();
/* PagerAdapter adapter=new PagerAdapter(manager);
viewPager.setAdapter(adapter);
*/
// viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
//set viewpager adapter
ViewPagerAdapter pagerAdapter = new ViewPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(pagerAdapter);
tabLayout.setupWithViewPager(viewPager);
//change Tab selection when swipe ViewPager
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
//change ViewPager page when tab selected
/* tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
viewPager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});*/
}
private InterstitialAd createNewIntAd() {
InterstitialAd intAd = new InterstitialAd(this);
// set the adUnitId (defined in values/strings.xml)
intAd.setAdUnitId(getString(R.string.ad_id_interstitial));
intAd.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
fab.setEnabled(true);
}
@Override
public void onAdFailedToLoad(int errorCode) {
fab.setEnabled(true);
}
@Override
public void onAdClosed() {
fabClicked();
}
});
return intAd;
}
private void showIntAdd() {
// Show the ad if it's ready. Otherwise toast and reload the ad.
if (mInterstitialAd != null && mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
} else {
levelTwo();
}
}
private void loadIntAdd() {
// Disable the level two button and load the ad.
// fab.setEnabled(false);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("ca-app-pub-6008099628983320~4249007494")
.build();
mInterstitialAd.loadAd(adRequest);
}
private void levelTwo() {
// Show the next level
fab.setVisibility(View.INVISIBLE);
/*mLevelTextView.setText("Level Two");*/
Toast t = Toast.makeText(this,"You have reached Level Two !!",Toast.LENGTH_LONG);
t.show();
}
private void fabClicked(){
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, SEND_TO_EMAIL);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, mAppName);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, mReport);
//emailIntent.putExtra(Intent.EXTRA_STREAM, u);
// Send it off to the Activity-Chooser
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
}
});
}
@Override
public boolean onNavigationItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.Device) {
viewPager.setCurrentItem(0);
} else if (id == R.id.OS) {
viewPager.setCurrentItem(1);
} else if (id == R.id.Screen) {
viewPager.setCurrentItem(2);
}else if (id == R.id.Memory) {
viewPager.setCurrentItem(3);
}else if (id == R.id.Battery) {
viewPager.setCurrentItem(4);
}/*else if (id == R.id.go) {
Intent intent = new Intent(this, DesActivity.class);
intent.putExtra("string", "Go to other Activity by NavigationView item cliked!");
startActivity(intent);
} else if (id == R.id.close) {
finish();
}*/
drawer.closeDrawer(GravityCompat.START);
return true;
}
@Override
public void onBackPressed() {
assert drawer != null;
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.about:
new AlertDialog.Builder(this)
.setTitle("Powered by : Tech_Nerds")
.setMessage(
"Email : [email protected]\n\n" +
"Blog : https://mhraju.github.io\n")
.setPositiveButton("OK", null)
.show();
return true;
case R.id.dedicate:
getDedication();
/* new AlertDialog.Builder(this)
.setTitle("Dedicated to...")
.setMessage(
"Email : [email protected]\n\n" +
"Blog : https://mhraju.github.io\n")
.setPositiveButton("OK", null)
.show();*/
return true;
/*
case R.id.create_new_pattern:
Intent intent = new Intent(MainActivity.this, ChangeActivity.class);
startActivity(intent);
finish();
return true;*/
default:
return super.onOptionsItemSelected(item);
}
}
public void getDedication() {
android.support.v7.app.AlertDialog.Builder dialogBuilder = new android.support.v7.app.AlertDialog.Builder(this);
LayoutInflater inflater = this.getLayoutInflater();
final View dialogView = inflater.inflate(R.layout.helpline_custom_dialog, null);
dialogBuilder.setView(dialogView);
tv1=(TextView)dialogView.findViewById(R.id.dedicateTo);
tv2=(TextView)dialogView.findViewById(R.id.dedicateName);
/* Typeface face= Typeface.createFromAsset(getAssets(), "SolaimanLipi.ttf");
tv1.setTypeface(face);
Typeface face1= Typeface.createFromAsset(getAssets(), "SolaimanLipi.ttf");
tv2.setTypeface(face1);
*/
dialogBuilder.setTitle("Dedicated to...");
//dialogBuilder.setMessage("Enter text below");
dialogBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
//do something with edt.getText().toString();
}
});
android.support.v7.app.AlertDialog b = dialogBuilder.create();
b.show();
}
/* @SuppressWarnings("StatementWithEmptyBody")
private void displaySelectedScreen(int itemId) {
//creating fragment object
Fragment fragment = null;
//initializing the fragment object which is selected
switch (itemId) {
case R.id.nav_device:
viewPager.setCurrentItem(0);
break;
case R.id.nav_os:
viewPager.setCurrentItem(1);
break;
case R.id.nav_screen:
viewPager.setCurrentItem(2);
break;
case R.id.nav_memory:
viewPager.setCurrentItem(3);
break;
case R.id.nav_battery:
viewPager.setCurrentItem(4);
break;
}
//replacing the fragment
if (fragment != null) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.content_frame, fragment);
ft.commit();
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
//calling the method displayselectedscreen and passing the id of selected menu
displaySelectedScreen(item.getItemId());
//make this method blank
return true;
}*/
}
| [
"[email protected]"
] | |
b8f764f5bf66149e77e31b1604249533ce83af42 | 00d4dd14b903292234f1602d79b0ce0e2e755b8c | /tbase/src/main/java/com/trjx/tbase/module/recyclermodule/TRecyclerMoreItemAdapter.java | c2eebd012909299c04408c3d8544f4fbf01b3ab0 | [] | no_license | tianhaifeng1/TBaseApp | baa4a51d24a99063829ff53f2b7d4ffba16e2bf1 | fac0e1e87d146aa4bf6fd56e90839c9ea97a0361 | refs/heads/master | 2023-04-03T08:20:31.196827 | 2021-04-14T02:38:01 | 2021-04-14T02:38:01 | 293,201,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 981 | java | package com.trjx.tbase.module.recyclermodule;
import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import java.util.List;
/**
* 多布局文件,可以参考此类
*
* @param <B>
* @param <H>
*/
/**
* 作者:小童
* 创建时间:2019/8/6 17:51
* <p>
* 描述:此为多条目样式的适配器
* <p>
* 注:
* <p>
* 1.单页面针对单适配器
*/
public abstract class TRecyclerMoreItemAdapter<B extends MultiItemEntity>
extends BaseMultiItemQuickAdapter<B,BaseViewHolder> {
public TRecyclerMoreItemAdapter( @Nullable List<B> data) {
super(data);
}
// protected void addItemType(int type, @LayoutRes int layoutResId) {
// super.addItemType(type,layoutResId);
// }
@Override
protected abstract void convert(BaseViewHolder helper, B item);
}
| [
"[email protected]"
] | |
9a3b01941e27f917cf6e39d7bc91000b8754a06e | 8d18b9059d0185b175509f8ee03898eab787b2d3 | /bdps-gapi/src/main/java/com/bdps/gateway/resolvers/orderDetail/OrderDetailQuery.java | 6dfc6f8691e17e0a4b95ce9dcd5f0e72dbd97ed8 | [] | no_license | inspirationLG/bdps02 | e894cb0a29baf87e135d2fdb634e40f311259e7c | 2db8609ceeb99812bb5212fb6c3aa25769b7b7ea | refs/heads/master | 2020-07-18T08:43:08.394393 | 2019-09-04T02:45:22 | 2019-09-04T02:45:22 | 206,215,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 977 | java | package com.bdps.gateway.resolvers.orderDetail;
import com.bdps.gateway.clients.OrderClient;
import com.bdps.gateway.clients.OrderDetailClient;
import com.bdps.order.OrderProto;
import com.bdps.order_detail.OrderDetailProto;
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.google.common.util.concurrent.ListenableFuture;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
@AllArgsConstructor
@Component
public class OrderDetailQuery implements GraphQLQueryResolver {
private final OrderDetailClient orderDetailClient;
public ListenableFuture<OrderDetailProto.OrderDetail> getOrderDetail(OrderDetailProto.GetOrderDetailRequest request) {
return orderDetailClient.getOrderDetail(request.getOrderDetailId());
}
public ListenableFuture<OrderDetailProto.OrderDetails> listOrderDetail(OrderDetailProto.ListOrderDetailRequest request) {
return orderDetailClient.listOrderDetail(request);
}
}
| [
"[email protected]"
] | |
540bc6ab456be0afc9b4f115087362a2365ebe45 | 0686720f016c459fec26f0ef31c0550e8b0d54dc | /src/main/java/com/mper/smartschool/entity/Offer.java | e8efbba01e59e599ba08466307c0eab315961354 | [] | no_license | BhHaipls/kinder_child_clothe | f8eaff3d5eaa556f3a4a5316343217be5a669539 | 3d7b672da650bf2b56526e1ca0adb4b81f00aff1 | refs/heads/master | 2021-05-20T10:51:16.387913 | 2020-04-01T18:36:17 | 2020-04-01T18:36:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | package com.mper.smartschool.entity;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Date;
@Data
@NoArgsConstructor
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class Offer extends BaseEntity{
@Column(length = 256)
private String name;
@Column()
private Date date;
@ManyToOne(cascade = CascadeType.MERGE)
@PrimaryKeyJoinColumn
private User user;
@ManyToOne(cascade = CascadeType.MERGE)
@PrimaryKeyJoinColumn
private Delivery delivery;
}
| [
"[email protected]"
] | |
2363ae98fdd21a7faf234bd44f122d3171e3e5df | 8c6875ae351f1821b940df88ea4990f069f59647 | /app/src/main/java/org/fossday/Model/Nodes/Lecture/Author.java | 730ad67561752c1f86bad52b9887e9736b89d7a5 | [
"MIT"
] | permissive | fossday/mobile | f583468f33b7e374b51f09ef62a213d07d107c3b | 0d22b81518631615930eca7fefc458ff9016e3b0 | refs/heads/master | 2020-08-02T16:34:04.479199 | 2019-09-30T17:58:01 | 2019-09-30T17:58:01 | 211,430,937 | 3 | 1 | MIT | 2019-09-30T17:58:02 | 2019-09-28T02:16:48 | null | UTF-8 | Java | false | false | 604 | java | package org.fossday.Model.Nodes.Lecture;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Author {
@SerializedName("embeddable")
@Expose
private Boolean embeddable;
@SerializedName("href")
@Expose
private String href;
public Boolean getEmbeddable() {
return embeddable;
}
public void setEmbeddable(Boolean embeddable) {
this.embeddable = embeddable;
}
public String getHref() {
return href;
}
public void setHref(String href) {
this.href = href;
}
}
| [
"[email protected]"
] | |
6abece38ef52517136b833469c966c1ee6a9f772 | 5c57c399921f2363955107b70a8cd82f470b1166 | /src/main/java/com/sofrecom/cos/mw/web/rest/errors/ErrorConstants.java | e2bd1eceedef7908055914b136535cde88f6d4e6 | [] | no_license | khabane1992/reamenagement-management | f348415d17587b783cfefc1eb24ceb2f3778dfe4 | 8cb838cc5d39a82e4725ff9e3f48c2858473a67a | refs/heads/main | 2023-04-26T00:34:04.215459 | 2021-06-03T17:47:12 | 2021-06-03T17:47:12 | 373,594,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 591 | java | package com.sofrecom.cos.mw.web.rest.errors;
import java.net.URI;
public final class ErrorConstants {
public static final String ERR_CONCURRENCY_FAILURE = "error.concurrencyFailure";
public static final String ERR_VALIDATION = "error.validation";
public static final String PROBLEM_BASE_URL = "https://www.jhipster.tech/problem";
public static final URI DEFAULT_TYPE = URI.create(PROBLEM_BASE_URL + "/problem-with-message");
public static final URI CONSTRAINT_VIOLATION_TYPE = URI.create(PROBLEM_BASE_URL + "/constraint-violation");
private ErrorConstants() {}
}
| [
"[email protected]"
] | |
5f963e3e38a67b65f95ddf114859f0af8436716d | 8f86001b47d73ab6325f98df2704b295014d9fad | /sc-ribbon-hystrix/src/main/java/lenny/sc/scribbon/ScRibbonApplication.java | 13d0649ed0526f5528ec26c02f3e20a4e0f78b70 | [
"Apache-2.0"
] | permissive | levphon/spring-cloud | 094d1beb62107c0e4421fd86e5f670a3b0a18be4 | 6d29b46eb3bba2b53180bed59c54ac5a2914a958 | refs/heads/master | 2020-03-29T05:04:09.413191 | 2018-09-11T10:21:53 | 2018-09-11T10:21:53 | 149,564,749 | 1 | 0 | Apache-2.0 | 2018-09-20T06:50:34 | 2018-09-20T06:50:34 | null | UTF-8 | Java | false | false | 858 | java | package lenny.sc.scribbon;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
@EnableDiscoveryClient
@EnableHystrix
@EnableHystrixDashboard
public class ScRibbonApplication {
public static void main(String[] args) {
SpringApplication.run(ScRibbonApplication.class, args);
}
@Bean
@LoadBalanced
public RestTemplate restTemplate(){
return new RestTemplate();
}
}
| [
"Abcd1234"
] | Abcd1234 |
cec8f652e70e8c1f046c1ac63b564c1e63d6931d | 35bd1991431dadb46d0ddaebaa3c3721424173cc | /src/JCup/ParserTokens/ID.java | 57b61ff8c98d21453c3e441240bf60116113ed45 | [] | no_license | Srdiegoibs/Doge | 28e674e575e1ab7232c799e964eac287fd72be76 | 2f402fa47f2398da950ce12988963c30391fe73d | refs/heads/master | 2023-07-12T16:49:11.265753 | 2021-08-20T15:43:23 | 2021-08-20T15:43:23 | 398,325,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 368 | java | package JCup.ParserTokens;
public class ID extends F{
Integer var;
public ID(Integer s) {
var = s;
}
@Override
void print(String prefix, boolean isTail) {
String type = "F";
System.out.println(prefix + (isTail ? "\\-- " : "|-- ") + type);
System.out.println(prefix + " " + (isTail ? "\\-- " : "|-- ") + "ID");
}
} | [
"[email protected]"
] | |
30ce46f06c1ebafab15751016619f2f4d8d97e81 | f3047430c93fee2d757884f921f0772fa6926ba1 | /LCK/src/contents/StringContents.java | d6664def6845a50abe668887884d2490800e402f | [] | no_license | doooyeon/LKC | 71e3f1381fb46dcdb5c8075e81431f4a5cc4b929 | 5440ed93b82f6be447cdd1b6af793ea3d254dea3 | refs/heads/master | 2021-01-19T04:41:03.103523 | 2016-09-28T02:46:28 | 2016-09-28T02:46:28 | 69,360,632 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 666 | java | package contents;
import java.io.Serializable;
import server_manager.LinKlipboard;
public class StringContents extends Contents implements Serializable {
private static final long serialVersionUID = 8197233165098147502L;
private String stringData;
public StringContents() {
super();
type = LinKlipboard.STRING_TYPE;
setDate();
}
public StringContents(String data) {
this();
stringData = data;
setDate();
}
public StringContents(String sharer, String data) {
super(sharer);
type = LinKlipboard.STRING_TYPE;
this.stringData = data;
setDate();
}
public String getString() {
return stringData;
}
} | [
"Administrator@LG-48"
] | Administrator@LG-48 |
c3df76c07e77edff821b8b8dba12972935a399f0 | 2383747f5989ca5c2c98e204f7be3b6cc5e52e4e | /src/test/java/day04/Notes.java | 0345e7fdada3d959c566fd20433024d7822efc54 | [] | no_license | salimkocabas/GMI-Bank-RestAssured-API-Tests | 1089d13d14bb04e41ff628ccf4cbd3b79e58f4e4 | c74075c0e0c32ef831ce648fbba9816d3b7fdbd2 | refs/heads/main | 2023-07-13T11:47:16.427821 | 2021-08-25T03:22:43 | 2021-08-25T03:22:43 | 399,676,361 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,172 | java | package day04;
public class Notes {
/*
Day 09
Day 04 of RestAssured
Post Request
need body , and need to tell server what kind of data we are sending
We learned how to pass body using String
we can also pass body by external file or Map object or custom class object
in spartan app we should get 201 status code
and new data should be generated with success
We want to get the name part random by using java faker dependency
<dependency>
<groupId>com.github.javafaker</groupId>
<artifactId>javafaker</artifactId>
<version>1.0.2</version>
</dependency>6
We can also provide the body as external File
File f1 = new File("path/to/your/file.json") ;
given()
.contentType(ContentType.json)
.body(f1)
when()
.post("/spartans")......
We can also provide Java objects like Map , or custom type we created(coming later)
conversion between Java object and JSON need external handler
popular options are :
Jackson library from com.fasterxml.jackson.core
Gson library from google
we just need to provide one of these in the classpath (dependency)
and restassured will take care of the rest
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.2</version>
</dependency>
so behind the scene
its taking the map object and turning it into json when we pass map object to the body
Map<String, Object> bodyMap = new HashMap<>();
bodyMap.put("name","Vincent");
bodyMap.put("gender","Male");
bodyMap.put("phone",3476346789l);
given()
.contentType(ContentType.JSON)
.body(bodyMap).
when()
.post("/spartans").
jackson-databind is turning the bodyMap object into below json
{
"name": "Vincent",
"gender": "Male",
"phone": 3476346789
}
turning your java object to json (or text files) known as serialization
you can use it for any request that need such transformation
like PUT , PATCH
{
"name": "Vincent",
"gender": "Male",
"phone": 3476346789
}
--->> custom java type
public class Spartan {
private String name ;
private String gender ;
private long phone ;
// public getters and setters
// optionally constructors
}
// this type of class that has private fields
// and public getters and setters , optionally constructors
// also known as pojo (PLAIN OLD JAVA OBJECT)
// to represent data
please create a package called pojo
add class Spartan with 3 encapsulate fields name, gender , phone
add 2 constructors
empty no arg constructor
constructors with 3 arguments to set all the field values
--------- back to Junit test from here
continue with your post request in the junit test
tinstead of providing body
as string or file or map object ,
this time we will provide the body as spartan object
and let jackson to take care of the rest of transformation to json
*/
}
| [
"[email protected]"
] | |
7cd17fd700c38aa7ccfb689f069b3d6a3d7c1c07 | 97087a1bc2bc16923a7656b287b9293aa161100f | /src/main/java/com/yurisantana/pedido/services/DBService.java | 4f5bf0c9bdb5af3ff409088a16ab8d8fdd070ff2 | [] | no_license | yuri300/SistemaPedido | f56b03e6c054e206618d297643079b3603e42527 | e899629aec10a56bc744609c77cf5ff0188ac43e | refs/heads/main | 2023-06-05T01:56:27.589107 | 2021-07-04T15:28:28 | 2021-07-04T15:28:28 | 382,880,396 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,988 | java | package com.yurisantana.pedido.services;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import com.yurisantana.pedido.domain.Categoria;
import com.yurisantana.pedido.domain.Cidade;
import com.yurisantana.pedido.domain.Cliente;
import com.yurisantana.pedido.domain.Endereco;
import com.yurisantana.pedido.domain.Estado;
import com.yurisantana.pedido.domain.ItemPedido;
import com.yurisantana.pedido.domain.Pagamento;
import com.yurisantana.pedido.domain.PagamentoComBoleto;
import com.yurisantana.pedido.domain.PagamentoComCartao;
import com.yurisantana.pedido.domain.Pedido;
import com.yurisantana.pedido.domain.Produto;
import com.yurisantana.pedido.domain.enums.EstadoPagamento;
import com.yurisantana.pedido.domain.enums.Perfil;
import com.yurisantana.pedido.domain.enums.TipoCliente;
import com.yurisantana.pedido.repositories.CategoriaRepository;
import com.yurisantana.pedido.repositories.CidadeRepository;
import com.yurisantana.pedido.repositories.ClienteRepository;
import com.yurisantana.pedido.repositories.EnderecoRepository;
import com.yurisantana.pedido.repositories.EstadoRepository;
import com.yurisantana.pedido.repositories.ItemPedidoRepository;
import com.yurisantana.pedido.repositories.PagamentoRepository;
import com.yurisantana.pedido.repositories.PedidoRepository;
import com.yurisantana.pedido.repositories.ProdutoRepository;
@Service
public class DBService {
@Autowired
private BCryptPasswordEncoder pe;
@Autowired
private CategoriaRepository categoriaRepository;
@Autowired
private ProdutoRepository produtoRepository;
@Autowired
private EstadoRepository estadoRepository;
@Autowired
private CidadeRepository cidadeRepository;
@Autowired
private ClienteRepository clienteRepository;
@Autowired
private EnderecoRepository enderecoRepository;
@Autowired
private PedidoRepository pedidoRepository;
@Autowired
private PagamentoRepository pagamentoRepository;
@Autowired
private ItemPedidoRepository itemPedidoRepository;
public void instantiateTestDatabase() throws ParseException {
Categoria cat1 = new Categoria(null, "Informática");
Categoria cat2 = new Categoria(null, "Escritório");
Categoria cat3 = new Categoria(null, "Cama mesa e banho");
Categoria cat4 = new Categoria(null, "Eletrônicos");
Categoria cat5 = new Categoria(null, "Jardinagem");
Categoria cat6 = new Categoria(null, "Decoração");
Categoria cat7 = new Categoria(null, "Perfumaria");
Produto p1 = new Produto(null, "Computador", 2000.00);
Produto p2 = new Produto(null, "Impressora", 800.00);
Produto p3 = new Produto(null, "Mouse", 80.00);
Produto p4 = new Produto(null, "Mesa de escritório", 300.00);
Produto p5 = new Produto(null, "Toalha", 50.00);
Produto p6 = new Produto(null, "Colcha", 200.00);
Produto p7 = new Produto(null, "TV true color", 1200.00);
Produto p8 = new Produto(null, "Roçadeira", 800.00);
Produto p9 = new Produto(null, "Abajour", 100.00);
Produto p10 = new Produto(null, "Pendente", 180.00);
Produto p11 = new Produto(null, "Shampoo", 90.00);
Produto p12 = new Produto(null, "Produto 12", 10.00);
Produto p13 = new Produto(null, "Produto 13", 10.00);
Produto p14 = new Produto(null, "Produto 14", 10.00);
Produto p15 = new Produto(null, "Produto 15", 10.00);
Produto p16 = new Produto(null, "Produto 16", 10.00);
Produto p17 = new Produto(null, "Produto 17", 10.00);
Produto p18 = new Produto(null, "Produto 18", 10.00);
Produto p19 = new Produto(null, "Produto 19", 10.00);
Produto p20 = new Produto(null, "Produto 20", 10.00);
Produto p21 = new Produto(null, "Produto 21", 10.00);
Produto p22 = new Produto(null, "Produto 22", 10.00);
Produto p23 = new Produto(null, "Produto 23", 10.00);
Produto p24 = new Produto(null, "Produto 24", 10.00);
Produto p25 = new Produto(null, "Produto 25", 10.00);
Produto p26 = new Produto(null, "Produto 26", 10.00);
Produto p27 = new Produto(null, "Produto 27", 10.00);
Produto p28 = new Produto(null, "Produto 28", 10.00);
Produto p29 = new Produto(null, "Produto 29", 10.00);
Produto p30 = new Produto(null, "Produto 30", 10.00);
Produto p31 = new Produto(null, "Produto 31", 10.00);
Produto p32 = new Produto(null, "Produto 32", 10.00);
Produto p33 = new Produto(null, "Produto 33", 10.00);
Produto p34 = new Produto(null, "Produto 34", 10.00);
Produto p35 = new Produto(null, "Produto 35", 10.00);
Produto p36 = new Produto(null, "Produto 36", 10.00);
Produto p37 = new Produto(null, "Produto 37", 10.00);
Produto p38 = new Produto(null, "Produto 38", 10.00);
Produto p39 = new Produto(null, "Produto 39", 10.00);
Produto p40 = new Produto(null, "Produto 40", 10.00);
Produto p41 = new Produto(null, "Produto 41", 10.00);
Produto p42 = new Produto(null, "Produto 42", 10.00);
Produto p43 = new Produto(null, "Produto 43", 10.00);
Produto p44 = new Produto(null, "Produto 44", 10.00);
Produto p45 = new Produto(null, "Produto 45", 10.00);
Produto p46 = new Produto(null, "Produto 46", 10.00);
Produto p47 = new Produto(null, "Produto 47", 10.00);
Produto p48 = new Produto(null, "Produto 48", 10.00);
Produto p49 = new Produto(null, "Produto 49", 10.00);
Produto p50 = new Produto(null, "Produto 50", 10.00);
cat1.getProdutos().addAll(Arrays.asList(p12, p13, p14, p15, p16, p17, p18, p19, p20,
p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p34, p35, p36, p37, p38,
p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50));
p12.getCategorias().add(cat1);
p13.getCategorias().add(cat1);
p14.getCategorias().add(cat1);
p15.getCategorias().add(cat1);
p16.getCategorias().add(cat1);
p17.getCategorias().add(cat1);
p18.getCategorias().add(cat1);
p19.getCategorias().add(cat1);
p20.getCategorias().add(cat1);
p21.getCategorias().add(cat1);
p22.getCategorias().add(cat1);
p23.getCategorias().add(cat1);
p24.getCategorias().add(cat1);
p25.getCategorias().add(cat1);
p26.getCategorias().add(cat1);
p27.getCategorias().add(cat1);
p28.getCategorias().add(cat1);
p29.getCategorias().add(cat1);
p30.getCategorias().add(cat1);
p31.getCategorias().add(cat1);
p32.getCategorias().add(cat1);
p33.getCategorias().add(cat1);
p34.getCategorias().add(cat1);
p35.getCategorias().add(cat1);
p36.getCategorias().add(cat1);
p37.getCategorias().add(cat1);
p38.getCategorias().add(cat1);
p39.getCategorias().add(cat1);
p40.getCategorias().add(cat1);
p41.getCategorias().add(cat1);
p42.getCategorias().add(cat1);
p43.getCategorias().add(cat1);
p44.getCategorias().add(cat1);
p45.getCategorias().add(cat1);
p46.getCategorias().add(cat1);
p47.getCategorias().add(cat1);
p48.getCategorias().add(cat1);
p49.getCategorias().add(cat1);
p50.getCategorias().add(cat1);
cat1.getProdutos().addAll(Arrays.asList(p1, p2, p3));
cat2.getProdutos().addAll(Arrays.asList(p2, p4));
cat3.getProdutos().addAll(Arrays.asList(p5, p6));
cat4.getProdutos().addAll(Arrays.asList(p1, p2, p3, p7));
cat5.getProdutos().addAll(Arrays.asList(p8));
cat6.getProdutos().addAll(Arrays.asList(p9, p10));
cat7.getProdutos().addAll(Arrays.asList(p11));
p1.getCategorias().addAll(Arrays.asList(cat1, cat4));
p2.getCategorias().addAll(Arrays.asList(cat1, cat2, cat4));
p3.getCategorias().addAll(Arrays.asList(cat1, cat4));
p4.getCategorias().addAll(Arrays.asList(cat2));
p5.getCategorias().addAll(Arrays.asList(cat3));
p6.getCategorias().addAll(Arrays.asList(cat3));
p7.getCategorias().addAll(Arrays.asList(cat4));
p8.getCategorias().addAll(Arrays.asList(cat5));
p9.getCategorias().addAll(Arrays.asList(cat6));
p10.getCategorias().addAll(Arrays.asList(cat6));
p11.getCategorias().addAll(Arrays.asList(cat7));
categoriaRepository.saveAll(Arrays.asList(cat1, cat2, cat3, cat4, cat5, cat6, cat7));
produtoRepository.saveAll(Arrays.asList(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11));
produtoRepository.saveAll(Arrays.asList(p12, p13, p14, p15, p16, p17, p18, p19, p20,
p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38,
p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50));
Estado est1 = new Estado(null, "Minas Gerais");
Estado est2 = new Estado(null, "São Paulo");
Cidade c1 = new Cidade(null, "Uberlândia", est1);
Cidade c2 = new Cidade(null, "São Paulo", est2);
Cidade c3 = new Cidade(null, "Campinas", est2);
est1.getCidades().addAll(Arrays.asList(c1));
est2.getCidades().addAll(Arrays.asList(c2, c3));
estadoRepository.saveAll(Arrays.asList(est1, est2));
cidadeRepository.saveAll(Arrays.asList(c1, c2, c3));
Cliente cli1 = new Cliente(null, "Maria Silva", "[email protected]", "36378912377", TipoCliente.PESSOAFISICA, pe.encode("123"));
cli1.getTelefones().addAll(Arrays.asList("27363323", "93838393"));
Cliente cli2 = new Cliente(null, "Ana Costa", "[email protected]", "31628382740", TipoCliente.PESSOAFISICA, pe.encode("123"));
cli2.getTelefones().addAll(Arrays.asList("93883321", "34252625"));
cli2.addPerfil(Perfil.ADMIN);
Endereco e1 = new Endereco(null, "Rua Flores", "300", "Apto 303", "Jardim", "38220834", cli1, c1);
Endereco e2 = new Endereco(null, "Avenida Matos", "105", "Sala 800", "Centro", "38777012", cli1, c2);
Endereco e3 = new Endereco(null, "Avenida Floriano", "2106", null, "Centro", "281777012", cli2, c2);
cli1.getEnderecos().addAll(Arrays.asList(e1, e2));
cli2.getEnderecos().addAll(Arrays.asList(e3));
clienteRepository.saveAll(Arrays.asList(cli1, cli2));
enderecoRepository.saveAll(Arrays.asList(e1, e2, e3));
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm");
Pedido ped1 = new Pedido(null, sdf.parse("30/09/2017 10:32"), cli1, e1);
Pedido ped2 = new Pedido(null, sdf.parse("10/10/2017 19:35"), cli1, e2);
Pagamento pagto1 = new PagamentoComCartao(null, EstadoPagamento.QUITADO, ped1, 6);
ped1.setPagamento(pagto1);
Pagamento pagto2 = new PagamentoComBoleto(null, EstadoPagamento.PENDENTE, ped2, sdf.parse("20/10/2017 00:00"), null);
ped2.setPagamento(pagto2);
cli1.getPedidos().addAll(Arrays.asList(ped1, ped2));
pedidoRepository.saveAll(Arrays.asList(ped1, ped2));
pagamentoRepository.saveAll(Arrays.asList(pagto1, pagto2));
ItemPedido ip1 = new ItemPedido(ped1, p1, 0.00, 1, 2000.00);
ItemPedido ip2 = new ItemPedido(ped1, p3, 0.00, 2, 80.00);
ItemPedido ip3 = new ItemPedido(ped2, p2, 100.00, 1, 800.00);
ped1.getItens().addAll(Arrays.asList(ip1, ip2));
ped2.getItens().addAll(Arrays.asList(ip3));
p1.getItens().addAll(Arrays.asList(ip1));
p2.getItens().addAll(Arrays.asList(ip3));
p3.getItens().addAll(Arrays.asList(ip2));
itemPedidoRepository.saveAll(Arrays.asList(ip1, ip2, ip3));
}
}
| [
"[email protected]"
] | |
e3bc576efbe34db3d6b5ccc7b68faf3dc07b3771 | 39b7e86a2b5a61a1f7befb47653f63f72e9e4092 | /src/main/java/com/alipay/api/response/AlipayEcoRenthouseRoomStateSyncResponse.java | e0fc5ac06884cc618935cb6c899f22bd952f9ec9 | [
"Apache-2.0"
] | permissive | slin1972/alipay-sdk-java-all | dbec0604c2d0b76d8a1ebf3fd8b64d4dd5d21708 | 63095792e900bbcc0e974fc242d69231ec73689a | refs/heads/master | 2020-08-12T14:18:07.203276 | 2019-10-13T09:00:11 | 2019-10-13T09:00:11 | 214,782,009 | 0 | 0 | Apache-2.0 | 2019-10-13T07:56:34 | 2019-10-13T07:56:34 | null | UTF-8 | Java | false | false | 382 | java | package com.alipay.api.response;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.eco.renthouse.room.state.sync response.
*
* @author auto create
* @since 1.0, 2019-08-02 19:40:16
*/
public class AlipayEcoRenthouseRoomStateSyncResponse extends AlipayResponse {
private static final long serialVersionUID = 3324248444486183692L;
}
| [
"[email protected]"
] | |
cccfdbef6d0d3d0e3bde54447f5419f5e5c402d6 | ee7709ded5fae75a7c3df4d781b7c5a5823ba602 | /app/build/generated/not_namespaced_r_class_sources/release/r/androidx/recyclerview/R.java | 200ec3ca8c9482f9d00e26cc07b4f748b0405b03 | [] | no_license | MahfoudAyoub/ProjetAndroid | 6cc8f2186580f73e6e56e935c23a1429403c0beb | 6d313a09bc72a9a36303bdba351f6d79e076d68e | refs/heads/master | 2021-04-20T23:55:18.206792 | 2021-02-11T13:55:43 | 2021-02-11T13:55:43 | 249,726,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,789 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package androidx.recyclerview;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f04002d;
public static final int fastScrollEnabled = 0x7f0401ef;
public static final int fastScrollHorizontalThumbDrawable = 0x7f0401f0;
public static final int fastScrollHorizontalTrackDrawable = 0x7f0401f1;
public static final int fastScrollVerticalThumbDrawable = 0x7f0401f2;
public static final int fastScrollVerticalTrackDrawable = 0x7f0401f3;
public static final int font = 0x7f0401f7;
public static final int fontProviderAuthority = 0x7f0401f9;
public static final int fontProviderCerts = 0x7f0401fa;
public static final int fontProviderFetchStrategy = 0x7f0401fb;
public static final int fontProviderFetchTimeout = 0x7f0401fc;
public static final int fontProviderPackage = 0x7f0401fd;
public static final int fontProviderQuery = 0x7f0401fe;
public static final int fontStyle = 0x7f0401ff;
public static final int fontVariationSettings = 0x7f040200;
public static final int fontWeight = 0x7f040201;
public static final int layoutManager = 0x7f04024e;
public static final int recyclerViewStyle = 0x7f040358;
public static final int reverseLayout = 0x7f040359;
public static final int spanCount = 0x7f0403ae;
public static final int stackFromEnd = 0x7f0403c9;
public static final int ttcIndex = 0x7f04046c;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f0600c7;
public static final int notification_icon_bg_color = 0x7f0600c8;
public static final int ripple_material_light = 0x7f0600d5;
public static final int secondary_text_default_material_light = 0x7f0600d7;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f07005d;
public static final int compat_button_inset_vertical_material = 0x7f07005e;
public static final int compat_button_padding_horizontal_material = 0x7f07005f;
public static final int compat_button_padding_vertical_material = 0x7f070060;
public static final int compat_control_corner_material = 0x7f070061;
public static final int compat_notification_large_icon_max_height = 0x7f070062;
public static final int compat_notification_large_icon_max_width = 0x7f070063;
public static final int fastscroll_default_thickness = 0x7f07009a;
public static final int fastscroll_margin = 0x7f07009b;
public static final int fastscroll_minimum_range = 0x7f07009c;
public static final int item_touch_helper_max_drag_scroll_per_frame = 0x7f0700a9;
public static final int item_touch_helper_swipe_escape_max_velocity = 0x7f0700aa;
public static final int item_touch_helper_swipe_escape_velocity = 0x7f0700ab;
public static final int notification_action_icon_size = 0x7f070149;
public static final int notification_action_text_size = 0x7f07014a;
public static final int notification_big_circle_margin = 0x7f07014b;
public static final int notification_content_margin_start = 0x7f07014c;
public static final int notification_large_icon_height = 0x7f07014d;
public static final int notification_large_icon_width = 0x7f07014e;
public static final int notification_main_column_padding_top = 0x7f07014f;
public static final int notification_media_narrow_margin = 0x7f070150;
public static final int notification_right_icon_size = 0x7f070151;
public static final int notification_right_side_padding_top = 0x7f070152;
public static final int notification_small_icon_background_padding = 0x7f070153;
public static final int notification_small_icon_size_as_large = 0x7f070154;
public static final int notification_subtext_size = 0x7f070155;
public static final int notification_top_pad = 0x7f070156;
public static final int notification_top_pad_large_text = 0x7f070157;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f0800fa;
public static final int notification_bg = 0x7f0800fb;
public static final int notification_bg_low = 0x7f0800fc;
public static final int notification_bg_low_normal = 0x7f0800fd;
public static final int notification_bg_low_pressed = 0x7f0800fe;
public static final int notification_bg_normal = 0x7f0800ff;
public static final int notification_bg_normal_pressed = 0x7f080100;
public static final int notification_icon_background = 0x7f080101;
public static final int notification_template_icon_bg = 0x7f080102;
public static final int notification_template_icon_low_bg = 0x7f080103;
public static final int notification_tile_bg = 0x7f080104;
public static final int notify_panel_notification_icon_bg = 0x7f080106;
}
public static final class id {
private id() {}
public static final int accessibility_action_clickable_span = 0x7f0a0012;
public static final int accessibility_custom_action_0 = 0x7f0a0013;
public static final int accessibility_custom_action_1 = 0x7f0a0014;
public static final int accessibility_custom_action_10 = 0x7f0a0015;
public static final int accessibility_custom_action_11 = 0x7f0a0016;
public static final int accessibility_custom_action_12 = 0x7f0a0017;
public static final int accessibility_custom_action_13 = 0x7f0a0018;
public static final int accessibility_custom_action_14 = 0x7f0a0019;
public static final int accessibility_custom_action_15 = 0x7f0a001a;
public static final int accessibility_custom_action_16 = 0x7f0a001b;
public static final int accessibility_custom_action_17 = 0x7f0a001c;
public static final int accessibility_custom_action_18 = 0x7f0a001d;
public static final int accessibility_custom_action_19 = 0x7f0a001e;
public static final int accessibility_custom_action_2 = 0x7f0a001f;
public static final int accessibility_custom_action_20 = 0x7f0a0020;
public static final int accessibility_custom_action_21 = 0x7f0a0021;
public static final int accessibility_custom_action_22 = 0x7f0a0022;
public static final int accessibility_custom_action_23 = 0x7f0a0023;
public static final int accessibility_custom_action_24 = 0x7f0a0024;
public static final int accessibility_custom_action_25 = 0x7f0a0025;
public static final int accessibility_custom_action_26 = 0x7f0a0026;
public static final int accessibility_custom_action_27 = 0x7f0a0027;
public static final int accessibility_custom_action_28 = 0x7f0a0028;
public static final int accessibility_custom_action_29 = 0x7f0a0029;
public static final int accessibility_custom_action_3 = 0x7f0a002a;
public static final int accessibility_custom_action_30 = 0x7f0a002b;
public static final int accessibility_custom_action_31 = 0x7f0a002c;
public static final int accessibility_custom_action_4 = 0x7f0a002d;
public static final int accessibility_custom_action_5 = 0x7f0a002e;
public static final int accessibility_custom_action_6 = 0x7f0a002f;
public static final int accessibility_custom_action_7 = 0x7f0a0030;
public static final int accessibility_custom_action_8 = 0x7f0a0031;
public static final int accessibility_custom_action_9 = 0x7f0a0032;
public static final int action_container = 0x7f0a003b;
public static final int action_divider = 0x7f0a003d;
public static final int action_image = 0x7f0a003e;
public static final int action_text = 0x7f0a0045;
public static final int actions = 0x7f0a0046;
public static final int async = 0x7f0a0061;
public static final int blocking = 0x7f0a006c;
public static final int chronometer = 0x7f0a00a4;
public static final int dialog_button = 0x7f0a00d9;
public static final int forever = 0x7f0a0116;
public static final int icon = 0x7f0a012b;
public static final int icon_group = 0x7f0a012e;
public static final int info = 0x7f0a0141;
public static final int italic = 0x7f0a0143;
public static final int item_touch_helper_previous_elevation = 0x7f0a0144;
public static final int line1 = 0x7f0a0157;
public static final int line3 = 0x7f0a0158;
public static final int normal = 0x7f0a01ae;
public static final int notification_background = 0x7f0a01b3;
public static final int notification_main_column = 0x7f0a01b7;
public static final int notification_main_column_container = 0x7f0a01b8;
public static final int right_icon = 0x7f0a0215;
public static final int right_side = 0x7f0a0216;
public static final int tag_accessibility_actions = 0x7f0a028d;
public static final int tag_accessibility_clickable_spans = 0x7f0a028e;
public static final int tag_accessibility_heading = 0x7f0a028f;
public static final int tag_accessibility_pane_title = 0x7f0a0290;
public static final int tag_screen_reader_focusable = 0x7f0a0291;
public static final int tag_transition_group = 0x7f0a0292;
public static final int tag_unhandled_key_event_manager = 0x7f0a0293;
public static final int tag_unhandled_key_listeners = 0x7f0a0294;
public static final int text = 0x7f0a0298;
public static final int text2 = 0x7f0a0299;
public static final int time = 0x7f0a02e4;
public static final int title = 0x7f0a02e5;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f0b0016;
}
public static final class layout {
private layout() {}
public static final int custom_dialog = 0x7f0d005d;
public static final int notification_action = 0x7f0d008e;
public static final int notification_action_tombstone = 0x7f0d008f;
public static final int notification_template_custom_big = 0x7f0d0098;
public static final int notification_template_icon_group = 0x7f0d0099;
public static final int notification_template_part_chronometer = 0x7f0d009d;
public static final int notification_template_part_time = 0x7f0d009e;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f11009b;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f1201bc;
public static final int TextAppearance_Compat_Notification_Info = 0x7f1201bd;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f1201bf;
public static final int TextAppearance_Compat_Notification_Time = 0x7f1201c2;
public static final int TextAppearance_Compat_Notification_Title = 0x7f1201c4;
public static final int Widget_Compat_NotificationActionContainer = 0x7f1202a2;
public static final int Widget_Compat_NotificationActionText = 0x7f1202a3;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f04002d };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f0401f9, 0x7f0401fa, 0x7f0401fb, 0x7f0401fc, 0x7f0401fd, 0x7f0401fe };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0401f7, 0x7f0401ff, 0x7f040200, 0x7f040201, 0x7f04046c };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
public static final int[] RecyclerView = { 0x10100c4, 0x10100eb, 0x10100f1, 0x7f0401ef, 0x7f0401f0, 0x7f0401f1, 0x7f0401f2, 0x7f0401f3, 0x7f04024e, 0x7f040359, 0x7f0403ae, 0x7f0403c9 };
public static final int RecyclerView_android_orientation = 0;
public static final int RecyclerView_android_clipToPadding = 1;
public static final int RecyclerView_android_descendantFocusability = 2;
public static final int RecyclerView_fastScrollEnabled = 3;
public static final int RecyclerView_fastScrollHorizontalThumbDrawable = 4;
public static final int RecyclerView_fastScrollHorizontalTrackDrawable = 5;
public static final int RecyclerView_fastScrollVerticalThumbDrawable = 6;
public static final int RecyclerView_fastScrollVerticalTrackDrawable = 7;
public static final int RecyclerView_layoutManager = 8;
public static final int RecyclerView_reverseLayout = 9;
public static final int RecyclerView_spanCount = 10;
public static final int RecyclerView_stackFromEnd = 11;
}
}
| [
"[email protected]"
] | |
532e36d68aec018d6ae75bd15aa68847860c3860 | 90eb7a131e5b3dc79e2d1e1baeed171684ef6a22 | /sources/com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrl.java | fc1949cfa17b9afdba613ae36760083d3aa8fdc2 | [] | no_license | shalviraj/greenlens | 1c6608dca75ec204e85fba3171995628d2ee8961 | fe9f9b5a3ef4a18f91e12d3925e09745c51bf081 | refs/heads/main | 2023-04-20T13:50:14.619773 | 2021-04-26T15:45:11 | 2021-04-26T15:45:11 | 361,799,768 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,903 | java | package com.google.api.client.googleapis.auth.oauth2;
import com.google.api.client.auth.oauth2.AuthorizationRequestUrl;
import java.util.Collection;
import p005b.p096l.p164b.p165a.p166a.p168b.C3661d;
import p005b.p096l.p164b.p165a.p169b.C3674c;
import p005b.p096l.p164b.p165a.p173d.C3730k;
import p005b.p096l.p164b.p165a.p173d.C3736n;
public class GoogleBrowserClientRequestUrl extends C3661d {
@C3736n("approval_prompt")
private String approvalPrompt;
/* renamed from: b */
public AuthorizationRequestUrl mo14947b(String str, Object obj) {
return (GoogleBrowserClientRequestUrl) super.set(str, obj);
}
/* renamed from: c */
public AuthorizationRequestUrl mo14948c(String str) {
return (GoogleBrowserClientRequestUrl) super.mo14948c(str);
}
/* renamed from: g */
public AuthorizationRequestUrl mo14950g(Collection collection) {
return (GoogleBrowserClientRequestUrl) super.mo14950g(collection);
}
/* renamed from: j */
public C3661d mo14959j(String str, Object obj) {
return (GoogleBrowserClientRequestUrl) super.set(str, obj);
}
/* renamed from: k */
public C3661d mo14960k(String str) {
return (GoogleBrowserClientRequestUrl) super.mo14948c(str);
}
/* renamed from: l */
public C3661d mo14961l(Collection collection) {
return (GoogleBrowserClientRequestUrl) super.mo14950g(collection);
}
/* renamed from: m */
public GoogleBrowserClientRequestUrl mo14958i() {
return (GoogleBrowserClientRequestUrl) super.clone();
}
public C3674c set(String str, Object obj) {
return (GoogleBrowserClientRequestUrl) super.set(str, obj);
}
/* renamed from: set reason: collision with other method in class */
public C3730k m15000set(String str, Object obj) {
return (GoogleBrowserClientRequestUrl) super.set(str, obj);
}
}
| [
"[email protected]"
] | |
61296ae7470b18d38eb643147a4407d943dbc940 | 92b3c5ab7a2591bec9a5eeb907a1a70299f41375 | /work/useit/opensource/mobilesafe/src/com/itheima/mobilesafe/EnterPwdActivity.java | e72f8f0ba08b20d88e4ce9589dbea2b1bc2274ea | [] | no_license | bigdog001/opensource_code | d394a3c3ca5bfe08cb5e3353aa5b74dcf8da12f9 | 0d03fba4ef9188fdbd702b00bc6229e404c1e7b3 | refs/heads/master | 2021-07-04T01:07:14.656470 | 2016-09-07T14:20:36 | 2016-09-07T14:20:36 | 17,190,145 | 0 | 1 | null | null | null | null | GB18030 | Java | false | false | 3,112 | java | package com.itheima.mobilesafe;
import com.itheima.mobilesafe.service.IService;
import com.itheima.mobilesafe.service.WatchDogService;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.os.IBinder;
import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
public class EnterPwdActivity extends Activity {
private EditText et_password;
private ImageView iv_enter_pwd;
private TextView tv_enter_pwd;
private String packname;
private Intent service;
private IService iService;
private MyConn conn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_enter_pwd);
et_password = (EditText) findViewById(R.id.et_password);
iv_enter_pwd = (ImageView) findViewById(R.id.iv_enter_pwd);
tv_enter_pwd = (TextView) findViewById(R.id.tv_enter_pwd);
Intent intent = getIntent();
packname = intent.getStringExtra("packname");
PackageManager pm = getPackageManager();
try {
PackageInfo info = pm.getPackageInfo(packname, 0);
iv_enter_pwd.setImageDrawable(info.applicationInfo.loadIcon(pm));
tv_enter_pwd.setText(info.applicationInfo.loadLabel(pm));
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
service = new Intent(this,WatchDogService.class);
conn = new MyConn();
bindService(service, conn, BIND_AUTO_CREATE);
}
private class MyConn implements ServiceConnection{
public void onServiceConnected(ComponentName name, IBinder service) {
iService = (IService) service;
}
public void onServiceDisconnected(ComponentName name) {
}
}
public void enter(View view){
String pwd = et_password.getText().toString().trim();
if("123".equals(pwd)){
//密码正确
//发送一个自定义的广播
/*Intent intent = new Intent();
intent.setAction("com.itheima.stopprotect");
intent.putExtra("packname", packname);
sendBroadcast(intent);*/
//绑定服务的方式 直接调用服务里面的方法.
iService.callTempStopProtect(packname);
finish();
}else{
Toast.makeText(this, "密码不正确", 0).show();
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(event.getKeyCode()==KeyEvent.KEYCODE_BACK){
//回桌面.
Intent intent =new Intent();
intent.setAction("android.intent.action.MAIN");
intent.addCategory("android.intent.category.HOME");
intent.addCategory("android.intent.category.DEFAULT");
intent.addCategory("android.intent.category.MONKEY");
startActivity(intent);
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
protected void onDestroy() {
unbindService(conn);
super.onDestroy();
}
}
| [
"[email protected]"
] | |
5b8103b49b47cdebb0839e575efd0e2543ffcf9e | ca33c5ffb802550ff9a424d044c1b9faa0b274d7 | /src/main/java/bo/gob/aduana/sga/gestormensajeria/service/impl/MensajeServiceImpl.java | 4f7836b802a15d356204a5c1e36010f16c346952 | [
"Apache-2.0"
] | permissive | json666/gestorMensajeria | 26b8d368db9555213d0fa1688b9aac2f2c168a39 | 691cfa17f2d754bc38e493e990c805cdb89ce816 | refs/heads/master | 2021-01-01T19:42:38.484422 | 2014-04-03T23:32:19 | 2014-04-03T23:32:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,153 | java | package bo.gob.aduana.sga.gestormensajeria.service.impl;
import java.util.List;
import java.util.UUID;
import bo.gob.aduana.sga.gestormensajeria.utils.JsonResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.stereotype.Service;
import bo.gob.aduana.sga.core.gestormensajeria.model.Mensaje;
import bo.gob.aduana.sga.gestormensajeria.excepciones.NullDeclaracionException;
import bo.gob.aduana.sga.gestormensajeria.repository.MensajeRepository;
import bo.gob.aduana.sga.gestormensajeria.service.MensajeService;
@Service
public class MensajeServiceImpl implements MensajeService{
@Autowired
MensajeRepository mensajeRepository;
public Mensaje getByAsunto(String asunto) {
//1ro: Buscar por asunto de mensaje
Mensaje mensaje = getByAsunto(asunto);
return mensaje;
}
public Mensaje crear(Mensaje mensaje){
mensaje.setId(UUID.randomUUID().toString());
mensajeRepository.save(mensaje);
return mensaje;
}
public Mensaje modificar(Mensaje mensaje) {
Mensaje oldMensjae = mensajeRepository.findOne(mensaje.getId());
if (oldMensjae == null) {
mensaje = null;
System.out.println("Error: Persona inexistente.");
} else {
System.out.println("mensaje.getAsunto() = " + mensaje);
mensajeRepository.save(mensaje);
System.out.println("Success: Persona actualizada.");
}
return mensaje;
}
public void eliminar(Mensaje mensaje) throws NullDeclaracionException {
// TODO Auto-generated method stub
}
public void eliminarMensaje(String asunto) throws NullDeclaracionException {
//Sacar el id del documento existente
Mensaje mensaje = getByAsunto(asunto);
if (mensaje != null) {
mensajeRepository.delete(mensaje);
} else {
throw new NullDeclaracionException("Error: La Declaracion ingresada no existe");
}
}
public List<Mensaje> listAll() {
return (List<Mensaje>) mensajeRepository.findAll();
}
public List<Mensaje> listByAsunto(String asunto, String cuerpo, String pie) {
//Si no existe estado, pasar todas las declaraciones
if (StringUtils.isBlank(asunto)) {
return (List<Mensaje>) mensajeRepository.findAll();
} else {
return mensajeRepository.findByAsunto(asunto, cuerpo, pie);
}
}
@Override
public List<Mensaje> findByUser(String id_usuario) {
return (List<Mensaje>) mensajeRepository.findByUser(id_usuario);
}
@Override
public JsonResult findAll(String id, int pagina) {
String ordenCampo = "id_usuario";
PageRequest page = new PageRequest(pagina, 7, Direction.ASC,
ordenCampo);
List<Mensaje> lista = mensajeRepository.findByDisabledFalse(id,page);
if (lista == null || lista.size() == 0) {
return new JsonResult(false, "No existen registros.");
}
return new JsonResult(true, lista);
}
}
| [
"[email protected]"
] | |
64532a2dca94fe9ca9b87a4198e9e9da8e1bcfc7 | d5fc2fba31dfeb38da1bddbfbf3b5205033ab9e3 | /src/main/java/RunnerClass/FailedScenarios.java | 413a1571399d3bca45548fdaa0c59fc821f683cd | [] | no_license | rakeshmishra36/RestAssuredFramework | 23bde45f5e0f7a45d5c67145e367b9b468a048cf | 40f81979dd16adc6f7d774a9ab630f105eda31d4 | refs/heads/master | 2022-07-07T20:13:00.892588 | 2019-08-26T17:21:23 | 2019-08-26T17:21:23 | 200,147,629 | 0 | 0 | null | 2022-06-29T17:36:10 | 2019-08-02T02:06:00 | Java | UTF-8 | Java | false | false | 453 | java | package RunnerClass;
import cucumber.api.CucumberOptions;
import cucumber.api.testng.AbstractTestNGCucumberTests;
@CucumberOptions(
monochrome = true,
features = "@target/rerun.txt", // Cucumber picks the failed scenarios from this file
glue = { "StepDefinition" },
plugin = {
"pretty", "html:target/site/cucumber-pretty",
"json:target/cucumber.json"
}
)
public class FailedScenarios extends AbstractTestNGCucumberTests{
} | [
"[email protected]"
] | |
dcd9f6b8b590ef5f2c9aa99cd75259d2dc127c07 | 10186b7d128e5e61f6baf491e0947db76b0dadbc | /org/apache/bcel/generic/PushInstruction.java | 347a685662fe546d1397947ef38734bb2aa91dda | [
"SMLNJ",
"Apache-1.1",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | MewX/contendo-viewer-v1.6.3 | 7aa1021e8290378315a480ede6640fd1ef5fdfd7 | 69fba3cea4f9a43e48f43148774cfa61b388e7de | refs/heads/main | 2022-07-30T04:51:40.637912 | 2021-03-28T05:06:26 | 2021-03-28T05:06:26 | 351,630,911 | 2 | 0 | Apache-2.0 | 2021-10-12T22:24:53 | 2021-03-26T01:53:24 | Java | UTF-8 | Java | false | false | 263 | java | package org.apache.bcel.generic;
public interface PushInstruction extends StackProducer {}
/* Location: /mnt/r/ConTenDoViewer.jar!/org/apache/bcel/generic/PushInstruction.class
* Java compiler version: 1 (45.3)
* JD-Core Version: 1.1.3
*/ | [
"[email protected]"
] | |
ef76a64b4c8cd1c95345d842bfca439a327f80ee | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /org/b/c/g.java | c94609486e34c2dd61ba97811fe22199c2c79162 | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,564 | java | package org.b.c;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.b.b.b;
import org.b.d.i;
import org.b.g.c;
import org.b.g.d;
public final class g
implements a, f
{
private static final Pattern BYK;
private static final Pattern BYL;
static
{
AppMethodBeat.i(77238);
BYK = Pattern.compile("oauth_token=([^&]+)");
BYL = Pattern.compile("oauth_token_secret=([^&]*)");
AppMethodBeat.o(77238);
}
private static String f(String paramString, Pattern paramPattern)
{
AppMethodBeat.i(77240);
paramPattern = paramPattern.matcher(paramString);
if ((paramPattern.find()) && (paramPattern.groupCount() > 0))
{
paramString = c.decode(paramPattern.group(1));
AppMethodBeat.o(77240);
return paramString;
}
paramString = new b("Response body is incorrect. Can't extract token and secret from this: '" + paramString + "'", null);
AppMethodBeat.o(77240);
throw paramString;
}
public final i awU(String paramString)
{
AppMethodBeat.i(77239);
d.jn(paramString, "Response body is incorrect. Can't extract a token from an empty string");
paramString = new i(f(paramString, BYK), f(paramString, BYL), paramString);
AppMethodBeat.o(77239);
return paramString;
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes2-dex2jar.jar
* Qualified Name: org.b.c.g
* JD-Core Version: 0.6.2
*/ | [
"[email protected]"
] | |
09963356f1a342eedd5936bcefca5e024155c365 | 2e17ef2bcbcf540b17b80a09ffe432a1e344ea1d | /src/de/wolfi/minopoly/commands/SetupCommand.java | 66c45bc80125865f4aa17830df4c112e20d7b5c9 | [
"MIT"
] | permissive | szarroug3/Minopoly | 162540865054c47439f861b4312f3fe5da8ed6b5 | 71c6896ff14bfea4ecd066831e152b783c76f9ee | refs/heads/master | 2021-05-15T09:06:16.768891 | 2017-10-23T15:13:26 | 2017-10-23T15:13:26 | 107,998,004 | 0 | 0 | null | 2017-10-23T15:01:34 | 2017-10-23T15:01:34 | null | ISO-8859-1 | Java | false | false | 17,103 | java | package de.wolfi.minopoly.commands;
import java.util.HashMap;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import de.wolfi.minopoly.Main;
import de.wolfi.minopoly.MinigameRegistry;
import de.wolfi.minopoly.MinigameRegistry.MinigameStyleSheet;
import de.wolfi.minopoly.components.FieldManager;
import de.wolfi.minopoly.components.Minopoly;
import de.wolfi.minopoly.components.fields.AirportField;
import de.wolfi.minopoly.components.fields.CommunityField;
import de.wolfi.minopoly.components.fields.EventField;
import de.wolfi.minopoly.components.fields.Field;
import de.wolfi.minopoly.components.fields.FieldColor;
import de.wolfi.minopoly.components.fields.FreeParkingField;
import de.wolfi.minopoly.components.fields.FundsField;
import de.wolfi.minopoly.components.fields.JailField;
import de.wolfi.minopoly.components.fields.NormalField;
import de.wolfi.minopoly.components.fields.PayingField;
import de.wolfi.minopoly.components.fields.PoliceField;
import de.wolfi.minopoly.components.fields.StartField;
import de.wolfi.utils.ItemBuilder;
import de.wolfi.utils.inventory.InventoryCounter;
import de.wolfi.utils.inventory.InventorySelector;
import de.wolfi.utils.nms.AnvilGUI;
import de.wolfi.utils.nms.AnvilGUI.AnvilSlot;
@SuppressWarnings("deprecation")
public class SetupCommand implements CommandExecutor, Listener {
/**
* Field Setup Items
*/
private static final ItemStack field_setup = new ItemBuilder(Material.WOOD_PLATE).setName("§eFields")
.addLore("< Speichern").build();
private static final ItemStack field_setup_colorer = new ItemBuilder(Material.INK_SACK).setName("§eColor")
.addLore("# Gib deiner Straße eine schöne Farbe").build();
private static final ItemStack field_setup_price = new ItemBuilder(Material.INK_SACK).setName("§ePrice")
.addLore("# Gib deiner Luxus Villa einen angemessenen Preis").build();
private static final ItemStack field_setup_size = new ItemBuilder(Material.INK_SACK).setName("§eSize")
.addLore("# Gib deiner Straße eine prachtvolle Größe").build();
private static final ItemStack field_setup_renamer = new ItemBuilder(Material.ANVIL).setName("§eName")
.addLore("> Benenne deine Straße").build();
private static final ItemStack fieldtype_airportField = new ItemBuilder(Material.MINECART)
.setName("§7Flughafen Feld").build();
private static final ItemStack fieldtype_communityField = new ItemBuilder(Material.GOLD_PLATE)
.setName("§7Community Feld").build();
private static final ItemStack fieldtype_eventField = new ItemBuilder(Material.IRON_PLATE).setName("§Event Feld")
.build();
private static final ItemStack fieldtype_fundsField = new ItemBuilder(Material.GOLD_INGOT)
.setName("§Fundation Feld").build();
private static final ItemStack fieldtype_freeParkingField = new ItemBuilder(Material.FLOWER_POT_ITEM)
.setName("§Freies Parken Feld").build();
private static final ItemStack fieldtype_payingField = new ItemBuilder(Material.PAPER).setName("§Zahl Feld")
.build();
private static final ItemStack fieldtype_jailField = new ItemBuilder(Material.IRON_BARDING).setName("§7Jelly Feld")
.build();
private static final ItemStack fieldtype_normalField = new ItemBuilder(Material.WOOD_PLATE)
.setName("§7Normales Feld").build();
private static final ItemStack fieldtype_policeField = new ItemBuilder(Material.IRON_SWORD)
.setName("§7Polizei Feld").build();
// --------------------------------------------
private static final ItemStack fieldtype_startField = new ItemBuilder(Material.BANNER).setName("§7Start Feld")
.build();
// --------------------------------------------
private static final InventoryHolder HOLDER = () -> SetupCommand.minopolyChooser;
private static final Main MAIN = Main.getMain();
private static final InventorySelector COLOR_SELECTOR = new InventorySelector("ColorPicker");
private static final InventoryCounter RANGE_SELECTOR = new InventoryCounter("Range Picker");
private static final InventoryCounter PRICE_SELECTOR = new InventoryCounter("Price Picker");
// -------------------------------------------
/**
* Main Setup Menu
*/
private static final ItemStack main_setup = new ItemBuilder(Material.SAPLING).setName("§aMain Setup")
.addLore("< Zurück").build();
private static final ItemStack main_setup_fieldItem = new ItemBuilder(Material.WOOD_PLATE).setName("§eFields")
.addLore("> Füge Felder hinzu").build();
private static final ItemStack main_setup_minigameItem = new ItemBuilder(Material.EMERALD).setName("§eMinigames")
.addLore("> Minigame Verwaltung").build();
// -------------------------------------------
/**
* Main Minigame Menu
*/
private static final ItemStack minigame_main = new ItemBuilder(Material.CHEST).setName("§aMinigame Übersicht")
.addLore("< Zurück").build();
private static final Enchantment selected = new ItemBuilder.MyEnchantment("Stupidity");
/**
* Minigame Setup Menu
*/
private static final ItemStack minigame_setup = new ItemBuilder(Material.EMERALD).setName("§aMinigame Setup")
.addLore("< Zurück").build();
private static final Inventory minopolyChooser;
private static final HashMap<Player, Minopoly> setups = new HashMap<>();
// --------------------------------------------
static {
minopolyChooser = Bukkit.createInventory(SetupCommand.HOLDER, 9 * 5, "§cWähle eine Welt / Setup");
for (final World w : Bukkit.getWorlds()) {
final ItemBuilder i = new ItemBuilder(Material.SPONGE);
i.setName(w.getName());
if (!SetupCommand.MAIN.isMinopolyWorld(w))
i.addLore("Not setup yet!");
SetupCommand.minopolyChooser.addItem(i.build());
}
for (short i = 0; i < 16; i++) {
COLOR_SELECTOR.addEntry(
new ItemBuilder(Material.WOOL).setMeta(i).setName(DyeColor.getByData((byte) i).toString()).build());
}
}
public SetupCommand() {
Bukkit.getPluginManager().registerEvents(this, SetupCommand.MAIN);
}
private Inventory createMinigameMainSetup(Minopoly m) {
final Inventory inv = Bukkit.createInventory(SetupCommand.HOLDER, 9 * 4,
"§c" + m.getWorldName() + " - Minigames");
inv.setItem(0, SetupCommand.minigame_main);
for (MinigameStyleSheet sheet : MinigameRegistry.minigames()) {
ItemBuilder builder = new ItemBuilder(Material.GOLD_INGOT);
builder.setName(sheet.getName());
builder.addLore(sheet.getShortDesc());
builder.addLore("Players: " + sheet.getMinPlayer() + " - " + sheet.getMaxPlayers());
builder.addLore(sheet.getUniqIdef().toString());
if (m.getMinigameManager().hasMinigame(sheet))
builder.enchant(SetupCommand.selected, 10);
inv.addItem(builder.build());
}
return inv;
}
private Inventory createFieldSetup(Minopoly m) {
final Inventory inv = Bukkit.createInventory(SetupCommand.HOLDER, 9, "§c" + m.getWorldName() + " - Field");
inv.setItem(0, SetupCommand.field_setup);
inv.setItem(1, SetupCommand.field_setup_renamer);
inv.setItem(2, SetupCommand.field_setup_colorer);
inv.setItem(3, SetupCommand.field_setup_price);
inv.setItem(4, SetupCommand.field_setup_size);
return inv;
}
private Inventory createGameManagmentInventory(Minopoly m) {
final Inventory inv = Bukkit.createInventory(SetupCommand.HOLDER, InventoryType.HOPPER,
"§c" + m.getWorldName() + " - Setup");
inv.setItem(0, SetupCommand.main_setup);
inv.setItem(1, SetupCommand.main_setup_fieldItem);
inv.setItem(2, SetupCommand.main_setup_minigameItem);
return inv;
}
private void giveFieldSetupItems(HumanEntity whoClicked) {
whoClicked.getInventory().addItem(SetupCommand.fieldtype_normalField, SetupCommand.fieldtype_eventField,
SetupCommand.fieldtype_communityField, SetupCommand.fieldtype_policeField,
SetupCommand.fieldtype_jailField, SetupCommand.fieldtype_startField,
SetupCommand.fieldtype_freeParkingField, SetupCommand.fieldtype_airportField,
SetupCommand.fieldtype_fundsField, SetupCommand.fieldtype_payingField);
}
@EventHandler
public void onClick(InventoryClickEvent e) {
final ItemStack clicked = e.getCurrentItem();
if (clicked == null)
return;
if (e.getClickedInventory().getHolder() != SetupCommand.HOLDER)
return;
e.setCancelled(true);
if (e.getClickedInventory().equals(SetupCommand.minopolyChooser)) {
final World w = Bukkit.getWorld(clicked.getItemMeta().getDisplayName());
if (w == null) {
Bukkit.broadcastMessage("§cError while converting world");
return;
}
final Minopoly m = SetupCommand.MAIN.loadMap(w);
SetupCommand.setups.put((Player) e.getWhoClicked(), m);
e.getWhoClicked().openInventory(this.createGameManagmentInventory(m));
} else {
final Minopoly m = SetupCommand.setups.get(e.getWhoClicked());
final ItemStack checker = e.getClickedInventory().getItem(0);
if (checker.equals(SetupCommand.main_setup)) {
if (clicked.equals(SetupCommand.main_setup)) {
e.getWhoClicked().openInventory(SetupCommand.minopolyChooser);
}
if (clicked.equals(SetupCommand.main_setup_fieldItem))
this.giveFieldSetupItems(e.getWhoClicked());
if (clicked.equals(SetupCommand.main_setup_minigameItem))
e.getWhoClicked().openInventory(this.createMinigameMainSetup(m));
} else if (checker.equals(SetupCommand.field_setup)) {
if (clicked.equals(SetupCommand.field_setup_renamer)) {
AnvilGUI gui = new AnvilGUI((Player) e.getWhoClicked(), (event) -> {
e.setCurrentItem(new ItemBuilder(Material.PAPER).setName(event.getName()).build());
event.setWillClose(false);
e.getWhoClicked().openInventory(e.getInventory());
});
gui.setSlot(AnvilSlot.INPUT_LEFT, field_setup_renamer);
gui.open("RENAME YOUR STREET");
} else if (clicked.equals(SetupCommand.field_setup_colorer)) {
COLOR_SELECTOR.setCallback((i) -> {
e.setCurrentItem(i);
e.getWhoClicked().openInventory(e.getInventory());
return true;
});
COLOR_SELECTOR.open((Player) e.getWhoClicked());
} else if (clicked.equals(SetupCommand.field_setup_size)) {
RANGE_SELECTOR.setCallback((i) -> {
e.setCurrentItem(i);
e.getWhoClicked().openInventory(e.getInventory());
return true;
});
RANGE_SELECTOR.open((Player) e.getWhoClicked());
} else if (clicked.equals(SetupCommand.field_setup_price)) {
PRICE_SELECTOR.setCallback((i) -> {
e.setCurrentItem(i);
e.getWhoClicked().openInventory(e.getInventory());
return true;
});
PRICE_SELECTOR.open((Player) e.getWhoClicked());
} else if (clicked.equals(SetupCommand.field_setup)) {
if (!(e.getClickedInventory().contains(Material.INK_SACK)
&& e.getClickedInventory().contains(Material.ANVIL))) {
Field f = m.getFieldManager().addField(new NormalField(
e.getClickedInventory().getItem(1).getItemMeta().getDisplayName(),
FieldColor.getByColor(DyeColor
.valueOf(e.getClickedInventory().getItem(2).getItemMeta().getDisplayName())),
e.getWhoClicked().getLocation(), m, e.getClickedInventory().getItem(4).getAmount(),
e.getClickedInventory().getItem(3).getAmount()));
e.getWhoClicked().closeInventory();
e.getWhoClicked().sendMessage("5 Sekudnen!!!");
Bukkit.getScheduler().runTaskLater(MAIN, () -> f.setHome(e.getWhoClicked().getLocation()),
20 * 5);
}
}
} else if (checker.equals(SetupCommand.minigame_main)) {
if (clicked.equals(checker)) {
e.getWhoClicked().openInventory(this.createGameManagmentInventory(m));
} else {
MinigameStyleSheet sheet = MinigameRegistry
.loadStyleFromUUID(UUID.fromString(clicked.getItemMeta().getLore().get(2)));
boolean enabled = checker.containsEnchantment(SetupCommand.selected);
if (enabled) {
m.getMinigameManager().removeMinigame(sheet);
clicked.removeEnchantment(SetupCommand.selected);
((Player) e.getWhoClicked()).playSound(e.getWhoClicked().getLocation(), Sound.LEVEL_UP, 1F, 1F);
} else {
m.getMinigameManager().addMinigame(m, sheet);
clicked.addUnsafeEnchantment(SetupCommand.selected, 10);
((Player) e.getWhoClicked()).playSound(e.getWhoClicked().getLocation(), Sound.LEVEL_UP, 1F, 1F);
}
}
} else if (checker.equals(SetupCommand.minigame_setup)) {
} else
e.getWhoClicked().sendMessage("§cError while converting inventory");
}
}
@Override
public boolean onCommand(CommandSender arg0, Command arg1, String arg2, String[] arg3) {
if (arg0 instanceof Player)
((Player) arg0).openInventory(SetupCommand.minopolyChooser);
return true;
}
/**
* This method wil create Field
*
* @category EventHandling
* @param e
* Event Argument
*/
@EventHandler
public void onInteract(PlayerInteractEvent e) {
if (e.getItem() != null && e.getAction() == Action.RIGHT_CLICK_BLOCK) {
final Minopoly mo = SetupCommand.setups.get(e.getPlayer());
if (mo == null)
return;
final FieldManager m = mo.getFieldManager();
if (e.getItem().equals(SetupCommand.fieldtype_normalField)) {
e.getClickedBlock().setType(Material.AIR);
e.getPlayer().teleport(e.getClickedBlock().getLocation());
e.getPlayer().openInventory(this.createFieldSetup(mo));
} else if (e.getItem().equals(SetupCommand.fieldtype_eventField)) {
RANGE_SELECTOR.setCallback((i) -> {
m.addField(new EventField(e.getClickedBlock().getLocation(), mo, i.getAmount()));
return true;
});
RANGE_SELECTOR.open(e.getPlayer());
} else if (e.getItem().equals(SetupCommand.fieldtype_communityField)) {
RANGE_SELECTOR.setCallback((i) -> {
m.addField(new CommunityField(e.getClickedBlock().getLocation(), mo, i.getAmount()));
return true;
});
RANGE_SELECTOR.open(e.getPlayer());
} else if (e.getItem().equals(SetupCommand.fieldtype_startField)) {
RANGE_SELECTOR.setCallback((i) -> {
m.addField(new StartField(e.getClickedBlock().getLocation(), mo, i.getAmount()));
return true;
});
RANGE_SELECTOR.open(e.getPlayer());
} else if (e.getItem().equals(SetupCommand.fieldtype_policeField)) {
RANGE_SELECTOR.setCallback((i) -> {
m.addField(new PoliceField(e.getClickedBlock().getLocation(), mo, i.getAmount()));
return true;
});
RANGE_SELECTOR.open(e.getPlayer());
} else if (e.getItem().equals(SetupCommand.fieldtype_jailField)) {
RANGE_SELECTOR.setCallback((i) -> {
m.addField(new JailField(e.getClickedBlock().getLocation(), mo, i.getAmount()));
return true;
});
RANGE_SELECTOR.open(e.getPlayer());
} else if (e.getItem().equals(SetupCommand.fieldtype_freeParkingField)) {
RANGE_SELECTOR.setCallback((i) -> {
m.addField(new FreeParkingField(e.getClickedBlock().getLocation(), mo, i.getAmount()));
return true;
});
RANGE_SELECTOR.open(e.getPlayer());
} else if (e.getItem().equals(SetupCommand.fieldtype_airportField)) {
AnvilGUI gui = new AnvilGUI(e.getPlayer(), (event) -> {
event.setWillClose(false);
PRICE_SELECTOR.setCallback((ip) -> {
RANGE_SELECTOR.setCallback((ir) -> {
m.addField(new AirportField(event.getName(), e.getClickedBlock().getLocation(), mo,
ir.getAmount(), ip.getAmount()));
return true;
});
RANGE_SELECTOR.open(e.getPlayer());
return true;
});
PRICE_SELECTOR.open(e.getPlayer());
});
gui.setSlot(AnvilSlot.INPUT_LEFT, field_setup_renamer);
gui.open("RENAME YOUR STREET");
} else if (e.getItem().equals(SetupCommand.fieldtype_fundsField)) {
AnvilGUI gui = new AnvilGUI(e.getPlayer(), (event) -> {
event.setWillClose(false);
RANGE_SELECTOR.setCallback((ir) -> {
m.addField(
new FundsField(event.getName(), e.getClickedBlock().getLocation(), mo, ir.getAmount()));
return true;
});
RANGE_SELECTOR.open(e.getPlayer());
});
gui.setSlot(AnvilSlot.INPUT_LEFT, field_setup_renamer);
gui.open("RENAME YOUR STREET");
} else if (e.getItem().equals(SetupCommand.fieldtype_payingField)) {
AnvilGUI gui = new AnvilGUI(e.getPlayer(), (event) -> {
event.setWillClose(false);
RANGE_SELECTOR.setCallback((ir) -> {
m.addField(new PayingField(event.getName(), e.getClickedBlock().getLocation(), mo,
ir.getAmount()));
return true;
});
RANGE_SELECTOR.open(e.getPlayer());
});
gui.setSlot(AnvilSlot.INPUT_LEFT, field_setup_renamer);
gui.open("RENAME YOUR STREET");
}
}
}
}
| [
"[email protected]"
] | |
c5c6e9c1e4bf9b10bacb25d7f79bcb192c65669a | 8a6453cd49949798c11f57462d3f64a1fa2fc441 | /aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/DesiredWeightAndCapacity.java | 763b1ee7678e8ef85e858b24a2541859fefa19b4 | [
"Apache-2.0"
] | permissive | tedyu/aws-sdk-java | 138837a2be45ecb73c14c0d1b5b021e7470520e1 | c97c472fd66d7fc8982cb4cf3c4ae78de590cfe8 | refs/heads/master | 2020-04-14T14:17:28.985045 | 2019-01-02T21:46:53 | 2019-01-02T21:46:53 | 163,892,339 | 0 | 0 | Apache-2.0 | 2019-01-02T21:38:39 | 2019-01-02T21:38:39 | null | UTF-8 | Java | false | false | 7,177 | java | /*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.sagemaker.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
* <p>
* Specifies weight and capacity values for a production variant.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DesiredWeightAndCapacity" target="_top">AWS
* API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DesiredWeightAndCapacity implements Serializable, Cloneable, StructuredPojo {
/**
* <p>
* The name of the variant to update.
* </p>
*/
private String variantName;
/**
* <p>
* The variant's weight.
* </p>
*/
private Float desiredWeight;
/**
* <p>
* The variant's capacity.
* </p>
*/
private Integer desiredInstanceCount;
/**
* <p>
* The name of the variant to update.
* </p>
*
* @param variantName
* The name of the variant to update.
*/
public void setVariantName(String variantName) {
this.variantName = variantName;
}
/**
* <p>
* The name of the variant to update.
* </p>
*
* @return The name of the variant to update.
*/
public String getVariantName() {
return this.variantName;
}
/**
* <p>
* The name of the variant to update.
* </p>
*
* @param variantName
* The name of the variant to update.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DesiredWeightAndCapacity withVariantName(String variantName) {
setVariantName(variantName);
return this;
}
/**
* <p>
* The variant's weight.
* </p>
*
* @param desiredWeight
* The variant's weight.
*/
public void setDesiredWeight(Float desiredWeight) {
this.desiredWeight = desiredWeight;
}
/**
* <p>
* The variant's weight.
* </p>
*
* @return The variant's weight.
*/
public Float getDesiredWeight() {
return this.desiredWeight;
}
/**
* <p>
* The variant's weight.
* </p>
*
* @param desiredWeight
* The variant's weight.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DesiredWeightAndCapacity withDesiredWeight(Float desiredWeight) {
setDesiredWeight(desiredWeight);
return this;
}
/**
* <p>
* The variant's capacity.
* </p>
*
* @param desiredInstanceCount
* The variant's capacity.
*/
public void setDesiredInstanceCount(Integer desiredInstanceCount) {
this.desiredInstanceCount = desiredInstanceCount;
}
/**
* <p>
* The variant's capacity.
* </p>
*
* @return The variant's capacity.
*/
public Integer getDesiredInstanceCount() {
return this.desiredInstanceCount;
}
/**
* <p>
* The variant's capacity.
* </p>
*
* @param desiredInstanceCount
* The variant's capacity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DesiredWeightAndCapacity withDesiredInstanceCount(Integer desiredInstanceCount) {
setDesiredInstanceCount(desiredInstanceCount);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getVariantName() != null)
sb.append("VariantName: ").append(getVariantName()).append(",");
if (getDesiredWeight() != null)
sb.append("DesiredWeight: ").append(getDesiredWeight()).append(",");
if (getDesiredInstanceCount() != null)
sb.append("DesiredInstanceCount: ").append(getDesiredInstanceCount());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DesiredWeightAndCapacity == false)
return false;
DesiredWeightAndCapacity other = (DesiredWeightAndCapacity) obj;
if (other.getVariantName() == null ^ this.getVariantName() == null)
return false;
if (other.getVariantName() != null && other.getVariantName().equals(this.getVariantName()) == false)
return false;
if (other.getDesiredWeight() == null ^ this.getDesiredWeight() == null)
return false;
if (other.getDesiredWeight() != null && other.getDesiredWeight().equals(this.getDesiredWeight()) == false)
return false;
if (other.getDesiredInstanceCount() == null ^ this.getDesiredInstanceCount() == null)
return false;
if (other.getDesiredInstanceCount() != null && other.getDesiredInstanceCount().equals(this.getDesiredInstanceCount()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getVariantName() == null) ? 0 : getVariantName().hashCode());
hashCode = prime * hashCode + ((getDesiredWeight() == null) ? 0 : getDesiredWeight().hashCode());
hashCode = prime * hashCode + ((getDesiredInstanceCount() == null) ? 0 : getDesiredInstanceCount().hashCode());
return hashCode;
}
@Override
public DesiredWeightAndCapacity clone() {
try {
return (DesiredWeightAndCapacity) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.sagemaker.model.transform.DesiredWeightAndCapacityMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}
| [
""
] | |
caf16f3cde7e834802fc630fddecc58569f60f26 | dd2dc275eaa2f8fa9e035a66394ccdf20a8bf1c3 | /floatwindow/src/com/yhao/floatwindow/enums/MoveType.java | 89839da3da5ab1904b1e24342acbf304a5b8bce1 | [
"Apache-2.0"
] | permissive | yangxu1210/FloatWindow-1 | e76233e90b20323b15a39fa1bfc95cefdfcd4320 | 01f13fe5ded8709cc62f070dd23bc5a5da01624a | refs/heads/master | 2020-08-13T19:58:17.277152 | 2019-10-11T10:47:20 | 2019-10-11T10:47:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 477 | java | package com.yhao.floatwindow.enums;
/**
* @Copyright © 2019 Analysys Inc. All rights reserved.
* @Description: 移动类型, 去除V4依赖
* </p>
* SLIDE : 可拖动,释放后自动贴边 (默认)
* </p>
* BACK : 可拖动,释放后自动回到原位置
* </p>
* ACTIVE : 可拖动
* </p>
* INACTIVE : 不可拖动
* @Version: 1.0
* @Create: Feb 19, 2019 11:32:21 AM
* @Author: sanbo
*/
public enum MoveType {
FIXED, INACTIVE, ACTIVE, SLIDE, BACK
} | [
"[email protected]"
] | |
14af5bba684504e62919e7941723c60aad3980e9 | fc8145cdb6293af65768c4316d739060a5bf2873 | /src/main/java/miu/asd/lab9/b/Car.java | da8a4e7fddba973e6b28b2876a81b9bba6e1d753 | [] | no_license | niick7/ASD_Lab9 | aa33751b100e8678ef15acfdf9adf45ef28d7f24 | 7fee4d62a5c75e2917081ddcbf8b68076fcc8558 | refs/heads/master | 2023-01-11T06:14:33.130891 | 2020-11-13T00:11:06 | 2020-11-13T00:11:06 | 311,700,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 629 | java | package miu.asd.lab9.b;
public class Car {
Gear gear0;
Gear gear1;
Gear gear2;
Gear gear3;
Gear gear4;
Gear gear5;
int currentSpeed = 0;
Gear currentGear;
public Car() {
gear0 = new GearZero(this);
gear1 = new GearFirst(this);
gear2 = new GearSecond(this);
gear3 = new GearThird(this);
gear4 = new GearFourth(this);
gear5 = new GearFifth(this);
this.currentGear = gear0;
}
public Gear changeGear(Gear gear) {
currentGear = gear;
return currentGear;
}
public int changeSpeed(int speed){
currentSpeed = currentGear.getSpeed(speed);
return currentSpeed;
}
} | [
"[email protected]"
] | |
c3cde1e23e9b58bfbc0e1097f1934573c50c0c95 | 34b8e226da9f7b8427c43bd1327deb5d129537c1 | /bigwiner/src/main/java/com/bigwiner/android/handler/ComplaintHandler.java | 4d28dc20d05faaa86e9c32e24d9036ffa327b07a | [] | no_license | xpx456/xpxproject | 11485d4a475c10f19dbbfed2b44cfb4644a87d12 | c19c69bc998cbbb3ebc0076c394db9746e906dce | refs/heads/master | 2021-04-23T08:46:43.530627 | 2021-03-04T09:38:24 | 2021-03-04T09:38:24 | 249,913,946 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,627 | java | package com.bigwiner.android.handler;
import android.os.Handler;
import android.os.Message;
import com.bigwiner.R;
import com.bigwiner.android.asks.SailAsks;
import com.bigwiner.android.prase.SailPrase;
import com.bigwiner.android.view.BigwinerApplication;
import com.bigwiner.android.view.activity.ComplaintActivity;
import intersky.apputils.AppUtils;
import intersky.xpxnet.net.NetObject;
import intersky.xpxnet.net.NetUtils;
//08
public class ComplaintHandler extends Handler {
public ComplaintActivity theActivity;
public ComplaintHandler(ComplaintActivity mComplaintActivity) {
theActivity = mComplaintActivity;
}
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case SailAsks.SAIL_RED_RESULT:
theActivity.waitDialog.hide();
SailPrase.parasComplant(theActivity, (NetObject) msg.obj,theActivity.Complaints,theActivity.sail);
theActivity.mComplaintAdapter.notifyDataSetChanged();
break;
case NetUtils.NO_INTERFACE:
theActivity.waitDialog.hide();
AppUtils.showMessage(theActivity,theActivity.getString(R.string.error_net_network));
break;
case NetUtils.TOKEN_ERROR:
if(BigwinerApplication.mApp.mAccount.islogin == true) {
BigwinerApplication.mApp.logout(BigwinerApplication.mApp.mAppHandler,BigwinerApplication.mApp.appActivityManager.getCurrentActivity());
NetUtils.getInstance().cleanTasks();
}
break;
}
}
}
| [
"[email protected]"
] | |
e6edfb12fa9712a9a881af9f1ee7d28a8394506b | 94e1394330580335df5d43fc37a9523e95627523 | /02.Src/batman/batman-upms/batman-upms-dao/src/main/java/com/batman/upms/dao/mapper/UpmsUserMapper.java | b92da87cad4a034f6118d1f2cf915abefa07e50f | [] | no_license | flycatki/organization | e3c805629b61c86c3dc7b65ba2d0c9981402f888 | 22caa9c3b6747911269d6f89e177b5f4296ecfc8 | refs/heads/master | 2021-01-02T08:50:21.495404 | 2017-08-24T09:59:39 | 2017-08-24T09:59:39 | 99,077,262 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 878 | java | package com.batman.upms.dao.mapper;
import com.batman.upms.dao.model.UpmsUser;
import com.batman.upms.dao.model.UpmsUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UpmsUserMapper {
long countByExample(UpmsUserExample example);
int deleteByExample(UpmsUserExample example);
int deleteByPrimaryKey(String uuid);
int insert(UpmsUser record);
int insertSelective(UpmsUser record);
List<UpmsUser> selectByExample(UpmsUserExample example);
UpmsUser selectByPrimaryKey(String uuid);
int updateByExampleSelective(@Param("record") UpmsUser record, @Param("example") UpmsUserExample example);
int updateByExample(@Param("record") UpmsUser record, @Param("example") UpmsUserExample example);
int updateByPrimaryKeySelective(UpmsUser record);
int updateByPrimaryKey(UpmsUser record);
} | [
"[email protected]"
] | |
50b9f3c0972bd5a7462fc5e777a264ddbb94d22d | 8fafa4525982133874fb6899132f6e9f755562a5 | /ProgramacionOO/code/JuegoRobot/src/com/politecnico/JuegoRobot.java | 08cf7f40fe41c67c23ab36e2b21c8a8c86b3af75 | [] | no_license | jesusdiazA/Programacion | f0091ac8c703acdd043778c20cec8dbee261da1c | 2f0def7180f682d901ff2fe3c1bbaee2d8867b31 | refs/heads/master | 2020-08-21T22:56:36.773011 | 2019-10-19T12:44:22 | 2019-10-19T12:44:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,109 | java | package com.politecnico;
import com.politecnico.movimiento.EjecutorDeMovimiento;
import com.politecnico.movimiento.EjecutorDeMovimientoFactory;
import com.politecnico.posicion.Coordenadas;
public class JuegoRobot {
private static InterfazJuego interfazJuego;
private static Tablero tablero;
private static Robot robotGanador;
public static void main(String[] args) {
inicializarJuego();
crearRobotsParaElJuego();
iniciarJuego();
interfazJuego.cartelRobotGanador(robotGanador.getNombre());
}
public static void inicializarJuego(){
robotGanador = null;
interfazJuego = new InterfazJuego();
interfazJuego.cartelInicioJuego();
Coordenadas anchoAltoTablero = interfazJuego.pedirAnchoYAltoTablero();
tablero = new Tablero(anchoAltoTablero);
}
public static void crearRobotsParaElJuego(){
interfazJuego.cartelIntroducirNuevosRobots();
do{
String nombreNuevoRobot = obtenerNombreDeNuevoRobotNoRepetido();
Robot nuevoRobot = new Robot(nombreNuevoRobot, new Coordenadas(0, 0));
tablero.anadirRobot(nuevoRobot);
} while (interfazJuego.usuarioDeseaCrearNuevoRobot());
}
public static void iniciarJuego(){
do {
for (int i = 0; i < tablero.getNumeroActualDeRobots() && !hayRobotGanador(); i++) {
Robot robotActual = tablero.getRobotPorNombre(i);
interfazJuego.mostrarTurnoRobot(robotActual);
moverRobotEnTablero(robotActual);
if (tablero.estaRobotEnObjetivo(robotActual.getNombre()))
robotGanador = robotActual;
}
} while (!hayRobotGanador());
}
private static String obtenerNombreDeNuevoRobotNoRepetido(){
boolean robotNoRepetidoObtenido = false;
String nombreNuevoRobot = "";
while (!robotNoRepetidoObtenido) {
nombreNuevoRobot = interfazJuego.pedirNombreNuevoRobot();
if (!tablero.estaRobotEnTablero(nombreNuevoRobot))
robotNoRepetidoObtenido = true;
else
interfazJuego.cartelRobotRepetido(nombreNuevoRobot);
}
return nombreNuevoRobot;
}
private static void moverRobotEnTablero(Robot robotActual) {
if (robotActual != null) {
EjecutorDeMovimiento ejecutorDeMovimiento = obtenerEjecutorDeMovimientoValido(robotActual.getNombre());
int movimiento = obtenerMovimientoValido(robotActual.getNombre(), ejecutorDeMovimiento);
ejecutorDeMovimiento.mover(robotActual.getCoordenadas(),movimiento);
if (!tablero.estaPuntoEnTablero(robotActual.getCoordenadas()))
ejecutorDeMovimiento.deshacerMovimiento(robotActual.getCoordenadas(),movimiento);
interfazJuego.mostrarPosicionRobot(robotActual);
}
}
private static int obtenerMovimientoValido(String nombreRobot, EjecutorDeMovimiento ejecutorDeMovimiento){
int movimiento = interfazJuego.pedirMovimientoParaRobot(nombreRobot, ejecutorDeMovimiento);
while (!ejecutorDeMovimiento.movimientoEsValido(movimiento)){
interfazJuego.cartelMovimientoNoValido();
movimiento = interfazJuego.pedirMovimientoParaRobot(nombreRobot, ejecutorDeMovimiento);
}
return movimiento;
}
private static EjecutorDeMovimiento obtenerEjecutorDeMovimientoValido(String nombreRobot){
int tipoEjecutorDeMovimiento = interfazJuego.pedirTipoDeEjecutorDeMovimiento(nombreRobot);
while (!EjecutorDeMovimiento.tipoDeEjecutorEsValido(tipoEjecutorDeMovimiento)){
interfazJuego.cartelEjecutorDeMovimientoNoValido();
tipoEjecutorDeMovimiento = interfazJuego.pedirTipoDeEjecutorDeMovimiento(nombreRobot);
}
EjecutorDeMovimientoFactory ejecutorDeMovimientoFactory = new EjecutorDeMovimientoFactory();
return ejecutorDeMovimientoFactory.crear(tipoEjecutorDeMovimiento);
}
public static boolean hayRobotGanador(){
return robotGanador != null;
}
}
| [
"[email protected]"
] | |
473c85da27049bf4550d6d925f2b9099773957d1 | 70861c37cebb559c966277f7561d3b222b72405d | /src/test/java/com/clust4j/utils/HeapTests.java | 36f0afac773e46fd3f3e41d7d8f81ccb21ff810b | [
"Apache-2.0"
] | permissive | Thiraviaselvi/clust4j | 0f53c131d41425995b1b4b64dbbb916a5540d618 | fd1e9c6c6a808244876af210235913353ef09333 | refs/heads/master | 2023-01-03T17:41:27.567317 | 2020-10-29T14:38:25 | 2020-10-29T14:38:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 421 | java | package com.clust4j.utils;
import static org.junit.Assert.*;
import org.junit.Test;
/**
* Most heap tests happen in the HDBSCAN tests, but for
* the sake of consistent structure, here's one or two tests
* @author Taylor G Smith
*/
public class HeapTests {
@Test
public void test() {
SimpleHeap<Integer> s = new SimpleHeap<Integer>();
s.add(1);
assertTrue(s.pop() == 1);
assertTrue(s.size() == 0);
}
}
| [
"[email protected]"
] | |
17074c7e3a105a114239ae03e8f475d30e287d53 | dbbaac36dceb77743321bf3130290dab8bd3828d | /pinyougou-cart-service/src/main/java/com/pinyougou/cart/service/impl/CartServiceImpl.java | d6d9f3007fa1a1e8c535f470fa79b6d219632a81 | [] | no_license | tamir2017/pinyougou | e3d0af9590a6360bd1a262c4a4556cc27807e2a4 | 7e6400a525ba17e7e4770ceaa86cf4f611d54a18 | refs/heads/master | 2020-03-23T10:14:19.913164 | 2018-08-24T01:56:01 | 2018-08-24T01:56:01 | 141,432,554 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,804 | java | package com.pinyougou.cart.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import com.alibaba.dubbo.config.annotation.Service;
import com.pinyougou.cart.service.CartService;
import com.pinyougou.mapper.TbItemMapper;
import com.pinyougou.pojo.TbItem;
import com.pinyougou.pojo.TbOrderItem;
import com.pinyougou.pojogroup.Cart;
@Service
public class CartServiceImpl implements CartService {
@Autowired
private TbItemMapper itemMapper;
@Override
public List<Cart> addGoodsToCartList(List<Cart> cartList, Long itemId, Integer num) {
// 1.根据商品SKU ID查询SKU商品信息
TbItem item = itemMapper.selectByPrimaryKey(itemId);
if (item == null) {
throw new RuntimeException("商品不存在");
}
if (!item.getStatus().equals("1")) {
throw new RuntimeException("商品状态无效");
}
// 2.获取商家ID
String sellerId = item.getSellerId();
// 3.根据商家ID判断购物车列表中是否存在该商家的购物车
Cart cart = searchCartBySellerId(cartList, sellerId);
// 4.如果购物车列表中不存在该商家的购物车
if (cart == null) {
// 4.1 新建购物车对象 ,
cart = new Cart();
cart.setSellerId(sellerId);
cart.setSellerName(item.getSeller());
TbOrderItem orderItem = createOrderItem(item, num);
List orderItemList = new ArrayList();
orderItemList.add(orderItem);
cart.setOrderItemList(orderItemList);
// 4.2将购物车对象添加到购物车列表
cartList.add(cart);
} else {
// 5.如果购物车列表中存在该商家的购物车
// 判断购物车明细列表中是否存在该商品
TbOrderItem orderItem = searchOrderItemByItemId(cart.getOrderItemList(), itemId);
if (orderItem == null) {
// 5.1. 如果没有,新增购物车明细
orderItem = createOrderItem(item, num);
cart.getOrderItemList().add(orderItem);
} else {
// 5.2. 如果有,在原购物车明细上添加数量,更改金额
orderItem.setNum(orderItem.getNum() + num);
orderItem.setTotalFee(new BigDecimal(orderItem.getNum() * orderItem.getPrice().doubleValue()));
// 如果数量操作后小于等于0,则移除
if (orderItem.getNum() <= 0) {
cart.getOrderItemList().remove(orderItem);// 移除购物车明细
}
// 如果移除后cart的明细数量为0,则将cart移除
if (cart.getOrderItemList().size() == 0) {
cartList.remove(cart);
}
}
}
return cartList;
}
/**
* 根据商家ID查询购物车对象
* @param cartList
* @param sellerId
* @return
*/
private Cart searchCartBySellerId(List<Cart> cartList, String sellerId){
for(Cart cart:cartList){
if(cart.getSellerId().equals(sellerId)){
return cart;
}
}
return null;
}
/**
* 根据商品明细ID查询
* @param orderItemList
* @param itemId
* @return
*/
private TbOrderItem searchOrderItemByItemId(List<TbOrderItem> orderItemList ,Long itemId ){
for(TbOrderItem orderItem :orderItemList){
if(orderItem.getItemId().longValue()==itemId.longValue()){
return orderItem;
}
}
return null;
}
/**
* 创建订单明细
* @param item
* @param num
* @return
*/
private TbOrderItem createOrderItem(TbItem item,Integer num){
if(num<=0){
throw new RuntimeException("数量非法");
}
TbOrderItem orderItem=new TbOrderItem();
orderItem.setGoodsId(item.getGoodsId());
orderItem.setItemId(item.getId());
orderItem.setNum(num);
orderItem.setPicPath(item.getImage());
orderItem.setPrice(item.getPrice());
orderItem.setSellerId(item.getSellerId());
orderItem.setTitle(item.getTitle());
orderItem.setTotalFee(new BigDecimal(item.getPrice().doubleValue()*num));
return orderItem;
}
@Autowired
private RedisTemplate redisTemplate;
@Override
public List<Cart> findCartListFromRedis(String username) {
System.out.println("从redis中提取购物车," + username);
List<Cart> cartList = (List<Cart>) redisTemplate.boundHashOps("cartList").get(username);
if(cartList==null){
cartList=new ArrayList();
}
return cartList;
}
@Override
public void saveCartListToRedis(String username, List<Cart> cartList) {
System.out.println("向redis中存入购物车," + username);
redisTemplate.boundHashOps("cartList").put(username, cartList);
}
@Override
public List<Cart> mergeCartList(List<Cart> cartList1, List<Cart> cartList2) {
System.out.println("合并购物车");
for(Cart cart: cartList2){
for(TbOrderItem orderItem:cart.getOrderItemList()){
cartList1= addGoodsToCartList(cartList1,orderItem.getItemId(),orderItem.getNum());
}
}
return cartList1;
}
}
| [
"[email protected]"
] | |
f4749eb1cbbce1922a61b3e0aa57fb59cccf8bbf | 60d18b02caa8fc833d7544cb2cd3f255d237bea8 | /chap02/src/sec01/exam01_variable/LlteralExample.java | 3e710eee0a02324dacc706e3513c8d0b67a86032 | [] | no_license | cyb1105/java-programming | c9566c5c25ebf09efb78d69d0d7f6c288d79eddc | 62fbce2eb93ba7148e8504958e611cca2cf8f266 | refs/heads/master | 2020-04-14T14:43:22.825638 | 2019-02-08T03:26:27 | 2019-02-08T03:26:27 | 163,905,299 | 0 | 1 | null | null | null | null | UHC | Java | false | false | 900 | java | package sec01.exam01_variable;
public class LlteralExample {
public static void main(String[] args) {
int var1 =10;
System.out.println(var1);
int var2 =010;
System.out.println(var2);
int var3 =0x10;
System.out.println(var3);
double var4 = 0.25;
System.out.println(var4);
double var5 = 2E5;
System.out.println(var5);
char var6 = 'A';
System.out.println(var6);
char var7 = '한';
System.out.println(var7);
System.out.println("\t"+"들여쓰기" );
System.out.println("대한"+ "\n"+"민국" );
System.out.println("this"+ "\'"+"s Java" );
System.out.println("이것은"+ "\""+"중요"+"\""+"합니다" );
System.out.println("가격이"+ "\\"+"300입니다" );
char var8 ='\u0041';
System.out.println(var8);
String var9 = "자바";
System.out.println(var9);
boolean var10 = true;
boolean var11 = false;
}
}
| [
"[email protected]"
] | |
57d426f057e589e4ab8fef7f17a0375e6865f6ee | e508742d7ec8568836a672a02477448f8f0cc5fe | /Chapter5/src/main/java/com/course/testng/BasicAnnotation.java | 71c3b126d077f691f5c9fe227eec1f14617f92a5 | [] | no_license | zzq13082836960/AutomatedTesting | 6f609f52305bc5f029b121821b31b5bdc1101d82 | 4fb2b755c91ecfde3682d9398635fb2fe78890c0 | refs/heads/master | 2022-07-22T19:26:27.876244 | 2019-06-03T12:13:46 | 2019-06-03T12:13:46 | 181,303,513 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,153 | java | package com.course.testng;
import org.testng.annotations.*;
public class BasicAnnotation {
//最基本的注解,用来把方法标记为测试的一部分
@Test
public void TestCase1(){
System.out.println("Test这是测试用例1");
}
@Test
public void TestCase2(){
System.out.println("Test这是测试用例2");
}
@BeforeMethod
public void BeforeMethod(){
System.out.println("BeforeMethod这是在测试方法之前运行的");
}
@AfterMethod
public void AfterMethod(){
System.out.println("AfterMethod这是在测试方法之后运行的");
}
@BeforeClass
public void BeforeClass(){
System.out.println("BeforeClass这是在测试类之前运行的");
}
@AfterClass
public void AfterClass(){
System.out.println("AfterClass这是在测试类之后运行的");
}
//测试套件包含多个类
@BeforeSuite
public void BeforeSuite(){
System.out.println("BeforeSuite这是测试套件");
}
@AfterSuite
public void AfterSuite(){
System.out.println("AfterSuite这是测试套件");
}
}
| [
"[email protected]"
] | |
af09aee252c8dd66e5295c8eef2f31d09ff7d1b2 | 65b154789cc84523b5bb44562e83d047177e6709 | /src/main/java/com/example/demokafka/DemoKafkaApplication.java | 6bf351a0f92eef7363403ed425ace1b4f8719b4b | [] | no_license | robertsicoie/demo-kafka | 66cf950186c143de88293de4a82a6056c12de794 | 6bdf34ca9f99ebe893d698d8094d4095037c9eb8 | refs/heads/master | 2023-04-30T13:44:28.953208 | 2020-02-17T20:48:48 | 2020-02-17T20:48:48 | 241,203,476 | 0 | 0 | null | 2023-04-14T17:43:18 | 2020-02-17T20:40:37 | Java | UTF-8 | Java | false | false | 1,102 | java | package com.example.demokafka;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import java.util.Date;
@SpringBootApplication
public class DemoKafkaApplication {
public static void main(String[] args) {
ConfigurableApplicationContext context = SpringApplication.run(DemoKafkaApplication.class, args);
if (args.length > 0) {
if ("-c".equals(args[0])) {
MessageConsumer consumer = context.getBean(MessageConsumer.class);
} else if ("-p".equals(args[0])) {
MessageProducer producer = context.getBean(MessageProducer.class);
for (int i = 1; i < args.length; i++) {
producer.send(new Message(new Date(), args[i]));
}
context.close();
} else {
System.out.println("\n\nTo start consumer:\n" +
" java -Dserver.port=8081 -jar demo-kafka-0.0.1-SNAPSHOT.jar -c\n" +
"\n\nTo start producer:\n" +
" java -jar demo-kafka-0.0.1-SNAPSHOT.jar -p <MSG1> <MSG2> <MSG3> <...>\n");
context.close();
}
}
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.