blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d91ed863554a19e1f9c6bbef061d262f2fc7b5ab | bf0d6aba6100060fc2c81dccc1d978a2f6a3abcb | /src/main/java/top/ijiujiu/component/LogoutSuccessHandlerImpl.java | 7e9f2c5228542b119f9d0419f2f6c1e469a04206 | [] | no_license | 2777450490/company-manage-system | 2b81d1fecb192d9823b3164f4ebacafc9ac6271e | 8589d374f0882f07b8de331b9e68ed381d0c8437 | refs/heads/master | 2020-09-21T13:48:45.484413 | 2019-11-29T08:17:56 | 2019-11-29T08:17:56 | 224,807,010 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,341 | java | package top.ijiujiu.component;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import org.springframework.stereotype.Component;
import top.ijiujiu.util.ResultUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 处理注销成功
*
* @author pengxl
* @version 1.0
* @since 2019-11-12 11:31
*/
@Component
public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler {
private final static Logger LOGGER = LoggerFactory.getLogger(LogoutSuccessHandlerImpl.class);
/**Json转化工具*/
@Autowired
private ObjectMapper objectMapper;
@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException{
LOGGER.info("登出成功");
ResultUtil result = new ResultUtil();
result.success("登出成功");
response.setContentType("application/json;charset=UTF-8");
response.getWriter().write(objectMapper.writeValueAsString(result));
}
}
| [
"pengxljava@163.com"
] | pengxljava@163.com |
e06943c7835051362b221a26b7b525671004dd5a | ca1d6c94c9801e89c614ce85ebb73fe462f86e7d | /src/main/java/com/github/vincentrussell/json/datagenerator/functions/impl/DateFormat.java | d45e18b1f4d9acc9462350a85e04949e4c9436c1 | [
"Apache-2.0"
] | permissive | vincentrussell/json-data-generator | f3455a088dd9c817a4b4b4556de8b0640c890dad | 4c0701a7ae4827dcb539a42ff70517652e8831bb | refs/heads/master | 2023-06-22T21:17:44.521461 | 2023-06-14T22:32:34 | 2023-06-16T03:00:46 | 20,046,570 | 71 | 28 | Apache-2.0 | 2023-06-16T03:00:48 | 2014-05-22T03:30:23 | Java | UTF-8 | Java | false | false | 1,246 | java | package com.github.vincentrussell.json.datagenerator.functions.impl;
import com.github.vincentrussell.json.datagenerator.functions.Function;
import com.github.vincentrussell.json.datagenerator.functions.FunctionInvocation;
import java.text.ParseException;
import java.text.SimpleDateFormat;
/**
* convert dates to different formats
*/
@Function(name = "dateFormat")
public class DateFormat {
/**
* function call to change format of date
* @param dateToParse the date to convert
* @param inputFormat the {@link SimpleDateFormat} to convert from
* @param outputFormat the{@link SimpleDateFormat} to convert to
* @return the converted date
*/
@FunctionInvocation
public String dateFormat(final String dateToParse, final String inputFormat,
final String outputFormat) {
try {
java.text.DateFormat incoming = new SimpleDateFormat(inputFormat);
java.text.DateFormat outgoingFormat = new SimpleDateFormat(outputFormat);
java.util.Date date = incoming.parse(dateToParse);
return outgoingFormat.format(date);
} catch (NullPointerException | ParseException e) {
throw new IllegalArgumentException(e);
}
}
}
| [
"vincent.russell@gmail.com"
] | vincent.russell@gmail.com |
de660741b06afe6c52263713f7cd06a7aacb2a52 | 3cfec0a5660ee92b1706ded738bb7429cfa682af | /Chapter11Stuff-InOutAndExceptions/src/InputOutput/FileStatsReader.java | 05ac345fceb93aa93cff8d67fa2449e21e90412b | [] | no_license | CodeforEvolution/SchoolProjects-2018-2019 | d0bcb7f104d1a3a062071f4a7c1736fcf6a40afa | db32ea9e650dbbbce93db75b83fbc8ce7752c257 | refs/heads/master | 2020-03-28T00:43:56.411113 | 2019-06-18T22:49:29 | 2019-06-18T22:49:29 | 147,444,845 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,035 | java | package InputOutput;
import java.io.File;
import java.io.FileReader;
import java.net.URI;
import java.util.Scanner;
public class FileStatsReader {
public static void main(String[] args)
{
/* File opening and setup */
Scanner in = new Scanner(System.in);
URI fileLocation = null;
String filePath = "";
System.out.println("Welcome!");
boolean ok = false;
do
{
ok = true;
System.out.println("Enter the path to a file you'd like to read: ");
filePath = "file://" + in.next();
System.out.println("\nChecking path and attempting to open the file...");
try {
fileLocation = new URI(filePath);
} catch (Exception e) {
System.out.println("\nWe couldn't open that file...try again please.\n");
ok = false;
}
} while (ok == false);
in.close();
System.out.println("Success!");
/* Statistic counting!!! */
int characters = -1;
int words = -1;
int lines = -1;
try
{
characters = characterCount(fileLocation);
words = wordCount(fileLocation);
lines = lineCount(fileLocation);
}
catch (Exception e)
{
System.out.println("Couldn't read statistics of file!!");
e.printStackTrace();
}
System.out.println("\nChars in file: " + characters);
System.out.println("\nWords in file: " + words);
System.out.println("\nLines in file: " + lines);
}
private static int characterCount(URI input) throws Exception
{
int count = 0;
FileReader reader = new FileReader(new File(input));
while (reader.read() != -1)
{
count++;
}
reader.close();
return count;
}
private static int wordCount(URI input) throws Exception
{
int count = 0;
Scanner reader = new Scanner(new File(input));
while (reader.hasNext())
{
count++;
reader.next();
}
reader.close();
return count;
}
private static int lineCount(URI input) throws Exception
{
int count = 0;
Scanner reader = new Scanner(new File(input));
while (reader.hasNextLine())
{
count++;
reader.nextLine();
}
reader.close();
return count;
}
}
| [
"secundaja@gmail.com"
] | secundaja@gmail.com |
82455bf34966a249acdda6b64672711cdc88f627 | 87c3c335023681d1c906892f96f3a868b3a6ee8e | /HTML5/dev/simplivity-citrixplugin-service/src/main/java/com/vmware/vim25/VMFSDatastoreExpandedEvent.java | 80a026dd4f2c0c7566c0b0abf210a003b171acf2 | [
"Apache-2.0"
] | permissive | HewlettPackard/SimpliVity-Citrix-VCenter-Plugin | 19d2b7655b570d9515bf7e7ca0cf1c823cbf5c61 | 504cbeec6fce27a4b6b23887b28d6a4e85393f4b | refs/heads/master | 2023-08-09T08:37:27.937439 | 2020-04-30T06:15:26 | 2020-04-30T06:15:26 | 144,329,090 | 0 | 1 | Apache-2.0 | 2020-04-07T07:27:53 | 2018-08-10T20:24:34 | Java | UTF-8 | Java | false | false | 737 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.12 at 09:16:35 AM EDT
//
package com.vmware.vim25;
/**
*
*/
@SuppressWarnings("all")
public class VMFSDatastoreExpandedEvent
extends HostEvent
{
public DatastoreEventArgument datastore;
public DatastoreEventArgument getDatastore() {
return datastore;
}
public void setDatastore(DatastoreEventArgument datastore) {
this.datastore = datastore;
}
}
| [
"anuanusha471@gmail.com"
] | anuanusha471@gmail.com |
b3e9bee5d7f6409d95c26d475877c0e8c0eb7bc1 | 873ce0e454579ebb0b642858568675df3d62d003 | /siw-project/src/main/java/it/uniroma3/model/User.java | 6119c7db8e458da47a9bdfe64b4c189f6bdb4f02 | [] | no_license | DavidePalluzzi/project-siw-azienda | b913018237e85f5cf41c16a34920dc18aaeac21b | d4406fd478c8e0bc852b78a0f7d120cf7149b420 | refs/heads/master | 2020-03-21T03:00:12.459762 | 2018-06-21T08:43:21 | 2018-06-21T08:43:21 | 138,032,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,679 | java |
package it.uniroma3.model;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.validator.constraints.*;
import org.hibernate.validator.constraints.Length;
import org.springframework.data.annotation.Transient;
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "user_id")
private int id;
@Column(name = "email")
@Email(message = "*Please provide a valid Email")
@NotEmpty(message = "*Please provide an email")
private String email;
@Column(name = "password")
@Length(min = 5, message = "*Your password must have at least 5 characters")
@NotEmpty(message = "*Please provide your password")
@Transient
private String password;
@Column(name = "name")
@NotEmpty(message = "*Please provide your name")
private String name;
@Column(name = "last_name")
@NotEmpty(message = "*Please provide your last name")
private String lastName;
@Column(name = "active")
private int active;
@OneToOne
private CentroDiFormazione centro; //di cui è responsabile
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "user_role", joinColumns = @JoinColumn(name = "user_id"), inverseJoinColumns = @JoinColumn(name = "role_id"))
private Set<Role> roles;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public int getActive() {
return active;
}
public void setActive(int active) {
this.active = active;
}
public Set<Role> getRoles() {
return roles;
}
public void setRoles(Set<Role> roles) {
this.roles = roles;
}
public CentroDiFormazione getCentro() {
return centro;
}
public void setCentro(CentroDiFormazione centro) {
this.centro = centro;
}
}
| [
"david@10.25.249.160"
] | david@10.25.249.160 |
59538e308ae0031de3fe2390b3c0c928c9427ce4 | f7751fb2f16afcff0bb0ac4cb9c815444e9631be | /AccountSystem/AccountSystemDomain/src/main/java/za/ac/nwu/ac/domain/persistence/AccountType.java | df172972146fa1a327c9a56b877a07eff5fd3aea | [] | no_license | maartinV2/Discovery_P1 | 7f6d3756e8a26475786457caf3c9f666db471e5e | 71a226a4d4f6a3a26d6dd50b07210c311a88f163 | refs/heads/main | 2023-08-22T11:39:07.105081 | 2021-10-10T22:17:09 | 2021-10-10T22:17:09 | 401,846,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,509 | java | package za.ac.nwu.ac.domain.persistence;
import javax.persistence.*;
import java.time.LocalDate;
import java.io.Serializable;
import java.util.Objects;
import java.util.Set;
@Entity
@Table(name = "ACCOUNT_TYPE", schema = "CMPG323")
public class AccountType implements Serializable {
private static final long serialVersionUID = 4453290124401196523L;
private Long accountTypeId;
private String mnemonic;
private String accountTypeName;
private LocalDate creationDate;
private Set<AccountTransaction> accountTransaction;
public AccountType() {
}
public AccountType(Long accountTypeId, String mnemonic, String accountTypeName, LocalDate creationDate) {
this.accountTypeId = accountTypeId;
this.mnemonic = mnemonic;
this.accountTypeName = accountTypeName;
this.creationDate = creationDate;
}
public AccountType(String mnemonic, String accountTypeName, LocalDate creationDate ) {
this.mnemonic = mnemonic;
this.accountTypeName = accountTypeName;
this.creationDate = creationDate;
}
@Id
@SequenceGenerator(name = "ACCOUNT_SEQ", sequenceName = "CMPG323.ACCOUNT_SEQ",allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE,generator = "ACCOUNT_SEQ")
@Column(name = "ACCOUNT_TYPE_ID")
public Long getAccountTypeId() {return accountTypeId; }
@Column(name="MNEMONIC")
public String getMnemonic() {
return mnemonic;
}
@Column(name = "ACCOUNT_TYPE_NAME")
public String getAccountTypeName() {
return accountTypeName;
}
@Column(name="CREATION_DATE")
public LocalDate getCreationDate() {
return creationDate;
}
@OneToMany(targetEntity = AccountTransaction.class,fetch = FetchType.LAZY,mappedBy = "accountType")
public Set<AccountTransaction> getAccountTransaction(){
return accountTransaction;
}
public void setAccountTransaction(Set<AccountTransaction> accountTransaction) {
this.accountTransaction = accountTransaction;
}
public void setAccountTypeId(Long accountTypeId) {
this.accountTypeId = accountTypeId;
}
public void setMnemonic(String mnemonic) {
this.mnemonic = mnemonic;
}
public void setAccountTypeName(String accountTypeName) {
this.accountTypeName = accountTypeName;
}
public void setCreationDate(LocalDate creationDate) {
this.creationDate = creationDate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AccountType that = (AccountType) o;
return Objects.equals(accountTypeId, that.accountTypeId) && Objects.equals(mnemonic, that.mnemonic) && Objects.equals(accountTypeName, that.accountTypeName) && Objects.equals(creationDate, that.creationDate) && Objects.equals(accountTransaction, that.accountTransaction);
}
@Override
public int hashCode() {
return Objects.hash(accountTypeId, mnemonic, accountTypeName, creationDate, accountTransaction);
}
@Override
public String toString() {
return "AccountType{" +
"accountTypeId=" + accountTypeId +
", mnemonic='" + mnemonic + '\'' +
", accountTypeName='" + accountTypeName + '\'' +
", creationDate=" + creationDate +
", accountTransaction=" + accountTransaction +
'}';
}
}
| [
"maartin.venter@gmail.com"
] | maartin.venter@gmail.com |
69dc9ceb4d918b9463184d6ed8a367089e850484 | 439e13f80a278ef53c8b0ac7c3cb5b9c174e72d7 | /ssm/src/main/java/com/llc/controller/WebSocketController.java | 9b6bf66ac304d3285394e81363ec2eb4567bf642 | [] | no_license | n040661/base | b046783d6c7e46b15b49fd2ac9e44544bd42d96b | 84c1d86792ce7a2a5b99fee23a78ce0f26c356b6 | refs/heads/master | 2020-03-18T17:45:06.675168 | 2018-05-17T14:09:32 | 2018-05-17T14:09:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,277 | java | package com.llc.controller;
import java.io.IOException;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.socket.TextMessage;
import com.alibaba.fastjson.JSON;
import com.google.gson.GsonBuilder;
import com.llc.entity.Message;
import com.llc.redis.RedisClientTemplate;
import com.llc.websocket.SystemWebSocketHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@Controller
@RequestMapping("/ws")
@Api(description = "websocket即时通讯")
public class WebSocketController {
@Resource
SystemWebSocketHandler handler;
@Resource
RedisClientTemplate redisClient;
// 跳转到交谈聊天页面
@RequestMapping(value = "talk", method = RequestMethod.GET)
public ModelAndView talk() {
return new ModelAndView("talk");
}
// 推送消息给指定用户
@ResponseBody
@RequestMapping(value = "push", method = RequestMethod.POST)
@ApiOperation(value = "推送消息给指定用户", notes = "推送消息给指定用户")
public void push(@ApiParam(value = "自己ID") @RequestParam(value = "mid") Integer mid,
@ApiParam(value = "对方ID") @RequestParam(value = "uid") Integer uid,
@ApiParam(value = "消息内容") @RequestParam(value = "text") String text) {
Message msg = new Message();
msg.setFromId(mid);
msg.setFromName(JSON.parseObject(redisClient.get(mid.toString())).getString("username"));
msg.setMsgContent(text);
msg.setToId(uid);
msg.setToName(JSON.parseObject(redisClient.get(mid.toString())).getString("username"));
msg.setSendTime(new Date());
msg.setMsgType(0);
try {
handler.sendMessageToUser(uid,
new TextMessage(new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create().toJson(msg)));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// 跳转到发布广播页面
@RequestMapping(value = "broadcast", method = RequestMethod.GET)
public ModelAndView broadcast() {
return new ModelAndView("broadcast");
}
// 发布系统广播(群发)
@ResponseBody
@RequestMapping(value = "broadcast", method = RequestMethod.POST)
@ApiOperation(value = "推送给所有用户", notes = "推送给所有用户")
public void broadcast(@ApiParam(value = "自己ID") @RequestParam(value = "mid") Integer mid,
@ApiParam(value = "消息内容") @RequestParam(value = "text") String text) throws IOException {
Message msg = new Message();
msg.setFromId(mid);
msg.setFromName(JSON.parseObject(redisClient.get(mid.toString())).getString("username"));
msg.setMsgContent(text);
msg.setToId(0);
msg.setToName("所有用户");
msg.setSendTime(new Date());
msg.setMsgType(1);
handler.broadcast(new TextMessage(new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create().toJson(msg)));
}
} | [
"Administrator@DESKTOP-1GTLVPH"
] | Administrator@DESKTOP-1GTLVPH |
822cb5a646c05ea77a95f3797d82a38f44c3dc21 | e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3 | /src/chosun/ciis/fc/func/dm/FC_FUNC_4022_LDM.java | 7c380f1c22405faf554c405906e32aa2b0e9f92d | [] | no_license | nosmoon/misdevteam | 4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60 | 1829d5bd489eb6dd307ca244f0e183a31a1de773 | refs/heads/master | 2020-04-15T15:57:05.480056 | 2019-01-10T01:12:01 | 2019-01-10T01:12:01 | 164,812,547 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 4,166 | java | /***************************************************************************************************
* 파일명 : .java
* 기능 : 독자우대-구독신청
* 작성일자 : 2007-05-22
* 작성자 : 김대섭
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.fc.func.dm;
import java.sql.*;
import oracle.jdbc.driver.*;
import somo.framework.db.*;
import somo.framework.util.*;
import chosun.ciis.fc.func.ds.*;
import chosun.ciis.fc.func.rec.*;
/**
*
*/
public class FC_FUNC_4022_LDM extends somo.framework.db.BaseDM implements java.io.Serializable{
public String cmpy_cd;
public String pay_note_no;
public FC_FUNC_4022_LDM(){}
public FC_FUNC_4022_LDM(String cmpy_cd, String pay_note_no){
this.cmpy_cd = cmpy_cd;
this.pay_note_no = pay_note_no;
}
public void setCmpy_cd(String cmpy_cd){
this.cmpy_cd = cmpy_cd;
}
public void setPay_note_no(String pay_note_no){
this.pay_note_no = pay_note_no;
}
public String getCmpy_cd(){
return this.cmpy_cd;
}
public String getPay_note_no(){
return this.pay_note_no;
}
public String getSQL(){
return "{ call MISFNC.SP_FC_FUNC_4022_L(? ,? ,? ,? ,?) }";
}
public void setParams(CallableStatement cstmt, BaseDM bdm) throws SQLException{
FC_FUNC_4022_LDM dm = (FC_FUNC_4022_LDM)bdm;
cstmt.registerOutParameter(1, Types.VARCHAR);
cstmt.registerOutParameter(2, Types.VARCHAR);
cstmt.setString(3, dm.cmpy_cd);
cstmt.setString(4, dm.pay_note_no);
cstmt.registerOutParameter(5, OracleTypes.CURSOR);
}
public BaseDataSet createDataSetObject(){
return new chosun.ciis.fc.func.ds.FC_FUNC_4022_LDataSet();
}
public void print(){
System.out.println("cmpy_cd = " + getCmpy_cd());
System.out.println("pay_note_no = " + getPay_note_no());
}
}
/*----------------------------------------------------------------------------------------------------
Web Tier에서 req.getParameter() 처리 및 결과확인 검사시 사용하십시오.
String cmpy_cd = req.getParameter("cmpy_cd");
if( cmpy_cd == null){
System.out.println(this.toString+" : cmpy_cd is null" );
}else{
System.out.println(this.toString+" : cmpy_cd is "+cmpy_cd );
}
String pay_note_no = req.getParameter("pay_note_no");
if( pay_note_no == null){
System.out.println(this.toString+" : pay_note_no is null" );
}else{
System.out.println(this.toString+" : pay_note_no is "+pay_note_no );
}
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 req.getParameter() 처리시 사용하십시오.
String cmpy_cd = Util.checkString(req.getParameter("cmpy_cd"));
String pay_note_no = Util.checkString(req.getParameter("pay_note_no"));
----------------------------------------------------------------------------------------------------*//*----------------------------------------------------------------------------------------------------
Web Tier에서 한글처리와 동시에 req.getParameter() 처리시 사용하십시오.
String cmpy_cd = Util.Uni2Ksc(Util.checkString(req.getParameter("cmpy_cd")));
String pay_note_no = Util.Uni2Ksc(Util.checkString(req.getParameter("pay_note_no")));
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 DM 파일의 변수를 설정시 사용하십시오.
dm.setCmpy_cd(cmpy_cd);
dm.setPay_note_no(pay_note_no);
----------------------------------------------------------------------------------------------------*/
/* 작성시간 : Fri Mar 06 15:26:35 KST 2009 */ | [
"DLCOM000@172.16.30.11"
] | DLCOM000@172.16.30.11 |
30918d7315b0270c5f21aef80d73dd07ebd75826 | a7b868c8c81984dbcb17c1acc09c0f0ab8e36c59 | /src/main/java/com/alipay/api/request/AlipayOpenPublicPersonalizedMenuDeleteRequest.java | daca0cf96b87874bf0c9cf058e7ed8ce9f0ec413 | [
"Apache-2.0"
] | permissive | 1755616537/alipay-sdk-java-all | a7ebd46213f22b866fa3ab20c738335fc42c4043 | 3ff52e7212c762f030302493aadf859a78e3ebf7 | refs/heads/master | 2023-02-26T01:46:16.159565 | 2021-02-02T01:54:36 | 2021-02-02T01:54:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,206 | java | package com.alipay.api.request;
import com.alipay.api.domain.AlipayOpenPublicPersonalizedMenuDeleteModel;
import java.util.Map;
import com.alipay.api.AlipayRequest;
import com.alipay.api.internal.util.AlipayHashMap;
import com.alipay.api.response.AlipayOpenPublicPersonalizedMenuDeleteResponse;
import com.alipay.api.AlipayObject;
/**
* ALIPAY API: alipay.open.public.personalized.menu.delete request
*
* @author auto create
* @since 1.0, 2021-01-25 16:30:49
*/
public class AlipayOpenPublicPersonalizedMenuDeleteRequest implements AlipayRequest<AlipayOpenPublicPersonalizedMenuDeleteResponse> {
private AlipayHashMap udfParams; // add user-defined text parameters
private String apiVersion="1.0";
/**
* 个性化菜单删除
*/
private String bizContent;
public void setBizContent(String bizContent) {
this.bizContent = bizContent;
}
public String getBizContent() {
return this.bizContent;
}
private String terminalType;
private String terminalInfo;
private String prodCode;
private String notifyUrl;
private String returnUrl;
private boolean needEncrypt=false;
private AlipayObject bizModel=null;
public String getNotifyUrl() {
return this.notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public String getReturnUrl() {
return this.returnUrl;
}
public void setReturnUrl(String returnUrl) {
this.returnUrl = returnUrl;
}
public String getApiVersion() {
return this.apiVersion;
}
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public void setTerminalType(String terminalType){
this.terminalType=terminalType;
}
public String getTerminalType(){
return this.terminalType;
}
public void setTerminalInfo(String terminalInfo){
this.terminalInfo=terminalInfo;
}
public String getTerminalInfo(){
return this.terminalInfo;
}
public void setProdCode(String prodCode) {
this.prodCode=prodCode;
}
public String getProdCode() {
return this.prodCode;
}
public String getApiMethodName() {
return "alipay.open.public.personalized.menu.delete";
}
public Map<String, String> getTextParams() {
AlipayHashMap txtParams = new AlipayHashMap();
txtParams.put("biz_content", this.bizContent);
if(udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public void putOtherTextParam(String key, String value) {
if(this.udfParams == null) {
this.udfParams = new AlipayHashMap();
}
this.udfParams.put(key, value);
}
public Class<AlipayOpenPublicPersonalizedMenuDeleteResponse> getResponseClass() {
return AlipayOpenPublicPersonalizedMenuDeleteResponse.class;
}
public boolean isNeedEncrypt() {
return this.needEncrypt;
}
public void setNeedEncrypt(boolean needEncrypt) {
this.needEncrypt=needEncrypt;
}
public AlipayObject getBizModel() {
return this.bizModel;
}
public void setBizModel(AlipayObject bizModel) {
this.bizModel=bizModel;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
f7b22a5f467e76b9553c705125241e249ba54140 | b3d7084c32c7088822ab1cddd9de0a073511601a | /mining/device-backend/code/device-backend/src/main/java/core/pojo/FirmwareTask.java | 4dfde68f4ca541769ba7d0eab4193e4d28f175be | [] | no_license | Lan2010/GitLib | 7aacd62c0915adfc493ce7d2db8f7d173ac1cfa0 | 0dd41ef27b2416605c406a7cc82ce1a44d69d613 | refs/heads/master | 2020-04-02T17:21:43.135564 | 2018-10-26T02:28:58 | 2018-10-26T02:28:58 | 154,654,767 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,292 | java | package core.pojo;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
/**
*
* @Description:插件任务(安装/卸载)
* @author: dev-lan
* @date: 2018年7月18日
*/
public class FirmwareTask {
private Integer firmwareTaskId; // 自增主键
private String taskName;// 任务名称
private String taskDesc;// 任务描述
private Integer firmwareId; // 插件ID
private Integer firmwareNameId; // 名称ID
private String firmwareName; // 名称
private String nickName; // 中文名称
private String version; // 固件版本
private List<Integer> devId; // 设备ID
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private java.util.Date addTime; // 任务新增时间
private Integer user_id; // 用户ID
private String user_name;// 账户名称
private Integer status; // 任务状态,0--已发起,1--已完成
private Integer devTotal; // 设备总数
private Integer completedNum; // 已完成数
public Integer getFirmwareTaskId() {
return firmwareTaskId;
}
public void setFirmwareTaskId(Integer firmwareTaskId) {
this.firmwareTaskId = firmwareTaskId;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public String getTaskDesc() {
return taskDesc;
}
public void setTaskDesc(String taskDesc) {
this.taskDesc = taskDesc;
}
public Integer getFirmwareId() {
return firmwareId;
}
public void setFirmwareId(Integer firmwareId) {
this.firmwareId = firmwareId;
}
public Integer getFirmwareNameId() {
return firmwareNameId;
}
public void setFirmwareNameId(Integer firmwareNameId) {
this.firmwareNameId = firmwareNameId;
}
public String getFirmwareName() {
return firmwareName;
}
public void setFirmwareName(String firmwareName) {
this.firmwareName = firmwareName;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public List<Integer> getDevId() {
return devId;
}
public void setDevId(List<Integer> devId) {
this.devId = devId;
}
public java.util.Date getAddTime() {
return addTime;
}
public void setAddTime(java.util.Date addTime) {
this.addTime = addTime;
}
public Integer getUser_id() {
return user_id;
}
public void setUser_id(Integer user_id) {
this.user_id = user_id;
}
public String getUser_name() {
return user_name;
}
public void setUser_name(String user_name) {
this.user_name = user_name;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getDevTotal() {
return devTotal;
}
public void setDevTotal(Integer devTotal) {
this.devTotal = devTotal;
}
public Integer getCompletedNum() {
return completedNum;
}
public void setCompletedNum(Integer completedNum) {
this.completedNum = completedNum;
}
@Override
public String toString() {
return "FirmwareTask [firmwareTaskId=" + firmwareTaskId + ", taskName=" + taskName + ", taskDesc=" + taskDesc
+ ", firmwareId=" + firmwareId + ", firmwareNameId=" + firmwareNameId + ", firmwareName=" + firmwareName
+ ", nickName=" + nickName + ", version=" + version + ", devId=" + devId + ", addTime=" + addTime
+ ", user_id=" + user_id + ", user_name=" + user_name + ", status=" + status + ", devTotal=" + devTotal
+ ", completedNum=" + completedNum + ", getFirmwareTaskId()=" + getFirmwareTaskId() + ", getTaskName()="
+ getTaskName() + ", getTaskDesc()=" + getTaskDesc() + ", getFirmwareId()=" + getFirmwareId()
+ ", getFirmwareNameId()=" + getFirmwareNameId() + ", getFirmwareName()=" + getFirmwareName()
+ ", getNickName()=" + getNickName() + ", getVersion()=" + getVersion() + ", getDevId()=" + getDevId()
+ ", getAddTime()=" + getAddTime() + ", getUser_id()=" + getUser_id() + ", getUser_name()="
+ getUser_name() + ", getStatus()=" + getStatus() + ", getDevTotal()=" + getDevTotal()
+ ", getCompletedNum()=" + getCompletedNum() + ", getClass()=" + getClass() + ", hashCode()="
+ hashCode() + ", toString()=" + super.toString() + "]";
}
} | [
"15013851179@163.com"
] | 15013851179@163.com |
cb32ea75f11d10f03ac3ac13f077ed43fdfa73c0 | 5a0e4b59ca8dbe85970971349adc3cb82aca6cde | /ClusteringAlgorithm/src/KMeansGUI/ScreenCard.java | 7c6399cc5a57cadc4ec64a3820e442140fb38571 | [] | no_license | nickfarrenkopf/ClusteringAlgorithm | cab70f051546364551ca997177396bfb7e49658a | 2a303c380709025833747993128c2c54a6870f74 | refs/heads/master | 2021-01-13T03:13:06.670502 | 2017-04-10T17:51:41 | 2017-04-10T17:51:41 | 77,630,603 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,304 | java | package KMeansGUI;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import KMeans.Controller;
import Math.Matrix;
import static KMeans.Constants.*;
/**
* ScreenCard is a JPanel that houses the iteration screen for the KMeans algorithm.
* Once loaded, the user is able to change the number of centroids for the algorithm,
* iterate, iterate on a timer, or run all the iterations for the KMeans algorithm.
* ScreenCard implements ActionListener so it can listen to components.
*/
@SuppressWarnings("serial")
public class ScreenCard extends JPanel implements ActionListener{
// Controller variable
private Controller controller;
// JComboBox for choosing number of centroids
private JComboBox<Integer> numberCentroidsBox;
// Buttons that control running
private JButton runButton;
private JButton timedButton;
private JButton allButton;
private JButton resetButton;
/**
* Initializes the screen card with a controller. Initializes a JComponents and adds them to panel.
* @param controller
*/
public ScreenCard(Controller controller)
{
// Sets controller
this.controller = controller;
// JComboBox for number of centroids
JLabel centroidLabel = new JLabel("Number of Centroids:");
Integer[] numCents = new Integer[maxNumberCentroids];
for (int i=0; i<numCents.length; i++)
numCents[i] = (Integer) (i + 1);
numberCentroidsBox = new JComboBox<Integer>(numCents);
numberCentroidsBox.setSelectedIndex(initialNumCentroids - 1);
// Initialize buttons
runButton = new JButton("Run Once");
timedButton = new JButton("Run Timed");
allButton = new JButton("Run All");
resetButton = new JButton("Reset");
// Add actions listeners
numberCentroidsBox.addActionListener(this);
runButton.addActionListener(this);
timedButton.addActionListener(this);
allButton.addActionListener(this);
resetButton.addActionListener(this);
// Add to panel
add(centroidLabel);
add(numberCentroidsBox);
add(runButton);
add(timedButton);
add(allButton);
add(resetButton);
}
/**
* Action Listener for JPanel. Contains code for what to do when boxes are changed or buttons are clicked.
*/
@Override
public void actionPerformed(ActionEvent e)
{
// If centroid box changed
if (e.getSource() == numberCentroidsBox)
if (controller.getKM() != null)
controller.setMessage("To change number of centroids, reset KMeans.");
// If run button clicked
if (e.getSource() == runButton)
controller.Iterate();
// If timed button clicked
if (e.getSource() == timedButton)
if (timedButton.getText().equals("Run Timed"))
{
controller.startTimedIteration();
timedButton.setText("Stop");
} else {
controller.setKeepRunning(false);
timedButton.setText("Run Timed");
}
// If run all button clicked
if (e.getSource() == allButton)
controller.runAll();
// If reset button clicked
if (e.getSource() == resetButton)
controller.resetKMeans();
// If not timed button, turn timer off
if (e.getSource() != timedButton)
{
controller.setKeepRunning(false);
timedButton.setText("Run Timed");
}
// Repaint screen
repaint();
}
/**
* Return the values for number of centroids JComboBox so controller knows how to initialize K Means.
* @return int
*/
public int getNumberCentroids()
{
return (int) numberCentroidsBox.getSelectedItem();
}
/**
* Paints components to screen. Paints all points to screen, transformaing to fit to screen.
* Also draws lines connecting old centroids so user can visualize how centroids change.
*/
public void paint(Graphics g)
{
// Draw everything else
super.paint(g);
// Initialize variables
Graphics2D g2 = (Graphics2D) g;
int[] ind = controller.getPlotIndexes();
Matrix data = controller.transformData(controller.getData());
int size = (int) (Math.sqrt(getParent().getHeight() * getParent().getWidth()) / 100);
if (size > maxPointSize)
size = maxPointSize;
// Prints message to user
g.setFont(smallFont);
g.drawString(controller.getMessage(), messageX, messageY);
// Plot black points if k means not initialized
if (controller.getKM() == null)
{
for (int i=0; i<data.numRows(); i++)
g2.fill(new Ellipse2D.Double(data.getValue(i, 0), data.getValue(i, 1), size, size));
// Plot colored points if k means is initialized
} else {
// Grab k means variables
ArrayList<Matrix> allCentroids = controller.getKM().getAllCentroids();
Matrix c1, c2;
int[] dataIndexes = controller.getKM().getDataCentroidIndex();
// Draw all data points
for (int i=0; i<controller.getKM().getCentroids().numRows(); i++)
{
// If point has specified centroid, draw circle
g2.setColor(colorScheme[i]);
for (int j=0; j<data.numRows(); j++)
if (dataIndexes[j] == i)
g2.fill(new Ellipse2D.Double(data.getValue(j, ind[0]), data.getValue(j, ind[1]), size, size));
}
// Draw all centroids
for (int i=0; i<allCentroids.size(); i++)
{
// Draws all centroids
c1 = controller.transformData(allCentroids.get(i));
for (int j=0; j<c1.numRows(); j++)
{
g2.setColor(colorScheme[j]);
g2.draw(new Ellipse2D.Double(c1.getValue(j, ind[0]), c1.getValue(j, ind[1]), 2 * size, 2 * size));
}
}
// Draw lines connecting centroids
double x1, y1, x2, y2;
for (int i=1; i<allCentroids.size(); i++)
{
c1 = controller.transformData(allCentroids.get(i));
c2 = controller.transformData(allCentroids.get(i - 1));
for (int j=0; j<c1.numRows(); j++)
{
g2.setColor(colorScheme[j]);
x1 = c1.getValue(j, ind[0]) + size;
y1 = c1.getValue(j, ind[1]) + size;
x2 = c2.getValue(j, ind[0]) + size;
y2 = c2.getValue(j, ind[1]) + size;
g2.draw(new Line2D.Double(x1, y1, x2, y2));
}
}
}
}
} | [
"nickfarrenkopf@gmail.com"
] | nickfarrenkopf@gmail.com |
98a146d026f94aa0834036bdb66952103bc3ef2c | a7f9a7f51a4ef56af2e4cafaef77accdcf42b354 | /src/dk/freya/dao/IngredientDAO.java | a602b60718da61ed8199234ab24d31ca3c4f39c6 | [] | no_license | freyahelstrup/graphql-java-example | 37dfbf94876d3d2810690be88c910516cf20b2b2 | 681cb14a82d1801a2ef4b011cd9d4a6af98e8915 | refs/heads/master | 2020-03-15T11:23:21.080679 | 2018-05-08T08:53:36 | 2018-05-08T08:53:36 | 132,119,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,651 | java | package dk.freya.dao;
import dk.freya.dto.IngredientDTO;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class IngredientDAO {
private static IngredientDAO instance;
private Map<Integer, IngredientDTO> ingredientMap;
private int nextId;
private IngredientDAO() {
ingredientMap = new HashMap<>();
addIngredient(new IngredientDTO(0, "kartoffel"));
addIngredient(new IngredientDTO(0, "fisk"));
addIngredient(new IngredientDTO(0, "mel"));
}
public static IngredientDAO getInstance() {
if (instance == null)
instance = new IngredientDAO();
return instance;
}
public List<IngredientDTO> getIngredientList() {
return new ArrayList<>(ingredientMap.values());
}
public IngredientDTO getIngredientFromId(int id) {
return ingredientMap.get(id);
}
public IngredientDTO getIngredientFromName(String name) {
for (IngredientDTO i : ingredientMap.values()) {
if (i.name.equals(name))
return i;
}
return null;
}
public IngredientDTO setIngredient(IngredientDTO ingredient) {
getIngredientFromId(ingredient.id).name = ingredient.name;
return getIngredientFromId(ingredient.id);
}
public IngredientDTO addIngredient(IngredientDTO ingredient) {
ingredient.id = nextId++;
ingredientMap.put(ingredient.id, ingredient);
return getIngredientFromId(ingredient.id);
}
public boolean deleteIngredient(int id) {
return ingredientMap.remove(id) != null;
}
}
| [
"s165232@student.dtu.dk"
] | s165232@student.dtu.dk |
b4f846a6148f45ee8376b61cb2b02fbd04a2cba5 | 53b0d47c6be5bb4ebe8305c5620a19438d9e3f40 | /filemanagerparent/user-manager/src/main/java/com/egs/training/service/UserServiceImpl.java | 6ca05d55006d8405cfce6adf8289e42cca95e9f5 | [] | no_license | tortig/filemanagerparent | 9288f74ef5087af1315f4646701ce0a678bb5651 | 12a8dc955b916a4e4fa04534165f2a9f9b1b3fa4 | refs/heads/master | 2020-03-09T13:02:59.367600 | 2018-04-09T16:22:53 | 2018-04-09T16:22:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,311 | java | package com.egs.training.service;
import com.egs.training.dao.UserDAO;
import com.egs.training.entity.User;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class UserServiceImpl implements UserService{
private static Logger logger = Logger.getLogger("com/egs/training/service");
@Autowired
@Qualifier(value = "userDAO_SFImpl")
private UserDAO userDAO;
@Override
@Transactional
public List<User> getAllUsers() {
logger.debug("Get all Users");
return userDAO.getAllUsers();
}
@Override
@Transactional
public User getUser(Long id) {
logger.debug("User get successfully");
return userDAO.getUser(id);
}
@Override
@Transactional
public void saveUser(User user) {
logger.debug("Adding new User");
userDAO.saveUser(user);
}
@Override
@Transactional
public void deleteUser(Long id) {
logger.debug("Deleting existing user");
userDAO.deleteUser(id);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
52e5e7d6092c24b56c033dd49db1d095443a3334 | 0f1f7332b8b06d3c9f61870eb2caed00aa529aaa | /ebean/tags/v2.0.0/src/com/avaje/ebean/config/AutofetchConfig.java | 0d605064b011a5c3753c969ad3362be7c61ff772 | [] | no_license | rbygrave/sourceforge-ebean | 7e52e3ef439ed64eaf5ce48e0311e2625f7ee5ed | 694274581a188be664614135baa3e4697d52d6fb | refs/heads/master | 2020-06-19T10:29:37.011676 | 2019-12-17T22:09:29 | 2019-12-17T22:09:29 | 196,677,514 | 1 | 0 | null | 2019-12-17T22:07:13 | 2019-07-13T04:21:16 | Java | UTF-8 | Java | false | false | 5,567 | java | package com.avaje.ebean.config;
/**
* Defines the Autofetch behaviour for a EbeanServer.
*/
public class AutofetchConfig {
AutofetchMode mode = AutofetchMode.DEFAULT_ONIFEMPTY;
boolean queryTuning = true;
boolean profiling = true;
int profilingMin = 1;
int profilingBase = 10;
double profilingRate = 0.05;
boolean useFileLogging = true;
String logDirectory;
int profileUpdateFrequency = 60;
int garbageCollectionWait = 100;
public AutofetchConfig() {
}
/**
* Return the mode used when autofetch has not been explicit
* defined on a query.
*/
public AutofetchMode getMode() {
return mode;
}
/**
* Set the mode used when autofetch has not been explicit
* defined on a query.
*/
public void setMode(AutofetchMode mode) {
this.mode = mode;
}
/**
* Return true if the queries are being tuned.
*/
public boolean isQueryTuning() {
return queryTuning;
}
/**
* Set to true if the queries should be tuned by autofetch.
*/
public void setQueryTuning(boolean queryTuning) {
this.queryTuning = queryTuning;
}
/**
* Return true if profiling information should be collected.
*/
public boolean isProfiling() {
return profiling;
}
/**
* Set to true if profiling information should be collected.
* <p>
* The profiling information is collected and then used to
* generate the tuned queries for autofetch.
* </p>
*/
public void setProfiling(boolean profiling) {
this.profiling = profiling;
}
/**
* Return the minimum number of queries to profile
* before autofetch will start tuning the queries.
*/
public int getProfilingMin() {
return profilingMin;
}
/**
* Set the minimum number of queries to profile
* before autofetch will start tuning the queries.
*/
public void setProfilingMin(int profilingMin) {
this.profilingMin = profilingMin;
}
/**
* Return the base number of queries to profile
* before changing to profile only a percentage
* of following queries (profileRate).
*/
public int getProfilingBase() {
return profilingBase;
}
/**
* Set the based number of queries to profile.
*/
public void setProfilingBase(int profilingBase) {
this.profilingBase = profilingBase;
}
/**
* Return the rate (%) of queries to be profiled
* after the 'base' amount of profiling.
*/
public double getProfilingRate() {
return profilingRate;
}
/**
* Set the rate (%) of queries to be profiled
* after the 'base' amount of profiling.
*/
public void setProfilingRate(double profilingRate) {
this.profilingRate = profilingRate;
}
/**
* Return true if a log file should be used to log
* the changes in autofetch query tuning.
*/
public boolean isUseFileLogging() {
return useFileLogging;
}
/**
* Set to true if a log file should be used to log
* the changes in autofetch query tuning.
*/
public void setUseFileLogging(boolean useFileLogging) {
this.useFileLogging = useFileLogging;
}
/**
* Return the log directory to put the autofetch log.
*/
public String getLogDirectory() {
return logDirectory;
}
/**
* Return the log directory substituting any expressions
* such as ${catalina.base} etc.
*/
public String getLogDirectoryWithEval() {
return PropertyExpression.eval(logDirectory);
}
/**
* Set the directory to put the autofetch log in.
*/
public void setLogDirectory(String logDirectory) {
this.logDirectory = logDirectory;
}
/**
* Return the frequency in seconds to update the autofetch
* tuned queries from the profiled information.
*/
public int getProfileUpdateFrequency() {
return profileUpdateFrequency;
}
/**
* Set the frequency in seconds to update the autofetch
* tuned queries from the profiled information.
*/
public void setProfileUpdateFrequency(int profileUpdateFrequency) {
this.profileUpdateFrequency = profileUpdateFrequency;
}
/**
* Return the time in millis to wait after a system gc to
* collect profiling information.
* <p>
* The profiling information is collected on object finalise.
* As such we generally don't want to trigger GC (let the JVM do its thing)
* but on shutdown the autofetch manager will trigger System.gc() and then
* wait (default 100 millis) to hopefully collect profiling information -
* especially for short run unit tests.
* </p>
*/
public int getGarbageCollectionWait() {
return garbageCollectionWait;
}
/**
* Set the time in millis to wait after a System.gc() to collect
* profiling information.
*/
public void setGarbageCollectionWait(int garbageCollectionWait) {
this.garbageCollectionWait = garbageCollectionWait;
}
/**
* Load the settings from the properties file.
*/
public void loadSettings(ConfigPropertyMap p){
queryTuning = p.getBoolean("autofetch.querytuning", true);
profiling = p.getBoolean("autofetch.profiling", true);
mode = p.getEnum(AutofetchMode.class, "implicitmode", AutofetchMode.DEFAULT_ONIFEMPTY);
profilingMin = p.getInt("autofetch.profiling.min", 1);
profilingBase = p.getInt("autofetch.profiling.base", 10);
String rate = p.get("autofetch.profiling.rate", "0.05");
profilingRate = Double.parseDouble(rate);
useFileLogging = p.getBoolean("autofetch.useFileLogging", true);
profileUpdateFrequency = p.getInt("autofetch.profiling.updatefrequency", 60);
}
}
| [
"208973+rbygrave@users.noreply.github.com"
] | 208973+rbygrave@users.noreply.github.com |
414ca0eb8701fb0d134e613d5a9598fc4908e38e | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/edu/umd/cs/findbugs/integration/FindNullDerefIntegrationTest.java | 3fd8865b00589874e1d1dafd822534b382ccd26f | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 2,681 | java | /**
* FindBugs - Find Bugs in Java programs
* Copyright (C) 2003-2008 University of Maryland
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package edu.umd.cs.findbugs.integration;
import edu.umd.cs.findbugs.AbstractIntegrationTest;
import edu.umd.cs.findbugs.test.matcher.BugInstanceMatcher;
import edu.umd.cs.findbugs.test.matcher.BugInstanceMatcherBuilder;
import java.io.IOException;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Test;
public class FindNullDerefIntegrationTest extends AbstractIntegrationTest {
@Test
public void testNullFromReturnOnLambda() {
performAnalysis("Elvis.class");
// There should only be 1 issue of this type
final BugInstanceMatcher bugTypeMatcher = new BugInstanceMatcherBuilder().bugType("SI_INSTANCE_BEFORE_FINALS_ASSIGNED").build();
Assert.assertThat(getBugCollection(), containsExactly(1, bugTypeMatcher));
// It must be on the INSTANCE field
final BugInstanceMatcher bugInstanceMatcher = new BugInstanceMatcherBuilder().bugType("SI_INSTANCE_BEFORE_FINALS_ASSIGNED").inClass("Elvis").atField("INSTANCE").build();
Assert.assertThat(getBugCollection(), Matchers.hasItem(bugInstanceMatcher));
}
@Test
public void testLambdaIssue20() throws IOException, InterruptedException {
performAnalysis("lambdas/Issue20.class");
// There should only be 1 issue of this type
final BugInstanceMatcher bugTypeMatcher = new BugInstanceMatcherBuilder().bugType("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE").build();
Assert.assertThat(getBugCollection(), containsExactly(1, bugTypeMatcher));
// It must be on the lambda method, checking by line number
final BugInstanceMatcher bugInstanceMatcher = new BugInstanceMatcherBuilder().bugType("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE").inClass("Issue20").atLine(24).build();
Assert.assertThat(getBugCollection(), Matchers.hasItem(bugInstanceMatcher));
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
fa24b60eae94d4384987533cb5c097cfccade0e8 | 0cd4206ee306d2d4a69d3316fb212274417d6996 | /Dalke_Assignment02/Assignment02/app/src/test/java/csc214/assignment02/ExampleUnitTest.java | 0611da3a5dbcc3ccbbd74ed0ff6890bb8fbf2c58 | [] | no_license | chrisdalke/CSC214-Android-Development | 4d34a7dcf0d5012e0c92541ace1cb92a9309f7a9 | 97141a9a54475645713210084d7728247b994d92 | refs/heads/master | 2022-04-05T15:06:30.331619 | 2020-02-22T22:01:21 | 2020-02-22T22:01:21 | 79,950,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 397 | java | package csc214.assignment02;
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() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"chrisdalke@gmail.com"
] | chrisdalke@gmail.com |
55cd6ab6f83f3eeb41f9bbf808b6e1e2d0b03cc9 | 8cd7a5bdcdbd6ef65e927f39b130db73c1be328d | /projects/com.oracle.truffle.llvm/src/com/oracle/truffle/llvm/LLVMOptimizations.java | 279add8038515c38dab1ad4a143b70450d9bbd55 | [
"BSD-3-Clause"
] | permissive | eregon/sulong | 06d6bb859f95cc95e1833cb8d9fea7ed611f0158 | b2cff7000b6d674174ebdb91d870d232a5d25ae9 | refs/heads/master | 2020-12-25T12:42:05.534547 | 2016-01-30T22:05:35 | 2016-01-30T22:05:35 | 50,747,296 | 0 | 0 | null | 2016-01-30T22:09:24 | 2016-01-30T22:09:24 | null | UTF-8 | Java | false | false | 2,360 | java | /*
* Copyright (c) 2016, Oracle and/or its affiliates.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.oracle.truffle.llvm;
public final class LLVMOptimizations {
private LLVMOptimizations() {
}
/**
* Speculation based on the <code>llvm.expect</code> intrinsic.
*/
public static final boolean VALUE_SPECIALIZATION_EXPECT_INTRINSIC = true;
/**
* Speculates that memory reads always return the same result.
*/
public static final boolean VALUE_PROFILING_MEMORY_READS = true;
/**
* Record branch probabilities for the LLVM <code>select</code> instruction.
*/
public static final boolean BRANCH_INJECTION_SELECT_INSTRUCTION = true;
/**
* Record branch probabilities for the LLVM <code>br</code> instruction.
*/
public static final boolean BRANCH_INJECTION_CONDITIONAL_BRANCH = true;
}
| [
"rigger.manuel@gmail.com"
] | rigger.manuel@gmail.com |
7e4df7cee42340f31eb7f0f56797f5b3cd47bd05 | b428c3595e717c6eb7eff50b6ef1a077a762175d | /JSPProject/src/by/iba/gomel/commands/ChangeCommand.java | 8e471b72b05253c681e817b805d9fb06ee95f595 | [] | no_license | Vlady32/jsp | a54e04cad8e8af70f1448b252e8ea4a0496b9f02 | 05d81f384c64a72f5d800017224a979756f57886 | refs/heads/master | 2021-01-10T15:26:05.096004 | 2016-05-11T19:44:38 | 2016-05-11T19:44:38 | 54,199,763 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 599 | java | package by.iba.gomel.commands;
import by.iba.gomel.Constants;
import by.iba.gomel.SessionRequest;
import by.iba.gomel.interfaces.IActionCommand;
import by.iba.gomel.managers.ConfigurationManager;
/**
* This class implements interface IActionCommand and realizes method execute. This class uses for
* change record.
*/
public class ChangeCommand implements IActionCommand {
@Override
public String execute(final SessionRequest request) {
new ProfileCommand().execute(request);
return ConfigurationManager.getProperty(Constants.PROPERTY_PATH_EDIT_PROFILE_PAGE);
}
}
| [
"UKalatsei@gomel.iba.by"
] | UKalatsei@gomel.iba.by |
dbedbffd38370349df3924e355f73c2941430417 | b49628948894caed5d618cd0d34f91dfafd21db5 | /todoSB/src/main/java/com/example/todoapp/models/CarDetailsCollection.java | d54b29c7afedb0c203961096f8817889a8a9ba4c | [] | no_license | EshaMayuri/CarGasMileageServerSide | 04ad45b764dc155274b2e5ab8ba658df69f6020d | 0bc3c55a99502696b96d7f6a4040e06ca8e91817 | refs/heads/master | 2021-08-11T13:13:07.798309 | 2017-11-13T19:15:17 | 2017-11-13T19:15:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,952 | java | //package edu.umkc.mobile.cargasmileageestimator.data;
package com.example.todoapp.models;
import org.springframework.data.mongodb.core.mapping.Document;
/**
* Created by Esha Mayuri on 11/12/2017.
*/
@Document(collection="carDetails")
public class CarDetailsCollection {
private String id;
private String emailId;
private String make;
private String model;
private String year;
private String odometer;
private String tankCapacity;
private String mileage;
private String fuel;
private String totalGas;
private String totalGasCost;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getEmailId() {
return emailId;
}
public void setEmailId(String emailId) {
this.emailId = emailId;
}
public String getMake() {
return make;
}
public void setMake(String make) {
this.make = make;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getOdometer() {
return odometer;
}
public void setOdometer(String odometer) {
this.odometer = odometer;
}
public String getTankCapacity() {
return tankCapacity;
}
public void setTankCapacity(String tankCapacity) {
this.tankCapacity = tankCapacity;
}
public String getMileage() {
return mileage;
}
public void setMileage(String mileage) {
this.mileage = mileage;
}
public String getFuel() {
return fuel;
}
public void setFuel(String fuel) {
this.fuel = fuel;
}
public String getTotalGas() {
return totalGas;
}
public void setTotalGas(String totalGas) {
this.totalGas = totalGas;
}
public String getTotalGasCost() {
return totalGasCost;
}
public void setTotalGasCost(String totalGasCost) {
this.totalGasCost = totalGasCost;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((emailId == null) ? 0 : emailId.hashCode());
result = prime * result + ((fuel == null) ? 0 : fuel.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((make == null) ? 0 : make.hashCode());
result = prime * result + ((mileage == null) ? 0 : mileage.hashCode());
result = prime * result + ((model == null) ? 0 : model.hashCode());
result = prime * result + ((odometer == null) ? 0 : odometer.hashCode());
result = prime * result + ((tankCapacity == null) ? 0 : tankCapacity.hashCode());
result = prime * result + ((totalGas == null) ? 0 : totalGas.hashCode());
result = prime * result + ((totalGasCost == null) ? 0 : totalGasCost.hashCode());
result = prime * result + ((year == null) ? 0 : year.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CarDetailsCollection other = (CarDetailsCollection) obj;
if (emailId == null) {
if (other.emailId != null)
return false;
} else if (!emailId.equals(other.emailId))
return false;
if (fuel == null) {
if (other.fuel != null)
return false;
} else if (!fuel.equals(other.fuel))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (make == null) {
if (other.make != null)
return false;
} else if (!make.equals(other.make))
return false;
if (mileage == null) {
if (other.mileage != null)
return false;
} else if (!mileage.equals(other.mileage))
return false;
if (model == null) {
if (other.model != null)
return false;
} else if (!model.equals(other.model))
return false;
if (odometer == null) {
if (other.odometer != null)
return false;
} else if (!odometer.equals(other.odometer))
return false;
if (tankCapacity == null) {
if (other.tankCapacity != null)
return false;
} else if (!tankCapacity.equals(other.tankCapacity))
return false;
if (totalGas == null) {
if (other.totalGas != null)
return false;
} else if (!totalGas.equals(other.totalGas))
return false;
if (totalGasCost == null) {
if (other.totalGasCost != null)
return false;
} else if (!totalGasCost.equals(other.totalGasCost))
return false;
if (year == null) {
if (other.year != null)
return false;
} else if (!year.equals(other.year))
return false;
return true;
}
}
| [
"mewanabdelmajeed@gmail.com"
] | mewanabdelmajeed@gmail.com |
95f1ccd68b51bb7010a9c4feb1b7eb3eaa052fb8 | 167ea134f9b2977d4ba6da4c017f209a56ea980c | /MicroserviceExamples/Vid4DatabaseOperations2/src/main/java/com/lahiru/training/microserviceanddatabases/service/CarService.java | 9fc5ca0c65eae181317c71827ffdfcf87c74630c | [] | no_license | its-lahiru/Krish_SE_training | a337e1089f8eeafe76921842e9bc3359fef2e55e | 4df65542768bdeb169ee5f96a32612e0126e0606 | refs/heads/main | 2023-03-03T23:45:43.899261 | 2021-02-14T12:43:12 | 2021-02-14T12:43:12 | 330,018,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | package com.lahiru.training.microserviceanddatabases.service;
import com.lahiru.training.microserviceanddatabases.model.Car;
public interface CarService {
Car save(Car car);
Car fetchCarById(int id);
}
| [
"lahirus250@gmail.com"
] | lahirus250@gmail.com |
e032ce6182d62e9397e477d85edf598b9ea4263a | da1e8b59aa1a183a432cbedab45f2ee99e519ba4 | /controllers/DiceController.java | 0cafb7ac5b53849b5f605517c44533c50cfb475b | [] | no_license | victor-jaimes-puente/SpringBootTestRep | 924bb144d4ae9beb0eae6bfd983d89233483bf9f | 4bc529ae287a7e254b591718c7918a45071829c8 | refs/heads/master | 2022-09-03T17:43:19.705474 | 2020-05-29T20:26:11 | 2020-05-29T20:26:11 | 267,939,623 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,803 | java | package com.codeup.springblogapp.controllers;
import com.codeup.springblogapp.model.DiceSet;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.ArrayList;
@Controller
public class DiceController {
@GetMapping("/roll-dice")
public String getUserGuess() {
return ("roll_guess");
}
@GetMapping("/roll-dice-once")
public String getGuess(Model model) {
boolean isFirstGuess = true;
model.addAttribute("first_guess", isFirstGuess);
return ("roll_single_guess");
}
@GetMapping("/roll-dice-once/{guess}")
public String getUserGuess(@PathVariable int guess, Model model) {
// one roll only
boolean isFirstGuess = false;
boolean isCorrect = false;
DiceSet diceSet = new DiceSet();
diceSet.die1 = (byte) ((Math.random() * 6) + 1);
diceSet.die2 = (byte) ((Math.random() * 6) + 1);
if (diceSet.die1 + diceSet.die2 == guess) {
isCorrect = true;
diceSet.result = "Winner, Winner, Chicken dinner!";
} else {
diceSet.result = "Born to loose. ;-(";
}
String header = String.format("Your guess was %d.", guess);
model.addAttribute("first_guess", isFirstGuess);
model.addAttribute("header", header);
model.addAttribute("dice", diceSet);
return ("roll_single_guess");
}
@PostMapping("/roll-dice")
public String processUserGuess(@RequestParam(name = "guess") int guess, Model model) {
// play five roles
int limit = 5;
int countCorrect = 0;
ArrayList<DiceSet> diceSets = new ArrayList<>();
for (int i = 0; i < limit; i++) {
DiceSet diceSet = new DiceSet();
diceSet.die1 = (byte) ((Math.random() * 6) + 1);
diceSet.die2 = (byte) ((Math.random() * 6) + 1);
if (diceSet.die1 + diceSet.die2 == guess) {
countCorrect++;
diceSet.result = "Winner, Winner, Chicken dinner!";
} else {
diceSet.result = "Born to loose. ;-(";
}
diceSets.add(diceSet);
}
String header = String.format("Your guess was %d.", guess);
String message = String.format("You got %d out of %d rolls correct.",
countCorrect, limit);
model.addAttribute("header", header);
model.addAttribute("message", message);
model.addAttribute("dice", diceSets);
return ("roll_result");
}
}
| [
"victor.jaimes.puente@gmail.com"
] | victor.jaimes.puente@gmail.com |
a476b71015f2cd78d0fde561f0ee5a4afb67b00d | 3c2685bddc415130476750465bc737a53defaddc | /microservice-business/business-admin/src/main/java/com/wuqianqian/business/admin/config/KaptchaConfig.java | 299bd2bafded350fa43e7ca20f49b988b959cb20 | [] | no_license | peiqingliu/managementplatform | 65653397078d6c5adee27299da9e39615a388f71 | 1c5c8ff7f44f16c1e3d80ec82d63ce8249fdcfb2 | refs/heads/master | 2020-03-30T07:07:28.713968 | 2018-10-09T02:21:19 | 2018-10-09T02:21:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,140 | java | package com.wuqianqian.business.admin.config;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import com.wuqianqian.core.commons.constants.SecurityConstant;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
/**
* 验证码配置类
* @author liupeqing
* @date 2018/9/28 20:08
*/
@Configuration
public class KaptchaConfig {
private static final String KAPTCHA_BORDER = "kaptcha.border";
private static final String KAPTCHA_TEXTPRODUCER_FONT_COLOR = "kaptcha.textproducer.font.color";
private static final String KAPTCHA_TEXTPRODUCER_CHAR_SPACE = "kaptcha.textproducer.char.space";
private static final String KAPTCHA_IMAGE_WIDTH = "kaptcha.image.width";
private static final String KAPTCHA_IMAGE_HEIGHT = "kaptcha.image.height";
private static final String KAPTCHA_TEXTPRODUCER_CHAR_LENGTH = "kaptcha.textproducer.char.length";
private static final Object KAPTCHA_IMAGE_FONT_SIZE = "kaptcha.textproducer.font.size";
//创建验证码实体对象
@Bean
public DefaultKaptcha producer(){
Properties properties = new Properties();
properties.put(KAPTCHA_BORDER,SecurityConstant.DEFAULT_IMAGE_BORDER);
properties.put(KAPTCHA_BORDER, SecurityConstant.DEFAULT_IMAGE_BORDER);
properties.put(KAPTCHA_TEXTPRODUCER_FONT_COLOR, SecurityConstant.DEFAULT_COLOR_FONT);
properties.put(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, SecurityConstant.DEFAULT_CHAR_SPACE);
properties.put(KAPTCHA_IMAGE_WIDTH, SecurityConstant.DEFAULT_IMAGE_WIDTH);
properties.put(KAPTCHA_IMAGE_HEIGHT, SecurityConstant.DEFAULT_IMAGE_HEIGHT);
properties.put(KAPTCHA_IMAGE_FONT_SIZE, SecurityConstant.DEFAULT_IMAGE_FONT_SIZE);
properties.put(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, SecurityConstant.DEFAULT_IMAGE_LENGTH);
Config config = new Config(properties);
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
defaultKaptcha.setConfig(config);
return defaultKaptcha;
}
}
| [
"1226880979@qq.com"
] | 1226880979@qq.com |
7ea929cbad330326fafd00445e89217cb45f44ca | 54a208350c8ed7b1be2dc9a5a9ba183ad920a006 | /app/src/main/java/com/daqa/data/sp/ISPHelper.java | fac6ca8b6dd77bab050462ee9b2dcd73c860eab2 | [] | no_license | RakeshTM/Quiz | 255d6af7bc3f663f164f2be2349acdae3949c7f4 | 5292900a3ce3dfdef8cf96bda9cd23b6c7773c24 | refs/heads/master | 2020-03-30T10:33:59.587526 | 2018-10-01T17:16:42 | 2018-10-01T17:16:42 | 151,119,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 121 | java | package com.daqa.data.sp;
public interface ISPHelper {
void setAppInitialized();
boolean isAppInitialized();
}
| [
"rakesh.tm@inubesolutions.com"
] | rakesh.tm@inubesolutions.com |
600bc046586cf15794144d62ee1ea6dcddf8955b | f0e8fe7eab635f2adf766ee9ca7dd4d4977b94f7 | /main/ar.com.oxen.nibiru.ui/ar.com.oxen.nibiru.ui.vaadin/src/main/java/ar/com/oxen/nibiru/ui/vaadin/api/ApplicationAccessor.java | 91a6ca26e6bf78664ecefa2a151f6fabc4635a92 | [] | no_license | lbrasseur/nibiru | 2d2ebdfce9175db7114890c54cb3e1ed1c607563 | 1764153c2f38f3430042132a5b8ff5e0d5572207 | refs/heads/master | 2022-07-28T00:08:56.059668 | 2015-09-08T14:25:05 | 2015-09-08T14:25:05 | 32,324,375 | 0 | 0 | null | 2022-07-08T19:06:32 | 2015-03-16T12:49:02 | Java | UTF-8 | Java | false | false | 336 | java | package ar.com.oxen.nibiru.ui.vaadin.api;
import com.vaadin.Application;
/**
* Interface for accessing Vaadin application from a service. Since
* {@link Application} is not an interface, it can't be exposed as a service.
*/
public interface ApplicationAccessor {
Application createApplication();
Application getApplication();
}
| [
"lbrasseur@gmail.com"
] | lbrasseur@gmail.com |
17903c0c1b3f5cbd22932df5c494549afc31093f | ffc584189dc927944f2f2b346ab1f1c1a30f7649 | /src/main/java/com/js/worker/code/Test3.java | abcedd3cb8e8eecc8a27514f76841a342678a98f | [] | no_license | guogai1949/js_code | 64cfb65ab2d2624128b1bdeb193ace38cc154e7e | cd1d2e4285b5b8808b9a148bc67ad9be7d24afb7 | refs/heads/master | 2022-07-09T20:27:32.257994 | 2020-03-04T03:44:41 | 2020-03-04T03:44:41 | 87,501,157 | 0 | 0 | null | 2022-06-17T02:12:12 | 2017-04-07T03:37:01 | Java | UTF-8 | Java | false | false | 713 | java | package com.js.worker.code;
public class Test3 {
public void testCase(int x) {
switch (x)
{
case 1: System.out.println("Test1");
case 2:
case 3:
System.out.println("Test2");
break;
default:
System.out.println("Test3");
break;
}
}
public static void main(String args[]) {
Test3 test3 = new Test3();
System.out.println("===============0");
test3.testCase(0);
System.out.println("===============1");
test3.testCase(1);
System.out.println("===============2");
test3.testCase(2);
System.out.println("===============3");
test3.testCase(3);
String s = "";
System.out.println(s.length());
}
}
| [
"578538991@qq.com"
] | 578538991@qq.com |
a33313ee5c032c1e04c69436003bbc4b954752b1 | 7d7aafb349277925b72541f09a3bf3f82a7c914e | /commons/src/main/java/com/setty/commons/cons/registry/Header.java | c429c8c9fe895096ab7e313dce924645f0a4f70d | [] | no_license | IsSenHu/setty | 3c7bc24e9cbfc2838e463bc2c41b929b2814ccca | 2810eb8f6f5a958402eb60f22187a3446f156686 | refs/heads/master | 2022-10-22T02:49:16.446016 | 2019-11-29T09:54:46 | 2019-11-29T09:54:46 | 195,032,562 | 1 | 0 | null | 2022-10-04T23:52:57 | 2019-07-03T10:31:27 | Java | UTF-8 | Java | false | false | 203 | java | package com.setty.commons.cons.registry;
/**
* @author HuSen
* create on 2019/7/8 10:20
*/
public class Header {
public static final String REGISTRY_IS_REPLICATION = "registry-is-replication";
}
| [
""
] | |
95c1856283c21c654474844908132f2a7b7d84e5 | f7bbf3ec53cbe7cdcb5cec571738aad0b6dea075 | /catalog-fe/src/main/java/org/openecomp/sdc/fe/utils/BeProtocol.java | 923728672e4e4aa82fc369b3aaf3005612ccbad0 | [
"Apache-2.0"
] | permissive | infosiftr/sdc | 450d65c6f03bf153bbd09975460651250227e443 | a1f23ec5e7cd191b76271b5f33c237bad38c61c6 | refs/heads/master | 2020-04-15T19:43:14.670197 | 2018-11-28T09:49:51 | 2019-01-08T15:37:03 | 164,961,555 | 0 | 0 | NOASSERTION | 2019-01-10T00:43:14 | 2019-01-10T00:43:13 | null | UTF-8 | Java | false | false | 267 | java | package org.openecomp.sdc.fe.utils;
public enum BeProtocol {
HTTP("http"), SSL("ssl");
private String protocolName;
public String getProtocolName() {
return protocolName;
}
BeProtocol(String protocolName) {
this.protocolName = protocolName;
}
}; | [
"ml636r@att.com"
] | ml636r@att.com |
58e185f098b4342b62592d68eed433a48158738d | d57fc3d03a9fba5c45507f0d30e00fca7a09d55f | /app/src/main/java/com/lsjr/zizisteward/ly/activity/Fragment_Found.java | 7775446b15187a469e51bcd76f621da41dabec09 | [] | no_license | gyymz1993/V6.1 | 8bc1cd4d9c10890331a4366b06c9384c7ba9068c | ecb13d853b4adc69f915ec24ff3cd501f99ee80e | refs/heads/master | 2020-03-28T21:41:16.584853 | 2017-06-20T11:58:41 | 2017-06-20T11:58:41 | 94,621,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,932 | java | package com.lsjr.zizisteward.ly.activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.google.gson.Gson;
import com.hyphenate.chatuidemo.ui.MainActivity;
import com.libs.zxing.CaptureActivity;
import com.lsjr.zizisteward.R;
import com.lsjr.zizisteward.basic.App;
import com.lsjr.zizisteward.bean.CircleFoundBean;
import com.lsjr.zizisteward.bean.CircleFoundBean.Circle;
import com.lsjr.zizisteward.http.HttpClientGet;
import com.lsjr.zizisteward.http.HttpConfig;
import com.lsjr.zizisteward.http.MyError;
import com.squareup.picasso.Picasso;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
public class Fragment_Found extends Fragment implements OnClickListener {
private View rootView;
private LinearLayout ll_message;
private LinearLayout ll_back;
private LinearLayout ll_scan;
private RoundImageView iv_head;
private LinearLayout ll_circle;
private LinearLayout ll_red_packet;
@Override
@Nullable
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (null == rootView) {
rootView = inflater.inflate(R.layout.fragment_found, null);
ll_back = (LinearLayout) rootView.findViewById(R.id.ll_back);
ll_scan = (LinearLayout) rootView.findViewById(R.id.ll_scan);
iv_head = (RoundImageView) rootView.findViewById(R.id.iv_head);
ll_circle = (LinearLayout) rootView.findViewById(R.id.ll_circle);
ll_message = (LinearLayout) rootView.findViewById(R.id.ll_message);
ll_red_packet = (LinearLayout) rootView.findViewById(R.id.ll_red_packet);
ll_back.setOnClickListener(this);
ll_scan.setOnClickListener(this);
ll_circle.setOnClickListener(this);
ll_red_packet.setOnClickListener(this);
}
return rootView;
}
private void getData() {
Map<String, String> map = new HashMap<String, String>();
map.put("OPT", "426");
map.put("user_id", Fragment_ChatList.addSign(Long.valueOf(App.getUserInfo().getId()), "u"));
new HttpClientGet(getContext(), null, map, false, new HttpClientGet.CallBacks<String>() {
@Override
public void onSuccess(String result) {
CircleFoundBean cfBean = new Gson().fromJson(result, CircleFoundBean.class);
Circle circle = cfBean.getCircle();
if (null != circle) {
ll_message.setVisibility(View.VISIBLE);
Picasso.with(getContext()).load(HttpConfig.IMAGEHOST + circle.getPhoto()).into(iv_head);
} else {
ll_message.setVisibility(View.GONE);
}
}
});
}
@Override
public void onResume() {
getData();
super.onResume();
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.ll_back:
MainActivity.dismiss();
break;
case R.id.ll_circle:
startActivity(new Intent(getActivity(),
Fragment_Circle_Friends.class));
break;
case R.id.ll_scan:
startActivityForResult(new Intent(getContext(),
CaptureActivity.class), 1);
break;
case R.id.ll_red_packet:
startActivity(new Intent(getContext(), RedPacketWeb.class));
break;
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case 1:
if (resultCode == -1) {
// 获取解析的数据
String text = data.getStringExtra("text");
handleResult(text);
}
break;
}
}
private void handleResult(String text) {
// 普通字符串
if (TextUtils.isEmpty(text)) {
return;
}
if (text.startsWith("http://") || text.startsWith("https://")) {
// 跳到浏览器加载网页
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(text));
startActivity(intent);
} else if (text.startsWith("tel:")) {
// 跳到打电话页面
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse(text));
startActivity(intent);
} else if (text.startsWith("smsto:")) {
// 跳到发短信页面
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse(text));
startActivity(intent);
} else if (text.startsWith("mailto:")) {
// 跳到发邮件页面
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse(text));
startActivity(intent);
} else if (text.startsWith("market://")) {
// 跳到应用市场页面
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(text));
startActivity(intent);
} else if (text.startsWith("ziziUser:")) {
String[] str = text.split("ziziUser:");
getQrCode("1", str[1]);
} else if (text.startsWith("ziziGroup:")) {
String[] str = text.split("ziziGroup:");
getQrCode("2", str[1]);
} else if (text.startsWith("zizicard:")) {
String[] str = text.split("zizicard:");
// 获取解析的数据
startActivity(new Intent(getContext(),
CardHolderDetails.class).putExtra("id",
str[1]).putExtra("activity", "save"));
} else {
// 用弹窗展示信息
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle("扫描结果:");// 标题
builder.setMessage(text);// 内容
builder.setPositiveButton("确定", null);
builder.show();
}
}
private void getQrCode(final String _type, final String content) {
Map<String, String> map = new HashMap<>();
map.put("OPT", "266");
map.put("content", content);
map.put("type", _type);
new HttpClientGet(getContext(), null, map, false,
new HttpClientGet.CallBacks<String>() {
@Override
public void onSuccess(String result) {
try {
System.out.println(result);
JSONObject jObject = new JSONObject(result);
String error = jObject.getString("error");
if (error.equals("1")) {
switch (_type) {
case "1":
startActivity(new Intent(getContext(),
QrCodePersonalActivity.class)
.putExtra("id", content));
break;
case "2":
startActivity(new Intent(getContext(),
QrCodeAddGroupActivity.class)
.putExtra("id", content));
break;
}
} else {
// 用弹窗展示信息
AlertDialog.Builder builder = new AlertDialog.Builder(
getContext());
builder.setTitle("扫描结果:");// 标题
builder.setMessage(content);// 内容
builder.setPositiveButton("确定", null);
builder.show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onFailure(MyError myError) {
super.onFailure(myError);
}
});
}
}
| [
"gyymz1993@126.com"
] | gyymz1993@126.com |
19dbd1f65d893941a58773e3a49db4fd1553bc00 | b452eceb185010f0307f994f5fa80bb6b3e2e315 | /src/main/java/com/example/api/cars/exception/UserNotFoundException.java | c991414565ab89267da441ba795191adfe22056a | [
"MIT"
] | permissive | annezdz/Orange-Talents | 9d5a0a6975e0b71e53e0f9d766181134e234d72f | a863d623116a04666e26ef87eb616d58ed0d260b | refs/heads/master | 2023-06-11T02:24:34.898986 | 2021-06-17T00:01:53 | 2021-06-17T00:01:53 | 376,532,924 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 172 | java | package com.example.api.cars.exception;
public class UserNotFoundException extends RuntimeException{
public UserNotFoundException(String s){
super(s);
}
}
| [
"annezdz@hotmail.com"
] | annezdz@hotmail.com |
6f886ddad587d76cf0dff803129544808d966456 | 11cc7bde403936ac1a6df4d5b3313e3f3172b21a | /tyl42/app/src/main/java/com/example/tyl4/LoginForgetActivity.java | cb59e8d54d44ae3da94acf19ea1def238ba71576 | [] | no_license | 18990170tyl/homework | 040e26eb709d5f7bada89888e309ee3d9eae335d | 1297a626fc343c7da8a9f7be5a756cc5e63da191 | refs/heads/main | 2023-02-02T22:05:47.218660 | 2020-12-18T10:08:47 | 2020-12-18T10:08:47 | 303,405,584 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,571 | java | package com.example.tyl4;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.example.tyl4.bean.UserInfo;
import com.example.tyl4.database.UserDBHelper;
import com.example.tyl4.util.DateUtil;
public class LoginForgetActivity extends AppCompatActivity implements View.OnClickListener {
private EditText et_password_first; // 声明一个编辑框对象
private EditText et_password_second; // 声明一个编辑框对象
private EditText et_verifycode; // 声明一个编辑框对象
private String mVerifyCode; // 验证码
private String mPhone; // 手机号码
private UserDBHelper mHelper; // 声明一个用户数据库的帮助器对象
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_forget);
// 从布局文件中获取名叫et_password_first的编辑框
et_password_first = findViewById(R.id.et_password_first);
// 从布局文件中获取名叫et_password_second的编辑框
et_password_second = findViewById(R.id.et_password_second);
// 从布局文件中获取名叫et_verifycode的编辑框
et_verifycode = findViewById(R.id.et_verifycode);
findViewById(R.id.btn_verifycode).setOnClickListener(this);
findViewById(R.id.btn_confirm).setOnClickListener(this);
// 从前一个页面获取要修改密码的手机号码
mPhone = getIntent().getStringExtra("phone");
}
@Override
protected void onResume() {
super.onResume();
// 获得用户数据库帮助器的一个实例
mHelper = UserDBHelper.getInstance(this, 2);
// 恢复页面,则打开数据库连接
mHelper.openWriteLink();
}
@Override
protected void onPause() {
super.onPause();
// 暂停页面,则关闭数据库连接
mHelper.closeLink();
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.btn_verifycode) { // 点击了“获取验证码”按钮
if (mPhone == null || mPhone.length() < 11) {
Toast.makeText(this, "请输入正确的手机号", Toast.LENGTH_SHORT).show();
return;
}
// 生成六位随机数字的验证码
mVerifyCode = String.format("%06d", (int) ((Math.random() * 9 + 1) * 100000));
// 弹出提醒对话框,提示用户六位验证码数字
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("请记住验证码");
builder.setMessage("手机号" + mPhone + ",本次验证码是" + mVerifyCode + ",请输入验证码");
builder.setPositiveButton("好的", null);
AlertDialog alert = builder.create();
alert.show();
} else if (v.getId() == R.id.btn_confirm) { // 点击了“确定”按钮
String password_first = et_password_first.getText().toString();
String password_second = et_password_second.getText().toString();
if (password_first.length() < 6 || password_second.length() < 6) {
Toast.makeText(this, "请输入正确的新密码", Toast.LENGTH_SHORT).show();
return;
}
if (!password_first.equals(password_second)) {
Toast.makeText(this, "两次输入的新密码不一致", Toast.LENGTH_SHORT).show();
return;
}
if (!et_verifycode.getText().toString().equals(mVerifyCode)) {
Toast.makeText(this, "请输入正确的验证码", Toast.LENGTH_SHORT).show();
} else {
UserInfo info = new UserInfo();
info.phone = mPhone;
info.pwd = password_first;
info.update_time = DateUtil.getNowDateTime("yyyy-MM-dd HH:mm:ss");
mHelper.update(info,"phone=" + mPhone);
Toast.makeText(this, "密码修改成功", Toast.LENGTH_SHORT).show();
// 把修改好的新密码返回给前一个页面
Intent intent = new Intent();
intent.putExtra("new_password", password_first);
setResult(Activity.RESULT_OK, intent);
finish();
}
}
}
}
| [
"85159179@qq.com"
] | 85159179@qq.com |
b393444638627e233a5347d1880cae45bc9d1190 | 70fbb6723a1badc8b24e6d13801ac48f8fa7baea | /test/src/main/java/pico/erp/shared/ComponentDefinitionServiceLoaderTestComponentSiblingsSupplier.java | c88db0f9f9dda5b59d516bc52eac46412de12fc9 | [] | no_license | kkojaeh/pico-erp-shared | 62408f06093bcffd24afdd4df4a856498d69f76c | 2c90adfc81ea52e9463f59e35f20a044d242bbe5 | refs/heads/master | 2020-03-27T10:18:21.383724 | 2019-04-04T08:24:57 | 2019-04-04T08:24:57 | 146,410,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 643 | java | package pico.erp.shared;
import java.util.LinkedList;
import java.util.ServiceLoader;
import java.util.function.Supplier;
import lombok.val;
import pico.erp.ComponentDefinition;
public class ComponentDefinitionServiceLoaderTestComponentSiblingsSupplier implements
Supplier<Class<?>[]> {
@Override
public Class<?>[] get() {
ServiceLoader<ComponentDefinition> loader = ServiceLoader.load(ComponentDefinition.class);
val components = new LinkedList<Class<?>>();
loader.forEach(definition -> {
components.add(definition.getComponentClass());
});
return components.toArray(new Class<?>[components.size()]);
}
}
| [
"kkojaeh@gmail.com"
] | kkojaeh@gmail.com |
235c27f71a39409eb4787e73e70047445eab8e57 | 091106b46bb2997ec9e6a40ca7966367e56b34d3 | /app/src/main/java/sakurafish/com/mvvm/sample/view/fragment/MainFragment.java | 48287e6a89b111e80ce6f6acf721abfc7acf7543 | [] | no_license | sakurabird/Android-MVVM-Sample | c803abba830fd6cefdb91f0c210ca19b77553c53 | 3da5365b4005d7aaf17a6c810642cb10c7ddd4dc | refs/heads/master | 2021-01-19T20:03:53.407603 | 2017-04-17T07:14:24 | 2017-04-17T07:14:24 | 88,482,350 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,628 | java | package sakurafish.com.mvvm.sample.view.fragment;
import android.content.Context;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import javax.inject.Inject;
import sakurafish.com.mvvm.sample.R;
import sakurafish.com.mvvm.sample.databinding.FragmentMainBinding;
import sakurafish.com.mvvm.sample.viewmodel.MainViewModel;
public class MainFragment extends BaseFragment {
public static final String TAG = MainFragment.class.getSimpleName();
private FragmentMainBinding binding;
@Inject
MainViewModel viewModel;
public static MainFragment newInstance() {
return new MainFragment();
}
public MainFragment() {
}
@Override
public void onDetach() {
viewModel.destroy();
super.onDetach();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO 後で消す
viewModel.setCode("1と表示されたら成功");
viewModel.requestDummyData();
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
getComponent().inject(this);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_main, container, false);
binding.setMainViewModel(viewModel);
return binding.getRoot();
}
}
| [
"neko3genki@gmail.com"
] | neko3genki@gmail.com |
23f98737fdf5e2563d4faa57299239b310dd93d3 | 70d2ab899fd4775c8fb5ee801f5529c9daaf8580 | /src/main/java/ru/rusya/controllers/MainController.java | 4252e0dad6f863c5c91c50b8e5adb66a5a8f925c | [] | no_license | RusyaKhalmatov/mvc-java | 8702167c285e6768096ec6e07de4cd02437a9dc6 | a21fffffa7252e34cd1fe88f256848d46542c6b3 | refs/heads/master | 2023-02-15T04:04:36.210650 | 2021-01-11T15:57:52 | 2021-01-11T15:57:52 | 328,715,141 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,125 | java | package ru.rusya.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
@Controller
@RequestMapping("/first")
public class MainController {
@GetMapping("/hello")
// public String helloPage(HttpServletRequest request) {
public String helloPage(@RequestParam(value= "name", required = false) String name,
@RequestParam(value = "surname", required = false) String surname,
Model model) {
// String name = request.getParameter("name");
// String surname = request.getParameter("surname");
// System.out.println("Hello, " + name + " " + surname);
model.addAttribute("message", "Hello, " + name + " " + surname);
return "first/hello";
}
@GetMapping("/goodbye")
public String goodbyePage(){
return "first/goodbye";
}
}
| [
"rusya.khalmatov@gmail.com"
] | rusya.khalmatov@gmail.com |
f0a5976c6158f5cc508c0403a68df9f962b80bd9 | 1a178bd21e0185be2bd8bda56dfd91231b1390a0 | /app/src/main/java/com/jmurray/android/jokearama2/JokeFactory.java | 27cbee5b193208dac38e180594f861e6058ee21a | [] | no_license | joshuajmurray/Jokearama2 | 4ffc3139b714567dc89b21234ed5a4334dd55ce6 | 612d51745fb6347cc24012efe4cb3ed3f802b9e3 | refs/heads/master | 2021-08-23T03:46:01.416716 | 2017-12-03T01:37:24 | 2017-12-03T01:37:24 | 112,881,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 484 | java | package com.jmurray.android.jokearama2;
//generate jokes here
import java.util.ArrayList;
import java.util.List;
/**
* Created by joshua on 12/2/2017.
*/
public class JokeFactory {
private List<Jokes> mJokes;
public JokeFactory() {
mJokes = new ArrayList<>();
for(int i = 0; i < 50; i++) {
Jokes joke = new Jokes("Joke " + i);
mJokes.add(joke);
}
}
public List<Jokes> getJokes() {
return mJokes;
}
}
| [
"joshuajmurray@gmail.com"
] | joshuajmurray@gmail.com |
5529132ec1ee108f4b0197bf88274b7b223e7f53 | 34a5b54fe1ffa5efec517beb811ae094056eb5da | /openTCS-PlantOverview/src/main/java/org/opentcs/guing/components/tree/ComponentsTreeViewManager.java | d3f863e08db08246ab7f3670ff66f234c49c0f05 | [] | no_license | AaronCheungEE/openTCS_src | ced06de5d0f95b93bc0f6c0184ead7a5a504a513 | d71e2a06da65006040e62a1d3d097ee2b5f359c5 | refs/heads/master | 2021-01-11T00:10:55.552126 | 2016-10-11T06:26:43 | 2016-10-11T06:26:43 | 70,562,819 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,476 | java | /*
* openTCS copyright information:
* Copyright (c) 2013 Fraunhofer IML
*
* This program is free software and subject to the MIT license. (For details,
* see the licensing information (LICENSE.txt) you should have received with
* this copy of the software.)
*/
package org.opentcs.guing.components.tree;
import java.awt.event.MouseListener;
import javax.inject.Inject;
import javax.swing.tree.TreeSelectionModel;
import org.opentcs.guing.components.tree.elements.UserObjectContext;
import org.opentcs.guing.components.tree.elements.UserObjectUtil;
import org.opentcs.guing.model.ModelComponent;
/**
* The tree view manager for components.
*
* @author Philipp Seifert (Philipp.Seifert@iml.fraunhofer.de)
*/
public class ComponentsTreeViewManager
extends TreeViewManager {
@Inject
public ComponentsTreeViewManager(TreeView treeView,
UserObjectUtil userObjectUtil,
MouseListener mouseListener) {
super(treeView, userObjectUtil, mouseListener);
treeView.getTree().getSelectionModel().setSelectionMode(
TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
}
@Override
public void addItem(Object parent, ModelComponent item) {
if (item.isTreeViewVisible()) {
UserObjectContext context =
userObjectUtil.createContext(UserObjectContext.CONTEXT_TYPE.COMPONENT);
getTreeView().addItem(parent, userObjectUtil.createUserObject(item, context));
}
}
}
| [
"zhshychina@126.com"
] | zhshychina@126.com |
73e49d7cd0b6bc101474618fad24fe15bebf47e3 | 77eba021349dba003b948c7620d2a21fef780562 | /src/main/java/com/wlp/behavioral/chainofresponsibility/v1/URLFilter.java | b47d907e89a6f885d1020530d803a97511d6b1fc | [] | no_license | WuLiPengPeng/designPattern | 6efcb45d7e299f4cc74c2691dab4f3f066122419 | 97a1aca4c6af05acdf7b83ad81dc5b6e0bd9693f | refs/heads/master | 2022-04-19T22:01:53.676031 | 2020-04-14T11:39:26 | 2020-04-14T11:39:26 | 255,589,538 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 290 | java | package com.wlp.behavioral.chainofresponsibility.v1;
public class URLFilter implements IFilter<Msg> {
public boolean doFilter(Msg msg) {
String newMsg = msg.getContent().replace("baidu.com", "http://www.baidu.com");
msg.setContent(newMsg);
return true;
}
}
| [
"1690575183@qq.com"
] | 1690575183@qq.com |
c6f8270a9d23ac6072999413921ba1f6534f93c4 | 9871ec603b55dea67f4d5dd355573645ba72298b | /app/src/main/java/top/aezdd/www/view/SwipeListLayout.java | ba99b39123e892f74441cfdd0530888f929dc3fc | [] | no_license | Justart2/Ant_Movies | c6a6de73690017d0a3ff5b002d9b3f8023dc120e | 2db645d0431f405bd0a94d9594e227c047f1ed58 | refs/heads/master | 2020-03-21T03:03:43.397186 | 2019-03-24T07:34:09 | 2019-03-24T07:34:09 | 138,034,785 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,144 | java | package top.aezdd.www.view;
import android.content.Context;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.ViewDragHelper;
import android.support.v4.widget.ViewDragHelper.Callback;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
/**
* 侧滑Layout
*/
public class SwipeListLayout extends FrameLayout {
private View hiddenView;
private View itemView;
private int hiddenViewWidth;
private ViewDragHelper mDragHelper;
private int hiddenViewHeight;
private int itemWidth;
private int itemHeight;
private OnSwipeStatusListener listener;
private Status status = Status.Close;
private boolean smooth = true;
public static final String TAG = "SlipListLayout";
// 状态
public enum Status {
Open, Close
}
/**
* 设置侧滑状态
*
* @param status
* 状态 Open or Close
* @param smooth
* 若为true则有过渡动画,否则没有
*/
public void setStatus(Status status, boolean smooth) {
this.status = status;
if (status == Status.Open) {
open(smooth);
} else {
close(smooth);
}
}
public void setOnSwipeStatusListener(OnSwipeStatusListener listener) {
this.listener = listener;
}
/**
* 是否设置过渡动画
*
* @param smooth
*/
public void setSmooth(boolean smooth) {
this.smooth = smooth;
}
public interface OnSwipeStatusListener {
/**
* 当状态改变时回调
*
* @param status
*/
void onStatusChanged(Status status);
/**
* 开始执行Open动画
*/
void onStartCloseAnimation();
/**
* 开始执行Close动画
*/
void onStartOpenAnimation();
}
public SwipeListLayout(Context context) {
this(context, null);
}
public SwipeListLayout(Context context, AttributeSet attrs) {
super(context, attrs);
mDragHelper = ViewDragHelper.create(this, callback);
}
// ViewDragHelper的回调
Callback callback = new Callback() {
@Override
public boolean tryCaptureView(View view, int arg1) {
return view == itemView;
}
@Override
public int clampViewPositionHorizontal(View child, int left, int dx) {
if (child == itemView) {
if (left > 0) {
return 0;
} else {
left = Math.max(left, -hiddenViewWidth);
return left;
}
}
return 0;
}
@Override
public int getViewHorizontalDragRange(View child) {
return hiddenViewWidth;
}
@Override
public void onViewPositionChanged(View changedView, int left, int top,
int dx, int dy) {
if (itemView == changedView) {
hiddenView.offsetLeftAndRight(dx);
}
// 有时候滑动很快的话 会出现隐藏按钮的linearlayout没有绘制的问题
// 为了确保绘制成功 调用 invalidate
invalidate();
}
public void onViewReleased(View releasedChild, float xvel, float yvel) {
// 向右滑xvel为正 向左滑xvel为负
if (releasedChild == itemView) {
if (xvel == 0
&& Math.abs(itemView.getLeft()) > hiddenViewWidth / 2.0f) {
open(smooth);
} else if (xvel < 0) {
open(smooth);
} else {
close(smooth);
}
}
}
};
private Status preStatus = Status.Close;
/**
* 侧滑关闭
*
* @param smooth
* 为true则有平滑的过渡动画
*/
private void close(boolean smooth) {
preStatus = status;
status = Status.Close;
if (smooth) {
if (mDragHelper.smoothSlideViewTo(itemView, 0, 0)) {
if (listener != null) {
Log.i(TAG, "start close animation");
listener.onStartCloseAnimation();
}
ViewCompat.postInvalidateOnAnimation(this);
}
} else {
layout(status);
}
if (listener != null && preStatus == Status.Open) {
Log.i(TAG, "close");
listener.onStatusChanged(status);
}
}
/**
*
* @param status
*/
private void layout(Status status) {
if (status == Status.Close) {
hiddenView.layout(itemWidth, 0, itemWidth + hiddenViewWidth,
itemHeight);
itemView.layout(0, 0, itemWidth, itemHeight);
} else {
hiddenView.layout(itemWidth - hiddenViewWidth, 0, itemWidth,
itemHeight);
itemView.layout(-hiddenViewWidth, 0, itemWidth - hiddenViewWidth,
itemHeight);
}
}
/**
* 侧滑打开
*
* @param smooth
* 为true则有平滑的过渡动画
*/
private void open(boolean smooth) {
preStatus = status;
status = Status.Open;
if (smooth) {
if (mDragHelper.smoothSlideViewTo(itemView, -hiddenViewWidth, 0)) {
if (listener != null) {
Log.i(TAG, "start open animation");
listener.onStartOpenAnimation();
}
ViewCompat.postInvalidateOnAnimation(this);
}
} else {
layout(status);
}
if (listener != null && preStatus == Status.Close) {
Log.i(TAG, "open");
listener.onStatusChanged(status);
}
}
@Override
public void computeScroll() {
super.computeScroll();
// 开始执行动画
if (mDragHelper.continueSettling(true)) {
ViewCompat.postInvalidateOnAnimation(this);
}
}
// 让ViewDragHelper来处理触摸事件
public boolean onInterceptTouchEvent(MotionEvent ev) {
final int action = ev.getAction();
if (action == MotionEvent.ACTION_CANCEL) {
mDragHelper.cancel();
return false;
}
return mDragHelper.shouldInterceptTouchEvent(ev);
}
// 让ViewDragHelper来处理触摸事件
public boolean onTouchEvent(MotionEvent event) {
mDragHelper.processTouchEvent(event);
super.onTouchEvent(event);
return true;
};
@Override
protected void onFinishInflate() {
super.onFinishInflate();
hiddenView = getChildAt(0); // 得到隐藏按钮的linearlayout
itemView = getChildAt(1); // 得到最上层的linearlayout
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
// 测量子View的长和宽
itemWidth = itemView.getMeasuredWidth();
itemHeight = itemView.getMeasuredHeight();
hiddenViewWidth = hiddenView.getMeasuredWidth();
hiddenViewHeight = hiddenView.getMeasuredHeight();
}
@Override
protected void onLayout(boolean changed, int left, int top, int right,
int bottom) {
layout(Status.Close);
}
}
| [
"sudo.jianzhou@gmail.com"
] | sudo.jianzhou@gmail.com |
bf1268e25a510901af5d38201c4bd8dd08bf4fa7 | 6c8485ab659a58f7bbc466d51924fd361aa84ebe | /headfirst-designpattern/src/main/java/com/tencent/data/sourcecode/headfirst/designpatterns/command/undo/DimmerLightOffCommand.java | 3508e9cb82ac95b0b6bfe5dbec917d296cd73d67 | [] | no_license | JeremyHwc/JDesignPattern | f5f143270174cd236d3c1086a8a1e20247154fea | e6535b6c475593a297a0bb3724a8e35c3f12e550 | refs/heads/master | 2020-03-19T09:27:50.817445 | 2019-04-18T10:28:15 | 2019-04-18T10:28:15 | 136,290,886 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 380 | java | package com.tencent.data.sourcecode.headfirst.designpatterns.command.undo;
public class DimmerLightOffCommand implements Command {
Light light;
int prevLevel;
public DimmerLightOffCommand(Light light) {
this.light = light;
prevLevel = 100;
}
public void execute() {
prevLevel = light.getLevel();
light.off();
}
public void undo() {
light.dim(prevLevel);
}
}
| [
"jeremy_hwc@163.com"
] | jeremy_hwc@163.com |
6b775e836c7db4459e84bd786fb4300a0ae5cc66 | c4f4f455af9c2c0e0b03ce34344e6b5ddbb1770d | /P1/BotonLetraNIF/app/src/main/java/com/example/botonletranif/core/CalcularLetraNIF.java | 42f25b8758abf6aa85ab22f9837253c675a7c94d | [] | no_license | bertoootui/PMDM | 97769c34a3a3a410182d3223f961e1ace93baa1a | 4fae6a1ed2c4ab351c8d75b68b8ecbe345aa113c | refs/heads/master | 2021-07-07T13:27:02.345301 | 2020-12-16T22:59:23 | 2020-12-16T22:59:23 | 217,498,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 307 | java | package com.example.botonletranif.core;
public class CalcularLetraNIF {
public static final String NIF_STRING_ASOCIATION
= "TRWAGMYFPDXBNJZSQVHLCKE";
public static char calcularLetraNif(int dni)
{
return NIF_STRING_ASOCIATION.charAt(dni%23);
}//end calcularLetraNif
}
| [
"albertopexe@gmail.com"
] | albertopexe@gmail.com |
507f59d71b7cc3476b377155b4f0758c52fabed9 | b921c073ab034dbea4c5b3545d1e295818905389 | /gwt-mvp-layout/src/main/resources/archetype-resources/src/main/java/client/application/widget/loading/LoadingPopUpViewImpl.java | 3843732839ff1bbdfafd2435d431d2a792dbc9b1 | [] | no_license | glebmtb/gwt-archetypes | 8416c1b265539a72aac100bcec288905d1325229 | 00682f2675e692fd941f754cefe90b3a5c765d4c | refs/heads/master | 2021-01-21T19:58:44.127982 | 2013-10-28T10:03:05 | 2013-10-28T10:03:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,003 | java | #set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.client.application.widget.loading;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.*;
public class LoadingPopUpViewImpl extends Composite implements LoadingPopUpView {
private static LoadingPopUpUiBinder uiBinder = GWT
.create(LoadingPopUpUiBinder.class);
interface LoadingPopUpUiBinder extends UiBinder<Widget, LoadingPopUpViewImpl> {
}
@UiField
PopupPanel popup;
@UiField
Label lblMsg;
public LoadingPopUpViewImpl() {
initWidget(uiBinder.createAndBindUi(this));
}
@Override
public void setPresenter(Presenter presenter) {
}
@Override
public PopupPanel getLoadingWidget() {
return popup;
}
@Override
public HasText getLblMessage() {
return lblMsg;
}
}
| [
"markdiesta@gmail.com"
] | markdiesta@gmail.com |
bed2df5dda7b5bc3b05b141ee63f906e209eb946 | 2929656da9682db266045472c2e144c81b9264ab | /src/main/java/com/hzgc/project/system/custom/service/CustomerServiceImpl.java | 132fbbc6e5e7e5a386221ead2a51e99031a8c834 | [] | no_license | wjhsy2009217/wjh | 0774d47657bcbf4d03f1c1ef2bfdfea2ed8f05ac | ee9af7c835332343c88bd966c615f3edae923b22 | refs/heads/master | 2022-11-13T17:40:20.527569 | 2020-05-22T07:53:27 | 2020-05-22T07:53:27 | 251,507,997 | 0 | 0 | null | 2022-10-05T18:21:34 | 2020-03-31T05:22:43 | JavaScript | UTF-8 | Java | false | false | 1,164 | java | package com.hzgc.project.system.custom.service;
import com.hzgc.common.support.Convert;
import com.hzgc.project.system.custom.domain.PzCustomer;
import com.hzgc.project.system.custom.domain.PzOrgan;
import com.hzgc.project.system.custom.mapper.PzCustomerMapper;
import com.hzgc.project.system.custom.mapper.PzOrganMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CustomerServiceImpl implements ICustomerService {
@Autowired
private PzCustomerMapper customerMapper;
@Override
public List<PzCustomer> selectAll() {
return customerMapper.selectAll();
}
@Override
public PzCustomer findById(int id) {
return customerMapper.selectById(id);
}
@Override
public int add(PzCustomer customer) {
return customerMapper.add(customer);
}
@Override
public int edit(PzCustomer customer) {
return customerMapper.edit(customer);
}
@Override
public int del(String id) {
Long[] ids = Convert.toLongArray(id);
return customerMapper.del(ids);
}
}
| [
"903081342@qq.com"
] | 903081342@qq.com |
1c5ef38ac8fdf209e278cefc973744f43b8f3318 | ef0c1514e9af6de3ba4a20e0d01de7cc3a915188 | /sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/FileServerLinkedServiceTypeProperties.java | 4df9face24c2a82fea34861c2ba6cc2d34946ed4 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.1-or-later",
"CC0-1.0",
"BSD-3-Clause",
"UPL-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-generic-cla"
] | permissive | Azure/azure-sdk-for-java | 0902d584b42d3654b4ce65b1dad8409f18ddf4bc | 789bdc6c065dc44ce9b8b630e2f2e5896b2a7616 | refs/heads/main | 2023-09-04T09:36:35.821969 | 2023-09-02T01:53:56 | 2023-09-02T01:53:56 | 2,928,948 | 2,027 | 2,084 | MIT | 2023-09-14T21:37:15 | 2011-12-06T23:33:56 | Java | UTF-8 | Java | false | false | 4,808 | java | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.datafactory.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.datafactory.models.SecretBase;
import com.fasterxml.jackson.annotation.JsonProperty;
/** File system linked service properties. */
@Fluent
public final class FileServerLinkedServiceTypeProperties {
/*
* Host name of the server. Type: string (or Expression with resultType string).
*/
@JsonProperty(value = "host", required = true)
private Object host;
/*
* User ID to logon the server. Type: string (or Expression with resultType string).
*/
@JsonProperty(value = "userId")
private Object userId;
/*
* Password to logon the server.
*/
@JsonProperty(value = "password")
private SecretBase password;
/*
* The encrypted credential used for authentication. Credentials are encrypted using the integration runtime
* credential manager. Type: string (or Expression with resultType string).
*/
@JsonProperty(value = "encryptedCredential")
private Object encryptedCredential;
/** Creates an instance of FileServerLinkedServiceTypeProperties class. */
public FileServerLinkedServiceTypeProperties() {
}
/**
* Get the host property: Host name of the server. Type: string (or Expression with resultType string).
*
* @return the host value.
*/
public Object host() {
return this.host;
}
/**
* Set the host property: Host name of the server. Type: string (or Expression with resultType string).
*
* @param host the host value to set.
* @return the FileServerLinkedServiceTypeProperties object itself.
*/
public FileServerLinkedServiceTypeProperties withHost(Object host) {
this.host = host;
return this;
}
/**
* Get the userId property: User ID to logon the server. Type: string (or Expression with resultType string).
*
* @return the userId value.
*/
public Object userId() {
return this.userId;
}
/**
* Set the userId property: User ID to logon the server. Type: string (or Expression with resultType string).
*
* @param userId the userId value to set.
* @return the FileServerLinkedServiceTypeProperties object itself.
*/
public FileServerLinkedServiceTypeProperties withUserId(Object userId) {
this.userId = userId;
return this;
}
/**
* Get the password property: Password to logon the server.
*
* @return the password value.
*/
public SecretBase password() {
return this.password;
}
/**
* Set the password property: Password to logon the server.
*
* @param password the password value to set.
* @return the FileServerLinkedServiceTypeProperties object itself.
*/
public FileServerLinkedServiceTypeProperties withPassword(SecretBase password) {
this.password = password;
return this;
}
/**
* Get the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted
* using the integration runtime credential manager. Type: string (or Expression with resultType string).
*
* @return the encryptedCredential value.
*/
public Object encryptedCredential() {
return this.encryptedCredential;
}
/**
* Set the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted
* using the integration runtime credential manager. Type: string (or Expression with resultType string).
*
* @param encryptedCredential the encryptedCredential value to set.
* @return the FileServerLinkedServiceTypeProperties object itself.
*/
public FileServerLinkedServiceTypeProperties withEncryptedCredential(Object encryptedCredential) {
this.encryptedCredential = encryptedCredential;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (host() == null) {
throw LOGGER
.logExceptionAsError(
new IllegalArgumentException(
"Missing required property host in model FileServerLinkedServiceTypeProperties"));
}
if (password() != null) {
password().validate();
}
}
private static final ClientLogger LOGGER = new ClientLogger(FileServerLinkedServiceTypeProperties.class);
}
| [
"noreply@github.com"
] | noreply@github.com |
b8a7dbcbfcdf1d154cbfec90378e17857ecd47ac | 76bb137ef6a41c7d1ccd48d963e6f79747adf475 | /src/main/java/webPages/MagentoCommercePage.java | 0b8a69d3cf8857376c07aee9f2588b42126e7faf | [] | no_license | sudha36/guru99Ecomerce | 42f846bf9770f19cea1097a20fa1da4e4ff30b9b | 040036cc640ff95a1f4afd43935a91a07e180a89 | refs/heads/master | 2020-03-29T14:50:46.272080 | 2018-10-07T19:53:44 | 2018-10-07T19:53:44 | 150,034,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,020 | java | package webPages;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.testng.Assert;
import testBase.TestBase;
import util.Util;
public class MagentoCommercePage extends TestBase{
@FindBy(xpath="/html/body/div/div/div[2]/div/div/p[1]/a")
WebElement OrderNumber;
//@FindBy(xpath="//div[@class='col-main']//p[1]")
//WebElement GeneratedOrderNumber;
@FindBy(xpath="//h1[contains(text(),'Your order has been received.')]")
WebElement GeneratedOrderNumber;
@FindBy(xpath="/html/body/div/div/div[2]/div/div[2]/div[3]/ul/li[1]/div/h2/a")
WebElement SonyXperiaName;
@FindBy(xpath="/html/body/div/div/div[2]/div/div[2]/div[3]/ul/li[1]/div/div[1]/span/span")
WebElement SonyXperiaPrice;
@FindBy(xpath="/html/body/div/div/div[2]/div/div[2]/div[3]/ul/li[2]/div/h2/a")
WebElement SamsungName;
@FindBy(xpath="//span[@id='product-price-3']")
WebElement SamsungPrice;
public MagentoCommercePage() {
PageFactory.initElements(driver, this);
}
public void Draw_Border_Number() {
Util.drawBorder(OrderNumber, driver);
}
//Verify The Order is generated
public void Generated_OrderNumber_8() {
String text = GeneratedOrderNumber.getText();
System.out.println(text);
Util.drawBorder(GeneratedOrderNumber, driver);
//return GeneratedOrderNumber.getText();
}
//verifing Product name and Price and print in the console
public void Verify_Sony_Functionality() {
String Text = SonyXperiaName.getText();
System.out.println(Text);
Assert.assertEquals(Text, "SONY XPERIA");
String Text1 = SonyXperiaPrice.getText();
System.out.println(Text1);
Assert.assertEquals(Text1, "$100.00");
}
public void Verify_Samusung_Functionality() {
String Text2 = SamsungName.getText();
System.out.println(Text2);
Assert.assertEquals(Text2, "SAMSUNG GALAXY");
String Text3 = SamsungPrice.getText();
System.out.println(Text3);
Assert.assertEquals(Text3, "$130.00");
}
}
| [
"sudhach80@yahoo.com"
] | sudhach80@yahoo.com |
93389fce2f5e68a0e605657d9c6a2ce50c82e990 | 15945be051ff615ffbb100ba5b251856aed76cba | /src/br/inf/ufes/ppd/slave/SlaveImpl.java | 39a4f2c5b7d6674a134e916ef1f1c10ea4da8ddc | [] | no_license | dhiegobroetto/trab1-ppd | fe8f6bc6b9aae10e4d9dc1b647672cf6b9091319 | 4cd8275e15ec7a13dc7be5ec76bd130bea55ad99 | refs/heads/master | 2020-06-06T04:40:37.006152 | 2019-06-19T22:39:07 | 2019-06-19T22:39:07 | 192,640,092 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,699 | java | package br.inf.ufes.ppd.slave;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.UUID;
import br.inf.ufes.ppd.Slave;
import br.inf.ufes.ppd.SlaveManager;
public class SlaveImpl implements Slave {
protected UUID slaveKey;
protected String fileName;
protected String slaveName;
protected SlaveManager master;
public SlaveImpl(UUID slaveKey, String slaveName, String fileName, SlaveManager master) {
this.slaveKey = slaveKey;
this.slaveName = slaveName;
this.fileName = fileName;
this.master = master;
}
@Override
public void startSubAttack(byte[] ciphertext, byte[] knowntext, long initialwordindex, long finalwordindex,
int attackNumber, SlaveManager callbackinterface) {
try {
Scanner scanner = new Scanner(new File(getFileName()));
for (int i = 0; i < initialwordindex && scanner.hasNextLine(); i++) {
scanner.nextLine();
}
System.out.println("[System Attack] Attack no." + attackNumber + " has begun!");
System.out.println("[Slave Index] Attack: [" + attackNumber + "] Index: [" + initialwordindex + ";" + finalwordindex + "]");
SubAttackThread subAttack = new SubAttackThread(this.getSlaveKey(), this.getSlaveName(),
ciphertext, knowntext, initialwordindex, finalwordindex, attackNumber, callbackinterface, scanner);
Thread subAttackThread = new Thread(subAttack);
subAttackThread.start();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
public UUID getSlaveKey() {
return slaveKey;
}
public String getFileName() {
return fileName;
}
public String getSlaveName() {
return slaveName;
}
public SlaveManager getMaster() {
return master;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
ebb18e274b95145f9d2637a63fd8a59221fa75e7 | f12c507f4105ff23f8f2c75d8176cfea94db7af6 | /android/app/src/main/java/com/uwp/MainActivity.java | 0045a3c2fd7b8f3c64713f196065c6eac2388461 | [] | no_license | LzxHahaha/react-native-uwp-style | 08e1a4cf6fbd0fb7bf50323b617c697cb7bd9ea4 | 4801d305a3e94abc16bc5ade18d0d500bc647b30 | refs/heads/master | 2021-01-10T17:00:33.733085 | 2015-12-30T15:00:06 | 2015-12-30T15:00:06 | 47,678,152 | 15 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,273 | java | package com.uwp;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import com.facebook.react.LifecycleState;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactRootView;
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
private ReactInstanceManager mReactInstanceManager;
private ReactRootView mReactRootView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
mReactRootView.startReactApplication(mReactInstanceManager, "UWP", null);
setContentView(mReactRootView);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) {
mReactInstanceManager.showDevOptionsDialog();
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public void onBackPressed() {
if (mReactInstanceManager != null) {
mReactInstanceManager.onBackPressed();
} else {
super.onBackPressed();
}
}
@Override
public void invokeDefaultOnBackPressed() {
super.onBackPressed();
}
@Override
protected void onPause() {
super.onPause();
if (mReactInstanceManager != null) {
mReactInstanceManager.onPause();
}
}
@Override
protected void onResume() {
super.onResume();
if (mReactInstanceManager != null) {
mReactInstanceManager.onResume(this, this);
}
}
}
| [
"lzxglhf@live.com"
] | lzxglhf@live.com |
1596fafe3d8b6c8c0434d778aface6093efe418c | 43b7830e34ab779b6faf5fa2f5501b7f68bce315 | /SnowWestAirlines/src/Headphones.java | c1737e1824b2fab59f6281ebcdb717f3b3cc0df8 | [] | no_license | devanegas/SnowAirlines | c6921eddbf9232cca59c82613c0a6b9867044989 | 15a19c46f454f660a1b8e94803038089d8e92a99 | refs/heads/master | 2020-04-19T22:21:22.814958 | 2019-01-31T05:09:20 | 2019-01-31T05:09:20 | 168,466,452 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | public class Headphones extends PurchaseExtra {
Flight flight;
public Headphones(Flight f){
this.flight = f;
}
public String getDescription() {
return flight.getDescription() + ", Headphone Rental";
}
@Override
public double cost() {
return flight.cost() + 2;
}
}
| [
"dieguitovan@gmail.com"
] | dieguitovan@gmail.com |
4b9f8e0b5512f132c20680a556e6ae65dbba2af6 | 3b62f218469d29b6febb979229f1c7f3961a26a1 | /src/main/java/org/codelibs/elasticsearch/taste/TasteConstants.java | 2a4983204bf1c163e5532994fff7ade27a4b3165 | [
"Apache-2.0"
] | permissive | may215/elasticsearch-taste | 266749cd9e16adaecd0ec7fbbfe395798bf9bf88 | 12f160da30cc435cd2feff0f1eac87455c095182 | refs/heads/master | 2021-01-16T21:36:29.948008 | 2016-04-15T13:45:31 | 2016-04-15T13:45:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,938 | java | package org.codelibs.elasticsearch.taste;
public class TasteConstants {
public static final String TRUE = "true";
public static final String YES = "yes";
public static final String ITEM_TYPE = "item";
public static final String USER_TYPE = "user";
public static final String PREFERENCE_TYPE = "preference";
public static final String ITEM_SIMILARITY_TYPE = "item_similarity";
public static final String USER_SIMILARITY_TYPE = "user_similarity";
public static final String REPORT_TYPE = "report";
public static final String RECOMMENDATION_TYPE = "recommendation";
public static final String VALUE_FIELD = "value";
public static final String ITEM_ID_FIELD = "item_id";
public static final String USER_ID_FIELD = "user_id";
public static final String TIMESTAMP_FIELD = "@timestamp";
public static final String ITEMS_FILED = "items";
public static final String RESULT_TYPE = "result";
public static final String USERS_FILED = "users";
public static final String REQUEST_PARAM_USER_ID_FIELD = "user_id_field";
public static final String REQUEST_PARAM_ITEM_ID_FIELD = "item_id_field";
public static final String REQUEST_PARAM_VALUE_FIELD = "value_field";
public static final String REQUEST_PARAM_TIMESTAMP_FIELD = "timestamp_field";
public static final String REQUEST_PARAM_USER_INDEX = "user_index";
public static final String REQUEST_PARAM_USER_TYPE = "user_type";
public static final String REQUEST_PARAM_ITEM_INDEX = "item_index";
public static final String REQUEST_PARAM_ITEM_TYPE = "item_type";
public static final String REQUEST_PARAM_PREFERENCE_INDEX = "preference_index";
public static final String REQUEST_PARAM_PREFERENCE_TYPE = "preference_type";
public static final String REQUEST_PARAM_TARGET_ID_FIELD = "target_id_field";
public static final String REQUEST_PARAM_ID_FIELD = "id_field";
}
| [
"shinsuke@yahoo.co.jp"
] | shinsuke@yahoo.co.jp |
df24e637c06d832d30fa3b6f8d5927cb1ed11fde | 10be4cfa08f80d785cb20d780e5ad7379ef8ef4f | /Curso Sequencial em desenvolvimento de soluções Java para Web - UNISUL/2 - Programação Orientada a Objetos/Exercicios/TelevisaoControle-Dependencia/src/Principal.java | b662b8a0b04e76fc602d512063ac48193263ec48 | [] | no_license | fdelameli/materiais-cursos | a62009f6bb56683e6031cec38bf02637fcdcba82 | d2193beb570930f20f0bf7d65691b37909f12996 | refs/heads/master | 2022-06-29T11:18:48.861802 | 2018-06-28T14:43:59 | 2018-06-28T14:43:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java |
public class Principal {
public static void main(String[] args) {
ControleRemoto controle = new ControleRemoto();
Televisao tv = new Televisao();
controle.aumentarVolumeTV(tv);
controle.desligarTV(tv);
}
}
| [
"fabio.bruna@digitro.com.br"
] | fabio.bruna@digitro.com.br |
dcff8699b0d353c9a49600a42875d0e9d3f9db8d | 0de001d939fbe5905d1dff76445f6dbedf31cde1 | /src/main/java/com/sportsdemo/com/sports/demo/model/Group.java | 1a6f636db5bb03cfeac103172cb322c51f04bd62 | [] | no_license | arrmixer/JavaService | d4cd05418a70e508271c6bb5f50830c0d1539e22 | 8b55511e9fcb5b0580758e0a9a78046ff1f2b1af | refs/heads/main | 2023-06-15T14:02:13.644824 | 2021-07-15T11:39:01 | 2021-07-15T11:39:01 | 385,967,835 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 375 | java | package com.sportsdemo.com.sports.demo.model;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Group {
private String groupName;
public Group() {
}
@JsonProperty("group_name")
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
}
| [
"arrmixer@gmail.com"
] | arrmixer@gmail.com |
93122ce58610cbc400e363ad0ddb00be9386afca | 53d832719cd3c0b39bb710389d3eef378fce43f2 | /test/RichSchedulerTest/RichSchedulerTest.java | 1f7084686f7094ba3fbbed063f7a4741891dab05 | [] | no_license | kiwiwin/rich | 5e6cc2d87ff21d0bc22f459991cb8518a0ed2b3f | 2123a2bee344e3db434d4860b1b7a9d12c08b833 | refs/heads/master | 2020-07-26T19:37:56.070397 | 2012-02-22T13:29:34 | 2012-02-22T13:29:34 | 3,207,169 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,176 | java | package RichSchedulerTest;
import DummyObject.RichDummyMapBuilder;
import RichColor.RichBlueColor;
import RichColor.RichRedColor;
import RichCommand.RichDefaultCommandFactory;
import RichCore.*;
import RichHouse.RichHouseCottageLevel;
import RichHouse.RichHousePlatLevel;
import RichScheduler.RichCommandFactory;
import RichScheduler.RichPlayerFactory;
import RichSite.RichDefaultMap;
import junit.framework.TestCase;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.io.StringReader;
public class RichSchedulerTest extends TestCase {
private final BufferedReader dummyReader = null;
private final RichMoney dummyMoney = null;
private final RichPoint dummyPoint = null;
private final PrintStream dummyWriter = null;
public void test_should_return_10000_for_default_player_money() {
BufferedReader reader = new BufferedReader(new StringReader("\n"));
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichTestUseScheduler scheduler = new RichTestUseScheduler(reader, writer);
scheduler.initMoney();
assertEquals(new RichMoney(10000), scheduler.getInitMoney());
}
public void test_should_return_1000_for_input_player_money() {
BufferedReader reader = new BufferedReader(new StringReader("1000\n"));
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichTestUseScheduler scheduler = new RichTestUseScheduler(reader, writer);
scheduler.initMoney();
assertEquals(new RichMoney(1000), scheduler.getInitMoney());
}
public void test_should_be_exception_for_input_player_money_10() {
BufferedReader reader = new BufferedReader(new StringReader("10\n"));
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichTestUseScheduler scheduler = new RichTestUseScheduler(reader, writer);
try {
scheduler.initMoney();
fail();
} catch (IllegalArgumentException ex) {
assertEquals("错误的初始金钱,请重新输入:(1000~50000)", ex.getMessage());
}
}
public void test_should_return_qa_for_input_12() {
BufferedReader reader = new BufferedReader(new StringReader("12\n"));
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichMap map = new RichDefaultMap(new RichDummyMapBuilder(reader, writer));
map.buildMap();
RichTestUseScheduler scheduler = new RichTestUseScheduler(reader, writer);
scheduler.setPlayerFactory(new RichPlayerFactory());
scheduler.setMap(map);
scheduler.initPlayers();
assertEquals(2, scheduler.getPlayersNumber());
}
public void test_should_be_exception_for_input_11_duplicate_player() {
BufferedReader reader = new BufferedReader(new StringReader("11\n"));
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichMap map = new RichDefaultMap(new RichDummyMapBuilder(reader, writer));
map.buildMap();
RichTestUseScheduler scheduler = new RichTestUseScheduler(reader, writer);
scheduler.setPlayerFactory(new RichPlayerFactory());
scheduler.setMap(map);
try {
scheduler.initPlayers();
fail("player cannot be duplicate");
} catch (IllegalArgumentException ex) {
assertEquals("错误的玩家编号", ex.getMessage());
}
}
public void test_should_be_exception_for_create_45() {
BufferedReader reader = new BufferedReader(new StringReader("45\n"));
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichTestUseScheduler scheduler = new RichTestUseScheduler(reader, writer);
scheduler.setPlayerFactory(new RichPlayerFactory());
try {
scheduler.initPlayers();
fail();
} catch (IllegalArgumentException ex) {
assertEquals("错误的玩家编号", ex.getMessage());
}
}
public void test_should_return_A_win_for_only_one_player() {
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichMap map = new RichDefaultMap(new RichDummyMapBuilder(dummyReader, writer));
map.buildMap();
RichTestUseScheduler scheduler = new RichTestUseScheduler(dummyReader, writer);
RichPlayer player = new RichPlayer(dummyMoney, dummyPoint);
player.setName("A");
player.setColor(new RichRedColor());
scheduler.addPlayer(player);
scheduler.schedule();
String expectString = "胜利者是: " + (char) 27 + "[01;31mA" + (char) 27 + "[00;00m\n";
assertEquals(expectString, writerStream.toString());
}
public void test_return_2_for_get_players_number_when_one_player_run_out_money() {
BufferedReader reader = new BufferedReader(new StringReader("roll\nquit\n"));
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichTestUseScheduler scheduler = new RichTestUseScheduler(reader, writer);
RichMap map = new RichDefaultMap(new RichDummyMapBuilder(dummyReader, dummyWriter));
map.buildMap();
RichPlayer poorPlayer = new RichPlayer(new RichMoney(-100), dummyPoint);
poorPlayer.setName("dummy name");
poorPlayer.setColor(new RichRedColor());
poorPlayer.initPosition(new RichSitePosition(map, 0));
RichPlayer dummyPlayer1 = new RichPlayer(new RichMoney(1000), dummyPoint);
dummyPlayer1.setName("dummy name 1");
dummyPlayer1.setColor(new RichBlueColor());
RichPlayer dummyPlayer2 = new RichPlayer(new RichMoney(1000), dummyPoint);
dummyPlayer2.setName("dummy name 2");
dummyPlayer2.setColor(new RichBlueColor());
RichCommandFactory commandFactory = new RichDefaultCommandFactory();
scheduler.addPlayer(poorPlayer);
scheduler.addPlayer(dummyPlayer1);
scheduler.addPlayer(dummyPlayer2);
scheduler.setMap(map);
scheduler.setCommandFactory(commandFactory);
scheduler.schedule();
assertEquals(2, scheduler.getPlayersNumber());
}
public void test_player_house_should_be_reinitialized_for_player_lost() {
BufferedReader reader = new BufferedReader(new StringReader("roll\nquit\n"));
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichTestUseScheduler scheduler = new RichTestUseScheduler(reader, writer);
RichMap map = new RichDefaultMap(new RichDummyMapBuilder(dummyReader, dummyWriter));
map.buildMap();
RichHouse houseOfPoor = new RichHouse(new RichHouseCottageLevel(dummyMoney));
RichPlayer poorPlayer = new RichPlayer(new RichMoney(-100), dummyPoint);
poorPlayer.setName("dummy name");
poorPlayer.setColor(new RichRedColor());
poorPlayer.initPosition(new RichSitePosition(map, 0));
poorPlayer.addHouse(houseOfPoor);
scheduler.checkPlayerHasMoney(poorPlayer);
assertEquals(0, poorPlayer.getHousesNumber());
assertFalse(houseOfPoor.hasOwner());
assertTrue(houseOfPoor.getLevel() instanceof RichHousePlatLevel);
}
public void test_return_false_for_player_is_punished_for_his_day() {
BufferedReader reader = new BufferedReader(new StringReader("quit\n"));
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichTestUseScheduler scheduler = new RichTestUseScheduler(reader, writer);
RichPlayer playerBePunished = new RichPlayer(new RichMoney(1000), dummyPoint);
playerBePunished.setName("dummy name");
playerBePunished.setColor(new RichRedColor());
playerBePunished.setPunishDays(5);
RichPlayer dummyPlayer = new RichPlayer(new RichMoney(1000), dummyPoint);
dummyPlayer.setName("dummy name 2");
dummyPlayer.setColor(new RichBlueColor());
RichMap map = new RichDefaultMap(new RichDummyMapBuilder(dummyReader, dummyWriter));
map.buildMap();
RichDefaultCommandFactory commandFactory = new RichDefaultCommandFactory();
scheduler.addPlayer(playerBePunished);
scheduler.addPlayer(dummyPlayer);
scheduler.setMap(map);
scheduler.setCommandFactory(commandFactory);
scheduler.schedule();
assertEquals(4, playerBePunished.getPunishDays());
}
public void test_input_invalid_command() {
BufferedReader reader = new BufferedReader(new StringReader("invalid command\nquit\n"));
ByteArrayOutputStream writerStream = new ByteArrayOutputStream();
PrintStream writer = new PrintStream(writerStream);
RichMap map = new RichDefaultMap(new RichDummyMapBuilder(dummyReader, dummyWriter));
map.buildMap();
RichPlayer dummyPlayer1 = new RichPlayer(new RichMoney(1000), dummyPoint);
dummyPlayer1.setName("dummy name 1");
dummyPlayer1.setColor(new RichBlueColor());
RichPlayer dummyPlayer2 = new RichPlayer(new RichMoney(1000), dummyPoint);
dummyPlayer2.setName("dummy name 2");
dummyPlayer2.setColor(new RichBlueColor());
RichTestUseScheduler scheduler = new RichTestUseScheduler(reader, writer);
scheduler.addPlayer(dummyPlayer1);
scheduler.addPlayer(dummyPlayer2);
scheduler.setCommandFactory(new RichDefaultCommandFactory());
scheduler.setMap(map);
scheduler.schedule();
assertEquals(2, scheduler.getPlayersNumber());
}
}
| [
"547880119@qq.com"
] | 547880119@qq.com |
2fc1bb13f31e81ddeaec2b450a242ef2d0850c9e | cbc75748cba33aebbd762b690ef480cd36fc6d73 | /src/testing/VisualTest.java | b75356e7eaf5e4e203866963a4e8b86fd9669052 | [] | no_license | jcowman2/jLinAlg | 66e1319476e756b27fa64858604b6f33e2046189 | ead586e9d62cd2c503434efbf386105c76ece47a | refs/heads/master | 2021-01-19T08:46:13.897806 | 2017-05-17T03:59:29 | 2017-05-17T03:59:29 | 87,672,796 | 0 | 0 | null | 2017-05-17T03:59:29 | 2017-04-09T00:36:13 | Java | UTF-8 | Java | false | false | 2,119 | java | package testing;
import java.util.ArrayList;
import com.jlinalg.math.*;
import com.jlinalg.graphic.*;
public class VisualTest {
public static void test() {
//testMatrixToString();
//testElementToString();
//testCenterString();
testAlignStringBlocks();
}
public static void testMatrixToString() {
System.out.println("\n~Testing converting matrix to string");
Matrix zeroMatrix = new Matrix(4, 4);
zeroMatrix.setDiagonal(11.5);
zeroMatrix.setEntry(1, 3, 59823);
zeroMatrix.setEntry(1, 1, 4);
System.out.println(Printer.matrixToString(zeroMatrix));
}
public static void testElementToString() {
System.out.println("\n~Testing converting doubles to strings");
double doubs[] = {0., -0, -1, 0.30, 0.423498273, 9191827391283., -123.00001, 04.000000};
for (double d : doubs) {
System.out.println(Printer.elementToString(d));
}
}
public static void testCenterString() {
System.out.println("\n~Testing centering strings");
String strings[] = {"dogy", "a", "ohyes", "woooot", "bab"};
for (String s : strings) {
System.out.println("|" + Printer.centerString(s, 7) + "|");
}
}
public static void testAlignStringBlocks() {
System.out.println("\n~Testing aligning string blocks");
Matrix m1 = MatrixGenerator.generateRandom(3, 4, -5, 10, 1);
Matrix m2 = MatrixGenerator.generateRandom(5, 2, -5, 10, 1);
Matrix m3 = MatrixGenerator.generateRandom(4, 6, -5, 10, 1);
ArrayList<String> ms = new ArrayList<String>();
ms.add("Your matrices are:");
ms.add(m1.toString());
ms.add(",");
ms.add(m2.toString());
ms.add(", and");
ms.add(m3.toString());
System.out.println(Printer.alignStringBlocks(ms));
System.out.println("-> 15 randomized matrices, string length 100\n");
ArrayList<String> matrixStrings = new ArrayList<String>();
for (int i = 1; i <= 15; i++) {
matrixStrings.add(MatrixGenerator.generateRandom(NumberUtils.randomInt(1, 5),
NumberUtils.randomInt(1, 5), -5, 10, 1).toString());
}
System.out.println(Printer.alignStringBlocks(matrixStrings, 100));
}
}
| [
"joe.cowman@huskers.unl.edu"
] | joe.cowman@huskers.unl.edu |
e557f201f804c2b79e93e1a031987225cdc0f316 | 0cb085ea2bcf8c59ea111d61c5b84d80fefb50dd | /LearningJava/Chapter2/src/HelloJava4.java | 11be4fd8020db82fe4ec2f65951d6cd3d3d37efb | [] | no_license | drastorguev/springBootTest | a98b213c1ffe8b77a16233721bed2a4d191a899e | 8675e24d2aac96e5aaca6baa9d515419c6be9bf5 | refs/heads/master | 2020-04-05T00:52:39.324126 | 2018-11-08T22:50:41 | 2018-11-08T22:50:41 | 156,414,057 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,190 | java | import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class HelloJava4
{
public static void main( String[] args ) {
JFrame frame = new JFrame( "HelloJava4" );
frame.add( new HelloComponent4("Hello Java!") );
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frame.setSize( 300, 300 );
frame.setVisible( true );
}
}
class HelloComponent4 extends JComponent
implements MouseMotionListener, ActionListener, Runnable
{
String theMessage;
int messageX = 125, messageY = 95; // Coordinates of the message
JButton theButton;
int colorIndex; // Current index into someColors.
static Color[] someColors = {
Color.black, Color.red, Color.green, Color.blue, Color.magenta };
boolean blinkState;
public HelloComponent4( String message ) {
theMessage = message;
theButton = new JButton("Change Color");
setLayout( new FlowLayout() );
add( theButton );
theButton.addActionListener( this );
addMouseMotionListener( this );
Thread t = new Thread( this );
t.start();
}
public void paintComponent( Graphics g ) {
g.setColor(blinkState ? getBackground() : currentColor( ));
g.drawString(theMessage, messageX, messageY);
}
public void mouseDragged(MouseEvent e) {
messageX = e.getX();
messageY = e.getY();
repaint();
}
public void mouseMoved(MouseEvent e) { }
public void actionPerformed( ActionEvent e ) {
if ( e.getSource() == theButton )
changeColor();
}
synchronized private void changeColor() {
if (++colorIndex == someColors.length)
colorIndex = 0;
setForeground( currentColor() );
repaint();
}
synchronized private Color currentColor( ) {
return someColors[colorIndex];
}
public void run( ) {
try {
while(true) {
blinkState = !blinkState; // Toggle blinkState.
repaint(); // Show the change.
Thread.sleep(300);
}
} catch (InterruptedException ie) { }
}
} | [
"dmitry@rastorguev.co.uk"
] | dmitry@rastorguev.co.uk |
3ad024e2a7f91912b38a0d410bb6366ec1e21adb | 26e4fcb032d6f6a5e69c95b7bc62c211fce235ab | /src/DefaultTimeZone.java | 5390da7d243ae4255de3389ee9b9068259003379 | [] | no_license | matamkiran/JavaDateExcercise | 7a72b52bc61d7cffb81b0541c0df1056fb26677c | de67ff8713353e52b495fbfc4862de24aec890f7 | refs/heads/main | 2023-08-11T19:03:14.424441 | 2021-10-12T19:12:15 | 2021-10-12T19:12:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java | import java.util.TimeZone;
public class DefaultTimeZone {
public static void main(String[] args) {
// TODO Auto-generated method stub
TimeZone timezone= TimeZone.getDefault();
System.out.println(timezone.getID());
}
}
| [
"matamkiran@users.noreply.github.com"
] | matamkiran@users.noreply.github.com |
4eff6cae550f1e7fa9fcef275ecd3f1dba2bc532 | aa3c00888b37d05a77ccafdbb4466d72ed603c5b | /zooShell/src/test/java/doyenm/zooshell/validator/function/FindingPaddockTypeFunctionApplyTest.java | 485097df73eb3c342c83ad83eed020e24e6b2f5c | [] | no_license | LineVA/zooShell | 43fc2e3672657fce3e9f6c55c456da96f8dcf608 | 02725877addd707fc97a3d5ae36273e66c472d8d | refs/heads/master | 2021-01-20T06:54:00.120970 | 2017-05-25T10:45:28 | 2017-05-25T10:45:28 | 89,941,424 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,929 | java | package doyenm.zooshell.validator.function;
import doyenm.zooshell.model.Biome;
import doyenm.zooshell.model.PaddockType;
import doyenm.zooshell.validator.context.FindingBiomeContext;
import doyenm.zooshell.validator.context.FindingPaddockTypeContext;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.mockito.Mockito;
/**
*
* @author doyenm
*/
public class FindingPaddockTypeFunctionApplyTest {
private FindingPaddockTypeContext givenContextWithInput(String input) {
FindingPaddockTypeContext context = Mockito.mock(FindingPaddockTypeContext.class);
Mockito.when(context.getConvertedType()).thenCallRealMethod();
Mockito.doCallRealMethod().when(context).setConvertedType(Mockito.any(PaddockType.class));
Mockito.when(context.getType()).thenReturn(input);
return context;
}
@Test
public void shouldSetTheConvertedTypeWhenTheInputIsIntegerCorrespondingToAnExistingType() {
// Given
String input = "1";
FindingPaddockTypeContext context = givenContextWithInput(input);
FindingPaddockTypeFunction function = new FindingPaddockTypeFunction();
// When
FindingPaddockTypeContext actualContext = function.apply(context);
// Then
Assertions.assertThat(actualContext.getConvertedType()).isEqualTo(PaddockType.AQUARIUM);
}
@Test
public void shouldSetTheConvertedTypeWhenTheInputIsStringCorrespondingToAnExistingType() {
// Given
String input = "AQUARIUM";
FindingPaddockTypeContext context = givenContextWithInput(input);
FindingPaddockTypeFunction function = new FindingPaddockTypeFunction();
// When
FindingPaddockTypeContext actualContext = function.apply(context);
// Then
Assertions.assertThat(actualContext.getConvertedType()).isEqualTo(PaddockType.AQUARIUM);
}
@Test
public void shouldSetTheConvertedTypeWhenTheInputIsIntegerNotCorrespondingToAnExistingType() {
// Given
String input = "111";
FindingPaddockTypeContext context = givenContextWithInput(input);
FindingPaddockTypeFunction function = new FindingPaddockTypeFunction();
// When
FindingPaddockTypeContext actualContext = function.apply(context);
// Then
Assertions.assertThat(actualContext.getConvertedType()).isNull();
}
@Test
public void shouldSetTheConvertedTypeWhenTheInputIsStringNotCorrespondingToAnExistingType() {
// Given
String input = "FALSE_AQUARUM";
FindingPaddockTypeContext context = givenContextWithInput(input);
FindingPaddockTypeFunction function = new FindingPaddockTypeFunction();
// When
FindingPaddockTypeContext actualContext = function.apply(context);
// Then
Assertions.assertThat(actualContext.getConvertedType()).isNull();
}
}
| [
"marine.doyen-le-boulaire@ensimag.grenoble-inp.fr"
] | marine.doyen-le-boulaire@ensimag.grenoble-inp.fr |
125509f6458dd48b9049e51224b33ba89c2c053a | 6a191b12522210c3d5e66b9dfe0505fa376e5029 | /back-end/time-reporter/src/main/java/com/time/reporter/domain/enums/Roles.java | 1026313ddd089a21acd28e5a96f5f2827da261c1 | [] | no_license | yepesalvarez/time-reporter | d7dbe0cde35dcf1034a862112e763f1bfb4a154a | cbf745f67c608ed2bb3e5363680b28098fe6ca36 | refs/heads/master | 2020-04-07T11:27:50.112657 | 2019-04-01T17:15:24 | 2019-04-01T17:15:24 | 158,327,304 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 276 | java | package com.time.reporter.domain.enums;
public enum Roles {
ADMIN ("ADMIN Role"),
USER ("USER Role");
private final String description;
Roles (String description) {
this.description = description;
}
public String getDescription() {
return description;
}
}
| [
"yepesluisfernando@hotmail.com"
] | yepesluisfernando@hotmail.com |
b6781f335893a6034213aee45215528daa72ff7c | 2b03a14247eacd51f053ec0f41209c2563850d10 | /java/src/progjava/excecao/Exception2.java | b1f37545cf6350f5ad88cbb50cf8a1c540166ef6 | [] | no_license | thiagolimacg/exemplos | bc5bbf56a99780a0cdfcfe98e549ccc00776a3f6 | b872a6a8301473ad908eb55be23816c1a3f72eb1 | refs/heads/master | 2021-01-16T21:31:33.865292 | 2010-06-29T20:38:38 | 2010-06-29T20:38:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 308 | java | package progjava.excecao;
public class Exception2 {
public static void main(String[] args) {
args[0] = null;
try {
System.out.println(args[0]);
} catch (NullPointerException npe) {
System.out.println("Ocorreu uma exceção!");
}
}
} | [
"projeto.kyrios@e2954138-3125-0410-b7ab-251e373a8e33"
] | projeto.kyrios@e2954138-3125-0410-b7ab-251e373a8e33 |
d1242380e267591e87b9b7da534c997cf1b4c0e5 | ab312bb17d03ca60eab6a599c210b8ccd29b6757 | /src/test/java/utility/ConfigurationReader.java | e16fa21b6a2f45ecb3be87b5af8cd937e2493774 | [] | no_license | semraozturk/BirdsApi | e2f6b221d59325c023f5f4f328f2e6b68aa185c2 | 2fa641e89dc89e23b6b752f15825183430fb91d7 | refs/heads/master | 2023-07-14T11:38:52.277605 | 2021-08-23T16:12:59 | 2021-08-23T16:12:59 | 399,167,588 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 693 | java | package utility;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
public class ConfigurationReader {
private static Properties properties;
static {
try (
FileInputStream fileInputStream = new FileInputStream("configuration.properties")) {
properties = new Properties();
properties.load(fileInputStream);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException("Unable to find configuration.properties file!");
}
}
public static String getProperty(String key) {
return properties.getProperty(key);
}
}
| [
"66539468+semraozturk@users.noreply.github.com"
] | 66539468+semraozturk@users.noreply.github.com |
aab27a57e2540013327eaef2c75713331b74ed28 | da63108117847f42836c15340a80f99c4ff247e3 | /src/main/java/io/kuzzle/sdk/util/EventList.java | 197de54c37d582fbb6e624f43b17481003805bf1 | [
"Apache-2.0"
] | permissive | HKMOpen/sdk-android | 1076a065732ed532991da63eaac2fcb10a6df5f7 | e31172ee7d9fd8ae5a050a514fad87cd98117052 | refs/heads/master | 2021-01-15T19:49:12.783953 | 2016-02-24T15:13:30 | 2016-02-24T15:13:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 145 | java | package io.kuzzle.sdk.util;
import java.util.HashMap;
public class EventList extends HashMap<String, Event> {
public long lastEmitted = 0;
}
| [
"scottinet@kaliop.com"
] | scottinet@kaliop.com |
ccfede6c63e71db70fa9cc7b4bdb8ef4c95d1284 | c2073e78205f8d257ba2612e2d3446d4c8048004 | /src/main/java/com/marek/todoapp/config/WebConfigurer.java | 302b0c434717732818aee091fe6bc004ae02c8fd | [] | no_license | marekmarecki28/todoapp | 7859142c7327bbd2e173daead71b06a38d7b1268 | bdb11a7f8bd2116471593ea15bb71cd5a3d4d9ca | refs/heads/master | 2020-03-25T05:13:05.998782 | 2018-08-10T13:29:10 | 2018-08-10T13:29:10 | 143,435,348 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,441 | java | package com.marek.todoapp.config;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.JHipsterProperties;
import io.github.jhipster.web.filter.CachingHttpHeadersFilter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.servlet.InstrumentedFilter;
import com.codahale.metrics.servlets.MetricsServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import io.undertow.UndertowOptions;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.*;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.http.MediaType;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;
import java.util.*;
import javax.servlet.*;
import static java.net.URLDecoder.decode;
/**
* Configuration of web application with Servlet 3.0 APIs.
*/
@Configuration
public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> {
private final Logger log = LoggerFactory.getLogger(WebConfigurer.class);
private final Environment env;
private final JHipsterProperties jHipsterProperties;
private MetricRegistry metricRegistry;
public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) {
this.env = env;
this.jHipsterProperties = jHipsterProperties;
}
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
if (env.getActiveProfiles().length != 0) {
log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles());
}
EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC);
initMetrics(servletContext, disps);
if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) {
initCachingHttpHeadersFilter(servletContext, disps);
}
log.info("Web application fully configured");
}
/**
* Customize the Servlet engine: Mime types, the document root, the cache.
*/
@Override
public void customize(WebServerFactory server) {
setMimeMappings(server);
// When running in an IDE or with ./gradlew bootRun, set location of the static web assets.
setLocationForStaticAssets(server);
/*
* Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288
* HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1.
* See the JHipsterProperties class and your application-*.yml configuration files
* for more information.
*/
if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) &&
server instanceof UndertowServletWebServerFactory) {
((UndertowServletWebServerFactory) server)
.addBuilderCustomizers(builder ->
builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true));
}
}
private void setMimeMappings(WebServerFactory server) {
if (server instanceof ConfigurableServletWebServerFactory) {
MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
// IE issue, see https://github.com/jhipster/generator-jhipster/pull/711
mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase());
// CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64
mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase());
ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server;
servletWebServer.setMimeMappings(mappings);
}
}
private void setLocationForStaticAssets(WebServerFactory server) {
if (server instanceof ConfigurableServletWebServerFactory) {
ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server;
File root;
String prefixPath = resolvePathPrefix();
root = new File(prefixPath + "build/www/");
if (root.exists() && root.isDirectory()) {
servletWebServer.setDocumentRoot(root);
}
}
}
/**
* Resolve path prefix to static resources.
*/
private String resolvePathPrefix() {
String fullExecutablePath;
try {
fullExecutablePath = decode(this.getClass().getResource("").getPath(), StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
/* try without decoding if this ever happens */
fullExecutablePath = this.getClass().getResource("").getPath();
}
String rootPath = Paths.get(".").toUri().normalize().getPath();
String extractedPath = fullExecutablePath.replace(rootPath, "");
int extractionEndIndex = extractedPath.indexOf("build/");
if (extractionEndIndex <= 0) {
return "";
}
return extractedPath.substring(0, extractionEndIndex);
}
/**
* Initializes the caching HTTP Headers Filter.
*/
private void initCachingHttpHeadersFilter(ServletContext servletContext,
EnumSet<DispatcherType> disps) {
log.debug("Registering Caching HTTP Headers Filter");
FilterRegistration.Dynamic cachingHttpHeadersFilter =
servletContext.addFilter("cachingHttpHeadersFilter",
new CachingHttpHeadersFilter(jHipsterProperties));
cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/i18n/*");
cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/content/*");
cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/app/*");
cachingHttpHeadersFilter.setAsyncSupported(true);
}
/**
* Initializes Metrics.
*/
private void initMetrics(ServletContext servletContext, EnumSet<DispatcherType> disps) {
log.debug("Initializing Metrics registries");
servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE,
metricRegistry);
servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY,
metricRegistry);
log.debug("Registering Metrics Filter");
FilterRegistration.Dynamic metricsFilter = servletContext.addFilter("webappMetricsFilter",
new InstrumentedFilter());
metricsFilter.addMappingForUrlPatterns(disps, true, "/*");
metricsFilter.setAsyncSupported(true);
log.debug("Registering Metrics Servlet");
ServletRegistration.Dynamic metricsAdminServlet =
servletContext.addServlet("metricsServlet", new MetricsServlet());
metricsAdminServlet.addMapping("/management/metrics/*");
metricsAdminServlet.setAsyncSupported(true);
metricsAdminServlet.setLoadOnStartup(2);
}
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = jHipsterProperties.getCors();
if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
log.debug("Registering CORS filter");
source.registerCorsConfiguration("/api/**", config);
source.registerCorsConfiguration("/management/**", config);
source.registerCorsConfiguration("/v2/api-docs", config);
}
return new CorsFilter(source);
}
@Autowired(required = false)
public void setMetricRegistry(MetricRegistry metricRegistry) {
this.metricRegistry = metricRegistry;
}
}
| [
"mc@amcbanking.com"
] | mc@amcbanking.com |
96320c1f5b4501f93094e85cac73221be7781353 | f504e1951c650a9051f2bcafd0714cd7cf87e021 | /humanResources-war/src/main/java/com/fs/humanResources/employee/model/EmployeeModel.java | b1fc8adf9178881c60727e73ab33efbf6447c625 | [] | no_license | SleepingTalent/SELENIUM_INTEGRATION_TEST | 886872cc5dde9dde0c0f90b0994a731d430f2416 | dccd963836f9c01b21f3398a7b259b0d7f56739e | refs/heads/master | 2021-01-15T22:28:36.616842 | 2013-10-21T10:21:47 | 2013-10-21T10:21:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 661 | java | package com.fs.humanResources.employee.model;
import com.fs.humanResources.employee.view.employee.EmployeeViewBean;
import org.apache.log4j.Logger;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
import java.io.Serializable;
@Named
@SessionScoped
public class EmployeeModel implements Serializable {
Logger log = Logger.getLogger(EmployeeModel.class);
private EmployeeViewBean employee;
public EmployeeViewBean getEmployee() {
return employee;
}
public void setEmployee(EmployeeViewBean employee) {
log.info("Setting "+employee+" in EmployeeModel");
this.employee = employee;
}
} | [
"jaybono30@hotmail.com"
] | jaybono30@hotmail.com |
f0415c528827aaf2c8446eb2c436317efa860aa4 | 92930e0fedf4c09bbf5b834c9fbd5f44cbc292cc | /src/main/java/com/demo/designPattern/adapter/TargetableImpl.java | 5201aa3c3112406e8cf29a1669773d4f0d9a9c0e | [] | no_license | hardill/demo_util2 | e4b47d886e6358a5030c7dbf8e7dd6c6626f15fb | e4b5e7e32223caa2200c3a1e3fd3759bf9f6e85a | refs/heads/master | 2022-09-13T04:22:55.369338 | 2021-09-16T08:27:22 | 2021-09-16T08:27:22 | 191,886,038 | 0 | 0 | null | 2022-09-01T23:35:31 | 2019-06-14T06:13:55 | Java | UTF-8 | Java | false | false | 335 | java | package com.demo.designPattern.adapter;
/**
* @program: demo_util
* @description: 类的适配器模式实现类
* @author: Mr.Huang
* @create: 2019-03-07 11:34
*/
public class TargetableImpl extends Source implements Targetable {
@Override
public void method2() {
System.out.println("hello adapter2");
}
}
| [
"hzt1212520@126.com"
] | hzt1212520@126.com |
b302812c9283c3c708976f65645e45cc5a634b13 | 5c41315fcb1d2347f273907d57bb946e33e743b2 | /chapter5/src/main/java/chapter5/reactivex/intro/VertxIntro.java | 08de23fdd27c30b495f942b40f71e9dab9ebabaa | [
"MIT"
] | permissive | jugaljoshi/vertx-in-action | 2d0ceae08c00f0c970d6a15b66481bf01e85683a | f50fb9d056f285a8ccfa6d40ab12552f06abe4c5 | refs/heads/master | 2022-04-21T13:26:08.409869 | 2020-04-20T23:41:15 | 2020-04-20T23:41:15 | 257,684,108 | 1 | 0 | MIT | 2020-04-21T18:39:58 | 2020-04-21T18:39:57 | null | UTF-8 | Java | false | false | 735 | java | package chapter5.reactivex.intro;
import io.reactivex.Completable;
import io.reactivex.Observable;
import io.vertx.reactivex.core.Vertx;
import io.vertx.reactivex.core.RxHelper;
import io.vertx.reactivex.core.AbstractVerticle;
import java.util.concurrent.TimeUnit;
public class VertxIntro extends AbstractVerticle {
@Override
public Completable rxStart() {
Observable
.interval(1, TimeUnit.SECONDS, RxHelper.scheduler(vertx))
.subscribe(n -> System.out.println("tick"));
return vertx.createHttpServer()
.requestHandler(r -> r.response().end("Ok"))
.rxListen(8080)
.ignoreElement();
}
public static void main(String[] args) {
Vertx.vertx().deployVerticle(new VertxIntro());
}
}
| [
"julien.ponge@gmail.com"
] | julien.ponge@gmail.com |
bf64133d69a5a8d87e1bf3c94f7f614ae1e6c56c | 36491a0cb00aa6191a58bd200f83ab1290ca1172 | /src/_04_CopyJpgFile.java | 1880ce41b7207e5be668d4326ff91e75f18d50af | [] | no_license | SoftUniJavaHomework/StreamsAndFiles | 73990083e4d9ffcdf568fe9f75815df37f8f3229 | 9eea7a5b8a987330a860d0ac4522af83922d34ca | refs/heads/master | 2021-01-10T15:42:52.224972 | 2016-04-01T08:02:51 | 2016-04-01T08:02:51 | 55,214,572 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 984 | java | import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* Created by pc on 3/25/2016.
*/
public class _04_CopyJpgFile {
public static void main(String[] args) {
try(FileInputStream source = new FileInputStream("C:\\Users\\pc\\Documents\\JavaStreamsAndFiles-Homework\\picture.jpg");
FileOutputStream destination = new FileOutputStream("C:\\Users\\pc\\Documents\\JavaStreamsAndFiles-Homework\\my-copied-picture.jpg")) {
byte[] buffer = new byte[4096];
while (true) {
int readBytes = source.read(buffer, 0, buffer.length);
if(readBytes <= 0) {
break;
}
destination.write(buffer, 0, readBytes);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"silvi.1981@windowslive.com"
] | silvi.1981@windowslive.com |
02e08776f6d3d0beb8fcc31ce856afdefbe935c9 | 43fac53ba56f3782264ff4f71ab500540b8b7a14 | /app/src/androidTest/java/com/example/venkatesh/myapplication/ExampleInstrumentedTest.java | 55bf8796cfe20b61522cccc336e3d88d1fa0a49a | [] | no_license | venkatesh1100/MyApplication | d83ae8061f2fa4043449cff51a6dc13cc992af6a | 57226da4c52c40d1c010ae956a56e90c46d6c39b | refs/heads/master | 2021-01-20T11:58:09.864369 | 2017-02-21T05:48:51 | 2017-02-21T05:48:51 | 82,641,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 774 | java | package com.example.venkatesh.myapplication;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.venkatesh.myapplication", appContext.getPackageName());
}
}
| [
"venkateshjose"
] | venkateshjose |
0f7f5a43bb4754e454e8eda6224eb61df97a154d | de4b50bc8f366c216a6eddb96a459f0e704f29b1 | /app/src/main/java/com/example/hussainmehboob/testapp/MainActivity.java | eb96e08f1c63e5dbf8a5f9439e4fbda23691e3cb | [] | no_license | HussainMehboob/TestApp | 8cf86a64ed9aeccf525541a6fba024f8bdcabf6c | c847e00bf3ca5c7be25e9ef2f6cd645b0646c47b | refs/heads/master | 2020-03-26T13:47:06.804479 | 2018-09-03T07:00:09 | 2018-09-03T07:00:09 | 144,956,579 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,047 | java | package com.example.hussainmehboob.testapp;
import android.app.Application;
import android.content.Intent;
import android.os.CountDownTimer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.Switch;
import com.example.hussainmehboob.mylibrary.LoginActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(MyApp.isAppTheme%2 == 0) {
setTheme(R.style.AppTheme);
} else {
setTheme(R.style.MyCustomTheme);
}
setContentView(R.layout.activity_main);
Button btn = findViewById(R.id.btn);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MyApp.isAppTheme++;
changeTheme();
}
});
new CountDownTimer(3000, 3000) {
public void onTick(long millisUntilFinished) {
//mTextField.setText("seconds remaining: " + millisUntilFinished / 1000);
//here you can have your logic to set text to edittext
}
public void onFinish() {
startActivity(new Intent(MainActivity.this, LoginActivity.class));
}
}.start();
/* switch1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
MyApp.isAppTheme = isChecked;
changeTheme();
//recreate();
}
});*/
}
private void changeTheme(){
if(MyApp.isAppTheme%2 == 0) {
setTheme(R.style.AppTheme);
} else {
setTheme(R.style.MyCustomTheme);
}
MainActivity.this.recreate();
}
}
| [
"hussain.1210a@gmail.com"
] | hussain.1210a@gmail.com |
c24785c56acfedc4b7bf83651985486ccb03a454 | 32c0b93d2f227d81eafd3f35d193e4456f4a25e5 | /src/main/java/ru/geekbrains/lesson6/lesson6.java | da30501ce33513c3e0d08ff963e2827e72bea931 | [] | no_license | Insert159/lesson6badthingfigetaboutit | fa275449f07697aa49143c74da4464e422d85a0b | c8e063030d2333e28a3d0ad3959c1037e0669829 | refs/heads/master | 2023-05-25T21:46:10.129331 | 2021-06-03T14:05:52 | 2021-06-03T14:05:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 109 | java | package ru.geekbrains.lesson6;
public class lesson6 {
public static void main(String[] args) {
}
}
| [
"info@geekbrains.ru"
] | info@geekbrains.ru |
fd0f270361c6b6016d93e3687c6fa50719da4028 | 03875fbf6370a0792103dfd6e81332cfc3aa59de | /common/src/main/java/com/mining/web/framework/helper/RequestHelper.java | 79c2749d132919b5554f40a7a4ff142e06fa4832 | [] | no_license | aizen1984/jgtx | 3d0a6e07af74998388d0223c2a5473c1aa358f27 | b02aadddd5af0962519af9c89993d1d53f82d803 | refs/heads/master | 2022-11-16T05:36:03.543184 | 2019-07-22T01:34:58 | 2019-07-22T01:34:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,016 | java | /**
* File Name: RequestHelper.java
* Author:
* Created Time: 2019-02-26
*/
package com.mining.web.framework.helper;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.mining.web.framework.bean.FormParam;
import com.mining.web.framework.bean.Param;
import com.mining.web.framework.util.ArrayUtil;
import com.mining.web.framework.util.CodecUtil;
import com.mining.web.framework.util.StreamUtil;
import com.mining.web.framework.util.StringUtil;
/**
* class: RequestHelper
* desc:
*/
public class RequestHelper {
/**
* 创建请求对象
*/
public static Param createParam(HttpServletRequest request) throws IOException {
List<FormParam> formParamList = new ArrayList<>();
formParamList.addAll(parseParameterNames(request));
formParamList.addAll(parseInputStream(request));
return new Param(formParamList);
}
private static List<FormParam> parseParameterNames(HttpServletRequest request) {
List<FormParam> formParamList = new ArrayList<>();
Enumeration<String> paramNames = request.getParameterNames();
while (paramNames.hasMoreElements()) {
String fieldName = paramNames.nextElement();
String[] fieldValues = request.getParameterValues(fieldName);
if (ArrayUtil.isNotEmpty(fieldValues)) {
Object fieldValue;
if (fieldValues.length == 1) {
fieldValue = fieldValues[0];
} else {
StringBuilder sb = new StringBuilder("");
for (int i = 0; i < fieldValues.length; i++) {
sb.append(fieldValues[i]);
if (i != fieldValues.length - 1) {
sb.append(StringUtil.SEPARATOR);
}
}
fieldValue = sb.toString();
}
formParamList.add(new FormParam(fieldName, fieldValue));
}
}
return formParamList;
}
private static List<FormParam> parseInputStream(HttpServletRequest request) throws IOException {
List<FormParam> formParamList = new ArrayList<>();
String body = CodecUtil.decodeURL(StreamUtil.getString(request.getInputStream()));
if (StringUtil.isNotEmpty(body)) {
String[] kvs = StringUtil.splitString(body, "&");
if (ArrayUtil.isNotEmpty(kvs)) {
for (String kv : kvs) {
String[] array = StringUtil.splitString(kv, "=");
if (ArrayUtil.isNotEmpty(array) && array.length == 2) {
String fieldName = array[0];
String fieldValue = array[1];
formParamList.add(new FormParam(fieldName, fieldValue));
}
}
}
}
return formParamList;
}
}
| [
"lt199025@163.com"
] | lt199025@163.com |
08c61a4669efc35464ea83344a81974b4197e4da | 9ea58b671f94c6e12f7a47753bcb1b13e39d1e54 | /src/main/java/com/sda/example/Production/WorkerConfig.java | 42bc5c351b9baa68d3ca63c8e96a18b4875ffe58 | [] | no_license | CristianB1/FirstProject | d526e8f792d102807884373ab3d4d7fd248193b1 | 0e7dcc06d690917d9a5cc20f10c83863e3001920 | refs/heads/master | 2020-05-15T15:31:31.546754 | 2019-04-20T12:49:10 | 2019-04-20T12:49:10 | 182,375,745 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 308 | java | package com.sda.example.Production;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class WorkerConfig {
@Bean
public WorkerMotto workerMotto(){
return new WorkerMotto("A new way of working!");
}
}
| [
"cboffice2008@yahoo.com"
] | cboffice2008@yahoo.com |
e53b3d623e3de1a6bbe580c581c1f654d399dbcd | 95c49f466673952b465e19a5ee3ae6eff76bee00 | /src/main/java/com/xiaomi/push/C8802ge.java | 8cb56bbb5fb8d33b872d0aa1559258ad3d5feb87 | [] | no_license | Phantoms007/zhihuAPK | 58889c399ae56b16a9160a5f48b807e02c87797e | dcdbd103436a187f9c8b4be8f71bdf7813b6d201 | refs/heads/main | 2023-01-24T01:34:18.716323 | 2020-11-25T17:14:55 | 2020-11-25T17:14:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,793 | java | package com.xiaomi.push;
import android.content.Context;
import android.text.TextUtils;
import com.xiaomi.p913a.p914a.p915a.AbstractC8508c;
import com.xiaomi.push.service.C9014o;
import com.xiaomi.push.service.XMPushService;
import java.io.File;
/* renamed from: com.xiaomi.push.ge */
public class C8802ge implements XMPushService.AbstractC8924l {
/* renamed from: a */
private static boolean f37470a;
/* renamed from: b */
private Context f37471b;
/* renamed from: c */
private boolean f37472c;
/* renamed from: d */
private int f37473d;
public C8802ge(Context context) {
this.f37471b = context;
}
/* renamed from: a */
private String m51805a(String str) {
return "com.xiaomi.xmsf".equals(str) ? "1000271" : this.f37471b.getSharedPreferences("pref_registered_pkg_names", 0).getString(str, null);
}
/* renamed from: a */
private void m51806a(Context context) {
this.f37472c = C9014o.m53201a(context).mo55823a(EnumC8814gp.TinyDataUploadSwitch.mo54946a(), true);
this.f37473d = C9014o.m53201a(context).mo55818a(EnumC8814gp.TinyDataUploadFrequency.mo54946a(), 7200);
this.f37473d = Math.max(60, this.f37473d);
}
/* renamed from: a */
public static void m51807a(boolean z) {
f37470a = z;
}
/* renamed from: a */
private boolean m51808a(AbstractC8808gj gjVar) {
if (C8599ae.m50646c(this.f37471b) && gjVar != null && !TextUtils.isEmpty(m51805a(this.f37471b.getPackageName())) && new File(this.f37471b.getFilesDir(), "tiny_data.data").exists() && !f37470a) {
return !C9014o.m53201a(this.f37471b).mo55823a(EnumC8814gp.ScreenOnOrChargingTinyDataUploadSwitch.mo54946a(), false) || C8834hi.m52223n(this.f37471b) || C8834hi.m52224o(this.f37471b);
}
return false;
}
/* renamed from: b */
private boolean m51809b() {
return Math.abs((System.currentTimeMillis() / 1000) - this.f37471b.getSharedPreferences("mipush_extra", 4).getLong("last_tiny_data_upload_timestamp", -1)) > ((long) this.f37473d);
}
@Override // com.xiaomi.push.service.XMPushService.AbstractC8924l
/* renamed from: a */
public void mo54885a() {
m51806a(this.f37471b);
if (this.f37472c && m51809b()) {
AbstractC8508c.m50231a("TinyData TinyDataCacheProcessor.pingFollowUpAction ts:" + System.currentTimeMillis());
AbstractC8808gj a = C8807gi.m51824a(this.f37471b).mo54887a();
if (!m51808a(a)) {
AbstractC8508c.m50231a("TinyData TinyDataCacheProcessor.pingFollowUpAction !canUpload(uploader) ts:" + System.currentTimeMillis());
return;
}
f37470a = true;
C8803gf.m51812a(this.f37471b, a);
}
}
}
| [
"seasonpplp@qq.com"
] | seasonpplp@qq.com |
310affefa82763dcc928bc8dc62268227f8853a7 | e8af1b62ba9cbf07469f428a0b7340e9f57d1482 | /src/ProjectPractice/LimitFlowFrame/rule/parser/YamlRuleConfigParser.java | f7de0581f422f365dae669f331a1d71ee798e402 | [
"Apache-2.0"
] | permissive | Kingwentao/DesignPatternOfBeauty | b51657459ad241dce45ac8a86d7c2a5511f58c8c | 08d672f18ce920482a54a27079745e865e88a64b | refs/heads/master | 2021-06-27T07:01:26.790296 | 2021-03-30T07:24:52 | 2021-03-30T07:24:52 | 225,011,555 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package ProjectPractice.LimitFlowFrame.rule.parser;
import ProjectPractice.LimitFlowFrame.rule.RuleConfig;
import java.io.InputStream;
/**
* author: WentaoKing
* created on: 2020/6/8
* description: yaml格式配置文件解析类
*/
public class YamlRuleConfigParser implements RuleConfigParser {
@Override
public RuleConfig parser(InputStream inputStream) {
return null;
}
}
| [
"jinwentao@cvte.com"
] | jinwentao@cvte.com |
a3dc7b824ff635940096810d9d9ee952162643b5 | a8a2d7badaaae418369fca3dbe52b090e3653dcb | /src/OperatorDemos.java | de3a91e2f91ff344d2696af614d640fc1e373c30 | [] | no_license | mmm13/VDemo | 56eda865706a5b58730c87380ab8e5c3c8438864 | 8977985f650ed95b3436ec4745de04c517f255b2 | refs/heads/master | 2021-01-10T06:46:53.790449 | 2015-05-22T15:33:31 | 2015-05-22T15:33:31 | 36,079,644 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,389 | java |
public class OperatorDemos {
/**
* @param args
*/
public static void main(String[] args) {
int sum=1+2+3+4+5;
String type;
if ( sum % 2 == 0)
type = "even";
else
type = "odd";
System.out.println (sum + " is " + type);
{
int a = 5;
double b = 2;
a = a + (int) b;
double c = a/b;
System.out.println("c is " + c);
}
int currentAge = 45;
int moreYears = 3;
System.out.println("Bob is " + currentAge + " years old.");
System.out.println("In " + moreYears + " years, Bob will be " + currentAge + moreYears + " years old");
System.out.println("In " + moreYears + " years, Bob will be " + (currentAge + moreYears) + " years old");
int newAge = currentAge + moreYears;
System.out.println("In " + moreYears + " years, Bob will be " + newAge + " years old");
{
int a = 3;
int b = 4;
boolean c = (a ==2) && (b++ ==4);
System.out.println("A = " + a);
System.out.println("B = " + b);
System.out.println("C = " + c);
int d = 3;
int e = 4;
boolean f = (d==3) && (e++ == 4);
System.out.println("D = " + d);
System.out.println("E = " + e);
System.out.println("F = " + f);
int g = 3;
int h = 4;
boolean i = (g==3) && (++h ==4);
System.out.println("G = " + g);
System.out.println("H = " + h);
System.out.println("I = " + i);
}
}
}
| [
"m.mcnully13@gmail.com"
] | m.mcnully13@gmail.com |
c9656c99ca9781db71f2df4694c9f38bcccaf95f | 43f7dce0e149ed2bd38ec73af5773ec7b46d7dab | /lesson1_3/CodeChallenge/ScrollingText/app/src/main/java/com/hs/scrollingtext/MainActivity.java | af3dbc91944259f8243566f33a26a511e5893cf5 | [
"MIT"
] | permissive | ACoolA-008/cs5520project | d11e0c19b9db530a211da8071a180c35fbbd20fb | e5c317c1bae52a8ed383cbbe544d9256e0f1ff0a | refs/heads/main | 2023-08-04T20:06:03.961951 | 2021-09-29T19:53:31 | 2021-09-29T19:53:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package com.hs.scrollingtext;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
} | [
"90421945+saiqi1999@users.noreply.github.com"
] | 90421945+saiqi1999@users.noreply.github.com |
665a646f1ccbbc5c8f1af9df3c5e3ca9017659e0 | 853cc7b6a6dd7633b19a4bd902d72aa4106b570a | /src/main/java/com/patrick/service/impl/TblNetdiskDirServiceImpl.java | 1221e48d570ea1b0cde04cb96a5d3b587230ad87 | [] | no_license | Snowing-J/family_service_platform | 36cb4f10a9537cff410ccf74760ec4b4f3874f92 | 9c1110b5043e954ec5c2295a94e2e7803af026ba | refs/heads/main | 2023-08-19T22:26:33.069432 | 2021-10-18T08:47:48 | 2021-10-18T08:47:48 | 416,817,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 536 | java | package com.patrick.service.impl;
import com.patrick.bean.TblNetdiskDir;
import com.patrick.mapper.TblNetdiskDirMapper;
import com.patrick.service.base.TblNetdiskDirService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 网络硬盘_文件夹 服务实现类
* </p>
*
* @author lian
* @since 2021-10-06
*/
@Service
public class TblNetdiskDirServiceImpl extends ServiceImpl<TblNetdiskDirMapper, TblNetdiskDir> implements TblNetdiskDirService {
}
| [
"77401904+Snowing-J@users.noreply.github.com"
] | 77401904+Snowing-J@users.noreply.github.com |
963eb8e6a1b5fc180d99f6f48fac0e2c5b3e63d6 | 944ca797af8a075549be53c69452d62f0a121f5e | /app/src/test/java/com/example/cyphers_matching_search_system/ExampleUnitTest.java | 19206967c3c974d580711865b541b7b37f76e89d | [] | no_license | whtjtjddn/Cyphers_Matching_Search_System | 20440925e14de76eeddaa984c2fcb028269a51b3 | c2be3cff293827a85d53b8fc7b7342df08fb4bd8 | refs/heads/master | 2023-08-21T05:33:33.368239 | 2021-10-18T15:09:59 | 2021-10-18T15:09:59 | 401,271,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package com.example.cyphers_matching_search_system;
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);
}
} | [
"54929329+whtjtjddn@users.noreply.github.com"
] | 54929329+whtjtjddn@users.noreply.github.com |
e48caeef664562c1dba5e1e78309dab67e2184dc | a1cb59f8b5d01f570fd966e38d0b3597eb9efbce | /src/subjectinventory/SubjectInventory.java | 2623ebfc6155c0f7f1f6ee843c8cf80bac4dbd81 | [] | no_license | epakconsultant/java-inventory | 094d3b0e6434c0706fb691c2125067d6f264a7ba | 1986e93190ddc156a77ec798ac7ecf91ec834269 | refs/heads/master | 2021-01-17T09:54:43.294307 | 2016-06-17T21:59:12 | 2016-06-17T21:59:12 | 61,404,578 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,055 | 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 subjectinventory;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
*
* @author meraj
*/
public class SubjectInventory extends Application {
@Override
public void start(Stage stage) throws Exception {
FXMLLoader fxmlLoader = new FXMLLoader(this.getClass().getResource("SubjectInventoryForm.fxml"));
Parent root = (Parent)fxmlLoader.load();
Scene scene = new Scene(root);
stage.setTitle("Course Inventory");
stage.setScene(scene);
SubjectInventoryController ctrlMain = (SubjectInventoryController)fxmlLoader.getController();
ctrlMain.setStage(stage);
stage.show();
}
public static void main(String[] args) {
SubjectInventory.launch((String[])args);
}
}
| [
"e_pak_consultant@yahoo.com"
] | e_pak_consultant@yahoo.com |
a6a91deb34dc11b9bdeaf041fa4ad3ba58dfd262 | d068e956673c2ad8bea6ba58d3f151179a89b2d2 | /src/main/java/app/resource/CategoryResource.java | edb6c30a83003c3a7b7f5ed7ce98a089c3e2ecb6 | [] | no_license | elizavetakhokhol/sw_app | a926e9d8f3acf5848573982397228c0bbe566db8 | 13cec94f6408ba0ed5f92d4802d2439d90260ed7 | refs/heads/master | 2023-03-29T18:00:27.000287 | 2021-03-16T11:38:52 | 2021-03-16T11:38:52 | 345,942,700 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,532 | java | package app.resource;
import app.model.Category;
import app.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Controller
@RequestMapping(path="/category")
public class CategoryResource {
@Autowired
CategoryService categoryService;
@PostMapping(path = "")
public ResponseEntity<String> createCategory (@RequestBody Category category) {
categoryService.addCategory(category);
return new ResponseEntity<>("Category " + category.getName() + " created", HttpStatus.CREATED);
}
@GetMapping(path = "{id}")
public ResponseEntity<Category> getCategoryById (@PathVariable(name = "id") long id) {
Category categoryById = categoryService.getCategoryById(id);
return new ResponseEntity<>(categoryById, HttpStatus.OK);
}
@DeleteMapping(path = "/{id}")
public ResponseEntity<String> deleteCategoryById (@PathVariable(name = "id") long id) {
categoryService.deleteCategoryById(id);
return new ResponseEntity<>("Category " + categoryService.getCategoryById(id).getName() + " deleted", HttpStatus.OK);
}
@GetMapping(path = "/getAll")
public ResponseEntity<List<Category>> getAllCategory () {
return new ResponseEntity<>(categoryService.getAllCategories(), HttpStatus.OK);
}
}
| [
"elizavetakhokhol@gmail.com"
] | elizavetakhokhol@gmail.com |
b4ee369a4748232495fd754b0f0df38571144ebd | eb74c3f5f8012cd37339c1566eb3109cc73b372f | /src/main/java/com/example/app/dao/PessoaDAO.java | 90646a7735a0247bb7e2cd3d96eac5c594af2cf0 | [] | no_license | vselias/agenda-spring | 15e75a84cca72824e40a75f4b68b0fd6881ae623 | 3d1f3bd1d05258d00f006d71d3d9946e490389e8 | refs/heads/master | 2023-03-12T13:58:54.982212 | 2021-02-20T16:42:54 | 2021-02-20T16:42:54 | 307,269,988 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,633 | java | package com.example.app.dao;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.example.app.entidade.Pessoa;
@Repository
@Transactional
public interface PessoaDAO extends PagingAndSortingRepository<Pessoa, Long> {
@Query("SELECT p from Pessoa p where p.email = :email")
public Pessoa buscarPessoaPorEmail(@Param("email") String email);
@Query("SELECT p from Usuario u join u.pessoas p where u.id = :id")
public Page<Pessoa> buscarTodosPorUsuarioPag(@Param("id") Long id, Pageable pageable);
@Query("SELECT p from Pessoa p join p.usuario u where u.id = :id")
public Page<Pessoa> buscarTodosPorUsuarioOrdenacao(@Param("id") Long id, Pageable pageable);
@Query("SELECT p from Pessoa p join p.usuario u where u.id = :id")
public List<Pessoa> buscarTodosPorUsuario(@Param("id") Long id);
@Query("SELECT p from Pessoa p join p.usuario u where u.id = :id "
+"and (lower(p.nome) like lower(concat(:texto,'%'))"
+"or lower(p.cidade) like lower(concat(:texto,'%'))"
+"or lower(p.sexo) like lower(concat(:texto,'%'))"
+"or lower(p.estado) like lower(concat(:texto,'%'))"
+"or lower(p.email) like lower(concat(:texto,'%')))")
public Page<Pessoa> buscarPorNome(@Param("texto") String texto, @Param("id") Long id ,Pageable pageable);
}
| [
"viniciusem@hotmail.com"
] | viniciusem@hotmail.com |
a93565b6862302eb05892103153fd4b8a7cf66eb | 3c5821b0eb099e684860cc48a19153b49461f8d1 | /src/test/java/com/github/chisui/translate/ImmutableTranslationHintTest.java | baebb914574d8ff80deeff362435579466ef9235 | [
"Apache-2.0"
] | permissive | chisui/translate | 9ef90b990a45d02bc2d22f0befbd747dfd2ea805 | e1d8ea5ff5e435b33592abf9ce130c8098690b12 | refs/heads/master | 2020-12-11T07:38:20.366477 | 2018-06-06T18:07:57 | 2018-06-06T18:07:57 | 48,446,786 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,688 | java | package com.github.chisui.translate;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import java.util.List;
import java.util.Optional;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import com.github.chisui.translate.TranslationHint.ImmutableTranslationHint;
import mockit.Expectations;
import mockit.Mocked;
public class ImmutableTranslationHintTest {
@Rule public ExpectedException thrown = ExpectedException.none();
@Test
public void testGetters(
@Mocked Object key,
@Mocked List<?> args,
@Mocked Optional<String> fallback
) throws Exception {
new Expectations() {{
}};
ImmutableTranslationHint hint = new ImmutableTranslationHint(key, args, fallback);
assertThat(hint.getKey(), is(key));
assertThat(hint.getArguments(), is(args));
assertThat(hint.getFallback(), is(fallback));
}
@Test
public void testKeyNull(
@Mocked List<?> args,
@Mocked Optional<String> fallback
) throws Exception {
new Expectations() {{
}};
thrown.expect(NullPointerException.class);
new ImmutableTranslationHint(null, args, fallback);
}
@Test
public void testArgsNull(
@Mocked Object key,
@Mocked Optional<String> fallback
) throws Exception {
new Expectations() {{
}};
thrown.expect(NullPointerException.class);
new ImmutableTranslationHint(key, null, fallback);
}
@Test
public void testFallbackNull(
@Mocked Object key,
@Mocked List<?> args
) throws Exception {
new Expectations() {{
}};
thrown.expect(NullPointerException.class);
new ImmutableTranslationHint(key, args, null);
}
}
| [
"chisui@fb3.uni-bremen.de"
] | chisui@fb3.uni-bremen.de |
0db6b08c2974b3bde1d938673cfbfe6aa8e62ae6 | 449d5e6220fc360823e085c8b226f197c8582b60 | /src/main/java/com/wangku/dpw/controller/admin/ProInvestmentController.java | 74c9360d9c0919eae7c750f9006d6f091ff4a246 | [] | no_license | yefengmengluo/icewine | 964776ba6600bec6c4b2f43787c54dcbbab4188f | 2c600facb4f71ea5dd90eb8ae0f0739b8cb1122d | refs/heads/master | 2021-01-10T01:12:27.793079 | 2016-03-04T08:13:43 | 2016-03-04T08:13:43 | 53,117,665 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,935 | java | package com.wangku.dpw.controller.admin;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.wangku.dpw.domain.Member;
import com.wangku.dpw.domain.ProInvestment;
import com.wangku.dpw.service.MemberService;
import com.wangku.dpw.service.ProInvestmentService;
import com.wangku.dpw.util.FileUploadUtil;
import com.wangku.dpw.util.Page;
/**
*
*
* @author: 亢临丽 2015-11-6
* @方法名:
* @方法描述:招商版块
* @param:
* @返回值:
*
*/
@Controller
@RequestMapping("proInvestment")
public class ProInvestmentController {
@Resource
private ProInvestmentService proInvestmentService;
@Resource
private MemberService memberService;
@RequestMapping("/list.html")
public String list(ProInvestment proInvestment,HttpServletRequest request,HttpServletResponse response,ModelMap modelMap){
Page<ProInvestment> page=new Page<ProInvestment>(request,response);
proInvestmentService.queryList(proInvestment, page);
modelMap.addAttribute("page", page);
return "/proInvestment/proInvestmentlist";
}
//添加招商
@RequestMapping("/add.html")
public String add(@RequestParam(value="id", required=false )Integer id,ModelMap modelMap){
modelMap.addAttribute("id", id);
return "/proInvestment/proInvestmentadd";
}
//操作已推荐、已置顶
@RequestMapping("/check.html")
public String check(ProInvestment proInvestment,HttpServletRequest request,HttpServletResponse response,ModelMap modelMap){
Page<ProInvestment> page=new Page<ProInvestment>(request,response);
proInvestmentService.queryList(proInvestment, page);
modelMap.addAttribute("page", page);
return "/proInvestment/proInvestmentlist";
}
//编辑招商数据
@RequestMapping("/toEdit.html")
public String toEdit(@RequestParam(value="id", required=false )Integer id,ModelMap modelMap){
ProInvestment proInvestment = null;
if( id != null ){
proInvestment = this.proInvestmentService.findByIdCode(id);
}
Member member=this.memberService.findById(proInvestment.getMemberId());
modelMap.addAttribute("member", member);
modelMap.addAttribute("proInvestment", proInvestment);
return "/proInvestment/proInvestmentupdate";
}
//查看招商数据
@RequestMapping("/detail.html")
public String detail(@RequestParam(value="id", required=false )Integer id,ModelMap modelMap){
ProInvestment proInvestment = null;
if( id != null ){
proInvestment = this.proInvestmentService.findByIdCode(id);
}
Member member=this.memberService.findById(proInvestment.getMemberId());
modelMap.addAttribute("member", member);
modelMap.addAttribute("proInvestment", proInvestment);
return "/proInvestment/proInvestmentdetail";
}
//删除数据
@RequestMapping("/delProInvestment.html")
public String delProInvestment(@RequestParam("id")String id){
if(id!=null&&!"".equals(id)){
List<String> ids = new ArrayList<String>() ;
ids.add(id);
this.proInvestmentService.delete(ids);
}
return "redirect:/proInvestment/list.html";
}
//保存招商会员数据
@RequestMapping("/save.html")
public String save(ProInvestment proInvestment,Member member,HttpServletRequest request,@RequestParam(value="files",required=false)MultipartFile files){
if(files!=null && files.getSize()>0){
FileUploadUtil.saveFile(files, request);
proInvestment.setPic(FileUploadUtil.getFilePath()+files.getOriginalFilename());
}
this.proInvestmentService.save(proInvestment);
this.memberService.save(member);
return "redirect:/proInvestment/list.html";
}
/**
*
* @param ids
* @param modelMap
* @param status
* @return
*/
//批量操作 推荐、置顶 按钮
@ResponseBody
@RequestMapping("checkboxAll")
public String AllCheckBox(@RequestParam(value="ids",required=false)String ids ,ModelMap modelMap,@RequestParam(value="status",required=false)String status){
List<Integer> idsList=null;
if(ids != "" && ids != null){
String [] arr = ids.split(",");
idsList = new ArrayList<Integer>() ;
for (int i = 0; i < arr.length; i++) {
try {
idsList.add(Integer.parseInt(arr[i])) ;
} catch (Exception e) {
break ;
}
}
}
ProInvestment proInfo = new ProInvestment() ;
proInfo.setStatus(status) ;
this.proInvestmentService.findbybatchUpdateProduct(idsList,proInfo);
return "" ;
}
}
| [
"yefengmengluo@163.com"
] | yefengmengluo@163.com |
1e26f473e4c935275300f6bd37bbde9d2a4436c6 | e29a16bb5d7af5a93cce005a93c120d583619c0d | /app/src/main/java/jocelyn_test03/com/jsontask/JsonTools/JsonTools.java | aa5796d839d85b04d171d2300ea51467fc77406d | [] | no_license | TonyLau2009/JsonTask | 21a5d2db0065649918d2d9bc39d076cdffda478b | 58abd170267cd67567a9035bfa28e481a0ba16f5 | refs/heads/master | 2020-12-02T22:20:55.093014 | 2017-07-03T14:28:39 | 2017-07-03T14:28:39 | 96,119,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,129 | java | package jocelyn_test03.com.jsontask.JsonTools;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import jocelyn_test03.com.jsontask.JavaBean.Person;
/**
* Created by Jocelyn on 23/10/2016.
*/
public class JsonTools {
public static ArrayList<Person> parseJson(String jsonString){
ArrayList<Person> psList = new ArrayList<>();
try {
JSONObject jo = new JSONObject(jsonString);
JSONArray jbA = jo.getJSONArray("person");
for(int i = 0; i < jbA.length();i++){
JSONObject valueObj = jbA.getJSONObject(i);
Person person = new Person();
person.setId(valueObj.getInt("id"));
person.setName(valueObj.getString("name"));
person.setAge(valueObj.getInt("age"));
person.setAddress(valueObj.getString("address"));
psList.add(person);
return psList;
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
}
| [
"tonylau2009@yahoo.com.hk"
] | tonylau2009@yahoo.com.hk |
e7d36d387a723279db03d02a3599694578b0e86e | 0e20142351411acfaa85a7c3901e2aaea02ad7ca | /AndroidDemoList-master/DemoList/Demo1/app/src/main/java/com/example/working/demo1/ListPerfenceActivity.java | 5ff0e953f148468dc2af45016a07a141ba9d4014 | [] | no_license | georgegopro/android-stuff | 6449684746698cbc3939c211889d74e06a05eefc | ccc68e6ca0a4416bc3d89c282504472cb2531dec | refs/heads/master | 2021-06-14T10:20:50.829234 | 2017-05-03T16:15:20 | 2017-05-03T16:15:20 | 90,168,174 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.example.working.demo1;
import android.os.Bundle;
import android.preference.PreferenceActivity;
/**
* Created by Administrator on 2015/9/25 0025.
*/
public class ListPerfenceActivity extends PreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.listactivity);
}
}
| [
"547949141@qq.com"
] | 547949141@qq.com |
2e8f3e2bafce38d687fa29504be7a693de4c6d86 | 74f23180a48b46ab784bc31bbfe5b221aeee0904 | /src/main/java/com/soft1721/spring/hello/StudentApp.java | 9d9351adcf15f2819fe12e5f8757cf7cea432cb9 | [] | no_license | hangov/helloworld | ef178ff9c3edcb7101f46d6f13211dabadd79809 | d8685f1ecc72b264cbee6ddcceb7e0249f55fd96 | refs/heads/master | 2020-04-25T19:46:05.160842 | 2019-02-28T03:05:46 | 2019-02-28T03:05:46 | 173,031,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package com.soft1721.spring.hello;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class StudentApp {
public static void main(String[] args) {
ApplicationContext context = new
ClassPathXmlApplicationContext("/beans.xml");
Student student = (Student)context.getBean("student");
System.out.println(student);
}
}
| [
"1013818707@qq.com"
] | 1013818707@qq.com |
f76754cde25e54dff53cd2dd60279e29f9a9283c | 3192b7a984ed59da652221d11bc2bdfaa1aede00 | /code/src/main/java/com/cmcu/mcc/five/entity/FiveOaAssociationChange.java | f84e92ce8ca8793e523c62a3520453f9ac828cf7 | [] | no_license | shanghaif/-wz- | e6f5eca1511f6d68c0cd6eb3c0f118e340d9ff50 | c7d6e8a000fbc4b6d8fed44cd5ffe483be45440c | refs/heads/main | 2023-06-08T22:35:30.125549 | 2021-04-30T07:03:21 | 2021-04-30T07:03:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,367 | java | package com.cmcu.mcc.five.entity;
import java.util.Date;
import javax.validation.constraints.*;
import lombok.Data;
@Data
public class FiveOaAssociationChange {
@NotNull(message="id不能为空!")
@Max(value=999999999, message="id必须为数字")
private Integer id;
@NotNull(message="businessKey不能为空!")
@Size(max=45, message="businessKey长度不能超过45")
private String businessKey;
@NotNull(message="被变更协会id不能为空!")
@Max(value=999999999, message="被变更协会id必须为数字")
private Integer applyId;
@NotNull(message="申请部门、单位不能为空!")
@Max(value=999999999, message="申请部门、单位必须为数字")
private Integer deptId;
@NotNull(message="deptName不能为空!")
@Size(max=145, message="deptName长度不能超过145")
private String deptName;
@NotNull(message="协(学)会名称不能为空!")
@Size(max=45, message="协(学)会名称长度不能超过45")
private String associationName;
@NotNull(message="协会级别不能为空!")
@Size(max=45, message="协会级别长度不能超过45")
private String associationLevel;
@NotNull(message="变更事项不能为空!")
@Size(max=45, message="变更事项长度不能超过45")
private String changeItem;
@NotNull(message="变更内容不能为空!")
@Size(max=45, message="变更内容长度不能超过45")
private String changeContent;
@NotNull(message="备注不能为空!")
@Size(max=45, message="备注长度不能超过45")
private String remark;
@NotNull(message="creator不能为空!")
@Size(max=45, message="creator长度不能超过45")
private String creator;
@NotNull(message="creatorName不能为空!")
@Size(max=45, message="creatorName长度不能超过45")
private String creatorName;
@NotNull(message="gmtCreate不能为空!")
private Date gmtCreate;
@NotNull(message="gmtModified不能为空!")
private Date gmtModified;
@NotNull(message="isDeleted不能为空!")
private Boolean deleted;
@NotNull(message="isProcessEnd不能为空!")
private Boolean processEnd;
@NotNull(message="processInstanceId不能为空!")
@Size(max=45, message="processInstanceId长度不能超过45")
private String processInstanceId;
} | [
"1129913541@qq.com"
] | 1129913541@qq.com |
6675eaaf314436ca696ce5e48dd27c20b7ab6812 | 66f1882043ef851a0996463ccd02933891f740f5 | /peluqueria/src/main/java/persistencia/dao/interfaz/ClienteDAO.java | c42f003ee4ebd68bc029e90cf935fdc8ade58e6f | [] | no_license | lumusitech/backend-java-desktop-demo-peluqueria-app | 0fa58a48ba1bb7996ffc5dfbdca3fd5ad983880f | ff5d2b54c7b248be554cf55435bb1d0baf3b4d9d | refs/heads/main | 2023-07-28T16:16:39.511791 | 2021-09-17T14:53:59 | 2021-09-17T14:53:59 | 407,580,910 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | package persistencia.dao.interfaz;
import java.util.List;
import dto.ClienteDTO;
public interface ClienteDAO {
public boolean insert(ClienteDTO cliente);
public boolean delete(ClienteDTO cliente);
public boolean update(ClienteDTO cliente);
public boolean used(ClienteDTO cliente);
public List<ClienteDTO> readAll();
public ClienteDTO obtenerDesdeID(int id_cliente_seleccionado);
public ClienteDTO find(String cadenaCliente);
} | [
"lumusitech@gmail.com"
] | lumusitech@gmail.com |
acde3b38fa629399d22234d428ea9db6006ac012 | 7c135f313256e050c75807f989e1aa8d67c7a478 | /deed-core/src/main/java/org/deed/core/server/handler/ServerHandler.java | aef6868fb7ea312b2bdfc7edbb3722f7d9198e9c | [] | no_license | hejianzxl/deed | 8309e1c175276356702f6485805cf00f3a6b92c3 | bafe96a42368dfb1210f256ebc2e645a976acc7e | refs/heads/master | 2022-11-30T01:44:56.921595 | 2018-04-27T09:21:22 | 2018-04-27T09:21:22 | 104,874,575 | 1 | 0 | null | 2022-11-16T08:27:23 | 2017-09-26T11:09:48 | Java | UTF-8 | Java | false | false | 1,463 | java | package org.deed.core.server.handler;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.deed.client.protocol.DeedRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
public class ServerHandler extends SimpleChannelInboundHandler<DeedRequest> {
private static final Logger logger = LoggerFactory.getLogger(ServerHandler.class);
//缓存client channel 引用
private static final Map<Long, Object> handlerMap = new ConcurrentHashMap<>(16);
private static final int DEFAULT_THREAD_POOL_SIZE = Runtime.getRuntime().availableProcessors();
//server端业务线程池
private static ExecutorService threadPoolExecutor = null;
static {
threadPoolExecutor = Executors.newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE);
}
@Override
protected void channelRead0(ChannelHandlerContext chc, DeedRequest request) throws Exception {
/*final ReentrantLock lock = new ReentrantLock();
lock.lockInterruptibly();
try {
handlerMap.put(request.getInvoikeId(), chc);
} finally {
lock.unlock();
}*/
threadPoolExecutor.execute(new InvokeWorker(request,chc));
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
//exception hanlder TODO
cause.printStackTrace();
ctx.close();
}
}
| [
"hejian@jk.cn"
] | hejian@jk.cn |
22603c40a9866b1b5942900d3d320ca083035dbf | 3aaa00401ba728aad8ea58eb91f15f6477153511 | /CoreUiModule/src/main/java/com/cme/coreuimodule/base/widget/ShowAllTextView.java | cfc94999df44a414fc20c799e87fffcea40f9b19 | [] | no_license | xkkk/IntelligentFactory | bac2a5bb79c0e08f261b8d635b5a92c22acf3060 | ff755b9499f5fd889aef1840b9f1236999bdaa49 | refs/heads/master | 2020-04-27T06:00:15.551427 | 2019-03-06T10:01:49 | 2019-03-06T10:01:49 | 174,096,213 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,631 | java | package com.cme.coreuimodule.base.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatTextView;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.TypedValue;
import com.common.coreuimodule.R;
/**
* Created by klx on 2017/8/25.
* 单行,显示所有Text的控件,自动调整文本大小
*/
public class ShowAllTextView extends AppCompatTextView {
// 最小文本大小
private int minTextSize;
public ShowAllTextView(Context context) {
this(context, null);
}
public ShowAllTextView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public ShowAllTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ShowAllTextView);
int minTextSizeSp = a.getInt(R.styleable.ShowAllTextView_minTextSize, 12);
minTextSize = spToPx(minTextSizeSp);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
public void setAutoText(final CharSequence text) {
if (TextUtils.isEmpty(text)) {
return;
}
float textWidth = getPaint().measureText(text.toString());
//可显示文本区域的宽度
int availableTextWidth = getWidth() - getPaddingLeft() - getPaddingRight();
if (availableTextWidth <= 0) {
int resultWidth = 0;
Drawable[] drawables = getCompoundDrawables();
if (drawables.length > 0) {
Drawable drawableLeft = drawables[0];
if (drawableLeft != null) {
resultWidth += drawableLeft.getIntrinsicWidth();
}
}
resultWidth += textWidth;
resultWidth += getCompoundDrawablePadding();
availableTextWidth = resultWidth;
}
if (minTextSize <= getTextSize()) {
while (textWidth > availableTextWidth) {
setTextSize(TypedValue.COMPLEX_UNIT_PX, getTextSize() - 1);
textWidth = getPaint().measureText(text.toString());
}
}
setText(text);
}
private int spToPx(int sp) {
float scale = getContext().getResources().getDisplayMetrics().scaledDensity;
return (int) (sp * scale + 0.5f);
}
}
| [
"xukun1007@163.com"
] | xukun1007@163.com |
a8ebe100216bb53ad7a957f35ea7ef0ae58791b4 | 4e1875c7df2837eb4ef108a6de4ad33774dfc38c | /Core/src/main/java/net/orekyuu/javatter/core/service/EnvironmentServiceImpl.java | ac0c8721bc2e43d479fe4bb54f6d2090fce1c4a6 | [] | no_license | orekyuu/JavaBeamStudio | fcba6bd45cc16dae4b91b7f6907844677eb767bf | 55a7e923206df798872aa541bc7dbe34e0bc7657 | refs/heads/develop | 2021-01-18T22:30:16.941799 | 2016-06-23T03:13:22 | 2016-06-23T03:13:22 | 38,489,168 | 5 | 4 | null | 2016-06-23T03:13:23 | 2015-07-03T11:20:49 | Java | UTF-8 | Java | false | false | 361 | java | package net.orekyuu.javatter.core.service;
import net.orekyuu.javatter.api.service.EnvironmentService;
public class EnvironmentServiceImpl implements EnvironmentService {
@Override
public String getJavaBeamStudioVersion() {
return "1.0.1";
}
@Override
public String getJavaBeamStudioApiVersion() {
return "1.0.1";
}
}
| [
"orekyuu@gmail.com"
] | orekyuu@gmail.com |
871a333bc8bd302e4350c8d59ddc3797329c16c8 | 1e17900597a3a7e8dbc207b3f451b5196de62b97 | /jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/stats/TimeSeriesMax.java | 8a71ade5a48d0d99b6c3907a545738a9162f27e4 | [
"W3C",
"Apache-2.0"
] | permissive | apache/jackrabbit | cf8e918166e6c84740ba3ae7fa68a590e410ee2b | a90a43501fc87e0b8ff6e38a70db8a17e4aeffb6 | refs/heads/trunk | 2023-08-24T02:53:24.324993 | 2023-08-08T04:10:21 | 2023-08-08T04:10:21 | 206,403 | 298 | 251 | Apache-2.0 | 2023-08-22T21:58:06 | 2009-05-21T01:43:24 | Java | UTF-8 | Java | false | false | 4,972 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.jackrabbit.stats;
import static java.util.Arrays.fill;
import org.apache.jackrabbit.api.stats.TimeSeries;
/**
* Time series of the maximum value recorded in a period
*/
public class TimeSeriesMax implements TimeSeries {
private final MaxValue max;
private final long missingValue;
private final long[] perSecond;
private final long[] perMinute;
private final long[] perHour;
private final long[] perWeek;
/** Current second (index in {@link #perSecond}) */
private int seconds;
/** Current minute (index in {@link #perMinute}) */
private int minutes;
/** Current hour (index in {@link #perHour}) */
private int hours;
/** Current week (index in {@link #perWeek}) */
private int weeks;
public TimeSeriesMax() {
this(0);
}
public TimeSeriesMax(long missingValue) {
this.missingValue = missingValue;
max = new MaxValue(missingValue);
perSecond = newArray(60, missingValue);
perMinute = newArray(60, missingValue);
perHour = newArray(7 * 24, missingValue);
perWeek = newArray(3 * 52, missingValue);
}
private static long[] newArray(int size, long value) {
long[] array = new long[size];
fill(array, value);
return array;
}
public void recordValue(long value) {
max.setIfMaximal(value);
}
/**
* Records the number of measured values over the past second and resets
* the counter. This method should be scheduled to be called once per
* second.
*/
public synchronized void recordOneSecond() {
perSecond[seconds++] = max.getAndSetValue(missingValue);
if (seconds == perSecond.length) {
seconds = 0;
perMinute[minutes++] = max(perSecond);
}
if (minutes == perMinute.length) {
minutes = 0;
perHour[hours++] = max(perMinute);
}
if (hours == perHour.length) {
hours = 0;
perWeek[weeks++] = max(perHour);
}
if (weeks == perWeek.length) {
weeks = 0;
}
}
@Override
public long getMissingValue() {
return missingValue;
}
@Override
public synchronized long[] getValuePerSecond() {
return cyclicCopyFrom(perSecond, seconds);
}
@Override
public synchronized long[] getValuePerMinute() {
return cyclicCopyFrom(perMinute, minutes);
}
@Override
public synchronized long[] getValuePerHour() {
return cyclicCopyFrom(perHour, hours);
}
@Override
public synchronized long[] getValuePerWeek() {
return cyclicCopyFrom(perWeek, weeks);
}
/**
* Returns the maximum of all entries in the given array.
*/
private long max(long[] array) {
long max = missingValue;
for (long v : array) {
if (max == missingValue) {
max = v;
} else if (v != missingValue) {
max = Math.max(max, v);
}
}
return max;
}
/**
* Returns a copy of the given cyclical array, with the element at
* the given position as the first element of the returned array.
*
* @param array cyclical array
* @param pos position of the first element
* @return copy of the array
*/
private static long[] cyclicCopyFrom(long[] array, int pos) {
long[] reverse = new long[array.length];
for (int i = 0; i < array.length; i++) {
reverse[i] = array[(pos + i) % array.length];
}
return reverse;
}
private class MaxValue {
private long max;
public MaxValue(long max) {
this.max = max;
}
public synchronized long getAndSetValue(long value) {
long v = max;
max = value;
return v;
}
public synchronized void setIfMaximal(long value) {
if (max == missingValue) {
max = value;
} else if (value != missingValue) {
max = Math.max(max, value);
}
}
}
}
| [
"mduerig@apache.org"
] | mduerig@apache.org |
4918805357a25174b290a2749e871b4f5269aecd | 4222f2648f6b6e7ee88d5520989c01d07e627a9b | /web/src/main/java/com/itacademy/jd2/ai/b2b/web/dto/CategoryDTO.java | 22a23deed6305196a5bb5f4297d2ea7a8b365cb9 | [] | no_license | artemivahno/Instrmental-b2b | fa4c2f2b3118d06bbddad24d5a4fc7916c5e4702 | d1f05583dde19000e814b36ce67b7fe63013ab88 | refs/heads/master | 2020-03-15T17:31:05.855852 | 2018-08-19T20:30:45 | 2018-08-19T20:30:45 | 132,263,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,676 | java | package com.itacademy.jd2.ai.b2b.web.dto;
import java.util.Date;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
public class CategoryDTO {
private Integer id;
@Size(min = 1, max = 50)
private String name;
private String description;
@Min (0)
private Integer position;
private Integer imageId;
private String imageName;
private Date created;
private Date updated;
public Integer getId() {
return id;
}
public void setId(final Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(final String description) {
this.description = description;
}
public Integer getPosition() {
return position;
}
public void setPosition(final Integer position) {
this.position = position;
}
public Integer getImageId() {
return imageId;
}
public void setImageId(final Integer imageId) {
this.imageId = imageId;
}
public String getImageName() {
return imageName;
}
public void setImageName(final String imageName) {
this.imageName = imageName;
}
public Date getCreated() {
return created;
}
public void setCreated(final Date created) {
this.created = created;
}
public Date getUpdated() {
return updated;
}
public void setUpdated(final Date updated) {
this.updated = updated;
}
}
| [
"artsiom.ivahno@gmail.com"
] | artsiom.ivahno@gmail.com |
fe8bd2559120afa31beb248f770f8a9c86ea4801 | f4fb031f70595659a44cee19ac5a745285ffd01e | /Minecraft/src/net/minecraft/src/IBehaviorDispenseItem.java | 4f29de09195ffbbd6306f38018223791be9d8ae2 | [] | no_license | minecraftmuse3/Minecraft | 7adfae39fccbacb8f4e5d9b1b0adf0d3ad9aebc4 | b3efea7d37b530b51bab42b8cf92eeb209697c01 | refs/heads/master | 2021-01-17T21:53:09.461358 | 2013-07-22T13:10:43 | 2013-07-22T13:10:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 227 | java | package net.minecraft.src;
public interface IBehaviorDispenseItem
{
IBehaviorDispenseItem itemDispenseBehaviorProvider = new BehaviorDispenseItemProvider();
ItemStack dispense(IBlockSource var1, ItemStack var2);
}
| [
"sashok7241@gmail.com"
] | sashok7241@gmail.com |
e2bb0a4337cff39be48a204c351258cde7c7389b | dec6bd85db1d028edbbd3bd18fe0ca628eda012e | /netbeans-projects/POO2Uni2AtendimentoComandas/src/Combo/Combo1.java | eb567c0bb5ad5dbc0e8f8fac316d6f20a8b77ca5 | [] | no_license | MatheusGrenfell/java-projects | 21b961697e2c0c6a79389c96b588e142c3f70634 | 93c7bfa2e4f73a232ffde2d38f30a27f2a816061 | refs/heads/master | 2022-12-29T12:55:00.014296 | 2020-10-16T00:54:30 | 2020-10-16T00:54:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 862 | java | package Combo;
import Bebida.Bebida;
import Bebida.Coca;
import PratoPrincipal.Feijao;
import PratoPrincipal.PratoPrincipal;
import Salada.Couve;
import Salada.Salada;
import Sobremesa.SaladaFrutas;
import Sobremesa.Sobremesa;
public class Combo1 implements ComboFactory {
private static Combo1 combo1;
private Combo1() {
}
public static Combo1 getInstance() {
if (combo1 == null) {
combo1 = new Combo1();
}
return combo1;
}
public Bebida getBebida() {
return new Coca();
}
public PratoPrincipal getPratoPricipal() {
return new Feijao();
}
public Salada getSalada() {
return new Couve();
}
public Sobremesa getSobremesa() {
return new SaladaFrutas();
}
@Override
public String toString() {
return "Combo 1";
}
}
| [
"caiohobus@gmail.com"
] | caiohobus@gmail.com |
7ef821e8e203950fbb6d9c5e83b6e70752efe3c9 | 645915b0fb3e084093fbe2d4bdcf63564a7a521e | /java/spring/src/main/java/com/thunisoft/spring/service/IUserService.java | 8e126196ff623b826c18e84e3c8d35b1256481c5 | [] | no_license | arvin-xiao/study | 42dce64c730b609eba9eba38a20735b78b020811 | 0a7761ad49963af60327e615be0b4010053a5c97 | refs/heads/master | 2023-04-29T23:17:23.664183 | 2018-09-25T16:28:47 | 2018-09-25T16:28:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 418 | java | package com.thunisoft.spring.service;
import com.thunisoft.spring.entity.User;
/**
* @Description: 用户业务处理类
* @Author: Administrator
* @CreateDate: 2018/8/28 21:53
*/
public interface IUserService {
/**
* 保存用户
* @param user 用户
*/
void saveUser(User user);
/**
* 查询用户
* @param id 主键
* @return
*/
User getUser(String id);
}
| [
"18328469867@163.com"
] | 18328469867@163.com |
5e50254abcdeea23cc6df79e64a626e1394cb6e0 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Jetty/Jetty3569.java | 8b673df2906b40a05575269d5b8f817c963b1656 | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,562 | java | @Test
public void testNotAccepting() throws Exception
{
_lowResourcesMonitor.setAcceptingInLowResources(false);
Thread.sleep(1200);
_threadPool.setMaxThreads(_threadPool.getThreads()-_threadPool.getIdleThreads()+10);
Thread.sleep(1200);
Assert.assertFalse(_lowResourcesMonitor.isLowOnResources());
for (AbstractConnector c : _server.getBeans(AbstractConnector.class))
assertThat(c.isAccepting(),Matchers.is(true));
final CountDownLatch latch = new CountDownLatch(1);
for (int i=0;i<100;i++)
{
_threadPool.execute(new Runnable()
{
@Override
public void run()
{
try
{
latch.await();
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
});
}
Thread.sleep(1200);
Assert.assertTrue(_lowResourcesMonitor.isLowOnResources());
for (AbstractConnector c : _server.getBeans(AbstractConnector.class))
assertThat(c.isAccepting(),Matchers.is(false));
latch.countDown();
Thread.sleep(1200);
Assert.assertFalse(_lowResourcesMonitor.isLowOnResources());
for (AbstractConnector c : _server.getBeans(AbstractConnector.class))
assertThat(c.isAccepting(),Matchers.is(true));
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
f4f932d75e2d9ffa30a8be7f681168b485ba6adc | f47757c3b9d38003e59b9764ea03d6ae47f405ac | /test/sample/WorkHourTest.java | 053a996f96225798ad590a35ce58a27bf9aef24f | [] | no_license | CaspervD0410/OPT3 | 4df47aac28726ad2a5e6021dc041e52e31db1029 | 595244f915b078e7934cb73d8e215c9141b22a96 | refs/heads/main | 2023-06-02T08:43:13.836465 | 2021-06-14T07:18:30 | 2021-06-14T07:18:30 | 364,842,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,475 | java | package sample;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class WorkHourTest {
Employee emp1 = new Technician("Hank","123",40);
Employee emp2 = new Administration("John","password",30);
Employee emp3 = new Technician("Marc","password123",40);
Employee emp4 = new Supervisor("Dean","P@ssw0rd!",40);
Client vda = new Client("VDA");
@Order(1)
@Test
public void showWorkHours() {
Login.getInstance().setLoggedInUser(emp1);
Client cli1 = new Client("Plus");
//Bij deze test moet er naast de uitkomst van de Assert ook gekeken worden naar de uitgeprinte regels
new WorkHour(DateTimeHandler.checkDateTime("08-05-2021", "07:30", "08:30"), cli1, "Werk");
assertEquals(1.0,emp1.getWorkHours().get(0).getDateAndTime().calcHours(),0.1);
new WorkHour(DateTimeHandler.checkDateTime("03-05-2021", "16:00", "18:00"), cli1, "Werk");
assertEquals(2.0,emp1.getWorkHours().get(1).getDateAndTime().calcHours(),0.1);
new WorkHour(DateTimeHandler.checkDateTime("05-05-2021", "17:00", "19:00"), cli1, "Werk");
assertEquals(2.0,emp1.getWorkHours().get(2).getDateAndTime().calcHours(),0.1);
new WorkHour(DateTimeHandler.checkDateTime("08-05-2021", "16:45", "17:15"), cli1, "Werk");
assertEquals(0.5,emp1.getWorkHours().get(3).getDateAndTime().calcHours(),0.1);
new WorkHour(DateTimeHandler.checkDateTime("04-05-2021", "08:00", "09:00"), cli1, "Werk");
assertEquals(1.0,emp1.getWorkHours().get(4).getDateAndTime().calcHours(),0.1);
new WorkHour(DateTimeHandler.checkDateTime("09-05-2021", "02:00", "02:15"), cli1, "Werk");
assertEquals(0.25,emp1.getWorkHours().get(5).getDateAndTime().calcHours(),0.1);
new WorkHour(DateTimeHandler.checkDateTime("09-05-2021", "13:00", "14:15"), cli1, "Werk");
assertEquals(1.25,emp1.getWorkHours().get(6).getDateAndTime().calcHours(),0.1);
new WorkHour(DateTimeHandler.checkDateTime("03-05-2021", "08:31", "16:59"), cli1, "Werk");
assertEquals(8.47,emp1.getWorkHours().get(7).getDateAndTime().calcHours(),0.1);
new WorkHour(DateTimeHandler.checkDateTime("05-05-2021", "08:29", "08:31"), cli1, "Werk");
assertEquals(0.03,emp1.getWorkHours().get(8).getDateAndTime().calcHours(),0.1);
new WorkHour(DateTimeHandler.checkDateTime("07-05-2021", "16:59", "17:01"), cli1, "Werk");
assertEquals(0.03,emp1.getWorkHours().get(9).getDateAndTime().calcHours(),0.1);
}
@Order(2)
@Test
public void checkWorkHour() {
Login.getInstance().setLoggedInUser(emp1);
assertTrue(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime("06-05-2021", "10:00", "15:00"), "Plus", "Werk"));
assertFalse(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime("06-05-2021", "10:00", "15:00"), "glopr", "Werk"));
assertFalse(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime("05-12-2028", "10:00", "15:00"), "Plus", "Werk"));
assertFalse(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime("06-05-2021", "10:00", "08:00"), "Plus", "Werk"));
}
@Order(3)
@Test
public void checkWorkHoursTest() {
Login.getInstance().setLoggedInUser(emp3);
assertTrue(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime("08-05-2021", "08:30", "09:00"), "Plus", "Werk"));
assertTrue(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime("08-05-2021", "09:00", "09:30"), "VDA", "Vrij"));
assertTrue(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime(null,"09:30", "10:00"), "VDA", "Werk"));
Login.getInstance().setLoggedInUser(emp1);
assertTrue(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime("08-05-2021", "10:00", "10:30"), "VDA", "Werk"));
assertFalse(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime(null,"10:30", "11:00"), "Plus", "Vrij"));
assertTrue(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime(null,"11:00", "11:30"), "VDA", "Werk"));
Login.getInstance().setLoggedInUser(emp2);
assertTrue(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime("08-05-2021", "11:30", "12:00"), "VDA", "Werk"));
assertFalse(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime("08-05-2021","12:00","12:30"),"Plus","Werk"));
assertTrue(WorkHour.checkWorkHour(DateTimeHandler.checkDateTime(null,"12:30","13:00"),"VDA","Vrij"));
}
} | [
"Casper@vdavis.local"
] | Casper@vdavis.local |
a7f5c918747e73bee117a8644ae6bc4fcede2241 | 5120b826c0b659cc609e7cecdf9718aba243dfb0 | /platform_only_recipe/hybris/bin/platform/ext/core/testsrc/de/hybris/platform/directpersistence/selfhealing/impl/DefaultSelfHealingServiceTest.java | d45404c5758643e522f2465ad7b933aebbe4e25b | [] | no_license | miztli/hybris | 8447c85555676742b524aee901a5f559189a469a | ff84a5089a0d99899672e60c3a60436ab8bf7554 | refs/heads/master | 2022-10-26T07:21:44.657487 | 2019-05-28T20:30:10 | 2019-05-28T20:30:10 | 186,463,896 | 1 | 0 | null | 2022-09-16T18:38:27 | 2019-05-13T17:13:05 | Java | UTF-8 | Java | false | false | 10,422 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package de.hybris.platform.directpersistence.selfhealing.impl;
import static java.util.stream.Collectors.toList;
import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Mockito.verify;
import de.hybris.bootstrap.annotations.IntegrationTest;
import de.hybris.platform.catalog.model.CatalogModel;
import de.hybris.platform.catalog.model.CatalogVersionModel;
import de.hybris.platform.catalog.model.CompanyModel;
import de.hybris.platform.core.PK;
import de.hybris.platform.core.model.type.AttributeDescriptorModel;
import de.hybris.platform.core.model.type.ComposedTypeModel;
import de.hybris.platform.core.model.user.CustomerModel;
import de.hybris.platform.directpersistence.ChangeSet;
import de.hybris.platform.directpersistence.WritePersistenceGateway;
import de.hybris.platform.directpersistence.selfhealing.ItemToHeal;
import de.hybris.platform.directpersistence.statement.backend.ServiceCol;
import de.hybris.platform.directpersistence.statement.sql.FluentSqlBuilder;
import de.hybris.platform.jalo.Item;
import de.hybris.platform.persistence.property.JDBCValueMappings;
import de.hybris.platform.servicelayer.ServicelayerBaseTest;
import de.hybris.platform.servicelayer.model.ModelService;
import de.hybris.platform.servicelayer.type.TypeService;
import de.hybris.platform.test.TestThreadsHolder;
import de.hybris.platform.util.ItemPropertyValue;
import de.hybris.platform.util.ItemPropertyValueCollection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.stream.LongStream;
import javax.annotation.Resource;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
import org.springframework.jdbc.core.JdbcTemplate;
import com.google.common.collect.Sets;
@IntegrationTest
public class DefaultSelfHealingServiceTest extends ServicelayerBaseTest
{
private static final String TABLE_A = "tableA";
private static final String COLUMN_A1 = "columnA1";
private static final String COLUMN_A2 = "columnA2";
private static final String TABLE_B = "tableB";
private static final String COLUMN_B1 = "columnB1";
private static final String COLUMN_B2 = "columnB2";
@Resource
private WritePersistenceGateway writePersistenceGateway;
@Resource
private ModelService modelService;
@Resource
private TypeService typeService;
@Resource
private JdbcTemplate jdbcTemplate;
private DefaultSelfHealingService selfHealingService;
private List<Long> range;
@Before
public void setup()
{
range = createRange();
selfHealingService = new DefaultSelfHealingService();
selfHealingService.setWritePersistenceGateway(writePersistenceGateway);
selfHealingService.setBatchLimit(10000);
// we *don't* want the background process to start -> therefore we *don't* call afterPropertiesSet() which would start it!
selfHealingService.setEnabled(true);
}
@Test
public void shouldReferencedValueBeNullWhenReferencedModelIsRemoved()
{
//given
final CatalogModel catalogModel = modelService.create(CatalogModel.class);
catalogModel.setId("id");
final CompanyModel companyModel = modelService.create(CompanyModel.class);
companyModel.setId("id_comp");
companyModel.setUid("id_comp");
catalogModel.setBuyer(companyModel);
modelService.saveAll();
//when
modelService.remove(companyModel);
final ItemToHeal catalogToHeal = new ItemToHeal(catalogModel.getPk(), CatalogModel._TYPECODE, CatalogModel.BUYER,
((Item) modelService.getSource(catalogModel)).getPersistenceVersion(), null);
selfHealingService.addItemToHeal(catalogToHeal);
selfHealingService.batchItems();
//then
final AttributeDescriptorModel attrDescBuyer = typeService.getAttributeDescriptor(CatalogModel._TYPECODE,
CatalogModel.BUYER);
final String sql = FluentSqlBuilder.genericBuilder().select(attrDescBuyer.getDatabaseColumn())
.from(attrDescBuyer.getEnclosingType().getTable()).where().field(ServiceCol.PK_STRING.colName()).isEqual().toSql();
final String persistedBuyer = jdbcTemplate.queryForObject(sql, new Object[]
{ catalogToHeal.getPk().getLong() }, String.class);
assertThat(persistedBuyer).isNullOrEmpty();
}
@Test
public void shouldNotIncrementVersionWhenPersisted()
{
//given
final CatalogModel catalogModel = modelService.create(CatalogModel.class);
catalogModel.setId("id");
final CompanyModel companyModel = modelService.create(CompanyModel.class);
companyModel.setId("id_comp");
companyModel.setUid("id_comp");
catalogModel.setBuyer(companyModel);
modelService.saveAll();
//when
final Long version = Long.valueOf(3);
final ItemToHeal catalogToHeal = new ItemToHeal(catalogModel.getPk(), CatalogModel._TYPECODE, CatalogModel.BUYER,
version.longValue(), null);
selfHealingService.addItemToHeal(catalogToHeal);
selfHealingService.batchItems();
//then
final ComposedTypeModel composedTypeModel = typeService.getComposedTypeForClass(CatalogModel.class);
final String sql = FluentSqlBuilder.genericBuilder().select(ServiceCol.HJMP_TS.colName()).from(composedTypeModel.getTable())
.where().field(ServiceCol.PK_STRING.colName()).isEqual().toSql();
final Long persistedBuyer = jdbcTemplate.queryForObject(sql, new Object[]
{ catalogToHeal.getPk().getLong() }, Long.class);
assertThat(persistedBuyer).isEqualTo(version);
}
@Test
public void shouldRefencedCollecionValueChangeWhenReferencedModelCollectionChanged()
{
//given
final CatalogModel catalogModel = modelService.create(CatalogModel.class);
catalogModel.setId("id_catalog");
final CatalogVersionModel catalogVersionModel1 = modelService.create(CatalogVersionModel.class);
catalogVersionModel1.setCatalog(catalogModel);
catalogVersionModel1.setVersion("version1");
final CatalogVersionModel catalogVersionModel2 = modelService.create(CatalogVersionModel.class);
catalogVersionModel2.setCatalog(catalogModel);
catalogVersionModel2.setVersion("version2");
final CustomerModel customerModel = modelService.create(CustomerModel.class);
customerModel.setUid("uid_customer");
customerModel.setPreviewCatalogVersions(Sets.newHashSet(catalogVersionModel1, catalogVersionModel2));
modelService.saveAll();
assertThat(customerModel.getPreviewCatalogVersions()).hasSize(2);
//when
modelService.remove(catalogVersionModel2);
final ItemPropertyValue catalogVersionModel1ItemPropertyValue = new ItemPropertyValue(catalogVersionModel1.getPk());
/*
* Uses Jalo which has it own health healing service. Use JDBCTemplate to verify data instead.
*
* modelService.refresh(customerModel);
*/
final ItemPropertyValueCollection itemPropertyValueCollection = new ItemPropertyValueCollection(
Sets.newHashSet(catalogVersionModel1ItemPropertyValue));
final ItemToHeal custumerToHeal = new ItemToHeal(customerModel.getPk(), CustomerModel._TYPECODE,
CustomerModel.PREVIEWCATALOGVERSIONS, ((Item) modelService.getSource(customerModel)).getPersistenceVersion(),
itemPropertyValueCollection);
selfHealingService.addItemToHeal(custumerToHeal);
selfHealingService.batchItems();
//then
final AttributeDescriptorModel attrDescPreviewCatalogVersions = typeService.getAttributeDescriptor(CustomerModel._TYPECODE,
CustomerModel.PREVIEWCATALOGVERSIONS);
final String sql = FluentSqlBuilder.genericBuilder().select(attrDescPreviewCatalogVersions.getDatabaseColumn())
.from(attrDescPreviewCatalogVersions.getEnclosingType().getTable()).where().field(ServiceCol.PK_STRING.colName())
.isEqual().toSql();
final String persistedPreviewCatalogVersionsDbValue = jdbcTemplate.queryForObject(sql, new Object[]
{ custumerToHeal.getPk().getLong() }, String.class);
final ItemPropertyValueCollection itemPropValueCollection = (ItemPropertyValueCollection) JDBCValueMappings.getInstance()
.getValueReader(ItemPropertyValueCollection.class).convertValueToJava(persistedPreviewCatalogVersionsDbValue);
assertThat(itemPropValueCollection).containsExactly(catalogVersionModel1ItemPropertyValue);
}
@Test
public void shouldKeepWorkingWhenConcurrentItemAdditionsOccure() throws InterruptedException, ExecutionException
{
//given
final WritePersistenceGateway mock = Mockito.mock(WritePersistenceGateway.class);
selfHealingService.setWritePersistenceGateway(mock);
//when
final TestThreadsHolder<Runnable> holderA1 = new TestThreadsHolder<>(10,
() -> range.forEach(l -> selfHealingService.addItemToHeal(createItemToHeal(l, TABLE_A, COLUMN_A1))));
final TestThreadsHolder<Runnable> holderA2 = new TestThreadsHolder<>(10,
() -> range.forEach(l -> selfHealingService.addItemToHeal(createItemToHeal(l, TABLE_A, COLUMN_A2))));
final TestThreadsHolder<Runnable> holderB1 = new TestThreadsHolder<>(10,
() -> range.forEach(l -> selfHealingService.addItemToHeal(createItemToHeal(l, TABLE_B, COLUMN_B1))));
final TestThreadsHolder<Runnable> holderB2 = new TestThreadsHolder<>(10,
() -> range.forEach(l -> selfHealingService.addItemToHeal(createItemToHeal(l, TABLE_B, COLUMN_B2))));
holderA1.startAll();
holderA2.startAll();
holderB1.startAll();
holderB2.startAll();
holderA1.waitForAll(20, TimeUnit.SECONDS);
holderA2.waitForAll(20, TimeUnit.SECONDS);
holderB1.waitForAll(20, TimeUnit.SECONDS);
holderB2.waitForAll(20, TimeUnit.SECONDS);
selfHealingService.batchItems();
//then
final ArgumentCaptor<ChangeSet> changeSetCaptor = ArgumentCaptor.forClass(ChangeSet.class);
verify(mock).persist(changeSetCaptor.capture());
assertThat(changeSetCaptor.getValue().getEntityRecords()).hasSize(10000);
}
private List<Long> createRange()
{
final List<Long> range = LongStream.range(1, 1000).boxed().collect(toList());
Collections.shuffle(range);
return range;
}
private static ItemToHeal createItemToHeal(final Long l, final String type, final String attribute)
{
return new ItemToHeal(PK.fromLong(l.longValue()), type, attribute, l.longValue(), l);
}
}
| [
"miztlimelgoza@miztlis-MacBook-Pro.local"
] | miztlimelgoza@miztlis-MacBook-Pro.local |
04fc59e5f964863575d662ca3197534f0f3a3a76 | d44c2bfe44ba51dd7e5acfb7b59d5cd1203316a0 | /02/backend/src/main/java/br/jus/trt22/demo/modelo/Advogado.java | 497ca864e6eda01a0bf82dad98692e42df32130d | [] | no_license | lucassimao/curso-trt22 | 7b347a15198cd94deb9b7c1e37b9bcc56fd9b899 | 7608c17e031f38ad93c2eea979b2c8546ed9f7c5 | refs/heads/master | 2022-12-23T10:27:55.273335 | 2019-08-21T20:08:19 | 2019-08-21T20:08:19 | 201,864,218 | 0 | 0 | null | 2022-12-16T00:38:54 | 2019-08-12T05:34:34 | HTML | UTF-8 | Java | false | false | 3,829 | java | package br.jus.trt22.demo.modelo;
import java.util.List;
import java.util.Objects;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
/**
* Advogado
*/
@Entity
@Table(schema = "public")
public class Advogado {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotEmpty
private String nome;
@Email
@NotEmpty
private String email;
@NotEmpty
@Pattern(regexp = "([a-zA-Z0-9]{4}\\-[a-zA-Z]{2}$)", message = "O nº OAB deve ter o formato [a-zA-Z0-9]{4}-[a-zA-Z]{2}")
private String oab;
@NotEmpty
private String telefone;
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
private List<Processo> processos;
public Advogado() {
}
public Advogado(Long id, String nome, String email, String oab, String telefone, List<Processo> processos) {
this.id = id;
this.nome = nome;
this.email = email;
this.oab = oab;
this.telefone = telefone;
this.processos = processos;
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return this.nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public String getOab() {
return this.oab;
}
public void setOab(String oab) {
this.oab = oab;
}
public String getTelefone() {
return this.telefone;
}
public void setTelefone(String telefone) {
this.telefone = telefone;
}
public List<Processo> getProcessos() {
return this.processos;
}
public void setProcessos(List<Processo> processos) {
this.processos = processos;
}
public Advogado id(Long id) {
this.id = id;
return this;
}
public Advogado nome(String nome) {
this.nome = nome;
return this;
}
public Advogado email(String email) {
this.email = email;
return this;
}
public Advogado oab(String oab) {
this.oab = oab;
return this;
}
public Advogado telefone(String telefone) {
this.telefone = telefone;
return this;
}
public Advogado processos(List<Processo> processos) {
this.processos = processos;
return this;
}
@Override
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof Advogado)) {
return false;
}
Advogado advogado = (Advogado) o;
return Objects.equals(id, advogado.id) && Objects.equals(nome, advogado.nome) && Objects.equals(email, advogado.email) && Objects.equals(oab, advogado.oab) && Objects.equals(telefone, advogado.telefone) && Objects.equals(processos, advogado.processos);
}
@Override
public int hashCode() {
return Objects.hash(id, nome, email, oab, telefone, processos);
}
@Override
public String toString() {
return "{" +
" id='" + getId() + "'" +
", nome='" + getNome() + "'" +
", email='" + getEmail() + "'" +
", oab='" + getOab() + "'" +
", telefone='" + getTelefone() + "'" +
", processos='" + getProcessos() + "'" +
"}";
}
} | [
"Lucas Simao"
] | Lucas Simao |
ebce7fa587c10a4719d3578d6e13d0c9c5ff408d | ccc3268554528f5ed5cc119bbd88cfc45b55691d | /java/l2p/gameserver/data/xml/holder/StaticObjectHolder.java | bea72e580c44ce88b75da8d7dae7262a013e6e36 | [] | no_license | trickititit/java-source | 447ea16c2892377a4625f742118ebfd4e3116848 | 724453441846ce44e65372100a70770f21572837 | refs/heads/master | 2021-01-18T09:38:01.836585 | 2016-09-17T17:43:34 | 2016-09-17T17:43:34 | 68,445,261 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,551 | java | package l2p.gameserver.data.xml.holder;
import l2p.commons.data.xml.AbstractHolder;
import l2p.gameserver.model.instances.StaticObjectInstance;
import l2p.gameserver.templates.StaticObjectTemplate;
import org.napile.primitive.maps.IntObjectMap;
import org.napile.primitive.maps.impl.HashIntObjectMap;
/**
* @author VISTALL
* @date 22:21/09.03.2011
*/
public final class StaticObjectHolder extends AbstractHolder {
private static final StaticObjectHolder _instance = new StaticObjectHolder();
private IntObjectMap<StaticObjectTemplate> _templates = new HashIntObjectMap<>();
private IntObjectMap<StaticObjectInstance> _spawned = new HashIntObjectMap<>();
public static StaticObjectHolder getInstance() {
return _instance;
}
public void addTemplate(StaticObjectTemplate template) {
_templates.put(template.getUId(), template);
}
public StaticObjectTemplate getTemplate(int id) {
return _templates.get(id);
}
public void spawnAll() {
_templates.values().stream().filter(template -> template.isSpawn()).forEach(template -> {
StaticObjectInstance obj = template.newInstance();
_spawned.put(template.getUId(), obj);
});
info("spawned: " + _spawned.size() + " static object(s).");
}
public StaticObjectInstance getObject(int id) {
return _spawned.get(id);
}
@Override
public int size() {
return _templates.size();
}
@Override
public void clear() {
_templates.clear();
}
}
| [
"trickititit@gmail.com"
] | trickititit@gmail.com |
35add4ef5a8e9862ec5d3116f7b45f9cda509cb8 | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.alpenglow-EnterpriseServer/sources/X/C06590nP.java | 81cf7db4b8b251cff36f16d7f95f5099dd0c8050 | [] | 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 | 716 | java | package X;
import java.io.IOException;
/* renamed from: X.0nP reason: invalid class name and case insensitive filesystem */
public final class C06590nP {
public Object A00;
public final Object A01;
public final void A00(Object obj) throws IOException {
if (this.A00 == null) {
this.A00 = obj;
return;
}
StringBuilder sb = new StringBuilder("Already had POJO for id (");
Object obj2 = this.A01;
sb.append(obj2.getClass().getName());
sb.append(") [");
sb.append(obj2);
sb.append("]");
throw new IllegalStateException(sb.toString());
}
public C06590nP(Object obj) {
this.A01 = obj;
}
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
f1280876b720c15bbd40e037ee297a1f4ec4f964 | ca21b8175b688de88cdb75cdeacb4c94231b8a8a | /Flight/src/FindingFlight.java | 64c78f4ec7aa6eeec93844b947ae2c31d9e77403 | [] | no_license | Shravya-Kasturi/testing | 51321a8d0f74e74e82730144cb5bca303a471ecf | 1db1262e56da877f73b3a04bf6ee79abeb8a9631 | refs/heads/master | 2021-01-01T16:58:47.174491 | 2017-07-21T17:25:26 | 2017-07-21T17:25:26 | 97,968,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,908 | java | import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Random;
import java.util.Scanner;
import java.util.logging.*;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
class FindingFlight {
public static Logger LOGGER = Logger.getLogger(FindingFlight.class.getName());
String filepath1;
String filepath2;
Workbook wb;
FileInputStream fs1;
FileInputStream fs2;
Sheet sh;
Scanner sc;
FindingFlight()
{
filepath1="C:\\Users\\Sheshu\\Documents\\Book125.xls";
filepath2="C:\\Users\\Sheshu\\Documents\\Flightseries1.xls";
try{
sc=new Scanner(System.in);
fs1 = new FileInputStream(filepath1);
fs2=new FileInputStream(filepath2);
wb = Workbook.getWorkbook(fs2);
sh = wb.getSheet(0);
}
catch(FileNotFoundException fn)
{
LOGGER.log(Level.SEVERE, "Exception occur", fn);
}
catch(BiffException exe){
LOGGER.log(Level.SEVERE, "Exception occur", exe);
}
catch(IOException ex){
LOGGER.log(Level.SEVERE, "Exception occur", ex);
}
}
String Flight_checking(String pnr) throws BadWeather
{
String fligt=pnr.substring(0,2);
//System.out.println("from pnr d clue about flight is "+fligt);
Cell c=sh.findCell(fligt);
int r=0;
if(c!=null)
{r=c.getRow();
System.out.println(r);
}
System.out.println("your flight is from "+sh.getCell(1,r).getContents()+" and goes to "+sh.getCell(2,r).getContents());
try{controlStation();}
finally{
System.out.println("contact control station");
}
return fligt;
}
void controlStation() throws BadWeather{
try{
Random rand=new Random();
int weather_stability=rand.nextInt(3);
if(weather_stability==3)
throw new BadWeather();
}
finally{
System.out.println("Check the Weather condition");
}
}
}
| [
"chittishravi123@gmail.com"
] | chittishravi123@gmail.com |
27610e08746a99f5e996d11dc4913b1658c68d12 | de081ea251c8cb67b3a901d6514a341c84cc55fa | /domain/src/main/java/com/og/todo/domain/model/BaseModel.java | 20d2778db04dc09464de8c9a428f9af1435bbfb7 | [] | no_license | testneer/MyTodo | 798a923df8eeff6ead7266572c35ad16d55a4f37 | 1b771eea04cbe3aafc8dbdcc6132bb76adfc841a | refs/heads/master | 2021-01-15T10:42:08.619139 | 2017-08-20T04:07:04 | 2017-08-20T04:07:04 | 99,593,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 117 | java | package com.og.todo.domain.model;
/**
*
* Created by orenegauthier on 10/08/2017.
*/
public class BaseModel {
}
| [
"ogauthier@corp.badoo.com"
] | ogauthier@corp.badoo.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.