blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 390 | content_id stringlengths 40 40 | detected_licenses listlengths 0 35 | license_type stringclasses 2 values | repo_name stringlengths 6 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 539 values | visit_date timestamp[us]date 2016-08-02 21:09:20 2023-09-06 10:10:07 | revision_date timestamp[us]date 1990-01-30 01:55:47 2023-09-05 21:45:37 | committer_date timestamp[us]date 2003-07-12 18:48:29 2023-09-05 21:45:37 | github_id int64 7.28k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 13 values | gha_event_created_at timestamp[us]date 2012-06-11 04:05:37 2023-09-14 21:59:18 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-28 02:39:21 ⌀ | gha_language stringclasses 62 values | src_encoding stringclasses 26 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 128 12.8k | extension stringclasses 11 values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 79 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a60e14c693b07a74d9eeb285867bf9dbe792ecdf | 10f30ea0bd56dcd8ae0a3e6efa1baec77ab0d89a | /JaDX/src/ua/naiksoftware/jadx/utils/exceptions/DecodeException.java | 1aa575f2ebca24ba3715d50a5d892245304af5c2 | [
"Apache-2.0"
] | permissive | CurioussX13/jadx | e6a3ac9c14681078b6b9200262d15982a22fff01 | 1256e46e247619ae3ca98a98c4b7b2bab24d786f | refs/heads/master | 2021-04-13T06:17:21.015752 | 2020-03-22T08:38:32 | 2020-03-22T08:38:32 | 249,142,793 | 0 | 0 | null | 2020-03-22T08:32:59 | 2020-03-22T08:32:59 | null | UTF-8 | Java | false | false | 523 | java | package jadx.utils.exceptions;
import jadx.dex.nodes.MethodNode;
public class DecodeException extends JadxException {
private static final long serialVersionUID = -6611189094923499636L;
public DecodeException(String message) {
super(message);
}
public DecodeException(String message, Throwable cause) {
super(message, cause);
}
public DecodeException(MethodNode mth, String msg) {
super(mth, msg, null);
}
public DecodeException(MethodNode mth, String msg, Throwable th) {
super(mth, msg, th);
}
}
| [
"skylot@gmail.com"
] | skylot@gmail.com |
6300cf5812ea8b239fb864e5de3e73746cb22af4 | 262b91ee24fd9ff49aa0f74aa9f3867cb13b63e8 | /USACO/Training/Chapter2/Section4/ttwo.java | 5d996af13d1ce2e790cc7c274b39cc82e2cbd203 | [] | no_license | Senpat/Competitive-Programming | ec169b1ed9ee85186768b72479b38391df9234b3 | d13731811eb310fb3d839e9a8e8200975d926321 | refs/heads/master | 2023-06-23T01:25:35.209727 | 2023-06-15T02:55:48 | 2023-06-15T02:55:48 | 146,513,522 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,102 | java | /*
TASK: ttwo
LANG: JAVA
*/
import java.io.*;
import java.util.*;
class ttwo{
public static void main(String[] args) throws IOException{
BufferedReader f = new BufferedReader(new FileReader("ttwo.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("ttwo.out")));
int N = 10;
char[][] board = new char[N][N];
//0 -> north, 1 -> east, 2 -> south, 3 -> west
int[] dx = new int[]{-1,0,1,0};
int[] dy = new int[]{0,1,0,-1};
int cx = -1;
int cy = -1;
int fx = -1;
int fy = -1;
for(int k = 0; k < N; k++){
String s = f.readLine();
for(int j = 0; j < N; j++){
board[k][j] = s.charAt(j);
if(board[k][j] == 'C'){
cx = k;
cy = j;
}
if(board[k][j] == 'F'){
fx = k;
fy = j;
}
}
}
boolean[][][][][][] seen = new boolean[N][N][N][N][4][4];
int time = 0;
int cdir = 0;
int fdir = 0;
while(true){
if(cx == fx && cy == fy){
break;
}
if(seen[cx][cy][fx][fy][cdir][fdir]){
time = -1;
break;
}
seen[cx][cy][fx][fy][cdir][fdir] = true;
if(!in(cx+dx[cdir],cy+dy[cdir]) || board[cx+dx[cdir]][cy+dy[cdir]] == '*'){
cdir = (cdir + 1)%4;
} else {
cx += dx[cdir];
cy += dy[cdir];
}
if(!in(fx+dx[fdir],fy+dy[fdir]) || board[fx+dx[fdir]][fy+dy[fdir]] == '*'){
fdir = (fdir + 1)%4;
} else {
fx += dx[fdir];
fy += dy[fdir];
}
time++;
}
if(time == -1){
out.println(0);
} else {
out.println(time);
}
out.close();
}
public static boolean in(int x, int y){
return x >= 0 && x < 10 && y >= 0 && y < 10;
}
} | [
"pgz11902@gmail.com"
] | pgz11902@gmail.com |
742b0fc103622fa011ca0943c80363495cc3916d | 0f5124795d0a7e16040c9adfc0f562326f17a767 | /steven-redis/src/main/java/com/steven/redis/entity/User.java | 17f4713f5c4ac182798fa4a59367f183ff0465df | [] | no_license | frank-mumu/steven-parent | b0fd7d52dfe5bab6f33c752efa132862f46cea54 | faca8295aac1da943bd4d4dd992debef6d537be7 | refs/heads/master | 2023-05-27T00:17:44.996281 | 2019-10-24T05:59:35 | 2019-10-24T05:59:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 769 | java | package com.steven.redis.entity;
/**
* Created by Steven on 2017/5/16.
*/
public class User {
private Long id;
private String firstName;
private String lastName;
public User(Long id,String firstName, String lastName) {
this.id = id ;
this.firstName = firstName;
this.lastName = lastName;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
| [
"918273244@qq.com"
] | 918273244@qq.com |
6051ec3cc4bbe9bfb12affc401e3e84574c112ea | 5d220b8cbe0bcab98414349ac79b449ec2a5bdcf | /src/com/ufgov/zc/server/zc/dao/ibatis/ZcEbEntrustBulletinDao.java | 9366aaaef2173b2d60c1455ce0be6ee86cb84737 | [] | no_license | jielen/puer | fd18bdeeb0d48c8848dc2ab59629f9bbc7a5633e | 0f56365e7bb8364f3d1b4daca0591d0322f7c1aa | refs/heads/master | 2020-04-06T03:41:08.173645 | 2018-04-15T01:31:56 | 2018-04-15T01:31:56 | 63,419,454 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,039 | java | package com.ufgov.zc.server.zc.dao.ibatis;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import com.ufgov.zc.common.system.RequestMeta;
import com.ufgov.zc.common.system.constants.NumLimConstants;
import com.ufgov.zc.common.system.constants.ZcSettingConstants;
import com.ufgov.zc.common.system.dto.ElementConditionDto;
import com.ufgov.zc.common.zc.model.ZcEbProjPrintPermit;
import com.ufgov.zc.common.zc.model.ZcEbProjSupport;
import com.ufgov.zc.common.zc.model.ZcEbSupplier;
import com.ufgov.zc.server.system.util.NumLimUtil;
import com.ufgov.zc.server.zc.dao.IZcEbEntrustBulletinDao;
public class ZcEbEntrustBulletinDao extends SqlMapClientDaoSupport implements IZcEbEntrustBulletinDao {
/**
* <p> 获取已下达的采购任务 </p>
* @param dto
* @return
* @see com.ufgov.zc.server.zc.dao.IZcEbEntrustBulletinDao#getZcEbEntrustBull(com.ufgov.zc.common.system.dto.ElementConditionDto)
* @author yuzz
* @since Sep 15, 2012 9:16:47 AM
*/
public List getZcEbEntrustBull(ElementConditionDto dto, RequestMeta meta) {
dto.setNumLimitStr(NumLimUtil.getInstance().getNumLimCondByCoType(dto.getWfcompoId(), NumLimConstants.FWATCH));
return this.getSqlMapClientTemplate().queryForList("ZcEbEntrustBull.getZcEbEntrustBullList", dto);
}
/**
* <p> 获取已上网的采购任务 </p>
* @param dto
* @return
* @see com.ufgov.zc.server.zc.dao.IZcEbEntrustBulletinDao#getZcEbEntrustBullin(com.ufgov.zc.common.system.dto.ElementConditionDto)
* @author yuzz
* @since Sep 15, 2012 9:17:16 AM
*/
public List getZcEbEntrustBullin(ElementConditionDto dto, RequestMeta meta) {
dto.setNumLimitStr(NumLimUtil.getInstance().getNumLimCondByCoType(dto.getWfcompoId(), NumLimConstants.FWATCH));
return this.getSqlMapClientTemplate().queryForList("ZcEbEntrustBull.getZcEbEntrustBullinList", dto);
}
/**
* <p> 获取已完成的采购任务 </p>
* @param dto
* @return
* @see com.ufgov.zc.server.zc.dao.IZcEbEntrustBulletinDao#getZcEbEntrustReport(com.ufgov.zc.common.system.dto.ElementConditionDto)
* @author yuzz
* @since Sep 15, 2012 9:17:22 AM
*/
public List getZcEbEntrustReport(ElementConditionDto dto, RequestMeta meta) {
dto.setNumLimitStr(NumLimUtil.getInstance().getNumLimCondByCoType(dto.getWfcompoId(), NumLimConstants.FWATCH));
return this.getSqlMapClientTemplate().queryForList("ZcEbEntrustBull.getZcEbEntrustReportList", dto);
}
/**
* <p> 获取招标项目情况 </p>
* @param dto
* @return
* @see com.ufgov.zc.server.zc.dao.IZcEbEntrustBulletinDao#getZcEbProjectSupport(com.ufgov.zc.common.system.dto.ElementConditionDto)
* @author yuzz
* @since Sep 19, 2012 3:10:05 PM
*/
public List getZcEbProjectSupport(ElementConditionDto dto, RequestMeta meta) {
dto.setNumLimitStr(NumLimUtil.getInstance().getNumLimCondByCoType(dto.getWfcompoId(), NumLimConstants.FWATCH));
return this.getSqlMapClientTemplate().queryForList("ZcEbEntrustBull.getZcEbProjSupportList", dto);
}
public void deletePrintPermit(ZcEbProjPrintPermit proj) {
this.getSqlMapClientTemplate().delete("ZcEbEntrustBull.deletePrintPermit", proj);
}
public void insertPrintPermit(ZcEbProjPrintPermit proj) {
this.getSqlMapClientTemplate().insert("ZcEbEntrustBull.insertPrintPermit", proj);
}
public void updatePrintPermit(ZcEbProjPrintPermit proj) {
this.getSqlMapClientTemplate().update("ZcEbEntrustBull.updatePrintPermit", proj);
}
public List getZcEbProjPrintPermit(ZcEbProjPrintPermit proj) {
ElementConditionDto dto = new ElementConditionDto();
dto.setProjCode(proj.getProjCode());
return this.getSqlMapClientTemplate().queryForList("ZcEbEntrustBull.getZcEbProjPrintPermitList", dto);
}
public void updateSupplierIsSite(final List zcEbProjSupportList) {
for (int i = 0; i < zcEbProjSupportList.size(); i++) {
ZcEbProjSupport result = (ZcEbProjSupport) zcEbProjSupportList.get(i);
System.out.println(result.getZcEbSupplier().getCode());
this.getSqlMapClientTemplate().update("ZcEbEntrustBull.updateZcEbSignupIsSite", result);
}
}
/**
* <p>Description:判断冻结供应商</p>
* @param zcEbProjSupportList
* @return
* @see com.ufgov.zc.server.zc.dao.IZcEbEntrustBulletinDao#frozenZcBSupplier(java.util.List)
* @author yuzz
* @since Nov 23, 2012 2:42:09 PM
*/
public List frozenZcBSupplier(List zcEbProjSupportList) {
List frozenLst = new ArrayList();
for (int i = 0; i < zcEbProjSupportList.size(); i++) {
ZcEbProjSupport result = (ZcEbProjSupport) zcEbProjSupportList.get(i);
if (ZcSettingConstants.IS_SITE_N.equals(result.getIsSite())) {
List lst = findZcEbSignupSite(result);
if (lst.size() != 0 && lst.size() % 3 == 0) {
ZcEbSupplier sup = new ZcEbSupplier();
sup.setCode(result.getZcEbSupplier().getCode());
sup.setZcAuditDate(new Date());
sup.setStatus(ZcSettingConstants.FROZEN_SUPPLIER_STATUS);
updateZcBSupplier(sup);
frozenLst.add(result);
}
}
}
return frozenLst;
}
public List findZcEbSignupSite(ZcEbProjSupport proj) {
return this.getSqlMapClientTemplate().queryForList("ZcEbSignup.getSignupSiteList", proj);
}
public void updateZcBSupplier(ZcEbSupplier sup) {
this.getSqlMapClientTemplate().update("ZcEbSupplier.updateSupplierStatus", sup);
}
public List getZcEbPackHistory(ElementConditionDto dto, RequestMeta meta) {
// TCJLODO Auto-generated method stub
dto.setNumLimitStr(NumLimUtil.getInstance().getNumLimCondByCoType(dto.getWfcompoId(), NumLimConstants.FWATCH));
return this.getSqlMapClientTemplate().queryForList("ZcEbEntrustBull.getHistoryList", dto);
}
}
| [
"jielenzghsy1@163.com"
] | jielenzghsy1@163.com |
0c08539ac4f7924984d44844c4ddffb650f73e0e | 7476aea24dc81eafc3ce71a629f89991e37b06bb | /Java OOP Basics/Exams/Exam Preparation III/src/app/entities/microbes/Microbe.java | efbea9b8268622613c867f629720c407adcebf6a | [
"MIT"
] | permissive | Taewii/java-fundamentals | 1bcf6f04f5829584d93dfb97e19793cf3afb54fb | 306a4fcba70a5fb6c76d9e0827f061ea7edb24a5 | refs/heads/master | 2020-03-19T11:55:15.852992 | 2018-09-08T12:18:32 | 2018-09-08T12:18:32 | 136,485,469 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 490 | java | package app.entities.microbes;
import app.entities.cells.Cell;
import app.interfaces.microbes.MicrobeInterface;
public abstract class Microbe extends Cell implements MicrobeInterface {
private int virulence;
public Microbe(String id, int health, int positionRow, int positionCol, int virulence) {
super(id, health, positionRow, positionCol);
this.virulence = virulence;
}
@Override
public int getVirulence() {
return this.virulence;
}
}
| [
"p3rfec7@abv.bg"
] | p3rfec7@abv.bg |
7f7056273bf749964180367e22c705a93a68b184 | 4e5d61b632c452dafbfbe2bf47cfb1247877c729 | /Java Repository/Spring Core/src/_34/spring/aop/test/SimpleThrowsAdviceTest.java | bbf501c5aa4afd91cea7e6a70febf8071eb788d4 | [] | no_license | tugcankoparan/Java-EE-Spring-Framework | 520c943d472afe6266ddf15ed91dd3120c1768c0 | ca565dfd29287b33d61acfe477d6980ad69c0866 | refs/heads/master | 2020-03-30T11:16:10.432834 | 2018-10-18T17:19:46 | 2018-10-18T17:19:46 | 151,164,255 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 857 | java | package _34.spring.aop.test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import _34.spring.aop.service.Validator;
public class SimpleThrowsAdviceTest {
public static void main(String[] args) throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("34.spring.aop.xml");
Validator validator = context.getBean("proxyThrows", Validator.class);
try {
validator.validateAge(-10);
} catch (ArithmeticException e) {
System.out.println("ArithmeticException#catch\n");
}
try {
validator.parseAge("Exception");
} catch (NumberFormatException e) {
System.out.println("NumberFormatException#catch\n");
}
try {
validator.throwRuntimeException();
} catch (RuntimeException e) {
System.out.println("RuntimeException#catch\n");
}
context.close();
}
} | [
"tugcankoparan10@gmail.com"
] | tugcankoparan10@gmail.com |
f0c82604680d687f44f9095fd6b24c23681750d0 | fc0879f1a64a9b12f191b46f3ee08f32114519af | /gameserver/src/ru/catssoftware/gameserver/util/actions/PlayerActions.java | 313880fffdaeb004a06f0eba987859ecedf4e0a1 | [] | no_license | Snikers0309/lucera2 | b26f59953edec905aefeb2c4273f3dec17e88a9d | 53d623903322e177cc7eb34a7e292878cbc74841 | refs/heads/master | 2023-03-23T00:25:53.002593 | 2013-01-30T01:11:33 | 2013-01-30T01:11:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,226 | java | package ru.catssoftware.gameserver.util.actions;
import javolution.util.FastList;
import ru.catssoftware.extension.GameExtensionManager;
import ru.catssoftware.extension.ObjectExtension;
import ru.catssoftware.gameserver.model.L2Character;
import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance;
import java.util.List;
/*
* @author Ro0TT
* @date 07.01.2012
*/
public class PlayerActions extends ObjectExtension
{
public static List<IOnLogin> _iOnLogin = new FastList<IOnLogin>();
public static List<ILogOut> _iLogOut = new FastList<ILogOut>();
public static List<IChangeSubClass> _iChangeSubCLass = new FastList<IChangeSubClass>();
public static List<IOnKill> _iOnKill = new FastList<IOnKill>();
public static PlayerActions _instance;
public static PlayerActions getInstance()
{
if (_instance==null)
{
_instance = new PlayerActions();
GameExtensionManager.getInstance().registerExtension(_instance);
}
return _instance;
}
@Override
public Class<?>[] forClasses()
{
return new Class<?>[]{ L2PcInstance.class };
}
@Override
public Object hanlde(Object o, Action action, Object... os)
{
if (o instanceof L2PcInstance)
{
L2PcInstance player = (L2PcInstance) o;
if (action.equals(Action.CHAR_ENTERWORLD))
for(IOnLogin script : _iOnLogin)
script.intoTheGame(player);
else if (action.equals(Action.PC_CHANGE_CLASS))
for(IChangeSubClass script : _iChangeSubCLass)
script.changeSubClass(player, (Integer) os[0]);
else if (action.equals(Action.NPC_ONACTION))
for(ILogOut script : _iLogOut)
script.outTheGame(player);
else if (action.equals(Action.CHAR_DIE))
for (IOnKill script : _iOnKill)
script.onKill(os.length == 0 || os[0] == null ? player : (L2Character) os[0], player);
}
return null;
}
public void addScript(Object script)
{
if (script instanceof IOnLogin)
_iOnLogin.add((IOnLogin) script);
if (script instanceof IChangeSubClass)
_iChangeSubCLass.add((IChangeSubClass) script);
if (script instanceof ILogOut)
_iLogOut.add((ILogOut) script);
if (script instanceof IOnKill)
_iOnKill.add((IOnKill) script);
}
} | [
"topp3000@mail.ru"
] | topp3000@mail.ru |
20b41325588837de54eae0bbf9703e63b757116b | 7c75e387de3bbc7c1732d6f21b64dcbc762e6034 | /gapi-gateway/src/main/java/io/github/conanchen/creativework/graphql/model/BlogPostingGQO.java | 63e0fd56b361590ee2ea65a443eb2c2aad287087 | [
"Apache-2.0"
] | permissive | conanchen/netifi-kgmovies | 8ce8f3aa5c8fae2304f48792b7f89326597eb169 | 77da1f463fb52a52fe91396e86840af84635fcb2 | refs/heads/master | 2020-12-28T05:34:52.317761 | 2020-04-05T15:01:07 | 2020-04-05T15:01:07 | 238,192,065 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,947 | java | package io.github.conanchen.creativework.graphql.model;
import io.github.conanchen.person.graphql.model.PersonGQO;
import io.github.conanchen.zommon.graphql.model.NodeGQO;
import io.github.conanchen.zommon.graphql.model.ThingGQO;
import java.util.Collection;
public class BlogPostingGQO implements CreativeWorkGQO, ArticleGQO, NodeGQO{
private ThingGQO about;
private PersonGQO editor;
private java.lang.String headline;
private java.lang.String alternativeHeadline;
private CreativeWorkGQO isPartOf;
private Collection<CreativeWorkGQO> hasPart;
private java.lang.String articleBody;
private java.lang.String articleSection;
private Integer pageEnd;
private Integer pageStart;
private java.lang.String pagination;
private Integer wordCount;
@javax.validation.constraints.NotNull
private String id;
public BlogPostingGQO() {
}
public BlogPostingGQO(ThingGQO about, PersonGQO editor, java.lang.String headline, java.lang.String alternativeHeadline, CreativeWorkGQO isPartOf, Collection<CreativeWorkGQO> hasPart, java.lang.String articleBody, java.lang.String articleSection, Integer pageEnd, Integer pageStart, java.lang.String pagination, Integer wordCount, String id) {
this.about = about;
this.editor = editor;
this.headline = headline;
this.alternativeHeadline = alternativeHeadline;
this.isPartOf = isPartOf;
this.hasPart = hasPart;
this.articleBody = articleBody;
this.articleSection = articleSection;
this.pageEnd = pageEnd;
this.pageStart = pageStart;
this.pagination = pagination;
this.wordCount = wordCount;
this.id = id;
}
public ThingGQO getAbout() {
return about;
}
public void setAbout(ThingGQO about) {
this.about = about;
}
public PersonGQO getEditor() {
return editor;
}
public void setEditor(PersonGQO editor) {
this.editor = editor;
}
public java.lang.String getHeadline() {
return headline;
}
public void setHeadline(java.lang.String headline) {
this.headline = headline;
}
public java.lang.String getAlternativeHeadline() {
return alternativeHeadline;
}
public void setAlternativeHeadline(java.lang.String alternativeHeadline) {
this.alternativeHeadline = alternativeHeadline;
}
public CreativeWorkGQO getIsPartOf() {
return isPartOf;
}
public void setIsPartOf(CreativeWorkGQO isPartOf) {
this.isPartOf = isPartOf;
}
public Collection<CreativeWorkGQO> getHasPart() {
return hasPart;
}
public void setHasPart(Collection<CreativeWorkGQO> hasPart) {
this.hasPart = hasPart;
}
public java.lang.String getArticleBody() {
return articleBody;
}
public void setArticleBody(java.lang.String articleBody) {
this.articleBody = articleBody;
}
public java.lang.String getArticleSection() {
return articleSection;
}
public void setArticleSection(java.lang.String articleSection) {
this.articleSection = articleSection;
}
public Integer getPageEnd() {
return pageEnd;
}
public void setPageEnd(Integer pageEnd) {
this.pageEnd = pageEnd;
}
public Integer getPageStart() {
return pageStart;
}
public void setPageStart(Integer pageStart) {
this.pageStart = pageStart;
}
public java.lang.String getPagination() {
return pagination;
}
public void setPagination(java.lang.String pagination) {
this.pagination = pagination;
}
public Integer getWordCount() {
return wordCount;
}
public void setWordCount(Integer wordCount) {
this.wordCount = wordCount;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
} | [
"conan8chan@yahoo.com"
] | conan8chan@yahoo.com |
3b055ea38472c7011a986b9575a53d4ee78a87e6 | 78f7fd54a94c334ec56f27451688858662e1495e | /partyanalyst-service/trunk/src/test/java/com/itgrids/partyanalyst/dao/hibernate/HHBoothLeaderDAOHibernateTest.java | d3dc0787f5f753bee0b43981090e75d642136ba9 | [] | no_license | hymanath/PA | 2e8f2ef9e1d3ed99df496761a7b72ec50d25e7ef | d166bf434601f0fbe45af02064c94954f6326fd7 | refs/heads/master | 2021-09-12T09:06:37.814523 | 2018-04-13T20:13:59 | 2018-04-13T20:13:59 | 129,496,146 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 953 | java | package com.itgrids.partyanalyst.dao.hibernate;
import java.util.ArrayList;
import java.util.List;
import org.appfuse.dao.BaseDaoTestCase;
import org.hibernate.mapping.Array;
import com.itgrids.partyanalyst.dao.IHHBoothLeaderDAO;
import com.itgrids.partyanalyst.model.HHBoothLeader;
public class HHBoothLeaderDAOHibernateTest extends BaseDaoTestCase{
private IHHBoothLeaderDAO hhBoothLeaderDAO;
public void setHhBoothLeaderDAO(IHHBoothLeaderDAO hhBoothLeaderDAO) {
this.hhBoothLeaderDAO = hhBoothLeaderDAO;
}
public void test(){
//List<Object[]> list=hhBoothLeaderDAO.getLeadersOfConstituency(228l);
/*List<Long> boothIds = new ArrayList<Long>();
boothIds.add(134868l);
List<Object[]> count = hhBoothLeaderDAO.getLeadersOfConstituency(228l);
System.out.println(count);*/
List<Object[]> list = hhBoothLeaderDAO.getConstituenciesOfHouseHolds();
System.out.println(list.size());
}
}
| [
"itgrids@b17b186f-d863-de11-8533-00e0815b4126"
] | itgrids@b17b186f-d863-de11-8533-00e0815b4126 |
fa74d272b67962df45fb0efdd69d08e02e7d644a | bf4122f5ae3a9f9b9c2cc94ef87cdb9dcadc9dc9 | /Transfer/SPIDER/20190516_Object_Assignment/Program2.java.bak | 788ad7fc98d2c0d35eced6bed48ea144d4f7df2b | [] | no_license | haren7474/TY_ELF_JFS_HarendraKumar | 7ef8b9a0bb6d6bdddb94b88ab2db4e0aef0fbc1d | f99ef30b40d0877167c8159e8b7f322af7cc87b9 | refs/heads/master | 2023-01-11T01:01:10.458037 | 2020-01-23T18:20:20 | 2020-01-23T18:20:20 | 225,845,989 | 0 | 0 | null | 2023-01-07T22:01:21 | 2019-12-04T11:00:37 | HTML | UTF-8 | Java | false | false | 571 | bak | import java.util.Scanner;
class Program
{
public static void main(String[] args)
{
Scanner sc= new Scanner(System.in);
System.out.println("Please enter a string");
String s= sc.nextLine();
String rev= Palindrom.isPalindrom(s);
if(s.equalsIgnoreCase(rev))
{
System.out.println(s+ " is a palindrom");
}
else
{
System.out.println(s+ " is a not palindrom");
}
}
}
class Palindrom
{
public static String isPalindrom(String s)
{
String rev="";
for(int i= s.length()-1; i>=0 ; i--)
{
rev= rev+ s.charAt(i);
}
return rev;
}
} | [
"harendra10104698@gmail.com"
] | harendra10104698@gmail.com |
38251705baea2cd597845c9bd1e997bd388f60e2 | cca5f035dbbe018268b63a8ddd77b4ec8a9ac0c0 | /src/test/java/com/amyliascarlet/jsontest/bvt/InetSocketAddressFieldTest.java | 5033fdf43a6b2df4dc772954c4d70c2f5f20e9e6 | [
"Apache-2.0"
] | permissive | AmyliaScarlet/amyliascarletlib | 45195dc277fa16ec7f9c71f20686acaaf2b84366 | 6bd7f69edae8d201e41c6ccfa231ce51fb0ffe16 | refs/heads/master | 2020-05-25T10:53:20.312058 | 2019-05-21T07:04:35 | 2019-05-21T07:04:35 | 187,766,221 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,730 | java | package com.amyliascarlet.jsontest.bvt;
import java.net.InetSocketAddress;
import org.junit.Assert;
import junit.framework.TestCase;
import com.amyliascarlet.lib.json.JSON;
import com.amyliascarlet.lib.json.serializer.SerializeConfig;
import com.amyliascarlet.lib.json.serializer.SerializerFeature;
public class InetSocketAddressFieldTest extends TestCase {
public void test_codec() throws Exception {
User user = new User();
user.setValue(new InetSocketAddress(33));
SerializeConfig mapping = new SerializeConfig();
mapping.setAsmEnable(false);
String text = JSON.toJSONString(user, mapping, SerializerFeature.WriteMapNullValue);
User user1 = JSON.parseObject(text, User.class);
Assert.assertEquals(user1.getValue(), user.getValue());
}
public void test_codec_null() throws Exception {
User user = new User();
user.setValue(null);
SerializeConfig mapping = new SerializeConfig();
mapping.setAsmEnable(false);
String text = JSON.toJSONString(user, mapping, SerializerFeature.WriteMapNullValue);
User user1 = JSON.parseObject(text, User.class);
Assert.assertEquals(user1.getValue(), user.getValue());
}
public void test_codec_null_2() throws Exception {
User user = JSON.parseObject("{\"value\":{\"address\":null,\"port\":33}}", User.class);
Assert.assertEquals(33, user.getValue().getPort());
}
public static class User {
private InetSocketAddress value;
public InetSocketAddress getValue() {
return value;
}
public void setValue(InetSocketAddress value) {
this.value = value;
}
}
}
| [
"amy373978205@outlook.com"
] | amy373978205@outlook.com |
2fab9f5f11eb42d1069b9b411324f98fa7d67d02 | 68c2e47ce20c7a872f95a8f2286ab5abd40157ce | /SpringBoot咨询发布系统实战项目源码/springboot-project-news-publish-system/src/main/java/com/site/springboot/core/entity/News.java | b00c1f390cddc527b35e645b6a2ed2038b1021c4 | [
"Apache-2.0"
] | permissive | ZHENFENG13/spring-boot-projects | 807abeff69dcc341a4bdf27bb5fe371302df958b | f08f1c4f91de27edb45f2c6702c7b23d0acf68cc | refs/heads/main | 2023-03-08T17:46:56.923319 | 2023-02-27T15:34:14 | 2023-02-27T15:34:14 | 86,874,274 | 3,283 | 870 | Apache-2.0 | 2023-02-27T15:34:15 | 2017-04-01T01:50:14 | Java | UTF-8 | Java | false | false | 3,005 | java | package com.site.springboot.core.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
public class News {
private Long newsId;
private String newsTitle;
private Long newsCategoryId;
private String newsCoverImage;
private String newsContent;
private Byte newsStatus;
private Long newsViews;
private Byte isDeleted;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
private Date updateTime;
public Long getNewsId() {
return newsId;
}
public void setNewsId(Long newsId) {
this.newsId = newsId;
}
public String getNewsTitle() {
return newsTitle;
}
public void setNewsTitle(String newsTitle) {
this.newsTitle = newsTitle == null ? null : newsTitle.trim();
}
public Long getNewsCategoryId() {
return newsCategoryId;
}
public void setNewsCategoryId(Long newsCategoryId) {
this.newsCategoryId = newsCategoryId;
}
public String getNewsCoverImage() {
return newsCoverImage;
}
public void setNewsCoverImage(String newsCoverImage) {
this.newsCoverImage = newsCoverImage == null ? null : newsCoverImage.trim();
}
public Byte getNewsStatus() {
return newsStatus;
}
public void setNewsStatus(Byte newsStatus) {
this.newsStatus = newsStatus;
}
public Long getNewsViews() {
return newsViews;
}
public void setNewsViews(Long newsViews) {
this.newsViews = newsViews;
}
public Byte getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(Byte isDeleted) {
this.isDeleted = isDeleted;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getNewsContent() {
return newsContent;
}
public void setNewsContent(String newsContent) {
this.newsContent = newsContent;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", newsId=").append(newsId);
sb.append(", newsTitle=").append(newsTitle);
sb.append(", newsCategoryId=").append(newsCategoryId);
sb.append(", newsCoverImage=").append(newsCoverImage);
sb.append(", newsStatus=").append(newsStatus);
sb.append(", newsViews=").append(newsViews);
sb.append(", isDeleted=").append(isDeleted);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append("]");
return sb.toString();
}
} | [
"1034683568@qq.com"
] | 1034683568@qq.com |
480cb76a151a05cd057fb921d09fec42e81e4a9f | 182b1105c2a1ffbe01dcf9869aa57c9fce789999 | /integral-core/src/main/java/my/com/myriadeas/integral/data/populator/HolidayDatabasePopulatorIntf.java | 55a4ff0269bce30cccdf874d704619d243a800f8 | [] | no_license | arlinashah/integral | 73d15e54f5cc071f2b56cc8b21b3ca3d26c2612f | 17108192cdec49b68e3d198913d1109fad4f1bff | refs/heads/master | 2022-12-25T21:54:39.705721 | 2014-09-23T02:30:39 | 2014-09-23T02:30:39 | 24,176,317 | 1 | 0 | null | 2022-12-16T02:38:46 | 2014-09-18T06:14:08 | JavaScript | UTF-8 | Java | false | false | 162 | java | package my.com.myriadeas.integral.data.populator;
public interface HolidayDatabasePopulatorIntf extends DatabaseInitializingBean,
HolidayData, BranchData {
}
| [
"arlinashah@gmail.com"
] | arlinashah@gmail.com |
0610d9b72c8edb61269009c468777f42060c2fed | a08f0c2e3e492c364f035d3b3b5fc4c29611e7c9 | /data-structure-and-algorithm/core-java/src/main/java/com/com/comparator/journaldev/toString.java | 8eebeffba60a2ea0c7fce447b4f292bad82943ad | [] | no_license | chamanbharti/java-works | 9832eb8ba6a81c88250fa81a71fa9db728993cd3 | aec6b503bde515dc174b23404c936635a7f59add | refs/heads/master | 2023-04-26T16:49:48.915313 | 2021-05-31T12:44:50 | 2021-05-31T12:44:50 | 328,213,982 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 731 | java | package com.comparator.journaldev;
import java.util.Arrays;
public class toString {
public static void main(String[] args) {
char[] Array = {'a', 'b', 'c', 'd', 'e', 'f'};
//int[] Array = {5,9,1,10};
/*System.out.println(Array.toString());//[C@15db9742
System.out.println(Arrays.toString());*/
//String a = new String(Array);
//System.out.println(a);//abcdef
convertToString(Array,6);
System.out.println(Array);
}
private static String convertToString(char[] array, int length) {
String char_string;
String return_string = "";
int i;
for(i=0;i<length;i++){
char_string = Character.toString(array[i]);
return_string = return_string.concat(char_string);
}
return return_string;
}
}
| [
"chaman.bharti84@gmail.com"
] | chaman.bharti84@gmail.com |
286ac4e9f04eb214c481bea57601c7d8e40833d7 | 7f23509f3cce358b7ae530687c100a243d8d0ed9 | /airline/service/src/main/java/com/mbv/airline/actors/RabbitMqServiceMaster.java | 5a943befcae394211cbc6b82e7318a0edee2acc3 | [] | no_license | zhaobingss/nds | 3275ae04956f65399d3ce0d9b495abfe530add8b | 5f65011e3a59c6efe3d2b34c1d9566ca905b368b | refs/heads/master | 2020-07-08T20:43:11.111670 | 2015-08-03T15:05:17 | 2015-08-03T15:05:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,062 | java | package com.mbv.airline.actors;
import java.util.HashMap;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.amqp.core.AcknowledgeMode;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.listener.ActiveObjectCounter;
import org.springframework.amqp.rabbit.listener.BlockingQueueConsumer;
import org.springframework.amqp.rabbit.support.DefaultMessagePropertiesConverter;
import akka.actor.Actor;
import akka.actor.ActorRef;
import akka.actor.Props;
import akka.actor.UntypedActor;
import akka.actor.UntypedActorFactory;
public class RabbitMqServiceMaster extends AirlineServiceMaster {
private static Logger logger = Logger.getLogger(RabbitMqServiceMaster.class);
private RabbitTemplate template;
private HashMap<String, ActorRef> listeners;
public RabbitMqServiceMaster(List<AbstractWorkerFactory> workerFactories, RabbitTemplate template) {
super(workerFactories);
this.template = template;
this.listeners = new HashMap<String, ActorRef>();
}
public void preStart() {
super.preStart();
logger.info("pre started");
}
@SuppressWarnings("serial")
@Override
protected void dispatchWorker(WorkerAvailableMessage message, ActorRef worker) {
final String vendor = message.getVendor();
ActorRef listener = listeners.get(vendor);
if (listener == null) {
listener = getContext().actorOf(new Props(new UntypedActorFactory() {
public Actor create() throws Exception {
return new RabbitMqListenerActor(vendor, template);
}
}));
listeners.put(vendor, listener);
}
listener.tell(getSender(), null);
}
private static class RabbitMqListenerActor extends UntypedActor {
private RabbitTemplate template;
private BlockingQueueConsumer consumer;
public RabbitMqListenerActor(String queue, RabbitTemplate template) {
this.template = template;
consumer = new BlockingQueueConsumer(template.getConnectionFactory(), new DefaultMessagePropertiesConverter(), new ActiveObjectCounter<BlockingQueueConsumer>(), AcknowledgeMode.AUTO, false, 1, queue);
consumer.start();
}
@Override
public void onReceive(Object object) throws Exception {
if (object instanceof ActorRef) {
ActorRef worker = (ActorRef) object;
Message message = consumer.nextMessage(1000L);
if (message == null) {
getSelf().tell(worker, null);
} else {
consumer.commitIfNecessary(false);
logger.info("dispatchWorker: " + worker.path());
worker.tell(template.getMessageConverter().fromMessage(message), null);
}
}
}
public void postStop() {
consumer.stop();
}
}
}
| [
"cuong.truong@mobivi.vn"
] | cuong.truong@mobivi.vn |
5dd8d9447b15bba51cb60412d723ce0ba65ccc21 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/12/12_1300f23c0f6d24a9303208a27edbb484480de28c/PrivilegeObjectConverter/12_1300f23c0f6d24a9303208a27edbb484480de28c_PrivilegeObjectConverter_s.java | ba4841e7e96ad4b99768b1144a00752978ea6dc5 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 5,715 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.smartitengineering.user.service.impl.hbase.dao;
import com.google.inject.Inject;
import com.smartitengineering.dao.impl.hbase.spi.ExecutorService;
import com.smartitengineering.dao.impl.hbase.spi.SchemaInfoProvider;
import com.smartitengineering.dao.impl.hbase.spi.impl.AbstractObjectRowConverter;
import com.smartitengineering.user.domain.Organization;
import com.smartitengineering.user.domain.Privilege;
import com.smartitengineering.user.domain.SecuredObject;
import com.smartitengineering.user.service.OrganizationService;
import com.smartitengineering.user.service.SecuredObjectService;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.util.Bytes;
/**
*
* @author imyousuf
*/
public class PrivilegeObjectConverter extends AbstractObjectRowConverter<Privilege, Long> {
private static final byte[] FAMILY_SELF = Bytes.toBytes("self");
private static final byte[] CELL_PARENT_ORG = Bytes.toBytes("primaryEmail");
private static final byte[] CELL_NAME = Bytes.toBytes("primaryEmail");
private static final byte[] CELL_DISPLAY_NAME = Bytes.toBytes("primaryEmail");
private static final byte[] CELL_SHORT_DESC = Bytes.toBytes("primaryEmail");
private static final byte[] CELL_SEC_OBJ = Bytes.toBytes("primaryEmail");
private static final byte[] CELL_PERMISSION_MASK = Bytes.toBytes("primaryEmail");
private static final byte[] CELL_CREATION_DATE = Bytes.toBytes("creationDate");
private static final byte[] CELL_LAST_MODIFIED_DATE = Bytes.toBytes("lastModifiedDate");
@Inject
private OrganizationService orgService;
@Inject
private SecuredObjectService secObjService;
@Inject
private SchemaInfoProvider<Organization, String> orgSchemaInfoProvider;
@Inject
private SchemaInfoProvider<SecuredObject, Long> secObjSchemaInfoProvider;
@Override
protected String[] getTablesToAttainLock() {
return new String[]{getInfoProvider().getMainTableName()};
}
@Override
protected void getPutForTable(Privilege instance, ExecutorService service, Put put) {
put.add(FAMILY_SELF, CELL_CREATION_DATE, Utils.toBytes(instance.getCreationDate()));
put.add(FAMILY_SELF, CELL_LAST_MODIFIED_DATE, Utils.toBytes(instance.getLastModifiedDate()));
if (instance.getParentOrganization() != null) {
try {
put.add(FAMILY_SELF, CELL_PARENT_ORG,
orgSchemaInfoProvider.getRowIdFromId(instance.getParentOrganization().getId()));
}
catch (Exception ex) {
logger.warn("Could not convert parent organization of privilege", ex);
}
}
if (instance.getSecuredObject() != null) {
try {
put.add(FAMILY_SELF, CELL_SEC_OBJ,
secObjSchemaInfoProvider.getRowIdFromId(instance.getSecuredObject().getId()));
}
catch (Exception ex) {
logger.warn("Could not convert secured objct of privilege", ex);
}
}
if (StringUtils.isNotBlank(instance.getName())) {
put.add(FAMILY_SELF, CELL_NAME, Bytes.toBytes(instance.getName()));
}
if (StringUtils.isNotBlank(instance.getDisplayName())) {
put.add(FAMILY_SELF, CELL_DISPLAY_NAME, Bytes.toBytes(instance.getDisplayName()));
}
if (StringUtils.isNotBlank(instance.getShortDescription())) {
put.add(FAMILY_SELF, CELL_SHORT_DESC, Bytes.toBytes(instance.getShortDescription()));
}
if (instance.getPermissionMask() != null) {
put.add(FAMILY_SELF, CELL_PERMISSION_MASK, Bytes.toBytes(instance.getPermissionMask()));
}
}
@Override
protected void getDeleteForTable(Privilege instance, ExecutorService service, Delete put) {
// Nothing is needed
}
@Override
public Privilege rowsToObject(Result startRow, ExecutorService executorService) {
try {
Privilege privilege = new Privilege();
privilege.setCreationDate(Utils.toDate(startRow.getValue(FAMILY_SELF, CELL_CREATION_DATE)));
privilege.setLastModifiedDate(Utils.toDate(startRow.getValue(FAMILY_SELF, CELL_LAST_MODIFIED_DATE)));
if (startRow.getValue(FAMILY_SELF, CELL_NAME) != null) {
privilege.setName(Bytes.toString(startRow.getValue(FAMILY_SELF, CELL_NAME)));
}
if (startRow.getValue(FAMILY_SELF, CELL_DISPLAY_NAME) != null) {
privilege.setDisplayName(Bytes.toString(startRow.getValue(FAMILY_SELF, CELL_DISPLAY_NAME)));
}
if (startRow.getValue(FAMILY_SELF, CELL_SHORT_DESC) != null) {
privilege.setShortDescription(Bytes.toString(startRow.getValue(FAMILY_SELF, CELL_SHORT_DESC)));
}
if (startRow.getValue(FAMILY_SELF, CELL_PERMISSION_MASK) != null) {
privilege.setPermissionMask(Bytes.toInt(startRow.getValue(FAMILY_SELF, CELL_PERMISSION_MASK)));
}
if (startRow.getValue(FAMILY_SELF, CELL_PARENT_ORG) != null) {
String orgId = orgSchemaInfoProvider.getIdFromRowId(startRow.getValue(FAMILY_SELF, CELL_PARENT_ORG));
privilege.setParentOrganization(orgService.getOrganizationByUniqueShortName(orgId));
}
if (startRow.getValue(FAMILY_SELF, CELL_SEC_OBJ) != null) {
Long secObjId = secObjSchemaInfoProvider.getIdFromRowId(startRow.getValue(FAMILY_SELF, CELL_SEC_OBJ));
privilege.setSecuredObject(secObjService.getById(secObjId));
}
return privilege;
}
catch (Exception ex) {
logger.error("Could not form Privilege", ex);
return null;
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
775d4fb436793e067e882e705f0bad2392ec9cc7 | 4878c0bccf7675c514961860a569aaa2b86d18f7 | /src/main/java/com/jojoldu/blogcode/teamcity/TeamcityInActionApplication.java | f1578021d647fb7cccd6cae26c350d1d6d1f125d | [] | no_license | rheehot/teamcity-in-action | 7bc313035567d2fb1e6ecee17aaaea7ea24424b4 | c66cf20f3a7df71140312353fe60b0c0ee2c1fe2 | refs/heads/master | 2022-03-27T16:59:37.563530 | 2020-01-11T03:34:42 | 2020-01-11T03:34:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 354 | java | package com.jojoldu.blogcode.teamcity;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class TeamcityInActionApplication {
public static void main(String[] args) {
SpringApplication.run(TeamcityInActionApplication.class, args);
}
}
| [
"jojoldu@gmail.com"
] | jojoldu@gmail.com |
e6bf2aa98d3dcef1b142509dc0d5ba2d2104aa3c | e8332d0091d58912699934dd45f57d38270e5529 | /src/test/java/com/bbytes/mailgun/WebhookOperationTest.java | 794117123525f1accc7e4ada8631f44328076842 | [] | no_license | bbytes/mailgun-java-client | 6a47e9677e6ada85861db4d85efaf6d631cd6506 | 9ab304581150aea74b514199797df2a76c43b581 | refs/heads/master | 2021-01-11T01:09:10.163195 | 2018-01-31T11:49:27 | 2018-01-31T11:49:27 | 71,056,888 | 3 | 6 | null | null | null | null | UTF-8 | Java | false | false | 1,938 | java | package com.bbytes.mailgun;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.util.Assert;
import com.bbytes.mailgun.api.WebhookOperations;
import com.bbytes.mailgun.api.impl.MailgunClientException;
import com.bbytes.mailgun.client.MailgunClient;
import com.bbytes.mailgun.model.MailgunWebhookListResponse;
import com.bbytes.mailgun.model.MailgunWebhookResponse;
import com.bbytes.mailgun.model.WebhookType;
public class WebhookOperationTest extends MailgunJavaClientApplicationTests {
@Autowired
Environment environment;
MailgunClient client;
String domain;
@Before
public void setup() {
client = MailgunClient.create(environment.getProperty("mailgun.api.key"));
domain = environment.getProperty("mailgun.domain");
}
@Test
public void getAllWebhooks() {
WebhookOperations webhookOperations = client.webhookOperations(domain);
MailgunWebhookListResponse response = webhookOperations.getAllWebhooks();
Assert.isTrue(!response.getWebhooks().isEmpty());
}
@Test
public void getWebnook() {
WebhookOperations webhookOperations = client.webhookOperations(domain);
MailgunWebhookResponse response = webhookOperations.getWebhook(WebhookType.click);
Assert.isTrue(!response.getWebhook().getUrl().isEmpty());
}
@Test
public void createWebhook() throws MailgunClientException {
WebhookOperations webhookOperations = client.webhookOperations(domain);
MailgunWebhookResponse response = webhookOperations.createWebhook(WebhookType.click,
"http://sample.com/post/test");
Assert.isTrue(!response.getWebhook().getUrl().isEmpty());
System.out.println(response);
}
@Test
public void deleteRoute() throws MailgunClientException {
WebhookOperations webhookOperations = client.webhookOperations(domain);
webhookOperations.deleteWebhook(WebhookType.click);
}
}
| [
"tm@beyondbytes.co.in"
] | tm@beyondbytes.co.in |
0ef82935343115a5263c7b7fb021d65595fc28c0 | b87148503121adb74e699f4c015f591e0aeb4ba6 | /src/main/java/com/igormaznitsa/jcp/logger/SystemOutLogger.java | 10ca6cd8b02aac64ec56e7afeefad9afd0a86e2a | [] | no_license | smalinin/java-comment-preprocessor | ec0275e617818d88ac2fe8b1f04a32c272da4f0b | 40755c48d95b713e97585e8dc66a0e37212006ea | refs/heads/master | 2020-12-06T22:04:20.560845 | 2015-12-08T20:19:41 | 2015-12-08T20:19:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,824 | java | /*
* Copyright 2014 Igor Maznitsa (http://www.igormaznitsa.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.igormaznitsa.jcp.logger;
/**
* An Easy logger which just output log messages into the system output streams
*
* @author Igor Maznitsa (igor.maznitsa@igormaznitsa.com)
*/
public class SystemOutLogger implements PreprocessorLogger {
/**
* Name of system property to enable debug level logging.
*/
public static final String PROPERTY_DEBUG_FLAG = "jcp.log.debug";
private static final boolean FLAG_DEBUG_LEVEL = Boolean.parseBoolean(System.getProperty(PROPERTY_DEBUG_FLAG));
@Override
public void error(final String text) {
if (text != null) {
final String out = "[JCP.ERR] " + text;
System.err.println(out);
}
}
@Override
public void info(final String text) {
if (text != null) {
final String out = "[JCP.INFO] " + text;
System.out.println(out);
}
}
@Override
public void warning(final String text) {
if (text != null) {
final String out = "[JCP.WARN] " + text;
System.out.println(out);
}
}
@Override
public void debug(final String text) {
if (FLAG_DEBUG_LEVEL && text != null) {
final String out = "[JCP.DEBUG] " + text;
System.out.println(out);
}
}
}
| [
"rrg4400@gmail.com"
] | rrg4400@gmail.com |
bd54b05816b968d1e7e9ad917b0962bd812221a5 | 77bb7d47ad1610dc8e7aacbbd1dc3fcf14d18f8e | /src/main/java/net/fabricmc/loader/game/GameProviderHelper.java | 2ea1de4503a75c174ecc0ee4f049f61b71af2b74 | [
"Apache-2.0"
] | permissive | FoundationGames/fabric-loader | 88e21299eb04a4ff3601217c947b20aaff0dc05d | e19f7da993754ef46c3f33b7d69947a240223158 | refs/heads/master | 2023-03-22T08:14:20.433269 | 2021-03-15T00:02:59 | 2021-03-15T00:02:59 | 325,935,984 | 0 | 0 | Apache-2.0 | 2021-03-15T00:02:59 | 2021-01-01T07:28:46 | null | UTF-8 | Java | false | false | 2,831 | java | /*
* Copyright 2016 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.fabricmc.loader.game;
import net.fabricmc.loader.util.UrlConversionException;
import net.fabricmc.loader.util.UrlUtil;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Path;
import java.util.*;
import java.util.stream.Collectors;
final class GameProviderHelper {
public static class EntrypointResult {
public final String entrypointName;
public final Path entrypointPath;
EntrypointResult(String entrypointName, Path entrypointPath) {
this.entrypointName = entrypointName;
this.entrypointPath = entrypointPath;
}
}
private GameProviderHelper() {
}
static Optional<Path> getSource(ClassLoader loader, String filename) {
URL url;
if ((url = loader.getResource(filename)) != null) {
try {
URL urlSource = UrlUtil.getSource(filename, url);
Path classSourceFile = UrlUtil.asPath(urlSource);
return Optional.of(classSourceFile);
} catch (UrlConversionException e) {
// TODO: Point to a logger
e.printStackTrace();
}
}
return Optional.empty();
}
static List<Path> getSources(ClassLoader loader, String filename) {
try {
Enumeration<URL> urls = loader.getResources(filename);
List<Path> paths = new ArrayList<>();
while (urls.hasMoreElements()) {
URL url = urls.nextElement();
try {
URL urlSource = UrlUtil.getSource(filename, url);
paths.add(UrlUtil.asPath(urlSource));
} catch (UrlConversionException e) {
// TODO: Point to a logger
e.printStackTrace();
}
}
return paths;
} catch (IOException e) {
e.printStackTrace();
return Collections.emptyList();
}
}
static Optional<EntrypointResult> findFirstClass(ClassLoader loader, List<String> classNames) {
List<String> entrypointFilenames = classNames.stream()
.map((ep) -> ep.replace('.', '/') + ".class")
.collect(Collectors.toList());
for (int i = 0; i < entrypointFilenames.size(); i++) {
String className = classNames.get(i);
String classFilename = entrypointFilenames.get(i);
Optional<Path> classSourcePath = getSource(loader, classFilename);
if (classSourcePath.isPresent()) {
return Optional.of(new EntrypointResult(className, classSourcePath.get()));
}
}
return Optional.empty();
}
}
| [
"kontakt@asie.pl"
] | kontakt@asie.pl |
dc12d2392bdec64b1cf1916fb4d44ac3176adb5e | 4482bb07aaae0f901fa48f74127f416ddbcf56f9 | /projects/uk.ac.york.ocl.javaMM/src/javaMM/TypeLiteral.java | 67febb89c655b1a8dae9d55ff902671a0ba78a14 | [] | no_license | SMadani/PhD | 931add010375b6df64fd4bf43fba0c8c85bc4d3b | 18c44b0126d22eb50a4dad4719a41e025402a337 | refs/heads/master | 2023-02-18T04:55:53.011207 | 2021-01-20T19:38:17 | 2021-01-20T19:38:17 | 275,636,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,517 | java | /**
*/
package javaMM;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Type Literal</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link javaMM.TypeLiteral#getType <em>Type</em>}</li>
* </ul>
*
* @see javaMM.JavaMMPackage#getTypeLiteral()
* @model
* @generated
*/
public interface TypeLiteral extends Expression {
/**
* Returns the value of the '<em><b>Type</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Type</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Type</em>' containment reference.
* @see #setType(TypeAccess)
* @see javaMM.JavaMMPackage#getTypeLiteral_Type()
* @model containment="true"
* annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://www.eclipse.org/MoDisco/Java/0.2.incubation/java!TypeLiteral!type'"
* @generated
*/
TypeAccess getType();
/**
* Sets the value of the '{@link javaMM.TypeLiteral#getType <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Type</em>' containment reference.
* @see #getType()
* @generated
*/
void setType(TypeAccess value);
} // TypeLiteral
| [
"sinadoom@googlemail.com"
] | sinadoom@googlemail.com |
55a939d139471d97e6402fc4606c6b78ac890ac7 | 90f9d0d74e6da955a34a97b1c688e58df9f627d0 | /com.ibm.ccl.soa.deploy.waswebplugin/src/com/ibm/ccl/soa/deploy/waswebplugin/validator/matcher/WasWebServerToIhsConstraintFactory.java | ea745d98c4e1dcce3fd04a6fd31400d440684a81 | [] | no_license | kalapriyakannan/UMLONT | 0431451674d7b3eb744fb436fab3d13e972837a4 | 560d9f5d2ba6a800398a24fd8265e5a946179fd3 | refs/heads/master | 2020-03-30T03:16:44.327160 | 2018-09-28T03:28:11 | 2018-09-28T03:28:11 | 150,679,726 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,122 | java | /*******************************************************************************
* Copyright (c) 2003, 2007 IBM Corporation Licensed Material - Property of IBM. All rights reserved.
*
* US Government Users Restricted Rights - Use, duplication or disclosure v1.0 restricted by GSA ADP
* Schedule Contract with IBM Corp.
*
* Contributors: IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.ccl.soa.deploy.waswebplugin.validator.matcher;
import com.ibm.ccl.soa.deploy.core.Constraint;
import com.ibm.ccl.soa.deploy.core.validator.pattern.matcher.IConstraintFactory;
import com.ibm.ccl.soa.deploy.waswebplugin.WasWebServerToIhsConstraint;
import com.ibm.ccl.soa.deploy.waswebplugin.WaswebpluginFactory;
/**
* Factory to create instances of {@link WasWebServerToIhsConstraint} constraints
*/
public class WasWebServerToIhsConstraintFactory implements IConstraintFactory {
public Constraint createConstraint() {
return WaswebpluginFactory.eINSTANCE.createWasWebServerToIhsConstraint();
}
}
| [
"kalapriya.kannan@in.ibm.com"
] | kalapriya.kannan@in.ibm.com |
dbd6c6fa0857010cf7792c26a4d5789317d0442e | 95c49f466673952b465e19a5ee3ae6eff76bee00 | /src/main/java/com/zhihu/android/topic/platfrom/$$Lambda$scatl2HjbDIHYDmGTDecqKInV48.java | cccbfbf46fd4d880dfc96bee1be95042ddcc36b6 | [] | 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 | 759 | java | package com.zhihu.android.topic.platfrom;
import com.zhihu.android.topic.p1949j.TopicMainViewModel;
import java8.util.p2234b.AbstractC32237i;
/* renamed from: com.zhihu.android.topic.platfrom.-$$Lambda$scatl2HjbDIHYDmGTDecqKInV48 reason: invalid class name */
/* compiled from: lambda */
public final /* synthetic */ class $$Lambda$scatl2HjbDIHYDmGTDecqKInV48 implements AbstractC32237i {
public static final /* synthetic */ $$Lambda$scatl2HjbDIHYDmGTDecqKInV48 INSTANCE = new $$Lambda$scatl2HjbDIHYDmGTDecqKInV48();
private /* synthetic */ $$Lambda$scatl2HjbDIHYDmGTDecqKInV48() {
}
@Override // java8.util.p2234b.AbstractC32237i
public final Object apply(Object obj) {
return ((TopicMainViewModel) obj).mo110108d();
}
}
| [
"seasonpplp@qq.com"
] | seasonpplp@qq.com |
44c1a86aa180aebd0e2720ab184d12a595c3dcc3 | 3efa417c5668b2e7d1c377c41d976ed31fd26fdc | /src/br/com/mind5/business/employee/model/action/EmpVisiNodePhoneInsert.java | 9440b9378cac890f0696953b135f7406a5bc6020 | [] | no_license | grazianiborcai/Agenda_WS | 4b2656716cc49a413636933665d6ad8b821394ef | e8815a951f76d498eb3379394a54d2aa1655f779 | refs/heads/master | 2023-05-24T19:39:22.215816 | 2023-05-15T15:15:15 | 2023-05-15T15:15:15 | 109,902,084 | 0 | 0 | null | 2022-06-29T19:44:56 | 2017-11-07T23:14:21 | Java | UTF-8 | Java | false | false | 867 | java | package br.com.mind5.business.employee.model.action;
import java.util.List;
import br.com.mind5.business.employee.info.EmpInfo;
import br.com.mind5.business.employee.model.decisionTree.EmpNodePhoneInsert;
import br.com.mind5.model.action.ActionVisitorTemplateAction;
import br.com.mind5.model.decisionTree.DeciTree;
import br.com.mind5.model.decisionTree.DeciTreeOption;
public final class EmpVisiNodePhoneInsert extends ActionVisitorTemplateAction<EmpInfo, EmpInfo> {
public EmpVisiNodePhoneInsert(DeciTreeOption<EmpInfo> option) {
super(option, EmpInfo.class, EmpInfo.class);
}
@Override protected Class<? extends DeciTree<EmpInfo>> getTreeClassHook() {
return EmpNodePhoneInsert.class;
}
@Override protected List<EmpInfo> toBaseClassHook(List<EmpInfo> baseInfos, List<EmpInfo> results) {
return results;
}
}
| [
"mmaciel@mind5.com.br"
] | mmaciel@mind5.com.br |
d1f4f8cfb7f2e275c4bc9754bfbf83a7f5a77519 | 1349e8fab61dfbdcf4900fcd1c20edf9d018a266 | /persistence/src/main/java/fi/foyt/fni/persistence/dao/chat/ChatMessageDAO.java | c7cd4c666b7aff8a1b80c060696ca3ae00c09c01 | [] | no_license | anttileppa/fni | a4d7d44590d0ad4db4fd0622a8342c8cefbbba1b | 2ae833883e40389d14431b85d70288e8ea02e9b9 | refs/heads/master | 2021-01-18T16:55:46.616122 | 2013-11-15T03:47:47 | 2013-11-15T03:47:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,864 | java | package fi.foyt.fni.persistence.dao.chat;
import java.util.Date;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import fi.foyt.fni.persistence.dao.DAO;
import fi.foyt.fni.persistence.dao.GenericDAO;
import fi.foyt.fni.persistence.model.chat.ChatMessage;
import fi.foyt.fni.persistence.model.chat.ChatMessage_;
import fi.foyt.fni.persistence.model.chat.XmppUser;
@DAO
public class ChatMessageDAO extends GenericDAO<ChatMessage> {
private static final long serialVersionUID = 1L;
public ChatMessage create(XmppUser from, XmppUser to, String body, String subject, Date sent, Boolean received) {
ChatMessage chatMessage = new ChatMessage();
chatMessage.setBody(body);
chatMessage.setFrom(from);
chatMessage.setSent(sent);
chatMessage.setSubject(subject);
chatMessage.setTo(to);
chatMessage.setReceived(received);
getEntityManager().persist(chatMessage);
return chatMessage;
}
public List<ChatMessage> listByReceivedAndTo(Boolean received, XmppUser to) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<ChatMessage> criteria = criteriaBuilder.createQuery(ChatMessage.class);
Root<ChatMessage> root = criteria.from(ChatMessage.class);
criteria.select(root);
criteria.where(
criteriaBuilder.and(
criteriaBuilder.equal(root.get(ChatMessage_.received), received),
criteriaBuilder.equal(root.get(ChatMessage_.to), to)
)
);
return entityManager.createQuery(criteria).getResultList();
}
public List<ChatMessage> listByReceivedToAndFrom(Boolean received, XmppUser to, XmppUser from) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<ChatMessage> criteria = criteriaBuilder.createQuery(ChatMessage.class);
Root<ChatMessage> root = criteria.from(ChatMessage.class);
criteria.select(root);
criteria.where(
criteriaBuilder.and(
criteriaBuilder.equal(root.get(ChatMessage_.received), received),
criteriaBuilder.equal(root.get(ChatMessage_.to), to),
criteriaBuilder.equal(root.get(ChatMessage_.from), from)
)
);
return entityManager.createQuery(criteria).getResultList();
}
public Long countByTo(XmppUser to) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<Long> criteria = criteriaBuilder.createQuery(Long.class);
Root<ChatMessage> root = criteria.from(ChatMessage.class);
criteria.select(criteriaBuilder.count(root));
criteria.where(criteriaBuilder.equal(root.get(ChatMessage_.to), to));
return entityManager.createQuery(criteria).getSingleResult();
}
public Long countByToAndFrom(XmppUser to, XmppUser from) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<Long> criteria = criteriaBuilder.createQuery(Long.class);
Root<ChatMessage> root = criteria.from(ChatMessage.class);
criteria.select(criteriaBuilder.count(root));
criteria.where(
criteriaBuilder.and(
criteriaBuilder.equal(root.get(ChatMessage_.to), to),
criteriaBuilder.equal(root.get(ChatMessage_.from), from)
)
);
return entityManager.createQuery(criteria).getSingleResult();
}
public ChatMessage updateReceived(ChatMessage chatMessage, Boolean received) {
chatMessage.setReceived(received);
getEntityManager().persist(chatMessage);
return chatMessage;
}
} | [
"antti.leppa@foyt.fi"
] | antti.leppa@foyt.fi |
16811cbf0c3561a315562ab0a90b9a4d463abe9d | 2a5a567c911a102be5ab6537c66b729c1033df70 | /src/com/aggfi/digest/client/ui/RunnableOnTabSelect.java | 23b7f11a5dbd90d37008d7cb192bde8ce90efebe | [] | no_license | vega113/DigestBottyNGadget | c55cbcabbc218b854e9c3862c7261f8cfe41739b | 5b80803375fe00176ec8af418f48f01a42f540b6 | refs/heads/master | 2021-01-01T18:17:43.800574 | 2010-10-16T09:54:56 | 2010-10-16T09:54:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | package com.aggfi.digest.client.ui;
public interface RunnableOnTabSelect {
public abstract Runnable getRunOnTabSelect();
public abstract String getName();
}
| [
"vega113@gmail.com"
] | vega113@gmail.com |
af4f0eef4b4967063ced278dedda30f1469fc83d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/20/20_8fd4f414bc6c8ecaf77f82693cbb3bbefaf69a9a/BarAPI/20_8fd4f414bc6c8ecaf77f82693cbb3bbefaf69a9a_BarAPI_t.java | f368bb07a05a213f3f0f97fb4e3289965f034f21 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 6,491 | java | package me.confuser.barapi;
import java.util.HashMap;
import me.confuser.barapi.nms.FakeDragon;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
/**
* Allows plugins to safely set a health bar message.
*
* @author James Mortemore
*/
public class BarAPI extends JavaPlugin implements Listener {
private static HashMap<String, FakeDragon> players = new HashMap<String, FakeDragon>();
private static HashMap<String, Integer> timers = new HashMap<String, Integer>();
private static BarAPI plugin;
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
getLogger().info("Loaded");
plugin = this;
/* Test
plugin.getServer().getScheduler().runTaskTimer(plugin, new Runnable() {
@Override
public void run() {
for (Player player : plugin.getServer().getOnlinePlayers()) {
BarAPI.setMessage(player, ChatColor.AQUA + "Testing BarAPI Testing BarAPI Testing BarAPI Testing BarAPI Testing BarAPI Testing BarAPI Testing BarAPI", 10);
}
}
}, 30L, 300L);*/
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void PlayerLoggout(PlayerQuitEvent event) {
quit(event.getPlayer());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerKick(PlayerKickEvent event) {
quit(event.getPlayer());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerTeleport(final PlayerTeleportEvent event) {
handleTeleport(event.getPlayer(), event.getTo().clone());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerTeleport(final PlayerRespawnEvent event) {
handleTeleport(event.getPlayer(), event.getRespawnLocation().clone());
}
private void handleTeleport(final Player player, final Location loc) {
if (!hasBar(player))
return;
Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
@Override
public void run() {
FakeDragon oldDragon = getDragon(player, "");
float health = oldDragon.health;
String message = oldDragon.name;
Util.sendPacket(player, getDragon(player, "").getDestroyPacket());
players.remove(player.getName());
FakeDragon dragon = addDragon(player, loc, message);
dragon.health = health;
sendDragon(dragon, player);
}
}, 2L);
}
private void quit(Player player) {
removeBar(player);
}
public static void setMessage(Player player, String message) {
FakeDragon dragon = getDragon(player, message);
dragon.name = cleanMessage(message);
dragon.health = FakeDragon.MAX_HEALTH;
cancelTimer(player);
sendDragon(dragon, player);
}
public static void setMessage(Player player, String message, float percent) {
FakeDragon dragon = getDragon(player, message);
dragon.name = cleanMessage(message);
dragon.health = (percent / 100f) * FakeDragon.MAX_HEALTH;
cancelTimer(player);
sendDragon(dragon, player);
}
public static void setMessage(final Player player, String message, int seconds) {
FakeDragon dragon = getDragon(player, message);
dragon.name = cleanMessage(message);
dragon.health = FakeDragon.MAX_HEALTH;
final int dragonHealthMinus = FakeDragon.MAX_HEALTH / seconds;
cancelTimer(player);
timers.put(player.getName(), Bukkit.getScheduler().runTaskTimer(plugin, new BukkitRunnable() {
@Override
public void run() {
FakeDragon drag = getDragon(player, "");
drag.health -= dragonHealthMinus;
if (drag.health <= 0) {
removeBar(player);
cancelTimer(player);
} else {
sendDragon(drag, player);
}
}
}, 20L, 20L).getTaskId());
sendDragon(dragon, player);
}
public static boolean hasBar(Player player) {
return players.get(player.getName()) != null;
}
public static void removeBar(Player player) {
if (!hasBar(player))
return;
Util.sendPacket(player, getDragon(player, "").getDestroyPacket());
players.remove(player.getName());
cancelTimer(player);
}
public static void setHealth(Player player, float percent) {
if (!hasBar(player))
return;
FakeDragon dragon = getDragon(player, "");
dragon.health = (percent / 100f) * FakeDragon.MAX_HEALTH;
cancelTimer(player);
sendDragon(dragon, player);
}
public static float getHealth(Player player) {
if (!hasBar(player))
return -1;
return getDragon(player, "").health;
}
public static String getMessage(Player player) {
if (!hasBar(player))
return "";
return getDragon(player, "").name;
}
private static String cleanMessage(String message) {
if (message.length() > 64)
message = message.substring(0, 63);
return message;
}
private static void cancelTimer(Player player) {
Integer timerID = timers.remove(player.getName());
if (timerID != null) {
Bukkit.getScheduler().cancelTask(timerID);
}
}
private static void sendDragon(FakeDragon dragon, Player player) {
Util.sendPacket(player, dragon.getMetaPacket(dragon.getWatcher()));
Util.sendPacket(player, dragon.getTeleportPacket(player.getLocation().add(0, -200, 0)));
}
private static FakeDragon getDragon(Player player, String message) {
if (hasBar(player)) {
return players.get(player.getName());
} else
return addDragon(player, cleanMessage(message));
}
private static FakeDragon addDragon(Player player, String message) {
FakeDragon dragon = Util.newDragon(message, player.getLocation().add(0, -200, 0));
Util.sendPacket(player, dragon.getSpawnPacket());
players.put(player.getName(), dragon);
return dragon;
}
private static FakeDragon addDragon(Player player, Location loc, String message) {
FakeDragon dragon = Util.newDragon(message, loc.add(0, -200, 0));
Util.sendPacket(player, dragon.getSpawnPacket());
players.put(player.getName(), dragon);
return dragon;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
8b31a4401cf1264745c9497025defe34bb1b16d2 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/JacksonDatabind-105/com.fasterxml.jackson.databind.deser.std.JdkDeserializers/BBC-F0-opt-70/tests/20/com/fasterxml/jackson/databind/deser/std/JdkDeserializers_ESTest_scaffolding.java | 7d7ef762261b7ca1435e9af6a1ac6dfb372b8bba | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 6,660 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Oct 21 16:57:22 GMT 2021
*/
package com.fasterxml.jackson.databind.deser.std;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class JdkDeserializers_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "com.fasterxml.jackson.databind.deser.std.JdkDeserializers";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
/*No java.lang.System property to set*/
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(JdkDeserializers_ESTest_scaffolding.class.getClassLoader() ,
"com.fasterxml.jackson.databind.exc.InvalidFormatException",
"com.fasterxml.jackson.databind.exc.MismatchedInputException",
"com.fasterxml.jackson.databind.jsontype.TypeDeserializer",
"com.fasterxml.jackson.core.Versioned",
"com.fasterxml.jackson.databind.util.AccessPattern",
"com.fasterxml.jackson.databind.deser.std.JdkDeserializers",
"com.fasterxml.jackson.databind.util.ByteBufferBackedOutputStream",
"com.fasterxml.jackson.databind.DatabindContext",
"com.fasterxml.jackson.databind.DeserializationFeature",
"com.fasterxml.jackson.core.type.ResolvedType",
"com.fasterxml.jackson.databind.deser.std.StdDeserializer",
"com.fasterxml.jackson.databind.MapperFeature",
"com.fasterxml.jackson.databind.DeserializationConfig",
"com.fasterxml.jackson.databind.deser.std.UUIDDeserializer",
"com.fasterxml.jackson.databind.deser.std.FromStringDeserializer$Std",
"com.fasterxml.jackson.databind.deser.ResolvableDeserializer",
"com.fasterxml.jackson.databind.cfg.MapperConfigBase",
"com.fasterxml.jackson.databind.introspect.AnnotatedMember",
"com.fasterxml.jackson.databind.JavaType",
"com.fasterxml.jackson.databind.JsonDeserializer",
"com.fasterxml.jackson.core.JsonParseException",
"com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase",
"com.fasterxml.jackson.databind.deser.impl.ObjectIdReader",
"com.fasterxml.jackson.databind.util.Named",
"com.fasterxml.jackson.databind.deser.std.ByteBufferDeserializer",
"com.fasterxml.jackson.databind.deser.ContextualDeserializer",
"com.fasterxml.jackson.databind.DeserializationContext",
"com.fasterxml.jackson.core.JsonParser",
"com.fasterxml.jackson.databind.deser.std.FromStringDeserializer",
"com.fasterxml.jackson.databind.deser.NullValueProvider",
"com.fasterxml.jackson.databind.BeanProperty",
"com.fasterxml.jackson.core.JsonProcessingException",
"com.fasterxml.jackson.databind.deser.std.StdDelegatingDeserializer",
"com.fasterxml.jackson.databind.introspect.Annotated",
"com.fasterxml.jackson.databind.cfg.ConfigFeature",
"com.fasterxml.jackson.databind.util.NameTransformer",
"com.fasterxml.jackson.databind.deser.std.StackTraceElementDeserializer",
"com.fasterxml.jackson.databind.cfg.MapperConfig",
"com.fasterxml.jackson.databind.deser.std.AtomicBooleanDeserializer",
"com.fasterxml.jackson.databind.introspect.ClassIntrospector$MixInResolver",
"com.fasterxml.jackson.databind.JsonMappingException",
"com.fasterxml.jackson.databind.deser.SettableBeanProperty",
"com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(JdkDeserializers_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"com.fasterxml.jackson.databind.JsonDeserializer",
"com.fasterxml.jackson.databind.DeserializationFeature",
"com.fasterxml.jackson.databind.deser.std.StdDeserializer",
"com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer",
"com.fasterxml.jackson.databind.deser.std.FromStringDeserializer",
"com.fasterxml.jackson.databind.deser.std.JdkDeserializers",
"com.fasterxml.jackson.databind.deser.std.AtomicBooleanDeserializer",
"com.fasterxml.jackson.databind.util.AccessPattern",
"com.fasterxml.jackson.databind.deser.std.StackTraceElementDeserializer",
"com.fasterxml.jackson.databind.deser.std.ByteBufferDeserializer",
"com.fasterxml.jackson.databind.deser.std.UUIDDeserializer"
);
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
a3d1d94ec8dcfd5a6db9f31702e306e24a2bb084 | 96ab59a64daf3d99676cde1cdc92d7201a978d6b | /jaulp.wicket.components/src/main/java/de/alpharogroup/wicket/components/sign/in/SigninPanel.java | 97ed1bf84f1ce1f03a90c4aa20da31ccef26d46e | [
"Apache-2.0"
] | permissive | blowupyourchains/jaulp.wicket | 3c3cb5e269e558eacef1f9779446f96eaebbf316 | 28ede8702e0f7da8e4d4bdd678cb331d3264b89d | refs/heads/master | 2021-01-14T12:57:28.950227 | 2015-09-27T16:47:35 | 2015-09-27T16:47:35 | 43,255,209 | 0 | 0 | null | 2015-09-27T16:50:58 | 2015-09-27T16:50:56 | null | UTF-8 | Java | false | false | 5,019 | java | /**
* Copyright (C) 2010 Asterios Raptis
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.alpharogroup.wicket.components.sign.in;
import static org.wicketeer.modelfactory.ModelFactory.from;
import static org.wicketeer.modelfactory.ModelFactory.model;
import lombok.Getter;
import org.apache.wicket.Component;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.form.EmailTextField;
import org.apache.wicket.markup.html.form.PasswordTextField;
import org.apache.wicket.model.IModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.alpharogroup.auth.models.SignInModel;
import de.alpharogroup.wicket.base.BasePanel;
import de.alpharogroup.wicket.base.util.resource.ResourceModelFactory;
import de.alpharogroup.wicket.components.labeled.textfield.LabeledEmailTextFieldPanel;
import de.alpharogroup.wicket.components.labeled.textfield.LabeledPasswordTextFieldPanel;
/**
* The Class {@link SigninPanel}.
*/
public class SigninPanel<T extends SignInModel> extends BasePanel<T>
{
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The Constant LOGGER. */
protected static final Logger LOGGER = LoggerFactory.getLogger(SigninPanel.class);
/** The email. */
@Getter
private final Component email;
/** The password. */
@Getter
private final Component password;
/**
* Instantiates a new {@link SigninPanel}.
*
* @param id
* the id
* @param model
* the model
*/
public SigninPanel(final String id, final IModel<T> model)
{
super(id, model);
add(email = newEmailTextField("email", model));
add(password = newPasswordTextField("password", model));
}
/**
* Factory method for creating the EmailTextField for the email. This method is invoked in the
* constructor from the derived classes and can be overridden so users can provide their own
* version of a EmailTextField for the email.
*
* @param id
* the id
* @param model
* the model
* @return the text field
*/
protected Component newEmailTextField(final String id, final IModel<T> model)
{
final IModel<String> labelModel = ResourceModelFactory.newResourceModel(
"global.email.label", this);
final IModel<String> placeholderModel = ResourceModelFactory.newResourceModel(
"global.enter.your.email.label", this);
final LabeledEmailTextFieldPanel<T> emailTextField = new LabeledEmailTextFieldPanel<T>(id,
model, labelModel)
{
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
protected EmailTextField newEmailTextField(final String id, final IModel<T> m)
{
final EmailTextField emailTextField = new EmailTextField(id, model(from(
model.getObject()).getEmail()));
emailTextField.setOutputMarkupId(true);
emailTextField.setRequired(true);
if (placeholderModel != null)
{
emailTextField.add(new AttributeAppender("placeholder", placeholderModel));
}
return emailTextField;
}
};
return emailTextField;
}
/**
* Factory method for creating the EmailTextField for the password. This method is invoked in
* the constructor from the derived classes and can be overridden so users can provide their own
* version of a EmailTextField for the password.
*
* @param id
* the id
* @param model
* the model
* @return the text field
*/
protected Component newPasswordTextField(final String id, final IModel<T> model)
{
final IModel<String> labelModel = ResourceModelFactory.newResourceModel(
"global.password.label", this);
final IModel<String> placeholderModel = ResourceModelFactory.newResourceModel(
"global.enter.your.password.label", this);
final LabeledPasswordTextFieldPanel<T> pwTextField = new LabeledPasswordTextFieldPanel<T>(
id, model, labelModel)
{
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
protected PasswordTextField newPasswordTextField(final String id, final IModel<T> model)
{
final PasswordTextField pwTextField = new PasswordTextField(id, model(from(model)
.getPassword()));
pwTextField.setOutputMarkupId(true);
if (placeholderModel != null)
{
pwTextField.add(new AttributeAppender("placeholder", placeholderModel));
}
return pwTextField;
}
};
return pwTextField;
}
}
| [
"asterios.raptis@gmx.net"
] | asterios.raptis@gmx.net |
11843374ee460fb07284086f092906e607eb1010 | 2fd9d77d529e9b90fd077d0aa5ed2889525129e3 | /DecompiledViberSrc/app/src/main/java/com/google/android/gms/wearable/internal/zzdb.java | 5b5feaccd9330603cef4bdeb4c0000fc286f3df4 | [] | no_license | cga2351/code | 703f5d49dc3be45eafc4521e931f8d9d270e8a92 | 4e35fb567d359c252c2feca1e21b3a2a386f2bdb | refs/heads/master | 2021-07-08T15:11:06.299852 | 2021-05-06T13:22:21 | 2021-05-06T13:22:21 | 60,314,071 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | package com.google.android.gms.wearable.internal;
import com.google.android.gms.common.data.DataBufferRef;
import com.google.android.gms.common.data.DataHolder;
import com.google.android.gms.wearable.DataItemAsset;
public final class zzdb extends DataBufferRef
implements DataItemAsset
{
public zzdb(DataHolder paramDataHolder, int paramInt)
{
super(paramDataHolder, paramInt);
}
public final String getDataItemKey()
{
return getString("asset_key");
}
public final String getId()
{
return getString("asset_id");
}
}
/* Location: E:\Study\Tools\apktool2_2\dex2jar-0.0.9.15\classes_viber_2_dex2jar.jar
* Qualified Name: com.google.android.gms.wearable.internal.zzdb
* JD-Core Version: 0.6.2
*/ | [
"yu.liang@navercorp.com"
] | yu.liang@navercorp.com |
62dd9272f81ffcf22f85b3794c401f05d43da515 | 9a68117c57f813c959bac2cebfd4f2b03e686aa6 | /src/main/java/nl/webservices/www/soap/AccountGetCreationStatusResponseType.java | 7d416466009175a6ebe15c1df2e49920e920f1a5 | [] | no_license | mytestrepofolder/cached-soap-webservices | dc394ba2cbabe58aca4516c623f46cf75021e46c | ce29a5e914b2f8e6963ef876d3558c74f0c47103 | refs/heads/master | 2020-12-02T16:22:55.920937 | 2017-07-07T13:55:41 | 2017-07-07T13:55:41 | 96,543,288 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,559 | java | /**
* AccountGetCreationStatusResponseType.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package nl.webservices.www.soap;
public class AccountGetCreationStatusResponseType implements java.io.Serializable {
private int accountid;
public AccountGetCreationStatusResponseType() {
}
public AccountGetCreationStatusResponseType(
int accountid) {
this.accountid = accountid;
}
/**
* Gets the accountid value for this AccountGetCreationStatusResponseType.
*
* @return accountid
*/
public int getAccountid() {
return accountid;
}
/**
* Sets the accountid value for this AccountGetCreationStatusResponseType.
*
* @param accountid
*/
public void setAccountid(int accountid) {
this.accountid = accountid;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof AccountGetCreationStatusResponseType)) return false;
AccountGetCreationStatusResponseType other = (AccountGetCreationStatusResponseType) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
this.accountid == other.getAccountid();
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
_hashCode += getAccountid();
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(AccountGetCreationStatusResponseType.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.webservices.nl/soap/", "accountGetCreationStatusResponseType"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("accountid");
elemField.setXmlName(new javax.xml.namespace.QName("http://www.webservices.nl/soap/", "accountid"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| [
"Plabon.Kakoti@shell.com"
] | Plabon.Kakoti@shell.com |
98af34296fd949d53fc5b302d3dbb764974c91da | d76d52b13045d775ddf3df06710fbec780d9dcd5 | /src/main/java/net/sharplab/epub/konjac/domain/service/EPubFileServiceImpl.java | a41e81bbc8f5ef9a17f21561aabc131026467b3f | [
"Apache-2.0"
] | permissive | httpsgithu/epub-konjac | 62224f03e0efcdb9a8a2d0b433c1b3e38cd732c6 | a400606fbfb45136f37da6c8a571074ebdd49fab | refs/heads/master | 2022-02-08T01:51:56.146640 | 2019-01-02T03:00:34 | 2019-01-02T03:00:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,804 | java | package net.sharplab.epub.konjac.domain.service;
import net.sharplab.epub.konjac.domain.model.EPubChapter;
import net.sharplab.epub.konjac.domain.model.EPubContentFile;
import net.sharplab.epub.konjac.domain.model.EPubFile;
import net.sharplab.epub.konjac.domain.provider.epub.EPubContentFileProvider;
import net.sharplab.epub.konjac.domain.repository.EPubFileRepository;
import net.sharplab.epub.konjac.domain.repository.TranslatorOption;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UncheckedIOException;
import java.util.List;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
* EPubファイルサービス
*/
@Service
public class EPubFileServiceImpl implements EPubFileService {
private final Logger logger = LoggerFactory.getLogger(EPubFileServiceImpl.class);
private final TranslatorService translatorService;
private final EPubFileRepository ePubFileRepository;
private final List<EPubContentFileProvider> ePubContentFileProviders;
@Autowired
public EPubFileServiceImpl(TranslatorService translatorService, EPubFileRepository ePubFileRepository, List<EPubContentFileProvider> ePubContentFileProviders) {
this.translatorService = translatorService;
this.ePubFileRepository = ePubFileRepository;
this.ePubContentFileProviders = ePubContentFileProviders;
}
@Override
public void translateEPubFile(File source, OutputStream outputStream, TranslatorOption translatorOption){
EPubFile ePubFile = ePubFileRepository.read(source);
List<EPubContentFile> contentFiles = ePubFile.getContentFiles(ePubContentFileProviders);
contentFiles = contentFiles.stream().map( contentFile -> {
if(contentFile instanceof EPubChapter){
EPubChapter ePubChapter = ((EPubChapter) contentFile).translate(translatorService, translatorOption);
logger.info("{} is translated.", ePubChapter.getName());
return ePubChapter;
}
else {
return contentFile;
}
}).collect(Collectors.toList());
try(ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)){
for(EPubContentFile contentFile : contentFiles){
ZipEntry zipEntry = new ZipEntry(contentFile.getName());
zipOutputStream.putNextEntry(zipEntry);
zipOutputStream.write(contentFile.getData());
}
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
}
}
| [
"mail@ynojima.net"
] | mail@ynojima.net |
3a7b19b0591bdac15bc3771997449cb3ab1f96be | d9432ccc9c8e7e36fca306e8f91b4b22b13bba77 | /src/main/java/org/htmlunit/cssparser/dom/CSSStyleSheetListImpl.java | 9305621998e93e51c1b5c637e1b76e90a758aa6d | [
"Apache-2.0"
] | permissive | HtmlUnit/htmlunit-cssparser | 337e7b48f425e0145b0676e4e574e8a1c7bee96c | f60e5c6c54992cb5897f7cdf16cfbb24adc771a1 | refs/heads/master | 2023-09-01T02:33:22.529900 | 2023-08-22T21:48:28 | 2023-08-23T17:32:37 | 121,845,207 | 5 | 10 | Apache-2.0 | 2023-09-11T21:39:50 | 2018-02-17T10:13:53 | CSS | UTF-8 | Java | false | false | 3,364 | java | /*
* Copyright (c) 2019-2023 Ronald Brill.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.htmlunit.cssparser.dom;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.htmlunit.cssparser.util.ParserUtils;
/**
* Implementation of StyleSheetList.
*
* @author Ronald Brill
*/
public class CSSStyleSheetListImpl {
private List<CSSStyleSheetImpl> cssStyleSheets_;
/**
* @return the list of style sheets
*/
public List<CSSStyleSheetImpl> getCSSStyleSheets() {
if (cssStyleSheets_ == null) {
cssStyleSheets_ = new ArrayList<>();
}
return cssStyleSheets_;
}
/**
* @return the number of style sheets
*/
public int getLength() {
return getCSSStyleSheets().size();
}
/**
* Adds a CSSStyleSheet.
*
* @param cssStyleSheet the CSSStyleSheet
*/
public void add(final CSSStyleSheetImpl cssStyleSheet) {
getCSSStyleSheets().add(cssStyleSheet);
}
// end StyleSheetList
/**
* Merges all StyleSheets in this list into one.
*
* @return the new (merged) StyleSheet
*/
public CSSStyleSheetImpl merge() {
final CSSStyleSheetImpl merged = new CSSStyleSheetImpl();
final CSSRuleListImpl cssRuleList = new CSSRuleListImpl();
final Iterator<CSSStyleSheetImpl> it = getCSSStyleSheets().iterator();
while (it.hasNext()) {
final CSSStyleSheetImpl cssStyleSheet = it.next();
final CSSMediaRuleImpl cssMediaRule = new CSSMediaRuleImpl(merged, null, cssStyleSheet.getMedia());
cssMediaRule.setRuleList(cssStyleSheet.getCssRules());
cssRuleList.add(cssMediaRule);
}
merged.setCssRules(cssRuleList);
merged.setMediaText("all");
return merged;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof CSSStyleSheetListImpl)) {
return false;
}
final CSSStyleSheetListImpl ssl = (CSSStyleSheetListImpl) obj;
return equalsStyleSheets(ssl);
}
private boolean equalsStyleSheets(final CSSStyleSheetListImpl ssl) {
if ((ssl == null) || (getLength() != ssl.getLength())) {
return false;
}
int i = 0;
for (final CSSStyleSheetImpl styleSheet : cssStyleSheets_) {
final CSSStyleSheetImpl styleSheet2 = ssl.cssStyleSheets_.get(i);
if (!ParserUtils.equals(styleSheet, styleSheet2)) {
return false;
}
i++;
}
return true;
}
@Override
public int hashCode() {
int hash = ParserUtils.HASH_SEED;
hash = ParserUtils.hashCode(hash, cssStyleSheets_);
return hash;
}
}
| [
"rbri@rbri.de"
] | rbri@rbri.de |
99749589195872eba16dce46758174bbc7e44804 | 3b368f80eef69aa8c33cb616248db07d06a5b3d9 | /server/src/main/java/au/com/codeka/warworlds/server/store/base/StatementBuilder.java | 69bba37f9027799e6afe2f15981b9830dcaf3ac4 | [
"MIT"
] | permissive | UnforeseenOcean/wwmmo | 2a6f1ee489f2247826d39ce005724fcbe69458f6 | 76abb755d4c06309a01caecab77a5b74f5abad22 | refs/heads/master | 2021-01-22T22:57:32.133999 | 2017-05-13T06:47:46 | 2017-05-13T06:47:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,218 | java | package au.com.codeka.warworlds.server.store.base;
import org.sqlite.javax.SQLiteConnectionPoolDataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Types;
import java.util.ArrayList;
import javax.annotation.Nullable;
import javax.sql.PooledConnection;
import au.com.codeka.warworlds.common.Log;
import au.com.codeka.warworlds.server.store.StoreException;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Base class for {@link StoreReader} and {@link StoreWriter} that handling building the query.
*/
@SuppressWarnings("unchecked")
class StatementBuilder<T extends StatementBuilder> implements AutoCloseable {
private static final Log log = new Log("StatementBuilder");
@Nullable protected final Transaction transaction;
protected PreparedStatement stmt;
protected Connection conn;
private String sql;
private ArrayList<Object> params;
/**
* We store any errors we get building the statement and throw it when it comes time to execute.
* In reality, it should be rare, since it would be an indication of programming error.
*/
protected SQLException e;
StatementBuilder(SQLiteConnectionPoolDataSource dataSource, @Nullable Transaction transaction) {
this.transaction = transaction;
try {
if (transaction == null) {
conn = dataSource.getPooledConnection().getConnection();
} else {
conn = transaction.getConnection();
}
} catch (SQLException e) {
log.error("Unexpected.", e);
}
}
public T stmt(String sql) {
this.sql = checkNotNull(sql);
try {
stmt = conn.prepareStatement(sql);
params = new ArrayList<>();
} catch (SQLException e) {
log.error("Unexpected error preparing statement.", e);
this.e = e;
}
return (T) this;
}
public T param(int index, @Nullable String value) {
checkNotNull(stmt, "stmt() must be called before param()");
try {
if (value == null) {
stmt.setNull(index + 1, Types.VARCHAR);
} else {
stmt.setString(index + 1, value);
}
saveParam(index, value);
} catch (SQLException e) {
log.error("Unexpected error setting parameter.", e);
this.e = e;
}
return (T) this;
}
public T param(int index, @Nullable Double value) {
checkNotNull(stmt, "stmt() must be called before param()");
try {
if (value == null) {
stmt.setNull(index + 1, Types.DOUBLE);
} else {
stmt.setDouble(index + 1, value);
}
saveParam(index, value);
} catch (SQLException e) {
log.error("Unexpected error setting parameter.", e);
this.e = e;
}
return (T) this;
}
public T param(int index, @Nullable Long value) {
checkNotNull(stmt, "stmt() must be called before param()");
try {
if (value == null) {
stmt.setNull(index + 1, Types.INTEGER);
} else {
stmt.setLong(index + 1, value);
}
saveParam(index, value);
} catch (SQLException e) {
log.error("Unexpected error setting parameter.", e);
this.e = e;
}
return (T) this;
}
public T param(int index, @Nullable Integer value) {
checkNotNull(stmt, "stmt() must be called before param()");
try {
if (value == null) {
stmt.setNull(index + 1, Types.INTEGER);
} else {
stmt.setInt(index + 1, value);
}
saveParam(index, value);
} catch (SQLException e) {
log.error("Unexpected error setting parameter.", e);
this.e = e;
}
return (T) this;
}
public T param(int index, @Nullable byte[] value) {
checkNotNull(stmt, "stmt() must be called before param()");
try {
if (value == null) {
stmt.setNull(index + 1, Types.BLOB);
} else {
stmt.setBytes(index + 1, value);
}
saveParam(index, value);
} catch (SQLException e) {
log.error("Unexpected error setting parameter.", e);
this.e = e;
}
return (T) this;
}
public void execute() throws StoreException {
if (e != null) {
throw new StoreException(e);
}
checkNotNull(stmt, "stmt() must be called before param()");
long startTime = System.nanoTime();
try {
stmt.execute();
} catch (SQLException e) {
throw new StoreException(e);
} finally {
long endTime = System.nanoTime();
log.debug("%.2fms %s", (endTime - startTime) / 1000000.0, debugSql(sql, params));
}
}
@Override
public void close() throws StoreException {
if (transaction != null) {
try {
conn.close();
} catch(SQLException e) {
throw new StoreException(e);
}
}
}
private void saveParam(int index, Object value) {
while (params.size() <= index) {
params.add(null);
}
params.set(index, value);
}
private static String debugSql(String sql, ArrayList<Object> params) {
sql = sql.replace("\n", " ");
sql = sql.replaceAll(" +", " ");
if (sql.length() > 70) {
sql = sql.substring(0, 68) + "...";
}
for (int i = 0; i < params.size(); i++) {
sql += " ; ";
sql += params.get(i);
}
return sql;
}
}
| [
"dean@codeka.com.au"
] | dean@codeka.com.au |
46538d6b1bce9ece787324911c9f794d0df6ed0c | eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3 | /tags/2008-12-04/seasar2-2.4.33/s2jdbc-it/src/test/java/org/seasar/extension/jdbc/it/auto/select/AutoSelectIterationCallbackTest.java | 0e1c083fdf9771f4ab752657d5515558b4db55aa | [] | no_license | svn2github/s2container | 54ca27cf0c1200a93e1cb88884eb8226a9be677d | 625adc6c4e1396654a7297d00ec206c077a78696 | refs/heads/master | 2020-06-04T17:15:02.140847 | 2013-08-09T09:38:15 | 2013-08-09T09:38:15 | 10,850,644 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,584 | java | /*
* Copyright 2004-2008 the Seasar Foundation and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.seasar.extension.jdbc.it.auto.select;
import java.math.BigDecimal;
import org.junit.runner.RunWith;
import org.seasar.extension.jdbc.IterationCallback;
import org.seasar.extension.jdbc.IterationContext;
import org.seasar.extension.jdbc.JdbcManager;
import org.seasar.extension.jdbc.it.entity.Department;
import org.seasar.extension.jdbc.it.entity.Employee;
import org.seasar.extension.jdbc.it.entity.NoId;
import org.seasar.framework.unit.Seasar2;
import static junit.framework.Assert.*;
/**
* @author taedium
*
*/
@RunWith(Seasar2.class)
public class AutoSelectIterationCallbackTest {
private JdbcManager jdbcManager;
private IterationCallback<Employee, BigDecimal> salarySumCallback =
new IterationCallback<Employee, BigDecimal>() {
BigDecimal temp = BigDecimal.ZERO;
public BigDecimal iterate(Employee entity, IterationContext context) {
if (entity.salary != null) {
temp = temp.add(entity.salary);
}
return temp;
}
};
/**
*
* @throws Exception
*/
public void testSingleEntity() throws Exception {
BigDecimal sum =
jdbcManager.from(Employee.class).iterate(salarySumCallback);
assertTrue(new BigDecimal(29025).compareTo(sum) == 0);
}
/**
*
* @throws Exception
*/
public void testSingleEntity_limitOnly() throws Exception {
BigDecimal sum =
jdbcManager
.from(Employee.class)
.limit(3)
.orderBy("employeeId")
.iterate(salarySumCallback);
assertTrue(new BigDecimal(3650).compareTo(sum) == 0);
}
/**
*
* @throws Exception
*/
public void testSingleEntity_offset_limit() throws Exception {
BigDecimal sum =
jdbcManager.from(Employee.class).offset(3).limit(5).orderBy(
"employeeId").iterate(salarySumCallback);
assertTrue(new BigDecimal(12525).compareTo(sum) == 0);
}
/**
*
* @throws Exception
*/
public void testSingleEntity_offset_limitZero() throws Exception {
BigDecimal sum =
jdbcManager.from(Employee.class).offset(3).limit(0).orderBy(
"employeeId").iterate(salarySumCallback);
assertTrue(new BigDecimal(25375).compareTo(sum) == 0);
}
/**
*
* @throws Exception
*/
public void testSingleEntity_offsetOnly() throws Exception {
BigDecimal sum =
jdbcManager
.from(Employee.class)
.offset(3)
.orderBy("employeeId")
.iterate(salarySumCallback);
assertTrue(new BigDecimal(25375).compareTo(sum) == 0);
}
/**
*
* @throws Exception
*/
public void testSingleEntity_offsetZero_limit() throws Exception {
BigDecimal sum =
jdbcManager.from(Employee.class).offset(0).limit(3).orderBy(
"employeeId").iterate(salarySumCallback);
assertTrue(new BigDecimal(3650).compareTo(sum) == 0);
}
/**
*
* @throws Exception
*/
public void testSingleEntity_offsetZero_limitZero() throws Exception {
BigDecimal sum =
jdbcManager.from(Employee.class).offset(0).limit(0).orderBy(
"employeeId").iterate(salarySumCallback);
assertTrue(new BigDecimal(29025).compareTo(sum) == 0);
}
/**
*
* @throws Exception
*/
public void testNoId() throws Exception {
int result =
jdbcManager.from(NoId.class).iterate(
new IterationCallback<NoId, Integer>() {
private int count;
public Integer iterate(NoId entity, IterationContext context) {
return ++count;
}
});
assertEquals(2, result);
}
/**
*
* @throws Exception
*/
public void testManyToOne() throws Exception {
BigDecimal sum =
jdbcManager
.from(Employee.class)
.leftOuterJoin("department")
.iterate(new IterationCallback<Employee, BigDecimal>() {
BigDecimal temp = BigDecimal.ZERO;
public BigDecimal iterate(Employee entity,
IterationContext context) {
if ("SALES".equals(entity.department.departmentName)) {
if (entity.salary != null) {
temp = temp.add(entity.salary);
}
}
return temp;
}
});
assertTrue(new BigDecimal(9400).compareTo(sum) == 0);
}
/**
*
* @throws Exception
*/
public void testOneToMany() throws Exception {
BigDecimal sum =
jdbcManager
.from(Department.class)
.leftOuterJoin("employees")
.orderBy("departmentId")
.iterate(new IterationCallback<Department, BigDecimal>() {
BigDecimal temp = BigDecimal.ZERO;
public BigDecimal iterate(Department entity,
IterationContext context) {
for (Employee e : entity.employees) {
if (e.salary != null) {
temp = temp.add(e.salary);
}
}
return temp;
}
});
assertTrue(new BigDecimal(29025).compareTo(sum) == 0);
}
}
| [
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] | koichik@319488c0-e101-0410-93bc-b5e51f62721a |
df131d23778220cfff527a4c406a81c3084c2570 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/17/17_01d432ab497b921c6da1f9d140927186352a325d/HTMLWriterTest/17_01d432ab497b921c6da1f9d140927186352a325d_HTMLWriterTest_t.java | ff97c31b24e24c935d0d47c60bd4339b6d803098 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,888 | java | /*******************************************************************************
* Copyright (c) 2009 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.birt.report.engine.emitter;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import junit.framework.TestCase;
/**
* Unit test for Class HTMLWriter.
*
*/
public class HTMLWriterTest extends TestCase
{
/*
* @see TestCase#setUp()
*/
protected void setUp( ) throws Exception
{
super.setUp( );
}
/**
* Test HTMLWriter getEscapedStr()
* <p>
* Test Case:
* <ul>
* <li>getEscapedStr</li>
* </ul>
* Excepted:
* <ul>
* <li>all the corresponding characters are transformed</li>
* </ul>
*
* @throws IOException
*/
public void testGetEscapeStr( ) throws IOException
{
ByteArrayOutputStream stream = new ByteArrayOutputStream( );
HTMLWriter writer = new HTMLWriter( );
writer.open( stream );
writer.text( "&<>\"1 2 3 4 " ); //$NON-NLS-1$
// flush the buffer
writer.endWriter( );
writer.close( );
assertEquals(
"&<>\"1 2  3   4    ", //$NON-NLS-1$
stream.toString( ).replaceAll( "[\\r|\\t|\\n]*", "" ) ); //$NON-NLS-1$ //$NON-NLS-2$
stream.close( );
}
public void testWhiteSpace( ) throws IOException
{
ByteArrayOutputStream stream = new ByteArrayOutputStream( );
HTMLWriter writer = new HTMLWriter( );
writer.open( stream );
writer.text( " a b \n abc \r\n abc cde" ); //$NON-NLS-1$
// flush the buffer
writer.endWriter( );
writer.close( );
assertEquals(
" a  b <br/>  abc  <br/>   abc cde", //$NON-NLS-1$
stream.toString( ).replaceAll( "[\\r|\\t|\\n]*", "" ) ); //$NON-NLS-1$ //$NON-NLS-2$
stream.close( );
}
public void testStyleEscape( ) throws IOException
{
ByteArrayOutputStream stream = new ByteArrayOutputStream( );
HTMLWriter writer = new HTMLWriter( );
writer.open( stream );
writer
.attribute( "style",
" font-family: Arial,\"Courier New\",\"Franklin Gothic Book\",'ABC{!}\"DEF'" );
// flush the buffer
writer.endWriter( );
writer.close( );
assertEquals(
" style=\" font-family: Arial,"Courier New","Franklin Gothic Book",'ABC{!}"DEF'\"", //$NON-NLS-1$
stream.toString( ).replaceAll( "[\\r|\\t|\\n]*", "" ) ); //$NON-NLS-1$ //$NON-NLS-2$
stream.close( );
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
be314f5fe4e5dc73ffdfe4c196814c8bcca1e1d6 | b796403692acd9cd1dcae90ee41c37ef4bc56f44 | /CobolPorterParser/src/main/java/tr/com/vbt/java/basic/JavaLocalUsing.java | 3eba7dc50fbd945aadde47acbad9269a971001a3 | [] | no_license | latift/PorterEngine | 7626bae05f41ef4e7828e13f2a55bf77349e1bb3 | c78a12f1cb2e72c90b1b22d6f50f71456d0c4345 | refs/heads/master | 2023-09-02T05:16:24.793958 | 2021-09-29T12:02:52 | 2021-09-29T12:02:52 | 95,788,676 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,784 | java | package tr.com.vbt.java.basic;
import org.apache.log4j.Logger;
import tr.com.vbt.java.AbstractJavaElement;
import tr.com.vbt.java.general.JavaClassElement;
import tr.com.vbt.java.general.JavaConstants;
import tr.com.vbt.java.utils.ConvertUtilities;
public class JavaLocalUsing extends AbstractJavaElement {
final static Logger logger = Logger.getLogger(JavaLocalUsing.class);
String localParameterName;
@Override
public boolean writeJavaToStream() throws Exception{
super.writeJavaToStream();
localParameterName = (String) this.parameters.get("localParameterName");
try {
/* JavaClassElement.javaCodeBuffer.append(localParameterName);
JavaClassElement.javaCodeBuffer.append(" ");
JavaClassElement.javaCodeBuffer.append(localParameterName);
JavaClassElement.javaCodeBuffer.append("= new ");
JavaClassElement.javaCodeBuffer.append(localParameterName);
JavaClassElement.javaCodeBuffer.append(JavaConstants.OPEN_NORMAL_BRACKET);
JavaClassElement.javaCodeBuffer.append(JavaConstants.CLOSE_NORMAL_BRACKET);
JavaClassElement.javaCodeBuffer.append(JavaConstants.DOT_WITH_COMMA);
JavaClassElement.javaCodeBuffer.append(JavaConstants.NEW_LINE);*/
} catch (Exception e) {
logger.debug("//Conversion Error"+this.getClass()+this.getSourceCode().getSatirNumarasi()+this.getSourceCode().getCommandName());
JavaClassElement.javaCodeBuffer.append("/*Conversion Error"+this.getClass()+this.getSourceCode().getSatirNumarasi()
+this.getSourceCode().getCommandName()+"*/"+JavaConstants.NEW_LINE);
logger.error("//Conversion Error:"+e.getMessage(), e);
ConvertUtilities.writeconversionErrors(e, this);
}
return true;
}
@Override
public boolean writeChildrenJavaToStream() {
// TODO Auto-generated method stub
return false;
}
}
| [
"latiftopcu@gmail.com"
] | latiftopcu@gmail.com |
3d7eae75c6685814c355ae75ceb2c35045334d60 | b2bfac7b91b2542228931c10c668ca2f67e86b51 | /fba/app/src/main/java/com/ppu/fba/ui/aw.java | aceb21933e7ccf87e78d91ee0ddd87d14a1e5111 | [] | no_license | abozanona/fbaAndroid | b58be90fc94ceec5170d84133c1e8c4e2be8806f | f058eb0317df3e76fd283e285c4dd3dbc354aef5 | refs/heads/master | 2021-09-26T22:05:31.517265 | 2018-11-03T07:21:17 | 2018-11-03T07:21:17 | 108,681,428 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,648 | java | package com.ppu.fba.ui;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.ppu.fba.free.R;
import com.ppu.fba.FirewallManagerService;
import com.ppu.fba.p004a.C0276a;
import com.ppu.fba.p004a.C0284b;
import com.ppu.fba.p007b.C0289a;
import com.ppu.fba.p007b.C0292d;
import com.ppu.fba.p009d.C0308e;
import com.ppu.fba.p009d.C0309f;
import java.util.ArrayList;
public class aw extends BaseAdapter {
final /* synthetic */ ao f1623a;
private ArrayList f1624b;
public aw(ao aoVar, Context context, ArrayList arrayList) {
this.f1623a = aoVar;
this.f1624b = arrayList;
}
public int getCount() {
synchronized (this.f1623a) {
}
int size = this.f1624b.size();
return size > 2 ? 2 : size;
}
public Object getItem(int i) {
return this.f1624b.get(i);
}
public long getItemId(int i) {
return (long) i;
}
public View getView(int i, View view, ViewGroup viewGroup) {
Context context = viewGroup.getContext();
C0276a c0276a = (C0276a) this.f1624b.get(i);
int b = c0276a.m1887b();
C0284b a = c0276a.m1886a();
view = (RelativeLayout) view;
if (view == null) {
LayoutInflater from = LayoutInflater.from(context);
view = c0276a.m1886a() == C0284b.COUNTRY ? (RelativeLayout) from.inflate(R.layout.list_view_item_suggestion_geo, viewGroup, false) : (RelativeLayout) from.inflate(R.layout.list_view_item_suggestion_app, viewGroup, false);
}
ImageView imageView = (ImageView) view.findViewById(R.id.suggestionIcon);
TextView textView = (TextView) view.findViewById(R.id.suggestionName);
TextView textView2 = (TextView) view.findViewById(R.id.suggestionComment);
((ImageView) view.findViewById(R.id.buttonCancel)).setOnClickListener(new ax(this, a, b, context));
String a2;
RadioButton radioButton;
RadioButton radioButton2;
FirewallManagerService a3;
if (c0276a.m1886a() == C0284b.COUNTRY) {
a2 = C0309f.m1974a(b);
textView.setText(C0309f.m1980c(a2));
imageView.setImageDrawable(C0309f.m1984e(a2));
radioButton = (RadioButton) view.findViewById(R.id.buttonAllow);
radioButton2 = (RadioButton) view.findViewById(R.id.buttonBlock);
a3 = FirewallManagerService.m1852a(null);
if (a3 != null) {
C0292d c0292d;
synchronized (a3.f1295d) {
C0292d c0292d2 = (C0292d) a3.f1295d.f1370a.get(Integer.valueOf(b));
if (c0292d2 == null) {
c0292d = new C0292d(C0309f.m1974a(b), b);
a3.f1295d.f1370a.put(Integer.valueOf(b), c0292d);
} else {
c0292d = c0292d2;
}
}
if (c0292d.f1369c == 2) {
radioButton2.setChecked(true);
radioButton.setChecked(false);
} else {
radioButton2.setChecked(false);
radioButton.setChecked(true);
}
radioButton.setOnClickListener(new ay(this, c0292d, context, b, a2));
radioButton2.setOnClickListener(new az(this, c0292d, context, b, a2));
}
} else {
CharSequence a4 = C0308e.m1964a(b);
a2 = C0308e.m1970c(b);
textView.setText(a4);
Bitmap b2 = C0308e.m1967b(b);
if (b2 != null) {
imageView.setImageBitmap(b2);
}
radioButton = (RadioButton) view.findViewById(R.id.buttonAllow);
radioButton2 = (RadioButton) view.findViewById(R.id.buttonWiFiOnly);
RadioButton radioButton3 = (RadioButton) view.findViewById(R.id.buttonBlock);
a3 = FirewallManagerService.m1852a(null);
if (a3 != null) {
C0289a c0289a;
synchronized (a3.f1294c) {
C0289a c0289a2 = (C0289a) a3.f1294c.f1366a.get(Integer.valueOf(b));
if (c0289a2 == null) {
c0289a = new C0289a(b);
a3.f1294c.f1366a.put(Integer.valueOf(b), c0289a);
} else {
c0289a = c0289a2;
}
}
int a5 = c0289a.m1919a();
if (a5 == 2) {
radioButton3.setChecked(true);
radioButton2.setChecked(false);
radioButton.setChecked(false);
} else if (a5 == 1) {
radioButton3.setChecked(false);
radioButton2.setChecked(true);
radioButton.setChecked(false);
} else {
radioButton3.setChecked(false);
radioButton2.setChecked(false);
radioButton.setChecked(true);
}
radioButton.setOnClickListener(new ba(this, c0289a, context, b, a2));
radioButton2.setOnClickListener(new bb(this, c0289a, context, b, a2));
radioButton3.setOnClickListener(new bc(this, c0289a, context, b, a2));
}
}
textView2.setText(c0276a.m1888c());
return view;
}
}
| [
"abozanona@gmail.com"
] | abozanona@gmail.com |
20fb0d79e53f4d6856888e58c7939910f308f429 | d3a6640631e1e689f419b751d380b66f3513979e | /src/main/java/org/bc/jcache/test/DiscardServerHandler.java | c53c55c75cbc0498226cd54832c6d3d97996a254 | [] | no_license | runningship/JCache | 0281b480e329553344dc813decede4ffd71e4c61 | d2c94699ab281859fa62f647d4d007bacabbc080 | refs/heads/master | 2021-01-14T10:36:52.808286 | 2017-02-19T14:51:40 | 2017-02-19T14:51:40 | 82,042,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 878 | java | package org.bc.jcache.test;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.ReferenceCountUtil;
public class DiscardServerHandler extends ChannelInboundHandlerAdapter{
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) { // (2)
ByteBuf in = (ByteBuf) msg;
try {
while (in.isReadable()) { // (1)
System.out.print((char) in.readByte());
System.out.flush();
}
} finally {
ReferenceCountUtil.release(msg); // (2)
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { // (4)
// Close the connection when an exception is raised.
cause.printStackTrace();
ctx.close();
}
}
| [
"runningship@gmail.com"
] | runningship@gmail.com |
8ec7b46416a34626db552ce32ae0f699b6d77756 | a0f38a7b611c863c01d82fc1cc92218a58e7635d | /src/main/java/com/zipcodewilmington/streams/conversions/ListConverter.java | b64540bf490fb4956afdb57e7eb8b2f48da7a534 | [] | no_license | aartikansal/CR-MicroLabs-Streams-And-Lambdas | 0eb573a4896424a75eab8d9be06914726334678e | 56b10df81b2a9ab73113fab9d1a2f15c65c047d4 | refs/heads/master | 2021-04-11T12:27:38.180701 | 2020-03-30T03:10:51 | 2020-03-30T03:10:51 | 249,020,046 | 1 | 0 | null | 2020-03-21T16:52:50 | 2020-03-21T16:52:49 | null | UTF-8 | Java | false | false | 931 | java | package com.zipcodewilmington.streams.conversions;
import com.zipcodewilmington.streams.anthropoid.Person;
import com.zipcodewilmington.streams.anthropoid.PersonFactory;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Created by leon on 5/25/17.
*/
public final class ListConverter extends PersonConversionAgent<List<Person>> {
public ListConverter(List<Person> people) {
super(people);
}
public ListConverter(int collectionSize) {
this(Stream
.generate(new PersonFactory()::createRandomPerson)
.limit(collectionSize)
.collect(Collectors.toList()));
}
@Override
public List<Person> toList() {
return super.objectSequence;
}
//TODO
public Stream<Person> toStream() {
return null;
}
//TODO
public Person[] toArray() {
return null;
}
}
| [
"leon@Leons-MacBook-Pro.local"
] | leon@Leons-MacBook-Pro.local |
8b0fa4d9f2f1b36a1f8b5350cedbd931bd109add | 67c89388e84c4e28d1559ee6665304708e5bf0b2 | /protocols/raft/src/main/java/io/atomix/protocols/raft/impl/DefaultRaftServer.java | 105ff7a6926bfe88a8e5899a285b4367e3a84e46 | [
"Apache-2.0"
] | permissive | maniacs-ops/atomix | f66e4eca65466fdda7dee9aec08b3a1cb51724dc | c28f884754f26edfec3677849e864eb3311738e7 | refs/heads/master | 2021-01-02T08:55:42.350924 | 2017-07-28T23:48:05 | 2017-07-28T23:48:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,796 | java | /*
* Copyright 2015-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.atomix.protocols.raft.impl;
import io.atomix.protocols.raft.RaftServer;
import io.atomix.protocols.raft.cluster.MemberId;
import io.atomix.protocols.raft.cluster.RaftCluster;
import io.atomix.protocols.raft.cluster.RaftMember;
import io.atomix.protocols.raft.service.RaftService;
import io.atomix.protocols.raft.storage.RaftStorage;
import io.atomix.utils.concurrent.Futures;
import io.atomix.utils.logging.ContextualLoggerFactory;
import io.atomix.utils.logging.LoggerContext;
import org.slf4j.Logger;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Supplier;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Provides a standalone implementation of the <a href="http://raft.github.io/">Raft consensus algorithm</a>.
*
* @see RaftService
* @see RaftStorage
*/
public class DefaultRaftServer implements RaftServer {
private final Logger log;
protected final RaftContext context;
private volatile CompletableFuture<RaftServer> openFuture;
private volatile CompletableFuture<Void> closeFuture;
private Consumer<RaftMember> electionListener;
private Consumer<RaftContext.State> stateChangeListener;
private volatile boolean started;
public DefaultRaftServer(RaftContext context) {
this.context = checkNotNull(context, "context cannot be null");
this.log = ContextualLoggerFactory.getLogger(getClass(), LoggerContext.builder(RaftServer.class)
.addValue(context.getName())
.build());
}
@Override
public String name() {
return context.getName();
}
@Override
public RaftCluster cluster() {
return context.getCluster();
}
@Override
public Role getRole() {
return context.getRole();
}
@Override
public void addRoleChangeListener(Consumer<Role> listener) {
context.addRoleChangeListener(listener);
}
@Override
public void removeRoleChangeListener(Consumer<Role> listener) {
context.removeRoleChangeListener(listener);
}
@Override
public CompletableFuture<RaftServer> bootstrap() {
return bootstrap(Collections.emptyList());
}
@Override
public CompletableFuture<RaftServer> bootstrap(MemberId... cluster) {
return bootstrap(Arrays.asList(cluster));
}
@Override
public CompletableFuture<RaftServer> bootstrap(Collection<MemberId> cluster) {
return start(() -> cluster().bootstrap(cluster));
}
@Override
public CompletableFuture<RaftServer> join(MemberId... cluster) {
return join(Arrays.asList(cluster));
}
@Override
public CompletableFuture<RaftServer> join(Collection<MemberId> cluster) {
return start(() -> cluster().join(cluster));
}
/**
* Starts the server.
*/
private CompletableFuture<RaftServer> start(Supplier<CompletableFuture<Void>> joiner) {
if (started)
return CompletableFuture.completedFuture(this);
if (openFuture == null) {
synchronized (this) {
if (openFuture == null) {
CompletableFuture<RaftServer> future = new CompletableFuture<>();
openFuture = future;
joiner.get().whenComplete((result, error) -> {
if (error == null) {
context.awaitState(RaftContext.State.READY, state -> {
started = true;
future.complete(null);
});
} else {
future.completeExceptionally(error);
}
});
}
}
}
return openFuture.whenComplete((result, error) -> {
if (error == null) {
log.info("Server started successfully!");
} else {
log.warn("Failed to start server!");
}
});
}
@Override
public CompletableFuture<RaftServer> promote() {
return context.anoint().thenApply(v -> this);
}
/**
* Returns a boolean indicating whether the server is running.
*
* @return Indicates whether the server is running.
*/
public boolean isRunning() {
return started;
}
/**
* Shuts down the server without leaving the Raft cluster.
*
* @return A completable future to be completed once the server has been shutdown.
*/
public CompletableFuture<Void> shutdown() {
if (!started) {
return Futures.exceptionalFuture(new IllegalStateException("context not open"));
}
CompletableFuture<Void> future = new CompletableFuture<>();
context.getThreadContext().execute(() -> {
started = false;
context.transition(Role.INACTIVE);
future.complete(null);
});
return future.whenCompleteAsync((result, error) -> {
context.close();
started = false;
});
}
/**
* Leaves the Raft cluster.
*
* @return A completable future to be completed once the server has left the cluster.
*/
public CompletableFuture<Void> leave() {
if (!started) {
return CompletableFuture.completedFuture(null);
}
if (closeFuture == null) {
synchronized (this) {
if (closeFuture == null) {
closeFuture = new CompletableFuture<>();
if (openFuture == null) {
cluster().leave().whenComplete((leaveResult, leaveError) -> {
shutdown().whenComplete((shutdownResult, shutdownError) -> {
context.delete();
closeFuture.complete(null);
});
});
} else {
openFuture.whenComplete((openResult, openError) -> {
if (openError == null) {
cluster().leave().whenComplete((leaveResult, leaveError) -> {
shutdown().whenComplete((shutdownResult, shutdownError) -> {
context.delete();
closeFuture.complete(null);
});
});
} else {
closeFuture.complete(null);
}
});
}
}
}
}
return closeFuture;
}
@Override
public String toString() {
return toStringHelper(this)
.add("name", name())
.toString();
}
/**
* Default Raft server builder.
*/
public static class Builder extends RaftServer.Builder {
public Builder(MemberId localMemberId) {
super(localMemberId);
}
@Override
public RaftServer build() {
if (serviceRegistry.size() == 0) {
throw new IllegalStateException("No state machines registered");
}
// If the server name is null, set it to the member ID.
if (name == null) {
name = localMemberId.id();
}
// If the storage is not configured, create a new Storage instance with the configured serializer.
if (storage == null) {
storage = RaftStorage.newBuilder().build();
}
RaftContext raft = new RaftContext(name, type, localMemberId, protocol, storage, serviceRegistry, threadPoolSize);
raft.setElectionTimeout(electionTimeout);
raft.setHeartbeatInterval(heartbeatInterval);
raft.setSessionTimeout(sessionTimeout);
return new DefaultRaftServer(raft);
}
}
}
| [
"jordan.halterman@gmail.com"
] | jordan.halterman@gmail.com |
673f08bfcca9b864e5ecc4766d03cdcf97f53654 | c79553b144512f82b4b88f699952a4b6ad39b78b | /src/main/java/com/madgag/agit/diff/FileDiff.java | 95ebfdff33f7072be4c1540532b41b6b1a8e6359 | [] | no_license | yangjiandong/myAGit | f29476c675cdd972285abf57c1862a1c33dbd811 | 03990e3339b8a64720616d97157fb55a34862710 | refs/heads/master | 2016-09-06T12:59:51.974423 | 2012-08-10T11:44:05 | 2012-08-10T11:44:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,789 | java | /*
* Copyright (c) 2011 Roberto Tyley
*
* This file is part of 'Agit' - an Android Git client.
*
* Agit is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Agit is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.madgag.agit.diff;
import android.util.Log;
import java.io.IOException;
import java.util.List;
import org.eclipse.jgit.diff.DiffEntry;
public class FileDiff {
private static final String TAG = "FD";
private final LineContextDiffer lineContextDiffer;
private final DiffEntry diffEntry;
private List<Hunk> hunks;
public FileDiff(LineContextDiffer lineContextDiffer, DiffEntry diffEntry) {
this.lineContextDiffer = lineContextDiffer;
this.diffEntry = diffEntry;
}
public List<Hunk> getHunks() {
if (hunks == null) {
hunks = calculateHunks();
}
return hunks;
}
private List<Hunk> calculateHunks() {
List<Hunk> h;
try {
h = lineContextDiffer.format(diffEntry);
Log.d(TAG, "Calculated " + h.size() + " hunks for " + diffEntry);
} catch (IOException e) {
throw new RuntimeException(e);
}
return h;
}
public DiffEntry getDiffEntry() {
return diffEntry;
}
}
| [
"young.jiandong@gmail.com"
] | young.jiandong@gmail.com |
ce9566926c9ddf2015d2bb443b9603f62d938002 | 4aa90348abcb2119011728dc067afd501f275374 | /app/src/main/java/com/tencent/mm/plugin/shake/d/a/l$1.java | 92a64fa76f666e66ec01e95e86638d87ca859c61 | [] | no_license | jambestwick/HackWechat | 0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6 | 6a34899c8bfd50d19e5a5ec36a58218598172a6b | refs/heads/master | 2022-01-27T12:48:43.446804 | 2021-12-29T10:36:30 | 2021-12-29T10:36:30 | 249,366,791 | 0 | 0 | null | 2020-03-23T07:48:32 | 2020-03-23T07:48:32 | null | UTF-8 | Java | false | false | 3,625 | java | package com.tencent.mm.plugin.shake.d.a;
import com.tencent.mm.plugin.report.service.g;
import com.tencent.mm.plugin.shake.d.a.a.a;
import com.tencent.mm.protocal.c.bdf;
import com.tencent.mm.protocal.c.bhx;
import com.tencent.mm.sdk.platformtools.bh;
import com.tencent.mm.sdk.platformtools.x;
import java.util.ArrayList;
class l$1 implements a {
final /* synthetic */ l qpX;
l$1(l lVar) {
this.qpX = lVar;
}
public final void a(bdf com_tencent_mm_protocal_c_bdf, long j, boolean z) {
long currentTimeMillis;
if (j > l.a(this.qpX)) {
currentTimeMillis = System.currentTimeMillis() - j;
} else {
currentTimeMillis = System.currentTimeMillis() - l.a(this.qpX);
}
if (com_tencent_mm_protocal_c_bdf != null && !bh.ov(((bhx) com_tencent_mm_protocal_c_bdf).vNZ)) {
boolean a;
bhx com_tencent_mm_protocal_c_bhx = (bhx) com_tencent_mm_protocal_c_bdf;
x.w("Micromsg.ShakeTVService", "resCallback Type:%d, xml:%s", new Object[]{Integer.valueOf(com_tencent_mm_protocal_c_bhx.ktN), com_tencent_mm_protocal_c_bhx.vNZ});
String str = null;
String str2 = null;
if (com_tencent_mm_protocal_c_bhx.vNZ != null) {
com_tencent_mm_protocal_c_bhx.vNZ = com_tencent_mm_protocal_c_bhx.vNZ.trim();
int indexOf = com_tencent_mm_protocal_c_bhx.vNZ.indexOf("<tvinfo>");
if (indexOf > 0) {
str = com_tencent_mm_protocal_c_bhx.vNZ.substring(0, indexOf);
str2 = com_tencent_mm_protocal_c_bhx.vNZ.substring(indexOf);
} else if (indexOf == 0) {
str2 = com_tencent_mm_protocal_c_bhx.vNZ;
} else {
str = com_tencent_mm_protocal_c_bhx.vNZ;
}
}
l.Jg(str2);
switch (com_tencent_mm_protocal_c_bhx.ktN) {
case 0:
a = l.a(this.qpX, str);
break;
case 1:
a = l.b(this.qpX, str);
break;
case 2:
a = l.c(this.qpX, str);
break;
case 3:
a = l.d(this.qpX, str);
break;
case 4:
a = l.e(this.qpX, str);
break;
case 5:
a = l.f(this.qpX, str);
break;
case 6:
a = l.g(this.qpX, str);
break;
default:
x.w("Micromsg.ShakeTVService", "parse unknown type:" + com_tencent_mm_protocal_c_bhx.ktN);
l.a(this.qpX, new ArrayList());
a = false;
break;
}
if (a) {
g.pQN.h(10987, new Object[]{Integer.valueOf(1), "", Integer.valueOf(1), Integer.valueOf((int) (System.currentTimeMillis() - l.a(this.qpX)))});
} else {
g.pQN.h(10987, new Object[]{Integer.valueOf(1), "", Integer.valueOf(5), Long.valueOf(currentTimeMillis)});
}
} else if (z) {
l.a(this.qpX, new ArrayList());
g.pQN.h(10987, new Object[]{Integer.valueOf(1), "", Integer.valueOf(4), Integer.valueOf((int) currentTimeMillis)});
} else {
l.a(this.qpX, new ArrayList());
g.pQN.h(10987, new Object[]{Integer.valueOf(1), "", Integer.valueOf(3), Integer.valueOf((int) currentTimeMillis)});
}
l.bsh();
}
}
| [
"malin.myemail@163.com"
] | malin.myemail@163.com |
5a00ecbb43a8a2e531a9904a6efda701f3801c73 | 58046a11761071763ea6ca9b6dc249240afd68fe | /ev/endrov/script/PLUGIN.java | 6b3ade32279d908329001a2b917b0282aacc08a6 | [] | no_license | dorry123/Endrov | 71be9c63ef30b5e36284745cc6baee1017901ee0 | c60571941bc14e4341fdb1351a48a55aca35b6a7 | refs/heads/master | 2021-01-21T02:46:46.357482 | 2013-10-16T09:17:53 | 2013-10-16T09:17:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 696 | java | /***
* Copyright (C) 2010 Johan Henriksson
* This code is under the Endrov / BSD license. See www.endrov.net
* for the full text and how to cite.
*/
package endrov.script;
import endrov.core.EvPluginDefinition;
public class PLUGIN extends EvPluginDefinition
{
public String getPluginName()
{
return "Scripting";
}
public String getAuthor()
{
return "Johan Henriksson";
}
public boolean systemSupported()
{
return true;
}
public String cite()
{
return "";
}
public String[] requires()
{
return new String[]{};
}
public Class<?>[] getInitClasses()
{
return new Class[]{Script.class};
}
public boolean isDefaultEnabled(){return true;};
}
| [
"mahogny@areta.org"
] | mahogny@areta.org |
b30deaa3365c4f76b91c802d91b0aae4be9c329c | b2a51e48acc915b02d006a3c6df197b894bc0b81 | /app/src/main/java/com/viger/mycode/net/HttpCallBack.java | bb1f23f5f5dd6640a872f992c668db96c50fa8d7 | [] | no_license | tqw214/MyCode | adde4cafe81625302e243f8636a5b6e246e68936 | 1ad7fbed0e7fe269a52c8fdf615d3d2fceef9c20 | refs/heads/master | 2020-09-28T22:39:39.948049 | 2020-09-20T05:57:03 | 2020-09-20T05:57:03 | 226,882,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 130 | java | package com.viger.mycode.net;
public interface HttpCallBack<T> {
void onSuccess(T result);
void onFailed(Exception e);
}
| [
"tqw214@163.com"
] | tqw214@163.com |
7340cfafd20cb75cbdb6f8859da7eec846232615 | b81e5387080c59ba3e62f0044e6e0ba5f2668c25 | /hutool-crypto/src/main/java/com/xiaoleilu/hutool/crypto/symmetric/SymmetricAlgorithm.java | ef20190c82e0f8fc1924477c10f506838b3a964f | [
"Apache-2.0"
] | permissive | AuroraBei/hutool | 9929db69ed9d5613587046b514dec45703b4667e | 33476ef9b3dd00aff568675435bab95c19d371c4 | refs/heads/master | 2022-06-24T22:11:16.041414 | 2017-07-07T12:30:33 | 2017-07-07T12:30:33 | 209,718,234 | 0 | 0 | Apache-2.0 | 2022-06-21T01:54:29 | 2019-09-20T06:12:52 | Java | UTF-8 | Java | false | false | 778 | java | package com.xiaoleilu.hutool.crypto.symmetric;
/**
* 对称算法类型<br>
* see: https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyGenerator
*
* @author Looly
*
*/
public enum SymmetricAlgorithm {
/** 默认的AES加密方式:AES/CBC/PKCS5Padding */
AES("AES"),
ARCFOUR("ARCFOUR"),
Blowfish("Blowfish"),
/** 默认的DES加密方式:DES/ECB/PKCS5Padding */
DES("DES"),
DESede("DESede"),
RC2("RC2"),
PBEWithMD5AndDES("PBEWithMD5AndDES"),
PBEWithSHA1AndDESede("PBEWithSHA1AndDESede"),
PBEWithSHA1AndRC2_40("PBEWithSHA1AndRC2_40");
private String value;
private SymmetricAlgorithm(String value) {
this.value = value;
}
public String getValue() {
return this.value;
}
} | [
"loolly@gmail.com"
] | loolly@gmail.com |
45167d81e57a354764133e88881e5b814e60ae23 | c9106d023a926f5968808a9958449e56a4170612 | /jenax-arq-parent/jenax-arq-constraints/src/test/java/org/aksw/jenax/constraint/api/TestConcatAssignments.java | 1676a0bf531e21761448e332771d287b24ce4884 | [] | no_license | Scaseco/jenax | c6f726fa25fd4b15e05119d05dbafaf44c8f5411 | 58a8dec0b055eaca3f6848cab4b552c9fd19a6ec | refs/heads/develop | 2023-08-24T13:37:16.574857 | 2023-08-24T11:53:24 | 2023-08-24T11:53:24 | 416,700,558 | 5 | 0 | null | 2023-08-03T14:41:53 | 2021-10-13T10:54:14 | Java | UTF-8 | Java | false | false | 1,005 | java | package org.aksw.jenax.constraint.api;
import java.util.Arrays;
import java.util.List;
import org.aksw.jenax.sparql.expr.optimize.util.Alignment;
import org.aksw.jenax.sparql.expr.optimize.util.StringAlignments;
import org.apache.jena.sparql.expr.Expr;
import org.apache.jena.sparql.expr.ExprVar;
import org.apache.jena.sparql.expr.NodeValue;
import org.junit.Test;
public class TestConcatAssignments {
@Test
public void testExpr() {
// Expr r = ConcatAssignments.optimizeRdfTerm(new E_Equals(
// E_StrConcatPermissive.create(NodeValue.makeString("<"), new ExprVar("p"), NodeValue.makeString(">")),
// NodeValue.makeString("<foo>")));
List<Alignment> r = StringAlignments.align(
Arrays.<Expr>asList(NodeValue.makeString("<"), new ExprVar("x"), NodeValue.makeString("-"), new ExprVar("y"), NodeValue.makeString(">")),
Arrays.<Expr>asList(NodeValue.makeString("<foo-b-ar>")));
System.out.println(r);
}
}
| [
"RavenArkadon@googlemail.com"
] | RavenArkadon@googlemail.com |
f53596e62caa56c3acbd7da99e2f3cfbe65e568f | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.minihd.qq/assets/exlibs.1.jar/classes.jar/ifa.java | 4372e5dac67e292f645542e59ffc09807376cb04 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 1,518 | java | import com.tencent.mobileqq.data.EmoticonPackage;
import com.tencent.mobileqq.emoticon.EmojiManager;
public class ifa
implements Runnable
{
public ifa(EmojiManager paramEmojiManager, EmoticonPackage paramEmoticonPackage, boolean paramBoolean) {}
public void run()
{
switch (this.jdField_a_of_type_ComTencentMobileqqDataEmoticonPackage.jobType)
{
default:
this.jdField_a_of_type_ComTencentMobileqqEmoticonEmojiManager.a(this.jdField_a_of_type_ComTencentMobileqqDataEmoticonPackage, this.jdField_a_of_type_ComTencentMobileqqEmoticonEmojiManager.d, this.jdField_a_of_type_Boolean);
return;
case 1:
this.jdField_a_of_type_ComTencentMobileqqEmoticonEmojiManager.a(this.jdField_a_of_type_ComTencentMobileqqDataEmoticonPackage, this.jdField_a_of_type_ComTencentMobileqqEmoticonEmojiManager.b);
return;
case 2:
this.jdField_a_of_type_ComTencentMobileqqEmoticonEmojiManager.b(this.jdField_a_of_type_ComTencentMobileqqDataEmoticonPackage, this.jdField_a_of_type_ComTencentMobileqqEmoticonEmojiManager.c);
return;
}
this.jdField_a_of_type_ComTencentMobileqqEmoticonEmojiManager.b(this.jdField_a_of_type_ComTencentMobileqqDataEmoticonPackage, this.jdField_a_of_type_ComTencentMobileqqEmoticonEmojiManager.e, this.jdField_a_of_type_Boolean);
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.1.jar\classes.jar
* Qualified Name: ifa
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
f8b8e308d7b180ccaa2d62745a65f9fabe03741e | f66fc1aca1c2ed178ac3f8c2cf5185b385558710 | /reladomo/src/test/java/com/gs/fw/common/mithra/test/finalgetter/TxFinalChildDatabaseObject.java | ed48513dd208ebb5bb7fed87b42141c688c2ceff | [
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | goldmansachs/reladomo | 9cd3e60e92dbc6b0eb59ea24d112244ffe01bc35 | a4f4e39290d8012573f5737a4edc45d603be07a5 | refs/heads/master | 2023-09-04T10:30:12.542924 | 2023-07-20T09:29:44 | 2023-07-20T09:29:44 | 68,020,885 | 431 | 122 | Apache-2.0 | 2023-07-07T21:29:52 | 2016-09-12T15:17:34 | Java | UTF-8 | Java | false | false | 731 | java |
/*
Copyright 2016 Goldman Sachs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
package com.gs.fw.common.mithra.test.finalgetter;
public class TxFinalChildDatabaseObject extends TxFinalChildDatabaseObjectAbstract
{
}
| [
"mohammad.rezaei@gs.com"
] | mohammad.rezaei@gs.com |
57a4f2853984aa0a3ab5e6e4a8390a72fd02546d | e563e2bbfa24db53256465479c09c9a49d4c515b | /speechsearch/server/src/main/java/ch/rasc/speechsearch/Application.java | fff023d26cfe6574530097d867803931c05d9141 | [] | no_license | thiagonunesvieira21/blog | a0f46942cb3d603fcfeaee03c3214cdf2e78af2a | 3e3019c11d614562e6617d00fcd224cd0f1cbc71 | refs/heads/master | 2020-03-21T19:19:09.380392 | 2018-06-26T19:35:18 | 2018-06-26T19:35:18 | 138,941,809 | 1 | 1 | null | 2018-06-27T23:07:24 | 2018-06-27T23:07:24 | null | UTF-8 | Java | false | false | 301 | java | package ch.rasc.speechsearch;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| [
"ralphschaer@gmail.com"
] | ralphschaer@gmail.com |
2e7f839411f812d75fec8d485edeadbcc27c9cc4 | 0f2d15e30082f1f45c51fdadc3911472223e70e0 | /src/3.7/plugins/com.perforce.team.ui/src/com/perforce/team/ui/p4v/RevisionGraphRunner.java | 26dac925ecc034fbaa5e10b3423a9b12769c8261 | [
"BSD-2-Clause"
] | permissive | eclipseguru/p4eclipse | a28de6bd211df3009d58f3d381867d574ee63c7a | 7f91b7daccb2a15e752290c1f3399cc4b6f4fa54 | refs/heads/master | 2022-09-04T05:50:25.271301 | 2022-09-01T12:47:06 | 2022-09-01T12:47:06 | 136,226,938 | 2 | 1 | BSD-2-Clause | 2022-09-01T19:42:29 | 2018-06-05T19:45:54 | Java | UTF-8 | Java | false | false | 2,333 | java | /**
* Copyright (c) 2008 Perforce Software. All rights reserved.
*/
package com.perforce.team.ui.p4v;
import java.util.ArrayList;
import java.util.List;
import com.perforce.team.core.p4java.IP4Connection;
import com.perforce.team.ui.P4ConnectionManager;
import com.perforce.team.ui.P4UIUtils;
import com.perforce.team.ui.PerforceUIPlugin;
/**
* @author Kevin Sawicki (ksawicki@perforce.com)
*/
public class RevisionGraphRunner extends P4VRunner {
private String path = null;
private IP4Connection connection = null;
/**
* @param connection
* @param path
*/
public RevisionGraphRunner(IP4Connection connection, String path) {
this.connection = connection;
this.path = path;
}
/**
* @see com.perforce.team.ui.p4v.P4VRunner#getCommand()
*/
@Override
protected List<String> getCommand() {
List<String> args=new ArrayList<String>();
args.add("tree " + this.path); //$NON-NLS-1$
return args;
}
/**
* @see com.perforce.team.ui.p4v.P4VRunner#getConnection()
*/
@Override
protected IP4Connection getConnection() {
return this.connection;
}
/**
* @see com.perforce.team.ui.p4merge.ApplicationRunner#applicationFinished(int)
*/
@Override
protected void applicationFinished(int exitCode) {
if (exitCode != 0) {
PerforceUIPlugin.syncExec(new Runnable() {
public void run() {
P4ConnectionManager.getManager().openInformation(
P4UIUtils.getShell(),
Messages.RevisionGraphRunner_ErrorTitle,
Messages.RevisionGraphRunner_ErrorMessage);
}
});
}
}
/**
* @see com.perforce.team.ui.p4merge.ApplicationRunner#loadFiles()
*/
@Override
protected boolean loadFiles() {
return true;
}
/**
* @see com.perforce.team.ui.p4merge.ApplicationRunner#getApplicationName()
*/
@Override
protected String getApplicationName() {
return Messages.RevisionGraphRunner_Title;
}
/**
* @see com.perforce.team.ui.p4merge.ApplicationRunner#getTaskName()
*/
@Override
protected String getTaskName() {
return this.path;
}
}
| [
"gunnar@wagenknecht.org"
] | gunnar@wagenknecht.org |
ba1b45a722aabbdf697d7faead12b99011d96a1b | 6dbae30c806f661bcdcbc5f5f6a366ad702b1eea | /Corpus/eclipse.jdt.core/517.java | 00986ac0d799ac6579b66c30e52ad9466ac6ede9 | [
"MIT"
] | permissive | SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018 | d3fd21745dfddb2979e8ac262588cfdfe471899f | 0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0 | refs/heads/master | 2020-03-31T15:52:01.005505 | 2018-10-01T23:38:50 | 2018-10-01T23:38:50 | 152,354,327 | 1 | 0 | MIT | 2018-10-10T02:57:02 | 2018-10-10T02:57:02 | null | UTF-8 | Java | false | false | 138 | java | package test0253;
import java.util.*;
public class Test {
public StringBuffer foo() {
return new StringBuffer("");
}
}
| [
"masudcseku@gmail.com"
] | masudcseku@gmail.com |
7369f676380dc3d93c9dbc1dbbc7c8ac7b58ae7a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/27/27_55883998b92f1cdcfec52743678efc25bd9b71f3/AsyncWorkerCreator/27_55883998b92f1cdcfec52743678efc25bd9b71f3_AsyncWorkerCreator_t.java | 27f29dcded16950b9025c0c25562b0607609057c | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,245 | java | /**
* AsyncWorkerCreator
*
* Performs all operations to create, start and stop threaded workers.
*
* @author Ariel Gerardo Rios <mailto:ariel.gerardo.rios@gmail.com>
*
*/
package org.gabrielle.AsyncProcessingExample.command;
import java.util.Properties;
import java.util.UUID;
import org.apache.log4j.Logger;
import org.gabrielle.AsyncProcessingExample.worker.Worker;
/**
* Performs all operations to create, start and stop threaded workers. This
* class is in charge of retain references to all created threads and workers
* for future calls as join or stop. Also it must have methods implementing the
* logic to apply when a signal interrumption arrives.
*
* @author Ariel Gerardo Ríos <mailto:ariel.gerardo.rios@gmail.com>
*/
public class AsyncWorkerCreator {
private static final Logger logger = Logger.getLogger(
"async-worker-creator");
private Worker[] workers;
private Thread[] threads;
/**
* Create all needed workers, indicated by total workers (1 worker per
* thread).
*
*/
public void createWorkers(final UUID uuid, final int nthreads,
final Properties config) {
this.workers = new Worker[nthreads];
this.threads = new Thread[nthreads];
Worker w;
for(int i = 0; i < nthreads; i++) {
w = new Worker(i, config);
// If the worker must have additional resourses, this is the moment
// to give it to them.
this.workers[i] = w;
this.threads[i] = new Thread(w, w.getName());
}
}
/**
* Calls all workers to start execution.
*
*/
public void startWorkers(final UUID uuid){
int nthreads = this.threads.length;
logger.info(String.format("UUID=%s - Starting %d workers ...", uuid,
nthreads));
for (Thread t: this.threads) {
t.start();
}
logger.info(String.format("UUID=%s - Starting workers %d: SUCCESSFUL.",
uuid, nthreads));
}
/**
* Calls all workers to stop exectution.
*
*/
public void stopWorkers(final UUID uuid) {
int nworkers = this.workers.length;
logger.info(String.format("UUID=%s - Stoping %d workers ...",
uuid, nworkers));
for (Worker w: this.workers) {
w.stopExecution();
}
logger.info(String.format("UUID=%s - Stoping %d workers: SUCCESSFUL.",
uuid, nworkers));
}
/**
* Joins all workers til they stop.
*
* @throws InterruptedException
*/
public void joinWorkers(final UUID uuid) throws InterruptedException {
int nthreads = this.threads.length;
logger.info(String.format("UUID=%s - Joining %d workers ...", uuid,
nthreads));
for (Thread t: this.threads) {
t.join();
}
logger.info(String.format("UUID=%s - Joining %d workers: SUCCESSFUL.",
uuid, nthreads));
}
// TODO Signal handling :O
}
// vim:ft=java:
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
420d63cfe5386a4a09482f68ccf896c6ca52e1ae | 1b33bb4e143b18de302ccd5f107e3490ea8b31aa | /learn.java/src/main/java/oc/a/chapters/_5_class_design/implementingInterfaces/defaultInterfaceMethods/multipleInheritance/overload/IAB.java | 6e9bde184d1d6027546997be67703f912429ef45 | [] | no_license | cip-git/learn | db2e4eb297e36db475c734a89d18e98819bdd07f | b6d97f529ed39f25e17b602c00ebad01d7bc2d38 | refs/heads/master | 2022-12-23T16:39:56.977803 | 2022-12-18T13:57:37 | 2022-12-18T13:57:37 | 97,759,022 | 0 | 1 | null | 2020-10-13T17:06:36 | 2017-07-19T20:37:29 | Java | UTF-8 | Java | false | false | 456 | java | package oc.a.chapters._5_class_design.implementingInterfaces.defaultInterfaceMethods.multipleInheritance.overload;
import oc.a.chapters._5_class_design.implementingInterfaces.defaultInterfaceMethods.multipleInheritance.B;
import oc.a.chapters._5_class_design.implementingInterfaces.defaultInterfaceMethods.multipleInheritance.C;
public interface IAB extends IA, IB{
public default void m(B b, C c){
System.out.println("IAB createAndPopulate");
}
}
| [
"ciprian.dorin.tanase@ibm.com"
] | ciprian.dorin.tanase@ibm.com |
597f489d6ab17e1e3b2884e1b688668d2058415b | 3ca934c5e29147bffc57a7212a450681d12b12ce | /Code/functional-testing/hotwire-step-defs/src/main/java/com/hotwire/test/steps/netscaler/NetScalerModelMobileWebApp.java | 4e41e73d1937c03ddd0b297cb5c02be440d228a3 | [] | no_license | amitoj/spring_cucumber | 8af821fd183e8a1ce049a3dc326dac9d80fc3e9a | fd4d207bca1645fb6f0465d1e016bfc607b39b43 | refs/heads/master | 2020-09-04T00:23:35.762856 | 2017-04-19T15:27:51 | 2017-04-19T15:27:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,455 | java | /*
* Copyright 2015 Hotwire. All Rights Reserved.
*
* This software is the proprietary information of Hotwire.
* Use is subject to license terms.
*/
package com.hotwire.test.steps.netscaler;
import com.hotwire.selenium.mobile.MobileHotwireHomePage;
import com.hotwire.selenium.mobile.search.HotelSearchFragment;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import static org.fest.assertions.Assertions.assertThat;
public class NetScalerModelMobileWebApp extends NetScalerModelTemplate {
private void verifyDateFormat(String format, String actualDate) {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
Date expectedDate = simpleDateFormat.parse(actualDate);
assertThat(actualDate).isEqualTo(simpleDateFormat.format(expectedDate));
}
catch (ParseException e) {
throw new AssertionError(String.format("<%s> does not match <%s> format", actualDate, format));
}
}
@Override
public void verifyLocalDateFormat(String format) {
MobileHotwireHomePage mobileHotwireHomePage = new MobileHotwireHomePage(getWebdriverInstance());
HotelSearchFragment hotelSearchFragment = mobileHotwireHomePage.getHotelSearchFragment();
verifyDateFormat(format, hotelSearchFragment.getCheckInDate());
verifyDateFormat(format, hotelSearchFragment.getCheckOutDate());
}
}
| [
"jiniguez@foundationmedicine.com"
] | jiniguez@foundationmedicine.com |
2849e5c32d153e4f3dda7f7ed584ca9465c690c3 | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/mm/g/a/tb$a.java | 2dbe25b6cc56ecd56050b4f38fd9bdb324624e8c | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 289 | java | package com.tencent.mm.g.a;
public final class tb$a
{
public boolean cPo = false;
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes-dex2jar.jar
* Qualified Name: com.tencent.mm.g.a.tb.a
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
e7fbe159fa6f2ea199f463699943510579664fc1 | ae296cb09143290d7dcf03bfac637c835746b77d | /app/src/main/java/com/example/red/magazine/model/ResponseMessage.java | 3b4e8626dd2f42afc67d3d1456ba897df9e79e2a | [] | no_license | messyKassaye/addismalls | 3f5b5b55567da02c77ed6825b2035659574ac01e | 8ab6e8648fdbdcf93c66c73bfce807af14bf239b | refs/heads/master | 2020-03-07T04:18:26.842190 | 2018-03-29T10:42:32 | 2018-03-29T10:42:32 | 127,262,660 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package com.example.red.magazine.model;
/**
* Created by RED on 10/3/2017.
*/
public class ResponseMessage {
private String status;
private String token;
public ResponseMessage(String status, String token) {
this.status = status;
this.token = token;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
}
| [
"nurelayinmehammed@gmail.com"
] | nurelayinmehammed@gmail.com |
e632ae12755d27c64a6b5342d8f2f9f6fa9277e6 | 17e8438486cb3e3073966ca2c14956d3ba9209ea | /dso/tags/2.3.0/code/base/dso-system-tests/tests.base/com/tctest/TransparentVectorTestApp.java | 08901755b9273bcec1518dd7a96453242d42be30 | [] | no_license | sirinath/Terracotta | fedfc2c4f0f06c990f94b8b6c3b9c93293334345 | 00a7662b9cf530dfdb43f2dd821fa559e998c892 | refs/heads/master | 2021-01-23T05:41:52.414211 | 2015-07-02T15:21:54 | 2015-07-02T15:21:54 | 38,613,711 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,037 | java | /*
* All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
*/
package com.tctest;
import EDU.oswego.cs.dl.util.concurrent.CyclicBarrier;
import com.tc.object.config.ConfigVisitor;
import com.tc.object.config.DSOClientConfigHelper;
import com.tc.object.config.spec.CyclicBarrierSpec;
import com.tc.simulator.app.ApplicationConfig;
import com.tc.simulator.listener.ListenerProvider;
import com.tc.util.Assert;
import com.tctest.runner.AbstractErrorCatchingTransparentApp;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Vector;
/**
*
*/
public class TransparentVectorTestApp extends AbstractErrorCatchingTransparentApp {
public TransparentVectorTestApp(String globalId, ApplicationConfig cfg, ListenerProvider listenerProvider) {
super(globalId, cfg, listenerProvider);
barrier = new CyclicBarrier(getParticipantCount());
}
private static final int INITIAL_STAGE = 0;
private static final int ADD_COMPLETE_STAGE = 1;
private static final int ASSERT_MAX_COUNT_SIZE_STAGE = 2;
private static final int REMOVE_COMPLETE_STAGE = 3;
private static final int ASSERT_REMOVE_SIZE_STAGE = 4;
private final Vector vector = new Vector();
// private List subList;
private final CyclicBarrier barrier;
public void moveToStageAndWait(int stage) {
super.moveToStageAndWait(stage);
}
protected void runTest() throws Throwable {
int maxCount = getParticipantCount() * getIntensity();
List testObjects = new Vector();
moveToStage(INITIAL_STAGE);
for (int i = 0; i < getIntensity(); i++) {
TestObject to = new TestObject(getApplicationId(), i);
testObjects.add(to);
synchronized (vector) {
int size = vector.size();
vector.add(to);
Assert.eval(vector.size() == size + 1);
}
}
moveToStageAndWait(ADD_COMPLETE_STAGE);
checkSize(maxCount);
moveToStageAndWait(ASSERT_MAX_COUNT_SIZE_STAGE);
int removeCount = getIntensity() / 2;
for (int i = 0; i < removeCount; i++) {
synchronized (vector) {
int size = vector.size();
Object toRemove = testObjects.get(i);
boolean wasRemoved = vector.remove(toRemove);
if (!wasRemoved) {
System.out.println("List:" + vector + " list hash:" + System.identityHashCode(vector));
Assert.eval("Test object should have been removed but wasn't: " + testObjects.get(i), wasRemoved);
Assert.eval(vector.size() == size - 1);
}
}
}
moveToStageAndWait(REMOVE_COMPLETE_STAGE);
checkSize(maxCount - getParticipantCount() * removeCount);
moveToStageAndWait(ASSERT_REMOVE_SIZE_STAGE);
synchronized (vector) {
vector.clear();
Assert.eval(vector.size() == 0);
}
checkSize(0);
int num = barrier.barrier();
if (num == 0) {
synchronized (vector) {
vector.setSize(5);
}
}
barrier.barrier();
checkSize(5);
for (int i = 0; i < 5; i++) {
Object val = vector.get(i);
if (val != null) {
notifyError("Expected null at index " + i + ", but found " + val);
return;
}
}
barrier.barrier();
// subList = vector.subList(1, 3);
//
// Assert.assertNotNull(subList);
// Assert.assertEquals(2, subList.size());
notifyResult(Boolean.TRUE);
}
private void checkSize(int s) {
synchronized (vector) {
if (vector.size() != s) {
Map res = new HashMap();
for (Iterator i = vector.iterator(); i.hasNext();) {
TestObject to = (TestObject) i.next();
String key = to.getId();
if (!res.containsKey(key)) {
res.put(key, new Long(0));
} else {
long v = ((Long) res.get(key)).longValue();
res.put(key, new Long(++v));
}
}
throw new AssertionError("" + res);
}
}
}
public static void visitL1DSOConfig(ConfigVisitor visitor, DSOClientConfigHelper config) {
new CyclicBarrierSpec().visit(visitor, config);
String testClassName = TransparentVectorTestApp.class.getName();
config.addRoot(testClassName, "vector", "vector", true);
config.addRoot(testClassName, "subList", "subList", true);
config.addRoot(testClassName, "barrier", "barrier", true);
String methodExpression = "* " + testClassName + ".*(..)";
System.err.println("Adding autolock for: " + methodExpression);
config.addWriteAutolock(methodExpression);
config.addIncludePattern(TestObject.class.getName());
}
static class TestObject {
private String id;
private int count;
TestObject(String id, int count) {
this.id = id;
this.count = count;
}
public String getId() {
return id;
}
public String toString() {
return "TestObject(" + id + "," + count + ")";
}
}
} | [
"jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864"
] | jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864 |
66fe85cd55fb197058892b6ca687b60596289163 | cbc7f5b1f0ec0f07700aedf8f37b1a3fd79fb191 | /23_septiembre/henryZerda/src/commands/print/PrintPluginInterface.java | 85d64aa6496157a0846200b9a1060b73f6077034 | [] | no_license | henryzrr/arquitectura_software | 831328f73edfba926471b499897f6b3394804f8e | e20ff182bd8ac887540cb94b4aac85df55893cbd | refs/heads/master | 2020-07-09T03:24:41.965384 | 2019-10-07T16:22:29 | 2019-10-07T16:22:29 | 203,859,734 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 588 | java | package commands.print;
import main.BobProgramValues;
import main.ICommand;
import main.IPlugin;
import java.util.List;
public class PrintPluginInterface implements IPlugin {
private BobProgramValues bobProgramValues;
public PrintPluginInterface(){
bobProgramValues = BobProgramValues.getBobProgramValues();
}
@Override
public String getPluginName() {
return "print";
}
@Override
public ICommand newCommand(List<String> commandLineTokens) throws Exception {
return new PrintCommand(commandLineTokens,bobProgramValues);
}
}
| [
"henry.zrz@gmail.com"
] | henry.zrz@gmail.com |
93597e49ebb143fbba6ea4416764702dcf3a25a8 | 6f0c99138278aa948dd4bdf68eb5a0c39163486d | /optaplanner-core/src/main/java/org/optaplanner/core/config/util/ConfigUtils.java | c13a92044ceb228b25418827a9a518dfa9f6c862 | [
"Apache-2.0"
] | permissive | taiwotman/optaplanner | 8b25daf862917083c59918e675f2ee0340dcdbac | 2fab98bcd45ee46089ac37733cfb5722cd881e8c | refs/heads/master | 2021-01-15T21:02:17.720923 | 2013-07-24T13:28:20 | 2013-07-24T19:22:56 | 11,678,597 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,721 | java | /*
* Copyright 2011 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.optaplanner.core.config.util;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class ConfigUtils {
public static <T> T newInstance(Object bean, String propertyName, Class<T> clazz) {
try {
return clazz.newInstance();
} catch (InstantiationException e) {
throw new IllegalArgumentException("The " + bean.getClass().getSimpleName() + "'s " + propertyName + " ("
+ clazz.getName() + ") does not have a public no-arg constructor", e);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("The " + bean.getClass().getSimpleName() + "'s " + propertyName + " ("
+ clazz.getName() + ") does not have a public no-arg constructor", e);
}
}
public static <T> T inheritOverwritableProperty(T original, T inherited) {
if (original != null) {
// Original overwrites inherited
return original;
} else {
return inherited;
}
}
public static <T> List<T> inheritMergeableListProperty(List<T> originalList, List<T> inheritedList) {
if (inheritedList == null) {
return originalList;
} else if (originalList == null) {
return inheritedList;
} else {
// The inheritedList should be before the originalList
List<T> mergedList = new ArrayList<T>(inheritedList);
mergedList.addAll(originalList);
return mergedList;
}
}
public static <K, T> Map<K, T> inheritMergeableMapProperty(Map<K, T> originalMap, Map<K, T> inheritedMap) {
if (inheritedMap == null) {
return originalMap;
} else if (originalMap == null) {
return inheritedMap;
} else {
// The inheritedMap should be before the originalMap
Map<K, T> mergedMap = new LinkedHashMap<K, T>(inheritedMap);
mergedMap.putAll(originalMap);
return mergedMap;
}
}
private ConfigUtils() {
}
}
| [
"gds.geoffrey.de.smet@gmail.com"
] | gds.geoffrey.de.smet@gmail.com |
afbaec87962ab7420c1b79e157873c38db859d19 | 30cf12e4016cc89018b554465406e8f9fa4ec3b3 | /javaEE/src/test_Practice/day04Test/Car.java | c65f83ceadd5d1c717088634d0a3ac9cc8ce5b53 | [] | no_license | guangjianwei/ssm_sum | 9f9b3279ca35599a0495457ab6f9f9db3c9ad025 | 7545c1e7f4a8626f1a3d8f832bd73cc296523f19 | refs/heads/master | 2020-04-04T12:52:47.394638 | 2018-11-03T02:51:03 | 2018-11-03T02:51:03 | 155,940,658 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,121 | java | package test_Practice.day04Test;
public class Car {
private String name;
private String color;
private String price;
public Car() {
}
public Car(String name, String color) {
this.name = name;
this.color = color;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Car)) return false;
Car car = (Car) o;
if (name != null ? !name.equals(car.name) : car.name != null) return false;
return color != null ? color.equals(car.color) : car.color == null;
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (color != null ? color.hashCode() : 0);
return result;
}
public String getPrice() {
return price;
}
}
| [
"admin@qq.com"
] | admin@qq.com |
9bc09cff1e06b4d43ad79bec7374fe28168e3ee9 | c9106d023a926f5968808a9958449e56a4170612 | /jenax-rx-parent/jenax-rx-dataaccess/src/main/java/org/aksw/jena_sparql_api/core/utils/FN_TripleFromQuad.java | b4686d94888e760de7d963ab03e5e915dd9c7c43 | [] | no_license | Scaseco/jenax | c6f726fa25fd4b15e05119d05dbafaf44c8f5411 | 58a8dec0b055eaca3f6848cab4b552c9fd19a6ec | refs/heads/develop | 2023-08-24T13:37:16.574857 | 2023-08-24T11:53:24 | 2023-08-24T11:53:24 | 416,700,558 | 5 | 0 | null | 2023-08-03T14:41:53 | 2021-10-13T10:54:14 | Java | UTF-8 | Java | false | false | 490 | java | package org.aksw.jena_sparql_api.core.utils;
import org.apache.jena.graph.Triple;
import org.apache.jena.sparql.core.Quad;
import com.google.common.base.Function;
public class FN_TripleFromQuad
implements Function<Quad, Triple>
{
public FN_TripleFromQuad() {
super();
}
@Override
public Triple apply(Quad quad) {
Triple result = quad.asTriple();
return result;
}
public static final FN_TripleFromQuad fn = new FN_TripleFromQuad();
}
| [
"RavenArkadon@googlemail.com"
] | RavenArkadon@googlemail.com |
83ca6b6cdec81d584433021bdd4288de0809483c | 2371b614eb0601172c1938bd0ff520d6253ebf18 | /src/main/java/com/intfish/securitydemo/entity/User.java | c6a0e6efea34b2c6dc99520a24135609e1d8eb54 | [] | no_license | intfish123/security-demo | 94820fe7c731bfef3857bd661360f26b32a11e8e | 6f9d85b5839400e7dc838a54cd72a40299833029 | refs/heads/master | 2022-11-30T16:20:22.029242 | 2020-08-12T13:17:21 | 2020-08-12T13:17:21 | 286,162,187 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,026 | java | package com.intfish.securitydemo.entity;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collection;
@Data
public class User implements UserDetails {
private String uid;
private String username;
private String password;
private Collection<? extends GrantedAuthority> authorities;
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return authorities;
}
@Override
public String getPassword() {
return password;
}
@Override
public String getUsername() {
return username;
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
}
| [
"123456"
] | 123456 |
d4900413cf9549247f2d59712c6bb6ccba1468af | 8335afe80e5eac4dcf8332064cd39cebd03d1b8f | /app/src/main/java/utils/APIClient.java | 149b26893798061c9e4ae5660950801e115c0d59 | [] | no_license | VethicsGit/Loft | a55f5f017a04cf36955f21f6b0cef00c2d0bced6 | 6ebe298bfd0e1886d42d9a696733f153d29fd08d | refs/heads/master | 2020-03-28T23:21:29.219076 | 2018-09-19T14:21:56 | 2018-09-19T14:21:56 | 146,724,564 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,159 | java | package utils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by Chirag on 1/10/2018.
*/
public class APIClient {
private static final String BASE_URL = "https://vethicsinternational.com/loft/";
private static Retrofit retrofit = null;
public static Retrofit getClient() {
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.retryOnConnectionFailure(true)
.build();
Gson gson = new GsonBuilder()
.setLenient()
.create();
if (retrofit == null) {
retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.client(client)
.addConverterFactory(GsonConverterFactory.create(gson))
.build();
}
return retrofit;
}
}
| [
"41325213+VethicsGit@users.noreply.github.com"
] | 41325213+VethicsGit@users.noreply.github.com |
8538ac83c69b596f91cc41a0cd9a624aa6176793 | 377e5e05fb9c6c8ed90ad9980565c00605f2542b | /bin/platform/ext/workflow/testsrc/de/hybris/platform/workflow/daos/impl/DefaultWorkflowLinksTemplateDaoUnitTest.java | 77aabee938554fe2f5541eea80aaa047fb13b33c | [] | no_license | automaticinfotech/HybrisProject | c22b13db7863e1e80ccc29774f43e5c32e41e519 | fc12e2890c569e45b97974d2f20a8cbe92b6d97f | refs/heads/master | 2021-07-20T18:41:04.727081 | 2017-10-30T13:24:11 | 2017-10-30T13:24:11 | 108,957,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,113 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 SAP SE
* All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* Hybris ("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 Hybris.
*/
package de.hybris.platform.workflow.daos.impl;
import de.hybris.bootstrap.annotations.UnitTest;
import de.hybris.platform.core.model.link.LinkModel;
import de.hybris.platform.servicelayer.exceptions.AmbiguousIdentifierException;
import de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException;
import de.hybris.platform.servicelayer.search.FlexibleSearchService;
import de.hybris.platform.servicelayer.search.SearchResult;
import de.hybris.platform.workflow.model.WorkflowActionModel;
import de.hybris.platform.workflow.model.WorkflowActionTemplateModel;
import de.hybris.platform.workflow.model.WorkflowDecisionModel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
@UnitTest
public class DefaultWorkflowLinksTemplateDaoUnitTest
{
private final DefaultWorkflowLinksTemplateDao dao = new DefaultWorkflowLinksTemplateDao();
private static final String RELATIONNAME = WorkflowActionTemplateModel._WORKFLOWACTIONTEMPLATELINKTEMPLATERELATION;
@Mock
private FlexibleSearchService flexibleSearchService;
@Before
public void prepare()
{
MockitoAnnotations.initMocks(this);
dao.setFlexibleSearchService(flexibleSearchService);
}
@Test
public void testFindWorkflowActionLinkRelationBySource()
{
final SearchResult result = Mockito.mock(SearchResult.class);
Mockito.when(result.getResult()).thenReturn(null);
Mockito.when(flexibleSearchService.search(Mockito.anyString(), Mockito.anyMap())).thenReturn(result);
Assert.assertNull(dao.findWorkflowActionLinkRelationBySource("sourceName"));
Mockito.verify(flexibleSearchService).search(Mockito.eq("SELECT {pk} from {" + RELATIONNAME + "} where {source}=?desc"),
Mockito.eq(Collections.singletonMap("desc", "sourceName")));
}
@Test
public void testfindLinksByDecisionAndActionNullWorkflowNullDecision()
{
try
{
dao.findLinksByDecisionAndAction(null, null);
Assert.fail("Should not be posssible to find links without workflow or decision");
}
catch (final IllegalArgumentException e)
{
//ok here
}
Mockito.verifyZeroInteractions(flexibleSearchService);
}
@Test
public void testfindLinksByDecisionAndActionNullWorkflow()
{
final WorkflowDecisionModel decision = Mockito.mock(WorkflowDecisionModel.class);
final SearchResult result = Mockito.mock(SearchResult.class);
Mockito.when(result.getResult()).thenReturn(null);
Mockito.when(flexibleSearchService.search(Mockito.anyString(), Mockito.anyMap())).thenReturn(result);
Assert.assertNull(dao.findLinksByDecisionAndAction(decision, null));
Mockito.verify(flexibleSearchService).search(Mockito.eq("SELECT {pk} from {" + RELATIONNAME + "} where {source}=?desc"),
Mockito.eq(Collections.singletonMap("desc", decision)));
}
@Test
public void testfindLinksByDecisionAndActionNullDecision()
{
final WorkflowActionModel workflow = Mockito.mock(WorkflowActionModel.class);
final SearchResult result = Mockito.mock(SearchResult.class);
Mockito.when(result.getResult()).thenReturn(null);
Mockito.when(flexibleSearchService.search(Mockito.anyString(), Mockito.anyMap())).thenReturn(result);
Assert.assertNull(dao.findLinksByDecisionAndAction(null, workflow));
Mockito.verify(flexibleSearchService).search(Mockito.eq("SELECT {pk} from {" + RELATIONNAME + "} where {target}=?act"),
Mockito.eq(Collections.singletonMap("act", workflow)));
}
@Test
public void testfindLinksByDecisionAndAction()
{
final List<LinkModel> resultList = new ArrayList<LinkModel>(1);
resultList.add(Mockito.mock(LinkModel.class));
final WorkflowActionModel workflow = Mockito.mock(WorkflowActionModel.class);
final WorkflowDecisionModel decision = Mockito.mock(WorkflowDecisionModel.class);
final SearchResult result = Mockito.mock(SearchResult.class);
Mockito.when(result.getResult()).thenReturn(resultList);
Mockito.when(flexibleSearchService.search(Mockito.anyString(), Mockito.anyMap())).thenReturn(result);
final Map map = new HashMap();
map.put("act", workflow);
map.put("desc", decision);
Assert.assertEquals(resultList, dao.findLinksByDecisionAndAction(decision, workflow));
Mockito.verify(flexibleSearchService).search(
Mockito.eq("SELECT {pk} from {" + RELATIONNAME + "} where {source}=?desc AND {target}=?act"), Mockito.eq(map));
}
@Test
public void testfindLinksByDecisionAndActionTooLessResults()
{
final List<LinkModel> resultList = new ArrayList<LinkModel>(0);
final WorkflowActionModel workflow = Mockito.mock(WorkflowActionModel.class);
final WorkflowDecisionModel decision = Mockito.mock(WorkflowDecisionModel.class);
final SearchResult result = Mockito.mock(SearchResult.class);
Mockito.when(result.getResult()).thenReturn(resultList);
Mockito.when(flexibleSearchService.search(Mockito.anyString(), Mockito.anyMap())).thenReturn(result);
final Map map = new HashMap();
map.put("act", workflow);
map.put("desc", decision);
try
{
dao.findLinksByDecisionAndAction(decision, workflow);
Assert.fail("Too less results ...");
}
catch (final UnknownIdentifierException e)
{
//
}
Mockito.verify(flexibleSearchService).search(
Mockito.eq("SELECT {pk} from {" + RELATIONNAME + "} where {source}=?desc AND {target}=?act"), Mockito.eq(map));
}
@Test
public void testfindLinksByDecisionAndActionTooMuchResults()
{
final List<LinkModel> resultList = new ArrayList<LinkModel>(2);
resultList.add(Mockito.mock(LinkModel.class));
resultList.add(Mockito.mock(LinkModel.class));
final WorkflowActionModel workflow = Mockito.mock(WorkflowActionModel.class);
final WorkflowDecisionModel decision = Mockito.mock(WorkflowDecisionModel.class);
final SearchResult result = Mockito.mock(SearchResult.class);
Mockito.when(result.getResult()).thenReturn(resultList);
Mockito.when(flexibleSearchService.search(Mockito.anyString(), Mockito.anyMap())).thenReturn(result);
final Map map = new HashMap();
map.put("act", workflow);
map.put("desc", decision);
try
{
dao.findLinksByDecisionAndAction(decision, workflow);
Assert.fail("Too much results ...");
}
catch (final AmbiguousIdentifierException e)
{
// ok here
}
Mockito.verify(flexibleSearchService).search(
Mockito.eq("SELECT {pk} from {" + RELATIONNAME + "} where {source}=?desc AND {target}=?act"), Mockito.eq(map));
}
}
| [
"santosh.kshirsagar@automaticinfotech.com"
] | santosh.kshirsagar@automaticinfotech.com |
46090e61de195c985a18204098757d8738badf4f | f861c7e3d3d4eb67a9f635633ee6b911f9635541 | /education-admin/src/main/java/com/ssic/education/admin/pageModel/DataGrid.java | b371e6581450399ffed8c5dc80db04170f3da43f | [] | no_license | wwbg1988/education | f8d232f4a032a2b19cf44afc6957d4d5f7d43a35 | 007565c2f5f1e51529ae079005778f08a69493ab | refs/heads/master | 2020-03-20T22:19:42.223159 | 2016-11-26T06:15:05 | 2016-11-26T06:15:05 | 74,808,441 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 490 | java | package com.ssic.education.admin.pageModel;
import java.util.ArrayList;
import java.util.List;
/**
* EasyUI DataGrid模型
*
* @author 刘博
*
*/
public class DataGrid implements java.io.Serializable {
private Long total = 0L;
private List rows = new ArrayList();
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public List getRows() {
return rows;
}
public void setRows(List rows) {
this.rows = rows;
}
}
| [
"wuweitree@163.com"
] | wuweitree@163.com |
b68bd7886d1b53ff1945324018d907c0eb1241b8 | 9cdf1414d6ab0ff42536972f6f5241182d425b8c | /zxhb/zxhb/shop/com/enation/app/shop/core/tag/member/DefaultConsigneeTag.java | 6720c299f11eb5a41ff57fe541df0cc44192e644 | [] | no_license | lxyjyy/study | 0ebd18126c4813dbe5ea067fc9dce36e32954bb4 | e9830a44a3c9e7314fd1f3974b7d68c0eeafc1a6 | refs/heads/master | 2021-06-18T17:17:10.133775 | 2017-06-28T11:47:43 | 2017-06-28T11:47:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,355 | java | package com.enation.app.shop.core.tag.member;
import java.util.Map;
import org.springframework.stereotype.Component;
import com.enation.app.base.core.model.Member;
import com.enation.app.base.core.model.MemberAddress;
import com.enation.app.shop.core.service.IMemberAddressManager;
import com.enation.eop.sdk.context.UserConext;
import com.enation.framework.taglib.BaseFreeMarkerTag;
import freemarker.template.TemplateModelException;
/**
* 会员地址
* @author xulipeng
* whj 0819 09:48修改如下:
* 如果无默认地址,则返回一个String型 “0”。
*/
@Component
public class DefaultConsigneeTag extends BaseFreeMarkerTag{
private IMemberAddressManager memberAddressManager;
@SuppressWarnings({ "rawtypes" })
@Override
protected Object exec(Map params) throws TemplateModelException {
Member member = UserConext.getCurrentMember();
if(member == null){
throw new TemplateModelException("未登录,不能使用此标签");
}
Integer memberid = member.getMember_id();
MemberAddress address = this.memberAddressManager.getMemberDefault(memberid);
return address;
}
public IMemberAddressManager getMemberAddressManager() {
return memberAddressManager;
}
public void setMemberAddressManager(IMemberAddressManager memberAddressManager) {
this.memberAddressManager = memberAddressManager;
}
}
| [
"342651808@qq.com"
] | 342651808@qq.com |
739593393226d8cb220df06e04f866484c48cb69 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Jetty/Jetty2141.java | ca88b7880ada775591ae7e061dd8350f124cb7e1 | [] | 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 | 432 | java | protected void doProcessBinding (Node node, App app) throws Exception
{
ClassLoader old = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(_server.getParentClassLoaderForWebapps());
try
{
super.processBinding(node,app);
}
finally
{
Thread.currentThread().setContextClassLoader(old);
}
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
6ace1da2dab5943d3b9f6610adaddf115bd5675e | 2fe28a033511fdf8d2027c8cc63c3423646150b8 | /src/day47_constructors/addressList.java | d14af713a9f735293138488db0145f0fa231a0fe | [] | no_license | danyalwalker/Java-Programming | 4c581a06a1cca45f56e3a6db4535d8fb6798ccac | a89505403eedd5920a7414d1b41c28136003d8a4 | refs/heads/master | 2023-07-19T16:56:07.188814 | 2021-09-25T21:27:20 | 2021-09-25T21:27:20 | 374,452,988 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 693 | java | package day47_constructors;
public class addressList {
public static void main(String[] args) {
Address myAddress = new Address();
myAddress.setStreet("172 Suffolk ave");
myAddress.setCity("Staten Island");
myAddress.setState("New York");
myAddress.setZipCode("10314");
myAddress.setCountry("United States");
System.out.println(myAddress.toString());
myAddress.setCity("Brooklyn");
System.out.println(myAddress.toString());
Address upDated = new Address();
System.out.println("upDated = " + upDated);
upDated.setCity("Queens");
System.out.println("upDated = " + upDated);
}
}
| [
"danielwalker.ny@gmail.com"
] | danielwalker.ny@gmail.com |
4cd2a47cd6217f95a49e122b78c0ae5d22a4e2cf | ac1c9fbc1f1019efb19d0a8f3a088e8889f1e83c | /out/release/gen/content/public/android/content_java/generated_java/annotation_processor_outputs/org/chromium/content_public/common/ResourceRequestBodyJni.java | 41a097f706e82300efb6d53b0f84ae73cb847df0 | [
"BSD-3-Clause"
] | permissive | xueqiya/chromium_src | 5d20b4d3a2a0251c063a7fb9952195cda6d29e34 | d4aa7a8f0e07cfaa448fcad8c12b29242a615103 | refs/heads/main | 2022-07-30T03:15:14.818330 | 2021-01-16T16:47:22 | 2021-01-16T16:47:22 | 330,115,551 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,678 | java | package org.chromium.content_public.common;
import J.N;
import java.lang.Override;
import javax.annotation.Generated;
import org.chromium.base.JniStaticTestMocker;
import org.chromium.base.NativeLibraryLoadedStatus;
import org.chromium.base.annotations.CheckDiscard;
@Generated("org.chromium.jni_generator.JniProcessor")
@CheckDiscard("crbug.com/993421")
final class ResourceRequestBodyJni implements ResourceRequestBody.Natives {
private static ResourceRequestBody.Natives testInstance;
public static final JniStaticTestMocker<ResourceRequestBody.Natives> TEST_HOOKS = new org.chromium.base.JniStaticTestMocker<org.chromium.content_public.common.ResourceRequestBody.Natives>() {
@java.lang.Override
public void setInstanceForTesting(
org.chromium.content_public.common.ResourceRequestBody.Natives instance) {
if (!J.N.TESTING_ENABLED) {
throw new RuntimeException("Tried to set a JNI mock when mocks aren't enabled!");
}
testInstance = instance;
}
};
@Override
public byte[] createResourceRequestBodyFromBytes(byte[] httpBody) {
return (byte[])N.MugoAW_d(httpBody);
}
public static ResourceRequestBody.Natives get() {
if (N.TESTING_ENABLED) {
if (testInstance != null) {
return testInstance;
}
if (N.REQUIRE_MOCK) {
throw new UnsupportedOperationException("No mock found for the native implementation for org.chromium.content_public.common.ResourceRequestBody.Natives. The current configuration requires all native implementations to have a mock instance.");
}
}
NativeLibraryLoadedStatus.checkLoaded(false);
return new ResourceRequestBodyJni();
}
}
| [
"xueqi@zjmedia.net"
] | xueqi@zjmedia.net |
e5509e17a0dfebe42543ee90db83234ab31926b3 | 4aed712e4d9761d3252aa13c7d69a1b8df45f43b | /src/cz/burios/uniql/persistence/internal/jpa/metadata/queries/ColumnResultMetadata.java | e21ad350175ed64c99c19c1656eb2aa8d02b24c2 | [] | no_license | buriosca/cz.burios.uniql-jpa | 86c682f2d19c824e21102ac71c150e7de1a25e18 | e9a651f836018456b99048f02191f2ebe824e511 | refs/heads/master | 2022-06-25T01:22:43.605788 | 2020-07-19T05:13:25 | 2020-07-19T05:13:25 | 247,073,006 | 0 | 0 | null | 2022-06-21T03:53:36 | 2020-03-13T13:05:10 | Java | UTF-8 | Java | false | false | 5,097 | java | /*******************************************************************************
* Copyright (c) 2012, 2013, 2013 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* 02/08/2012-2.4 Guy Pelletier
* - 350487: JPA 2.1 Specification defined support for Stored Procedure Calls
* 06/20/2012-2.5 Guy Pelletier
* - 350487: JPA 2.1 Specification defined support for Stored Procedure Calls
******************************************************************************/
package cz.burios.uniql.persistence.internal.jpa.metadata.queries;
import cz.burios.uniql.persistence.internal.helper.DatabaseField;
import cz.burios.uniql.persistence.internal.jpa.metadata.ORMetadata;
import cz.burios.uniql.persistence.internal.jpa.metadata.accessors.MetadataAccessor;
import cz.burios.uniql.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject;
import cz.burios.uniql.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotation;
import cz.burios.uniql.persistence.internal.jpa.metadata.accessors.objects.MetadataClass;
import cz.burios.uniql.persistence.internal.jpa.metadata.xml.XMLEntityMappings;
import cz.burios.uniql.persistence.queries.ColumnResult;
/**
* INTERNAL:
* Object to hold onto a column result metadata.
*
* Key notes:
* - any metadata mapped from XML to this class must be compared in the
* equals method.
* - all metadata mapped from XML must be initialized in the initXMLObject
* method.
* - when loading from annotations, the constructor accepts the metadata
* accessor this metadata was loaded from. Used it to look up any
* 'companion' annotation needed for processing.
* - methods should be preserved in alphabetical order.
*
* @author Guy Pelletier
* @since Eclipselink 2.4
*/
public class ColumnResultMetadata extends ORMetadata {
private MetadataClass type;
private String name;
private String typeName;
/**
* INTERNAL:
* Used for XML loading.
*/
public ColumnResultMetadata() {
super("<column-result>");
}
/**
* INTERNAL:
* Used for annotation loading.
*/
public ColumnResultMetadata(MetadataAnnotation columnResult, MetadataAccessor accessor) {
super(columnResult, accessor);
name = columnResult.getAttributeString("name");
type = getMetadataClass(columnResult.getAttributeString("type"));
}
/**
* INTERNAL:
*/
@Override
public boolean equals(Object objectToCompare) {
if (objectToCompare instanceof ColumnResultMetadata) {
ColumnResultMetadata columnResult = (ColumnResultMetadata) objectToCompare;
if (! valuesMatch(getName(), columnResult.getName())) {
return false;
}
return valuesMatch(getType(), columnResult.getType());
}
return false;
}
/**
* INTERNAL:
* Used for OX mapping.
*/
public String getName() {
return name;
}
/**
* INTERNAL:
*/
public MetadataClass getType() {
return type;
}
/**
* INTERNAL:
* Used for OX mapping.
*/
public String getTypeName() {
return typeName;
}
/**
* INTERNAL:
*/
@Override
public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) {
super.initXMLObject(accessibleObject, entityMappings);
setType(initXMLClassName(getTypeName()));
}
/**
* INTERNAL:
* Process the column result for the caller.
*/
public ColumnResult process() {
DatabaseField field = new DatabaseField();
// Process the name (taking into consideration delimiters etc.)
setFieldName(field, getName());
// Set the type name.
if (! getType().isVoid()) {
field.setTypeName(getJavaClassName(getType()));
}
// Return a column result to the mapping.
return new ColumnResult(field);
}
/**
* INTERNAL:
* Used for OX mapping.
*/
public void setName(String name) {
this.name = name;
}
/**
* INTERNAL:
*/
public void setType(MetadataClass type) {
this.type = type;
}
/**
* INTERNAL:
* Used for OX mapping.
*/
public void setTypeName(String typeName) {
this.typeName = typeName;
}
}
| [
"Buriosca.cz@DESKTOP-PKNI7NI"
] | Buriosca.cz@DESKTOP-PKNI7NI |
aa1d122f9c1c42932cbc9b213cc7502182eaa319 | 0ac05e3da06d78292fdfb64141ead86ff6ca038f | /OSWE/oswe/openCRX/rtjar/rt.jar.src/sun/security/krb5/internal/crypto/DesCbcCrcEType.java | d82346e7ce98ced24e71f931e70910439f1ad750 | [] | no_license | qoo7972365/timmy | 31581cdcbb8858ac19a8bb7b773441a68b6c390a | 2fc8baba4f53d38dfe9c2b3afd89dcf87cbef578 | refs/heads/master | 2023-07-26T12:26:35.266587 | 2023-07-17T12:35:19 | 2023-07-17T12:35:19 | 353,889,195 | 7 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,108 | java | /* */ package sun.security.krb5.internal.crypto;
/* */
/* */ import sun.security.krb5.KrbCryptoException;
/* */ import sun.security.krb5.internal.KrbApErrException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class DesCbcCrcEType
/* */ extends DesCbcEType
/* */ {
/* */ public int eType() {
/* 44 */ return 1;
/* */ }
/* */
/* */ public int minimumPadSize() {
/* 48 */ return 4;
/* */ }
/* */
/* */ public int confounderSize() {
/* 52 */ return 8;
/* */ }
/* */
/* */ public int checksumType() {
/* 56 */ return 7;
/* */ }
/* */
/* */ public int checksumSize() {
/* 60 */ return 4;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public byte[] encrypt(byte[] paramArrayOfbyte1, byte[] paramArrayOfbyte2, int paramInt) throws KrbCryptoException {
/* 73 */ return encrypt(paramArrayOfbyte1, paramArrayOfbyte2, paramArrayOfbyte2, paramInt);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public byte[] decrypt(byte[] paramArrayOfbyte1, byte[] paramArrayOfbyte2, int paramInt) throws KrbApErrException, KrbCryptoException {
/* 85 */ return decrypt(paramArrayOfbyte1, paramArrayOfbyte2, paramArrayOfbyte2, paramInt);
/* */ }
/* */
/* */ protected byte[] calculateChecksum(byte[] paramArrayOfbyte, int paramInt) {
/* 89 */ return crc32.byte2crc32sum_bytes(paramArrayOfbyte, paramInt);
/* */ }
/* */ }
/* Location: /Users/timmy/timmy/OSWE/oswe/openCRX/rt.jar!/sun/security/krb5/internal/crypto/DesCbcCrcEType.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/ | [
"t0984456716"
] | t0984456716 |
ca13672387be66514fd48cc62bb5cc2e866d55a1 | fdb73f281318cf51cdd014485b605f4729cd65f3 | /jishitongxin/app/src/main/java/com/example/wenhaibo/jishitongxin/MeasageAdapter.java | bcc2707881a6b4f1648cf0e2976c0f04a488740a | [
"Apache-2.0"
] | permissive | haibowen/JianChat | f0b412aa576879650d7933a7bc9471a7f75c1f89 | 637b3d3c48b9daa9158edeb6431200a996832ce2 | refs/heads/master | 2020-04-29T16:05:38.953252 | 2019-03-19T06:19:18 | 2019-03-19T06:19:18 | 176,247,600 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,082 | java | package com.example.wenhaibo.jishitongxin;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.List;
/**
* Created by wenhaibo on 2017/11/18.
*/
public class MeasageAdapter extends RecyclerView.Adapter<MeasageAdapter.MyViewHolder> {
private List<Measage> measageList;
public MeasageAdapter(List<Measage> measageList){
this.measageList=measageList;
}
@Override
public MeasageAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = View.inflate(parent.getContext(), R.layout.item_msg, null);
MyViewHolder holder = new MyViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(MeasageAdapter.MyViewHolder holder, int position) {
Measage measage = measageList.get(position);
if (measage.getType() == Measage.TYPE_RECEIVED){
holder.llLeft.setVisibility(View.VISIBLE);
holder.llRight.setVisibility(View.GONE);
holder.tv_Left.setText(measage.getContent());
} else if (measage.getType() == Measage.TYPE_SEND){
holder.llLeft.setVisibility(View.GONE);
holder.llRight.setVisibility(View.VISIBLE);
holder.tv_Right.setText(measage.getContent());
}
}
@Override
public int getItemCount() {
return measageList.size();
}
static class MyViewHolder extends RecyclerView.ViewHolder{
LinearLayout llLeft;
LinearLayout llRight;
TextView tv_Left;
TextView tv_Right;
public MyViewHolder(View itemView) {
super(itemView);
llLeft = (LinearLayout) itemView.findViewById(R.id.ll_msg_left);
llRight = (LinearLayout) itemView.findViewById(R.id.ll_msg_right);
tv_Left = (TextView) itemView.findViewById(R.id.tv_msg_left);
tv_Right = (TextView) itemView.findViewById(R.id.tv_msg_right);
}
}
}
| [
"1461154748@qq.com"
] | 1461154748@qq.com |
e168c608fbc6cde32e35d9e1952666091c090a27 | 11f60262a3cb72653d20e07e18d2b03d65fc4670 | /apollo_mq/apollo-core/src/main/java/com/fangcang/common/util/UploadFileConfig.java | acd724a86fa8c4620d61b26b5e2af8fbadc4defa | [
"Apache-2.0"
] | permissive | GSIL-Monitor/hotel-1 | 59812e7c3983a9b6db31f7818f93d7b3a6ac683c | 4d170c01a86a23ebf3378d906cac4641ba1aefa9 | refs/heads/master | 2020-04-12T18:29:14.914311 | 2018-12-21T07:03:37 | 2018-12-21T07:03:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,067 | java | package com.fangcang.common.util;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import lombok.Data;
/**
* Created by ASUS on 2018/6/6.
*/
@Component
@ConfigurationProperties(prefix = "ftp")
@Data
public class UploadFileConfig {
/**
* 服务地址
*/
private String addr;
/**
* 端口
*/
private String port;
/**
* 服务器登录名
*/
private String userName;
/**
* 用户登录秘密
*/
private String passWord;
/**
* 图片域名
*/
private String domainName;
/**
* 图片真实路径
*/
private String realPath;
/**
* 供应商合同文件路径
*/
private String supplyContractPath;
/**
* 分销商合同文件路径
*/
private String agentContractPath;
/**
* 文件目录前缀
*/
private String fileDirpRefix;
/**
* 文件url前缀
*/
private String fileUrlRefix;
}
| [
"961346704@qq.com"
] | 961346704@qq.com |
7fce4a5f6d1bcfa78c5229e65b9fc5235743a434 | c697b14836a01be88e6bbf43ac648be83426ade0 | /Algorithms/0001-1000/0553. Optimal Division/Solution.java | 206c7b29e2d8efe915d715a50ff04538e9754661 | [] | no_license | jianyimiku/My-LeetCode-Solution | 8b916d7ebbb89606597ec0657f16a8a9e88895b4 | 48058eaeec89dc3402b8a0bbc8396910116cdf7e | refs/heads/master | 2023-07-17T17:50:11.718015 | 2021-09-05T06:27:06 | 2021-09-05T06:27:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 670 | java | class Solution {
public String optimalDivision(int[] nums) {
if (nums == null || nums.length == 0)
return "";
int length = nums.length;
if (length == 1)
return String.valueOf(nums[0]);
if (length == 2)
return nums[0] + "/" + nums[1];
StringBuffer sb = new StringBuffer();
sb.append(String.valueOf(nums[0]));
sb.append("/");
sb.append("(");
for (int i = 1; i < length; i++) {
sb.append(String.valueOf(nums[i]));
if (i < length - 1)
sb.append("/");
}
sb.append(")");
return sb.toString();
}
} | [
"chenyi_storm@sina.com"
] | chenyi_storm@sina.com |
36f1f0c5941f694f9cd4f7e7697a7b7e46b93fc2 | 95d20c83d8aff34e314c56a3ecb2b87c9fa9fc86 | /Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/symbol/ManagedLocalOrParameterSIMRStMsSymbol.java | 912aef68825e56115511dc9f9ad4b6c58a0271d2 | [
"GPL-1.0-or-later",
"GPL-3.0-only",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LGPL-2.1-only",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | NationalSecurityAgency/ghidra | 969fe0d2ca25cb8ac72f66f0f90fc7fb2dbfa68d | 7cc135eb6bfabd166cbc23f7951dae09a7e03c39 | refs/heads/master | 2023-08-31T21:20:23.376055 | 2023-08-29T23:08:54 | 2023-08-29T23:08:54 | 173,228,436 | 45,212 | 6,204 | Apache-2.0 | 2023-09-14T18:00:39 | 2019-03-01T03:27:48 | Java | UTF-8 | Java | false | false | 1,679 | java | /* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ghidra.app.util.bin.format.pdb2.pdbreader.symbol;
import ghidra.app.util.bin.format.pdb2.pdbreader.*;
/**
* This class represents the <B>StMsSymbol</B> flavor of Managed Local- Or Parameter Stored
* in Many Register symbol.
* <P>
* Note: we do not necessarily understand each of these symbol type classes. Refer to the
* base class for more information.
*/
public class ManagedLocalOrParameterSIMRStMsSymbol
extends AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol {
public static final int PDB_ID = 0x1025;
/**
* Constructor for this symbol.
* @param pdb {@link AbstractPdb} to which this symbol belongs.
* @param reader {@link PdbByteReader} from which this symbol is deserialized.
* @throws PdbException upon error parsing a field.
*/
public ManagedLocalOrParameterSIMRStMsSymbol(AbstractPdb pdb, PdbByteReader reader)
throws PdbException {
super(pdb, reader, 8, StringParseType.StringUtf8St);
}
@Override
public int getPdbId() {
return PDB_ID;
}
@Override
protected String getSymbolTypeName() {
return "MANMANYREG_ST";
}
}
| [
"50744617+ghizard@users.noreply.github.com"
] | 50744617+ghizard@users.noreply.github.com |
df3c21f9e533bc5cf6e979b4836f37a3ed0e6cba | 2e007171683616881b62eb3f1db8b271dc3284d1 | /axinfu-model/src/main/java/modellib/service/MessageService.java | e5f9b5b198f4998406097c3bd0c3ca0614a8143f | [
"Apache-2.0"
] | permissive | ZcrPro/axinfu | cc85856cefbd4b2050566d2d18f611e664facd9d | 66fc7c6df4c6ea8a8a01a0008d5165eb6e53f09a | refs/heads/master | 2020-03-20T08:45:38.205203 | 2018-07-09T01:56:39 | 2018-07-09T01:56:39 | 127,858,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 784 | java | package modellib.service;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;
/**
* Created by zcrpro on 2016/11/7.
*/
public interface MessageService {
//获取banner广告内容
@FormUrlEncoded
@POST("MessageService/get_advertises/")
Observable<String> getAdvertises(@Field("json") String json, @Field("sign") String sign);
//获取通知消息
@FormUrlEncoded
@POST("MessageService/get_messages/")
Observable<String> getMsg(@Field("json") String json, @Field("sign") String sign);
//获取通知消息
@FormUrlEncoded
@POST("MessageService/get_important_messages/")
Observable<String> getImportantMsg(@Field("json") String json, @Field("sign") String sign);
}
| [
"zcrpro@gmail.com"
] | zcrpro@gmail.com |
b7fe0f25357a4db39303384c9eee6b79c5decb53 | 49b4cb79c910a17525b59d4b497a09fa28a9e3a8 | /parserValidCheck/src/main/java/com/ke/css/cimp/fna/fna1/Rule_LF.java | 654ca30a270b16caad634e0913592e9bde4dddc2 | [] | no_license | ganzijo/koreanair | a7d750b62cec2647bfb2bed4ca1bf8648d9a447d | e980fb11bc4b8defae62c9d88e5c70a659bef436 | refs/heads/master | 2021-04-26T22:04:17.478461 | 2018-03-06T05:59:32 | 2018-03-06T05:59:32 | 124,018,887 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,177 | java | package com.ke.css.cimp.fna.fna1;
/* -----------------------------------------------------------------------------
* Rule_LF.java
* -----------------------------------------------------------------------------
*
* Producer : com.parse2.aparse.Parser 2.5
* Produced : Tue Feb 27 09:51:44 KST 2018
*
* -----------------------------------------------------------------------------
*/
import java.util.ArrayList;
final public class Rule_LF extends Rule
{
public Rule_LF(String spelling, ArrayList<Rule> rules)
{
super(spelling, rules);
}
public Object accept(Visitor visitor)
{
return visitor.visit(this);
}
public static Rule_LF parse(ParserContext context)
{
context.push("LF");
boolean parsed = true;
int s0 = context.index;
ParserAlternative a0 = new ParserAlternative(s0);
ArrayList<ParserAlternative> as1 = new ArrayList<ParserAlternative>();
parsed = false;
{
int s1 = context.index;
ParserAlternative a1 = new ParserAlternative(s1);
parsed = true;
if (parsed)
{
boolean f1 = true;
int c1 = 0;
for (int i1 = 0; i1 < 1 && f1; i1++)
{
Rule rule = Terminal_NumericValue.parse(context, "%x0A", "[\\x0A]", 1);
if ((f1 = rule != null))
{
a1.add(rule, context.index);
c1++;
}
}
parsed = c1 == 1;
}
if (parsed)
{
as1.add(a1);
}
context.index = s1;
}
ParserAlternative b = ParserAlternative.getBest(as1);
parsed = b != null;
if (parsed)
{
a0.add(b.rules, b.end);
context.index = b.end;
}
Rule rule = null;
if (parsed)
{
rule = new Rule_LF(context.text.substring(a0.start, a0.end), a0.rules);
}
else
{
context.index = s0;
}
context.pop("LF", parsed);
return (Rule_LF)rule;
}
}
/* -----------------------------------------------------------------------------
* eof
* -----------------------------------------------------------------------------
*/
| [
"wrjo@wrjo-PC"
] | wrjo@wrjo-PC |
2a41fb973b92da5185145cc430b83cce5c0b04b2 | d755ad9c403797ce62c7bf19bfb4bca63ddf8e2c | /consensus/consensus-mq/src/main/java/com/jd/blockchain/consensus/mq/server/MsgQueueNodeServer.java | 5a65eb418fa5044340e59eb5e5661e07e5e3dfe3 | [] | no_license | SergiusAC/jdchain-core | 59a90e64ec5f6d103ecd89b754c9dc8337281728 | ec842b88f4ea19ffa8f9a00f31317e5e4dc5218b | refs/heads/master | 2022-12-19T01:21:47.768393 | 2020-08-07T11:08:16 | 2020-08-07T11:08:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,732 | java | /**
* Copyright: Copyright 2016-2020 JD.COM All Right Reserved
* FileName: com.jd.blockchain.consensus.mq.server.MsgQueueNodeServer
* Author: shaozhuguang
* Department: 区块链研发部
* Date: 2018/12/13 上午11:20
* Description:
*/
package com.jd.blockchain.consensus.mq.server;
import java.util.concurrent.Executors;
import com.jd.blockchain.consensus.ConsensusManageService;
import com.jd.blockchain.consensus.mq.MsgQueueConsensusProvider;
import com.jd.blockchain.consensus.mq.consumer.MsgQueueConsumer;
import com.jd.blockchain.consensus.mq.factory.MsgQueueFactory;
import com.jd.blockchain.consensus.mq.producer.MsgQueueProducer;
import com.jd.blockchain.consensus.mq.settings.MsgQueueBlockSettings;
import com.jd.blockchain.consensus.mq.settings.MsgQueueConsensusSettings;
import com.jd.blockchain.consensus.mq.settings.MsgQueueNetworkSettings;
import com.jd.blockchain.consensus.mq.settings.MsgQueueServerSettings;
import com.jd.blockchain.consensus.service.MessageHandle;
import com.jd.blockchain.consensus.service.NodeServer;
import com.jd.blockchain.consensus.service.StateMachineReplicate;
/**
*
* @author shaozhuguang
* @create 2018/12/13
* @since 1.0.0
*/
public class MsgQueueNodeServer implements NodeServer {
private DefaultMsgQueueMessageDispatcher dispatcher;
private ExtendMsgQueueMessageExecutor extendExecutor;
private MessageHandle messageHandle;
private StateMachineReplicate stateMachineReplicator;
private MsgQueueMessageExecutor messageExecutor;
private MsgQueueNetworkSettings networkSettings;
private MsgQueueConsensusManageService manageService;
private int txSizePerBlock = 1000;
private long maxDelayMilliSecondsPerBlock = 1000;
private MsgQueueServerSettings serverSettings;
private boolean isRunning;
public MsgQueueNodeServer setMessageHandle(MessageHandle messageHandle) {
this.messageHandle = messageHandle;
return this;
}
public MsgQueueNodeServer setStateMachineReplicator(StateMachineReplicate stateMachineReplicator) {
this.stateMachineReplicator = stateMachineReplicator;
return this;
}
public MsgQueueNodeServer setTxSizePerBlock(int txSizePerBlock) {
this.txSizePerBlock = txSizePerBlock;
return this;
}
public MsgQueueNodeServer setMaxDelayMilliSecondsPerBlock(long maxDelayMilliSecondsPerBlock) {
this.maxDelayMilliSecondsPerBlock = maxDelayMilliSecondsPerBlock;
return this;
}
public MsgQueueNodeServer setMsgQueueNetworkSettings(MsgQueueNetworkSettings networkSettings) {
this.networkSettings = networkSettings;
return this;
}
public MsgQueueNodeServer setServerSettings(MsgQueueServerSettings serverSettings) {
this.serverSettings = serverSettings;
this.manageService = new MsgQueueConsensusManageService()
.setConsensusSettings(serverSettings.getConsensusSettings());
return this;
}
public MsgQueueNodeServer init() {
String realmName = this.serverSettings.getRealmName();
MsgQueueBlockSettings blockSettings = this.serverSettings.getBlockSettings();
MsgQueueConsensusSettings consensusSettings = this.serverSettings.getConsensusSettings();
this.setTxSizePerBlock(blockSettings.getTxSizePerBlock())
.setMaxDelayMilliSecondsPerBlock(blockSettings.getMaxDelayMilliSecondsPerBlock())
.setMsgQueueNetworkSettings(consensusSettings.getNetworkSettings())
;
String server = networkSettings.getServer(),
txTopic = networkSettings.getTxTopic(),
blTopic = networkSettings.getBlTopic(),
msgTopic = networkSettings.getMsgTopic();
MsgQueueProducer blProducer = MsgQueueFactory.newProducer(server, blTopic),
txProducer = MsgQueueFactory.newProducer(server, txTopic),
msgProducer = MsgQueueFactory.newProducer(server, msgTopic);
MsgQueueConsumer txConsumer = MsgQueueFactory.newConsumer(server, txTopic),
msgConsumer = MsgQueueFactory.newConsumer(server, msgTopic);
initMessageExecutor(blProducer, realmName);
initDispatcher(txProducer, txConsumer);
initExtendExecutor(msgProducer, msgConsumer);
return this;
}
@Override
public String getProviderName() {
return MsgQueueConsensusProvider.NAME;
}
@Override
public ConsensusManageService getConsensusManageService() {
return this.manageService;
}
@Override
public MsgQueueServerSettings getSettings() {
return serverSettings;
}
@Override
public boolean isRunning() {
return isRunning;
}
@Override
public synchronized void start() {
if (!isRunning) {
try {
dispatcher.connect();
Executors.newSingleThreadExecutor().execute(dispatcher);
extendExecutor.connect();
Executors.newSingleThreadExecutor().execute(extendExecutor);
isRunning = true;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
@Override
public synchronized void stop() {
if (isRunning) {
try {
dispatcher.stop();
extendExecutor.stop();
isRunning = false;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
private void initMessageExecutor(MsgQueueProducer blProducer, final String realmName) {
messageExecutor = new MsgQueueMessageExecutor()
.setRealmName(realmName)
.setMessageHandle(messageHandle)
.setBlProducer(blProducer)
.setStateMachineReplicator(stateMachineReplicator)
.setTxSizePerBlock(txSizePerBlock)
.init()
;
}
private void initDispatcher(MsgQueueProducer txProducer, MsgQueueConsumer txConsumer) {
dispatcher = new DefaultMsgQueueMessageDispatcher(txSizePerBlock, maxDelayMilliSecondsPerBlock)
.setTxProducer(txProducer)
.setTxConsumer(txConsumer)
.setEventHandler(messageExecutor)
;
dispatcher.init();
}
private void initExtendExecutor(MsgQueueProducer msgProducer, MsgQueueConsumer msgConsumer) {
extendExecutor = new ExtendMsgQueueMessageExecutor()
.setMessageHandle(messageHandle)
.setMsgConsumer(msgConsumer)
.setMsgProducer(msgProducer)
;
extendExecutor.init();
}
} | [
"huanghaiquan@jd.com"
] | huanghaiquan@jd.com |
dcefce379bb992bd5935a197b36ab7f355bf50de | a389fac72faa6f9ba4f8aa9f70d9e6a4cb7bb462 | /Chapter 07/Ch07-WF/src/main/java/org/packt/online/cart/portal/dao/impl/CustomerAccountDaoImpl.java | 8daf5197948a10bd989a514660fb1ff48b825e68 | [
"MIT"
] | permissive | PacktPublishing/Spring-MVC-Blueprints | a0e481dd7a8977a64fa4aa0876ab48b5c78139d0 | 14fe9a0889c75f31014f2ebdb2184f40cd7e1da0 | refs/heads/master | 2023-03-13T01:47:20.470661 | 2023-01-30T09:03:09 | 2023-01-30T09:03:09 | 65,816,732 | 27 | 42 | MIT | 2023-02-22T03:32:27 | 2016-08-16T12:04:50 | Java | UTF-8 | Java | false | false | 1,705 | java | package org.packt.online.cart.portal.dao.impl;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
import org.packt.online.cart.portal.dao.CustomerAccountDao;
import org.packt.online.cart.portal.model.data.CustomerAccount;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@Repository
public class CustomerAccountDaoImpl implements CustomerAccountDao {
private SessionFactory sessionFactory;
public SessionFactory getSessionFactory() {
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
@Transactional
@Override
public void setCustomerProfile(CustomerAccount account) {
Session session = this.sessionFactory.openSession();
Transaction transaction = session.beginTransaction();
session.persist(account);
transaction.commit();
session.close();
}
@Transactional
@SuppressWarnings("unchecked")
@Override
public CustomerAccount getCustomerProfile(String username) {
Session session = this.sessionFactory.getCurrentSession();
Criteria crit = session.createCriteria(CustomerAccount.class);
crit.add(Restrictions.like("username",username));
List<CustomerAccount> login = crit.list();
return login.get(0);
}
@Transactional
@Override
public List<CustomerAccount> getAllCustomers() {
Session session = this.sessionFactory.getCurrentSession();
List<CustomerAccount> customers = session.createQuery("from CustomerAccount").list();
return customers;
}
}
| [
"vishalm@packtpub.com"
] | vishalm@packtpub.com |
3a8304d6e4397992f396aeb06a33f6d383ec439d | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /P40_HarmonyOS_2.0.0_Developer_Beta1/src/main/java/gov/nist/core/HostPort.java | 1245c4e0316d39baf39e56c731be8c5a73866447 | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,406 | java | package gov.nist.core;
import java.net.InetAddress;
import java.net.UnknownHostException;
public final class HostPort extends GenericObject {
private static final long serialVersionUID = -7103412227431884523L;
protected Host host = null;
protected int port = -1;
@Override // gov.nist.core.GenericObject
public String encode() {
return encode(new StringBuffer()).toString();
}
@Override // gov.nist.core.GenericObject
public StringBuffer encode(StringBuffer buffer) {
this.host.encode(buffer);
if (this.port != -1) {
buffer.append(Separators.COLON);
buffer.append(this.port);
}
return buffer;
}
@Override // gov.nist.core.GenericObject, java.lang.Object
public boolean equals(Object other) {
if (other == null || getClass() != other.getClass()) {
return false;
}
HostPort that = (HostPort) other;
if (this.port != that.port || !this.host.equals(that.host)) {
return false;
}
return true;
}
public Host getHost() {
return this.host;
}
public int getPort() {
return this.port;
}
public boolean hasPort() {
return this.port != -1;
}
public void removePort() {
this.port = -1;
}
public void setHost(Host h) {
this.host = h;
}
public void setPort(int p) {
this.port = p;
}
public InetAddress getInetAddress() throws UnknownHostException {
Host host2 = this.host;
if (host2 == null) {
return null;
}
return host2.getInetAddress();
}
@Override // gov.nist.core.GenericObject
public void merge(Object mergeObject) {
super.merge(mergeObject);
if (this.port == -1) {
this.port = ((HostPort) mergeObject).port;
}
}
@Override // gov.nist.core.GenericObject, java.lang.Object
public Object clone() {
HostPort retval = (HostPort) super.clone();
Host host2 = this.host;
if (host2 != null) {
retval.host = (Host) host2.clone();
}
return retval;
}
@Override // java.lang.Object
public String toString() {
return encode();
}
@Override // java.lang.Object
public int hashCode() {
return this.host.hashCode() + this.port;
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
020c11f8f653fef580c9093dfbfd87a5439bc923 | fec4c1754adce762b5c4b1cba85ad057e0e4744a | /jf-base/src/main/java/com/jf/entity/LandingPageH5Info.java | 8bd59e412591675dd690e3d44a3cbe101ee1d81a | [] | no_license | sengeiou/workspace_xg | 140b923bd301ff72ca4ae41bc83820123b2a822e | 540a44d550bb33da9980d491d5c3fd0a26e3107d | refs/heads/master | 2022-11-30T05:28:35.447286 | 2020-08-19T02:30:25 | 2020-08-19T02:30:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,001 | java | package com.jf.entity;
import java.util.Date;
public class LandingPageH5Info {
private Integer id;
private String type;
private String ip;
private String reqModel;
private String systemVersion;
private String androidChnl;
private Integer iosActivityGroupId;
private String iosActivityName;
private Integer createBy;
private Date createDate;
private Integer updateBy;
private Date updateDate;
private String remarks;
private String delFlag;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip == null ? null : ip.trim();
}
public String getReqModel() {
return reqModel;
}
public void setReqModel(String reqModel) {
this.reqModel = reqModel == null ? null : reqModel.trim();
}
public String getSystemVersion() {
return systemVersion;
}
public void setSystemVersion(String systemVersion) {
this.systemVersion = systemVersion == null ? null : systemVersion.trim();
}
public String getAndroidChnl() {
return androidChnl;
}
public void setAndroidChnl(String androidChnl) {
this.androidChnl = androidChnl == null ? null : androidChnl.trim();
}
public Integer getIosActivityGroupId() {
return iosActivityGroupId;
}
public void setIosActivityGroupId(Integer iosActivityGroupId) {
this.iosActivityGroupId = iosActivityGroupId;
}
public String getIosActivityName() {
return iosActivityName;
}
public void setIosActivityName(String iosActivityName) {
this.iosActivityName = iosActivityName == null ? null : iosActivityName.trim();
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks == null ? null : remarks.trim();
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag == null ? null : delFlag.trim();
}
} | [
"397716215@qq.com"
] | 397716215@qq.com |
6b40ed4cf48ec3404cbcfc1dee1fb3b78fc32892 | 0adcb787c2d7b3bbf81f066526b49653f9c8db40 | /src/main/java/com/alipay/api/domain/InteligentPromoTool.java | afc4792384c6617a9aa399fd4f05ab950f316a4d | [
"Apache-2.0"
] | permissive | yikey/alipay-sdk-java-all | 1cdca570c1184778c6f3cad16fe0bcb6e02d2484 | 91d84898512c5a4b29c707b0d8d0cd972610b79b | refs/heads/master | 2020-05-22T13:40:11.064476 | 2019-04-11T14:11:02 | 2019-04-11T14:11:02 | 186,365,665 | 1 | 0 | null | 2019-05-13T07:16:09 | 2019-05-13T07:16:08 | null | UTF-8 | Java | false | false | 1,661 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 智能营销工具
*
* @author auto create
* @since 1.0, 2018-01-22 17:07:18
*/
public class InteligentPromoTool extends AlipayObject {
private static final long serialVersionUID = 3339389697548586236L;
/**
* 奖品发放的规则
*/
@ApiField("inteligent_send_rule")
private InteligentSendRule inteligentSendRule;
/**
* 券对象,当活动类型为POINT_SEND时为null,其他活动类型此字段必填
*/
@ApiField("inteligent_voucher")
private InteligentVoucher inteligentVoucher;
/**
* 单个营销工具的生效状态,当在招商部分券失效后会使用这个字段
*/
@ApiField("status")
private String status;
/**
* 营销工具uid,创建营销活动时无需设置
*/
@ApiField("voucher_no")
private String voucherNo;
public InteligentSendRule getInteligentSendRule() {
return this.inteligentSendRule;
}
public void setInteligentSendRule(InteligentSendRule inteligentSendRule) {
this.inteligentSendRule = inteligentSendRule;
}
public InteligentVoucher getInteligentVoucher() {
return this.inteligentVoucher;
}
public void setInteligentVoucher(InteligentVoucher inteligentVoucher) {
this.inteligentVoucher = inteligentVoucher;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public String getVoucherNo() {
return this.voucherNo;
}
public void setVoucherNo(String voucherNo) {
this.voucherNo = voucherNo;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
3eb26ad1a18ed8544d6ee43ac0d45dcc7609a3f6 | ba9192f4aeb635d5c49d80878a04512bc3b645e9 | /src/extends-parent/jetty-all/src/main/java/com/sun/mail/handlers/text_plain.java | dbd0e2737c47618adb642a4854881a10c3547db5 | [
"Apache-2.0"
] | permissive | ivanDannels/hasor | 789e9183a5878cfc002466c9738c9bd2741fd76a | 3b9f4ae6355c6dad2ea8818750b3e04e90cc3e39 | refs/heads/master | 2020-04-15T10:10:22.453889 | 2013-09-14T10:02:01 | 2013-09-14T10:02:01 | 12,828,661 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,885 | java | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can obtain
* a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
* or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
* Sun designates this particular file as subject to the "Classpath" exception
* as provided by Sun in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the License
* Header, with the fields enclosed by brackets [] replaced by your own
* identifying information: "Portions Copyrighted [year]
* [name of copyright owner]"
*
* Contributor(s):
*
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/*
* @(#)text_plain.java 1.21 07/05/04
*/
package com.sun.mail.handlers;
import java.io.*;
import java.awt.datatransfer.DataFlavor;
import javax.activation.*;
import javax.mail.internet.*;
/**
* DataContentHandler for text/plain.
*
* @version 1.21, 07/05/04
*/
public class text_plain implements DataContentHandler {
private static ActivationDataFlavor myDF = new ActivationDataFlavor(
java.lang.String.class,
"text/plain",
"Text String");
protected ActivationDataFlavor getDF() {
return myDF;
}
/**
* Return the DataFlavors for this <code>DataContentHandler</code>.
*
* @return The DataFlavors
*/
public DataFlavor[] getTransferDataFlavors() {
return new DataFlavor[] { getDF() };
}
/**
* Return the Transfer Data of type DataFlavor from InputStream.
*
* @param df The DataFlavor
* @param ds The DataSource corresponding to the data
* @return String object
*/
public Object getTransferData(DataFlavor df, DataSource ds)
throws IOException {
// use myDF.equals to be sure to get ActivationDataFlavor.equals,
// which properly ignores Content-Type parameters in comparison
if (getDF().equals(df))
return getContent(ds);
else
return null;
}
public Object getContent(DataSource ds) throws IOException {
String enc = null;
InputStreamReader is = null;
try {
enc = getCharset(ds.getContentType());
is = new InputStreamReader(ds.getInputStream(), enc);
} catch (IllegalArgumentException iex) {
/*
* An unknown charset of the form ISO-XXX-XXX will cause
* the JDK to throw an IllegalArgumentException. The
* JDK will attempt to create a classname using this string,
* but valid classnames must not contain the character '-',
* and this results in an IllegalArgumentException, rather than
* the expected UnsupportedEncodingException. Yikes.
*/
throw new UnsupportedEncodingException(enc);
}
try {
int pos = 0;
int count;
char buf[] = new char[1024];
while ((count = is.read(buf, pos, buf.length - pos)) != -1) {
pos += count;
if (pos >= buf.length) {
int size = buf.length;
if (size < 256*1024)
size += size;
else
size += 256*1024;
char tbuf[] = new char[size];
System.arraycopy(buf, 0, tbuf, 0, pos);
buf = tbuf;
}
}
return new String(buf, 0, pos);
} finally {
try {
is.close();
} catch (IOException ex) { }
}
}
/**
* Write the object to the output stream, using the specified MIME type.
*/
public void writeTo(Object obj, String type, OutputStream os)
throws IOException {
if (!(obj instanceof String))
throw new IOException("\"" + getDF().getMimeType() +
"\" DataContentHandler requires String object, " +
"was given object of type " + obj.getClass().toString());
String enc = null;
OutputStreamWriter osw = null;
try {
enc = getCharset(type);
osw = new OutputStreamWriter(os, enc);
} catch (IllegalArgumentException iex) {
/*
* An unknown charset of the form ISO-XXX-XXX will cause
* the JDK to throw an IllegalArgumentException. The
* JDK will attempt to create a classname using this string,
* but valid classnames must not contain the character '-',
* and this results in an IllegalArgumentException, rather than
* the expected UnsupportedEncodingException. Yikes.
*/
throw new UnsupportedEncodingException(enc);
}
String s = (String)obj;
osw.write(s, 0, s.length());
osw.flush();
}
private String getCharset(String type) {
try {
ContentType ct = new ContentType(type);
String charset = ct.getParameter("charset");
if (charset == null)
// If the charset parameter is absent, use US-ASCII.
charset = "us-ascii";
return MimeUtility.javaCharset(charset);
} catch (Exception ex) {
return null;
}
}
}
| [
"zyc@byshell.org"
] | zyc@byshell.org |
62975c16075e33807f4d84682b341b1e250280d7 | 5db11b0c9098351480c57de617336ab7dff483e1 | /src/com/aionemu/gameserver/dataholders/AssemblyItemsData.java | 3fc173235992b9317c13ba9dc92ad769d71af842 | [] | no_license | VictorManKBO/aion_gserver_4_0 | d7c6383a005f1a716fcee5e4bd0c33df30a0e0c5 | ed24bf40c9fcff34cd0c64243b10ab44e60bb258 | refs/heads/master | 2022-11-15T19:52:47.654179 | 2020-07-13T10:16:04 | 2020-07-13T10:16:04 | 277,644,635 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,678 | java | /*
* This file is part of aion-lightning <aion-lightning.org>.
*
* aion-lightning is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* aion-lightning is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with aion-lightning. If not, see <http://www.gnu.org/licenses/>.
*/
package com.aionemu.gameserver.dataholders;
import com.aionemu.gameserver.model.templates.item.AssemblyItem;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.*;
/**
*
* @author xTz
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"item"
})
@XmlRootElement(name = "assembly_items")
public class AssemblyItemsData {
@XmlElement(required = true)
protected List<AssemblyItem> item;
@XmlTransient
private List<AssemblyItem> items = new ArrayList<AssemblyItem>();
void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
for (AssemblyItem template : item) {
items.add(template);
}
}
public int size() {
return items.size();
}
public AssemblyItem getAssemblyItem(int itemId) {
for (AssemblyItem assemblyItem : items) {
if (assemblyItem.getId() == itemId) {
return assemblyItem;
}
}
return null;
}
}
| [
"Vitek.agl@yandex.ru"
] | Vitek.agl@yandex.ru |
363f6819cde267dd67238cffab9368c40d3371c6 | 6d5bca66f5e3e93f2f4addb326de67503c839dd3 | /src/main/java/net/codingme/lucene/analyzer/StkAnalyzer.java | adf49e01a8389bb66f94cc28922feec213965f9a | [] | no_license | niumoo/lucene-examples | 3cabc1b8667318b32e77431b6cc3f65bf8434fad | a1d515b99be0f154d4cd111f29a1c9484308669a | refs/heads/master | 2020-03-22T23:50:45.894748 | 2019-07-31T08:43:25 | 2019-07-31T08:43:25 | 140,831,288 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,725 | java | package net.codingme.lucene.analyzer;
import java.io.IOException;
import java.io.StringReader;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
/**
* <p>
* Lucene标准分词器
* <p>
* StandardAnalyzer对中文分词:
* 中|华|人|民|共|和|国|简|称|中|国|是|一|个|有|13|亿|人|口|的|国|家|
* StandardAnalyzer对英文分词:
* dogs|can|achiece|place|eyes|can|reach|
*
* @author niujinpeng
* @date 2018年6月20日下午10:33:47
*/
public class StkAnalyzer {
private static String strCh = "中华人民共和国简称中国,是一个有13亿人口的国家";
private static String strEn = "Dogs can not achiece a place, eyes can reach";
public static void main(String[] args) throws IOException {
System.out.println("StandardAnalyzer对中文分词:");
stdAnalyzer(strCh);
System.out.println("StandardAnalyzer对英文分词:");
stdAnalyzer(strEn);
}
// Lucene标准分词处理
public static void stdAnalyzer(String str) throws IOException {
Analyzer analyzer = new StandardAnalyzer();
StringReader reader = new StringReader(str);
TokenStream tokenStream = analyzer.tokenStream(str, reader);
// 清空流
tokenStream.reset();
CharTermAttribute charTermAttribute = tokenStream.getAttribute(CharTermAttribute.class);
while (tokenStream.incrementToken()) {
System.out.print(charTermAttribute.toString() + "|");
}
System.out.println();
analyzer.close();
}
}
| [
"niumoo@126.com"
] | niumoo@126.com |
88a2a5a38de681616832d979512437bfca3909f6 | 2fe28a033511fdf8d2027c8cc63c3423646150b8 | /src/OfficeHours/Practice/certification/date_time/Old_DateAndTime.java | 2ab7b39014c2821854ca5af5ccf16296617be3c8 | [] | no_license | danyalwalker/Java-Programming | 4c581a06a1cca45f56e3a6db4535d8fb6798ccac | a89505403eedd5920a7414d1b41c28136003d8a4 | refs/heads/master | 2023-07-19T16:56:07.188814 | 2021-09-25T21:27:20 | 2021-09-25T21:27:20 | 374,452,988 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 605 | java | package OfficeHours.Practice.certification.date_time;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar; // imports are from util package
public class Old_DateAndTime {
public static void main(String[] args) {
Calendar c = Calendar.getInstance();
c.set(2021, Calendar.AUGUST,29);
Date Aug = c.getTime();
Calendar g = new GregorianCalendar(2021, Calendar.AUGUST,29);
Date August = g.getTime();
Calendar d = Calendar.getInstance(); c.set(2015, 0, 1); // without the constant
Date jan = c.getTime();
}
}
| [
"danielwalker.ny@gmail.com"
] | danielwalker.ny@gmail.com |
20c34e5db2119adcb365300b29cfda9c45f7690a | 0548278d3e457964ebd5da9378b7e6f6f0f55f7e | /zl-pl/src-fencing/com/vt/fengci/zlnf/service/impl/TimeAxisServiceImpl.java | e7ea1679679412e1aa566de7e3b55281815cfe54 | [] | no_license | cnhys/Job-Uav | 4bbfeef2231067d284599f2854aaa70212efd6eb | 06639d5a23e3dcf92f3a4355323d3d0ee4cbc986 | refs/heads/master | 2020-03-22T23:26:21.117122 | 2018-07-13T07:26:47 | 2018-07-13T07:26:47 | 140,810,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,108 | java | package com.vt.fengci.zlnf.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.vt.base.mapper.IBaseMapper;
import com.vt.base.service.BaseService;
import com.vt.fencing.client.ZlnfTimeAxisMapper;
import com.vt.fencing.model.ZlnfTimeAxis;
import com.vt.fencing.model.ZlnfTimeAxisExample;
import com.vt.fengci.zlnf.service.ITimeAxisService;
/**
* 时间轴业务
* Created by john on 17/7/17.
*/
@Service
public class TimeAxisServiceImpl extends BaseService<ZlnfTimeAxis, ZlnfTimeAxisExample, Integer> implements ITimeAxisService{
private static final long serialVersionUID = -3767813387098063443L;
/**
* mapper
*/
@Autowired
private ZlnfTimeAxisMapper mapper;
@Override
public IBaseMapper<ZlnfTimeAxis, ZlnfTimeAxisExample, Integer> getMapper() {
// TODO Auto-generated method stub
return mapper;
}
@Override
public List<ZlnfTimeAxis> queryByOrdercode(ZlnfTimeAxis record) {
// TODO Auto-generated method stub
return mapper.queryByOrdercode(record);
}
}
| [
"ithys001@163.com"
] | ithys001@163.com |
eac77a97405a6d6042f8cf7414739db2e61e2d73 | a1e49f5edd122b211bace752b5fb1bd5c970696b | /projects/org.springframework.context/src/main/java/org/springframework/format/datetime/joda/ReadablePartialPrinter.java | 9ad97c20581feea2c9dcfc530106210d5e634688 | [
"Apache-2.0"
] | permissive | savster97/springframework-3.0.5 | 4f86467e2456e5e0652de9f846f0eaefc3214cfa | 34cffc70e25233ed97e2ddd24265ea20f5f88957 | refs/heads/master | 2020-04-26T08:48:34.978350 | 2019-01-22T14:45:38 | 2019-01-22T14:45:38 | 173,434,995 | 0 | 0 | Apache-2.0 | 2019-03-02T10:37:13 | 2019-03-02T10:37:12 | null | UTF-8 | Java | false | false | 1,449 | java | /*
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.springframework.format.datetime.joda;
import java.util.Locale;
import org.joda.time.ReadablePartial;
import org.joda.time.format.DateTimeFormatter;
import org.springframework.format.Printer;
/**
* Prints JodaTime {@link ReadablePartial} instances using a {@link DateTimeFormatter}.
*
* @author Keith Donald
* @since 3.0
*/
public final class ReadablePartialPrinter implements Printer<ReadablePartial> {
private final DateTimeFormatter formatter;
/**
* Create a new ReadableInstantPrinter.
* @param formatter the Joda DateTimeFormatter instance
*/
public ReadablePartialPrinter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public String print(ReadablePartial partial, Locale locale) {
return JodaTimeContextHolder.getFormatter(this.formatter, locale).print(partial);
}
}
| [
"taibi@sonar-scheduler.rd.tut.fi"
] | taibi@sonar-scheduler.rd.tut.fi |
f2a1106c4822571931e2ea96c032cde1c7665658 | 2bc00c3d724a8ddbfc1ca7f57265cd459dc67467 | /com.renho.internet/src/main/java/com/renho/internet/nio/netty/TimeClient.java | 9a40c3fa1cd4ffa45ee70a5a21b6a5dfd74723c4 | [] | no_license | renho-r/ongit | 1aed813a2d056b940f8de56e7fbdc739f0277de1 | 5b3d2dc16b3381ebe251868ce08872372a6f12a2 | refs/heads/master | 2021-10-07T17:05:07.269405 | 2020-04-07T13:15:57 | 2020-04-07T13:15:57 | 31,402,894 | 5 | 0 | null | 2020-12-09T08:18:51 | 2015-02-27T04:06:44 | HTML | UTF-8 | Java | false | false | 1,278 | java | package com.renho.internet.nio.netty;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
public class TimeClient {
public static void main(String[] args) throws Exception {
args = new String[]{"localhost", "8080"};
String host = args[0];
int port = Integer.parseInt(args[1]);
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
Bootstrap b = new Bootstrap(); // (1)
b.group(workerGroup); // (2)
b.channel(NioSocketChannel.class); // (3)
b.option(ChannelOption.SO_KEEPALIVE, true); // (4)
b.handler(new ChannelInitializer<SocketChannel>() {
@Override
public void initChannel(SocketChannel ch) throws Exception {
ch.pipeline().addLast(new TimeClientHandler());
}
});
// Start the client.
ChannelFuture f = b.connect(host, port).sync(); // (5)
// Wait until the connection is closed.
f.channel().closeFuture().sync();
} finally {
workerGroup.shutdownGracefully();
}
}
} | [
"rho_i_xx@163.com"
] | rho_i_xx@163.com |
f289875cb4e1134b431179d8659cba5dc056649a | c662a1f1f4660cc644b63f417f0911cee5e8fbfb | /corejava/src/main/java/io/qkits/corejava/corejava/stream/Streams6.java | f54db45e721ff3ddbe3df68a490c5d43bd6babe8 | [] | no_license | qdriven/walkthough-backend | c10308b4fb1a3524d9c11f313f5c22620e554432 | df9cb95e814e66eb582c319c983154f36f1acf23 | refs/heads/master | 2022-07-08T11:34:39.424832 | 2021-12-11T03:47:08 | 2021-12-11T03:47:08 | 200,501,198 | 0 | 0 | null | 2022-06-21T04:16:24 | 2019-08-04T14:14:29 | Java | UTF-8 | Java | false | false | 1,249 | java | package io.qkits.corejava.corejava.stream;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.stream.IntStream;
import java.util.stream.Stream;
/**
* @author Benjamin Winterberg
*/
public class Streams6 {
public static void main(String[] args) throws IOException {
test1();
test2();
test3();
test4();
}
private static void test4() {
Stream
.of(new BigDecimal("1.2"), new BigDecimal("3.7"))
.mapToDouble(BigDecimal::doubleValue)
.average()
.ifPresent(System.out::println);
}
private static void test3() {
IntStream
.range(0, 10)
.average()
.ifPresent(System.out::println);
}
private static void test2() {
IntStream
.builder()
.add(1)
.add(3)
.add(5)
.add(7)
.add(11)
.build()
.average()
.ifPresent(System.out::println);
}
private static void test1() {
int[] ints = {1, 3, 5, 7, 11};
Arrays
.stream(ints)
.average()
.ifPresent(System.out::println);
}
}
| [
"patrickwuke@163.com"
] | patrickwuke@163.com |
29ff520dc22e316a52defc825ae1bb3bbbff73b8 | 4dade4f29881e99d8602144744e09ed870bd1034 | /Java/DesignPatterns/Builder/src/items/Burger.java | 62310da309b4cb1bbfac8945fed8345bf794da3c | [] | no_license | alexbaryzhikov/codebase-archive | 9795347c19a82c098983c6d0fe4959c3162ca868 | c78c189002a26296a552f30078578cc0cf72e426 | refs/heads/master | 2023-02-19T21:54:21.310865 | 2021-01-11T15:47:50 | 2021-01-11T15:47:50 | 106,846,461 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 183 | java | package items;
public abstract class Burger implements Item {
@Override
public Packing packing() {
return new Wrapper();
}
@Override
public abstract float price();
}
| [
"aleksiarts@gmail.com"
] | aleksiarts@gmail.com |
89e9f9f102bad921375864c0e0d1204bb4108b70 | f59f9a03eaf296faa8fad67380e5c90958dbe3cf | /src/main/java/com/whg/ijvm/ch11/instruction/conver/F2x.java | bc5cf8d7dc13884563653dcc69988b2c28e6a164 | [] | no_license | whg333/ijvm | 479b1ee2328c6b8c663e668b2c38c8423dbb8596 | 28c4b60beaa7412cec59e210e40c366b74aaa939 | refs/heads/master | 2022-06-26T07:47:10.357161 | 2022-05-16T12:25:32 | 2022-05-16T12:25:32 | 208,620,194 | 3 | 2 | null | 2022-06-17T03:37:40 | 2019-09-15T16:09:24 | Java | UTF-8 | Java | false | false | 961 | java | package com.whg.ijvm.ch11.instruction.conver;
import com.whg.ijvm.ch11.instruction.base.NoOperandsInstruction;
import com.whg.ijvm.ch11.runtime.OperandStack;
import com.whg.ijvm.ch11.runtime.RFrame;
public class F2x {
public static class F2D extends NoOperandsInstruction{
@Override
public void execute(RFrame frame) {
OperandStack stack = frame.getOperandStack();
stack.pushDouble(stack.popFloat());
}
}
public static class F2I extends NoOperandsInstruction{
@Override
public void execute(RFrame frame) {
OperandStack stack = frame.getOperandStack();
stack.pushInt((int) stack.popFloat());
}
}
public static class F2L extends NoOperandsInstruction{
@Override
public void execute(RFrame frame) {
OperandStack stack = frame.getOperandStack();
stack.pushLong((long) stack.popFloat());
}
}
}
| [
"wanghonggang@hulai.com"
] | wanghonggang@hulai.com |
124261e94c0eb85bd85d87ea21d7c6a25d49fd90 | df8a7ef35ff28506053e4729b029c8d7a80587cd | /src/main/java/com/joymain/ng/util/ListUtil.java | 06e4ffc2647231f1af36a39e35be10bf25bfd120 | [] | no_license | lshowbiz/agnt_qt | 101a5b3cabd0e1ff9135155ac87a602997a9eff5 | 789c2439308adaa5371d5bbb8a0f71a295395006 | refs/heads/master | 2022-12-11T10:13:18.791876 | 2019-10-02T01:01:57 | 2019-10-02T01:01:57 | 212,161,344 | 0 | 1 | null | 2022-12-05T23:28:41 | 2019-10-01T17:46:56 | Java | UTF-8 | Java | false | false | 1,424 | java | package com.joymain.ng.util;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import com.joymain.ng.Constants;
public class ListUtil {
protected static JdbcTemplate jdbcTemplate;
/**
* 根据键值获取对应的字符值<value, title>
* @param msgKey
* @return
*/
public static final LinkedHashMap<String, String> getListOptions(String companyCode, String listCode) {
Set valueSets = Constants.sysListMap.get(listCode).entrySet();
LinkedHashMap<String, String> optionMap=new LinkedHashMap<String, String>();
if (valueSets != null) {
Iterator iter = valueSets.iterator();
while (iter.hasNext()) {
Map.Entry entry=(Map.Entry)iter.next();
String[] values = (String[])entry.getValue();
if(StringUtils.contains(values[1],companyCode)){
//如果当前用户所属公司在排除公司之内,则不显示
continue;
}else{
optionMap.put(entry.getKey().toString(), values[0]);
}
}
}
return optionMap;
}
public static final String getListValue(String characterCode, String listCode, String listValue){
String[] values = Constants.sysListMap.get(listCode).get(listValue);
if (values != null){
return LocaleUtil.getLocalText(characterCode, values[0]);
}else{
return null;
}
}
} | [
"727736571@qq.com"
] | 727736571@qq.com |
39aeda4a71f52c0cb9c722bebde7f8ce376cd929 | 79d081703d7516e474be2da97ee6419a5320b6ff | /src/swordToOffer/maxProfit/improve4/Solution.java | eebec30c0b5e2ac7efeeadadbf1097ea6a801d67 | [] | no_license | ITrover/Algorithm | e22494ca4c3b2e41907cc606256dcbd1d173886d | efa4eecc7e02754078d284269556657814cb167c | refs/heads/master | 2022-05-26T01:48:28.956693 | 2022-04-01T11:58:24 | 2022-04-01T11:58:24 | 226,656,770 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,139 | java | package swordToOffer.maxProfit.improve4;
/**
* @author itrover
* 714. 买卖股票的最佳时机含手续费 https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
* 贪心算法
*/
class Solution {
public int maxProfit(int[] prices, int fee) {
int n = prices.length;
// 买入费用
int buy = prices[0] + fee;
// 收益
int profit = 0;
for (int i = 1; i < n; ++i) {
// 如果买入费用 < 之前buy的费用,则重新购买
if (prices[i] + fee < buy) {
buy = prices[i] + fee;
} else if (prices[i] > buy) {
// 如果当前售价大于了买入费用,则用贪心算法更新收益
profit += prices[i] - buy;
// 买入的价格按照prices[i]来算,因为一个收益已经减去了fee
// 下一次如果 prices[i] > buy 才能够更新
// 如果下一个次的price + fee 也比 buy小,那么重新买的收益会更大
buy = prices[i];
}
}
return profit;
}
}
| [
"1172610139@qq.com"
] | 1172610139@qq.com |
ad44d2334602a2b8bee9fd3f98245148f2f3844d | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/grade/1c2bb3a40a82cba97b2937bc6825903a28ecfe91f993fc177a0f2ae003bcc7b1073eb49e35d3f0f69d6b612e8347e9c1b93306bf25a7e5390098c1a06845baac/003/mutations/48/grade_1c2bb3a4_003.java | 7869b5f415c027b530eb5548825d130399c54d2d | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,361 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class grade_1c2bb3a4_003 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
grade_1c2bb3a4_003 mainClass = new grade_1c2bb3a4_003 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
DoubleObj a = new DoubleObj (), b = new DoubleObj (), c =
new DoubleObj (), d = new DoubleObj (), e = new DoubleObj ();
output +=
(String.format
("Enter thresholds for A, B, C, D\nin that order, decreasing percentages > Thank you. "));
a.value = scanner.nextDouble ();
b.value = scanner.nextDouble ();
c.value = scanner.nextDouble ();
d.value = scanner.nextDouble ();
output += (String.format ("Now enter student score (percent) >"));
e.value = scanner.nextDouble ();
if (e.value >= a.value) {
output += (String.format ("Student has an A grade\n"));
} else if (e.value) >= (d.value) {
output += (String.format ("Student has an B grade\n"));
} else if (e.value >= c.value) {
output += (String.format ("Student has an C grade\n"));
} else if (e.value >= d.value) {
output += (String.format ("Student has an D grade\n"));
} else {
output += (String.format ("Student has an F grade\n"));
}
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
605b564297e84309999a5d5f0fa5f89f73faea9f | 258de8e8d556901959831bbdc3878af2d8933997 | /utopia-service/utopia-crm/utopia-crm-api/src/main/java/com/voxlearning/utopia/entity/crm/CrmRecSchool.java | 7ac708f5dbc798e3f48a78405c4afe685db363d9 | [] | no_license | Explorer1092/vox | d40168b44ccd523748647742ec376fdc2b22160f | 701160b0417e5a3f1b942269b0e7e2fd768f4b8e | refs/heads/master | 2020-05-14T20:13:02.531549 | 2019-04-17T06:54:06 | 2019-04-17T06:54:06 | 181,923,482 | 0 | 4 | null | 2019-04-17T15:53:25 | 2019-04-17T15:53:25 | null | UTF-8 | Java | false | false | 2,158 | java | package com.voxlearning.utopia.entity.crm;
import com.voxlearning.alps.annotation.dao.DocumentConnection;
import com.voxlearning.alps.annotation.dao.DocumentField;
import com.voxlearning.alps.annotation.dao.DocumentFieldIgnore;
import com.voxlearning.alps.annotation.dao.DocumentId;
import com.voxlearning.alps.annotation.dao.mongo.DocumentCollection;
import com.voxlearning.alps.annotation.dao.mongo.DocumentDatabase;
import com.voxlearning.alps.spi.common.TimestampTouchable;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Date;
/**
* Created by jiang wei on 2016/7/26.
*/
@Getter
@Setter
@DocumentConnection(configName = DocumentConnection.DEFAULT_MONGO_CONFIG_NAME)
@DocumentDatabase(database = "vox-bigdata")
@DocumentCollection(collection = "vb_rec_school_result")
public class CrmRecSchool implements Serializable, TimestampTouchable {
private static final long serialVersionUID = -7409920989532201772L;
@DocumentId
private String id;
@DocumentField("province_id")
private Integer provinceId;
@DocumentField("city_id")
private Integer cityId;
@DocumentField("county_id")
private Integer countyId;
@DocumentField("name")
private String schoolName;
@DocumentField("blat")
private Double blat;
@DocumentField("blon")
private Double blon;
@DocumentField("addr")
private String addr;
@DocumentField("verify")
private String verify;
@DocumentField("verify_mode")
private String verifyMode;
@DocumentField("auditor")
private String auditor;
@DocumentField("update_time")
private Date updateTime;
@DocumentField("status")
private String status;
@DocumentField("audit_result")
private Integer auditResult;
@DocumentField("id")
private Integer schoolId;
@DocumentField("dt")
private String dt;
@DocumentFieldIgnore
private String provinceName;
@DocumentFieldIgnore
private String cityName;
@DocumentFieldIgnore
private String countyName;
@Override
public void touchUpdateTime(long timestamp) {
updateTime = new Date(timestamp);
}
}
| [
"wangahai@300.cn"
] | wangahai@300.cn |
3e1ab77d36b1c09aa74f60ea90ea35c7c7cd8a83 | e669f331f32d001e908ecaacf485fd9e415689e2 | /app/src/main/java/com/example/ddopik/phlogbusiness/ui/profile/model/BusinessProfileResponse.java | 3f3f809e440802443446e47a986b1100ac28270c | [] | no_license | ddopik/SofPhLogBus | 17953169906b0114c58e7782039dcba7c87f0c41 | 7d8c476264dc86b51d98cf161316e6788737514e | refs/heads/master | 2020-04-08T12:27:05.429678 | 2019-04-24T15:08:40 | 2019-04-24T15:08:40 | 159,347,828 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package com.example.ddopik.phlogbusiness.ui.profile.model;
import com.example.ddopik.phlogbusiness.base.commonmodel.Business;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class BusinessProfileResponse {
@SerializedName("data")
@Expose
public Business brand;
}
| [
"ddopik.01@gmail.com"
] | ddopik.01@gmail.com |
f8f01507634eee032b0ad50bd62fd3c22098bb17 | 95c49f466673952b465e19a5ee3ae6eff76bee00 | /src/main/java/com/zhihu/android/api/model/template/api/ApiTemplateRoot.java | 5d7d32958ba0cba306dafa64717246b8e825745d | [] | 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 | 6,540 | java | package com.zhihu.android.api.model.template.api;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import com.fasterxml.jackson.databind.p528a.JsonDeserialize;
import com.fasterxml.jackson.p518a.JsonIgnore;
import com.fasterxml.jackson.p518a.JsonProperty;
import com.zhihu.android.answer.utils.AnswerConstants;
import com.zhihu.android.api.model.FeedPromotionExtra;
import com.zhihu.android.api.model.FeedUninterestReason;
import com.zhihu.android.api.model.ZHObject;
import com.zhihu.android.api.model.template.BlockItem;
import com.zhihu.android.api.model.template.DataUnique;
import com.zhihu.android.api.model.template.FeedContent;
import com.zhihu.android.api.model.template.ImageList;
import com.zhihu.android.api.model.template.LineList;
import com.zhihu.android.api.model.template.MediaContent;
import com.zhihu.android.api.model.template.TemplateAction;
import com.zhihu.android.api.model.template.TemplateFeed;
import com.zhihu.android.api.model.template.TemplateRoot;
import com.zhihu.android.api.model.template.TemplateText;
import com.zhihu.android.app.feed.util.JsonSafeUtils;
import com.zhihu.android.p945ad.adzj.AdZjProxy;
import java.util.List;
import java.util.Map;
import java8.util.Optional;
import java8.util.stream.Collectors;
@JsonDeserialize
public class ApiTemplateRoot extends ZHObject implements Parcelable {
public static final Parcelable.Creator<ApiTemplateRoot> CREATOR = new Parcelable.Creator<ApiTemplateRoot>() {
/* class com.zhihu.android.api.model.template.api.ApiTemplateRoot.C102871 */
@Override // android.os.Parcelable.Creator
public ApiTemplateRoot createFromParcel(Parcel parcel) {
return new ApiTemplateRoot(parcel);
}
@Override // android.os.Parcelable.Creator
public ApiTemplateRoot[] newArray(int i) {
return new ApiTemplateRoot[i];
}
};
public static final String TYPE = "common_card";
@JsonProperty(mo29184a = "actors")
public List<ZHObject> actors;
@JsonProperty(mo29184a = "attached_info")
public String attached_info;
@JsonProperty(mo29184a = "brand_promotion_extra")
public String brandPromotionExtra;
@JsonProperty(mo29184a = "brief")
public String brief;
@JsonProperty(mo29184a = TYPE)
public ApiFeedCard common_card;
@JsonProperty(mo29184a = "extra")
public DataUnique extra;
@JsonProperty(mo29184a = "offset")
public int offset;
@JsonProperty(mo29184a = AnswerConstants.EXTRA_PROMOTION)
public String promotionExtra;
@JsonIgnore
public TemplateRoot templateRoot;
@JsonProperty(mo29184a = "type")
public String type;
@JsonProperty(mo29184a = "uninterest_reasons")
public List<FeedUninterestReason> uninterestReasons;
@Override // com.zhihu.android.api.model.ZHObject
public int describeContents() {
return 0;
}
public TemplateRoot parse() {
DataUnique dataUnique;
ApiFeedCard apiFeedCard = this.common_card;
if (apiFeedCard == null || this.templateRoot != null) {
return this.templateRoot;
}
if (apiFeedCard.feed_content == null && apiFeedCard.media_card_content == null) {
return null;
}
TemplateFeed templateFeed = new TemplateFeed();
templateFeed.headTeletexts = TemplateText.parseTeletextsFromApi(apiFeedCard.headline);
templateFeed.bottomTeletexts = TemplateText.parseTeletextsFromApi(apiFeedCard.footline);
if (!(apiFeedCard.feed_content == null || apiFeedCard.feed_content.drama == null || (dataUnique = this.extra) == null || dataUnique.f40448id == null)) {
apiFeedCard.feed_content.drama.f40449id = this.extra.f40448id;
}
if (apiFeedCard.media_card_content != null) {
templateFeed.content = MediaContent.parseFromApi(apiFeedCard.media_card_content);
} else {
templateFeed.content = FeedContent.parseFromApi(apiFeedCard.feed_content, apiFeedCard.version);
}
templateFeed.style = apiFeedCard.style;
templateFeed.menuItems = ApiFeedCard.parseMenuFromApi(apiFeedCard.ellipsis_menu);
templateFeed.action = TemplateAction.parseFromApi(apiFeedCard.action);
templateFeed.offset = this.offset;
templateFeed.blockItems = (List) Optional.m150255b(apiFeedCard.apiBlockItems).mo131268d().mo131132b($$Lambda$V4Rz6FaiNaMupn_gv9MfDnakh64.INSTANCE).mo131128a($$Lambda$ApiTemplateRoot$quRCXpz3nKqHhHRJ9MylTbTrJM.INSTANCE).mo131127a($$Lambda$ApiTemplateRoot$a1dcxHAXoFbnOpWeX5mhAKUinM.INSTANCE).mo131125a(Collectors.m150199a());
templateFeed.imageListItems = ImageList.parseFromApi(apiFeedCard.apiBlockItems);
saveZjEntity(templateFeed, this.promotionExtra);
templateFeed.unique = this.extra;
templateFeed.actors = this.actors;
templateFeed.attachInfo = this.attached_info;
templateFeed.promotionExtra = (FeedPromotionExtra) JsonSafeUtils.m62786a(this.promotionExtra, FeedPromotionExtra.class);
templateFeed.brandPromotionExtra = (FeedPromotionExtra) JsonSafeUtils.m62786a(this.brandPromotionExtra, FeedPromotionExtra.class);
templateFeed.brief = this.brief;
templateFeed.unInterestReasons = this.uninterestReasons;
templateFeed.hasMenu = templateFeed.menuItems != null && templateFeed.menuItems.size() > 0;
this.templateRoot = templateFeed;
return templateFeed;
}
static /* synthetic */ boolean lambda$parse$0(ApiBlockItem apiBlockItem) {
return apiBlockItem.lineList != null;
}
static /* synthetic */ BlockItem lambda$parse$1(ApiBlockItem apiBlockItem) {
if (apiBlockItem.lineList != null) {
return LineList.parseFromApi(apiBlockItem);
}
return null;
}
private void saveZjEntity(TemplateRoot templateRoot2, String str) {
if (!TextUtils.isEmpty(str)) {
String a = AdZjProxy.m53919a(str, (Map<String, String>) null);
if (!TextUtils.isEmpty(a)) {
templateRoot2.contentSign = a;
}
}
}
public ApiTemplateRoot() {
}
@Override // com.zhihu.android.api.model.ZHObject
public void writeToParcel(Parcel parcel, int i) {
super.writeToParcel(parcel, i);
ApiTemplateRootParcelablePlease.writeToParcel(this, parcel, i);
}
protected ApiTemplateRoot(Parcel parcel) {
super(parcel);
ApiTemplateRootParcelablePlease.readFromParcel(this, parcel);
}
}
| [
"seasonpplp@qq.com"
] | seasonpplp@qq.com |
c94fff17cc7c8e951397ebe281aa0f346da9eda9 | 8e5584f51543d2122fe2c565eb96f4f61aed1af6 | /Pattern/src/com/xj/flyweight/Client.java | 2deb368dfdc4b8d57eac7fd3ce7dc229f526d71e | [] | no_license | Wall-Xj/JavaStudy | 8bf8c149b75582eca1e52fc06bffbbb06c3bd528 | 0fe70d8d869b9360b09e9ce27efecd7329d42f8c | refs/heads/master | 2021-01-15T22:46:22.591778 | 2018-03-05T13:23:10 | 2018-03-05T13:23:10 | 99,911,643 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 442 | java | package com.xj.flyweight;
public class Client {
public static void main(String[] args) {
ChessFlyWeight chess1 = ChessFlyWeightFactory.getChess("黑");
ChessFlyWeight chess2 = ChessFlyWeightFactory.getChess("黑");
System.out.println(chess1.getColor());
System.out.println(chess2.getColor());
System.out.println("增加外部状态操作:");
chess1.display(new Coordinate(1, 2));
chess2.display(new Coordinate(2, 2));
}
}
| [
"592942092@qq.com"
] | 592942092@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.