blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d573023557e25d1bf7815e53219f40d0fefc42b6 | 7b4b99c2db37c9dc40d3b100eec588d0b5c5531c | /src/main/java/com/wherex/appventas/service/ClientService.java | 0bbab57167e0c669c84f8120a9a3f4b4ae5acefa | [] | no_license | fharavena/Spring-Java-Fullstack-W | 7f48804256c9c048648d28419bb76eb2bb14769f | cf1106bc942def151f66f816fdd25e987acfb4a1 | refs/heads/main | 2023-06-30T11:59:12.799137 | 2021-08-02T15:32:32 | 2021-08-02T15:32:32 | 389,985,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 707 | java | package com.wherex.appventas.service;
import com.wherex.appventas.repository.ClientRepository;
import com.wherex.appventas.entity.Client;
import com.wherex.appventas.service.IService.IClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ClientService implements IClientService {
@Autowired
private ClientRepository clientRepository;
@Override
@Transactional(readOnly = true)
public List<Client> findByEstado(Integer state) {
return (List<Client>) clientRepository.findByEstado(state);
}
}
| [
"fharavena@gmail.com"
] | fharavena@gmail.com |
a9b9d0246bcb1b956f3cd304e42322d2c07ef7bf | 575c74231f19358c2c7d5f8e41fc5a3251ad3f57 | /gmall-api/src/main/java/com/atguigu/gmall/cms/entity/SubjectCategory.java | 0a5d1cb3d27d16e08875e68cad786c3ee2dbb7e3 | [] | no_license | Ryujung/gmall | bcf9b87e0bc4bea0b5166ef9f66374d63077ccfe | ef8b133e3e709239ddfc87e3814d4e4098dc73f1 | refs/heads/master | 2022-07-04T01:14:40.200020 | 2020-09-23T00:52:24 | 2020-09-23T00:52:24 | 241,570,828 | 0 | 0 | null | 2022-06-21T02:49:46 | 2020-02-19T08:32:52 | Java | UTF-8 | Java | false | false | 1,278 | java | package com.atguigu.gmall.cms.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 专题分类表
* </p>
*
* @author RyuJung
* @since 2020-02-19
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("cms_subject_category")
@ApiModel(value="SubjectCategory对象", description="专题分类表")
public class SubjectCategory implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@TableField("name")
private String name;
@ApiModelProperty(value = "分类图标")
@TableField("icon")
private String icon;
@ApiModelProperty(value = "专题数量")
@TableField("subject_count")
private Integer subjectCount;
@TableField("show_status")
private Integer showStatus;
@TableField("sort")
private Integer sort;
}
| [
"ryujung@163.com"
] | ryujung@163.com |
9c5b3f703c8b5ded77640e46de85eaceb4136342 | 88f01463c9d1305136c4213fbddaa8e6b362a627 | /src/test/java/com/mailler/controller/sender/EmailJacksonSerializationTest.java | 96fbd3803d7e06c3f445d2297655efcfd3f0afc8 | [] | no_license | waffle-iron/mailler | 572a6a9548daae1eb8a9aef9cba5ec83151d5d6b | 90162c619a33dcb5120fceb246b5d656b865005a | refs/heads/master | 2020-12-07T15:17:53.112154 | 2016-07-23T05:21:10 | 2016-07-23T05:21:10 | 64,000,390 | 0 | 0 | null | 2016-07-23T05:21:09 | 2016-07-23T05:21:09 | null | UTF-8 | Java | false | false | 2,095 | java | package com.mailler.controller.sender;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasValue;
import static org.hamcrest.Matchers.is;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.mailler.controller.sender.Content;
import com.mailler.controller.sender.Email;
public class EmailJacksonSerializationTest {
@Test
public void shouldCheckIfEmailObjectIsTheSameAsTheEmailJsonObject() throws Exception {
Map<String, String> properties = new HashMap<>();
properties.put("name", "Alexandre Gama");
properties.put("message", "Welcome to Mailler Gama");
Content bodyContent = new Content();
bodyContent.setProperties(properties);
Email email = new Email();
email.setEmailFrom("alexandre.gama@elo7.com");
email.setEmailTo("alexandre.gama.lima@gmail.com");
email.setTemplate("http://s3.amazon.com/mailler/template/email.html");
email.setContent(bodyContent);
email.setSubject("Welcome");
ObjectWriter prettyWriter = new ObjectMapper().writerWithDefaultPrettyPrinter();
prettyWriter.writeValue(new File("email-pretty.json"), email);
ObjectWriter writer = new ObjectMapper().writer();
writer.writeValue(new File("email-ugly.json"), email);
ObjectMapper mapper = new ObjectMapper();
Email emailFromJson = mapper.readValue(new File("email-pretty.json"), Email.class);
assertThat(emailFromJson.getEmailFrom(), is(equalTo("alexandre.gama@elo7.com")));
assertThat(emailFromJson.getEmailTo(), is(equalTo("alexandre.gama.lima@gmail.com")));
assertThat(emailFromJson.getSubject(), is(equalTo("Welcome")));
assertThat(emailFromJson.getTemplate(), is(equalTo("http://s3.amazon.com/mailler/template/email.html")));
assertThat(emailFromJson.getContent().getProperties(), hasValue("Alexandre Gama"));
assertThat(emailFromJson.getContent().getProperties(), hasValue("Welcome to Mailler Gama"));
}
}
| [
"alexandre.gama.lima@gmail.com"
] | alexandre.gama.lima@gmail.com |
83e908880d5ded6bec5c6ed4a7fe918ad7e0841e | db5c22bc2b64429ac5a14d8a96b52238e4cf3f9f | /src/com/jtc08/gym_a_gym/persons/operaters/ClientImp.java | 4cd535cde6fb1a97847f6fa86a57bee577505219 | [] | no_license | jiangtiancheng/jtcStudy | 38b036e5a7b593b34e5b4ef1d7754e4416eff7f3 | 2b294f3a2695b36f3092e57f73f69898bec360d3 | refs/heads/master | 2020-04-30T14:29:21.428478 | 2019-03-21T12:32:34 | 2019-03-21T12:32:34 | 176,892,122 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,574 | java | package com.jtc08.gym_a_gym.persons.operaters;
import com.jtc08.gym_a_gym.persons.beans.Client;
//import com.jtc08.gym_a_gym.persons.beans.Coach;
public class ClientImp implements ClientInf {
//客户增加
public String addNewClient(Client[] clients, Client c) {
String eg = "";
int newl = clients.length + 1;
Client[] newClients = new Client[newl];
for (int i = 0; i < clients.length; i++) {
Client temp = clients[i];
String phone = temp.getpPhone();
if (phone.equals(c.getpPhone())) {
eg = "该用户已注册!!!";
// System.out.println("该用户已注册!!!");
return eg;
}
newClients[i] = temp;
}
newClients[clients.length] = c;
eg = "新增客户信息:" + c.toString();
return eg;
}
//根据电话号查询用户信息
public String checkClientByPhone(Client[] clients,String phoneNum){
String eg = "";
for (int i = 0; i < clients.length; i++){
Client temp = clients[i];
String phone = temp.getpPhone();
if (phone.equals(phoneNum)) {
eg = "用户信息为:"+temp.toString();
}else{
eg = "该用户不存在!!!!!";
}
}
return eg;
}
//根据电话号码更改姓名
public String changeClientByPhone(String phone_num,String client_id,Client[] clients,Client c){
String eg = "";
for (int i = 0; i < clients.length; i++){
Client temp = clients[i];
String phone = temp.getpPhone();
String id = temp.getId();
if (phone.equals(phone_num)&&(id.equals(client_id))) {
clients[i]=c;
eg = "新的姓名为:"+clients[i].getpName();
break;
}else{
eg = "该用户手机号码不正确!!!!!";
}
}
return eg;
}
//选择教练后交费
// public String deductClientFeeByChooseCoach(Client[] clients,String phoneNum,Coach coach){
// String eg = "";
// for (int i = 0; i < clients.length; i++){
// Client temp = clients[i];
// String phone = temp.getpPhone();
// if (phone.equals(phoneNum)) {
// temp.setFees(temp.getFees()-coach.getPrice());
// eg = "余额为:"+temp.getFees();
// }else{
// eg = "该用户不存在!!!!!";
// }
// }
// return eg;
// }
//删除会员
public String deleteClientByPhone(Client[] clients,String phoneNum){
String eg = "";
for (int i = 0; i < clients.length; i++){
Client temp = clients[i];
String phone = temp.getpPhone();
if (phone.equals(phoneNum)) {
temp.setpName(temp.getpName()+"*");
eg = "被删用户信息为:"+temp.toString();
}else{
eg = "该用户不存在!!!!!";
}
}
return eg;
}
}
| [
"2950632424@qq.com"
] | 2950632424@qq.com |
ac93f9982ae9749f94bf44bf54fb580a9a0123c5 | 5d1a0b5a9fe8dfa729bce7d5ff59c084ee5a10ea | /src/main/java/uebung11/RegularPrice.java | 023d04e336c3c3119ddf5964edbd76d82dd3520c | [] | no_license | ksnvc/oop-uebung11 | 95994816c058f661cadbbb96c26e1f3c440434ea | ca263b040925f3df83549a2f6f40ede4545c2267 | refs/heads/master | 2020-06-10T15:18:22.748798 | 2019-06-27T20:12:53 | 2019-06-27T20:12:53 | 193,661,608 | 0 | 0 | null | 2019-06-25T07:55:50 | 2019-06-25T07:55:50 | null | UTF-8 | Java | false | false | 405 | java | package uebung11;
public class RegularPrice extends Price {
@Override
public int getPriceCode() {
return Movie.REGULAR;
}
public double getCharge(int daysRented) {
double result = 2;
if (daysRented > 2)
result += (daysRented - 2) * 1.5;
return result;
}
public double getFrequentRenterPoints(int daysRented){
return 1;
}
}
| [
"sarakosanovic@Saras-MacBook-Pro.local"
] | sarakosanovic@Saras-MacBook-Pro.local |
c0d12ae97234412e5e53305a4178e1ae2e680937 | 37271a875a728ee888ccb1e220e5771474dfd979 | /storio-content-resolver/src/test/java/com/pushtorefresh/storio/contentresolver/design/OperationDesignTest.java | 6d27fe41601bdf595be66217d1e72b72aa169491 | [
"Apache-2.0"
] | permissive | taimur97/storio | e9e74287fd742175663e9794f6e0031985f0319d | 3dd8c0830ee91bc5c337e25e0d3c88b38697722b | refs/heads/master | 2020-02-26T13:18:03.197639 | 2015-07-01T12:28:27 | 2015-07-01T12:28:27 | 38,390,784 | 1 | 0 | null | 2015-07-01T19:31:18 | 2015-07-01T19:31:18 | null | UTF-8 | Java | false | false | 450 | java | package com.pushtorefresh.storio.contentresolver.design;
import android.support.annotation.NonNull;
import com.pushtorefresh.storio.contentresolver.StorIOContentResolver;
abstract class OperationDesignTest {
@NonNull
private final StorIOContentResolver storIOContentResolver = new DesignTestStorIOContentResolver();
@NonNull
protected StorIOContentResolver storIOContentResolver() {
return storIOContentResolver;
}
}
| [
"artem.zinnatullin@gmail.com"
] | artem.zinnatullin@gmail.com |
77f7a836c82d3ac280f8a11b2c84b88dd4f2d976 | 3cd63aba77b753d85414b29279a77c0bc251cea9 | /main/plugins/org.talend.designer.components.libs/libs_src/crm4client/com/microsoft/schemas/crm/_2007/webservices/TargetCreateIncidentResolution.java | a92acdd900cd0c54487d5a0d1528e505ea5f386f | [
"Apache-2.0"
] | permissive | 195858/tdi-studio-se | 249bcebb9700c6bbc8905ccef73032942827390d | 4fdb5cfb3aeee621eacfaef17882d92d65db42c3 | refs/heads/master | 2021-04-06T08:56:14.666143 | 2018-10-01T14:11:28 | 2018-10-01T14:11:28 | 124,540,962 | 1 | 0 | null | 2018-10-01T14:11:29 | 2018-03-09T12:59:25 | Java | UTF-8 | Java | false | false | 9,934 | java | /*
* XML Type: TargetCreateIncidentResolution
* Namespace: http://schemas.microsoft.com/crm/2007/WebServices
* Java type: com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution
*
* Automatically generated - do not modify.
*/
package com.microsoft.schemas.crm._2007.webservices;
/**
* An XML TargetCreateIncidentResolution(@http://schemas.microsoft.com/crm/2007/WebServices).
*
* This is a complex type.
*/
public interface TargetCreateIncidentResolution extends com.microsoft.schemas.crm._2007.webservices.TargetCreate
{
public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)
org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(TargetCreateIncidentResolution.class.getClassLoader(), "schemaorg_apache_xmlbeans.system.sE3DFDC56E75679F2AF264CA469AD5996").resolveHandle("targetcreateincidentresolutione9c9type");
/**
* Gets the "IncidentResolution" element
*/
com.microsoft.schemas.crm._2007.webservices.Incidentresolution getIncidentResolution();
/**
* Sets the "IncidentResolution" element
*/
void setIncidentResolution(com.microsoft.schemas.crm._2007.webservices.Incidentresolution incidentResolution);
/**
* Appends and returns a new empty "IncidentResolution" element
*/
com.microsoft.schemas.crm._2007.webservices.Incidentresolution addNewIncidentResolution();
/**
* A factory class with static methods for creating instances
* of this type.
*/
public static final class Factory
{
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution newInstance() {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution newInstance(org.apache.xmlbeans.XmlOptions options) {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
/** @param xmlAsString the string value to parse */
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); }
/** @param file the file from which to load an xml document */
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); }
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return (com.microsoft.schemas.crm._2007.webservices.TargetCreateIncidentResolution) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
private Factory() { } // No instance of this class allowed
}
}
| [
"bchen@f6f1c999-d317-4740-80b0-e6d1abc6f99e"
] | bchen@f6f1c999-d317-4740-80b0-e6d1abc6f99e |
6aaf11db68a22046827797e541d47b5c716c16bb | 99a9e4d46fa4964f16299b1d2bcb7a4cdb2bcd4d | /app/src/main/java/com/xiangmu/tuisong/SettingActivity.java | 268af0c876111447bbaede465d273a0396a16f7f | [] | no_license | lichengyu20/guanjia | 55bc4199a6b624a8756d419fcf08a61d95a21065 | bcac7d5959d7b46077ab3e548193bd14c9d778d8 | refs/heads/master | 2020-03-27T23:38:16.301486 | 2018-09-05T01:05:08 | 2018-09-05T01:05:55 | 147,334,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,044 | java | package com.xiangmu.tuisong;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TimePicker;
import android.widget.Toast;
import com.xiangmu.R;
import java.util.HashSet;
import java.util.Set;
import cn.jpush.android.api.InstrumentedActivity;
import cn.jpush.android.api.JPushInterface;
public class SettingActivity extends InstrumentedActivity implements OnClickListener {
TimePicker startTime;
TimePicker endTime;
CheckBox mMonday ;
CheckBox mTuesday ;
CheckBox mWednesday;
CheckBox mThursday;
CheckBox mFriday ;
CheckBox mSaturday;
CheckBox mSunday ;
Button mSetTime;
SharedPreferences mSettings;
Editor mEditor;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.set_push_time);
init();
initListener();
}
@Override
public void onStart() {
super.onStart();
initData();
}
private void init(){
startTime = (TimePicker) findViewById(R.id.start_time);
endTime = (TimePicker) findViewById(R.id.end_time);
startTime.setIs24HourView(DateFormat.is24HourFormat(this));
endTime.setIs24HourView(DateFormat.is24HourFormat(this));
mSetTime = (Button)findViewById(R.id.bu_setTime);
mMonday = (CheckBox)findViewById(R.id.cb_monday);
mTuesday = (CheckBox)findViewById(R.id.cb_tuesday);
mWednesday = (CheckBox)findViewById(R.id.cb_wednesday);
mThursday = (CheckBox)findViewById(R.id.cb_thursday);
mFriday = (CheckBox)findViewById(R.id.cb_friday);
mSaturday = (CheckBox)findViewById(R.id.cb_saturday);
mSunday = (CheckBox)findViewById(R.id.cb_sunday);
}
private void initListener(){
mSetTime.setOnClickListener(this);
}
private void initData(){
mSettings = getSharedPreferences(ExampleUtil.PREFS_NAME, MODE_PRIVATE);
String days = mSettings.getString(ExampleUtil.PREFS_DAYS, "");
if (!TextUtils.isEmpty(days)) {
initAllWeek(false);
String[] sArray = days.split(",");
for (String day : sArray) {
setWeek(day);
}
} else {
initAllWeek(true);
}
int startTimeStr = mSettings.getInt(ExampleUtil.PREFS_START_TIME, 0);
startTime.setCurrentHour(startTimeStr);
int endTimeStr = mSettings.getInt(ExampleUtil.PREFS_END_TIME, 23);
endTime.setCurrentHour(endTimeStr);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.bu_setTime:
v.requestFocus();
v.requestFocusFromTouch();
setPushTime();
break;
}
}
/**
*设置允许接收通知时间
*/
private void setPushTime(){
int startime = startTime.getCurrentHour();
int endtime = endTime.getCurrentHour();
if (startime > endtime) {
Toast.makeText(SettingActivity.this, "开始时间不能大于结束时间", Toast.LENGTH_SHORT).show();
return;
}
StringBuffer daysSB = new StringBuffer();
Set<Integer> days = new HashSet<Integer>();
if (mSunday.isChecked()) {
days.add(0);
daysSB.append("0,");
}
if (mMonday.isChecked()) {
days.add(1);
daysSB.append("1,");
}
if (mTuesday.isChecked()) {
days.add(2);
daysSB.append("2,");
}
if (mWednesday.isChecked()) {
days.add(3);
daysSB.append("3,");
}
if (mThursday.isChecked()) {
days.add(4);
daysSB.append("4,");
}
if (mFriday.isChecked()) {
days.add(5);
daysSB.append("5,");
}
if (mSaturday.isChecked()) {
days.add(6);
daysSB.append("6,");
}
//调用JPush api设置Push时间
JPushInterface.setPushTime(getApplicationContext(), days, startime, endtime);
mEditor = mSettings.edit();
mEditor.putString(ExampleUtil.PREFS_DAYS, daysSB.toString());
mEditor.putInt(ExampleUtil.PREFS_START_TIME, startime);
mEditor.putInt(ExampleUtil.PREFS_END_TIME, endtime);
mEditor.commit();
Toast.makeText(SettingActivity.this, R.string.setting_su, Toast.LENGTH_SHORT).show();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK){
finish();
}
return super.onKeyDown(keyCode, event);
}
private void setWeek(String day){
int dayId = Integer.valueOf(day);
switch (dayId) {
case 0:
mSunday.setChecked(true);
break;
case 1:
mMonday.setChecked(true);
break;
case 2:
mTuesday.setChecked(true);
break;
case 3:
mWednesday.setChecked(true);
break;
case 4:
mThursday.setChecked(true);
break;
case 5:
mFriday.setChecked(true);
break;
case 6:
mSaturday.setChecked(true);
break;
}
}
private void initAllWeek(boolean isChecked) {
mSunday.setChecked(isChecked);
mMonday.setChecked(isChecked);
mTuesday.setChecked(isChecked);
mWednesday.setChecked(isChecked);
mThursday.setChecked(isChecked);
mFriday.setChecked(isChecked);
mSaturday.setChecked(isChecked);
}
} | [
"260@qq.com"
] | 260@qq.com |
ad16de95dc05412264a15feb2529cbe64b2bb3f8 | 1d44d44257be6c6d89e04ae773d17dc8f070e3aa | /src/test/java/CalculatorTest.java | 803e4edab6f240efe9015fcd7d691fd1484517b2 | [] | no_license | aleka2311/CalculatorTest | 2c8d42a971feff241133dd797e0ac5a7c7d75bb7 | 49d87f3c6d02ca6e00c90b0cd2c47a3977c98664 | refs/heads/master | 2021-05-07T04:22:10.519561 | 2017-11-19T11:48:16 | 2017-11-19T11:48:16 | 111,290,066 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,099 | java | import com.epam.tat.module4.Calculator;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import static java.lang.Double.NaN;
public class CalculatorTest {
Calculator calculator = new Calculator();
@Test(dataProvider = "sumLongTestData")
public void sumLongTest(long firstNumber, long secondNumber, long expectedResult) {
Assert.assertEquals(calculator.sum(firstNumber, secondNumber), expectedResult);
}
@DataProvider
public Object[][] sumLongTestData() {
return new Object[][]{
{5, 6, 11},
{50, 40, 90},
{10, 58, 68},
{10025, -498415, -488390}
};
}
@Test(dataProvider = "sumDoubleTestData")
public void sumDoubleTest(double firstNumber, double secondNumber, double expectedResult) {
Assert.assertEquals(calculator.sum(firstNumber, secondNumber), expectedResult);
}
@DataProvider
public Object[][] sumDoubleTestData() {
return new Object[][]{
{3.2, 4.8, 8.0},
{50.001, 0.002, 50.003},
{-10.697, 21.47, 10.773},
{10.58, 21.47, 32.05}
};
}
@Test(dataProvider = "subLongTestData")
public void subLongTest(long firstNumber, long secondNumber, long expectedResult) {
Assert.assertEquals(calculator.sub(firstNumber, secondNumber), expectedResult);
}
@DataProvider
public Object[][] subLongTestData() {
return new Object[][]{
{11, 6, 5},
{90, 40, 50},
{68, 58, 10},
{488390, 498415, -10025}
};
}
@Test(dataProvider = "subDoubleTestData")
public void subDoubleTest(double firstNumber, double secondNumber, double expectedResult, double delta) {
Assert.assertEquals(calculator.sub(firstNumber, secondNumber), expectedResult, delta);
}
@DataProvider
public Object[][] subDoubleTestData() {
return new Object[][]{
{8.0, 4.8, 3.2, 0.001},
{50.003, 0.002, 50.001, 0.001},
{-12.02, -56.056, 44.036, 0.001},
{32.05, 21.47, 10.58, 0.001}
};
}
@Test(dataProvider = "multLongTestData")
public void multLongTest(long firstNumber, long secondNumber, long expectedResult) {
Assert.assertEquals(calculator.mult(firstNumber, secondNumber), expectedResult);
}
@DataProvider
public Object[][] multLongTestData() {
return new Object[][]{
{11, 6, 66},
{90, -40,-3600 },
{-68, -58, 3944},
};
}
@Test(dataProvider = "multDoubleTestData")
public void multDoubleTest(double firstNumber, double secondNumber, double expectedResult, double delta) {
Assert.assertEquals(calculator.mult(firstNumber, secondNumber), expectedResult, delta);
//1
}
@DataProvider
public Object[][] multDoubleTestData() {
return new Object[][]{
{8.0, 4.8, 38.4, 0.001},
{50.003, -5, -250.01, 0.001},
{-12.02, -56.56, 679.8512, 0.0001}
};
}
@Test(expectedExceptions = {NumberFormatException.class})
public void divLongTest(){
long result=calculator.div(5,0);
Assert.assertEquals(calculator.div(6,2), 3);
}
@Test (dataProvider = "divDoubleTestData")
public void divDoubleTest(double firstNumber, double secondNumber, double expectedResult, double delta) {
Assert.assertEquals(calculator.div(firstNumber, secondNumber), expectedResult, delta);
}
@DataProvider
public Object[][] divDoubleTestData() {
return new Object[][]{
{8.0, 4.0, 2.0, 0.001},
{50.05, -5, -10.01, 0.001},
};
}
@Test (dataProvider = "powTestData")
public void powTest(double firstNumber, double secondNumber, double expectedResult, double delta) {
Assert.assertEquals(calculator.pow(firstNumber, secondNumber), expectedResult, delta);
//2
}
@DataProvider
public Object[][] powTestData() {
return new Object[][]{
{8.0, 4.0, 4096.0, 0.001},
{5.2, 2.3, 44.3412253379, 0.001},
};
}
@Test (dataProvider = "sqrtTestData")
public void sqrtTest(double number, double expectedResult, double delta) {
Assert.assertEquals(calculator.sqrt(number), expectedResult, delta);
//3
}
@DataProvider
public Object[][] sqrtTestData() {
return new Object[][]{
{16.0, 4.0, 0.001},
{-16.0, NaN, 0.001}
};
}
@Test (dataProvider = "tgTestData")
public void tgTest(double number, double expectedResult, double delta) {
Assert.assertEquals(calculator.tg(number), expectedResult, delta);
//4
}
@DataProvider
public Object[][] tgTestData() {
return new Object[][]{
{0, 0, 0.001},
{-16.0, -0.2867453858, 0.001}
//Что такое НАН?
};
}
@Test (dataProvider = "сtgTestData")
public void сtgTest(double number, double expectedResult, double delta) {
Assert.assertEquals(calculator.ctg(number), expectedResult, delta);
//5
}
@DataProvider
public Object[][] сtgTestData() {
return new Object[][]{
{0, NaN, 0.001},
{-16.0, -3.4874144438, 0.001}
};
}
@Test (dataProvider = "cosTestData")
public void cosTest(double number, double expectedResult, double delta) {
Assert.assertEquals(calculator.cos(number), expectedResult, delta);
//6
}
@DataProvider
public Object[][] cosTestData() {
return new Object[][]{
{0, 1.0, 0.001},
{-16.0, -0.9612616959, 0.001}
};
}
@Test (dataProvider = "sinTestData")
public void sinTest(double number, double expectedResult, double delta) {
Assert.assertEquals(calculator.sin(number), expectedResult, delta);
}
@DataProvider
public Object[][] sinTestData() {
return new Object[][]{
{0, 0, 0.001},
{2.5, 0.5984721441039564, 0.001}
};
}
@Test(dataProvider = "isPositiveTestData")
public void isPositiveTest(long val, boolean expectedResult){
Assert.assertEquals(calculator.isPositive(val), expectedResult);
}
@DataProvider
public Object[][] isPositiveTestData() {
return new Object[][]{
{0, false},
{16, true},
{-16, false}
};
}
@Test(dataProvider = "isNegativeTestData")
public void isNegativeTest(long val, boolean expectedResult){
Assert.assertEquals(calculator.isNegative(val), expectedResult);
}
@DataProvider
public Object[][] isNegativeTestData() {
return new Object[][]{
{0, false},
{16, false},
{-16, true}
};
}
}
| [
"aray.ibrayeva@bk.ru"
] | aray.ibrayeva@bk.ru |
face945b5d520b6c7be2dde6c4027ded1c04afb0 | f47da2b88588cfc2679b668904f3da441326675b | /SpringProductApp/src/test/java/com/product/demo/SpringProductAppApplicationTests.java | 152381324fb247d50f24e9cdff83d8168b85074a | [] | no_license | vrijeshpatel1997/cst-323 | d58a40cabbcf913d8556bc0428bb5532447a5978 | 38b91645f484e8da52cdfc1601434a0d8d4071b0 | refs/heads/master | 2023-05-02T10:13:29.260908 | 2021-05-12T19:37:07 | 2021-05-12T19:37:07 | 365,854,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 206 | java | package com.product.demo;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringProductAppApplicationTests {
@Test
void contextLoads() {
}
}
| [
"vrijesh@vrijesh-VirtualBox"
] | vrijesh@vrijesh-VirtualBox |
7915292264959f799d300b3115252d4fa2f88c03 | 3647f3da5e8348d5449e2e6f7575a99a2b244849 | /sday14_Regex/src/demo05PatternMatcher/RegexDemo.java | 5f8df0db93aea9a58d1322b56ba6aba5e4ac092b | [] | no_license | NianDUI/chuanzhi | f3f04b5da5c15797a9134846b1d20013363e853d | 9d4a60b14801ee1483ddade080cf059a4037eacb | refs/heads/master | 2022-07-02T01:14:07.768575 | 2019-11-24T12:45:15 | 2019-11-24T12:45:15 | 223,742,493 | 0 | 0 | null | 2022-06-21T02:18:19 | 2019-11-24T12:43:30 | Java | GB18030 | Java | false | false | 353 | java | package demo05PatternMatcher;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/*
* 获取功能
* Pattern和Matcher类的使用
*/
public class RegexDemo {
public static void main(String[] args) {
Pattern p = Pattern.compile("a*b");
Matcher m = p.matcher("aaaaab");
boolean b = m.matches();
System.out.println(b);
}
}
| [
"760664212@qq.com"
] | 760664212@qq.com |
54c1243d4d3c5dbcec986d68741bdbe40df308e9 | 4bd7ceeba8dbcb3fa5edd8cd23f3b137abaed16d | /.svn/pristine/9f/9f78a5b150277213c9496f9026a5892a85a9edc9.svn-base | 9a89b840ffdccbd593dc3ffe4946d9cd175db1bd | [] | no_license | JohnHubcr/electrombile-master | 9543ef06b06d389c62862c5fe7c1ac028ebd1260 | 8b97e19d211a157d458aa53f08343bc031aea5db | refs/heads/master | 2020-03-23T03:08:59.716564 | 2017-07-21T08:44:25 | 2017-07-21T08:44:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,654 | package com.zenchn.electrombile.wrapper;
import android.content.Context;
import com.tencent.android.tpush.XGIOperateCallback;
import com.tencent.android.tpush.XGPushManager;
import com.zenchn.electrombile.BuildConf;
import com.zenchn.electrombile.kit.LogKit;
import com.zenchn.mlibrary.log.LogUtils;
/**
* 作 者:wangr on 2017/2/24 22:33
* 描 述:对信鸽注册Token进行封装
* 修订记录:
*/
public class XGRegisterWrapper implements XGIOperateCallback {
private int errorCount;
private Context mContext;
private XGRegisterWrapper() {
}
public static XGRegisterWrapper getInstance() {
return new XGRegisterWrapper();
}
/**
* 注册信鸽
*
* @param context
*/
public void registerXgPush(Context context) {
this.mContext = context.getApplicationContext();
XGPushManager.registerPush(mContext, this);
}
@Override
public void onSuccess(Object data, int flag) {
LogKit.success("信鸽token注册成功", "token=" + data.toString());
LogUtils.printCustomLog(BuildConf.LogTags.TOKEN_TAG, "注册成功:" + data.toString());
errorCount = 0;//重置错误计数
}
@Override
public void onFail(Object data, int errCode, String msg) {
errorCount++;
LogKit.success("信鸽token注册失败" + errorCount + "次数", "msg=" + msg);
LogUtils.printCustomLog(BuildConf.LogTags.TOKEN_TAG, "注册失败:" + errCode + "," + msg);
if (errorCount < 5)
XGPushManager.registerPush(mContext, this);
else
errorCount = 0;//重置错误计数
}
}
| [
"xu_1986@qq.com"
] | xu_1986@qq.com | |
01f6914a7cccb67104d26dd1335c045b22ea678c | a2d2024c7989edcbf4c51ae449c80418a74310fd | /GitCommon/src/main/java/org/camarena/tools/oscommands/git/GitLogPrettyOption.java | 57dac73c8a5c3fa1e5204c0e02b8b80d34e84009 | [] | no_license | camarena/GitTools | 03bbd623cb53bf65622c94cc92a865e0a23f9681 | 7b8daddfbf38b530ba89535808d7ba931824c10d | refs/heads/main | 2021-06-15T05:10:43.296576 | 2019-12-10T16:00:47 | 2019-12-10T16:00:47 | 35,640,679 | 0 | 1 | null | 2021-04-26T18:33:44 | 2015-05-14T22:39:03 | Java | UTF-8 | Java | false | false | 1,548 | java | package org.camarena.tools.oscommands.git;
import com.beust.jcommander.internal.Nullable;
import com.google.common.collect.ImmutableSet;
import org.camarena.tools.CLIInvalidArgumentException;
import org.camarena.tools.oscommands.StringOSCommandOption;
import java.util.Optional;
/**
* Limit the number of commits to output.
*
* @author Hermán de J. Camarena R.
*/
public
class GitLogPrettyOption extends StringOSCommandOption implements GitLogOption {
private static ImmutableSet<String> mgValues = ImmutableSet.copyOf(new String[]{"oneline",
"short",
"medium",
"full",
"fuller",
"email",
"raw"});
public
GitLogPrettyOption(@Nullable final String value) throws CLIInvalidArgumentException {
super("--pretty", Optional.ofNullable(value));
if (value != null) {
if (!mgValues.contains(value))
throw new CLIInvalidArgumentException("Invalid value \"" + value + "\" for --pretty");
}
}
public static
GitLogPrettyOption pretty(@Nullable final String value) throws CLIInvalidArgumentException {
return new GitLogPrettyOption(value);
}
}
| [
"herman@camarena.org"
] | herman@camarena.org |
e26a58dac2e34fe02ccf47e4b7384fa4e04c25b4 | 2d0de05ba47ad7200e3091bad8b2fbf1dc127684 | /Books-Code-Example/HeadFirstDesignPatterns/src/main/java/com/sayem/state/gumballstate/SoldState.java | b572cff889c310e385f3151b47e7e618618f8826 | [] | no_license | alvarozs/OnlineCode | 10a05685ef515b42468521ae19a0e9e1061b49ad | c859d36c14520a11c1af31f12c20e89a19b4e24c | refs/heads/master | 2021-01-22T01:04:42.278651 | 2013-07-24T03:16:12 | 2013-07-24T03:16:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 903 | java | package com.sayem.state.gumballstate;
public class SoldState implements State {
GumballMachine gumballMachine;
public SoldState(GumballMachine gumballMachine) {
this.gumballMachine = gumballMachine;
}
public void insertQuarter() {
System.out.println("Please wait, we're already giving you a gumball");
}
public void ejectQuarter() {
System.out.println("Sorry, you already turned the crank");
}
public void turnCrank() {
System.out.println("Turning twice doesn't get you another gumball!");
}
public void dispense() {
gumballMachine.releaseBall();
if (gumballMachine.getCount() > 0) {
gumballMachine.setState(gumballMachine.getNoQuarterState());
} else {
System.out.println("Oops, out of gumballs!");
gumballMachine.setState(gumballMachine.getSoldOutState());
}
}
public String toString() {
return "dispensing a gumball";
}
}
| [
"mohammad.hemel@gmail.com"
] | mohammad.hemel@gmail.com |
96ae3951ba4e938e8825ed056dbab60e3e1493a7 | e94aaf1de1b04ef422dd6323d0b6e6a8ce1000f8 | /src/sqlancer/postgres/ast/PostgresAggregate.java | f92de9e8b86ccc24a46166eeedd311ee59262a3d | [
"MIT"
] | permissive | inboxs/sqlancer | d4fe09deec6b784ce9e32d5d7659c37b7d751db9 | 85ebbd9f4b7b927d31ecbb6b8553cbd6c0275069 | refs/heads/master | 2022-11-17T01:55:50.919837 | 2020-06-29T21:32:06 | 2020-06-30T07:02:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,610 | java | package sqlancer.postgres.ast;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import sqlancer.Randomly;
import sqlancer.ast.FunctionNode;
import sqlancer.postgres.PostgresSchema.PostgresDataType;
import sqlancer.postgres.ast.PostgresAggregate.PostgresAggregateFunction;
/**
* @see https://www.sqlite.org/lang_aggfunc.html
*/
public class PostgresAggregate extends FunctionNode<PostgresAggregateFunction, PostgresExpression>
implements PostgresExpression {
public enum PostgresAggregateFunction {
AVG(PostgresDataType.INT, PostgresDataType.FLOAT, PostgresDataType.REAL, PostgresDataType.DECIMAL), BIT_AND(
PostgresDataType.INT), BIT_OR(PostgresDataType.INT), BOOL_AND(PostgresDataType.BOOLEAN), BOOL_OR(
PostgresDataType.BOOLEAN), COUNT(
PostgresDataType.INT), EVERY(PostgresDataType.BOOLEAN), MAX, MIN,
// STRING_AGG
SUM(PostgresDataType.INT, PostgresDataType.FLOAT, PostgresDataType.REAL, PostgresDataType.DECIMAL);
private PostgresDataType[] supportedReturnTypes;
PostgresAggregateFunction(PostgresDataType... supportedReturnTypes) {
this.supportedReturnTypes = supportedReturnTypes.clone();
}
public static PostgresAggregateFunction getRandom() {
return Randomly.fromOptions(values());
}
public static PostgresAggregateFunction getRandom(PostgresDataType type) {
return Randomly.fromOptions(values());
}
public List<PostgresDataType> getTypes(PostgresDataType returnType) {
return Arrays.asList(returnType);
}
public boolean supportsReturnType(PostgresDataType returnType) {
return Arrays.asList(supportedReturnTypes).stream().anyMatch(t -> t == returnType)
|| supportedReturnTypes.length == 0;
}
public static List<PostgresAggregateFunction> getAggregates(PostgresDataType type) {
return Arrays.asList(values()).stream().filter(p -> p.supportsReturnType(type))
.collect(Collectors.toList());
}
public PostgresDataType getRandomReturnType() {
if (supportedReturnTypes.length == 0) {
return Randomly.fromOptions(PostgresDataType.getRandomType());
} else {
return Randomly.fromOptions(supportedReturnTypes);
}
}
}
public PostgresAggregate(List<PostgresExpression> args, PostgresAggregateFunction func) {
super(func, args);
}
}
| [
"manuel.rigger@inf.ethz.ch"
] | manuel.rigger@inf.ethz.ch |
c623a92b0c2d9889ce57e1cec74d20032113375e | ebf5d5ccc7b06389044e591282fba4c9e5a0d765 | /libs_common/src/main/java/com/nisco/family/common/view/SearchEditTextView.java | 8b10edbe990441e4ba640742913a0d29d743ee77 | [] | no_license | shannonOne/HMMTensorflowAndroid | 8fec9efdd9f7fabb4a8532b7e5e68d81adc80611 | 3fcb3bb8987821e164689e855ae4daa52cfb2dc1 | refs/heads/master | 2021-01-14T14:48:46.915241 | 2019-05-04T06:00:38 | 2019-05-04T06:00:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,164 | java | package com.nisco.family.common.view;
/**
* Created by wangyu on 2018/3/8.
*/
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.AppCompatEditText;
import android.util.AttributeSet;
import com.nisco.family.common.R;
public class SearchEditTextView extends AppCompatEditText {
private float searchSize = 0;
private float textSize = 0;
private int textColor = 0xFF000000;
private Drawable mDrawable;
private Paint paint;
public SearchEditTextView(Context context, AttributeSet attrs) {
super(context, attrs);
InitResource(context, attrs);
InitPaint();
}
private void InitResource(Context context, AttributeSet attrs) {
TypedArray mTypedArray = context.obtainStyledAttributes(attrs, R.styleable.searchedit);
float density = context.getResources().getDisplayMetrics().density;
searchSize = mTypedArray.getDimension(R.styleable.searchedit_imagewidth, 18 * density + 0.5F);
textColor = mTypedArray.getColor(R.styleable.searchedit_textColor, 0xFF848484);
textSize = mTypedArray.getDimension(R.styleable.searchedit_textSize, 14 * density + 0.5F);
mTypedArray.recycle();
}
private void InitPaint() {
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setColor(textColor);
paint.setTextSize(textSize);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
DrawSearchIcon(canvas);
}
private void DrawSearchIcon(Canvas canvas) {
if (this.getText().toString().length() == 0) {
float textWidth = paint.measureText("请输入客户名称");
float textHeight = getFontLeading(paint);
float dx = (getWidth() - searchSize - textWidth - 8) / 2;
float dy = (getHeight() - searchSize) / 2;
canvas.save();
canvas.translate(getScrollX() + dx, getScrollY() + dy);
if (mDrawable != null) {
mDrawable.draw(canvas);
}
canvas.drawText("请输入客户名称", getScrollX() + searchSize + 8, getScrollY() + (getHeight() - (getHeight() - textHeight) / 2) - paint.getFontMetrics().bottom - dy, paint);
canvas.restore();
}
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (mDrawable == null) {
try {
mDrawable = getContext().getResources().getDrawable(R.drawable.common_search_kuang);
mDrawable.setBounds(0, 0, (int) searchSize, (int) searchSize);
} catch (Exception e) {
}
}
}
@Override
protected void onDetachedFromWindow() {
if (mDrawable != null) {
mDrawable.setCallback(null);
mDrawable = null;
}
super.onDetachedFromWindow();
}
public float getFontLeading(Paint paint) {
Paint.FontMetrics fm = paint.getFontMetrics();
return fm.bottom - fm.top;
}
} | [
"952646089@qq.com"
] | 952646089@qq.com |
400896989d4a684cadae0e240fe2ca29f5a84a89 | 53510b2f25f4fab32b9a0494500b84f6c79cb2ee | /FQPMall/app/src/main/java/com/fengqipu/mall/main/acty/mine/EditPasswordActy.java | 5e92e9fa529646c46a2a973e7c1b672b13e1d045 | [] | no_license | shenkuen88/FQPMall | 14c594172e9e70c8c752c1a452bd898161c796c6 | 6b81cc076844f126c5e682e9c1d5f5c7bc5add6e | refs/heads/master | 2020-12-03T00:42:41.203339 | 2017-11-30T06:48:29 | 2017-11-30T06:48:29 | 96,063,803 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,935 | java | package com.fengqipu.mall.main.acty.mine;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import com.fengqipu.mall.R;
import com.fengqipu.mall.bean.BaseResponse;
import com.fengqipu.mall.bean.NetResponseEvent;
import com.fengqipu.mall.bean.NoticeEvent;
import com.fengqipu.mall.bean.mine.EditPasswordResponse;
import com.fengqipu.mall.constant.Constants;
import com.fengqipu.mall.constant.ErrorCode;
import com.fengqipu.mall.constant.Global;
import com.fengqipu.mall.constant.IntentCode;
import com.fengqipu.mall.constant.NotiTag;
import com.fengqipu.mall.main.base.BaseActivity;
import com.fengqipu.mall.main.base.BaseApplication;
import com.fengqipu.mall.main.base.HeadView;
import com.fengqipu.mall.network.GsonHelper;
import com.fengqipu.mall.network.UserServiceImpl;
import com.fengqipu.mall.tools.GeneralUtils;
import com.fengqipu.mall.tools.NetLoadingDialog;
import com.fengqipu.mall.tools.StringEncrypt;
import com.fengqipu.mall.tools.ToastUtil;
import de.greenrobot.event.EventBus;
/**
* 设置密码
*/
public class EditPasswordActy extends BaseActivity implements View.OnClickListener {
private Button comfirmBn;
private String phoneNum = "";
private EditText etPsdComfirm;
private EditText psdEt;
/**
* 旧密码
*/
private EditText etOld;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_find_password_reset);
phoneNum = getIntent().getStringExtra(IntentCode.REGISTER_PHONE);
initAll();
}
private void initTitle() {
View view = findViewById(R.id.common_back);
HeadView headView = new HeadView((ViewGroup) view);
headView.setTitleText("修改密码");
headView.setLeftImage(R.mipmap.app_title_back);
headView.setHiddenRight();
}
@Override
public void initView() {
initTitle();
psdEt = (EditText) findViewById(R.id.app_phone_et);
etOld = (EditText) findViewById(R.id.app_old_et);
etPsdComfirm = (EditText) findViewById(R.id.app_code_et);
comfirmBn = (Button) findViewById(R.id.app_register_next_bn);
comfirmBn.setOnClickListener(this);
etPsdComfirm.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (GeneralUtils.isNotNullOrZeroLenght(etPsdComfirm.getText().toString())) {
comfirmBn.setEnabled(true);
}
}
});
}
@Override
public void initViewData() {
}
@Override
public void initEvent() {
}
@Override
public void onEventMainThread(BaseResponse event) {
if (event instanceof NoticeEvent) {
String tag = ((NoticeEvent) event).getTag();
if (NotiTag.TAG_CLOSE_ACTIVITY.equals(tag) && BaseApplication.currentActivity.equals(this.getClass().getName())) {
finish();
}
} else if (event instanceof NetResponseEvent) {
NetLoadingDialog.getInstance().dismissDialog();
String tag = ((NetResponseEvent) event).getTag();
String result = ((NetResponseEvent) event).getResult();
if (tag.equals(EditPasswordResponse.class.getName()) && BaseApplication.currentActivity.equals(this.getClass().getName())) {
if (GeneralUtils.isNotNullOrZeroLenght(result)) {
EditPasswordResponse mCheck = GsonHelper.toType(result, EditPasswordResponse.class);
if (Constants.SUCESS_CODE.equals(mCheck.getResultCode())) {
//密码修改成功
ToastUtil.makeText(mContext, "密码修改成功,请用新密码登录");
Global.loginOut(mContext);
EventBus.getDefault().post(new NoticeEvent(NotiTag.TAG_LOGIN_OUT));
startActivity(new Intent(mContext,LoginActy.class));
finish();
} else {
ErrorCode.doCode(mContext, mCheck.getResultCode(), mCheck.getDesc());
NetLoadingDialog.getInstance().dismissDialog();
}
} else {
NetLoadingDialog.getInstance().dismissDialog();
ToastUtil.showError(mContext);
}
}
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.app_register_next_bn:
if (GeneralUtils.isNullOrZeroLenght(etOld.getText().toString().trim())) {
ToastUtil.makeText(mContext, "请输入旧密码");
return;
} else if (etPsdComfirm.getText().toString().trim().equals(psdEt.getText().toString().trim())) {
if (etPsdComfirm.getText().toString().trim().length() >= 6) {
UserServiceImpl.instance().editPassword("1", phoneNum, etOld.getText().toString().trim(), StringEncrypt.Encrypt(etPsdComfirm.getText().toString().trim()), EditPasswordResponse.class.getName());
} else {
ToastUtil.makeText(mContext, "请输入大于六位数的密码");
}
} else {
ToastUtil.makeText(mContext, "两次密码输入不一致");
}
break;
}
}
}
| [
"543126764@qq.com"
] | 543126764@qq.com |
d66682e3384ffb5b6f3a274ae16f87098a228a86 | 53dd3fda7ecc06cdbfb805b46eeaa3d686907929 | /src/main/java/com/foo/config/BatchConfiguration.java | b826c87a167160a0f3c7aac91acf294320f919ef | [] | no_license | vinodhinic/scale-spring-batch | 08f05a3be202bc13312c05c54c270cb71090f3da | 26837728fe35d4430994ae72a13270296332ea27 | refs/heads/main | 2023-01-24T21:57:38.010646 | 2020-12-02T12:30:44 | 2020-12-02T12:30:44 | 317,835,297 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,829 | java | package com.foo.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.configuration.JobRegistry;
import org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor;
import org.springframework.batch.core.converter.DefaultJobParametersConverter;
import org.springframework.batch.core.explore.JobExplorer;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.launch.JobOperator;
import org.springframework.batch.core.launch.support.RunIdIncrementer;
import org.springframework.batch.core.launch.support.SimpleJobLauncher;
import org.springframework.batch.core.launch.support.SimpleJobOperator;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.task.TaskSchedulerCustomizer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import javax.sql.DataSource;
import java.util.List;
import java.util.function.Function;
import static org.springframework.beans.factory.config.ConfigurableBeanFactory.SCOPE_PROTOTYPE;
@Configuration("batchConfiguration")
public class BatchConfiguration extends DefaultBatchConfigurer implements ApplicationContextAware {
/* TODO: Make sure web server does not get initialized unless flyway migration succeeds.
Makes readiness probe solid. i.e. do not direct any http request until the application is ready.
When the application is ready? - when the flyway migration is done. But currently web-server and
flyway-migration initialization are happening independently.
*/
private static final Logger LOGGER = LoggerFactory.getLogger(BatchConfiguration.class);
private static final String MONITORING_JOB = "monitoring-job";
private static final String PUBLISHER_JOB = "publisher-job";
private static final String TRADE_JOB = "trade-job";
private static final String PRICE_JOB = "price-job";
public static final List<String> jobs = List.of(MONITORING_JOB, PUBLISHER_JOB, TRADE_JOB, PRICE_JOB);
@Autowired
private JobBuilderFactory jobBuilderFactory;
@Autowired
private StepBuilderFactory stepBuilderFactory;
@Autowired
private JobLauncher jobLauncher;
@Autowired
private JobRepository jobRepository;
@Autowired
private JobRegistry jobRegistry;
@Autowired
private JobExplorer jobExplorer;
@Autowired
private JobOperator jobOperator;
@Autowired
private DynamoDBJobCoordinator dynamoDBJobCoordinator;
private ApplicationContext applicationContext;
@Autowired
private ChunkListener chunkListener;
@Bean // to register the job into the registry
public JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor() throws Exception {
JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor = new JobRegistryBeanPostProcessor();
jobRegistryBeanPostProcessor.setJobRegistry(this.jobRegistry);
jobRegistryBeanPostProcessor.setBeanFactory(this.applicationContext.getAutowireCapableBeanFactory());
jobRegistryBeanPostProcessor.afterPropertiesSet();
System.out.println("job registry initialized");
return jobRegistryBeanPostProcessor;
}
@Bean // this job operator is needed in order to handle restarts and all
public JobOperator jobOperator() throws Exception {
SimpleJobOperator simpleJobOperator = new SimpleJobOperator();
simpleJobOperator.setJobLauncher(this.jobLauncher);
simpleJobOperator.setJobParametersConverter(new DefaultJobParametersConverter());
simpleJobOperator.setJobRepository(this.jobRepository);
simpleJobOperator.setJobExplorer(this.jobExplorer);
simpleJobOperator.setJobRegistry(this.jobRegistry);
simpleJobOperator.afterPropertiesSet();
return simpleJobOperator;
}
@Override
public JobLauncher getJobLauncher() {
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
jobLauncher.setJobRepository(this.jobRepository);
jobLauncher.setTaskExecutor(new SimpleAsyncTaskExecutor("EXEC-JL-"));
try {
jobLauncher.afterPropertiesSet();
} catch (Exception e) {
e.printStackTrace();
}
return jobLauncher;
}
@Autowired
private DataSource dataSource;
@Override
protected JobRepository createJobRepository() throws Exception {
JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
factory.setDataSource(dataSource);
factory.setTransactionManager(getTransactionManager());
// https://github.com/spring-projects/spring-batch/issues/1127
factory.setIsolationLevelForCreate("ISOLATION_READ_UNCOMMITTED");
factory.afterPropertiesSet();
return factory.getObject();
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
@Bean
public TaskSchedulerCustomizer taskSchedulerCustomizer() {
return taskScheduler -> {
taskScheduler.setThreadNamePrefix("SYNC_SCHEDULER");
taskScheduler.setPoolSize(20);
taskScheduler.setAwaitTerminationSeconds(210);
taskScheduler.setWaitForTasksToCompleteOnShutdown(true);
};
}
@Bean("jobSyncRunnableBeanFactory")
public Function<String, JobSyncRunnable> jobSyncRunnableBeanFactory() {
return this::jobSyncRunnable;
}
@Bean
@Scope(SCOPE_PROTOTYPE)
public JobSyncRunnable jobSyncRunnable(String name) {
return new JobSyncRunnable(name, jobExplorer, jobOperator, jobRepository, dynamoDBJobCoordinator);
}
@Bean("tradeJob")
public Job tradeJob() {
return jobBuilderFactory.get(TRADE_JOB)
.incrementer(new RunIdIncrementer())
.start(stepBuilderFactory.get("trade-ETL")
.tasklet((contribution, chunkContext) -> {
LOGGER.info("Trades are pulled from source and staged in postgres");
return RepeatStatus.FINISHED;
}).listener(chunkListener)
.build()
).build();
}
@Bean("priceJob")
public Job priceJob() {
return jobBuilderFactory.get(PRICE_JOB)
.incrementer(new RunIdIncrementer())
.start(stepBuilderFactory.get("price-ETL")
.tasklet((contribution, chunkContext) -> {
LOGGER.info("Prices are pulled from source and staged in postgres");
return RepeatStatus.FINISHED;
}).listener(chunkListener)
.build()
).build();
}
@Bean("publisherJob")
public Job publisherJob() {
return jobBuilderFactory.get(PUBLISHER_JOB)
.incrementer(new RunIdIncrementer())
.start(stepBuilderFactory.get("publisher-step")
.tasklet((contribution, chunkContext) -> {
LOGGER.info("Publisher is loading from postgres and publishing the messages to the sink");
return RepeatStatus.FINISHED;
}).listener(chunkListener)
.build()
).build();
}
@Autowired
private GlobalJobMonitor globalJobMonitor;
@Bean("monitoringJob")
public Job monitoringJob() {
return jobBuilderFactory.get(MONITORING_JOB)
.incrementer(new RunIdIncrementer())
.start(stepBuilderFactory.get("monitoring-ETL")
.tasklet((contribution, chunkContext) -> {
globalJobMonitor.run();
return RepeatStatus.FINISHED;
}).listener(chunkListener)
.build()
).build();
}
}
| [
"chockali@arcesium.com"
] | chockali@arcesium.com |
25f9e9684acbdc23fd81d789dc624d21ceeb1fc0 | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.ocms-OCMS/sources/com/facebook/quicklog/identifiers/Ufi.java | 1b5aa3104a839dafc9eefa471363d7e14f99e22f | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 5,825 | java | package com.facebook.quicklog.identifiers;
public class Ufi {
public static final int COMMENT_FLYOUT_TTRC = 3735607;
public static final int DASH_FLYOUT_LOAD_CACHED = 3735565;
public static final int DASH_FLYOUT_LOAD_NETWORK = 3735566;
public static final int FLYOUT_NETWORK_TIME_EXECUTOR_FEEDBACK_ID = 3735568;
public static final int FLYOUT_NETWORK_TIME_FEEDBACK_ID = 3735567;
public static final int FLYOUT_NETWORK_TIME_PHOTO_ID = 3735569;
public static final int LOAD_MORE_COMMENTS = 3735577;
public static final short MODULE_ID = 57;
public static final int NNF_FLYOUT_ANIMATION_ADJUSTED_WAIT_TIME = 3735578;
public static final int NNF_FLYOUT_ANIMATION_TO_DATA_FETCH = 3735580;
public static final int NNF_FLYOUT_ANIMATION_WAIT_TIME = 3735575;
public static final int NNF_FLYOUT_BG_INFLATABLE_FEEDBACK_TOTAL_TIME = 3735584;
public static final int NNF_FLYOUT_BG_INFLATION_TIME = 3735585;
public static final int NNF_FLYOUT_FRAGMENT_CREATE_TIME = 3735562;
public static final int NNF_FLYOUT_LOAD_COMPLETE_FLOW = 3735559;
public static final int NNF_FLYOUT_LOAD_COMPLETE_FLOW_AND_RENDER = 3735560;
public static final int NNF_FLYOUT_LOAD_COMPLETE_FLOW_TO_RENDER = 3735576;
public static final int NNF_FLYOUT_LOAD_DB_CACHE = 3735553;
public static final int NNF_FLYOUT_LOAD_DB_CACHE_AND_RENDER = 3735554;
public static final int NNF_FLYOUT_LOAD_NETWORK = 3735555;
public static final int NNF_FLYOUT_LOAD_NETWORK_AND_RENDER = 3735556;
public static final int NNF_FLYOUT_LOAD_NETWORK_WITHOUT_CACHE = 3735557;
public static final int NNF_FLYOUT_LOAD_NETWORK_WITHOUT_CACHE_AND_RENDER = 3735558;
public static final int NNF_FLYOUT_LOAD_NETWORK_WITH_CACHE = 3735583;
public static final int NNF_FLYOUT_ON_ACTIVITYCRAETED_TIME = 3735572;
public static final int NNF_FLYOUT_ON_CREATEVIEW_TIME = 3735570;
public static final int NNF_FLYOUT_ON_CREATE_TIME = 3735561;
public static final int NNF_FLYOUT_ON_RESUME_TIME = 3735573;
public static final int NNF_FLYOUT_ON_VIEWCREATED_TIME = 3735571;
public static final int NNF_FLYOUT_RESUME_TO_ANIMATION_WAIT = 3735579;
public static final int NNF_FLYOUT_RESUME_TO_RENDER_TIME = 3735574;
public static final int PERF_MARKER_OPTIMISTIC_COMMENT = 3735582;
public static final int PERF_MARKER_POST_COMMENT = 3735581;
public static final int PHOTO_FLYOUT_LOAD_CACHED = 3735563;
public static final int PHOTO_FLYOUT_LOAD_NETWORK = 3735564;
public static final int SINGLELINECOMMENTCOMPOSERVIEW_INITIALIZATION = 3735588;
public static final int THREADED_FLYOUT_LOAD_COMPLETE_FLOW_AND_RENDER = 3735587;
public static String getMarkerName(int i) {
if (i == 35) {
return "UFI_THREADED_FLYOUT_LOAD_COMPLETE_FLOW_AND_RENDER";
}
if (i == 36) {
return "UFI_SINGLELINECOMMENTCOMPOSERVIEW_INITIALIZATION";
}
if (i == 55) {
return "UFI_COMMENT_FLYOUT_TTRC";
}
switch (i) {
case 1:
return "UFI_NNF_FLYOUT_LOAD_DB_CACHE";
case 2:
return "UFI_NNF_FLYOUT_LOAD_DB_CACHE_AND_RENDER";
case 3:
return "UFI_NNF_FLYOUT_LOAD_NETWORK";
case 4:
return "UFI_NNF_FLYOUT_LOAD_NETWORK_AND_RENDER";
case 5:
return "UFI_NNF_FLYOUT_LOAD_NETWORK_WITHOUT_CACHE";
case 6:
return "UFI_NNF_FLYOUT_LOAD_NETWORK_WITHOUT_CACHE_AND_RENDER";
case 7:
return "NNF_FlyoutLoadCompleteFlow";
case 8:
return "NNF_FlyoutLoadCompleteFlowAndRender";
case 9:
return "UFI_NNF_FLYOUT_ON_CREATE_TIME";
case 10:
return "UFI_NNF_FLYOUT_FRAGMENT_CREATE_TIME";
case 11:
return "UFI_PHOTO_FLYOUT_LOAD_CACHED";
case 12:
return "UFI_PHOTO_FLYOUT_LOAD_NETWORK";
case 13:
return "UFI_DASH_FLYOUT_LOAD_CACHED";
case 14:
return "UFI_DASH_FLYOUT_LOAD_NETWORK";
case 15:
return "UFI_FLYOUT_NETWORK_TIME_FEEDBACK_ID";
case 16:
return "UFI_FLYOUT_NETWORK_TIME_EXECUTOR_FEEDBACK_ID";
case 17:
return "UFI_FLYOUT_NETWORK_TIME_PHOTO_ID";
case 18:
return "UFI_NNF_FLYOUT_ON_CREATEVIEW_TIME";
case 19:
return "UFI_NNF_FLYOUT_ON_VIEWCREATED_TIME";
case 20:
return "UFI_NNF_FLYOUT_ON_ACTIVITYCRAETED_TIME";
case 21:
return "UFI_NNF_FLYOUT_ON_RESUME_TIME";
case 22:
return "UFI_NNF_FLYOUT_RESUME_TO_RENDER_TIME";
case 23:
return "UFI_NNF_FLYOUT_ANIMATION_WAIT_TIME";
case 24:
return "UFI_NNF_FLYOUT_LOAD_COMPLETE_FLOW_TO_RENDER";
case 25:
return "UfiLoadMoreComments";
case 26:
return "UFI_NNF_FLYOUT_ANIMATION_ADJUSTED_WAIT_TIME";
case 27:
return "UFI_NNF_FLYOUT_RESUME_TO_ANIMATION_WAIT";
case 28:
return "UFI_NNF_FLYOUT_ANIMATION_TO_DATA_FETCH";
case 29:
return "UfiFuturesPostComment";
case 30:
return "UFI_PERF_MARKER_OPTIMISTIC_COMMENT";
case 31:
return "NNF_FlyoutLoadNetworkWithCache";
case 32:
return "UFI_NNF_FLYOUT_BG_INFLATABLE_FEEDBACK_TOTAL_TIME";
case 33:
return "UFI_NNF_FLYOUT_BG_INFLATION_TIME";
default:
return "UNDEFINED_QPL_EVENT";
}
}
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
9ba2af47ecadc37abc2647cd9cf9ba6e02efec1a | cfbc8c36915cd19b142e6e75876ff03090f06372 | /app/src/test/java/com/example/wifind/ExampleUnitTest.java | 008c06a70644a059e4fc67ac97c656321b008ff4 | [] | no_license | aniketp319/wifind | f080b026e9d07e2910f4f5fcec3430746c97fecc | 34410c7cd13e6e9207c1c0d7dab81fc11a64cfff | refs/heads/master | 2020-04-28T18:11:30.387346 | 2019-04-25T04:40:57 | 2019-04-25T04:40:57 | 175,470,895 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 379 | java | package com.example.wifind;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"aniket.sp@somaiya.edu"
] | aniket.sp@somaiya.edu |
2fb8b1d130ec34555e7d5340e3b5e8dd3f5abf99 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/29/29_714a45a7c64881173f5faa36c09dfb805a3963f3/MTFSupply/29_714a45a7c64881173f5faa36c09dfb805a3963f3_MTFSupply_s.java | 96061205bd05b1c883adac2ef6b088228a900259 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 29,945 | java | package com.raygroupintl.m.token;
import com.raygroupintl.m.struct.MError;
import com.raygroupintl.parser.TFSyntaxError;
import com.raygroupintl.parser.TokenFactory;
import com.raygroupintl.parser.annotation.AdapterSupply;
import com.raygroupintl.parser.annotation.CharSpecified;
import com.raygroupintl.parser.annotation.Choice;
import com.raygroupintl.parser.annotation.Rule;
import com.raygroupintl.parser.annotation.List;
import com.raygroupintl.parser.annotation.ParseException;
import com.raygroupintl.parser.annotation.Parser;
import com.raygroupintl.parser.annotation.Sequence;
import com.raygroupintl.parser.annotation.TokenType;
import com.raygroupintl.parser.annotation.WordSpecified;
public class MTFSupply {
@CharSpecified(chars={'.'}, single=true)
public TokenFactory dot;
@CharSpecified(chars={','}, single=true)
public TokenFactory comma;
@CharSpecified(chars={'\''}, single=true)
public TokenFactory squote;
@CharSpecified(chars={'"'}, single=true)
public TokenFactory quote;
@CharSpecified(chars={'|'}, single=true)
public TokenFactory pipe;
@CharSpecified(chars={'['}, single=true)
public TokenFactory lsqr;
@CharSpecified(chars={']'}, single=true)
public TokenFactory rsqr;
@CharSpecified(chars={'('}, single=true)
public TokenFactory lpar;
@CharSpecified(chars={')'}, single=true)
public TokenFactory rpar;
@CharSpecified(chars={'?'}, single=true)
public TokenFactory qmark;
@CharSpecified(chars={'@'}, single=true)
public TokenFactory at;
@CharSpecified(chars={'='}, single=true)
public TokenFactory eq;
@CharSpecified(chars={'^'}, single=true)
public TokenFactory caret;
@CharSpecified(chars={':'}, single=true)
public TokenFactory colon;
@CharSpecified(chars={'+'}, single=true)
public TokenFactory plus;
@CharSpecified(chars={'#'}, single=true)
public TokenFactory pound;
@CharSpecified(chars={'*'}, single=true)
public TokenFactory asterix;
@CharSpecified(chars={'E'}, single=true)
public TokenFactory e;
@CharSpecified(chars={'/'}, single=true)
public TokenFactory slash;
@CharSpecified(chars={' '}, single=true)
public TokenFactory space;
@CharSpecified(chars={' '})
public TokenFactory spaces;
@CharSpecified(chars={'$'})
public TokenFactory dollar;
@CharSpecified(chars={';'})
public TokenFactory semicolon;
@WordSpecified("^$")
public TokenFactory caretquest;
@WordSpecified("$$")
public TokenFactory ddollar;
@CharSpecified(chars={'+', '-'})
public TokenFactory pm;
@CharSpecified(ranges={'a', 'z', 'A', 'Z'}, excludechars={'y', 'Y'})
public TokenFactory identxy;
@CharSpecified(ranges={'a', 'y', 'A', 'Y'})
public TokenFactory identxz;
@CharSpecified(chars={'z', 'Z'})
public TokenFactory yy;
@CharSpecified(chars={'z', 'Z'})
public TokenFactory zz;
@CharSpecified(ranges={'a', 'x', 'A', 'X'})
public TokenFactory paton;
@Sequence(value={"yy", "identxy", "yy"}, required="all")
public TokenFactory patony;
@Sequence(value={"zz", "identxz", "zz"}, required="all")
public TokenFactory patonz;
@Choice({"paton", "patony", "patonz"})
public TokenFactory patons;
@Sequence(value={"squote", "patons"}, required="or")
public TokenFactory patcode;
@Sequence(value={"intlit", "dot", "intlit"})
public TokenFactory repcount;
@Rule("alternation | patcode | strlit")
public TokenFactory patatom_re;
@Sequence(value={"repcount", "patatom_re"}, required="all")
public TokenFactory patatom;
@List(value="patatoms", delim="comma", left="lpar", right="rpar")
public TokenFactory alternation;
@List(value="patatom")
public TokenFactory patatoms;
@Choice({"indirection", "patatoms"})
public TokenFactory pattern;
@Rule("'%' + 'a'...'z' + 'A'...'Z', [{'a'...'z' + 'A'...'Z' + '0'...'9'}]")
public TokenFactory name;
@Rule("{'a'...'z' + 'A'...'Z'}")
public TokenFactory ident;
@TokenType(TIntLit.class)
@CharSpecified(ranges={'0', '9'})
public TokenFactory intlit;
@TokenType(TLabel.class)
@Rule("name | intlit")
public TokenFactory label;
@Sequence(value={"caret", "environment", "name"}, required="ror")
public TokenFactory envroutine;
@TokenType(TNumLit.class)
@Rule("'.', intlit, ['E', ['+' | '-'], intlit]")
public TokenFactory numlita;
@TokenType(TNumLit.class)
@Rule("intlit, ['.', intlit], ['E', ['+' | '-'], intlit]")
public TokenFactory numlitb;
@Choice({"numlita", "numlitb"})
public TokenFactory numlit;
public TFOperator operator = new TFOperator("operator");
public TokenFactory error = new TFSyntaxError("error", MError.ERR_GENERAL_SYNTAX);
@CharSpecified(chars={'+', '-', '\''})
public TokenFactory unaryop;
@CharSpecified(excludechars={'\r', '\n', '"'})
public TokenFactory quotecontent;
@Sequence(value={"quote", "quotecontent", "quote"}, required="ror")
public TokenFactory strlitatom;
@TokenType(TStringLiteral.class)
@Sequence(value={"strlitatom", "strlit"}, required="ro")
public TokenFactory strlit;
@Sequence(value={"pipe", "expr", "pipe"}, required="all")
public TokenFactory env_0;
@List(value="expratom", delim="comma", left="lsqr", right="rsqr")
public TokenFactory env_1;
@TokenType(TEnvironment.class)
@Choice({"env_0", "env_1"})
public TokenFactory environment;
@Sequence(value={"qmark", "pattern"}, required="all")
public TokenFactory exprtail_s0;
@Rule("\"'?\", pattern")
public TokenFactory exprtail_s1;
@Sequence(value={"operator", "expratom"}, required="all")
public TokenFactory exprtail_s2;
@Choice({"exprtail_s0", "exprtail_s1", "exprtail_s2"})
public TokenFactory exprtail_s;
@List("exprtail_s")
public TokenFactory exprtail;
@List(value="expr", delim="comma")
public TokenFactory exprlist;
@List(value="expr", delim="comma", left="lpar", right="rpar")
public TokenFactory exprlistinparan;
@Sequence(value={"lpar", "expr", "rpar"}, required="all")
public TokenFactory exprinpar;
@Sequence(value={"eq", "expr"}, required="all")
public TokenFactory eqexpr;
@TokenType(TIndirection.class)
@Rule("'@', expratom, [\"@(\", exprlist, ')']")
public TokenFactory indirection;
@TokenType(TIndirection.class)
@Rule("'@', expratom")
public TokenFactory rindirection;
@Rule("lvn | gvnall | indirection")
public TokenFactory glvn;
@Sequence(value={"environment", "name", "exprlistinparan"}, required="oro")
public TokenFactory gvn_0;
@TokenType(TGlobalNamed.class)
@Sequence(value={"caret", "gvn_0"}, required="all")
public TokenFactory gvn;
@Sequence(value={"caretquest", "ident", "exprlistinparan"}, required="all")
public TokenFactory gvnssvn;
@Sequence(value={"ddollar", "extrinsicarg"}, required="all")
public TokenFactory extrinsic;
@Sequence(value={"unaryop", "expratom"}, required="all")
public TokenFactory unaryexpritem;
@TokenType(TGlobalNaked.class)
@Sequence(value={"caret", "exprlistinparan"}, required="all")
public TokenFactory gvnnaked;
@Sequence(value={"expr", "colon", "expr"}, required="all")
public TokenFactory dselectarg_e;
@List(value="dselectarg_e", delim="comma")
public TokenFactory dselectarg;
@Rule("gvnssvn | gvnnaked | gvn")
public TokenFactory gvnall;
@Rule("extrinsic | external | intrinsic")
public TokenFactory expritemd;
@Rule("strlit | expritemd | unaryexpritem | numlit | exprinpar")
public TokenFactory expritem;
@Rule("'.', name")
public TokenFactory actualda;
@Rule("'.', indirection")
public TokenFactory actualdb;
@Rule("numlita | actualda | actualdb | expr")
public TokenFactory actual;
@Choice({"glvn", "expritem"})
public TokenFactory expratom;
@TokenType(TLocal.class)
@Sequence(value={"name", "exprlistinparan"}, required="ro")
public TokenFactory lvn;
@Sequence(value={"expratom", "exprtail"}, required="ro")
public TokenFactory expr;
@TokenType(TActualList.class)
@List(value="actual", delim="comma", left="lpar", right="rpar", empty=true, none=true)
public TokenFactory actuallist;
@Sequence(value={"eq", "expr"}, required="all")
public TokenFactory deviceparam_1;
@Sequence(value={"expr", "deviceparam_1"}, required="ro")
public TokenFactory deviceparam;
@List(value="deviceparam", delim="colon", left="lpar", right="rpar", empty=true)
public TokenFactory deviceparamsi;
@Rule("deviceparamsi | deviceparam")
public TokenFactory deviceparams;
@Choice({"indirection", "name"})
public TokenFactory cmdkexcarg;
@List(value="cmdkexcarg", delim="comma", left="lpar", right="rpar")
public TokenFactory cmdkexcargs;
@Rule("cmdkexcargs | indirection | glvn")
public TokenFactory cmdkarg;
@List(value="cmdkarg", delim="comma")
public TokenFactory cmdkargs;
@Sequence(value={"glvn", "eqexpr"}, required="all")
public TokenFactory cmdmarg_basic;
@Sequence(value={"indirection", "eqexpr"}, required="ro")
public TokenFactory cmdmarg_indirect;
@Choice({"cmdmarg_indirect", "cmdmarg_basic"})
public TokenFactory cmdmarg;
@List(value="cmdmarg", delim="comma")
public TokenFactory cmdmargs;
@Choice({"exprlistinparan", "expr"})
public TokenFactory exprorinlist;
@Sequence(value={"colon", "deviceparams", "colon", "expr", "colon", "exprorinlist"}, required="rooooo")
public TokenFactory cmdoarg_tail;
@Sequence(value={"expr", "cmdoarg_tail"}, required="ro")
public TokenFactory cmdoarg_basic;
@Choice({"indirection", "cmdoarg_basic"})
public TokenFactory cmdoarg;
@List(value="cmdoarg", delim="comma")
public TokenFactory cmdoargs;
@Choice({"indirection", "label"})
public TokenFactory linetagname;
@Sequence(value={"plus", "expr"}, required="all")
public TokenFactory lineoffset;
@Sequence(value={"linetagname", "lineoffset"})
public TokenFactory tagspec;
@Sequence(value={"environment", "name"}, required="or")
public TokenFactory envname;
@Choice(value={"rindirection", "envname"})
public TokenFactory routinespec_0;
@Sequence(value={"caret", "routinespec_0"}, required="all")
public TokenFactory routinespec;
@Sequence({"tagspec", "routinespec"})
public TokenFactory cmdgargmain;
@Sequence(value={"cmdgargmain", "postcondition"}, required="ro")
public TokenFactory gotoargument;
@List(value="gotoargument", delim="comma")
public TokenFactory gotoarguments;
@Sequence(value={"pound", "expr"}, required="all")
public TokenFactory readcount;
@Sequence(value={"qmark", "expr"}, required="all")
public TokenFactory tabformat;
@CharSpecified(chars={'!', '#'})
public TokenFactory excorpounds;
@Sequence(value={"excorpounds", "tabformat"}, required="ro")
public TokenFactory xtabformat;
@Choice({"tabformat", "xtabformat"})
public TokenFactory format;
@Sequence(value={"glvn", "readcount", "timeout"}, required="roo")
public TokenFactory cmdrargdef;
@Sequence(value={"asterix", "glvn", "timeout"}, required="rro")
public TokenFactory cmdrargast;
@Sequence(value={"indirection", "timeout"}, required="ro")
public TokenFactory cmdrargat;
@Rule("format | strlit | cmdrargast | cmdrargat | cmdrargdef")
public TokenFactory cmdrarg;
@List(value="cmdrarg", delim="comma")
public TokenFactory cmdrargs;
@Sequence(value={"colon", "expr"}, required="all")
public TokenFactory postcondition;
@Sequence(value={"asterix", "expr"}, required="all")
public TokenFactory asterixexpr;
@Sequence(value={"colon", "expr"}, required="all")
public TokenFactory timeout;
@List(value="expr", delim="colon", left="lpar", right="rpar", empty=true)
public TokenFactory usedeviceparam_list;
@Choice(value={"usedeviceparam_list", "expr"})
public TokenFactory usedeviceparam;
@Sequence(value={"colon", "usedeviceparam"}, required="ro")
public TokenFactory colonusedeviceparam;
@Sequence(value={"expr", "colonusedeviceparam", "colonusedeviceparam"}, required="roo")
public TokenFactory cmduarg;
@List(value="cmduarg", delim="comma")
public TokenFactory cmduargs;
@Sequence(value={"label", "lineoffset"}, required="ro")
public TokenFactory labelwoffset;
@Choice({"rindirection", "labelwoffset"})
public TokenFactory entryspec_0;
@Sequence(value={"entryspec_0", "routinespec", "actuallist", "colonusedeviceparam", "timeout"}, required="ooooo")
public TokenFactory cmdjarg;
@Sequence(value={"colon", "usedeviceparam"}, required="ro")
public TokenFactory jobparams;
@List(value="cmdjarg", delim="comma")
public TokenFactory cmdjargs;
@Sequence(value={"labelpiece", "lineoffset", "doroutinef", "actuallist"}, required="oooo")
public TokenFactory extrinsicarg;
@TokenType(TExtDoArgument.class)
@Rule("'&', name, ['.', name], ['^', name], [actuallist], [postcondition]")
public TokenFactory extdoargument;
@TokenType(TDoArgument.class)
@Rule("rindirection, [dolineoffset], [doroutinef], [postcondition]")
public TokenFactory inddoargument;
@TokenType(TDoArgument.class)
@Rule("label, dolineoffset, [doroutinef], [postcondition]")
public TokenFactory offsetdoargument;
//@TokenType(TDoArgument.class)
//@Rule("label, ['^', doroutinepostcaret], [actuallist], [postcondition]")
//public TokenFactory doargument;
@TokenType(TDoArgument.class)
@Rule("label, ['^', doroutinepostcaret], [actuallist], [postcondition]")
public TokenFactory doargument;
@TokenType(TDoArgument.class)
@Rule("'^', noindroutinepostcaret, [actuallist], [postcondition]")
public TokenFactory onlyrsimpledoargument;
@TokenType(TDoArgument.class)
@Rule("'^', indirection, [postcondition]")
public TokenFactory onlyrdoargument;
@Rule("extdoargument | inddoargument | offsetdoargument | doargument | onlyrsimpledoargument | onlyrdoargument")
public TokenFactory doargumentall;
@List(value="doargumentall", delim="comma")
public TokenFactory doarguments;
@Rule("environment, name")
public TokenFactory envdoroutine;
@Rule("name")
public TokenFactory doroutine;
@Rule("envdoroutine | doroutine")
public TokenFactory noindroutinepostcaret;
@Rule("rindirection")
public TokenFactory inddoroutine;
@Rule("envdoroutine | doroutine | inddoroutine")
public TokenFactory doroutinepostcaret;
@Rule("'^', doroutinepostcaret")
public TokenFactory doroutinef;
@Rule("'+', expr")
public TokenFactory dolineoffset;
@Choice(value={"indirection", "label"})
public TokenFactory labelpiece;
@Choice(value={"indirection", "intrinsic", "glvn"})
public TokenFactory setlhsbasic;
@List(value="setlhsbasic", delim="comma", left="lpar", right="rpar")
public TokenFactory setlhsbasics;
@Choice(value={"setlhsbasics", "setlhsbasic"})
public TokenFactory setlhs;
@Rule("expr")
public TokenFactory setrhs;
@Sequence(value={"setlhs", "eq", "setrhs"}, required="all")
public TokenFactory setarg_direct;
@Sequence(value={"indirection", "eq", "setrhs"}, required="roo")
public TokenFactory setarg_indirect;
@Choice(value={"setarg_indirect", "setarg_direct"})
public TokenFactory setarg;
@List(value="setarg", delim="comma")
public TokenFactory setargs;
@Sequence(value={"colon", "deviceparams"}, required="all")
public TokenFactory closearg_dp;
@Sequence(value={"expr", "closearg_dp"}, required="ro")
public TokenFactory closearg_direct;
@Choice(value={"indirection", "closearg_direct"})
public TokenFactory closearg;
@List(value="closearg", delim="comma")
public TokenFactory closeargs;
@Sequence(value={"colon", "expr"}, required="all")
public TokenFactory cexpr;
@Sequence(value={"expr", "cexpr", "cexpr"}, required="roo")
public TokenFactory forrhs;
@List(value="forrhs", delim="comma")
public TokenFactory forrhss;
@Sequence(value={"lvn", "eq", "forrhss"}, required="all")
public TokenFactory forarg;
@Rule("gvn | indirection | lvn")
public TokenFactory lockee_single;
@List(value="lockee", delim="comma", left="lpar", right="rpar")
public TokenFactory lockee_list;
@Choice({"lockee_single", "lockee_list"})
public TokenFactory lockee;
@Sequence(value={"pm", "lockee", "timeout"}, required="oro")
public TokenFactory lockarg;
@List(value="lockarg", delim="comma")
public TokenFactory lockargs;
@List(value="lvn", delim="comma", left="lpar", right="rpar")
public TokenFactory lvns;
@Rule("lvns | indirection | intrinsic | name")
public TokenFactory newarg;
@List(value="newarg", delim="comma")
public TokenFactory newargs;
@Sequence(value={"dot", "name"}, required="all")
public TokenFactory dname;
@Sequence(value={"caret", "name"}, required="all")
public TokenFactory cname;
@Sequence(value={"name", "dname", "cname"}, required="roo")
public TokenFactory ampersandtail;
@WordSpecified("$&")
public TokenFactory dolamp;
@Sequence(value={"dolamp", "ampersandtail", "actuallist"}, required="roo")
public TokenFactory external;
@Sequence(value={"comma", "expr"}, required="all")
public TokenFactory dorderarg_1;
@Sequence(value={"glvn", "dorderarg_1"}, required="ro")
public TokenFactory dorderarg;
@Choice({"indirection", "expr"})
public TokenFactory xecutearg_main;
@Sequence(value={"xecutearg_main", "postcondition"}, required="ro")
public TokenFactory xecutearg;
@List(value="xecutearg", delim="comma")
public TokenFactory xecuteargs;
@Sequence(value={"slash", "name", "actuallist"}, required="all")
public TokenFactory writeargslash;
@Rule("format | writeargslash | asterixexpr | indirection | expr")
public TokenFactory writearg;
@List(value="writearg", delim="comma")
public TokenFactory writeargs;
@List(value="name", delim="comma", left="lpar", right="rpar", none=true)
public TokenFactory lineformal;
@Sequence(value={"dollar", "ident"}, required="all")
public TokenFactory intrinsicname;
@Choice({"spaces", "comment", "end"})
public TokenFactory commandend;
public TFCommand command = new TFCommand("command", this);
@CharSpecified(excludechars={'\r', '\n'})
public TokenFactory commentcontent;
@TokenType(TComment.class)
@Sequence(value={"semicolon", "commentcontent"}, required="ro")
public TokenFactory comment;
@Rule("command | comment | error")
public TokenFactory commandorcomment;
@List(value="commandorcomment")
public TokenFactory commandorcommentlist;
@CharSpecified(chars={' ', '\t'})
public TokenFactory ls;
@CharSpecified(chars={' ', '.'})
public TokenFactory level;
@TokenType(TLine.class)
@Sequence({"label", "lineformal", "ls", "level", "commandorcommentlist"})
public TokenFactory line;
public TFIntrinsic intrinsic = new TFIntrinsic("intrinsic", this);
protected void initialize() {
this.intrinsic.addVariable("D", "DEVICE");
this.intrinsic.addVariable("EC", "ECODE");
this.intrinsic.addVariable("ES", "ESTACK");
this.intrinsic.addVariable("ET", "ETRAP");
this.intrinsic.addVariable("H", "HOROLOG");
this.intrinsic.addVariable("I", "IO");
this.intrinsic.addVariable("J", "JOB");
this.intrinsic.addVariable("K", "KEY");
this.intrinsic.addVariable("PD", "PDISPLAY");
this.intrinsic.addVariable("P", "PRINCIPAL");
this.intrinsic.addVariable("Q", "QUIT");
this.intrinsic.addVariable("S", "STORAGE");
this.intrinsic.addVariable("ST", "STACK");
this.intrinsic.addVariable("SY", "SYSTEM");
this.intrinsic.addVariable("T", "TEST");
this.intrinsic.addVariable("X", "X");
this.intrinsic.addVariable("Y", "Y");
this.intrinsic.addFunction(this.exprlist, "A", "ASCII", 1, 2);
this.intrinsic.addFunction(this.exprlist, "C", "CHAR", 1, 999);
this.intrinsic.addFunction(this.exprlist, "D", "DATA", 1, 1);
this.intrinsic.addFunction(this.exprlist, "E", "EXTRACT", 1, 3);
this.intrinsic.addFunction(this.exprlist, "F", "FIND", 2, 3);
this.intrinsic.addFunction(this.exprlist, "G", "GET", 1, 2);
this.intrinsic.addFunction(this.exprlist, "I", "INCREMENT", 1, 2);
this.intrinsic.addFunction(this.exprlist, "J", "JUSTIFY", 2, 3);
this.intrinsic.addFunction(this.exprlist, "L", "LENGTH", 1, 2);
this.intrinsic.addFunction(this.dorderarg, "O", "ORDER", 1, 2);
this.intrinsic.addFunction(this.exprlist, "P", "PIECE", 2, 4);
this.intrinsic.addFunction(this.exprlist, "Q", "QUERY", 1, 1);
this.intrinsic.addFunction(this.exprlist, "R", "RANDOM", 1, 1);
this.intrinsic.addFunction(this.exprlist, "RE", "REVERSE", 1, 1);
this.intrinsic.addFunction(this.dselectarg, "S", "SELECT", 1, 999);
this.intrinsic.addFunction(this.cmdgargmain, "T", "TEXT", 1, 1);
this.intrinsic.addFunction(this.exprlist, "V", "VIEW", 1, 999);
this.intrinsic.addFunction(this.exprlist, "FN", "FNUMBER", 2, 3);
this.intrinsic.addFunction(this.exprlist, "N", "NEXT", 1, 2);
this.intrinsic.addFunction(this.exprlist, "NA", "NAME", 1, 2);
this.intrinsic.addFunction(this.exprlist, "Q", "QUERY", 1, 2);
this.intrinsic.addFunction(this.exprlist, "QL", "QLENGTH", 1, 2);
this.intrinsic.addFunction(this.exprlist, "QS", "QSUBSCRIPT", 1, 3);
this.intrinsic.addFunction(this.exprlist, "ST", "STACK", 1, 2);
this.intrinsic.addFunction(this.exprlist, "TR", "TRANSLATE", 1, 3);
this.intrinsic.addFunction(this.exprlist, "WFONT", 4, 4);
this.intrinsic.addFunction(this.exprlist, "WTFIT", 6, 6);
this.intrinsic.addFunction(this.exprlist, "WTWIDTH", 5, 5);
this.intrinsic.addVariable("ZA");
this.intrinsic.addVariable("ZB");
this.intrinsic.addVariable("ZC");
this.intrinsic.addVariable("ZE");
this.intrinsic.addVariable("ZH");
this.intrinsic.addVariable("ZJ");
this.intrinsic.addVariable("ZJOB");
this.intrinsic.addVariable("ZR");
this.intrinsic.addVariable("ZT");
this.intrinsic.addVariable("ZV");
this.intrinsic.addVariable("ZIO");
this.intrinsic.addVariable("ZIOS");
this.intrinsic.addVariable("ZVER");
this.intrinsic.addVariable("ZEOF");
this.intrinsic.addVariable("ZNSPACE");
this.intrinsic.addVariable("ZINTERRUPT");
this.intrinsic.addVariable("ZRO");
this.intrinsic.addVariable("R");
this.intrinsic.addVariable("EREF");
this.intrinsic.addVariable("ZDIR");
this.intrinsic.addVariable("ZS");
this.intrinsic.addVariable("ZROUTINES");
this.intrinsic.addVariable("ZGBLDIR");
this.intrinsic.addVariable("ZN");
this.intrinsic.addVariable("ZSTATUS");
this.intrinsic.addVariable("REFERENCE");
this.intrinsic.addVariable("ETRAP");
this.intrinsic.addVariable("ZTIMESTAMP");
this.intrinsic.addVariable("ZERROR");
this.intrinsic.addVariable("ZCMDLINE");
this.intrinsic.addVariable("ZPOSITION");
this.intrinsic.addFunction(this.exprlist, "ZBITGET");
this.intrinsic.addFunction(this.exprlist, "ZBN");
this.intrinsic.addFunction(this.exprlist, "ZC");
this.intrinsic.addFunction(this.exprlist, "ZF");
this.intrinsic.addFunction(this.exprlist, "ZJ");
this.intrinsic.addFunction(this.exprlist, "ZU");
this.intrinsic.addFunction(this.exprlist, "ZUTIL");
this.intrinsic.addFunction(this.exprlist, "ZTRNLNM");
this.intrinsic.addFunction(this.exprlist, "ZBOOLEAN");
this.intrinsic.addFunction(this.exprlist, "ZDEV");
this.intrinsic.addFunction(this.exprlist, "ZGETDV");
this.intrinsic.addFunction(this.exprlist, "ZSORT");
this.intrinsic.addFunction(this.exprlist, "ZESCAPE");
this.intrinsic.addFunction(this.exprlist, "ZSEARCH");
this.intrinsic.addFunction(this.exprlist, "ZPARSE");
this.intrinsic.addFunction(this.exprlist, "ZCONVERT");
this.intrinsic.addFunction(this.exprlist, "ZDVI");
this.intrinsic.addFunction(this.exprlist, "ZGETDVI");
this.intrinsic.addFunction(this.exprlist, "ZOS");
this.intrinsic.addFunction(this.exprlist, "ZINTERRUPT");
this.intrinsic.addFunction(this.exprlist, "ZJOB");
this.intrinsic.addFunction(this.exprlist, "ZBITSTR");
this.intrinsic.addFunction(this.exprlist, "ZBITXOR");
this.intrinsic.addFunction(this.exprlist, "LISTGET");
this.intrinsic.addFunction(this.exprlist, "ZDEVSPEED");
this.intrinsic.addFunction(this.exprlist, "ZGETJPI");
this.intrinsic.addFunction(this.exprlist, "ZGETSYI");
this.intrinsic.addFunction(this.exprlist, "ZUTIL");
this.intrinsic.addFunction(this.exprlist, "ZK");
this.intrinsic.addFunction(this.exprlist, "ZWA");
this.intrinsic.addFunction(this.exprlist, "ZVERSION");
this.command.addCommands(this);
this.command.addCommand("ZB", this);
this.command.addCommand("ZS", this);
this.command.addCommand("ZC", this);
this.command.addCommand("ZR", this);
this.command.addCommand("ZI", this);
this.command.addCommand("ZQ", this);
this.command.addCommand("ZT", this);
this.command.addCommand("ZU", this);
this.command.addCommand("ZSHOW", this);
this.command.addCommand("ZNSPACE", this);
this.command.addCommand("ZETRAP", this);
this.command.addCommand("ESTART", this);
this.command.addCommand("ESTOP", this);
this.command.addCommand("ABORT", this);
this.command.addCommand("ZRELPAGE", this);
this.command.addCommand("ZSYSTEM", this);
this.command.addCommand("ZLINK", this);
this.command.addCommand("ZESCAPE", this);
this.command.addCommand("ZITRAP", this);
this.command.addCommand("ZGETPAGE", this);
String[] ops = {
"-", "+", "_", "*", "/", "#", "\\", "**",
"&", "!", "=", "<", ">", "[", "]", "?", "]]",
"'&", "'!", "'=", "'<", "'>", "'[", "']", "'?", "']]"};
for (String op : ops) {
this.operator.addOperator(op);
}
}
public static class CacheSupply extends MTFSupply {
@Choice({"glvn", "expritem", "classmethod"})
public TokenFactory expratom;
@TokenType(TObjectExpr.class)
@Rule("name, '.', {name:'.'}, [actuallist]")
public TokenFactory objectexpr;
@Rule("objectexpr | lvn | gvnall | indirection")
public TokenFactory glvn;
@Choice({"expratom", "classmethod"})
public TokenFactory expr_0;
@Sequence(value={"expr_0", "exprtail"}, required="ro")
public TokenFactory expr;
@WordSpecified("##class")
public TokenFactory ppclass;
@Sequence(value={"dot", "name"}, required="all")
public TokenFactory classreftail;
@List("classreftail")
public TokenFactory classreftaillst;
@Sequence(value={"name", "classreftaillst"}, required="ro")
public TokenFactory classref;
@Sequence(value={"ppclass", "lpar", "classref", "rpar", "dot", "name", "actuallist"}, required="all")
public TokenFactory classmethod;
@WordSpecified(value="$SYSTEM", ignorecase=true)
public TokenFactory system;
@Sequence(value={"dot", "name"}, required="all")
public TokenFactory method;
@List(value="method")
public TokenFactory methods;
@Sequence(value={"system", "methods", "actuallist"}, required="ror")
public TokenFactory systemcall;
@Rule("label, method, [dolineoffset], [doroutinef], [actuallist], [postcondition]")
public TokenFactory objdoargument;
@Rule("classmethod, [dolineoffset], [doroutinef], [actuallist], [postcondition]")
public TokenFactory clsdoargument;
@Rule("systemcall, [dolineoffset], [doroutinef], [actuallist], [postcondition]")
public TokenFactory sysdoargument;
@Rule("objdoargument | extdoargument | inddoargument | offsetdoargument | doargument | onlyrsimpledoargument | onlyrdoargument | clsdoargument | sysdoargument")
public TokenFactory doargumentall;
@Rule("name, method")
public TokenFactory objdoroutine;
@Rule("envdoroutine | objdoroutine | doroutine | inddoroutine")
public TokenFactory doroutinepostcaret;
@Rule("classmethod | expr")
public TokenFactory setrhs;
@Rule("expr, ',', {([expr], [':', expr]):','}")
public TokenFactory dcasearg;
@List(value="actual", delim="comma")
public TokenFactory dsystemarg;
@Sequence(value={"dollar", "ident", "methods"}, required="rro")
public TokenFactory intrinsicname;
@Override
protected void initialize() {
super.initialize();
this.intrinsic.addFunction(this.dcasearg, "CASE", 1, Integer.MAX_VALUE);
this.intrinsic.addFunction(this.dsystemarg, "SYS", "SYSTEM", 0, Integer.MAX_VALUE);
this.operator.addOperator(">=");
this.operator.addOperator("<=");
this.operator.addOperator("&&");
this.operator.addOperator("||");
}
}
private static MTFSupply CACHE_SUPPLY;
private static MTFSupply STD_95_SUPPLY;
private static MTFSupply generateSupply(Class<? extends MTFSupply> cls) throws ParseException {
AdapterSupply as = new MAdapterSupply();
Parser parser = new Parser();
MTFSupply result = parser.parse(cls, as);
result.initialize();
return result;
}
public static MTFSupply getInstance(MVersion version) throws ParseException {
switch (version) {
case CACHE: {
if (CACHE_SUPPLY == null) {
CACHE_SUPPLY = generateSupply(CacheSupply.class);
}
return CACHE_SUPPLY;
}
case ANSI_STD_95: {
if (STD_95_SUPPLY == null) {
STD_95_SUPPLY = generateSupply(MTFSupply.class);
}
return STD_95_SUPPLY;
}
default:
throw new IllegalArgumentException("Unknown M version");
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
3acf07d308ae9fdaf255bd407e254bf47dcbe9d5 | 40aa1e35de323834e28db4bbb2267c7bd20db3b9 | /src/main/java/com/choa/file/Download.java | 7c702945152baa17273b6922842aa9e897b957e2 | [] | no_license | hongyukyeong/ex6 | b06f61f47635f9ea0dd657af2ed0c340ef0999db | d4b6484f55387cd2488bda96841a7f9d6d4a1f60 | refs/heads/master | 2021-01-13T05:37:27.177746 | 2017-06-28T09:55:24 | 2017-06-28T09:55:24 | 95,113,472 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,492 | java | package com.choa.file;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.servlet.view.AbstractView;
public class Download extends AbstractView {
//일반 클래스가 아닌 View 역할을 해야함
public Download() {
setContentType("application/download;charser=URF-8");
}
@Override
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response)
throws Exception {
File f = (File)model.get("downloadFile");
String oriName = (String)model.get("oriName");
response.setCharacterEncoding(getContentType());
response.setContentLength((int)f.length());
//String fileName = URLEncoder.encode(f.getName(), "UTF-8");
String fileName = URLEncoder.encode(f.getName(), "UTF-8");
fileName = fileName.substring(fileName.lastIndexOf("_")+1); //fileName을 쓰고 싶으면 바로 밑에 fileName으로 바꿔준다
response.setHeader("Content-Disposition", "attachment;filename=\""+oriName+"\"");
response.setHeader("Content-Transfer-Encoding", "binary");
OutputStream out = response.getOutputStream();
FileInputStream fi = null;
fi = new FileInputStream(f);
FileCopyUtils.copy(fi, out);
fi.close();
out.close();
}
}
| [
"dbrud1336@gmail.com"
] | dbrud1336@gmail.com |
407e8fdc85321073e501321a3caf83e073dae4c9 | 6faa200b968936ce70947d077514b3d2471fab67 | /src/main/java/com/bestpractice/api/common/util/Util.java | a08ff6ed7bb0ed92348a16f868607499e4501015 | [
"MIT"
] | permissive | tanbinh123/springboot-bestpractice | d186adaeffcbb9a386531c07dbcf49d498c13763 | 9b2250b36ed86cfd0ebdf82c24715972c8532bbc | refs/heads/master | 2023-07-12T09:29:19.257002 | 2021-08-09T15:05:04 | 2021-08-09T15:05:04 | 477,728,219 | 1 | 0 | MIT | 2022-04-04T14:05:39 | 2022-04-04T14:05:38 | null | UTF-8 | Java | false | false | 377 | java | package com.bestpractice.api.common.util;
import java.util.Calendar;
import java.util.Date;
public class Util {
public static Date calculateDate() {
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.YEAR, 1);
date = calendar.getTime();
return date;
}
}
| [
"tohito0430@gmail.com"
] | tohito0430@gmail.com |
e82218aec5be605011436cb25da4f693015c1913 | 90736d070391ed2c60cd8a98a54523e5b483e984 | /src/main/java/searchfeature/SearchByPlacement.java | c9b80d6cb276c18ea6d5588d7c4d292bd808d8b8 | [] | no_license | Abdelrahmanba/SoftwareEng | 339ef4ff6819099f02dc6649efcb8dbba0cfc3f0 | 23296b57c54af4895dee0a8737af41208556db22 | refs/heads/main | 2023-02-23T00:16:45.933066 | 2021-01-23T17:23:22 | 2021-01-23T17:23:22 | 332,266,592 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package searchfeature;
import mainclasses.Home;
import java.util.ArrayList;
import java.util.List;
public class SearchByPlacement implements SearchInterface {
ArrayList<Home> byPlacement;
String placement;
public SearchByPlacement(String condition) {
this.placement = condition;
byPlacement = new ArrayList<>();
}
public List<Home> search(List<Home> homeList) {
for (Home home : homeList)
if (home.getPlacement().equals(placement)) {
byPlacement.add(home);
}
return byPlacement;
}
}
| [
"babaa.abd@gmail.com"
] | babaa.abd@gmail.com |
6ef8ee1acaa2d1b9f3ae229d28502fe89d195ff7 | bd316d1979f6b8de309e8ccaff9ed26a99d87951 | /gen/nl/hannahsten/texifyidea/psi/LatexGreedyContent.java | cbb2036d0d58f4cf7c6ab5af67defb96791ba845 | [
"MIT"
] | permissive | fberlakovich/TeXiFy-IDEA | 7273ac61ee1c0ac1d4569de47a95b396fc6f91b0 | dd4216fca4616f145f89b6760343001ce5a6cdb7 | refs/heads/master | 2022-09-01T14:16:42.471322 | 2022-08-03T18:44:31 | 2022-08-03T18:44:31 | 229,038,336 | 0 | 0 | MIT | 2019-12-19T11:14:41 | 2019-12-19T11:14:40 | null | UTF-8 | Java | false | true | 310 | java | // This is a generated file. Not intended for manual editing.
package nl.hannahsten.texifyidea.psi;
import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;
public interface LatexGreedyContent extends PsiElement {
@NotNull
LatexNoMathContent getNoMathContent();
}
| [
"felix@berlakovich.at"
] | felix@berlakovich.at |
4b883f339e79d56bda35980ecfa6634c2e7f0a4e | 902dfd8fd41b1e570d7f9d5a3ff2594833b21321 | /src/main/java/org/example/netty/NettyClient.java | 881dfbfa508a272b1fb0188583aefbc080a0d8a0 | [] | no_license | zxhjames/RpcLearn | ae61d23ab0d2fafc850082f5560bc4cf8b42026d | 03f043b2798b55ef40d5e422dd180bae7c24303d | refs/heads/master | 2023-01-02T01:37:26.081991 | 2020-10-30T07:56:46 | 2020-10-30T07:56:46 | 308,561,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,474 | java | package org.example.netty;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
public class NettyClient {
public static void main(String[] args) throws InterruptedException {
//客户端需要一个事件循环组
NioEventLoopGroup eventExecutors = new NioEventLoopGroup();
//创建客户端的启动对象
try {
Bootstrap bootstrap = new Bootstrap();
//设置相关参数
bootstrap.group(eventExecutors). //设置线程组
channel(NioSocketChannel.class). //设置客户端通道实现类
handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
ch.pipeline().addLast(new NettyClientHandler()); //加入自己的处理器
}
});
System.out.println("客户端 ok...");
//启动客户端去连接服务器,这里涉及到netty的异步模型
ChannelFuture channelFuture = bootstrap.connect("127.0.0.1", 6668).sync();
channelFuture.channel().closeFuture().sync();
}finally {
eventExecutors.shutdownGracefully();
}
}
}
| [
"1849483422@qq.com"
] | 1849483422@qq.com |
ce27391d57c7d84f84459b61dde6c05b6766a161 | 37d089840e838dfa880c18bde7a87cba55c664e5 | /app/controllers/helpers/RequestHelper.java | f6147e6519ba7dab4bc76e8f00f7481dd3aa8af1 | [
"Apache-2.0"
] | permissive | bttalic/sample_play | 0728929b2b6bd4c8d0f4234176b9d85b3f32397a | 7311e82a988626a86e8ef2a7129449ce5d6396d2 | refs/heads/master | 2020-06-04T20:42:55.197445 | 2015-09-15T21:35:14 | 2015-09-15T21:35:14 | 42,532,700 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package controllers.helpers;
import play.mvc.Http;
/**
* Created by benjamin on 14/09/15.
*/
public class RequestHelper {
public static boolean isAjax() {
Http.Request request = Http.Context.current().request();
if (request.getHeader("X-Requested-With") != null) {
return true;
}
return false;
}
}
| [
"b.ttalic@gmail.com"
] | b.ttalic@gmail.com |
ef625b13f2aaaa45a8c781a89af3fc1b9df09b0d | 757c00a749b365a5e7862c21eb38c89135b3c723 | /src/main/java/com/demo/gener/entity/test/UserDetailsEntity.java | 66bf66740932185d5c2585a3ee949f41f4274e52 | [] | no_license | yangyp8110/springboot_database_access_demo | 04bac3828c150f2cc77d3b694dd27f1993b985cd | ad1954bc88f701267fb9a7a15799e9e56de89536 | refs/heads/master | 2020-03-30T18:47:46.687254 | 2018-10-04T06:03:25 | 2018-10-04T06:03:25 | 151,514,711 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 571 | java | package com.demo.gener.entity.test;
import lombok.Getter;
import lombok.Setter;
/**
* @author mr.yang.demo
* @date - 2018/09/19
*/
@Getter
@Setter
public class UserDetailsEntity {
/**
* 主键
*/
private Long id;
/**
* 用户id
*/
private Long uid;
/**
* 用户昵称
*/
private String nickName;
/**
* 用户描述
*/
private String userDesc;
/**
* 新增时间
*/
private java.util.Date inserttime;
/**
* 修改时间
*/
private java.util.Date updatetime;
} | [
"443148514@qq.com"
] | 443148514@qq.com |
4374df79d488ad47700a21a94914766964567211 | bfe71904028a7e932da0e533cadfb397208a6155 | /app/src/main/java/edu/niit/ydkf/grand_prix/common/utils/CustomDialog.java | 964b0032a6e1c2e9f37823a1cef359e9cec74698 | [] | no_license | xiashilin/Grand_prix | fec0d966b0dea0f6a53ded815db8adf21473bf5b | 2921c9e206d3e517148bc76e2399d67da9762665 | refs/heads/master | 2021-01-19T19:09:32.850120 | 2017-04-16T08:43:31 | 2017-04-16T08:43:31 | 88,401,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,501 | java | package edu.niit.ydkf.grand_prix.common.utils;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import edu.niit.ydkf.grand_prix.R;
/**
* Created by hp on 2016/3/23.
*/
public class CustomDialog extends Dialog {
public CustomDialog(Context context) {
super(context);
}
public CustomDialog(Context context, int theme) {
super(context, theme);
}
public static class Builder {
private Context context;
private String title;
private String message;
private String message2;
private String positiveButtonText;
private String negativeButtonText;
private View contentView;
private OnClickListener positiveButtonClickListener;
private OnClickListener negativeButtonClickListener;
private View layout;
public Builder(Context context) {
this.context = context;
}
public Builder setMessage(String message) {
this.message = message;
return this;
}
public Builder setMessage2(String message2) {
this.message2 = message2;
return this;
}
/**
* Set the Dialog message from resource
*
* @param
* @return
*/
public Builder setMessage(int message) {
this.message = (String) context.getText(message);
return this;
}
/**
* Set the Dialog title from resource
*
* @param title
* @return
*/
public Builder setTitle(int title) {
this.title = (String) context.getText(title);
return this;
}
/**
* Set the Dialog title from String
*
* @param title
* @return
*/
public Builder setTitle(String title) {
this.title = title;
return this;
}
public Builder setContentView(View v) {
this.contentView = v;
return this;
}
public Builder setView(View v) {
this.layout = v;
return this;
}
/**
* Set the positive button resource and it's listener
*
* @param positiveButtonText
* @return
*/
public Builder setPositiveButton(int positiveButtonText,
OnClickListener listener) {
this.positiveButtonText = (String) context
.getText(positiveButtonText);
this.positiveButtonClickListener = listener;
return this;
}
public Builder setPositiveButton(String positiveButtonText,
OnClickListener listener) {
this.positiveButtonText = positiveButtonText;
this.positiveButtonClickListener = listener;
return this;
}
public Builder setNegativeButton(int negativeButtonText,
OnClickListener listener) {
this.negativeButtonText = (String) context
.getText(negativeButtonText);
this.negativeButtonClickListener = listener;
return this;
}
public Builder setNegativeButton(String negativeButtonText,
OnClickListener listener) {
this.negativeButtonText = negativeButtonText;
this.negativeButtonClickListener = listener;
return this;
}
public CustomDialog create() {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// instantiate the dialog with the custom Theme
final CustomDialog dialog = new CustomDialog(context, R.style.Dialog);
if (layout == null) {
layout = inflater.inflate(R.layout.dialog_style, null);
}
dialog.addContentView(layout, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
// set the dialog title
((TextView) layout.findViewById(R.id.title)).setText(title);
// set the confirm button
if (positiveButtonText != null) {
((Button) layout.findViewById(R.id.positiveButton))
.setText(positiveButtonText);
if (positiveButtonClickListener != null) {
((Button) layout.findViewById(R.id.positiveButton))
.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
positiveButtonClickListener.onClick(dialog,
DialogInterface.BUTTON_POSITIVE);
}
});
}
} else {
// if no confirm button just set the visibility to GONE
layout.findViewById(R.id.positiveButton).setVisibility(
View.GONE);
}
// set the cancel button
if (negativeButtonText != null) {
((Button) layout.findViewById(R.id.negativeButton))
.setText(negativeButtonText);
if (negativeButtonClickListener != null) {
((Button) layout.findViewById(R.id.negativeButton))
.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
negativeButtonClickListener.onClick(dialog,
DialogInterface.BUTTON_NEGATIVE);
}
});
}
} else {
// if no confirm button just set the visibility to GONE
layout.findViewById(R.id.negativeButton).setVisibility(
View.GONE);
}
// set the content message
if (message != null) {
((TextView) layout.findViewById(R.id.message)).setText(message);
} else if (contentView != null) {
// if no message set
// add the contentView to the dialog body
((LinearLayout) layout.findViewById(R.id.content))
.removeAllViews();
((LinearLayout) layout.findViewById(R.id.content))
.addView(contentView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
}
dialog.setContentView(layout);
return dialog;
}
public CustomDialog create2() {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// instantiate the dialog with the custom Theme
final CustomDialog dialog = new CustomDialog(context, R.style.Dialog);
if (layout == null) {
layout = inflater.inflate(R.layout.dialog_style_twoline, null);
}
dialog.addContentView(layout, new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
// set the dialog title
((TextView) layout.findViewById(R.id.title)).setText(title);
// set the confirm button
if (positiveButtonText != null) {
((Button) layout.findViewById(R.id.positiveButton))
.setText(positiveButtonText);
if (positiveButtonClickListener != null) {
((Button) layout.findViewById(R.id.positiveButton))
.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
positiveButtonClickListener.onClick(dialog,
DialogInterface.BUTTON_POSITIVE);
}
});
}
} else {
// if no confirm button just set the visibility to GONE
layout.findViewById(R.id.positiveButton).setVisibility(
View.GONE);
}
// set the cancel button
if (negativeButtonText != null) {
((Button) layout.findViewById(R.id.negativeButton))
.setText(negativeButtonText);
if (negativeButtonClickListener != null) {
((Button) layout.findViewById(R.id.negativeButton))
.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
negativeButtonClickListener.onClick(dialog,
DialogInterface.BUTTON_NEGATIVE);
}
});
}
} else {
// if no confirm button just set the visibility to GONE
layout.findViewById(R.id.negativeButton).setVisibility(
View.GONE);
}
// set the content message
if (message != null) {
((EditText) layout.findViewById(R.id.message)).setHint(message);
}
if (message2 != null) ((EditText) layout.findViewById(R.id.message2)).setHint(message2);
else if (contentView != null) {
// if no message set
// add the contentView to the dialog body
((LinearLayout) layout.findViewById(R.id.content))
.removeAllViews();
((LinearLayout) layout.findViewById(R.id.content))
.addView(contentView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
}
dialog.setContentView(layout);
return dialog;
}
}
}
| [
"1479714932@qq.com"
] | 1479714932@qq.com |
000979b78d6b613b138361f1d6474826fac85f95 | 4b0b0542d0ba5b63054d98690fd12c4ba3bb27b1 | /spoj/testing/src/main/java/com/spoj/mitemitreski/mitemitreski/ILD18MSM/Main.java | 991e6942bc503583629edd6d4618030692c1f797 | [] | no_license | mitemitreski/Various-Book-Solutions | 5e9fc96840edbf40fb5adc23e7b926dbfa2288b3 | 46b2d4e498b6a58ebea9a4fd00a1d179af187ec8 | refs/heads/master | 2023-01-31T13:09:43.665581 | 2023-01-14T23:52:48 | 2023-01-14T23:52:48 | 1,094,720 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,343 | java | package com.spoj.mitemitreski.mitemitreski.ILD18MSM;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Input:
aab
baa
Output:
1
Input:
aaaaabaaa
aaaaaabaa
Output:
1
Input:
aabaaaaa
aaaaaabaa
Output:
1
Input:
baaaaaaa
aaaaaaab
Output:
1
Input:
baaaaaaa
aaaaaaba
Output:
2
*/
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String a = r.readLine();
String b = r.readLine();
if (a.equals(b)) {
System.out.println(0);
return;
}
int output = caluclateNumbeOfMoves(a, b);
System.out.println(output);
}
public static int caluclateNumbeOfMoves(String a, String b) {
int numberOfMoves = 0;
for (int i = 0; i < a.length(); i++) {
int j = i;
int countMoves = 0;
while (j < b.length() && a.charAt(i) != b.charAt(j)) {
j++;
countMoves++;
}
if (countMoves > a.length() / 2) {
countMoves = a.length() / 2;
}
numberOfMoves += countMoves;
}
throw new RuntimeException("not solved");
// int output = numberOfMoves / 2;
// return output;
}
}
| [
"mite.mitreski@gmail.com"
] | mite.mitreski@gmail.com |
34a338d4ccc669877f862ae11ab45f350ff93abe | 344c1591fdb0f55957c000ea1ef91ec7abee1065 | /src/com/timliu/security/asymmetric_encryption/ElGamalTest.java | 56aa74469b774682a123fd5098a1f4c03344de3b | [
"MIT"
] | permissive | jquanlee/java_security | 32bcb95216cb80a62c9390885a453afd6bdfa51b | daf8d190e1e907214e61e934aecd8a37e383fe78 | refs/heads/master | 2021-01-21T11:00:05.502908 | 2015-11-29T11:58:59 | 2015-11-29T11:58:59 | 83,511,935 | 2 | 1 | null | 2017-03-01T04:35:53 | 2017-03-01T04:35:53 | null | UTF-8 | Java | false | false | 5,608 | java | package com.timliu.security.asymmetric_encryption;
import java.security.AlgorithmParameterGenerator;
import java.security.AlgorithmParameters;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.Security;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import javax.crypto.Cipher;
import javax.crypto.spec.DHParameterSpec;
import org.apache.commons.codec.binary.Base64;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
public class ElGamalTest {
public static final String src = "Elgamal test";
public static void main(String[] args)
{
jdkElgamal();
}
/**
*
* 对于:“Illegal key size or default parameters”异常,是因为美国的出口限制,Sun通过权限文件(local_policy.jar、US_export_policy.jar)做了相应限制。因此存在一些问题:
* Java 6 无政策限制文件:http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
* Java 7 无政策限制文件:http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
* 我的时java7,自己安装的。
* /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib/security目录下,对应覆盖local_policy.jar和US_export_policy.jar两个文件。
*
* 切换到%JDK_Home%\jre\lib\security目录下,对应覆盖local_policy.jar和US_export_policy.jar两个文件。同时,你可能有必要在%JRE_Home%\lib\security目录下,也需要对应覆盖这两个文件。
*/
// jdk实现:“私钥解密、公钥加密” , 对于:“私钥加密、公钥解密”有问题,因为Elgamal不支持
public static void jdkElgamal()
{
try
{
// 加入对BouncyCastle支持
Security.addProvider(new BouncyCastleProvider());
// 1.初始化发送方密钥
AlgorithmParameterGenerator algorithmParameterGenerator = AlgorithmParameterGenerator.getInstance("Elgamal");
// 初始化参数生成器
algorithmParameterGenerator.init(256);
// 生成算法参数
AlgorithmParameters algorithmParameters = algorithmParameterGenerator.generateParameters();
// 构建参数材料
DHParameterSpec dhParameterSpec = (DHParameterSpec)algorithmParameters.getParameterSpec(DHParameterSpec.class);
// 实例化密钥生成器
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("Elgamal");
// 初始化密钥对生成器
keyPairGenerator.initialize(dhParameterSpec, new SecureRandom());
KeyPair keyPair = keyPairGenerator.generateKeyPair();
// 公钥
PublicKey elGamalPublicKey = keyPair.getPublic();
// 私钥
PrivateKey elGamalPrivateKey = keyPair.getPrivate();
System.out.println("Public Key:" + Base64.encodeBase64String(elGamalPublicKey.getEncoded()));
System.out.println("Private Key:" + Base64.encodeBase64String(elGamalPrivateKey.getEncoded()));
// 2.私钥解密、公钥加密 ---- 加密
// 初始化公钥
// 密钥材料转换
X509EncodedKeySpec x509EncodedKeySpec2 = new X509EncodedKeySpec(elGamalPublicKey.getEncoded());
// 实例化密钥工厂
KeyFactory keyFactory2 = KeyFactory.getInstance("Elgamal");
// 产生公钥
PublicKey publicKey2 = keyFactory2.generatePublic(x509EncodedKeySpec2);
// 数据加密
// Cipher cipher2 = Cipher.getInstance("Elgamal");
Cipher cipher2 = Cipher.getInstance(keyFactory2.getAlgorithm());
cipher2.init(Cipher.ENCRYPT_MODE, publicKey2);
byte[] result2 = cipher2.doFinal(src.getBytes());
System.out.println("私钥加密、公钥解密 ---- 加密:" + Base64.encodeBase64String(result2));
// 3.私钥解密、公钥加密 ---- 解密
PKCS8EncodedKeySpec pkcs8EncodedKeySpec5 = new PKCS8EncodedKeySpec(elGamalPrivateKey.getEncoded());
KeyFactory keyFactory5 = KeyFactory.getInstance("Elgamal");
PrivateKey privateKey5 = keyFactory5.generatePrivate(pkcs8EncodedKeySpec5);
// Cipher cipher5 = Cipher.getInstance("Elgamal");
Cipher cipher5 = Cipher.getInstance(keyFactory5.getAlgorithm());
cipher5.init(Cipher.DECRYPT_MODE, privateKey5);
byte[] result5 = cipher5.doFinal(result2);
System.out.println("Elgamal 私钥加密、公钥解密 ---- 解密:" + new String(result5));
/*
// 私钥加密、公钥解密: 有问题
// 4.私钥加密、公钥解密 ---- 加密
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(elGamalPrivateKey.getEncoded());
KeyFactory keyFactory = KeyFactory.getInstance("Elgamal");
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec);
Cipher cipher = Cipher.getInstance("Elgamal");
cipher.init(Cipher.ENCRYPT_MODE, privateKey);
byte[] result = cipher.doFinal(src.getBytes());
System.out.println("私钥加密、公钥解密 ---- 加密:" + Base64.encodeBase64String(result));
// 5.私钥加密、公钥解密 ---- 解密
X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(elGamalPublicKey.getEncoded());
keyFactory = KeyFactory.getInstance("Elgamal");
PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec);
cipher = Cipher.getInstance("Elgamal");
cipher.init(Cipher.DECRYPT_MODE, publicKey);
result = cipher.doFinal(result);
System.out.println("Elgamal 私钥加密、公钥解密 ---- 解密:" + new String(result));
*/
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"doinone@163.com"
] | doinone@163.com |
fe0cb882b5695d59fc966d402129bc9bcaa78071 | ced193d91d6192d70c05277f6bc93c8e335830b5 | /app/src/main/java/com/github/jtml/ui/fragment/FragmentShowBill.java | e12dd17049cf6f8ae87b3b66f67ce145c60844a0 | [] | no_license | pengjfcn/Jtml | 83af0b2619c4bc2e72515587371e37fd2e62d335 | 59ffe1032b4e2d01472c2e220a8acdae7442598b | refs/heads/master | 2020-12-24T07:15:29.883530 | 2016-09-08T02:16:48 | 2016-09-08T02:16:48 | 58,697,318 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 558 | java | package com.github.jtml.ui.fragment;
import android.os.Bundle;
import com.github.jtml.R;
import com.github.jtml.base.BaseFragment;
/**
* Created by pengjf on 2016/5/12.
*/
public class FragmentShowBill extends BaseFragment {
@Override
protected int getLayoutId() {
return R.layout.fragment_show_bill;
}
@Override
protected void afterCreate(Bundle savedInstanceState) {
init();
}
public static FragmentShowBill newInstance() {
return new FragmentShowBill();
}
private void init() {
}
}
| [
"343520123@qq.com"
] | 343520123@qq.com |
45a0d8ef09af6ec21be8dd115d6080ac29448ee8 | 9f4ef7f14d0b1f9832c54c0db586ce33f6ecb057 | /src/com/revature/dao/TestUserDAO.java | 45b939b41e9f07da6378f4e24acfd0ca2a4444de | [] | no_license | soniyaramesh/Pubhub200_310814106102_core | fcfc0d88d06a2ab1f7cc1207d4abb99733198d5c | 9151c70cd1bf4d1b5d60fc1d5a53707fb4cd19a0 | refs/heads/master | 2020-12-03T00:42:43.950156 | 2017-07-03T09:47:42 | 2017-07-03T09:47:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 461 | java | package com.revature.dao;
import java.sql.SQLException;
import com.revature.model.User;
public class TestUserDAO {
public static void main(String[] args) throws ClassNotFoundException, SQLException {
// TODO Auto-generated method stub
User user=new User();
user.setName("agalya");
user.setEmail("agal@gmail.com");
user.setPassword("abc123");
UserDAO dao= new UserDAO();
dao.register(user);
}
}
| [
"RAMESH@RAMESH-PC"
] | RAMESH@RAMESH-PC |
f0a0e3ed7445bb357090b3d592c97b2cf2622638 | 1b9f1396c65a4218ba9be1a451c672282c7234bc | /taotao-manager-service/src/main/java/com/taotao/service/impl/ContentCatgoryServiceImpl.java | 3f1c56014eb7c245e6ee1eb4c5395c5d7b0ef40a | [
"Apache-2.0"
] | permissive | MrLW/taotao-manager | 329fe41818069f23f0c4adbd49d15876cf3faec9 | eb755b37fe22fbe6222202278f15b70ea8412846 | refs/heads/master | 2021-01-25T09:38:44.477711 | 2017-06-09T15:07:15 | 2017-06-09T15:07:15 | 93,870,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,541 | java | package com.taotao.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.taotao.common.pojo.EasyUIITreeNode;
import com.taotao.common.pojo.TaotaoResult;
import com.taotao.mapper.TbContentCategoryMapper;
import com.taotao.pojo.TbContentCategory;
import com.taotao.pojo.TbContentCategoryExample;
import com.taotao.pojo.TbContentCategoryExample.Criteria;
import com.taotao.service.ContentCatgoryService;
@Service
public class ContentCatgoryServiceImpl implements ContentCatgoryService {
@Autowired
private TbContentCategoryMapper tbContentCategoryMapper;
@Override
public List<EasyUIITreeNode> getContentCatList(Long parentId) {
TbContentCategoryExample example = new TbContentCategoryExample();
Criteria criteria = example.createCriteria();
criteria.andParentIdEqualTo(parentId);
List<TbContentCategory> tbContentCategoryList = tbContentCategoryMapper.selectByExample(example);
//
List<EasyUIITreeNode> resultList = new ArrayList<>();
for (TbContentCategory tbContentCategory : tbContentCategoryList) {
//创建一个EasyUITree结点
EasyUIITreeNode node = new EasyUIITreeNode() ;
node.setId(tbContentCategory.getId());
node.setState(tbContentCategory.getIsParent()?"closed":"open");
node.setText(tbContentCategory.getName());
//添加到列表
resultList.add(node);
}
return resultList;
}
@Override
public TaotaoResult insertContentNode(Long parentId, String name) {
TbContentCategory category = new TbContentCategory() ;
category.setName(name);
category.setParentId(parentId);
category.setCreated(new Date());
category.setUpdated(new Date());
category.setIsParent(false);
//'排列序号,表示同级类目的展现次序,如数值相等则按名称次序排列。取值范围:大于零的整数',
category.setSortOrder(1);
// '状态。可选值:1(正常),2(删除)',
category.setStatus(1);
tbContentCategoryMapper.insert(category);
Long id = category.getId();
//查询父节点
TbContentCategory parentNode = tbContentCategoryMapper.selectByPrimaryKey(parentId);
//判断父节点是不是叶子节点
if(!parentNode.getIsParent()){
parentNode.setIsParent(true);
//更新数据库
tbContentCategoryMapper.updateByPrimaryKeySelective(parentNode);
}
//将id包装成TaoTaoResult
return TaotaoResult.ok(id);
}
@Override
public TaotaoResult updateContentNode(Long id, String name) {
//根据Id查询到对应节点
TbContentCategory contentCategory = tbContentCategoryMapper.selectByPrimaryKey(id);
contentCategory.setName(name);
System.out.println("service中的name:" + contentCategory.getName());
//同步数据库
tbContentCategoryMapper.updateByPrimaryKeySelective(contentCategory);
return TaotaoResult.ok();
}
@Override
public TaotaoResult deleteContentNode(Long id) {
//查询到对应id的TbContentCategory
TbContentCategory category = tbContentCategoryMapper.selectByPrimaryKey(id);
//判断是否是叶子节点
if(!category.getIsParent()){// 是
tbContentCategoryMapper.deleteByPrimaryKey(id);
System.out.println("id:" + id );
}else{ //不是
// deleteContentNode(category) ;
}
return TaotaoResult.ok();
}
//递归删除某个父节点下的所有子节点
public void deleteParentNode(TbContentCategory category){
}
}
| [
"1819270694@qq.com"
] | 1819270694@qq.com |
410596090d1ecbcf927a0df19606a69fb4e96c2d | cac93e973773e349ee789702fe5c8645194a117f | /src/main/java/tq/spring/pjt_command/BoardDeleteCommand.java | 61c56a862aa8030171fc0758d05c73e729519b6e | [] | no_license | KimTaeGuk/springJDBC | 3f322d12bb47410178970302ce679512371d8d4f | e2161f0a2984eda1d7d3a462db4e8b5460600e96 | refs/heads/master | 2021-01-17T11:20:05.620432 | 2017-03-06T08:30:21 | 2017-03-06T08:30:21 | 84,031,040 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 589 | java | package tq.spring.pjt_command;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.ui.Model;
import tq.spring.pjt_dao.BoardDao;
public class BoardDeleteCommand implements BoardCommand{
@Override
public void execute(Model model) {
// TODO Auto-generated method stub
Map<String, Object> map=model.asMap();
HttpServletRequest request=(HttpServletRequest) map.get("request");
int num=Integer.parseInt(request.getParameter("num"));
new BoardDao().delete(num);
//아이디가 같지 않을 시 삭제 못하도록 할 것
}
}
| [
"xoox1020@naver.com"
] | xoox1020@naver.com |
4c2424be09ef1a90ea6a1dc4c57abda1d6991758 | 12e1cb52a2a0db56c91f762963e0582f93e34ff1 | /src/com/ssm/filter/EncodeFilter.java | 14a757d8e271de582b956703ea0dc5f7e1bd6519 | [] | no_license | soliderking/workplace | 101f40ef2e1962cfcf45a10b9f140b1a3aff14e1 | 9103745a4cf890c95218c0a6d599592370bdc2c8 | refs/heads/master | 2021-09-05T18:13:11.357097 | 2018-01-29T12:14:54 | 2018-01-29T12:14:54 | 117,506,737 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,055 | java | package com.ssm.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class EncodeFilter implements Filter {
@Override
public void destroy() {
// TODO Auto-generated method stub
}
@Override
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
throws IOException, ServletException {
// TODO Auto-generated method stub
HttpServletRequest request=(HttpServletRequest)req;
HttpServletResponse response=(HttpServletResponse)resp;
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
chain.doFilter(request, response);
}
@Override
public void init(FilterConfig arg0) throws ServletException {
// TODO Auto-generated method stub
}
}
| [
"996869270@qq.com"
] | 996869270@qq.com |
e8b84cf533f729ad07bb5bbac2330f5a2d8acb80 | e72552ae03d5416edf9861f1fee182b237039843 | /2020/etterretningstjenesten/cybertalent-winter/2_oppdrag/1_beslag/files/apk/decompiled/sources/a/h/d/i.java | 196e8f55d6cb3d64dea18693318ca4133c71789e | [] | no_license | mklarz/ctf-writeups | c455c751959127dc71019244bda3db94418cd288 | 9dc8bcd4b64a72252b0002ae387479d1bb372d44 | refs/heads/main | 2023-02-27T09:11:49.659145 | 2021-02-04T10:56:31 | 2021-02-04T10:56:31 | 312,985,795 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,818 | java | package a.h.d;
import a.h.b.d;
import a.h.c.b.b;
import a.h.g.e;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.CancellationSignal;
import java.io.File;
import java.util.concurrent.ConcurrentHashMap;
public class i {
@SuppressLint({"BanConcurrentHashMap"})
/* renamed from: a reason: collision with root package name */
public ConcurrentHashMap<Long, b> f461a = new ConcurrentHashMap<>();
public interface a<T> {
int a(T t);
boolean b(T t);
}
public static <T> T d(T[] tArr, int i, a<T> aVar) {
int i2 = (i & 1) == 0 ? 400 : 700;
boolean z = (i & 2) != 0;
T t = null;
int i3 = Integer.MAX_VALUE;
for (T t2 : tArr) {
int abs = (Math.abs(aVar.a(t2) - i2) * 2) + (aVar.b(t2) == z ? 0 : 1);
if (t == null || i3 > abs) {
t = t2;
i3 = abs;
}
}
return t;
}
public Typeface a(Context context, b bVar, Resources resources, int i) {
throw null;
}
public Typeface b(Context context, CancellationSignal cancellationSignal, e.c[] cVarArr, int i) {
throw null;
}
public Typeface c(Context context, Resources resources, int i, String str, int i2) {
File n = d.n(context);
if (n == null) {
return null;
}
try {
if (!d.i(n, resources, i)) {
return null;
}
Typeface createFromFile = Typeface.createFromFile(n.getPath());
n.delete();
return createFromFile;
} catch (RuntimeException unused) {
return null;
} finally {
n.delete();
}
}
}
| [
"mklarz@protonmail.com"
] | mklarz@protonmail.com |
d553e488fe702eedc73b0a47d2c27c38907d996f | 1e5980f20616a32ac1c9004f99e7b241f6ff82b8 | /untitled1/src/main/java/com/google/demo/dao/impl/beishantieziDaoImpl.java | 0b909ad886113af5b50dd1dc9024df1dfab0ed34 | [] | no_license | 1104256730/untitled | 33fa7e7f8b23bba13a97e6f064d2d9b2764dec21 | 962e0cce90645174bd8770ad447a9d03146e98a6 | refs/heads/master | 2023-06-06T03:30:30.656128 | 2021-06-26T05:06:44 | 2021-06-26T05:06:44 | 326,610,426 | 0 | 0 | null | 2021-06-21T16:49:07 | 2021-01-04T08:00:50 | Java | UTF-8 | Java | false | false | 72 | java | package com.google.demo.dao.impl;
public class beishantieziDaoImpl {
}
| [
"https://github.com/1104256730/improved-spork.git"
] | https://github.com/1104256730/improved-spork.git |
e0d5ff126233f6d1fb754f5ad21f0b2c03a7340f | 695ab9a54e04e01b1d0808d00e960257ea83b64a | /repository/src/main/java/gw2trades/repository/api/model/ItemListings.java | 2f9c8150f658eec7e4f6b2b5500c4bbf6280f7cd | [
"MIT"
] | permissive | slotties/gw2trades | b90e0da1f99b5cbdfe3abf7c50a47d28d62baeab | d9174708d9c113ce42e01706d2fe14025731be81 | refs/heads/develop | 2020-12-31T04:29:05.501638 | 2016-02-16T19:56:24 | 2016-02-16T19:56:24 | 45,492,425 | 3 | 0 | null | 2016-02-09T17:49:32 | 2015-11-03T20:06:30 | Java | UTF-8 | Java | false | false | 922 | java | package gw2trades.repository.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author Stefan Lotties (slotties@gmail.com)
*/
public class ItemListings {
@JsonProperty("id")
private int itemId;
private List<ItemListing> buys;
private List<ItemListing> sells;
private Item item;
public List<ItemListing> getSells() {
return sells;
}
public void setSells(List<ItemListing> sells) {
this.sells = sells;
}
public List<ItemListing> getBuys() {
return buys;
}
public void setBuys(List<ItemListing> buys) {
this.buys = buys;
}
public void setItemId(int itemId) {
this.itemId = itemId;
}
public int getItemId() {
return itemId;
}
public void setItem(Item item) {
this.item = item;
}
public Item getItem() {
return item;
}
}
| [
"slotties@gmail.com"
] | slotties@gmail.com |
e5335870a18bb87564b890279a50b38d89481506 | 863acb02a064a0fc66811688a67ce3511f1b81af | /sources/p005cm/aptoide/p006pt/promotions/C4526ec.java | 491db3d6410c9e583c4e1f4e8cc86f6573cb3ad9 | [
"MIT"
] | permissive | Game-Designing/Custom-Football-Game | 98d33eb0c04ca2c48620aa4a763b91bc9c1b7915 | 47283462b2066ad5c53b3c901182e7ae62a34fc8 | refs/heads/master | 2020-08-04T00:02:04.876780 | 2019-10-06T06:55:08 | 2019-10-06T06:55:08 | 211,914,568 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 534 | java | package p005cm.aptoide.p006pt.promotions;
import p005cm.aptoide.p006pt.presenter.View.LifecycleEvent;
import p026rx.p027b.C0132p;
/* renamed from: cm.aptoide.pt.promotions.ec */
/* compiled from: lambda */
public final /* synthetic */ class C4526ec implements C0132p {
/* renamed from: a */
public static final /* synthetic */ C4526ec f8144a = new C4526ec();
private /* synthetic */ C4526ec() {
}
public final Object call(Object obj) {
return PromotionsPresenter.m8895a((LifecycleEvent) obj);
}
}
| [
"tusharchoudhary0003@gmail.com"
] | tusharchoudhary0003@gmail.com |
4696e2c44f1b9be3cff353965ca933af4e47b518 | 5f48017aac227ac0d33f4319a4beb77ea3e867df | /src/mygame/CollisionDetectionSubject.java | 16c4b358aaa11e50a57b3e6d8d6fd3839e744275 | [] | no_license | ankitd89/GumballSurfer | 83010ea942dc217d63c125fbb06052b094102ca0 | c05821ca3cffbd470f568a252c4d5c749cf3edaf | refs/heads/master | 2020-09-22T13:54:16.108258 | 2014-12-01T04:00:39 | 2014-12-01T04:00:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,006 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mygame;
import com.jme3.app.state.AppState;
import com.jme3.bounding.BoundingVolume;
import com.jme3.collision.CollisionResults;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import java.util.ArrayList;
/**
*
* @author Rohan
*/
public class CollisionDetectionSubject {
private ScoreUpdateObserver scoreUpdtObserver;
private AppState app;
private static int score = 0;
private CoinScoreHandler red ;
private CoinScoreHandler blue ;
private CoinScoreHandler green;
public int getScore(){
return score;
}
CollisionDetectionSubject(AppState app) {
this.app = app;
this.scoreUpdtObserver = new ScoreUpdateObserver(this,app);
red = new RedCoinScoreHandler();
blue = new BlueCoinScoreHandler();
green = new GreenCoinScoreHandler();
red.setNextHandler(blue);
blue.setNextHandler(green);
}
public void checkCollision(ArrayList<Spatial> coinField, Node player) {
for (int i = 0; i < coinField.size(); i++){
Spatial playerModel = (Spatial) player.getChild(0);
Spatial coin = coinField.get(i);
coin.updateGeometricState();
CollisionResults results = new CollisionResults();
BoundingVolume bv = playerModel.getWorldBound();
coin.collideWith(bv, results);
if (results.size() > 0) {
score += red.handleRequest(coin);
coinField.get(i).removeFromParent();
coinField.remove(coinField.get(i));
notifyScoreUpdtObserver();
break;
}
}
}
public void notifyScoreUpdtObserver() {
scoreUpdtObserver.showUpdatedScore();
}
}
| [
"ankitd89@yahoo.com"
] | ankitd89@yahoo.com |
090fcf8328b2eb9ea25468e22e792cdfd8f2cbc8 | d2db0aa4a6ea463ea4ed0086ea2ad913d56bb202 | /src/com/google/caja/opensocial/service/ContentTypeCheck.java | fe328c0e171abc7a763445679aeb8974cb6d697c | [] | no_license | dkahn1/caja | c930b4fc73bebec3e2ac4ac3f14937773a834ed6 | 6997c63bf0d0e3fe33cffa87e893fc7c315543fb | refs/heads/master | 2021-01-10T19:43:24.337324 | 2009-02-20T20:39:33 | 2009-02-20T20:39:33 | 133,688 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 933 | java | // Copyright 2007 Google Inc. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.caja.opensocial.service;
public abstract class ContentTypeCheck {
/**
* Tests whether content-type {@code requested} mime-type
* is consistent with {@code received} mime-type
* @return true if they are consistent
*/
public abstract boolean check(String requested, String received);
}
| [
"jasvir@360991c0-9f3b-0410-ba87-8b362a00edf4"
] | jasvir@360991c0-9f3b-0410-ba87-8b362a00edf4 |
d8df0ca7c88db8f527b49bf2dfa3dc145de75454 | ef245c04e6ecc30b152398e431eca6c9d53bc405 | /src/main/java/de/hsharz/abgabeverwaltung/ui/views/ModuleView.java | ab7ace2bcce766b3512514ca48bfb3b2207bdc3b | [] | no_license | Spiderlinker/Abgabeverwaltung | f1814b074882e2592357087a32d30b85d7d56266 | d055347192087eb8561c59532e1a5aed629e699c | refs/heads/master | 2023-01-04T05:58:53.745949 | 2020-10-29T18:12:22 | 2020-10-29T18:12:22 | 285,989,171 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,736 | java | package de.hsharz.abgabeverwaltung.ui.views;
import com.jfoenix.controls.JFXButton;
import de.hsharz.abgabeverwaltung.Language;
import de.hsharz.abgabeverwaltung.model.Module;
import de.hsharz.abgabeverwaltung.model.ModuleDatabase;
import de.hsharz.abgabeverwaltung.model.Task;
import de.hsharz.abgabeverwaltung.ui.dialogs.ModuleDialog;
import de.hsharz.abgabeverwaltung.ui.dialogs.TaskDialog;
import de.hsharz.abgabeverwaltung.ui.utils.AbstractStyledView;
import de.hsharz.abgabeverwaltung.ui.utils.ImageLibrary;
import de.hsharz.abgabeverwaltung.ui.utils.LayoutUtils;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.css.PseudoClass;
import javafx.geometry.Orientation;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
public class ModuleView extends AbstractStyledView<BorderPane> {
private static final PseudoClass invalidModuleState = PseudoClass.getPseudoClass("invalid");
private StackPane parent;
private HBox boxTitle;
private Label lblModule;
private Button btnAddTask;
private Button btnRemoveModule;
private Button btnEditModule;
private ListView<Task> viewTasks;
private ObjectProperty<Module> module = new SimpleObjectProperty<>();
public ModuleView(final StackPane parent) {
super(new BorderPane());
this.parent = parent;
this.initializeView();
}
@Override
protected String getStylesheet() {
return "/style/ModuleView.css";
}
@Override
protected void createWidgets() {
this.root.setPrefSize(0, 300);
this.boxTitle = new HBox(5);
this.boxTitle.getStyleClass().add("headerBox");
this.lblModule = new Label();
this.lblModule.getStyleClass().add("header-label");
this.btnAddTask = new JFXButton(Language.getString("AddTask"));
this.btnRemoveModule = new JFXButton("", ImageLibrary.getImageView("trash.png"));
this.btnEditModule = new JFXButton("", ImageLibrary.getImageView("edit.png"));
this.viewTasks = new ListView<>();
this.viewTasks.setOrientation(Orientation.HORIZONTAL);
this.viewTasks.setCellFactory(param -> new TaskView(this.parent, this.module).newListCell());
this.viewTasks.setPlaceholder(new Label(Language.getString("ClickAddTask")));
}
@Override
protected void setupInteractions() {
this.btnAddTask.setOnAction(e -> {
Task task = new Task(Language.getString("NewTask"));
this.module.get().addTask(task);
new TaskDialog(this.parent, this.module.get(), task).show();
});
this.btnEditModule.setOnAction(e -> new ModuleDialog(this.parent, this.module.get()).show());
this.btnRemoveModule.setOnAction(e -> ModuleDatabase.getInstance().removeModule(this.module.get()));
}
@Override
protected void addWidgets() {
this.boxTitle.getChildren().addAll(this.btnAddTask, LayoutUtils.getHSpacer(), this.lblModule, LayoutUtils.getHSpacer(), this.btnEditModule,
this.btnRemoveModule);
this.root.setTop(this.boxTitle);
this.root.setCenter(this.viewTasks);
}
public ListCell<Module> newListCell() {
return new ModuleListCell();
}
private class ModuleListCell extends ListCell<Module> {
@Override
protected void updateItem(final Module item, final boolean empty) {
super.updateItem(item, empty);
ModuleView.this.module.set(item);
if (item == null) {
this.setGraphic(null);
return;
}
ModuleView.this.boxTitle.pseudoClassStateChanged(invalidModuleState, false);
ModuleView.this.lblModule.setGraphic(null);
// If the professor is not set, the module has an invalid state!
// Visualise via background-color of header box
if (ModuleView.this.module.get().getProfessor() == null) {
ModuleView.this.boxTitle.pseudoClassStateChanged(invalidModuleState, true);
ModuleView.this.lblModule.setGraphic(ImageLibrary.getImageView("warning.png"));
}
ModuleView.this.lblModule.textProperty().bind(item.nameProperty());
ModuleView.this.viewTasks.setItems(item.getTasks());
this.setGraphic(ModuleView.this.root);
}
}
}
| [
"support@spiderlinker.de"
] | support@spiderlinker.de |
cf5322886a47246d4aa1e51d64b185f9e90631f8 | 65c2365f978ba7d34850e154feb0169e9c82b1b3 | /OOPSConcepts/Polymorphism/ModifierOverridingExample.java | 79cfce0b429f826a26a81ed91fbe57bc33f81eba | [] | no_license | EDharan66/Hariharan-FullStack_JavaDeveloper_Intern-firstWeekTask | 0d25b94f257d079e2ca3b9748e47946373c5bfe9 | e286e253b7406481e9ebc69ab1ab8fe36e00f846 | refs/heads/master | 2023-07-06T08:35:25.076443 | 2021-08-11T11:36:04 | 2021-08-11T11:36:04 | 392,555,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 796 | java | class Student1 {
public void show(){
System.out.println("Student details.");
}
}
public class ModifierOverridingExample extends Student1 {
public void show(){ //compile-time error if put Access modifier as private or public
System.out.println("College Student details.");
}
//main method
public static void main(String args[]){
ModifierOverridingExample obj = new ModifierOverridingExample();
//subclass overrides super class method
//hence method of CollegeStudant class will be called.
obj.show();
}
}
/**
* Role of access modifiers in method overriding:
* Access modifier of overridden method in subclass can’t be more restrictive than in super class.
* Otherwise it will throw an exception.
*/
| [
"hariharan80122@gmail.com"
] | hariharan80122@gmail.com |
8cde525e7aa7cae4e03d136216ba8039a9c42aa7 | 40890ea623f6838c2b45da98f584c32bde7179c4 | /Java/src/Chapter1/VariableScopeExample.java | 2cc7feb1ae4da8efcec02392d65bb2bf46fa81e0 | [] | no_license | woghwjs1/JavaStudy | dc5f33a77c142d0b1a679aa04acb43ec17f226b7 | 760cf9407e4f5ed53e3b8483d069a4008915cd85 | refs/heads/master | 2021-05-02T09:48:31.416252 | 2018-03-11T13:07:44 | 2018-03-11T13:07:44 | 120,783,659 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 272 | java | package Chapter1;
public class VariableScopeExample {
public static void main(String[] args) {
int v1 = 15;
if(v1 > 10) {
int v2 = v1 - 10;
}
//int v3 = v1 + v2 + 5; //v2변수를 사용할 수 없기 때문에 에러 발생
}
}
| [
"jaeho@DESKTOP-D0D8256"
] | jaeho@DESKTOP-D0D8256 |
772e8a48f93e6880bb18c26ed0c4e2e69ba92297 | d763b638c43f888061c5cf67b220863325065eec | /Lab11-12.1/src/main/java/by/punko/repository/specification/AbstractRepository.java | 4c5aebe069d9084e152718804597c59464ecd30f | [] | no_license | AlinaPunko/Java-labs-1.0 | 08c3cd7eeff7887a6297672b2310eb368720beae | c90e14fe949b623a6bd467abb659c844b2dd7e6a | refs/heads/master | 2020-07-24T09:23:24.834618 | 2019-09-11T18:28:05 | 2019-09-11T18:28:05 | 207,880,743 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,883 | java | package main.java.by.punko.repository.specification;
import main.java.by.punko.builder.Builder;
import main.java.by.punko.builder.BuilderFactory;
import main.java.by.punko.exception.RepositoryException;
import org.apache.log4j.Logger;
import java.sql.*;
import java.util.*;
public abstract class AbstractRepository<T> implements Repository<T> {
private Connection connection;
private static final Logger LOGGER =
Logger.getLogger(AbstractRepository.class);
private static final String GET_ALL_QUERY = "SELECT * FROM ";
private final String WHERE_ID_CONDITION = " WHERE id_" + getTableName() + "=(?)";
protected final String DELETE_QUERY = "DELETE from " + getTableName() + "where id_" + getTableName() + "=(?)";
protected abstract String getTableName();
AbstractRepository(Connection connection) {
this.connection = connection;
}
private static Integer getType(Object object) {
if (object instanceof Integer) {
return Types.INTEGER;
}
if (object instanceof Float) {
return Types.FLOAT;
}
if (object instanceof String) {
return Types.VARCHAR;
} else {
return Types.NULL;
}
}
public static void prepare(PreparedStatement preparedStatement,
List<Object> parameters) throws SQLException {
int length = parameters.size();
for (int i = 0; i < length; i++) {
if (parameters.get(i) == null) {
preparedStatement.setNull(i + 1, getType(parameters.get(i)));
} else {
preparedStatement.setObject(i + 1, parameters.get(i));
}
}
}
public static void prepare(PreparedStatement preparedStatement, Map<String,
Object> fields, String tableName) throws SQLException {
int i = 1;
for (Map.Entry<String, Object> entry : fields.entrySet()) {
Object value = entry.getValue();
String key = entry.getKey();
if (!key.equals(SQLHelper.ID)) {
if (value == null) {
preparedStatement.setNull(i++, getType(value));
} else {
preparedStatement.setObject(i++, value);
}
}
}
Object id = fields.get(SQLHelper.ID);
if (id != null) {
preparedStatement.setString(i++, String.valueOf(id));
}
}
List<T> executeQuery(String sql, Builder<T> builder, List<Object>
parameters) throws RepositoryException {
List<T> objects = new ArrayList<>();
try {
PreparedStatement preparedStatement =
connection.prepareStatement(sql);
prepare(preparedStatement, parameters);
ResultSet resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
T item = builder.build(resultSet);
objects.add(item);
}
} catch (SQLException e) {
throw new RepositoryException(e.getMessage(), e);
}
return objects;
}
protected Optional<T> executeQueryForSingleResult(String query, Builder<T>
builder, List<Object> parameters) throws RepositoryException {
List<T> items = executeQuery(query, builder, parameters);
return items.size() == 1 ?
Optional.of(items.get(0)) :
Optional.empty();
}
protected abstract Map<String, Object> getFields(T obj);
@Override
public Integer save(T object) throws RepositoryException {
String sql;
Map<String, Object> fields = getFields(object);
sql = SQLHelper.makeInsertQuery(fields, getTableName());
return executeSave(sql, fields);
}
private Integer executeSave(String query, Map<String, Object> fields)
throws RepositoryException {
try {
PreparedStatement preparedStatement =
connection.prepareStatement(query, Statement.RETURN_GENERATED_KEYS);
prepare(preparedStatement, fields, getTableName());
LOGGER.info(preparedStatement.toString());
preparedStatement.executeUpdate();
ResultSet resultSet = preparedStatement.getGeneratedKeys();
Integer generatedId = null;
while (resultSet.next()) {
generatedId = resultSet.getInt(1);
}
return generatedId;
} catch (SQLException e) {
throw new RepositoryException(e.getMessage(), e);
}
}
@Override
public List<T> findAll() throws RepositoryException {
Builder builder = BuilderFactory.create(getTableName());
String query = GET_ALL_QUERY + getTableName();
return executeQuery(query, builder, Collections.emptyList());
}
}
| [
"punko.alina2000@gmail.com"
] | punko.alina2000@gmail.com |
aaeeb6eaa1addab9b60867245a44057bac6211b4 | 41bda50ed5b3b9553503670f6372fc9e0f1a0981 | /app/src/androidTest/java/com/example/link_online_tutoring_app_/postingTest.java | d74efb99ace50e2cb1ca014d8712bdb841b403c8 | [] | no_license | WitsUpSikhanyiso/Link-Online-Tutoring-App- | 673b216f0ff00336871f69bbf80a52477e261300 | 0c9b0e2ef1672c80c751cc7f458302611c502233 | refs/heads/master | 2022-10-18T17:53:29.748229 | 2020-06-15T09:19:29 | 2020-06-15T09:19:29 | 272,094,353 | 0 | 0 | null | 2020-06-14T07:49:58 | 2020-06-13T22:17:59 | Java | UTF-8 | Java | false | false | 4,045 | java | package com.example.link_online_tutoring_app_;
import android.app.Activity;
import android.app.Instrumentation;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.PopupMenu;
import androidx.test.InstrumentationRegistry;
import androidx.test.annotation.UiThreadTest;
import androidx.test.espresso.action.ViewActions;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import com.example.link_online_tutoring_app_.PostsActivity;
import com.example.link_online_tutoring_app_.R;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.concurrent.CountDownLatch;
import static android.content.Context.MODE_PRIVATE;
import static androidx.test.espresso.Espresso.closeSoftKeyboard;
import static androidx.test.espresso.Espresso.onData;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.Espresso.openContextualActionModeOverflowMenu;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.pressMenuKey;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.matcher.ViewMatchers.isSelected;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.internal.runner.junit4.statement.UiThreadStatement.runOnUiThread;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static org.hamcrest.Matchers.anything;
import static org.junit.Assert.assertNull;
@RunWith(AndroidJUnit4.class)
public class postingTest {
SharedPreferences.Editor preferenceEditor;
private Instrumentation mI;
private Activity mA;
private PopupMenu Popmenu;
@Rule
public ActivityTestRule<PostsActivity> ATR = new ActivityTestRule<>(PostsActivity.class, true,false);
Instrumentation.ActivityMonitor Monitor =getInstrumentation().addMonitor(PostsActivity.class.getName(),null,false);
// Instrumentation.ActivityMonitor activityMonitor=getInstrumentation().addMonitor(HomeActivity.class.getName(),null,false);
@Test
public void ClickPostFail() {
ATR.launchActivity(new Intent());
try{
runOnUiThread(new Runnable() {
@Override
public void run(){
EditText Q = ATR.getActivity().findViewById(R.id.PostYourQ);
EditText PlaceHolder = ATR.getActivity().findViewById(R.id.Viewer);
Q.setText("");
PlaceHolder.setText("");
Button Post = ATR.getActivity().findViewById(R.id.Post_button);
Post.performClick();
Activity NextActivity=getInstrumentation().waitForMonitorWithTimeout(Monitor,3000);
assertNull(NextActivity);
}
});
}catch (Throwable output){
output.printStackTrace();
}
}
@Test
public void DoPostPass(){
ATR.launchActivity(new Intent());
try{
Button Post = ATR.getActivity().findViewById(R.id.Post_button);
Post.performClick();
}catch (Throwable tr){
tr.printStackTrace();
}
}
@Test
public void Can_post1() { //testing if you can post
ATR.launchActivity(new Intent());
try {
onView(withId(R.id.Add_post)).perform(typeText("this is a question"));
onView(withId(R.id.CourseChoice)).perform(click());
onView(withText("COMS")).perform(click());
onView(withId(R.id.Post_button)).perform(click());
}
catch (Throwable throwable) {
throwable.printStackTrace();
}
}
} | [
"mabhutidlodlo1@gmail.com"
] | mabhutidlodlo1@gmail.com |
6a17b10b4b624be8a5b661b03c36319e7e775568 | 66ac4ed19d19e9d7b8aae5d84c05c58aee6658ea | /src/main/java/br/usjt/app_previsoes/AppConfig.java | c5467d7de7dc1b14e20df360c6898604dceae9a0 | [] | no_license | gabrieljeronimo/ccp3an_mca_app_previsoes | 391ab895e7cc249cfb1ae7ef514c65b87e9377fe | 20aa80c3ed98e355b3f1ea9bdae8076a1ee5decd | refs/heads/master | 2022-09-24T22:24:59.232857 | 2020-06-03T20:27:35 | 2020-06-03T20:27:35 | 268,377,949 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 742 | java | package br.usjt.app_previsoes;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import br.usjt.app_previsoes.controller.LoginInterceptor;
@Configuration
public class AppConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry
.addInterceptor(new LoginInterceptor())
.addPathPatterns("/**")
.excludePathPatterns(
"/login",
"/api/**",
"/",
"/fazerLogin",
"/webjars/**",
"/bootstrap/**"
)
;
}
}
| [
"gjs@topnode.com.br"
] | gjs@topnode.com.br |
79eaf91f8e5c62eb9954e86b712de0d3df265fd4 | b19d9b53d8ae9f50e0bc3e6030d6b9713f9c16c3 | /src/main/java/org/tinymediamanager/ui/actions/BugReportAction.java | d98f3b89bb478e8de1b5fdfba126ccfb9bf97d05 | [
"Apache-2.0"
] | permissive | jmulvaney1/tinyMediaManager | 3606cba26e24cfaaa378224dd4cf7aa343bf1480 | bff0c13c5d0f286bac4f2b675c75bbafa111fc16 | refs/heads/master | 2021-01-12T00:35:11.536908 | 2016-12-27T09:58:21 | 2016-12-27T09:58:21 | 78,743,595 | 1 | 0 | null | 2017-01-12T12:32:26 | 2017-01-12T12:32:26 | null | UTF-8 | Java | false | false | 1,818 | java | /*
* Copyright 2012 - 2016 Manuel Laggner
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.tinymediamanager.ui.actions;
import java.awt.event.ActionEvent;
import java.util.ResourceBundle;
import javax.swing.AbstractAction;
import javax.swing.JDialog;
import org.tinymediamanager.ui.IconManager;
import org.tinymediamanager.ui.MainWindow;
import org.tinymediamanager.ui.UTF8Control;
import org.tinymediamanager.ui.dialogs.BugReportDialog;
/**
* The BugReportAction to send bug reports directly from tmm
*
* @author Manuel Laggner
*/
public class BugReportAction extends AbstractAction {
private static final long serialVersionUID = 2468561945547768259L;
private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("messages", new UTF8Control()); //$NON-NLS-1$
public BugReportAction() {
putValue(NAME, BUNDLE.getString("BugReport")); //$NON-NLS-1$
putValue(SHORT_DESCRIPTION, BUNDLE.getString("BugReport")); //$NON-NLS-1$
putValue(SMALL_ICON, IconManager.BUG);
putValue(LARGE_ICON_KEY, IconManager.BUG);
}
@Override
public void actionPerformed(ActionEvent e) {
JDialog dialog = new BugReportDialog();
dialog.setLocationRelativeTo(MainWindow.getActiveInstance());
dialog.setVisible(true);
dialog.pack();
}
} | [
"manuel.laggner@gmail.com"
] | manuel.laggner@gmail.com |
32874e7290f2d4bba14a19a3615a8a1e24d24b92 | 8e9d2f1c9389d121d2d443b799a546ad92da54a3 | /ReceiptAs/app/src/test/java/com/example/receiptas/ParticipantTest.java | 1bfb780f2750a48b2beedee372703145fd5f42e6 | [] | no_license | Roux-libres/MGL7130_ReceiptAs | 41b8c4afc29d4d39fd9320ed66fe18aa88e12372 | e35200be0af12ebc922aaeaf0272e3b2c5b688fc | refs/heads/development | 2023-04-25T03:01:48.473785 | 2021-05-05T01:36:32 | 2021-05-05T01:36:32 | 341,722,358 | 4 | 0 | null | 2021-05-05T01:36:32 | 2021-02-23T23:44:49 | Java | UTF-8 | Java | false | false | 879 | java | package com.example.receiptas;
import com.example.receiptas.model.domain_model.Participant;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class ParticipantTest {
public static final String name = "participant";
public static final boolean payer = false;
private Participant participant;
@Before
public void createParticipant(){
this.participant = new Participant(this.name, this.payer);
}
@Test
public void testGetName() {
assertEquals(this.name, this.participant.getName());
}
@Test
public void testIsPayer() {
assertEquals(this.payer, this.participant.isPayer());
}
@Test
public void testSetPayer() {
boolean isPayer = true;
this.participant.setPayer(isPayer);
assertEquals(isPayer, this.participant.isPayer());
}
}
| [
"romain.peyret@viacesi.fr"
] | romain.peyret@viacesi.fr |
178c4f5584c1075c93ea42e886aec0d687272e57 | 473b76b1043df2f09214f8c335d4359d3a8151e0 | /benchmark/bigclonebenchdata_partial/6371580.java | 4d9142bb92b4cb5bb36a950b307d06d6b6c868d4 | [] | no_license | whatafree/JCoffee | 08dc47f79f8369af32e755de01c52d9a8479d44c | fa7194635a5bd48259d325e5b0a190780a53c55f | refs/heads/master | 2022-11-16T01:58:04.254688 | 2020-07-13T20:11:17 | 2020-07-13T20:11:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,460 | java |
class c6371580 {
public void insertDomain(final List<String> domains) {
try {
connection.setAutoCommit(false);
new ProcessEnvelope().executeNull(new ExecuteProcessAbstractImpl(connection, false, false, true, true) {
@Override
public void executeProcessReturnNull() throws SQLException {
psImpl = connImpl.prepareStatement(sqlCommands.getProperty("domain.add"));
Iterator<String> iter = domains.iterator();
String domain;
while (iter.hasNext()) {
domain = iter.next();
psImpl.setString(1, domain);
psImpl.setString(2, domain.toLowerCase(locale));
psImpl.executeUpdate();
}
}
});
connection.commit();
cmDB.updateDomains(null, null);
} catch (SQLException sqle) {
log.error(sqle);
if (connection != null) {
try {
connection.rollback();
} catch (SQLException ex) {
}
}
} finally {
if (connection != null) {
try {
connection.setAutoCommit(true);
} catch (SQLException ex) {
log.error(ex);
}
}
}
}
}
| [
"piyush16066@iiitd.ac.in"
] | piyush16066@iiitd.ac.in |
bda80c0c774f09cb5745772aa336621405a7d91e | a2736fed9b089842e5449ae9ec5681dd0a2589fc | /Client/app/src/main/java/com/example/apekshakhandelwal/client/Contact_Us.java | 75defbe7f8cfa8d199cde5169869f62d833b1d61 | [] | no_license | apeksha-khandelwal/android-projects | 422325c6cf9aaff5b79add96ff0c223b83e56075 | b8de7b275a29a188fbff06698abf210aa6442c0b | refs/heads/main | 2023-04-04T16:43:41.739607 | 2021-04-09T01:05:42 | 2021-04-09T01:05:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,627 | java | package com.example.apekshakhandelwal.client;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import android.Manifest;
public class Contact_Us extends AppCompatActivity implements View.OnClickListener{
// let this be static in the app
Button address,phone,mail,link;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_contact__us);
address=(Button)findViewById(R.id.add);
mail=(Button)findViewById(R.id.id);
phone=(Button)findViewById(R.id.phone);
link=(Button)findViewById(R.id.web);
address.setOnClickListener(this);
link.setOnClickListener(this);
mail.setOnClickListener(this);
phone.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(v==address)
address(v);
else if(v==mail)
mail(v);
else if(v==phone)
phone(v);
else if(v==link)
link(v);
}
void address(View v)
{
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("google.navigation:q=an+techno india njr+udaipur"));
}
void mail(View v)
{
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { "apeksha.khandelwal23@gmail.com" });
intent.putExtra(Intent.EXTRA_SUBJECT, "subject");
intent.putExtra(Intent.EXTRA_TEXT, "mail body");
startActivity(Intent.createChooser(intent, ""));
}
void phone(View v)
{
int checkPermission = ContextCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE);
if (checkPermission != PackageManager.PERMISSION_GRANTED) {
Toast.makeText(this,"Permisiion denied!", Toast.LENGTH_SHORT).show();
}
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);
}
void link(View v)
{
Uri uri = Uri.parse("http://technonjr.org/"); // missing 'http://' will cause crashed
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
}
| [
"khandelwal.ap@northeastern.edu"
] | khandelwal.ap@northeastern.edu |
c842793b13274440872c2b183c17e17b002a1b53 | 902d3dfa33f961ee04bff0a3b521f6a2b47beb9d | /src/nl/sogeti/battleship/Game.java | fc0561d2c67ea43bb1c07b69f0cde38a6ed6ab38 | [] | no_license | johandj123/BattleShip | 23f279f82f63a9c704800c5ade9673aa024d0bc4 | 6f5112becfcee8799e8524a01330e9c40d64701c | refs/heads/master | 2023-01-08T09:28:57.537673 | 2020-11-13T10:48:53 | 2020-11-13T10:48:53 | 312,548,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,399 | java | package nl.sogeti.battleship;
import java.util.Scanner;
public class Game {
private Board myBoard = new Board();
private Board opponentBoard = new Board();
private Scanner scanner = new Scanner(System.in);
private boolean isMyTurn = true;
public void play() {
while (!myBoard.isGameLost() && !opponentBoard.isGameLost()) {
if (isMyTurn) {
printBoards();
myTurn();
} else {
opponentTurn();
}
isMyTurn = !isMyTurn;
}
}
private void printBoards() {
myBoard.boardToText(false).forEach(System.out::println);
System.out.println();
opponentBoard.boardToText(true).forEach(System.out::println);
}
public void myTurn() {
int x = scanner.nextInt();
int y = scanner.nextInt();
performAttack(new Coordinate(x, y), opponentBoard);
}
public void opponentTurn() {
Coordinate coordinate = myBoard.randomCoordinate();
System.out.println("Computer attacks " + coordinate);
performAttack(coordinate, myBoard);
}
private void performAttack(Coordinate coordinate, Board board) {
boolean hit = board.attackCoordinate(coordinate);
if (hit) {
System.out.println("BOOM!!!");
} else {
System.out.println("Miss");
}
}
}
| [
"johan.de.jong@sogeti.com"
] | johan.de.jong@sogeti.com |
b07a0f983fdf0f70efd4f194610209d225678363 | 3e19e438c259a47e28f567047c0d5ec174dcd412 | /app/src/main/java/com/audio/demo/audiointeraction/MainApplication.java | 0064ceb8c3fe4dd9db6df9c3d62d843ba0c34430 | [] | no_license | ScottTamg/AudioInteraction | 594b4bd0ea8944e9f236f97b5e9459650e75224e | 61c31464e7eef0565e687b0e5c2cf24d04ad7cca | refs/heads/master | 2020-03-24T13:11:02.753788 | 2018-08-10T06:46:47 | 2018-08-10T06:46:47 | 142,737,556 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,042 | java | package com.audio.demo.audiointeraction;
import android.app.Application;
import com.audio.demo.audiointeraction.callback.MyTTTRtcEngineEventHandler;
import com.wushuangtech.wstechapi.TTTRtcEngine;
import java.util.Random;
public class MainApplication extends Application{
public MyTTTRtcEngineEventHandler mMyTTTRtcEngineEventHandler;
@Override
public void onCreate() {
super.onCreate();
Random mRandom = new Random();
LocalConfig.mLoginUserID = mRandom.nextInt(999999);
//1.设置SDK的回调接收类
mMyTTTRtcEngineEventHandler = new MyTTTRtcEngineEventHandler(getApplicationContext());
//2.创建SDK的实例对象
// 音视频模式用a967ac491e3acf92eed5e1b5ba641ab7 纯音频模式用496e737d22ecccb8cfa780406b9964d0
TTTRtcEngine mTTTEngine = TTTRtcEngine.create(getApplicationContext(), "a967ac491e3acf92eed5e1b5ba641ab7",
mMyTTTRtcEngineEventHandler);
if (mTTTEngine == null) {
System.exit(0);
}
}
}
| [
"1601576874@qq.com"
] | 1601576874@qq.com |
fee3ca96eb6bc6ad0d480deba2a04524ab5f541c | b7287cbb811d4d90c11fc5053ee02d40fbad0f83 | /src/com/miss/pictureload/ImageLoader.java | f5040c2cd8172b352c8671d27e82539645954999 | [] | no_license | missmisslonely/happyflower | cdd5a898a4c70b0d027d59fc361abfc3a93cfe82 | 4679aadc58f4a51161d006a7d0853e6cb5d50fef | refs/heads/master | 2021-01-01T03:48:22.130219 | 2016-05-26T04:57:58 | 2016-05-26T04:57:58 | 58,112,534 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,418 | java | package com.miss.pictureload;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Collections;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.qlf.plants.R;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.widget.ImageView;
public class ImageLoader {
MemoryCache memoryCache=new MemoryCache();
FileCache fileCache;
private Map<ImageView, String> imageViews=Collections.synchronizedMap(new WeakHashMap<ImageView, String>());
ExecutorService executorService;
public ImageLoader(Context context){
fileCache=new FileCache(context);
executorService=Executors.newFixedThreadPool(5);
}
final int stub_id = R.drawable.head_image;
public void DisplayImage(String url, ImageView imageView)
{
imageViews.put(imageView, url);
Bitmap bitmap=memoryCache.get(url);
if(bitmap!=null)
imageView.setImageBitmap(bitmap);
else
{
queuePhoto(url, imageView);
imageView.setImageResource(stub_id);
}
}
private void queuePhoto(String url, ImageView imageView)
{
PhotoToLoad p=new PhotoToLoad(url, imageView);
System.out.println("����ͼƬ��ַurl--->"+url);
executorService.submit(new PhotosLoader(p));
}
private Bitmap getBitmap(String url)
{
File f = fileCache.getFile(url);
// �ȴ��ļ������в����Ƿ���
Bitmap b = null;
if (f != null && f.exists()){
b = decodeFile(f);
}
if (b != null){
return b;
}
try {
Bitmap bitmap=null;
URL imageUrl = new URL(url);
HttpURLConnection conn = (HttpURLConnection)imageUrl.openConnection();
conn.setConnectTimeout(30000);
conn.setReadTimeout(30000);
conn.setInstanceFollowRedirects(true);
System.out.println("��ȡͼƬ��--->");
InputStream is=conn.getInputStream();
OutputStream os = new FileOutputStream(f);
Utils.CopyStream(is, os);
System.out.println("����ͼƬ��--->");
os.close();
bitmap = decodeFile(f);
return bitmap;
} catch (Exception ex){
ex.printStackTrace();
System.out.println("ͼƬ��������--->");
return null;
}
}
private Bitmap decodeFile(File f){
try {
BitmapFactory.Options o = new BitmapFactory.Options();
o.inJustDecodeBounds = true;
BitmapFactory.decodeStream(new FileInputStream(f),null,o);
final int REQUIRED_SIZE=70;
int width_tmp=o.outWidth, height_tmp=o.outHeight;
int scale=1;
while(true){
if(width_tmp/2<REQUIRED_SIZE || height_tmp/2<REQUIRED_SIZE)
break;
width_tmp/=2;
height_tmp/=2;
scale*=2;
}
BitmapFactory.Options o2 = new BitmapFactory.Options();
o2.inSampleSize=scale;
return BitmapFactory.decodeStream(new FileInputStream(f), null, o2);
} catch (FileNotFoundException e) {}
return null;
}
private class PhotoToLoad
{
public String url;
public ImageView imageView;
public PhotoToLoad(String u, ImageView i){
url=u;
imageView=i;
}
}
class PhotosLoader implements Runnable {
PhotoToLoad photoToLoad;
PhotosLoader(PhotoToLoad photoToLoad){
this.photoToLoad=photoToLoad;
}
@Override
public void run() {
if(imageViewReused(photoToLoad))
return;
Bitmap bmp=getBitmap(photoToLoad.url);
memoryCache.put(photoToLoad.url, bmp);
if(imageViewReused(photoToLoad))
return;
BitmapDisplayer bd=new BitmapDisplayer(bmp, photoToLoad);
Activity a=(Activity)photoToLoad.imageView.getContext();
a.runOnUiThread(bd);
}
}
boolean imageViewReused(PhotoToLoad photoToLoad){
String tag=imageViews.get(photoToLoad.imageView);
if(tag==null || !tag.equals(photoToLoad.url))
return true;
return false;
}
class BitmapDisplayer implements Runnable
{
Bitmap bitmap;
PhotoToLoad photoToLoad;
public BitmapDisplayer(Bitmap b, PhotoToLoad p){bitmap=b;photoToLoad=p;}
public void run()
{
if(imageViewReused(photoToLoad))
return;
if(bitmap!=null)
photoToLoad.imageView.setImageBitmap(bitmap);
else
photoToLoad.imageView.setImageResource(stub_id);
}
}
public void clearCache() {
memoryCache.clear();
fileCache.clear();
}
}
| [
"874470346@qq.com"
] | 874470346@qq.com |
4c0e8f9b5701d2bbb7ae67f3c49f0a90ae51dbc5 | a398f23dad24a598d00da0e2a2bb78f3ee6cfd8c | /imagetoast/src/test/java/com/doomers/imagetoast/ExampleUnitTest.java | cc002e4e28c859219ec1bc16f28fe854bfa1c58a | [
"Apache-2.0"
] | permissive | rohitnotes/ImageToast | ab449795b5f00b298a063b1c19a55d3b070eba44 | ae6ee7d3d17c3ddf04148afc54972cba2ffca6b9 | refs/heads/master | 2021-09-06T12:09:04.533606 | 2018-02-06T10:44:00 | 2018-02-06T10:44:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 315 | java | package com.doomers.imagetoast;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"rahul40800@gmail.com"
] | rahul40800@gmail.com |
1e0d08c1c065a6c202f931badeefe528e1e4f62c | 12d2882971ba4034cb5c62507f64ab48e688efd3 | /communicating-vessels-web/src/main/java/me/rybka/dmytro/util/WebResources.java | f749c84f84ae28e4aa03e5a0e07dd6ede5f96acd | [] | no_license | DmytroRybka/CommunicatingVessels | 3db69594338aab5f70fe24eb99aed257632b96d7 | c6f2ff2f50d6ed5c826492d0f7eb4d9b768136c3 | refs/heads/master | 2020-12-31T04:28:18.477459 | 2016-05-18T23:30:55 | 2016-05-18T23:30:55 | 58,677,159 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 568 | java | package me.rybka.dmytro.util;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.faces.context.FacesContext;
/**
* This class uses CDI to alias Java EE resources, such as the persistence context, to CDI beans
*
* <p>
* Example injection on a managed bean field:
* </p>
*
* <pre>
* @Inject
* private EntityManager em;
* </pre>
*/
public class WebResources {
@Produces
@RequestScoped
public FacesContext produceFacesContext() {
return FacesContext.getCurrentInstance();
}
}
| [
"d.rybka@external.oberthur.com"
] | d.rybka@external.oberthur.com |
0e3cff382e250a76bf9b0233b56844f785049e9b | db84d8ee9d9930f6ed7eea9b531000cb853c2b42 | /okhttputil/src/main/java/com/awesome/okhttp/builder/OtherRequestBuilder.java | a8213431dcfed4e700000c5f8921c4a5a4024c5b | [] | no_license | yueshow/CBMS | 5bff2142db81bcb4d56fd67a30b270166b343b89 | 945bd6f7b759600f4b445d67994fd17c3351b9a7 | refs/heads/master | 2021-04-05T23:30:59.415433 | 2018-03-08T10:37:43 | 2018-03-08T10:37:43 | 124,375,913 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,152 | java | package com.awesome.okhttp.builder;
import com.awesome.okhttp.request.OtherRequest;
import com.awesome.okhttp.request.RequestCall;
import okhttp3.RequestBody;
/**
* Create: 05/01/18 , 上午11:28
* Author: 越秀
* Version: V100R001C01
* Changes (from 05/01/18)
* *
* -----------------------------------------------------------------
* 文件描述 :DELETE、PUT、PATCH等其他方法
* -----------------------------------------------------------------
*/
public class OtherRequestBuilder extends OkHttpRequestBuilder<OtherRequestBuilder> {
private RequestBody requestBody;
private String method;
private String content;
public OtherRequestBuilder(String method) {
this.method = method;
}
@Override
public RequestCall build() {
return new OtherRequest(requestBody, content, method, url, tag, params, headers, id).build();
}
public OtherRequestBuilder requestBody(RequestBody requestBody) {
this.requestBody = requestBody;
return this;
}
public OtherRequestBuilder requestBody(String content) {
this.content = content;
return this;
}
}
| [
"yuki@YukideMacBook-Pro.local"
] | yuki@YukideMacBook-Pro.local |
601558ab70022f353d1679c4fcf928e85fb154ee | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/mm/plugin/messenger/b/a.java | 586675d78ed6ea6eed5a55ba22e9a11d89a49789 | [] | 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 | 16,269 | java | package com.tencent.mm.plugin.messenger.b;
import android.content.Context;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.ClickableSpan;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.messenger.a.e;
import com.tencent.mm.plugin.messenger.a.e.a;
import com.tencent.mm.plugin.messenger.a.e.b;
import com.tencent.mm.plugin.messenger.a.e.c;
import com.tencent.mm.plugin.messenger.foundation.a.o;
import com.tencent.mm.pluginsdk.ui.e.j;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ah;
import com.tencent.mm.sdk.platformtools.al;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.sdk.platformtools.br;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public final class a
implements e
{
private Map<String, LinkedList<e.b>> oqU;
private Map<String, LinkedList<e.a>> oqV;
private Map<String, HashSet<e.c>> oqW;
private com.tencent.mm.at.a.d.a<Long, CharSequence> oqX;
private com.tencent.mm.at.a.d.a<Long, CharSequence> oqY;
public o oqZ;
public a()
{
AppMethodBeat.i(136923);
this.oqU = new HashMap();
this.oqV = new HashMap();
this.oqW = new HashMap();
this.oqX = new com.tencent.mm.at.a.d.a(200);
this.oqY = new com.tencent.mm.at.a.d.a(500);
this.oqZ = new a.1(this);
AppMethodBeat.o(136923);
}
private static void J(CharSequence paramCharSequence)
{
int i = 0;
AppMethodBeat.i(136934);
if ((paramCharSequence != null) && (paramCharSequence.length() > 0) && ((paramCharSequence instanceof Spanned)))
{
paramCharSequence = (ClickableSpan[])((Spanned)paramCharSequence).getSpans(0, paramCharSequence.length(), ClickableSpan.class);
if ((paramCharSequence != null) && (paramCharSequence.length > 0))
{
int j = paramCharSequence.length;
while (i < j)
{
if (!(paramCharSequence[i] instanceof com.tencent.mm.ui.base.a.a))
{
paramCharSequence = new IllegalArgumentException("hy: actively throw Exception!!! all clickable spans must be instance of com.tencent.mm.ui.base.span.IPressableSpan!");
AppMethodBeat.o(136934);
throw paramCharSequence;
}
i++;
}
}
}
AppMethodBeat.o(136934);
}
private static boolean RD(String paramString)
{
AppMethodBeat.i(136937);
boolean bool;
if (("tmpl_type_profile".equals(paramString)) || ("tmpl_type_profilewithrevoke".equals(paramString)) || ("tmpl_type_profilewithrevokeqrcode".equals(paramString)) || ("tmpl_type_wxappnotifywithview".equals(paramString)) || ("tmpl_type_succeed_contact".equals(paramString)) || ("tmpl_type_jump_chat".equals(paramString)))
{
bool = true;
AppMethodBeat.o(136937);
}
while (true)
{
return bool;
bool = false;
AppMethodBeat.o(136937);
}
}
private static boolean RE(String paramString)
{
AppMethodBeat.i(136938);
boolean bool;
if (("link_profile".equals(paramString)) || ("link_revoke".equals(paramString)) || ("link_revoke_qrcode".equals(paramString)) || ("link_plain".equals(paramString)) || ("link_view_wxapp".equals(paramString)) || ("link_succeed_contact".equals(paramString)) || ("link_jump_chat".equals(paramString)) || ("link_admin_explain".equals(paramString)))
{
bool = true;
AppMethodBeat.o(136938);
}
while (true)
{
return bool;
bool = false;
AppMethodBeat.o(136938);
}
}
private CharSequence a(Map<String, String> paramMap, Bundle paramBundle, WeakReference<Context> paramWeakReference, int paramInt)
{
AppMethodBeat.i(136932);
ArrayList localArrayList1 = new ArrayList();
int i = 0;
Object localObject1 = new StringBuilder();
Object localObject2;
if (i == 0)
{
localObject2 = "";
label35: localObject2 = localObject2;
localObject2 = ".sysmsg.sysmsgtemplate.content_template" + (String)localObject2;
if (bo.isNullOrNil((String)paramMap.get(localObject2)))
break label862;
localObject1 = (String)paramMap.get((String)localObject2 + ".$type");
if (!RD((String)localObject1))
{
ab.w("MicroMsg.SysMsgTemplateImp", "hy: non supported type: %s", new Object[] { localObject1 });
localArrayList1.add(q((String)localObject2, paramMap));
}
localObject2 = (String)paramMap.get((String)localObject2 + ".template");
ab.v("MicroMsg.SysMsgTemplateImp", "hy: rawTemplate : %s", new Object[] { localObject2 });
localObject2 = b.RF((String)localObject2);
if (localObject2 != null)
break label278;
}
label278: for (int j = 0; ; j = ((ArrayList)localObject2).size())
{
ab.d("MicroMsg.SysMsgTemplateImp", "hy: parsed %d models", new Object[] { Integer.valueOf(j) });
if ((localObject2 != null) && (((ArrayList)localObject2).size() != 0))
break label288;
localArrayList1.add(new SpannableString(""));
i++;
break;
localObject2 = Integer.valueOf(i);
break label35;
}
label288: ArrayList localArrayList2 = new ArrayList();
Iterator localIterator = ((ArrayList)localObject2).iterator();
label651: label909: label910:
while (true)
{
label304: b.a locala;
if (localIterator.hasNext())
{
locala = (b.a)localIterator.next();
if (locala.type == 0)
{
localArrayList2.add(new SpannableString(j.b(ah.getContext(), locala.content)));
}
else if (locala.type == 1)
{
j = 0;
localObject2 = ".sysmsg.sysmsgtemplate.content_template" + ".link_list.link";
if (j == 0)
break label909;
localObject2 = (String)localObject2 + j;
}
}
else
{
while (true)
{
if (bo.isNullOrNil((String)paramMap.get(localObject2)))
break label910;
localObject1 = (String)paramMap.get((String)localObject2 + ".$name");
String str;
label553: boolean bool;
if (locala.content.equals(localObject1))
{
str = (String)paramMap.get((String)localObject2 + ".$type");
if (paramInt != 0)
break label690;
localObject1 = (List)this.oqU.get(str);
if ((localObject1 != null) && (((List)localObject1).size() > 0))
break label626;
localObject1 = null;
if ((RE(str)) && (localObject1 != null))
break label657;
str = bo.bc(str, "");
if (localObject1 != null)
break label651;
bool = true;
label583: ab.i("MicroMsg.SysMsgTemplateImp", "alvinluo not support link type: %s or listener == null: %b", new Object[] { str, Boolean.valueOf(bool) });
localArrayList2.add(q((String)localObject2, paramMap));
}
label783:
while (true)
{
j++;
break;
label626: localObject1 = (e.b)((LinkedList)this.oqU.get(str)).getLast();
break label553;
bool = false;
break label583;
label657: localObject2 = ((e.b)localObject1).a(paramMap, (String)localObject2, paramBundle, paramWeakReference);
J((CharSequence)localObject2);
localArrayList2.add(nullAsNil((CharSequence)localObject2));
continue;
label690: if (paramInt == 1)
{
localObject1 = (List)this.oqV.get(str);
if ((localObject1 == null) || (((List)localObject1).size() <= 0));
for (localObject1 = null; ; localObject1 = (e.a)((LinkedList)this.oqV.get(str)).getLast())
{
if ((RE(str)) && (localObject1 != null))
break label783;
localArrayList2.add(q((String)localObject2, paramMap));
break;
}
localArrayList2.add(bo.nullAsNil(((e.a)localObject1).g(paramMap, (String)localObject2)));
}
else
{
ab.e("MicroMsg.SysMsgTemplateImp", "hy: not supported digest type");
}
}
ab.e("MicroMsg.SysMsgTemplateImp", "hy: invalid! should not get here");
break label304;
localObject2 = concactSpannable(localArrayList2);
ab.v("MicroMsg.SysMsgTemplateImp", "hy: concatedvalue is %s", new Object[] { localObject2 });
localArrayList1.add(localObject2);
break;
label862: if (localArrayList1.size() == 0)
{
ab.w("MicroMsg.SysMsgTemplateImp", "hy: not handled");
paramMap = new SpannableString("");
AppMethodBeat.o(136932);
}
while (true)
{
return paramMap;
paramMap = concactSpannable(localArrayList1);
AppMethodBeat.o(136932);
}
}
}
}
}
private static CharSequence concactSpannable(ArrayList<CharSequence> paramArrayList)
{
AppMethodBeat.i(136935);
SpannableString localSpannableString = new SpannableString("");
Iterator localIterator = paramArrayList.iterator();
for (paramArrayList = localSpannableString; localIterator.hasNext(); paramArrayList = TextUtils.concat(new CharSequence[] { paramArrayList, (CharSequence)localIterator.next() }));
AppMethodBeat.o(136935);
return paramArrayList;
}
private static CharSequence nullAsNil(CharSequence paramCharSequence)
{
AppMethodBeat.i(136933);
if ((paramCharSequence == null) || (paramCharSequence.length() == 0))
{
paramCharSequence = new SpannableString("");
AppMethodBeat.o(136933);
}
while (true)
{
return paramCharSequence;
AppMethodBeat.o(136933);
}
}
private static CharSequence q(String paramString, Map<String, String> paramMap)
{
AppMethodBeat.i(136936);
int i;
if (bo.getInt((String)paramMap.get(paramString + ".$hidden"), 0) == 1)
{
i = 1;
if (i == 0)
break label80;
ab.v("MicroMsg.SysMsgTemplateImp", "hy: hide");
paramString = new SpannableString("");
AppMethodBeat.o(136936);
}
while (true)
{
return paramString;
i = 0;
break;
label80: paramString = (String)paramMap.get(paramString + ".plain");
paramString = new SpannableString(j.b(ah.getContext(), bo.nullAsNil(paramString)));
AppMethodBeat.o(136936);
}
}
public final void QB(String paramString)
{
AppMethodBeat.i(136927);
ab.i("MicroMsg.SysMsgTemplateImp", "hy: removing template listener: %s", new Object[] { paramString });
if (!this.oqU.containsKey(paramString))
ab.w("MicroMsg.SysMsgTemplateImp", "[removeTemplateListener] mHandleListener is not contains this linkName:%s", new Object[] { paramString });
LinkedList localLinkedList = (LinkedList)this.oqU.get(paramString);
ab.i("MicroMsg.SysMsgTemplateImp", "[removeTemplateListener] linkName(%s) list size:%s", new Object[] { paramString, Integer.valueOf(localLinkedList.size()) });
if (localLinkedList.size() > 0)
localLinkedList.removeLast();
AppMethodBeat.o(136927);
}
public final void QC(String paramString)
{
AppMethodBeat.i(136929);
ab.i("MicroMsg.SysMsgTemplateImp", "hy: removing digest listener: %s", new Object[] { paramString });
if (!this.oqV.containsKey(paramString))
ab.w("MicroMsg.SysMsgTemplateImp", "[removeTemplateListener] mHandleListener is not contains this linkName:%s", new Object[] { paramString });
LinkedList localLinkedList = (LinkedList)this.oqV.get(paramString);
ab.i("MicroMsg.SysMsgTemplateImp", "[removeDigestListener] linkName(%s) list size:%s", new Object[] { paramString, Integer.valueOf(localLinkedList.size()) });
if (localLinkedList.size() > 0)
localLinkedList.removeLast();
AppMethodBeat.o(136929);
}
public final CharSequence QD(String paramString)
{
AppMethodBeat.i(136931);
if (bo.isNullOrNil(paramString))
{
ab.w("MicroMsg.SysMsgTemplateImp", "hy: [digest] request translate content is null!");
AppMethodBeat.o(136931);
paramString = null;
}
while (true)
{
return paramString;
paramString = br.z(paramString, "sysmsg");
if (paramString == null)
{
ab.i("MicroMsg.SysMsgTemplateImp", "hy: [digest] not retrieved sysmsg from new xml!");
AppMethodBeat.o(136931);
paramString = null;
}
else
{
String str = (String)paramString.get(".sysmsg.$type");
if ((bo.isNullOrNil(str)) || (!"sysmsgtemplate".equals(str)))
{
ab.w("MicroMsg.SysMsgTemplateImp", "hy: [digest] not acceptable sysmsg: %s", new Object[] { str });
AppMethodBeat.o(136931);
paramString = null;
}
else
{
paramString = a(paramString, null, null, 1);
AppMethodBeat.o(136931);
}
}
}
}
public final CharSequence a(String paramString, Bundle paramBundle, WeakReference<Context> paramWeakReference)
{
AppMethodBeat.i(136930);
if (bo.isNullOrNil(paramString))
{
ab.w("MicroMsg.SysMsgTemplateImp", "hy: request translate content is null!");
AppMethodBeat.o(136930);
paramString = null;
}
while (true)
{
return paramString;
Map localMap = br.z(paramString, "sysmsg");
if (localMap == null)
{
ab.i("MicroMsg.SysMsgTemplateImp", "hy: not retrieved sysmsg from new xml!");
AppMethodBeat.o(136930);
paramString = null;
}
else
{
paramString = (String)localMap.get(".sysmsg.$type");
if ((bo.isNullOrNil(paramString)) || (!"sysmsgtemplate".equals(paramString)))
{
ab.w("MicroMsg.SysMsgTemplateImp", "hy: not acceptable sysmsg: %s", new Object[] { paramString });
AppMethodBeat.o(136930);
paramString = null;
}
else
{
paramString = a(localMap, paramBundle, paramWeakReference, 0);
AppMethodBeat.o(136930);
}
}
}
}
public final void a(String paramString, e.a parama)
{
AppMethodBeat.i(136928);
ab.i("MicroMsg.SysMsgTemplateImp", "hy: adding digest listener: %s", new Object[] { paramString });
if (!this.oqV.containsKey(paramString))
this.oqV.put(paramString, new LinkedList());
if (!((List)this.oqV.get(paramString)).contains(parama))
((LinkedList)this.oqV.get(paramString)).add(parama);
AppMethodBeat.o(136928);
}
public final void a(String paramString, e.b paramb)
{
AppMethodBeat.i(136926);
ab.i("MicroMsg.SysMsgTemplateImp", "hy: adding template listener: %s", new Object[] { paramString });
if (!this.oqU.containsKey(paramString))
this.oqU.put(paramString, new LinkedList());
if (!((List)this.oqU.get(paramString)).contains(paramb))
((LinkedList)this.oqU.get(paramString)).add(paramb);
AppMethodBeat.o(136926);
}
public final void a(String paramString, e.c paramc)
{
AppMethodBeat.i(136924);
al.d(new a.2(this, paramString, paramc));
AppMethodBeat.o(136924);
}
public final void b(String paramString, e.c paramc)
{
AppMethodBeat.i(136925);
al.d(new a.3(this, paramString, paramc));
AppMethodBeat.o(136925);
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes5-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.messenger.b.a
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
019ed552577222e7c8a13c02ce64342d39f1e34b | be1ec926074d1912e14a17297688f4bbeb070823 | /src/main/java/com/itrex/navigator/graph/path/element/AbstractPathElementList.java | 3f2499dad2dfeb6b8ff8a8db6ba9cf7c4d6eb455 | [] | no_license | AlexeySkadorva/navigator | 88c4239f61b6138cab8d1eb6cec914c6c48d5a16 | 07cc296e3c392cbc54d10e787ce06517ec75c134 | refs/heads/master | 2020-04-10T06:34:40.309394 | 2018-12-13T09:15:48 | 2018-12-13T09:15:48 | 160,858,739 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,357 | java | package com.itrex.navigator.graph.path.element;
import org.jgrapht.Graph;
import org.jgrapht.Graphs;
import java.util.AbstractList;
import java.util.ArrayList;
/*
* Analog of org.jgrapht.alg.shortestpath.AbstractPathElementList class.
* Changed class modifier to public and deleted maxSize field.
*/
public abstract class AbstractPathElementList<V, E, T extends AbstractPathElement<V, E>> extends AbstractList<T> {
protected Graph<V, E> graph;
public ArrayList<T> pathElements = new ArrayList<>();
protected V vertex;
protected AbstractPathElementList(Graph<V, E> graph, AbstractPathElementList<V, E, T> elementList, E edge) {
this.graph = graph;
this.vertex = Graphs.getOppositeVertex(graph, edge, elementList.getVertex());
}
protected AbstractPathElementList(Graph<V, E> graph, T pathElement) {
this.graph = graph;
this.vertex = pathElement.getVertex();
this.pathElements.add(pathElement);
}
protected AbstractPathElementList(Graph<V, E> graph, V vertex) {
this.graph = graph;
this.vertex = vertex;
}
@Override
public T get(int index) {
return this.pathElements.get(index);
}
public V getVertex() {
return this.vertex;
}
@Override
public int size() {
return this.pathElements.size();
}
} | [
"leshaskadorva@gmail.com"
] | leshaskadorva@gmail.com |
dc04f3857cf08d80901c9bba03e04c6cd7457429 | bf2966abae57885c29e70852243a22abc8ba8eb0 | /aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/transform/OutputLocationJsonUnmarshaller.java | f957251df140f706b0cedee562f313394a1fb621 | [
"Apache-2.0"
] | permissive | kmbotts/aws-sdk-java | ae20b3244131d52b9687eb026b9c620da8b49935 | 388f6427e00fb1c2f211abda5bad3a75d29eef62 | refs/heads/master | 2021-12-23T14:39:26.369661 | 2021-07-26T20:09:07 | 2021-07-26T20:09:07 | 246,296,939 | 0 | 0 | Apache-2.0 | 2020-03-10T12:37:34 | 2020-03-10T12:37:33 | null | UTF-8 | Java | false | false | 2,965 | java | /*
* Copyright 2016-2021 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.robomaker.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.robomaker.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* OutputLocation JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OutputLocationJsonUnmarshaller implements Unmarshaller<OutputLocation, JsonUnmarshallerContext> {
public OutputLocation unmarshall(JsonUnmarshallerContext context) throws Exception {
OutputLocation outputLocation = new OutputLocation();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("s3Bucket", targetDepth)) {
context.nextToken();
outputLocation.setS3Bucket(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("s3Prefix", targetDepth)) {
context.nextToken();
outputLocation.setS3Prefix(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return outputLocation;
}
private static OutputLocationJsonUnmarshaller instance;
public static OutputLocationJsonUnmarshaller getInstance() {
if (instance == null)
instance = new OutputLocationJsonUnmarshaller();
return instance;
}
}
| [
""
] | |
c82bd7c34a52608f36f04dced2a780ffb46b3ef7 | 037415285031e0ff3cc3891c70824946ee45b352 | /한이진/JAVA/TeamProject/src/Ex.java | f8e1037f287fe03273e9e557a6b4bb8a0a337b10 | [] | no_license | kb-ict/20210111_AI_BigData_class | f157634baf0614e443046d699a90b31dc15a8b26 | 0516b1a322cb43602086b689b7b7d93e238024db | refs/heads/main | 2023-06-16T18:17:53.421908 | 2021-07-16T05:30:03 | 2021-07-16T05:30:03 | 346,164,949 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,467 | java | //
//import java.awt.event.ActionEvent;
//import java.awt.event.ActionListener;
//import java.sql.CallableStatement;
//import java.sql.Connection;
//import java.sql.DriverManager;
//import java.sql.PreparedStatement;
//import java.sql.ResultSet;
//import java.util.Scanner;
//
//import javax.swing.JTable;
//import javax.swing.JTextField;
//import javax.swing.table.DefaultTableModel;
//
//public class Ex {
// JTable table;
// Connection conn = null;
// PreparedStatement pstmt = null;
// ResultSet rs = null;
// CallableStatement cs=null;
//
//
// public Ex(JTable table, int page) {
// this.table = table;
//
// try {
// Class.forName("oracle.jdbc.driver.OracleDriver");
// conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "AI", "1234");
//
//
// // 프로시저를 사용한 select문(이재문)
// cs = conn.prepareCall("begin proc_lib_pagination(?,?,?,?,?); end;");
// cs.setString(3, "BID");
// cs.setString(4, "y");
//
// cs.registerOutParameter(5, oracle.jdbc.OracleTypes.CURSOR);
//
// cs.execute();
// rs = (ResultSet) cs.getObject(5);
//
// String str[] = new String[5];
// DefaultTableModel model = (DefaultTableModel) table.getModel();
// model.setNumRows(0);
// int temp =0;
// while (rs.next()) {
// temp++;
// str[0] = rs.getString("BID");
// str[1] = rs.getString("TITLE");
// str[2] = rs.getString("AUTHOR");
// str[3] = rs.getString("COPYRIGHT");
// str[4] = rs.getString("YEAR");
//
// model = (DefaultTableModel) table.getModel();
// model.addRow(str);
//
// }
//// System.out.println("row count = "+temp);
//
// } catch (Exception ex) {
// // TODO: handle exception
// ex.printStackTrace();
// } finally {
// try
// {
// conn.close();
// if (rs != null) {
// rs.close();
// }
// if (pstmt != null) {
// pstmt.close();
// }
// if (conn != null) {
// conn.close();
// }
// if (cs != null) {
// cs.close();
// }
// }
// catch (Exception e2)
// {
// // TODO: handle exception
// e2.printStackTrace();
// }
//
// }
// }
//
//} | [
"gksdlwls123@naver.com"
] | gksdlwls123@naver.com |
384f5e25f006e24ff9d0441eb05ac1d5e3b2bd3d | d4ac2b70331d26d32cdc06009f5afd9b4f06bc24 | /week2/Example/src/com/revature/DAO/DAO.java | 1b40d050024dd1518f352d37e72cf6765217b9d2 | [] | no_license | Revature1705May15Java/1705May15Java | ed85c3d31c5f926e642ac82fe6ace146f54ed729 | 44a3631fa416da30c909a0d282f135c8a3f5f0e0 | refs/heads/master | 2022-12-16T14:12:38.942622 | 2017-07-17T19:29:00 | 2017-07-17T19:29:00 | 91,478,686 | 1 | 0 | null | 2022-12-16T00:40:52 | 2017-05-16T16:11:42 | JavaScript | UTF-8 | Java | false | false | 762 | java | package com.revature.DAO;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.revature.UTIL.ConnectionUTIL;
public class DAO {
public String getDepartment(int key){
try (Connection connect = ConnectionUTIL.getConnection();){
String sql = "SELECT * FROM Department WHERE dept_id = ?";
PreparedStatement ps = connect.prepareStatement(sql);
ps.setInt(1, key);
ResultSet rs = ps.executeQuery();
String dept = null;
while(rs.next()){
dept = rs.getString("dept_name");
}
rs.close();
return dept;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
}
| [
"genesis.bonds@revature.com"
] | genesis.bonds@revature.com |
00752569ca455e486ae781c572c3249d520a504f | 1c928bb17cba70c9ed50b0b2b0f2b493c3eee6cf | /app/src/main/java/com/techneapps/triviaapp/view/quiz/SecondQuizQuestionActivity.java | b17baa7403aebf9831efca4fe1e8ccc1bb4b25a5 | [] | no_license | SivaAggzz/Trivia-App | 149c51208a9a0e78e8b94154342e2c095fa30c5e | 04f6febd2e71941897811fc719ce3fdc9443b594 | refs/heads/master | 2021-03-19T21:19:05.597051 | 2020-03-13T20:14:15 | 2020-03-13T20:14:37 | 247,147,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,700 | java | package com.techneapps.triviaapp.view.quiz;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider;
import androidx.room.Room;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.techneapps.triviaapp.R;
import com.techneapps.triviaapp.database.QuizHistoryDatabase;
import com.techneapps.triviaapp.database.models.QuizHistory;
import com.techneapps.triviaapp.databinding.ActivitySecondQuizQuestionBinding;
import com.techneapps.triviaapp.utils.QuizHistoryViewModelFactory;
import com.techneapps.triviaapp.viewmodel.QuizHistoryViewModel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Objects;
import static com.techneapps.triviaapp.repo.StaticQuestionsRepo.getSecondQuestion;
public class SecondQuizQuestionActivity extends AppCompatActivity {
private ActivitySecondQuizQuestionBinding secondQuizQuestionBinding;
private QuizHistoryViewModel quizHistoryViewModel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//data binding initialization
secondQuizQuestionBinding = DataBindingUtil.setContentView(this, R.layout.activity_second_quiz_question);
secondQuizQuestionBinding.setQuestionAnswer(getSecondQuestion());
initializeViewModel();
initializeViews();
}
@Override
protected void onResume() {
super.onResume();
getWindow().setNavigationBarColor(Color.parseColor("#000000"));
}
private void initializeViewModel() {
//quiz History Database initialization
QuizHistoryDatabase quizHistoryDatabase = Room.databaseBuilder(this, QuizHistoryDatabase.class, "quiz_history.db").build();
quizHistoryViewModel = new ViewModelProvider(this, new QuizHistoryViewModelFactory(quizHistoryDatabase))
.get(QuizHistoryViewModel.class);
}
private void initializeViews() {
//setting setOnCheckedChangeListener to toggle next button state accordingly
secondQuizQuestionBinding.radioOption1.setOnCheckedChangeListener((buttonView, isChecked) -> {
secondQuizQuestionBinding.radioOption1.setChecked(isChecked);
if (isChecked) {
enableNextButton();
} else {
if (secondQuizQuestionBinding.radioOption2.isChecked()
|| secondQuizQuestionBinding.radioOption3.isChecked()
|| secondQuizQuestionBinding.radioOption4.isChecked()) {
enableNextButton();
} else {
disableNextButton();
}
}
});
secondQuizQuestionBinding.radioOption2.setOnCheckedChangeListener((buttonView, isChecked) -> {
secondQuizQuestionBinding.radioOption2.setChecked(isChecked);
if (isChecked) {
enableNextButton();
} else {
if (secondQuizQuestionBinding.radioOption1.isChecked()
|| secondQuizQuestionBinding.radioOption3.isChecked()
|| secondQuizQuestionBinding.radioOption4.isChecked()) {
enableNextButton();
} else {
disableNextButton();
}
}
});
secondQuizQuestionBinding.radioOption3.setOnCheckedChangeListener((buttonView, isChecked) -> {
secondQuizQuestionBinding.radioOption3.setChecked(isChecked);
if (isChecked) {
enableNextButton();
} else {
if (secondQuizQuestionBinding.radioOption1.isChecked()
|| secondQuizQuestionBinding.radioOption2.isChecked()
|| secondQuizQuestionBinding.radioOption4.isChecked()) {
enableNextButton();
} else {
disableNextButton();
}
}
});
secondQuizQuestionBinding.radioOption4.setOnCheckedChangeListener((buttonView, isChecked) -> {
secondQuizQuestionBinding.radioOption4.setChecked(isChecked);
if (isChecked) {
enableNextButton();
} else {
if (secondQuizQuestionBinding.radioOption1.isChecked()
|| secondQuizQuestionBinding.radioOption2.isChecked()
|| secondQuizQuestionBinding.radioOption3.isChecked()) {
enableNextButton();
} else {
disableNextButton();
}
}
});
}
private void disableNextButton() {
secondQuizQuestionBinding.nextBtn.setEnabled(false);
}
private void enableNextButton() {
secondQuizQuestionBinding.nextBtn.setEnabled(true);
}
public void goToNextPage(View view) {
//called when user press the next button
if (validateUserAnswerSelection()) {
QuizHistory currentQuizHistoryObject = getCurrentQuizHistoryObject();
quizHistoryViewModel.addQuizHistory(currentQuizHistoryObject, (resultID) -> {
Intent showResultIntent = new Intent(SecondQuizQuestionActivity.this, QuizResultActivity.class);
showResultIntent.putExtra("currentQuizHistoryID", resultID);
startActivity(showResultIntent);
});
}
}
private QuizHistory getCurrentQuizHistoryObject() {
//method which creates a QuizHistory object , using the data entered by the user
QuizHistory quizHistory = new QuizHistory();
//this attributes are already passed to this activity by previous activities,so just get them
quizHistory.setUserName(Objects.requireNonNull(getIntent().getExtras()).getString("userName"));
//this attribute is not passed previously,so get currentTimeMillis
quizHistory.setTimeStamp(System.currentTimeMillis());
//this attributes are already passed to this activity by previous activities,so just get them
quizHistory.setQuizQuestion1(Objects.requireNonNull(getIntent().getExtras()).getString("question1"));
quizHistory.setQuizAnswered1(Objects.requireNonNull(getIntent().getExtras()).getString("answer1"));
quizHistory.setQuizQuestion2(secondQuizQuestionBinding.quizSecondQuestionTextView.getText().toString().trim());
quizHistory.setQuizAnswered2(getSelectedAnswer());
return quizHistory;
}
private String getSelectedAnswer() {
//get the values which user has selected
ArrayList<String> selectedItem = new ArrayList<>();
if (secondQuizQuestionBinding.radioOption1.isChecked()) {
// answer+=secondQuizQuestionBinding.radioOption1.getText().toString();
selectedItem.add(secondQuizQuestionBinding.radioOption1.getText().toString());
}
if (secondQuizQuestionBinding.radioOption2.isChecked()) {
// answer+=","+secondQuizQuestionBinding.radioOption2.getText().toString();
selectedItem.add(secondQuizQuestionBinding.radioOption2.getText().toString());
}
if (secondQuizQuestionBinding.radioOption3.isChecked()) {
// answer+=","+secondQuizQuestionBinding.radioOption3.getText().toString();
selectedItem.add(secondQuizQuestionBinding.radioOption3.getText().toString());
}
if (secondQuizQuestionBinding.radioOption4.isChecked()) {
// answer+=","+secondQuizQuestionBinding.radioOption4.getText().toString();
selectedItem.add(secondQuizQuestionBinding.radioOption4.getText().toString());
}
return Collections.singletonList(selectedItem).toString().replace("[", "").replace("]", "");
}
private boolean validateUserAnswerSelection() {
//validate if user has selected any option
if (!isAnyOptionSelectedByUser()) {
Toast.makeText(this, "Please select your answer before continuing.", Toast.LENGTH_SHORT).show();
return false;
} else {
return true;
}
}
private boolean isAnyOptionSelectedByUser() {
//validate if user has selected any option
if (secondQuizQuestionBinding.radioOption1.isChecked()) {
return true;
} else if (secondQuizQuestionBinding.radioOption2.isChecked()) {
return true;
} else if (secondQuizQuestionBinding.radioOption3.isChecked()) {
return true;
} else return secondQuizQuestionBinding.radioOption4.isChecked();
}
}
| [
"sivaaggzz@gmail.com"
] | sivaaggzz@gmail.com |
845081b8a7431b37f400a09d49314acf387d3496 | 74c0d85417dccd0403ae0ea4662e06743ef639c2 | /implements/param-finder/src/main/java/com/tihiy/fxclient/element/LineChartController.java | efb13b77e407081b756df6c7882cae995f5c63dc | [] | no_license | TihiyTi/HeartLive | 32b146f5276e47826c3e05e253402192cfd00e82 | d17adff821070e5ec5ffcd0b66d30e46c1e1671f | refs/heads/master | 2016-09-09T23:02:14.073594 | 2015-05-26T05:22:02 | 2015-05-26T05:22:02 | 5,828,532 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,588 | java | package com.tihiy.fxclient.element;
import com.tihiy.fxclient.element.interfaces.AbstractSignalController;
import javafx.beans.property.ListProperty;
import javafx.beans.property.SimpleListProperty;
import javafx.fxml.Initializable;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import java.net.URL;
import java.util.ResourceBundle;
public class LineChartController extends AbstractSignalController implements Initializable{
public LineChart<Number,Number> chart;
public NumberAxis xAxis;
public NumberAxis yAxis;
public String id;
ListProperty<Double> listXProperty = new SimpleListProperty<>();
@Override
public void initialize(URL location, ResourceBundle resources) {
bindAll();
}
@Override
public void bindSignal() {
if (models.size()!=0){
models.forEach(e -> {
e.getSignal().addListener((observable, oldValue, newValue) -> {
XYChart.Series<Number, Number> series = new XYChart.Series<>();
series.setName(e.getName().getValue());
for (int i = 0; i < newValue.size(); i++) {
series.getData().add(new XYChart.Data<>(1. * i / e.getSampleFreq().getValue(), newValue.get(i)));
}
chart.getData().add(series);
});
});
}
}
@Override
public void bindName() {
chart.setTitle("Test title");
}
@Override
public void bindSampleFreq() {
}
}
| [
"tihiy-ti@mail.ru"
] | tihiy-ti@mail.ru |
8ee460dbcd85e7c4fe7d71857b861afa98d6e56e | 7475645dfba27bc75eba07e780b116116178e7b9 | /exec/java-exec/src/main/codegen/templates/CastHigh.java | 934b60b8895e85e784082031e344d7bf8fb59027 | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | yssharma/pig-on-drill | 9c25b4f493a768a2d8d3218281a2975bf4d924d0 | 16bc26320c0ffac545982c6f3d9f381160af3630 | refs/heads/master | 2016-09-11T10:30:37.633663 | 2014-10-22T07:20:18 | 2014-10-22T07:20:18 | 25,564,723 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,236 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
<@pp.dropOutputFile />
<@pp.changeOutputFile name="/org/apache/drill/exec/expr/fn/impl/gcast/CastHighFunctions.java" />
<#include "/@includes/license.ftl" />
package org.apache.drill.exec.expr.fn.impl.gcast;
import org.apache.drill.exec.expr.DrillSimpleFunc;
import org.apache.drill.exec.expr.annotations.FunctionTemplate;
import org.apache.drill.exec.expr.annotations.FunctionTemplate.NullHandling;
import org.apache.drill.exec.expr.annotations.Output;
import org.apache.drill.exec.expr.annotations.Param;
import org.apache.drill.exec.expr.holders.*;
import javax.inject.Inject;
import io.netty.buffer.DrillBuf;
import org.apache.drill.exec.record.RecordBatch;
public class CastHighFunctions {
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(CastHighFunctions.class);
<#list casthigh.types as type>
@SuppressWarnings("unused")
@FunctionTemplate(name = "casthigh", scope = FunctionTemplate.FunctionScope.SIMPLE, nulls=NullHandling.NULL_IF_NULL)
public static class CastHigh${type.from} implements DrillSimpleFunc {
@Param ${type.from}Holder in;
<#if type.from.contains("Decimal")>
@Output ${type.from}Holder out;
<#else>
@Output ${type.to}Holder out;
</#if>
public void setup(RecordBatch incoming) {}
public void eval() {
<#if type.value >
out.value = (double) in.value;
<#else>
out = in;
</#if>
}
}
</#list>
}
| [
"jacques@apache.org"
] | jacques@apache.org |
1289a290b294cab7ff24ba67ee7265f172b88056 | 1f44b78c22b859fdcab0d9d4bef13cda2b03abd5 | /src/activity/notification/User.java | e506aa5c01b9dbcf74ab4c5f87aecd098ade5ac2 | [] | no_license | cszhangzhan/ebayFriends | a1c9f40270c4a245cedda82010414ca3dac735fd | b98c6cfdb91ecd27a851df9323f46ae5cc90aa17 | refs/heads/master | 2021-01-16T01:25:41.772425 | 2013-05-26T07:58:05 | 2013-05-26T07:58:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package activity.notification;
public class User {
private String img;
private String title;
public User(String img, String title) {
this.img = img;
this.title = title;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
| [
"wtksyjpy@gmail.com"
] | wtksyjpy@gmail.com |
0255ae12e4f784a56bc52bb679a6a0240e02e222 | d9e8774143df7d446eff3da74ef69e8a0075143c | /src/test/java/org/assertj/db/navigation/ToChange_ChangeOfCreation_Integer_Test.java | 23633e8576219f3a3ca544daa682237e00b00a41 | [
"Apache-2.0"
] | permissive | Hikarigaoka/assertj-db | 0d662203671d77b70c4d0ac13a9d67d4cd48acfe | 025aab3c59eb4b79af1d60bf4f69e0c5300de5f9 | refs/heads/master | 2021-05-08T21:35:53.651674 | 2017-05-08T21:03:34 | 2017-05-08T21:03:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,168 | java | /**
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* Copyright 2012-2016 the original author or authors.
*/
package org.assertj.db.navigation;
import org.assertj.core.api.Assertions;
import org.assertj.db.api.ChangeAssert;
import org.assertj.db.api.ChangesAssert;
import org.assertj.db.common.AbstractTest;
import org.assertj.db.common.NeedReload;
import org.assertj.db.exception.AssertJDBException;
import org.assertj.db.output.ChangeOutputter;
import org.assertj.db.output.ChangesOutputter;
import org.assertj.db.type.ChangeType;
import org.assertj.db.type.Changes;
import org.junit.Test;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.db.api.Assertions.assertThat;
import static org.assertj.db.output.Outputs.output;
import static org.junit.Assert.fail;
/**
* Tests on {@link ToChange} class :
* {@link ToChange#changeOfCreation(int)} method.
*
* @author Régis Pouiller
*
*/
public class ToChange_ChangeOfCreation_Integer_Test extends AbstractTest {
/**
* This method tests the {@code changeOfCreation} with index navigation method.
*/
@Test
@NeedReload
public void test_change_of_creation_with_index_with_assertions() throws Exception {
Changes changes = new Changes(source).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
Field fieldPosition = ChangesAssert.class.getDeclaredField("changesPosition");
fieldPosition.setAccessible(true);
Field fieldList = Changes.class.getDeclaredField("changesList");
fieldList.setAccessible(true);
Field fieldIndex = PositionWithChanges.class.getDeclaredField("indexNextChangeMap");
fieldIndex.setAccessible(true);
Field fieldChange = ChangeAssert.class.getDeclaredField("change");
fieldChange.setAccessible(true);
ChangesAssert changesAssert = assertThat(changes);
PositionWithChanges<ChangesAssert, ChangeAssert> position =
(PositionWithChanges) fieldPosition.get(changesAssert);
Map<ChangeType, Map<String, Integer>> map = (Map<ChangeType, Map<String, Integer>>)fieldIndex.get(position);
assertThat(map).hasSize(0);
assertThat(map.get(null)).isNull();
ChangeAssert changeAssert0 = changesAssert.changeOfCreation(0);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(1);
ChangeAssert changeAssert1 = changesAssert.changeOfCreation(1);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(2);
ChangeAssert changeAssert2 = changesAssert.changeOfCreation(2);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(3);
try {
changesAssert.changeOfCreation(3);
fail("An exception must be raised");
} catch (AssertJDBException e) {
Assertions.assertThat(e.getMessage()).isEqualTo("Index 3 out of the limits [0, 3[");
}
try {
changesAssert.changeOfCreation(-1);
fail("An exception must be raised");
} catch (AssertJDBException e) {
Assertions.assertThat(e.getMessage()).isEqualTo("Index -1 out of the limits [0, 3[");
}
ChangeAssert changeAssertAgain0 = changesAssert.changeOfCreation(0);
assertThat(changeAssert0).isSameAs(changeAssertAgain0);
ChangesAssert changesAssertBis = assertThat(changes);
PositionWithChanges<ChangesAssert, ChangeAssert> positionBis =
(PositionWithChanges) fieldPosition.get(changesAssertBis);
map = (Map<ChangeType, Map<String, Integer>>)fieldIndex.get(positionBis);
assertThat(map).hasSize(0);
assertThat(map.get(null)).isNull();
ChangeAssert changeAssertBis0 = changesAssertBis.changeOfCreation(0);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(1);
ChangeAssert changeAssertBis1 = changeAssertBis0.changeOfCreation(1);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(2);
ChangeAssert changeAssertBis2 = changeAssertBis1.changeOfCreation(2);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(3);
try {
changeAssertBis2.changeOfCreation(3);
fail("An exception must be raised");
} catch (AssertJDBException e) {
Assertions.assertThat(e.getMessage()).isEqualTo("Index 3 out of the limits [0, 3[");
}
try {
changeAssertBis2.changeOfCreation(-1);
fail("An exception must be raised");
} catch (AssertJDBException e) {
Assertions.assertThat(e.getMessage()).isEqualTo("Index -1 out of the limits [0, 3[");
}
ChangeAssert changeAssertBisAgain0 = changeAssertBis2.changeOfCreation(0);
assertThat(changeAssertBis0).isSameAs(changeAssertBisAgain0);
List<Changes> changesList = (List<Changes>) fieldList.get(changes);
assertThat(fieldChange.get(changeAssert0)).isSameAs(fieldChange.get(changeAssertBis0)).isSameAs(changesList.get(0));
assertThat(fieldChange.get(changeAssert1)).isSameAs(fieldChange.get(changeAssertBis1)).isSameAs(changesList.get(1));
assertThat(fieldChange.get(changeAssert2)).isSameAs(fieldChange.get(changeAssertBis2)).isSameAs(changesList.get(2));
}
/**
* This method tests the {@code changeOfCreation} with index navigation method.
*/
@Test
@NeedReload
public void test_change_of_creation_with_index_with_displays() throws Exception {
Changes changes = new Changes(source).setStartPointNow();
updateChangesForTests();
changes.setEndPointNow();
Field fieldPosition = ChangesOutputter.class.getDeclaredField("changesPosition");
fieldPosition.setAccessible(true);
Field fieldList = Changes.class.getDeclaredField("changesList");
fieldList.setAccessible(true);
Field fieldIndex = PositionWithChanges.class.getDeclaredField("indexNextChangeMap");
fieldIndex.setAccessible(true);
Field fieldChange = ChangeOutputter.class.getDeclaredField("change");
fieldChange.setAccessible(true);
ChangesOutputter changesDisplay = output(changes);
PositionWithChanges<ChangesAssert, ChangeAssert> position =
(PositionWithChanges) fieldPosition.get(changesDisplay);
Map<ChangeType, Map<String, Integer>> map = (Map<ChangeType, Map<String, Integer>>)fieldIndex.get(position);
assertThat(map).hasSize(0);
assertThat(map.get(null)).isNull();
ChangeOutputter changeDisplay0 = changesDisplay.changeOfCreation(0);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(1);
ChangeOutputter changeDisplay1 = changesDisplay.changeOfCreation(1);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(2);
ChangeOutputter changeDisplay2 = changesDisplay.changeOfCreation(2);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(3);
try {
changesDisplay.changeOfCreation(3);
fail("An exception must be raised");
} catch (AssertJDBException e) {
Assertions.assertThat(e.getMessage()).isEqualTo("Index 3 out of the limits [0, 3[");
}
try {
changesDisplay.changeOfCreation(-1);
fail("An exception must be raised");
} catch (AssertJDBException e) {
Assertions.assertThat(e.getMessage()).isEqualTo("Index -1 out of the limits [0, 3[");
}
ChangeOutputter changeDisplayAgain0 = changesDisplay.changeOfCreation(0);
assertThat(changeDisplay0).isSameAs(changeDisplayAgain0);
ChangesOutputter changesDisplayBis = output(changes);
PositionWithChanges<ChangesAssert, ChangeAssert> positionBis =
(PositionWithChanges) fieldPosition.get(changesDisplayBis);
map = (Map<ChangeType, Map<String, Integer>>)fieldIndex.get(positionBis);
assertThat(map).hasSize(0);
assertThat(map.get(null)).isNull();
ChangeOutputter changeDisplayBis0 = changesDisplayBis.changeOfCreation(0);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(1);
ChangeOutputter changeDisplayBis1 = changeDisplayBis0.changeOfCreation(1);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(2);
ChangeOutputter changeDisplayBis2 = changeDisplayBis1.changeOfCreation(2);
assertThat(map).hasSize(1);
assertThat(map.get(null)).isNull();
assertThat(map.get(ChangeType.CREATION)).hasSize(1);
assertThat(map.get(ChangeType.CREATION).get(null)).isEqualTo(3);
try {
changeDisplayBis2.changeOfCreation(3);
fail("An exception must be raised");
} catch (AssertJDBException e) {
Assertions.assertThat(e.getMessage()).isEqualTo("Index 3 out of the limits [0, 3[");
}
try {
changeDisplayBis2.changeOfCreation(-1);
fail("An exception must be raised");
} catch (AssertJDBException e) {
Assertions.assertThat(e.getMessage()).isEqualTo("Index -1 out of the limits [0, 3[");
}
ChangeOutputter changeDisplayBisAgain0 = changeDisplayBis2.changeOfCreation(0);
assertThat(changeDisplayBis0).isSameAs(changeDisplayBisAgain0);
List<Changes> changesList = (List<Changes>) fieldList.get(changes);
assertThat(fieldChange.get(changeDisplay0)).isSameAs(fieldChange.get(changeDisplayBis0)).isSameAs(changesList.get(0));
assertThat(fieldChange.get(changeDisplay1)).isSameAs(fieldChange.get(changeDisplayBis1)).isSameAs(changesList.get(1));
assertThat(fieldChange.get(changeDisplay2)).isSameAs(fieldChange.get(changeDisplayBis2)).isSameAs(changesList.get(2));
}
}
| [
"regis1512@gmail.com"
] | regis1512@gmail.com |
f2abb0aeffb48c849defa5d148ad2d65e08625df | a42b5a23ae5021fe679a41167cad131bfa89eb46 | /app/src/main/java/in/mahabhujal/mahbhujalapp/ui/share/ShareViewModel.java | 73e8b0cf814d35849943f78927fd42548402725f | [] | no_license | RamolaShishupal/Mahabhujal | e8530c288f5f8a70f2c5ed1b25c01ece03bc75e0 | 11fafe724ea24dbab97a091ebfe5f19f7f898923 | refs/heads/master | 2022-04-10T12:28:45.772235 | 2020-02-23T14:41:39 | 2020-02-23T14:41:39 | 271,259,933 | 1 | 0 | null | 2020-06-10T11:35:37 | 2020-06-10T11:35:36 | null | UTF-8 | Java | false | false | 453 | java | package in.mahabhujal.mahbhujalapp.ui.share;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class ShareViewModel extends ViewModel {
private MutableLiveData<String> mText;
public ShareViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is share fragment");
}
public LiveData<String> getText() {
return mText;
}
} | [
"ameyaoka444@gmail.com"
] | ameyaoka444@gmail.com |
f6d52075320c0ef744ee0ed040aa8125d244b0b0 | 545fe9f21b0e05f32191e324535e6e3e1bcfb3f1 | /Spring-Udemy/7-Spring-Factory-beans-and-methods/src/main/java/com/pshingavi/spring/Address.java | 0277f67d5178e43e5cb2eb3fc23bae539bb2ff30 | [] | no_license | pshingavi/Java-Spring | 348591e45c25fe0a32ee1f4a5210768845854669 | a1c1a72deb1c53d327e0bce5e56337b07c22c200 | refs/heads/master | 2022-07-19T04:56:28.322808 | 2022-06-29T17:27:20 | 2022-06-29T17:27:20 | 63,443,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | package com.pshingavi.spring;
public class Address {
private String street;
private int postcode;
public Address(String street, int postcode) {
this.street = street;
this.postcode = postcode;
}
// Runs global init-method
public void onCreateMethod() {
System.out.println("Address created !");
}
public void onDestroyMethod() {
System.out.println("Address destroyed !");
}
@Override
public String toString() {
return "Address [Street= " + this.street + ", Postcode= " + this.postcode + "]";
}
}
| [
"preetams3@gmail.com"
] | preetams3@gmail.com |
e6b22ccf6552deb5d79fd5f14c9fedd876f13c4c | 6e6796b6dd0cf30396ea3cf1e89551feab95222e | /src/main/java/com/georgidinov/universitytestingtask/junit/controller/TeacherController.java | 7c51d0ebefa616b85c1a7acd20cded381ca732c8 | [] | no_license | GeorgiDinov/university-testing-task | 5d8a84407dd1cc991a9fd9ee3a0a5b6721d57751 | 7c282d678f73201d42665e26fdaa35f1d707e00c | refs/heads/master | 2023-03-09T17:19:54.430176 | 2021-02-21T13:32:59 | 2021-02-21T13:32:59 | 339,517,109 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,020 | java | package com.georgidinov.universitytestingtask.junit.controller;
import com.georgidinov.universitytestingtask.junit.api.v1.model.TeacherDTO;
import com.georgidinov.universitytestingtask.junit.api.v1.model.TeacherListDTO;
import com.georgidinov.universitytestingtask.junit.exception.CustomValidationException;
import com.georgidinov.universitytestingtask.junit.service.TeacherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import static com.georgidinov.universitytestingtask.junit.util.ApplicationConstants.TEACHER_BASE_URL;
@Slf4j
@RestController
@RequestMapping(TEACHER_BASE_URL)
public class TeacherController {
private final TeacherService teacherService;
@Autowired
public TeacherController(TeacherService teacherService) {
this.teacherService = teacherService;
}
@GetMapping
@ResponseStatus(HttpStatus.OK)
public TeacherListDTO findAllTeachers() {
log.info("TeacherController::findAllTeachers");
return this.teacherService.findAllTeachers();
}
@GetMapping("/{id}")
@ResponseStatus(HttpStatus.OK)
public TeacherDTO findTeacherById(@PathVariable String id) throws CustomValidationException {
log.info("TeacherController::findTeacherById -> id passed = {}", id);
return this.teacherService.findTeacherById(Long.valueOf(id));
}
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public TeacherDTO saveTeacher(@RequestBody TeacherDTO teacherDTO) throws CustomValidationException {
log.info("TeacherController::saveTeacher -> DTO passed = {}", teacherDTO);
return this.teacherService.saveTeacher(teacherDTO);
}
@PutMapping("/{id}")
@ResponseStatus(HttpStatus.OK)
public TeacherDTO updateTeacher(@PathVariable String id,
@RequestBody TeacherDTO teacherDTO) throws CustomValidationException {
log.info("TeacherController::saveTeacher -> id passed = {}, DTO passed = {}", id, teacherDTO);
return this.teacherService.updateTeacher(Long.valueOf(id), teacherDTO);
}
@DeleteMapping("/{id}")
@ResponseStatus(HttpStatus.OK)
public void deleteTeacherById(@PathVariable String id) throws CustomValidationException {
log.info("TeacherController::deleteTeacherById -> id passed = {}", id);
this.teacherService.deleteTeacherById(Long.valueOf(id));
}
} | [
"georgidinov1@abv.bg"
] | georgidinov1@abv.bg |
bd046bd1f2e1a000d7ae3c9b4cca7269453c6ead | 80b0bbe0ffb8578874a1e9014e249254fc1bb343 | /src/main/java/com/officer/policeofiicer/repository/BikerRepository.java | 816476e5728ff6b70a8048210d20342c025724d7 | [] | no_license | arshamsedaghatbin/police-office | 58221fdf792adf7ed4a4562100ddfcad89d80598 | 5ba881fe5fe66408ebf8826442b259ccf0b05a49 | refs/heads/master | 2021-02-05T13:49:55.272596 | 2020-03-01T17:38:57 | 2020-03-01T17:38:57 | 243,787,841 | 0 | 0 | null | 2020-02-29T23:09:08 | 2020-02-28T15:00:42 | Java | UTF-8 | Java | false | false | 377 | java | package com.officer.policeofiicer.repository;
import com.officer.policeofiicer.domain.Biker;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Spring Data repository for the Biker entity.
*/
@SuppressWarnings("unused")
@Repository
public interface BikerRepository extends JpaRepository<Biker, Long> {
}
| [
"arsham.sedaghatbin@gmail.com"
] | arsham.sedaghatbin@gmail.com |
c993181ccb09cf1955a816cf2a02565801999f5b | 9369051deb0b96e660460c104fcd27aad797cd62 | /SeleniumprojectB20/src/test/java/com/cybertek/tests/day8_Alerts_Iframe_Windows/iframe_Practice.java | eb6241237a9d2e0c5aafd15054bac67d8192d7ac | [] | no_license | asferdem/NovemberProject | 4ec70a492e9564cbbe5fb3ec5531b7150444cc0b | d6a714e9071ef28dd649aad0fd70584755bfa227 | refs/heads/master | 2023-02-10T10:18:06.442237 | 2021-01-02T21:41:00 | 2021-01-02T21:41:00 | 309,129,257 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,795 | java | package com.cybertek.tests.day8_Alerts_Iframe_Windows;
import com.cybertek.utilities.WebDriverFactory;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.concurrent.TimeUnit;
public class iframe_Practice {
WebDriver driver;
@BeforeMethod
public void setupMethod(){
driver = WebDriverFactory.getDriver("chrome");
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://practice.cybertekschool.com/iframe");
}
/*
1. Create a new class called: IframePractice
2. Create new test and make set ups
3. Go to: http://practice.cybertekschool.com/iframe
4. Assert: “Your content goes here.” Text is displayed.
5. Assert: “An iFrame containing the TinyMCE WYSIWYG Editor
*/
@Test
public void p4_iframe_practice(){
//3 ways of locating.
//1- ByIndex
//driver.switchTo().frame(0);
//2- By Id or Name
//driver.switchTo().frame("mce_0_ifr");
//3- Locate as a web element, then switch to it
WebElement iframe=driver.findElement(By.id("mce_0_ifr"));
driver.switchTo().frame(iframe);
//Locating paragraph tag as a web element
WebElement yourContentGoesHereText = driver.findElement(By.xpath("//p"));
Assert.assertTrue(yourContentGoesHereText.isDisplayed());
//driver.switchTo().defaultContent();
driver.switchTo().parentFrame();
WebElement headerText=driver.findElement(By.xpath("//h3"));
Assert.assertTrue(headerText.isDisplayed() );
}
}
| [
"ferdem4254@gmail.com"
] | ferdem4254@gmail.com |
3a737d013c944459615eb9459d42dc6d9da28a7a | bbda6895f9f436b44678ea3d7c7e7ae6a31eb8e2 | /src/com/page/pojo/PageInfo.java | ea5833f756fcaaa01a8f2edfa6627eda07bea07a | [] | no_license | 1345414527/MybatisCode | 88cea04ed6501078ea48fb2e516dad435ecc0778 | bc36f60ce0a7d153e70a1561649d1dbabd6409ab | refs/heads/master | 2021-01-16T16:25:48.202592 | 2020-02-26T06:12:52 | 2020-02-26T06:12:52 | 243,182,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 847 | java | package com.page.pojo;
import java.util.List;
public class PageInfo {
//显示每页的个数
private int pageSize;
//当前第几页
private int pageNumber;
//总页数
private long total;
//当前页显示的数据
private List<?> list;
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPageNumber() {
return pageNumber;
}
public void setPageNumber(int pageNumber) {
this.pageNumber = pageNumber;
}
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
}
public List<?> getList() {
return list;
}
public void setList(List<?> list) {
this.list = list;
}
}
| [
"1345414527@qq.com"
] | 1345414527@qq.com |
fb962f1417e6d99cb3b12ed646b64a118f4529ec | 1bcbb45ac8aa03f43a4c137a3ea9cf666f858426 | /entityold/src/main/java/com/ay/ydzf/zhifawenshu/pojo2017/WsAjclcp.java | 16cb87d0a70ab75cda8d431ee7dc811307843804 | [] | no_license | srxffcc1/Codefactory | 592865f34632d61e73c3789ed9c293c526099802 | 8f605766224513ad78e93dc240f1f0be7edea5d3 | refs/heads/master | 2022-11-01T07:17:25.246189 | 2022-10-17T09:12:08 | 2022-10-17T09:12:08 | 169,352,794 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,611 | java | package com.ay.ydzf.zhifawenshu.pojo2017;
import com.ay.framework.annotation.ChineseName;
import com.ay.framework.core.pojo.BasePojo;
//@ChineseName("案件处理呈批表")
public class WsAjclcp extends BasePojo{
@ChineseName("行政执法id")
public String xzzfid;
@ChineseName("文书名称")
public String tname;
@ChineseName("填报时间")
public String tbsj;
@ChineseName("企业ID")
public String qyid;
@ChineseName("地方")
public String pcode;
@ChineseName("字")
public String ycode;
@ChineseName("号")
public String ncode;
@ChineseName("案件名称")
public String ajmc;
@ChineseName("被处罚单位")
public String bcfdw;
@ChineseName("地址")
public String dz;
@ChineseName("法定代表人")
public String fddbr;
@ChineseName("职务")
public String zw;
@ChineseName("单位邮编")
public String dwyb;
@ChineseName("被处罚人")
public String bcfr;
@ChineseName("年龄")
public String nl;
@ChineseName("性别")
public String xb;
@ChineseName("所在单位")
public String szdw;
@ChineseName("单位地址")
public String dwdz;
@ChineseName("家庭住址")
public String jtzz;
@ChineseName("联系电话")
public String lxdh;
@ChineseName("家庭邮编")
public String jtyb;
@ChineseName("违法事实及处罚依据")
public String wfss;
@ChineseName("当事人申辩意见")
public String dsrsbyj;
@ChineseName("承办人意见")
public String cbryj;
@ChineseName("承办人签名1")
public String cbrqmy;
@ChineseName("承办人签名2")
public String cbrqme;
@ChineseName("承办人签名时间")
public String cbrqmsj;
@ChineseName("审核意见")
public String shyj;
@ChineseName("审核人签名")
public String shrqm;
@ChineseName("审核时间")
public String shsj;
@ChineseName("审批意见")
public String spyj;
@ChineseName("审批人签名")
public String sprqm;
@ChineseName("审批时间")
public String spsj;
@ChineseName("版本号")
public String version;
public String getAjmc() {
return ajmc;
}
public String getBcfdw() {
return bcfdw;
}
public String getBcfr() {
return bcfr;
}
public String getCbrqme() {
return cbrqme;
}
public String getCbrqmsj() {
return cbrqmsj;
}
public String getCbrqmy() {
return cbrqmy;
}
public String getCbryj() {
return cbryj;
}
public String getDsrsbyj() {
return dsrsbyj;
}
public String getDwdz() {
return dwdz;
}
public String getDwyb() {
return dwyb;
}
public String getDz() {
return dz;
}
public String getFddbr() {
return fddbr;
}
public String getJtyb() {
return jtyb;
}
public String getJtzz() {
return jtzz;
}
public String getLxdh() {
return lxdh;
}
public String getNcode() {
return ncode;
}
public String getNl() {
return nl;
}
public String getPcode() {
return pcode;
}
public String getQyid() {
return qyid;
}
public String getShrqm() {
return shrqm;
}
public String getShsj() {
return shsj;
}
public String getShyj() {
return shyj;
}
public String getSprqm() {
return sprqm;
}
public String getSpsj() {
return spsj;
}
public String getSpyj() {
return spyj;
}
public String getSzdw() {
return szdw;
}
public String getTbsj() {
return tbsj;
}
public String getTname() {
return tname;
}
public String getVersion() {
return version;
}
public String getWfss() {
return wfss;
}
public String getXb() {
return xb;
}
public String getXzzfid() {
return xzzfid;
}
public String getYcode() {
return ycode;
}
public String getZw() {
return zw;
}
public void setAjmc(String ajmc) {
this.ajmc = ajmc;
}
public void setBcfdw(String bcfdw) {
this.bcfdw = bcfdw;
}
public void setBcfr(String bcfr) {
this.bcfr = bcfr;
}
public void setCbrqme(String cbrqme) {
this.cbrqme = cbrqme;
}
public void setCbrqmsj(String cbrqmsj) {
this.cbrqmsj = cbrqmsj;
}
public void setCbrqmy(String cbrqmy) {
this.cbrqmy = cbrqmy;
}
public void setCbryj(String cbryj) {
this.cbryj = cbryj;
}
public void setDsrsbyj(String dsrsbyj) {
this.dsrsbyj = dsrsbyj;
}
public void setDwdz(String dwdz) {
this.dwdz = dwdz;
}
public void setDwyb(String dwyb) {
this.dwyb = dwyb;
}
public void setDz(String dz) {
this.dz = dz;
}
public void setFddbr(String fddbr) {
this.fddbr = fddbr;
}
public void setJtyb(String jtyb) {
this.jtyb = jtyb;
}
public void setJtzz(String jtzz) {
this.jtzz = jtzz;
}
public void setLxdh(String lxdh) {
this.lxdh = lxdh;
}
public void setNcode(String ncode) {
this.ncode = ncode;
}
public void setNl(String nl) {
this.nl = nl;
}
public void setPcode(String pcode) {
this.pcode = pcode;
}
public void setQyid(String qyid) {
this.qyid = qyid;
}
public void setShrqm(String shrqm) {
this.shrqm = shrqm;
}
public void setShsj(String shsj) {
this.shsj = shsj;
}
public void setShyj(String shyj) {
this.shyj = shyj;
}
public void setSprqm(String sprqm) {
this.sprqm = sprqm;
}
public void setSpsj(String spsj) {
this.spsj = spsj;
}
public void setSpyj(String spyj) {
this.spyj = spyj;
}
public void setSzdw(String szdw) {
this.szdw = szdw;
}
public void setTbsj(String tbsj) {
this.tbsj = tbsj;
}
public void setTname(String tname) {
this.tname = tname;
}
public void setVersion(String version) {
this.version = version;
}
public void setWfss(String wfss) {
this.wfss = wfss;
}
public void setXb(String xb) {
this.xb = xb;
}
public void setXzzfid(String xzzfid) {
this.xzzfid = xzzfid;
}
public void setYcode(String ycode) {
this.ycode = ycode;
}
public void setZw(String zw) {
this.zw = zw;
}
}
| [
"srxffcc1@foxmail.com"
] | srxffcc1@foxmail.com |
869812740883a90166b0ea2799c33a94b9b4c863 | 428f153d19e518777d8f9c0bf014cd6982ad610b | /src/main/java/xyz/flaflo/ytp/playlist/YouTubePlaylistParser.java | abc6f453c7b1501dac0ee31df009f1e0df2ea972 | [] | no_license | Flaflo/YouTubePlus | 29dc035f0a37717cbabaaebed7cf21313204abb4 | cc5dcb073603631ff9cbc0239e5a55046a701984 | refs/heads/master | 2020-06-19T06:37:44.538508 | 2019-09-23T14:28:33 | 2019-09-23T14:28:33 | 74,915,171 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,350 | java | package xyz.flaflo.ytp.playlist;
import java.io.IOException;
import java.text.ParseException;
import java.util.concurrent.ExecutionException;
/**
* Provides a parser for YouTube playlists
*
* @author Flaflo
*/
public final class YouTubePlaylistParser {
private String apiKey;
/**
* @param apiKey the google api key
*/
public YouTubePlaylistParser(String apiKey) {
this.apiKey = apiKey;
}
/**
* Pareses a YouTube playlist by its id
*
* @param playlistId the playlist id
* @return the parsed Playlist
* @throws java.text.ParseException
* @throws java.io.IOException
* @throws java.lang.InterruptedException
* @throws java.util.concurrent.ExecutionException
*/
public YouTubePlaylist parsePlaylist(final String playlistId) throws ParseException, IOException, InterruptedException, ExecutionException {
final ImplYouTubePlaylist playlist = new ImplYouTubePlaylist(playlistId);
playlist.parse(apiKey);
return playlist;
}
/**
* @return the google api key
*/
public String getApiKey() {
return apiKey;
}
/**
* @param apiKey the google api key
*/
public void setApiKey(final String apiKey) {
this.apiKey = apiKey;
}
}
| [
"theflaflo@yahoo.de"
] | theflaflo@yahoo.de |
f66e5b2cd5306fada06c1b0ab4185295cf1494ca | 8521badc2502fea9aef6990cf516aea822c7da6b | /SpringServer/src/main/java/com/javeriana/webservices/ECCO/repositories/PaseoEcologicoRepository.java | 36df06355f4342ac66791a5937e40874a0392867 | [] | no_license | SebastianTrianaP/ECCO | 53a421c15df91b7c99196aba2b754cdfcfe0f2f2 | 49a87b39040faf671341367487bbee4fd9111bd5 | refs/heads/master | 2023-01-07T19:30:50.519323 | 2019-12-04T03:05:00 | 2019-12-04T03:05:00 | 225,765,988 | 0 | 0 | null | 2023-01-07T12:27:23 | 2019-12-04T02:57:39 | Java | UTF-8 | Java | false | false | 485 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.javeriana.webservices.ECCO.repositories;
import com.javeriana.webservices.ECCO.Model.PaseoEcologico;
import org.springframework.data.jpa.repository.JpaRepository;
/**
*
* @author randy
*/
public interface PaseoEcologicoRepository extends JpaRepository<PaseoEcologico, Long> {
}
| [
"juan_triana@javeriana.edu.co"
] | juan_triana@javeriana.edu.co |
190f70e32139daa8b4080e9eb9173bd37c7eee69 | 88061023150cd942a8fa83bdb813d8e796caf40c | /data-entity/src/main/java/com/sdc/factor/entity/business/entity/FtsSession.java | 984146da307a34c18ec7e72548edc9e7e9acafe1 | [] | no_license | 755173247/learn | 5eab35fedbef241ac4ffbd71920da7dfdfe5c443 | dcfc15bde304822a78375e24651c8f82c2ef51d7 | refs/heads/master | 2020-05-17T12:35:52.532432 | 2019-04-27T15:41:40 | 2019-04-27T15:41:40 | 183,715,618 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,606 | java | package com.sdc.factor.entity.business.entity;
import com.sdc.factor.entity.base.entity.BaseModel;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import javax.persistence.*;
/**
* 会话
*
* @author Sean
* @since 2019-03-24
*/
@Getter
@Setter
@Accessors(chain = true)
@Entity
@Table(indexes = { @Index(columnList = "sessionUuid", unique = true) })
@ToString
public class FtsSession extends BaseModel {
@Id
@GeneratedValue(generator = "hilo")
private Long sessionId;
@Column()
private String sessionUuid;
/** 帐号ID */
@Column(nullable = false)
private Long userId;
/** 帐号名称 */
@Column(nullable = false, length = 128)
private String userName;
/** 角色ID */
@Column(nullable = false)
private Long roleId;
/** 企业Id */
@Column
private Long entId;
/** 企业名称 */
@Column(length = 128)
private String entName;
/** 是否为超级管理员 */
@Column(nullable = false)
private Boolean superUser;
/** 用户当前登录IP地址 */
@Column
private String ipAddr;
//TODO: convert session data to request context
/*
public void toCtx(Ctx ctx) {
ctx.setAccountId(getUserId());
ctx.setAccountName(getUserName());
ctx.setSession(getSessionUuid());
ctx.setOrgId(getEntId());
ctx.setOrgName(getEntName());
ctx.setSuperUser(superUser);
ctx.getExt().put("roleId", STR.toString(getRoleId().toString()));
ctx.setIpAddr(getIpAddr());
}
*/
}
| [
"13538022289@163.com"
] | 13538022289@163.com |
ea7ace3be1c532b6c5de8e2600df739f2edbd00c | 24670f7dfe64244ecfd5d90be9c8e15d6b3bf4c5 | /src/main/java/ex07/quiz/Computer.java | 082244ff8b2fb4500876b6c4d1c044b53c4559e9 | [] | no_license | hyejin000112/Spring_DI | 407f8d873241e8bd70c44cb4a176f0f483b83244 | 3a50a8d15343d0a28e026b56d0b228197ef867b9 | refs/heads/master | 2022-11-10T01:23:52.962092 | 2020-07-01T07:04:29 | 2020-07-01T07:04:29 | 276,302,641 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 371 | java | package ex07.quiz;
import org.springframework.beans.factory.annotation.Autowired;
public class Computer {
@Autowired
private Mouse mouse;
@Autowired
private Keyboard kb;
@Autowired
private Monitor monitor;
public void computerInfo() {
System.out.println("***컴퓨터 정보***");
mouse.info();
kb.info();
monitor.info();
}
}
| [
"bnanan@naver.com"
] | bnanan@naver.com |
2fed92e2f71df0818619b7b940b9ff26ef8e3431 | 6480aa2835a3579727f86e0b1a4cbaccae0b9a74 | /MITEK/src/function/ColumnsAutoSizer.java | 64cb8824a3db0989324834eac279ea404601446f | [] | no_license | tommytomz/mitek | 85a60d96bef349bc566635a176991fff9757bcfd | 995a1a4b4d2cfc15f72d7b6e80bb44926e6c2101 | refs/heads/master | 2020-12-24T12:20:45.172360 | 2016-11-14T08:26:18 | 2016-11-14T08:26:18 | 73,052,348 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,352 | 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 function;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import java.awt.Component;
import java.awt.FontMetrics;
public class ColumnsAutoSizer {
public static void sizeColumnsToFit(JTable table) {
sizeColumnsToFit(table, 5);
}
public static void sizeColumnsToFit(JTable table, int columnMargin) {
JTableHeader tableHeader = table.getTableHeader();
if(tableHeader == null) {
// can't auto size a table without a header
return;
}
FontMetrics headerFontMetrics = tableHeader.getFontMetrics(tableHeader.getFont());
int[] minWidths = new int[table.getColumnCount()];
int[] maxWidths = new int[table.getColumnCount()];
for(int columnIndex = 0; columnIndex < table.getColumnCount(); columnIndex++) {
int headerWidth = headerFontMetrics.stringWidth(table.getColumnName(columnIndex));
minWidths[columnIndex] = headerWidth + columnMargin;
int maxWidth = getMaximalRequiredColumnWidth(table, columnIndex, headerWidth);
maxWidths[columnIndex] = Math.max(maxWidth, minWidths[columnIndex]) + columnMargin;
}
adjustMaximumWidths(table, minWidths, maxWidths);
for(int i = 0; i < minWidths.length; i++) {
if(minWidths[i] > 0) {
table.getColumnModel().getColumn(i).setMinWidth(minWidths[i]);
}
if(maxWidths[i] > 0) {
table.getColumnModel().getColumn(i).setMaxWidth(maxWidths[i]);
table.getColumnModel().getColumn(i).setWidth(maxWidths[i]);
}
}
}
private static void adjustMaximumWidths(JTable table, int[] minWidths, int[] maxWidths) {
if(table.getWidth() > 0) {
// to prevent infinite loops in exceptional situations
int breaker = 0;
// keep stealing one pixel of the maximum width of the highest column until we can fit in the width of the table
while(sum(maxWidths) > table.getWidth() && breaker < 10000) {
int highestWidthIndex = findLargestIndex(maxWidths);
maxWidths[highestWidthIndex] -= 1;
maxWidths[highestWidthIndex] = Math.max(maxWidths[highestWidthIndex], minWidths[highestWidthIndex]);
breaker++;
}
}
}
private static int getMaximalRequiredColumnWidth(JTable table, int columnIndex, int headerWidth) {
int maxWidth = headerWidth;
TableColumn column = table.getColumnModel().getColumn(columnIndex);
TableCellRenderer cellRenderer = column.getCellRenderer();
if(cellRenderer == null) {
cellRenderer = new DefaultTableCellRenderer();
}
for(int row = 0; row < table.getModel().getRowCount(); row++) {
Component rendererComponent = cellRenderer.getTableCellRendererComponent(table,
table.getModel().getValueAt(row, columnIndex),
false,
false,
row,
columnIndex);
double valueWidth = rendererComponent.getPreferredSize().getWidth();
maxWidth = (int) Math.max(maxWidth, valueWidth);
}
return maxWidth;
}
private static int findLargestIndex(int[] widths) {
int largestIndex = 0;
int largestValue = 0;
for(int i = 0; i < widths.length; i++) {
if(widths[i] > largestValue) {
largestIndex = i;
largestValue = widths[i];
}
}
return largestIndex;
}
private static int sum(int[] widths) {
int sum = 0;
for(int width : widths) {
sum += width;
}
return sum;
}
public static void hiddenColumn(JTable table, int indexColumn){
table.getColumnModel().getColumn(indexColumn).setMinWidth(0);
table.getColumnModel().getColumn(indexColumn).setMaxWidth(0);
}
}
| [
"tommysuindra7@gmail.com"
] | tommysuindra7@gmail.com |
783ff6d34ab46a9d828f25f43dc0667ad5b4e54e | f03e8fbee99d5d035bd0ab40714f8ec2d31f22f9 | /app/src/main/java/net/ym/zzy/favoritenews/dao/ChannelDaoInface.java | dd4863495665d1e9dce313905df2f90011220418 | [] | no_license | zheying/NewsClient | 0fda158f31e6d999b9dd43e9ec7d9f4b6d6a4855 | 94e6eaadf092ba3da5786f86abb44f309e59e5c2 | refs/heads/master | 2021-01-10T21:31:25.845804 | 2015-05-08T16:07:30 | 2015-05-08T16:07:30 | 33,839,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 738 | java | package net.ym.zzy.favoritenews.dao;
import java.util.List;
import java.util.Map;
import android.content.ContentValues;
import net.ym.zzy.favoritenews.bean.ChannelItem;
public interface ChannelDaoInface {
public boolean addCache(ChannelItem item);
public boolean deleteCache(String whereClause, String[] whereArgs);
public boolean updateCache(ContentValues values, String whereClause,
String[] whereArgs);
public Map<String, String> viewCache(String selection,
String[] selectionArgs);
public List<Map<String, String>> listCache(String selection,
String[] selectionArgs);
public void clearFeedTable();
}
| [
"zengzheying@youmi.net"
] | zengzheying@youmi.net |
17f22e09e5ea9d038e28b9d54e7cb1cb9b9f72bd | 220ede574f1cdbf43315ddf96c18f48122b57cb8 | /src/com/homeTask/task04_01/Site.java | 1725e6fe758cc4951311de45e2443c96354bdbd8 | [] | no_license | DariiaSadik/HomeTask | fb5d1ce4966437eff52c6ece1275d54c4b9d4ca9 | ce0b52e55794417d069d9ae903dbdd3d0b32bd3d | refs/heads/master | 2021-01-15T18:03:44.599574 | 2014-12-22T00:54:47 | 2014-12-22T00:54:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,434 | java | package com.homeTask.task04_01;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
public class Site {
private static class Inner {
public static final Site instance = new Site();
}
public static Site getInstance(){
return Inner.instance;
}
private Publication[] publication = new Publication[4];
private Site() {
publication[0] = new Comersial("String title", "String contetnt", new Date(), new Date());
publication[1] = new News("String title", "String contetnt", new Date(), "String source");
publication[2] = new Articles("String title", "String contetnt", new Date(), "String author");
publication[3] = new Publication("String title", "String contetnt", new Date());
}
public Publication[] getPublication() {
return publication;
}
public void setPublication(Publication[] publication) {
this.publication = publication;
}
public Publication[] getSortPub(){
Publication[] pub = new Publication[publication.length];
System.arraycopy(publication, 0, pub, 0, publication.length);
Arrays.sort(pub);
return pub;
}
public Publication[] getSort(Comparator c){
Publication[] pub = new Publication[publication.length];
System.arraycopy(publication, 0, pub, 0, publication.length);
Arrays.sort(pub, c);
return pub;
}
}
| [
"dasha.sadik@gmail.com"
] | dasha.sadik@gmail.com |
960a30ff5c3ee19c6ceb0a1f292049f844678219 | c5203c5cecc60f33d9a9534f9f771d1c3bf04fc4 | /app/src/main/java/com/gitproject/adapters/RepoDetailsAdapter.java | 41671ae544de6235e42c4eab5d91e709b188a9f3 | [] | no_license | bijoyjoseph/GitProject | 6d42e1555dc4be734dab4ce7dcdb7b714ab0821c | d6c1412425dea1273cc36251fc190b00b0080a71 | refs/heads/master | 2020-03-18T01:33:43.064818 | 2018-05-20T13:06:28 | 2018-05-20T13:06:28 | 134,147,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,369 | java | package com.gitproject.adapters;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.gitproject.github.R;
import com.gitproject.models.RepoContentModel;
import java.util.ArrayList;
public class RepoDetailsAdapter extends RecyclerView.Adapter<RepoDetailsAdapter.DetailsViewHolder> {
private final String TAG = "RepoDetailsAdapter";
private Context context;
private ArrayList<RepoContentModel> repoContentModelArrayList;
public RepoDetailsAdapter(Context context, ArrayList<RepoContentModel> repoContentModelArrayList) {
this.context = context;
this.repoContentModelArrayList = repoContentModelArrayList;
}
public void setRepoDetailsData(ArrayList<RepoContentModel> repoContentModelArrayList) {
this.repoContentModelArrayList = repoContentModelArrayList;
notifyDataSetChanged();
}
@NonNull
@Override
public RepoDetailsAdapter.DetailsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.repo_details_layout, parent, false);
return new RepoDetailsAdapter.DetailsViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull RepoDetailsAdapter.DetailsViewHolder holder, int position) {
RepoContentModel repoContentModel = repoContentModelArrayList.get(position);
holder.tv_file_name.setText(repoContentModel.getName());
holder.tv_repo_sha.setText(repoContentModel.getSha());
holder.tv_repo_content_size.setText(Integer.toString(repoContentModel.getSize()));
holder.tv_repo_content_path.setText(repoContentModel.getPath());
holder.tv_repo_content_type.setText(repoContentModel.getType());
holder.tv_repo_content_url.setText(repoContentModel.getHtml_url());
}
@Override
public int getItemCount() {
return repoContentModelArrayList != null ? repoContentModelArrayList.size() : 0;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public int getItemViewType(int position) {
return super.getItemViewType(position);
}
public class DetailsViewHolder extends RecyclerView.ViewHolder {
private TextView tv_file_name;
private TextView tv_repo_sha;
private TextView tv_repo_content_size;
private TextView tv_repo_content_path;
private TextView tv_repo_content_type;
private TextView tv_repo_content_url;
private DetailsViewHolder(View view) {
super(view);
tv_file_name = view.findViewById(R.id.tv_file_name);
tv_repo_sha = view.findViewById(R.id.tv_repo_sha);
tv_repo_content_size = view.findViewById(R.id.tv_repo_content_size);
tv_repo_content_path = view.findViewById(R.id.tv_repo_content_path);
tv_repo_content_type = view.findViewById(R.id.tv_repo_content_type);
tv_repo_content_url = view.findViewById(R.id.tv_repo_content_url);
tv_repo_content_url.setMovementMethod(LinkMovementMethod.getInstance());
}
}
}
| [
"bijoyjsph04@gmail.com"
] | bijoyjsph04@gmail.com |
d84a02b5e49f46a616f6522bd89593bfe22d1b71 | f4e27799db9abd76354f61886efba6e00675db36 | /app/src/main/java/com/example/gfavier/partie1/WiFiJobService.java | 81d237ecaa2b056389714fd935c60c15b5ed37b1 | [] | no_license | GeoffreyFavier/crowdsourcing | e481247e3137601f0eb194f35978feb3322d3506 | 2545f38f65b96c9ec71f11788b26d1f3b8aedab9 | refs/heads/master | 2020-03-20T02:56:15.621032 | 2018-06-12T22:01:16 | 2018-06-12T22:01:16 | 137,129,208 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,421 | java | package com.example.gfavier.partie1;
import android.annotation.TargetApi;
import android.app.job.JobParameters;
import android.app.job.JobService;
import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.os.AsyncTask;
import android.util.Log;
import java.util.List;
import static android.content.ContentValues.TAG;
/**
* Created by gfavier on 16/01/18.
*/
public class WiFiJobService extends JobService {
MaTaskDeScan task1;
DBHelper dbHelper;
@Override
public boolean onStartJob(JobParameters params) {
Log.d(TAG, "onStartJob id=" + params.getJobId());
dbHelper = new DBHelper(this); //On récupère le base de données
task1 = new MaTaskDeScan();
task1.execute(params); //On lance la tâche de scan
return true;
}
@Override
public boolean onStopJob(JobParameters params) {
Log.d(TAG, "onStopJob id=" + params.getJobId());
boolean shouldReschedule = true;
return shouldReschedule;
}
private class MaTaskDeScan extends AsyncTask {
@Override
protected Object doInBackground(Object[] objects) {
WifiManager manager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); //On récupère l'objet WifiManager
//Scan des réseaux wifi disponibles
manager.startScan();
List<ScanResult> results = manager.getScanResults();
Log.d(TAG, "on recupere la liste de reseaux");
writeToDB(results);
jobFinished((JobParameters) objects[0], true);
return true;
}
//Ecrit les résultats dans la base de données
public void writeToDB(List<ScanResult> results) {
SQLiteDatabase db = dbHelper.getWritableDatabase();
for (ScanResult wifi: results) {
ContentValues values = new ContentValues();
values.put(DBContract.DBEntry.COLUMN_NAME_BSSID, wifi.BSSID);
values.put(DBContract.DBEntry.COLUMN_NAME_SSID, wifi.SSID);
values.put(DBContract.DBEntry.COLUMN_NAME_TIMESTAMP, System.currentTimeMillis());
long newRowId = db.insert(DBContract.DBEntry.TABLE_NAME, null, values);
}
}
}
}
| [
"geoffrey.favier@laposte.net"
] | geoffrey.favier@laposte.net |
aad55d91d9738d00584e413211b8800ce97939b4 | ade07d9c70b582a17b92bc5beb84320a2a0d948b | /core/src/main/java/com/aem/sample/core/servlets/SimpleServlet.java | 577dd63452262d3f5c421347ff7f5309e54bac2e | [] | no_license | Arpan190989/breadcrumb | 7a43c564b3a10b65e56ff471c2588b639641f028 | f89078dcafd3e9b2ecd60caa6bc566a11a311ba7 | refs/heads/master | 2020-03-17T16:24:16.673918 | 2018-05-17T12:48:13 | 2018-05-17T12:48:13 | 133,747,359 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,896 | java | /*
* Copyright 2015 Adobe Systems Incorporated
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aem.sample.core.servlets;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.servlets.SlingAllMethodsServlet;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import javax.servlet.ServletException;
import java.io.IOException;
/**
* Servlet that writes some sample content into the response. It is mounted for
* all resources of a specific Sling resource type. The
* {@link SlingSafeMethodsServlet} shall be used for HTTP methods that are
* idempotent. For write operations use the {@link SlingAllMethodsServlet}.
*/
@SuppressWarnings("serial")
@SlingServlet(resourceTypes = "sample/structure/page")
public class SimpleServlet extends SlingSafeMethodsServlet {
@Override
protected void doGet(final SlingHttpServletRequest req,
final SlingHttpServletResponse resp) throws ServletException, IOException {
final Resource resource = req.getResource();
resp.getOutputStream().println(resource.toString());
resp.getOutputStream().println(
"This content is generated by the SimpleServlet");
}
}
| [
"arpan.garg@accenture.com"
] | arpan.garg@accenture.com |
dbc743bc05864ad1123f3fde6473bc0395b7d4b9 | 2ea49bfaa6bc1b9301b025c5b2ca6fde7e5bb9df | /contributions/dukman/java/Testing/2016-09-21.java | b161d4f77b90a01262d4071738541ba5293fa415 | [] | no_license | 0x8801/commit | 18f25a9449f162ee92945b42b93700e12fd4fd77 | e7692808585bc7e9726f61f7f6baf43dc83e28ac | refs/heads/master | 2021-10-13T08:04:48.200662 | 2016-12-20T01:59:47 | 2016-12-20T01:59:47 | 76,935,980 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java | Writing JUnit tests using `Assert`
JUnit: Specifying file locations
The Robot Utility
Replacements for `setUp()` and `tearDown()` for **JUnit** | [
"dukman.box@gmail.com"
] | dukman.box@gmail.com |
95df2f205ab75b9b4a5077bb00764a44562eb75a | 5f4fe92c208f33615a035cba589cf756d63ec698 | /src/android/SquareReader.java | 746ea087025f5dd321d8a7a1f8545eee1647bf95 | [
"MIT"
] | permissive | jonathanz/cordova-square-reader | 568a8ed7e51b20ba0c4afe506b3137b5225da6a5 | ae1718349ec20028f10cc032ff063dd3a9c9839f | refs/heads/master | 2020-04-16T06:40:01.373701 | 2019-01-25T07:42:18 | 2019-01-25T07:42:18 | 165,356,127 | 0 | 0 | MIT | 2019-01-12T06:41:12 | 2019-01-12T06:41:12 | null | UTF-8 | Java | false | false | 1,215 | java | package org.apache.cordova.plugin;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CallbackContext;
import android.support.multidex.MultiDex;
import com.squareup.sdk.reader.ReaderSdk;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* This class echoes a string called from JavaScript.
*/
public class SquareReader extends CordovaPlugin {
@Override
protected void pluginInitialize() {
ReaderSdk.initialize(cordova.getActivity().getApplication());
MultiDex.install(cordova.getActivity().getApplication());
}
@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
if (action.equals("echo")) {
String message = args.getString(0);
this.echo(message, callbackContext);
return true;
}
return false;
}
private void echo(String message, CallbackContext callbackContext) {
if (message != null && message.length() > 0) {
callbackContext.success(message);
} else {
callbackContext.error("Expected one non-empty string argument.");
}
}
} | [
"hao.zhang@downtown8.com"
] | hao.zhang@downtown8.com |
cea58f8731ec58e6057e9f2408aa26e4b7b00825 | e0089275433a01e6836b6742fedf0e5e42bfb874 | /spring_project/Spring-DI/src/member/service/MemberRegService2.java | 8a420802a906325ccc87fef7386ff8238192b2bc | [] | no_license | rainty02/JavaTheorem | 82b1240d06f6fccce6a4994df64efb50e3085db5 | c283e0275ed76f3433ad9e95525825a8592e0ec8 | refs/heads/main | 2023-08-27T08:22:15.953130 | 2021-09-29T14:58:56 | 2021-09-29T14:58:56 | 371,240,224 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 833 | java | package member.service;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import member.dao.Dao;
import member.domain.Member;
import member.domain.RegRequest;
public class MemberRegService2 {
//@Autowired
//@Qualifier("member1")
@Resource(name="guestDao")
private Dao dao;
public void regMember(RegRequest request) throws Exception {
// 중복 이메일 체크, 예외발생
Member member = dao.selectByEmail(request.getEmail());
if(member != null) {
throw new Exception("이미 존재하는 이메일주소입니다.");
}
Member newMember = new Member(0, request.getEmail(), request.getPassword(), request.getName(), new Date());
dao.insert(newMember);
}
}
| [
"rainty02@gmail.com"
] | rainty02@gmail.com |
5f7dc94aa5dda0f5a409dcea397bd92313ccaaf2 | beabb1c398577f377120b6a4f10f1711f9a1e844 | /src/java/org/openmarkov/core/gui/dialog/LanguageDialog.java | f0e570b915a593c2ef9107740c3d5c530274bd11 | [] | no_license | kkroo/OpenMarkov | 3051da32bde4bbe8a74a36c16d54e16d6090f2f6 | 8884f1eecd64d8ffb7c0be5b84c27ff0ab8a5275 | refs/heads/master | 2020-06-02T15:12:29.177389 | 2014-12-08T07:03:29 | 2014-12-08T07:03:29 | 26,507,704 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 25,715 | java | /*
* Copyright 2011 CISIAD, UNED, Spain Licensed under the European Union Public
* Licence, version 1.1 (EUPL) Unless required by applicable law, this code is
* distributed on an "AS IS" basis, WITHOUT WARRANTIES OF ANY KIND.
*/
package org.openmarkov.core.gui.dialog;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.LayoutStyle;
import javax.swing.WindowConstants;
import org.apache.log4j.Logger;
import org.openmarkov.core.gui.loader.element.OpenMarkovLogoIcon;
import org.openmarkov.core.gui.localize.Languages;
import org.openmarkov.core.gui.localize.LocaleChangeEvent;
import org.openmarkov.core.gui.localize.LocaleChangeListener;
import org.openmarkov.core.gui.localize.StringDatabase;
/**
* Change Language Dialog to set the language of the application
* @author jlgozalo
* @version 1.0 26 Jun 2009
*/
public class LanguageDialog extends JDialog
implements
LocaleChangeListener
{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* singleton
*/
private static LanguageDialog languageDialog = null;
/**
* components of the dialog
*/
private JComboBox<String> jComboBoxLanguages;
private JLabel jLabelLanguageChoice;
private JTextArea jTextAreaInstructions;
private JButton jButtonAccept;
private JButton jButtonCancel;
private JButton jButtonApply;
/**
* String database
*/
private StringDatabase stringDatabase = StringDatabase.getUniqueInstance ();
/**
* to store temporally the old language to set
*/
private String oldLanguage;
private Logger logger;
/**
* singleton for LanguageDialog
* @return a LanguageDialog dialog
*/
public static LanguageDialog getUniqueInstance ()
{
return getUniqueInstance (null);
}
/**
* singleton for LanguageDialog
* @param parent the parent for the LanguageDialog frame
* @return a LanguageDialog dialog
*/
public static LanguageDialog getUniqueInstance (JFrame parent)
{
if (languageDialog == null)
{ // singleton
languageDialog = new LanguageDialog (parent);
}
return languageDialog;
}
/**
* constructor on a parent JFrame
* @param parent
*/
private LanguageDialog (JFrame parent)
{
super (parent, "", true);
setName ("LanguageDialog");
this.logger = Logger.getLogger (LanguageDialog.class);
this.oldLanguage = stringDatabase.getLanguage ();
stringDatabase.addLocaleChangeListener (this);
try
{
this.setDefaultCloseOperation (WindowConstants.DISPOSE_ON_CLOSE);
initialize ();
}
catch (Exception e)
{
logger.fatal (e);
}
}
/**
* initialize the dialog
* @throws Exception
*/
private void initialize ()
throws Exception
{
final GroupLayout groupLayout = new GroupLayout (getContentPane ());
groupLayout.setHorizontalGroup (groupLayout.createParallelGroup (GroupLayout.Alignment.LEADING).addGroup (groupLayout.createSequentialGroup ().addGroup (groupLayout.createParallelGroup (GroupLayout.Alignment.LEADING).addGroup (GroupLayout.Alignment.TRAILING,
groupLayout.createSequentialGroup ().addContainerGap ().addComponent (getJLabelLanguageChoice (),
GroupLayout.DEFAULT_SIZE,
201,
Short.MAX_VALUE).addPreferredGap (LayoutStyle.ComponentPlacement.RELATED).addComponent (getJComboBoxLanguages (),
GroupLayout.PREFERRED_SIZE,
234,
GroupLayout.PREFERRED_SIZE)).addGroup (groupLayout.createSequentialGroup ().addGap (102,
102,
102).addComponent (getJButtonAccept ()).addPreferredGap (LayoutStyle.ComponentPlacement.RELATED).addComponent (getJButtonCancel (),
GroupLayout.PREFERRED_SIZE,
96,
GroupLayout.PREFERRED_SIZE).addPreferredGap (LayoutStyle.ComponentPlacement.RELATED).addComponent (getJButtonApply ())).addGroup (groupLayout.createSequentialGroup ().addContainerGap ().addComponent (getJTextAreaInstructions (),
GroupLayout.DEFAULT_SIZE,
447,
Short.MAX_VALUE))).addContainerGap ()));
groupLayout.setVerticalGroup (groupLayout.createParallelGroup (GroupLayout.Alignment.LEADING).addGroup (groupLayout.createSequentialGroup ().addContainerGap ().addGroup (groupLayout.createParallelGroup (GroupLayout.Alignment.LEADING,
false).addComponent (getJLabelLanguageChoice (),
GroupLayout.DEFAULT_SIZE,
GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE).addComponent (getJComboBoxLanguages ())).addGap (14,
14,
14).addComponent (getJTextAreaInstructions (),
GroupLayout.PREFERRED_SIZE,
91,
GroupLayout.PREFERRED_SIZE).addPreferredGap (LayoutStyle.ComponentPlacement.RELATED,
79,
Short.MAX_VALUE).addGroup (groupLayout.createParallelGroup (GroupLayout.Alignment.BASELINE).addComponent (getJButtonAccept ()).addComponent (getJButtonCancel (),
GroupLayout.PREFERRED_SIZE,
25,
GroupLayout.PREFERRED_SIZE).addComponent (getJButtonApply ())).addContainerGap ()));
groupLayout.linkSize (javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {
getJButtonAccept (), getJButtonCancel (), getJButtonApply ()});
groupLayout.linkSize (javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {
getJButtonAccept (), getJButtonCancel (), getJButtonApply ()});
getContentPane ().setLayout (groupLayout);
setTitle (stringDatabase.getString ("LanguageDialog.Title.Text"));
setModal (true);
setIconImage (OpenMarkovLogoIcon.getUniqueInstance ().getOpenMarkovLogoIconImage16 ());
pack ();
}
/**
* @return label to choice language combobox
*/
protected JLabel getJLabelLanguageChoice ()
{
if (jLabelLanguageChoice == null)
{
jLabelLanguageChoice = new JLabel ();
jLabelLanguageChoice.setName ("LanguageDialog.jLabelLanguageChoice");
jLabelLanguageChoice.setText ("a Label");
jLabelLanguageChoice.setText (stringDatabase.getString ("LanguageDialog.jLabelLanguageChoice.Text"));
}
return jLabelLanguageChoice;
}
/**
* @return a combo box to choice language
*/
protected JComboBox<String> getJComboBoxLanguages ()
{
if (jComboBoxLanguages == null)
{
jComboBoxLanguages = new JComboBox<String> (Languages.getStringList ());
jComboBoxLanguages.setName ("LanguageDialog.jComboBoxLanguages");
jComboBoxLanguages.setEditable (false);
// jComboBoxLanguages.setMaximumRowCount(2); // two languages by now
// jComboBoxLanguages.setSelectedIndex(findLanguageIndex(this.oldLanguage));
if (this.oldLanguage.equals ("es"))
{
jComboBoxLanguages.setSelectedIndex (1);
}
else if (this.oldLanguage.equals ("en"))
{
jComboBoxLanguages.setSelectedIndex (0);
}
else
{
// future languages
}
// special behavior to handle i18n
StringDatabase.getUniqueInstance ().addLocaleChangeListener (new LocaleChangeListener ()
{
public void processLocaleChange (final LocaleChangeEvent event)
{
int prevSelectedIndex = jComboBoxLanguages.getSelectedIndex ();
jComboBoxLanguages.removeAllItems ();
for (String item : Languages.getStringList ())
{
jComboBoxLanguages.addItem (item);
}
jComboBoxLanguages.setSelectedIndex (prevSelectedIndex);
}
});
}
return jComboBoxLanguages;
}
/**
* @return button accept
*/
protected JButton getJButtonAccept ()
{
if (jButtonAccept == null)
{
jButtonAccept = new JButton ();
jButtonAccept.addActionListener (new ActionListener ()
{
public void actionPerformed (final ActionEvent e)
{
String newLanguage = Languages.getShortNameByIndex (jComboBoxLanguages.getSelectedIndex ());
stringDatabase.setLanguage (newLanguage);
// next line must be re-written to use some Event method
// to notify visibility to false instead calling
// getParent()
jButtonAccept.getParent ().getParent ().getParent ().getParent ().setVisible (false);
}
});
jButtonAccept.setName ("Ok");
jButtonAccept.setText ("OK Button");
jButtonAccept.setText (stringDatabase.getString ("LanguageDialog.jButtonAccept.Text"));
}
return jButtonAccept;
}
/**
* @return button cancel
*/
protected JButton getJButtonCancel ()
{
if (jButtonCancel == null)
{
jButtonCancel = new JButton ();
jButtonCancel.addActionListener (new ActionListener ()
{
public void actionPerformed (final ActionEvent e)
{
StringDatabase.getUniqueInstance ().setLanguage (oldLanguage);
// next line must be re-written to use some Event method
// to notify visibility to false instead calling
// getParent()
jButtonCancel.getParent ().getParent ().getParent ().getParent ().setVisible (false);
}
});
jButtonCancel.setName ("Cancel");
jButtonCancel.setText ("Cancel Button");
jButtonCancel.setText (stringDatabase.getString ("LanguageDialog.jButtonCancel.Text"));
}
return jButtonCancel;
}
/**
* @return button apply
*/
protected JButton getJButtonApply ()
{
if (jButtonApply == null)
{
jButtonApply = new JButton ();
jButtonApply.addActionListener (new ActionListener ()
{
public void actionPerformed (final ActionEvent arg0)
{
String newLanguage = Languages.getShortNameByIndex (jComboBoxLanguages.getSelectedIndex ());
StringDatabase.getUniqueInstance ().setLanguage (newLanguage);
}
});
jButtonApply.setName ("Apply");
jButtonApply.setText ("Apply Button");
jButtonApply.setText (stringDatabase.getString ("LanguageDialog.jButtonApply.Text"));
}
return jButtonApply;
}
/**
* @return a text area with instructions
*/
protected JTextArea getJTextAreaInstructions ()
{
if (jTextAreaInstructions == null)
{
jTextAreaInstructions = new JTextArea ();
jTextAreaInstructions.setLineWrap (true);
jTextAreaInstructions.setWrapStyleWord (true);
jTextAreaInstructions.setEditable (false);
jTextAreaInstructions.setName ("LanguageDialog.jTextAreaInstructions");
jTextAreaInstructions.setText ("jTextAreaInstructions");
jTextAreaInstructions.setText (stringDatabase.getString ("LanguageDialog.jTextAreaInstructions.Text"));
}
return jTextAreaInstructions;
}
/**
* process a change in the String Resource Locale, settings all the labels
* menus, and strings in the application to the new selected language
*/
public void processLocaleChange (LocaleChangeEvent event)
{
this.oldLanguage = stringDatabase.getLanguage ();
stringDatabase.allComponentsUpdateSetText (this);
stringDatabase.allComponentsUpdateSetText (this.getParent ());
repaint ();
}
/**
* Find a language index in the combo box list of the dialog
* @param language - the language to find the position in the combo box
* @return the index of the language in the combo box
*/
protected int findLanguageIndex (String language)
{
int index = 0;
for (int i = 0; i < jComboBoxLanguages.getItemCount (); i++, index++)
{
if (jComboBoxLanguages.getItemAt (index).equals (language))
{
break;
}
}
return index;
}
}
| [
"omar.ramadan93@gmail.com"
] | omar.ramadan93@gmail.com |
4b181749d42d2aa5320ce462c978a98f5a9fb38c | 0205999a193bf670cd9d6e5b37e342b75f4e15b8 | /spring-context/src/main/java/org/springframework/format/datetime/standard/YearFormatter.java | e93771bc70dbb9dc812d5d8d3d46291494c8cbab | [
"Apache-2.0"
] | permissive | leaderli/spring-source | 18aa9a8c7c5e22d6faa6167e999ff88ffa211ba0 | 0edd75b2cedb00ad1357e7455a4fe9474b3284da | refs/heads/master | 2022-02-18T16:34:19.625966 | 2022-01-29T08:56:48 | 2022-01-29T08:56:48 | 204,468,286 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,281 | java | /*
* Copyright 2002-2018 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 org.springframework.format.datetime.standard;
import org.springframework.format.Formatter;
import java.text.ParseException;
import java.time.Year;
import java.util.Locale;
/**
* {@link Formatter} implementation for a JSR-310 {@link Year},
* following JSR-310's parsing rules for a Year.
*
* @author Juergen Hoeller
* @see Year#parse
* @since 5.0.4
*/
class YearFormatter implements Formatter<Year> {
@Override
public Year parse(String text, Locale locale) throws ParseException {
return Year.parse(text);
}
@Override
public String print(Year object, Locale locale) {
return object.toString();
}
}
| [
"429243408@qq.com"
] | 429243408@qq.com |
77be570e920758027f1c21215d99c7cb862f6d43 | 1b6ae88353600578c1167bf854887aa1cd70963e | /kgengine/src/test/java/kgraph/Distrib.java | 03ddabc94feea280661351c5c5568d6e93411f3c | [] | no_license | Ahmedko/corese | 8a2fddde7b51d4e4830b7b51528732d828c3f588 | 6c746bdc3b3ae45ad5e90ef2be959e31ae84913d | refs/heads/master | 2021-05-10T21:48:39.771470 | 2018-01-24T09:41:24 | 2018-01-24T09:41:24 | 118,238,712 | 0 | 1 | null | 2018-01-20T11:57:10 | 2018-01-20T11:57:10 | null | UTF-8 | Java | false | false | 617 | java | package kgraph;
import fr.inria.acacia.corese.exceptions.EngineException;
import fr.inria.edelweiss.kgram.core.Mappings;
import fr.inria.edelweiss.kgraph.core.Graph;
import fr.inria.edelweiss.kgraph.query.QueryProcess;
public class Distrib {
public static void main(String[] args){
new Distrib().process();
}
void process(){
Graph g = Graph.create();
QueryProcess exec = QueryProcess.create(g);
String q = "select * where {?x ?p ?y}";
try {
Mappings map = exec.query(q);
System.out.println(map.size());
} catch (EngineException e) {
e.printStackTrace();
}
}
}
| [
"olivier.corby@inria.fr"
] | olivier.corby@inria.fr |
fea66e028fcc08d252df2d96df1bdff2371874c1 | 6fedcad7fdcca7d48e46d5357c7b66899b6a5576 | /20200818/src/TestDemo.java | 29ff693507a1268d53fffa604beea13535f56f3e | [] | no_license | Sherry280/java-code | 8749ea51d1dc86320bf695032e12537843689095 | 622be50ab35e4d9836520916d1145dadc583e4f6 | refs/heads/master | 2023-08-14T18:45:47.712272 | 2021-10-13T14:08:11 | 2021-10-13T14:08:11 | 280,135,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,262 | java |
public class TestDemo {
static class Node {
public Node next;
public int data;
public Node(int data) {
this.data = data;
}
public Node(int[] arr) {
if (arr == null || arr.length == 0) {
throw new IllegalArgumentException("arr can to be empty");
}
this.data = arr[0];
Node cur = this;
for (int i = 1; i < arr.length; i++) {
cur.next = new Node(arr[i]);
cur = cur.next;
}
}
@Override
public String toString() {
StringBuilder res=new StringBuilder();
Node cur=this;
while(cur!=null){
res.append(cur.data+"->");
cur=cur.next;
}
res.append("NULL");
return res.toString();
}
}
//给定一个链表(不带头结点),删除链表的倒数第K个节点,并且返回链表的头结点。
public Node removeNthFromEnd(Node head,int k){
//当链表为空或者要删除的节点小于0时,直接返回头节点
if(head==null||k<0){
return head;
}
//建立一个虚拟的头节点,因为要删除的节点也可能是头节点
Node newHead=new Node(-1);
newHead.next=head;
Node p=newHead,q=newHead;
//p指针和q指针先跑k次
for(int i=0;i<k;i++){
if(p==null){
return head;
}else{
p=p.next;
}
}
//p,q一起往前跑,直到p.next为空,p所指的下一个节点就是要删除的节点
while(p.next!=null){
p=p.next;
q=q.next;
}
q.next=q.next.next;
return newHead.next;
}
//给定一个不带头结点的单链表,对链表进行插入排序(从小到大排序). 注意:节点整体移动,不是数值域的交换
public static void main(String[] args) {
int[] arr={5,3,6,7,0,8};
Node head=new Node(arr);
TestDemo testDemo=new TestDemo();
head=testDemo.removeNthFromEnd(head,3);
System.out.println(head.toString());
}
}
| [
"2827092620@qq.com"
] | 2827092620@qq.com |
e5fe9d5edc7990d48aec113619b379eb199d422f | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/orientechnologies--orientdb/6bf7dcd0ce4319b935b227110de3aadaf6215691/after/ODatabaseImport.java | 9515357eb82b895c407a98d7a70e1a3de15934ef | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,072 | java | /*
* Copyright 1999-2010 Luca Garulli (l.garulli--at--orientechnologies.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.orientechnologies.orient.core.db.tool;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.zip.GZIPInputStream;
import com.orientechnologies.common.parser.OStringForwardReader;
import com.orientechnologies.orient.core.command.OCommandOutputListener;
import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
import com.orientechnologies.orient.core.db.record.ODatabaseRecord;
import com.orientechnologies.orient.core.exception.OConfigurationException;
import com.orientechnologies.orient.core.exception.OSchemaException;
import com.orientechnologies.orient.core.id.ORID;
import com.orientechnologies.orient.core.id.ORecordId;
import com.orientechnologies.orient.core.index.OIndex;
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.metadata.schema.OProperty;
import com.orientechnologies.orient.core.metadata.schema.OType;
import com.orientechnologies.orient.core.record.ORecordInternal;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.serialization.serializer.OJSONReader;
import com.orientechnologies.orient.core.serialization.serializer.OStringSerializerHelper;
import com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerJSON;
import com.orientechnologies.orient.core.storage.OStorage;
/**
* Import data from a file into a database.
*
* @author Luca Garulli (l.garulli--at--orientechnologies.com)
*
*/
public class ODatabaseImport extends ODatabaseImpExpAbstract {
private Map<OProperty, String> linkedClasses = new HashMap<OProperty, String>();
private Map<OClass, String> superClasses = new HashMap<OClass, String>();
private OJSONReader jsonReader;
private OStringForwardReader reader;
private ORecordInternal<?> record;
private Set<String> recordToDelete = new HashSet<String>();
private Map<OProperty, String> propertyIndexes = new HashMap<OProperty, String>();
public ODatabaseImport(final ODatabaseDocument database, final String iFileName, final OCommandOutputListener iListener)
throws IOException {
super(database, iFileName, iListener);
InputStream inStream;
try {
inStream = new GZIPInputStream(new FileInputStream(fileName));
} catch (Exception e) {
inStream = new FileInputStream(fileName);
}
jsonReader = new OJSONReader(new InputStreamReader(inStream));
database.declareIntent(new OIntentMassiveInsert());
}
public ODatabaseImport(final ODatabaseDocument database, final InputStream iStream, final OCommandOutputListener iListener)
throws IOException {
super(database, "streaming", iListener);
jsonReader = new OJSONReader(new InputStreamReader(iStream));
database.declareIntent(new OIntentMassiveInsert());
}
public ODatabaseImport importDatabase() {
try {
listener.onMessage("\nStarted import of database '" + database.getURL() + "' from " + fileName + "...");
long time = System.currentTimeMillis();
jsonReader.readNext(OJSONReader.BEGIN_OBJECT);
database.setUseCache(false);
database.getCache().setMaxSize(0);
database.getCache().clear();
database.getStorage().getCache().setMaxSize(0);
database.getStorage().getCache().clear();
String tag;
while (jsonReader.hasNext() && jsonReader.lastChar() != '}') {
tag = jsonReader.readString(OJSONReader.FIELD_ASSIGNMENT);
if (tag.equals("info"))
importInfo();
else if (tag.equals("clusters"))
importClusters();
else if (tag.equals("schema"))
importSchema();
else if (tag.equals("records"))
importRecords();
else if (tag.equals("indexes"))
importManualIndexes();
else if (tag.equals("dictionary"))
importDictionary();
}
deleteHoleRecords();
rebuildAutomaticIndexes();
listener.onMessage("\n\nDatabase import completed in " + ((System.currentTimeMillis() - time)) + " ms");
} catch (Exception e) {
System.err.println("Error on database import happened just before line " + jsonReader.getLineNumber() + ", column "
+ jsonReader.getColumnNumber());
e.printStackTrace();
throw new ODatabaseExportException("Error on importing database '" + database.getName() + "' from file: " + fileName, e);
} finally {
close();
}
return this;
}
private void rebuildAutomaticIndexes() {
listener.onMessage("\nRebuilding " + propertyIndexes.size() + " indexes...");
database.getMetadata().getIndexManager().load();
for (Entry<OProperty, String> e : propertyIndexes.entrySet()) {
e.getKey().setIndex(database.getMetadata().getIndexManager().getIndex(e.getValue()));
e.getKey().getIndex().getUnderlying().setCallback(e.getKey().getIndex());
// listener.onMessage("\n- Index '" + e.getKey().getIndex().getUnderlying().getName() + "'...");
//
// e.getKey().getIndex().getUnderlying().rebuild(new OProgressListener() {
// public boolean onProgress(Object iTask, long iCounter, float iPercent) {
// if (iPercent % 10 == 0)
// listener.onMessage(".");
// return false;
// }
//
// public void onCompletition(Object iTask, boolean iSucceed) {
// }
//
// public void onBegin(Object iTask, long iTotal) {
// }
// });
//
// listener.onMessage("OK (" + e.getKey().getIndex().getUnderlying().getSize() + " records)");
}
}
/**
* Delete all the temporary records created to fill the holes and to mantain the same record ID
*/
private void deleteHoleRecords() {
listener.onMessage("\nDelete temporary records...");
final ORecordId rid = new ORecordId();
final ODocument doc = new ODocument(database, rid);
for (String recId : recordToDelete) {
doc.reset();
rid.fromString(recId);
doc.delete();
}
listener.onMessage("OK (" + recordToDelete.size() + " records)");
}
private void importInfo() throws IOException, ParseException {
listener.onMessage("\nImporting database info...");
jsonReader.readNext(OJSONReader.COMMA_SEPARATOR);
jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT);
@SuppressWarnings("unused")
int defClusterId = jsonReader.readNumber(OJSONReader.ANY_NUMBER, true);
jsonReader.readNext(OJSONReader.END_OBJECT);
jsonReader.readNext(OJSONReader.COMMA_SEPARATOR);
listener.onMessage("OK");
}
@SuppressWarnings("unused")
private long importDictionary() throws IOException, ParseException {
listener.onMessage("\nImporting database dictionary...");
String dictionaryKey;
String dictionaryValue;
final ODocument doc = new ODocument(database);
final ORecordId rid = new ORecordId();
long tot = 0;
jsonReader.readNext(OJSONReader.BEGIN_OBJECT);
do {
dictionaryKey = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"key\"")
.readString(OJSONReader.COMMA_SEPARATOR);
dictionaryValue = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"value\"")
.readString(OJSONReader.NEXT_IN_OBJECT);
if (dictionaryValue.length() >= 4)
rid.fromString(dictionaryValue.substring(1));
// AVOID TO CHANGE THE DICTIONARY BECAUSE IT'S IMPORTED BY UNDERLYING RECORDS
// ((ODictionary<ODocument>) database.getDictionary()).put(dictionaryKey, doc);
tot++;
} while (jsonReader.lastChar() == ',');
listener.onMessage("OK (" + tot + " entries)");
jsonReader.readNext(OJSONReader.END_OBJECT);
return tot;
}
@SuppressWarnings("unused")
private void importManualIndexes() throws IOException, ParseException {
listener.onMessage("\nImporting manual indexes...");
String key;
String value;
final ODocument doc = new ODocument(database);
// FORCE RELOADING
database.getMetadata().getIndexManager().load();
jsonReader.readNext(OJSONReader.BEGIN_OBJECT);
do {
final String indexName = jsonReader.readString(OJSONReader.FIELD_ASSIGNMENT);
listener.onMessage("\n- Index '" + indexName + "'...");
final OIndex index = database.getMetadata().getIndexManager().getIndex(indexName);
long tot = 0;
jsonReader.readNext(OJSONReader.BEGIN_OBJECT);
String n;
do {
jsonReader.readNext(new char[] { ':', '}' });
if (jsonReader.lastChar() != '}') {
key = jsonReader.checkContent("\"key\"").readString(OJSONReader.COMMA_SEPARATOR);
value = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"value\"")
.readString(OJSONReader.NEXT_IN_OBJECT);
if (index != null)
if (value.length() >= 4) {
if (value.charAt(0) == '[')
// REMOVE []
value = value.substring(1, value.length() - 1);
List<String> rids = OStringSerializerHelper.split(value, ',', new char[] { '#', '"' });
for (String rid : rids) {
doc.setIdentity(new ORecordId(rid));
index.put(key, doc);
}
}
tot++;
}
} while (jsonReader.lastChar() == ',');
if (index != null)
listener.onMessage("OK (" + tot + " entries)");
else
listener.onMessage("KO, the index wasn't found in configuration");
jsonReader.readNext(OJSONReader.NEXT_IN_OBJECT);
} while (jsonReader.lastChar() == ',');
}
private void importSchema() throws IOException, ParseException {
listener.onMessage("\nImporting database schema...");
jsonReader.readNext(OJSONReader.BEGIN_OBJECT);
@SuppressWarnings("unused")
int schemaVersion = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"version\"")
.readNumber(OJSONReader.ANY_NUMBER, true);
jsonReader.readNext(OJSONReader.COMMA_SEPARATOR).readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"classes\"")
.readNext(OJSONReader.BEGIN_COLLECTION);
long classImported = 0;
String className;
int classId;
int classDefClusterId;
String classClusterIds;
String classSuper = null;
OClass cls;
try {
do {
jsonReader.readNext(OJSONReader.BEGIN_OBJECT);
className = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"name\"")
.readString(OJSONReader.COMMA_SEPARATOR);
classId = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"id\"").readInteger(OJSONReader.COMMA_SEPARATOR);
classDefClusterId = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"default-cluster-id\"")
.readInteger(OJSONReader.COMMA_SEPARATOR);
classClusterIds = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"cluster-ids\"")
.readString(OJSONReader.NEXT_IN_OBJECT).trim();
cls = database.getMetadata().getSchema().getClass(className);
if (cls != null) {
if (cls.getDefaultClusterId() != classDefClusterId)
cls.setDefaultClusterId(classDefClusterId);
} else
cls = database.getMetadata().getSchema().createClass(className, classDefClusterId);
if (classId != cls.getId())
throw new OSchemaException("Imported class '" + className + "' has id=" + cls.getId() + " different from the original: "
+ classId);
if (classClusterIds != null) {
// REMOVE BRACES
classClusterIds = classClusterIds.substring(1, classClusterIds.length() - 1);
// ASSIGN OTHER CLUSTER IDS
for (int i : OStringSerializerHelper.splitIntArray(classClusterIds)) {
cls.addClusterIds(i);
}
}
String value;
while (jsonReader.lastChar() == ',') {
jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT);
value = jsonReader.getValue();
if (value.equals("\"super-class\"")) {
classSuper = jsonReader.readString(OJSONReader.NEXT_IN_OBJECT);
superClasses.put(cls, classSuper);
} else if (value.equals("\"properties\"")) {
// GET PROPERTIES
jsonReader.readNext(OJSONReader.BEGIN_COLLECTION);
while (jsonReader.lastChar() != ']') {
importProperty(cls);
if (jsonReader.lastChar() == '}')
jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
}
jsonReader.readNext(OJSONReader.END_OBJECT);
}
}
classImported++;
jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
} while (jsonReader.lastChar() == ',');
// REBUILD ALL THE INHERITANCE
for (Map.Entry<OClass, String> entry : superClasses.entrySet()) {
entry.getKey().setSuperClass(database.getMetadata().getSchema().getClass(entry.getValue()));
}
// SET ALL THE LINKED CLASSES
for (Map.Entry<OProperty, String> entry : linkedClasses.entrySet()) {
entry.getKey().setLinkedClass(database.getMetadata().getSchema().getClass(entry.getValue()));
}
database.getMetadata().getSchema().save();
listener.onMessage("OK (" + classImported + " classes)");
jsonReader.readNext(OJSONReader.END_OBJECT);
jsonReader.readNext(OJSONReader.COMMA_SEPARATOR);
} catch (Exception e) {
e.printStackTrace();
listener.onMessage("ERROR (" + classImported + " entries): " + e);
}
}
private void importProperty(final OClass iClass) throws IOException, ParseException {
jsonReader.readNext(OJSONReader.NEXT_OBJ_IN_ARRAY);
if (jsonReader.lastChar() == ']')
return;
String propName = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"name\"")
.readString(OJSONReader.COMMA_SEPARATOR);
final int id = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"id\"")
.readInteger(OJSONReader.COMMA_SEPARATOR);
final OType type = OType.valueOf(jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"type\"")
.readString(OJSONReader.NEXT_IN_OBJECT));
String attrib;
String value;
String min = null;
String max = null;
String linkedClass = null;
OType linkedType = null;
String indexName = null;
String indexType = null;
while (jsonReader.lastChar() == ',') {
jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT);
attrib = jsonReader.getValue();
value = jsonReader.readString(OJSONReader.NEXT_IN_OBJECT);
if (attrib.equals("\"min\""))
min = value;
else if (attrib.equals("\"max\""))
max = value;
else if (attrib.equals("\"linked-class\""))
linkedClass = value;
else if (attrib.equals("\"linked-type\""))
linkedType = OType.valueOf(value);
else if (attrib.equals("\"index\""))
indexName = value;
else if (attrib.equals("\"index-type\""))
indexType = value;
}
OProperty prop = iClass.getProperty(propName);
if (prop == null) {
// CREATE IT
prop = iClass.createProperty(propName, type);
} else {
if (prop.getId() != id)
throw new OSchemaException("Imported property '" + iClass.getName() + "." + propName
+ "' has an id different from the original: " + id);
}
if (min != null)
prop.setMin(min);
if (max != null)
prop.setMax(max);
if (linkedClass != null)
linkedClasses.put(prop, linkedClass);
if (linkedType != null)
prop.setLinkedType(linkedType);
if (indexName != null)
// PUSH INDEX TO CREATE AFTER ALL
propertyIndexes.put(prop, indexName);
}
private long importClusters() throws ParseException, IOException {
listener.onMessage("\nImporting clusters...");
long total = 0;
jsonReader.readNext(OJSONReader.BEGIN_COLLECTION);
@SuppressWarnings("unused")
ORecordId rid = null;
while (jsonReader.lastChar() != ']') {
jsonReader.readNext(OJSONReader.BEGIN_OBJECT);
String name = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"name\"")
.readString(OJSONReader.COMMA_SEPARATOR);
// CHECK IF THE CLUSTER IS INCLUDED
if (includeClusters != null) {
if (!includeClusters.contains(name)) {
jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
continue;
}
} else if (excludeClusters != null) {
if (excludeClusters.contains(name)) {
jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
continue;
}
}
int id = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"id\"").readInteger(OJSONReader.COMMA_SEPARATOR);
String type = jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"type\"")
.readString(OJSONReader.NEXT_IN_OBJECT);
if (jsonReader.lastChar() == ',') {
rid = new ORecordId(jsonReader.readNext(OJSONReader.FIELD_ASSIGNMENT).checkContent("\"rid\"")
.readString(OJSONReader.NEXT_IN_OBJECT));
} else
rid = null;
listener.onMessage("\n- Creating cluster " + name + "...");
int clusterId = database.getClusterIdByName(name);
if (clusterId == -1) {
// CREATE IT
if (type.equals("PHYSICAL"))
clusterId = database.addPhysicalCluster(name, name, -1);
else if (type.equals("LOGICAL"))
clusterId = database.addLogicalCluster(name, database.getClusterIdByName(OStorage.CLUSTER_INTERNAL_NAME));
}
if (clusterId != id)
throw new OConfigurationException("Imported cluster '" + name + "' has id=" + clusterId + " different from the original: "
+ id);
listener.onMessage("OK, assigned id=" + clusterId);
total++;
jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
}
jsonReader.readNext(OJSONReader.COMMA_SEPARATOR);
listener.onMessage("\nDone. Imported " + total + " clusters");
return total;
}
private long importRecords() throws ParseException, IOException {
long total = 0;
jsonReader.readNext(OJSONReader.BEGIN_COLLECTION);
long totalRecords = 0;
System.out.print("\nImporting records...");
ORID rid;
int lastClusterId = 0;
long clusterRecords = 0;
while (jsonReader.lastChar() != ']') {
rid = importRecord();
if (rid != null) {
++clusterRecords;
if (rid.getClusterId() != lastClusterId) {
// CHANGED CLUSTERID: DUMP STATISTICS
System.out.print("\n- Imported records into the cluster '" + database.getClusterNameById(lastClusterId) + "': "
+ clusterRecords + " records");
clusterRecords = 0;
}
lastClusterId = rid.getClusterId();
++totalRecords;
} else
lastClusterId = 0;
}
listener.onMessage("\n\nDone. Imported " + totalRecords + " records\n");
jsonReader.readNext(OJSONReader.COMMA_SEPARATOR);
return total;
}
private ORID importRecord() throws IOException, ParseException {
final String value = jsonReader.readString(OJSONReader.END_OBJECT, true);
record = ORecordSerializerJSON.INSTANCE.fromString(database, value, record);
// CHECK IF THE CLUSTER IS INCLUDED
if (includeClusters != null) {
if (!includeClusters.contains(database.getClusterNameById(record.getIdentity().getClusterId()))) {
jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
return null;
}
} else if (excludeClusters != null) {
if (excludeClusters.contains(database.getClusterNameById(record.getIdentity().getClusterId()))) {
jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
return null;
}
}
String rid = record.getIdentity().toString();
long nextAvailablePos = database.getStorage().getClusterDataRange(record.getIdentity().getClusterId())[1] + 1;
// SAVE THE RECORD
if (record.getIdentity().getClusterPosition() < nextAvailablePos) {
// REWRITE PREVIOUS RECORD
if (record instanceof ODocument)
record.save();
else
((ODatabaseRecord) database.getUnderlying()).save(record);
} else {
String clusterName = database.getClusterNameById(record.getIdentity().getClusterId());
if (record.getIdentity().getClusterPosition() > nextAvailablePos) {
// CREATE HOLES
int holes = (int) (record.getIdentity().getClusterPosition() - nextAvailablePos);
ODocument tempRecord = new ODocument(database);
for (int i = 0; i < holes; ++i) {
tempRecord.reset();
((ODatabaseRecord) database.getUnderlying()).save(tempRecord, clusterName);
recordToDelete.add(tempRecord.getIdentity().toString());
}
}
// APPEND THE RECORD
record.setIdentity(-1, -1);
if (record instanceof ODocument)
record.save(clusterName);
else
((ODatabaseRecord) database.getUnderlying()).save(record, clusterName);
}
if (!record.getIdentity().toString().equals(rid))
throw new OSchemaException("Imported record '" + record.getIdentity() + "' has rid different from the original: " + rid);
jsonReader.readNext(OJSONReader.NEXT_IN_ARRAY);
return record.getIdentity();
}
public void close() {
database.declareIntent(null);
if (reader == null)
return;
try {
reader.close();
reader = null;
} catch (IOException e) {
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
88d1729cbcf658fe4336a42399f76e7ef0240176 | f654dc1a31b1971e960ea001ccdaa65e517cee71 | /nhance-api-masterdata/build/classes/main/com/nhance/api/masterdata/mapper/CurrencyMapperImpl.java | 744aca538f301d8ea0a32e7a81c5bcb428120ffa | [] | no_license | nhancenow/organization | 865b1f457db70f766892eae0e7a1d4c3ff48f6f0 | d74d92564f21a9e0b536b754080e7356154f9961 | refs/heads/master | 2021-04-12T12:13:24.436592 | 2017-07-18T13:06:28 | 2017-07-18T13:06:28 | 94,550,517 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,187 | java | package com.nhance.api.masterdata.mapper;
import com.nhance.api.masterdata.dto.CurrencyDto;
import com.nhance.bom.masterdata.domain.Currency;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2017-06-19T19:41:23+0530",
comments = "version: 1.1.0.CR1, compiler: javac, environment: Java 1.8.0_65 (Oracle Corporation)"
)
public class CurrencyMapperImpl implements CurrencyMapper {
@Override
public Currency mapModelToEntity(CurrencyDto dto) {
if ( dto == null ) {
return null;
}
Currency currency = new Currency();
currency.setName( dto.getName() );
currency.setCode( dto.getCode() );
currency.setUnicode( dto.getUnicode() );
return currency;
}
@Override
public CurrencyDto mapEntityToModel(Currency currency) {
if ( currency == null ) {
return null;
}
CurrencyDto currencyDto = new CurrencyDto();
currencyDto.setName( currency.getName() );
currencyDto.setCode( currency.getCode() );
currencyDto.setUnicode( currency.getUnicode() );
return currencyDto;
}
}
| [
"saroj.biswal@easoftech.com"
] | saroj.biswal@easoftech.com |
1471aba69c7f7db9b49b57afe4cbc56da8d59cd8 | 686e7fd492c8f9f8ee87b29d084d257a9e3f5ca5 | /library/src/main/java/com/permission/utils/checkDetailPermissionUtils/CheckREAD_EXTERNAL_STORAGE.java | fe7ca5ab99bdf356adbcaebefea1d8357105c126 | [] | no_license | wangdanlizhiyun/permission | b54bdf5b804676b0125613c3d5771aeaaa4daef6 | 911af71198d6dd139c379cf99548bcdfc1bbfe2a | refs/heads/master | 2020-07-10T12:16:09.763473 | 2019-08-25T07:28:40 | 2019-08-25T07:28:40 | 204,257,520 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 620 | java | package com.permission.utils.checkDetailPermissionUtils;
import android.content.Context;
import android.os.Environment;
import java.io.File;
public class CheckREAD_EXTERNAL_STORAGE implements Check {
@Override
public Boolean check(Context context) throws Exception {
File directory = Environment.getExternalStorageDirectory();
if (directory.exists() && directory.canRead()) {
long modified = directory.lastModified();
String[] pathList = directory.list();
return modified > 0 && pathList != null;
}else {
return false;
}
}
}
| [
"742971453@qq.com"
] | 742971453@qq.com |
a4ee158f5e88086f959f29938411e14485d81714 | 4204e7db200a7ab93a6d6b6138653f5a0187b529 | /src/main/java/com/chillhub/app/services/ISpecialityService.java | ff80de31472500c77491f64150174642f263fd5f | [] | no_license | OmarElaibi/noubty2.0 | 556a895b6a1fb45512eff11b8c704f4181899ddc | 5b0ec6ba3c22e8ac0941bb48f994199b2999127c | refs/heads/master | 2020-12-19T01:27:04.675687 | 2020-05-17T02:15:21 | 2020-05-17T02:15:21 | 235,578,747 | 0 | 1 | null | 2020-05-17T02:15:22 | 2020-01-22T13:25:07 | Java | UTF-8 | Java | false | false | 325 | java | package com.chillhub.app.services;
import java.util.List;
import java.util.Optional;
import com.chillhub.app.entities.Speciality;
public interface ISpecialityService {
List<Speciality> getAll();
Optional<Speciality> getOneById(int id);
void addOrUpdate(Speciality s);
void delete(Speciality s);
} | [
"akhouad.samy@gmail.com"
] | akhouad.samy@gmail.com |
183bdc572885b9b9c513a26e6b98b19d998d4831 | 6d7dcb39ba963eeeb391f5422b1dda71ce506df4 | /src/main/java/life/yurie/community/controller/ProfileCotroller.java | 4c6db7956c45f3b829f5a269af2203c5d85b6d54 | [] | no_license | YurieSun/community | 60761e6f9aa73c08055cda06fe070410120e2b93 | c17230539617fecd3c7ce1603b880e4b775b8830 | refs/heads/master | 2022-06-27T05:34:24.331127 | 2020-04-15T01:40:57 | 2020-04-15T01:40:57 | 241,360,225 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,971 | java | package life.yurie.community.controller;
import life.yurie.community.dto.PaginationDTO;
import life.yurie.community.model.User;
import life.yurie.community.service.NotificationService;
import life.yurie.community.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
@Controller
public class ProfileCotroller {
@Autowired
private QuestionService questionService;
@Autowired
private NotificationService notificationService;
@GetMapping("/profile/{action}")
public String profile(HttpServletRequest request,
@PathVariable(name = "action") String action,
Model model,
@RequestParam(name = "page", defaultValue = "1") Integer page,
@RequestParam(name = "size", defaultValue = "5") Integer size) {
User user = (User) request.getSession().getAttribute("user");
if ("questions".equals(action)) {
model.addAttribute("section", "questions");
model.addAttribute("sectionName", "我的提问");
PaginationDTO paginationDTO = questionService.listById(user.getId(), page, size);
model.addAttribute("pagination", paginationDTO);
} else if ("replies".equals(action)) {
model.addAttribute("section", "replies");
model.addAttribute("sectionName", "最新回复");
PaginationDTO paginationDTO = notificationService.listById(user.getId(), page, size);
model.addAttribute("pagination", paginationDTO);
}
return "profile";
}
}
| [
"757075280@qq.com"
] | 757075280@qq.com |
fcd0432d3b22cdce54af10e9d17bf6407e5bde52 | 52e9d881c9c127f8b8795bf4f864787d1a2d241f | /src/tk/pankajb/Requests/AuthBody.java | 82bb5a1f6cd67a3e4a1e3be9cd17580255406c95 | [] | no_license | PennOx/Supabase_Authentication | be1cd6e3a4077e349d9ec25598fe20bdd1c85b11 | 846df46c608a2d528b1b20a5c41f3235a6673bd2 | refs/heads/master | 2023-03-22T04:13:23.108152 | 2021-03-13T17:53:41 | 2021-03-13T17:53:41 | 346,812,646 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 704 | java | package tk.pankajb.Requests;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class AuthBody {
@SerializedName("email")
@Expose
private String email;
@SerializedName("password")
@Expose
private String password;
public AuthBody(String email, String password) {
this.email = email;
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"bairwapankaj25@gmail.com"
] | bairwapankaj25@gmail.com |
a49753200aa9d40667469dbb4959244da7734e28 | 3feb60a78b4c36218793caa62302ffe2766964ea | /app/src/main/java/com/dev/novel/HomePage.java | 9948e6ce1cbc87f9aef544d1369c6a3d2daa02ce | [] | no_license | chiuthuy/hoanglinh | ae5baaec0327f68386aaa63977059cd6729e70f0 | 519e2fab8039f03bba34f11467c661e3656c8bfd | refs/heads/master | 2022-07-04T12:42:25.028456 | 2020-05-14T15:37:48 | 2020-05-14T15:37:48 | 263,954,994 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,694 | java | package com.dev.novel;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.dev.novel.Adapters.NovelAdapter;
import com.dev.novel.Models.Novel;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.firestore.CollectionReference;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.Query;
import com.google.firebase.firestore.QueryDocumentSnapshot;
import com.google.firebase.firestore.QuerySnapshot;
import java.util.ArrayList;
import java.util.List;
public class HomePage extends AppCompatActivity {
// private EditText searchBar;
private FirebaseFirestore db;
private ListView listOfNovels;
private Button logOutButton, searchButton;
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.home_page);
initState();
getNovels();
logOutButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
logOut();
navigateToLogInPage();
}
});
searchButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
navigateToSearchPage();
}
});
}
private void initState() {
db = FirebaseFirestore.getInstance();
logOutButton = (Button) findViewById(R.id.logOutButton);
searchButton = (Button) findViewById(R.id.searchButton);
listOfNovels = (ListView) findViewById(R.id.listOfNovels);
}
private void getNovels() {
CollectionReference novels = db.collection("novels");
getAllNovels(novels);
}
private void getAllNovels(Query query) {
query.get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
List<Novel> listOfNovels = new ArrayList<>();
Novel[] novels = {};
for (QueryDocumentSnapshot novel: task.getResult()) {
listOfNovels.add(responseToNovel(novel));
}
novels = listOfNovels.toArray(novels);
renderListOfNovels(novels);
}
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(HomePage.this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
private void renderListOfNovels(final Novel[] novels) {
NovelAdapter adapter = new NovelAdapter(HomePage.this, novels);
listOfNovels.setAdapter(adapter);
listOfNovels.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Novel novel = novels[position];
navigateToNovelPage(novel.getId(), novel.getName());
}
});
}
private void logOut() {
SharedPreferences sharedPreferences = getSharedPreferences("USERNAME", MODE_PRIVATE);
sharedPreferences.edit().remove("username").apply();
}
private void navigateToLogInPage() {
Intent intent = new Intent(HomePage.this, MainActivity.class);
startActivity(intent);
finish();
}
private void navigateToNovelPage(String novelId, String novelTitle) {
Bundle bundle = new Bundle();
Intent intent = new Intent(HomePage.this, NovelPage.class);
bundle.putString("NOVEL_ID", novelId);
bundle.putString("NOVEL_TITLE", novelTitle);
intent.putExtras(bundle);
startActivity(intent);
finish();
}
private void navigateToSearchPage() {
Intent intent = new Intent(HomePage.this, SearchPage.class);
startActivity(intent);
finish();
}
private Novel responseToNovel(DocumentSnapshot snapshot) {
return new Novel(snapshot.getId(), snapshot.getString("name"));
}
}
| [
"="
] | = |
186de1712d2acec59b5aa36017b425c4c7d2e266 | d2dcb275a36aca1df8c7221ffd9745ecbbf6bea3 | /qrdlib/src/main/java/ae/sinxiao/android/qrd/Constants.java | 2f1a1d9b61d5bf5ef50974f5527717b19e7e0bd1 | [
"Apache-2.0"
] | permissive | sinxiao/sinxiaoqrdlib | 9943fbc9e21d52ce1fa9a45c754de9277699f005 | 29a1e5a29ccb8854404341ce5dd2ac814d4c429e | refs/heads/master | 2023-02-25T23:56:24.581988 | 2021-01-31T05:13:17 | 2021-01-31T05:13:17 | 296,564,669 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 262 | java | package ae.sinxiao.android.qrd;
public class Constants {
public interface PermissionCode {
int PERMISSION_WEB_CAMER = 101;
int PERMISSION_WEB_PHOTO = 102;
int PERMISSION_WEB_VIDEO = 103;
int PERMISSION_WEB_ALL = 105;
}
}
| [
"a6t8@qq.com"
] | a6t8@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.