blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
332
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
50
| license_type
stringclasses 2
values | repo_name
stringlengths 7
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 557
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 82
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
5.41M
| extension
stringclasses 11
values | content
stringlengths 7
5.41M
| authors
listlengths 1
1
| author
stringlengths 0
161
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00849ddd740c055395c0f5b2d65e82b1d1847aa6
|
ffb812e8e56c38a7c38856e49710d06c8e387efd
|
/src/com/braker/icontrol/cgmanage/cgexpert/manager/impl/ExpertOutMngImpl.java
|
5603f158116225e3fde2ee0cd41d457d089fea53
|
[] |
no_license
|
MengleiZhao/gxjzy_nk
|
81a9720f996a937c8067466c9dd4f210e9861ac5
|
7c1693092467339fa5294149b605c1d8f19d817f
|
refs/heads/main
| 2023-08-24T18:18:59.839056 | 2021-09-24T12:57:28 | 2021-09-24T12:57:28 | 409,955,569 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,912 |
java
|
package com.braker.icontrol.cgmanage.cgexpert.manager.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.braker.common.entity.CheckEntity;
import com.braker.common.hibernate.BaseManagerImpl;
import com.braker.common.hibernate.Finder;
import com.braker.common.util.StringUtil;
import com.braker.core.manager.EconomicMng;
import com.braker.core.manager.PersonalWorkMng;
import com.braker.core.manager.PrivateInforMng;
import com.braker.core.manager.UserMng;
import com.braker.core.model.User;
import com.braker.icontrol.cgmanage.cgexpert.manager.CgExpertMng;
import com.braker.icontrol.cgmanage.cgexpert.manager.ExpertCheckMng;
import com.braker.icontrol.cgmanage.cgexpert.manager.ExpertOutMng;
import com.braker.icontrol.cgmanage.cgexpert.model.ExpertInfo;
import com.braker.icontrol.cgmanage.cgexpert.model.ExpertOutInfo;
import com.braker.icontrol.cgmanage.cgsupplier.model.SupplierOut;
import com.braker.icontrol.cgmanage.cgsupplier.model.WinningBidder;
import com.braker.workflow.entity.TProcessCheck;
import com.braker.workflow.manager.TNodeDataMng;
import com.braker.workflow.manager.TProcessCheckMng;
import com.braker.workflow.manager.TProcessDefinMng;
@Service
@Transactional
public class ExpertOutMngImpl extends BaseManagerImpl<ExpertOutInfo> implements ExpertOutMng{
@Autowired
private PersonalWorkMng personalWorkMng;
@Autowired
private EconomicMng economicMng;
@Autowired
private TProcessCheckMng tProcessCheckMng;
@Autowired
private TProcessDefinMng tProcessDefinMng;
@Autowired
private TNodeDataMng tNodeDataMng;
@Autowired
private UserMng userMng;
@Autowired
private ExpertCheckMng expertcheckMng;
@Autowired
private CgExpertMng cgexpertMng;
@Autowired
private PrivateInforMng privateInforMng;
@Override
public void saveCheckOut(TProcessCheck checkBean, ExpertOutInfo bean,
User user, String files) throws Exception {
bean=this.findById(bean.getFoId());
CheckEntity entity=(CheckEntity)bean;
String checkUrl="/expertcheck/check?checkType=out&id=";
String lookUrl ="/expertgl/detail?checkType=out&id=";
bean=(ExpertOutInfo)tProcessCheckMng.checkProcess(checkBean,entity,user,"ZJKCK",checkUrl,lookUrl,files);
bean=(ExpertOutInfo)super.saveOrUpdate(bean);
ExpertInfo w=expertcheckMng.findById(Integer.valueOf(bean.getFeId()));
if(w.getFisBlackStatus().equals("-1")){
w.setFisBlackStatus("0");
}
if(bean.getfCheckStatus().equals("9")){
if(bean.getFflag().equals("1")){
w.setFstauts("2"); //2出库状态,1默认 ,99 删除
}else{
//w.setFisBlackStatus("0");
w.setFstauts("1"); // 数据状态默认
}
w.setFisOutStatus("9");
w.setFisBlackStatus("0");
expertcheckMng.saveOrUpdate(w);
}
if(checkBean.getFcheckResult().equals("0")){
if(bean.getFflag().equals("1")){
w.setFstauts("1");
w.setFisOutStatus("-1"); //出库 不通过 被退回
w.setFcheckType("in");
}else{
w.setFstauts("2");
w.setFisOutStatus("-2"); //入库 不通过 被退回
w.setFcheckType("out");
}
expertcheckMng.saveOrUpdate(w);
}
}
@Override
public List<ExpertOutInfo> findCheckOut(String feId, User user) {
Finder finder =Finder.create(" FROM ExpertOutInfo WHERE fCheckStatus <>"+99+""); //未审核通过的
finder.append(" AND fUserId="+user.getId()+"");
finder.append(" AND feId="+feId+"");
finder.append(" order by fRecTime desc");
return super.find(finder);
}
@Override
public List<ExpertOutInfo> findByExpertOut(String feId, String recId, String status, String checkType) {
Finder finder =Finder.create(" FROM ExpertOutInfo WHERE");
if(!StringUtil.isEmpty(status) && status.equals("-2")){
status="-1";
}
finder.append(" fCheckStatus="+status+"");
//finder.append(" AND fRecUserId="+recId+"");
finder.append(" AND feId="+feId+"");
finder.append(" order by fRecTime desc");
return super.find(finder);
}
@Override
public void deleteOutExpert(Integer feId, Integer foId) {
ExpertOutInfo exOut=new ExpertOutInfo();
ExpertInfo bean=new ExpertInfo();
if(!StringUtil.isEmpty(String.valueOf(feId))){
exOut=findByExpertOut(String.valueOf(feId),null, "-1",null).get(0);
deleteById(exOut.getFoId());
bean=cgexpertMng.findById(feId);
}
if(!StringUtil.isEmpty(String.valueOf(foId))){
exOut=findById(foId);
deleteById(foId);
bean=cgexpertMng.findById(Integer.valueOf(exOut.getFeId()));
}
if(exOut.getFflag().equals("1")){//出库 不通过 被退回
bean.setFisOutStatus("0");
}
if(exOut.getFflag().equals("2")){//入库 不通过 被退回
bean.setFisOutStatus("9");
}
super.saveOrUpdate(bean);
}
@Override
public String outRecall(Integer id) throws Exception {
//根据id查询对象
ExpertOutInfo bean=(ExpertOutInfo)super.findById(id);
//删除待办
personalWorkMng.deleteDb(bean.getNextCheckUserId() , bean.getBeanCode(), "0");
//给待审批人发送消息
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ExpertInfo w=expertcheckMng.findById(bean.getFeId());
if(bean.getFflag().equals("1")){
w.setFstauts("1");
w.setFisOutStatus("-4"); //出库 被撤回
w.setFcheckType("in");
}else{
w.setFstauts("2");
w.setFisOutStatus("-4"); //入库被撤回
w.setFcheckType("out");
}
expertcheckMng.saveOrUpdate(w);
String title="专家库入库申请被撤回消息";
String msg="您待审批的 "+w.getFexpertName() +" 专家,任务编号:("+bean.getFoCode()+")于"+sdf.format(new Date())+"被申请人撤回,请及时关注.";
privateInforMng.setMsg(title, msg, bean.getNextCheckUserId(), "3");
//撤回
bean=(ExpertOutInfo) reCall((CheckEntity) bean);
this.updateDefault(bean);
return "操作成功";
}
}
|
[
"[email protected]"
] | |
cb125d11216209e7421feaf897c264127aa983e9
|
bdfb28465019385dc630af92654b434ca9f53c56
|
/gulimall-coupon/src/test/java/com/simmons/coupon/coupon/GulimallCouponApplicationTests.java
|
61809a28f90222dbe18c3c8c21f58d404938b708
|
[
"Apache-2.0"
] |
permissive
|
SimmonsZhang/gulimall
|
f773ed422c82525ca95d2bc9f8520e6d50e36cdf
|
d5337a1f3e5a5b1dbd7b1f22da26d4f1d3bb9025
|
refs/heads/main
| 2023-06-18T12:08:36.416476 | 2021-04-22T13:02:18 | 2021-04-22T13:02:18 | 360,447,419 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 234 |
java
|
package com.simmons.coupon.coupon;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class GulimallCouponApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"[email protected]"
] | |
9620fff74e653af75efd11547e86bc1f6266e5c3
|
c7f6256ec96ffaaaf26a1b190291698520156977
|
/src/main/java/ar/edu/unq/desapp/grupoa/backenddesappapi/messaging/LikeReviewEvent.java
|
50db19962f04a6b5f5e6ecc39a1c997213d164d0
|
[] |
no_license
|
nicoruiz/DesApp-Grupo-A-012021-backend
|
64f3a68b85e3e788c99efe6350c34e6a7f3bad9d
|
e09a1f262d1dafaeb9b0ca664a545978b0496f11
|
refs/heads/main
| 2023-06-10T14:32:27.071783 | 2021-07-06T03:50:19 | 2021-07-06T03:50:19 | 356,740,703 | 2 | 0 | null | 2021-07-03T21:17:46 | 2021-04-11T01:39:44 |
Java
|
UTF-8
|
Java
| false | false | 432 |
java
|
package ar.edu.unq.desapp.grupoa.backenddesappapi.messaging;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.Serializable;
public class LikeReviewEvent implements Serializable, Event {
@Override
public void handle() {
Logger logger = LogManager.getLogger(LikeReviewEvent.class);
logger.info("[RabbitMQ] Like Review Event handled successfully.");
}
}
|
[
"[email protected]"
] | |
e8ee8c33769b33462d25c5e0fcd13b83fbb634ad
|
5fc08726794b85ba1c1622acc5ce021186a85459
|
/app/src/test/java/com/bobbyprabowo/android/todolist/ExampleUnitTest.java
|
7150dbb4dca9965a18a68e45bf325bd9b4b7c8f9
|
[] |
no_license
|
bopbi/todo-android
|
32652ef15c48df71ff4d07a73705e47b439adc0c
|
2bf0691fb4ee38a5e147be30b3483f0ca6a6af60
|
refs/heads/master
| 2021-01-18T04:04:50.260687 | 2017-03-22T01:01:54 | 2017-03-22T01:01:54 | 85,766,954 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 411 |
java
|
package com.bobbyprabowo.android.todolist;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
f39a323cffd438e2ce5345edcd9f52655de2cc0c
|
f0d561ae6720480139439dadfead85bfb27994e6
|
/src/test/java/com/gorilla/test/BaseTest.java
|
e7e0720b78e853aa0c7510356ed77249c2ca2c9b
|
[] |
no_license
|
tyagiVimal/gorilla
|
5cf0e9af7f3d106e1620fac29642c5ce5e61921c
|
2f2cf33cf16ce78fa32763afd6241efa36692275
|
refs/heads/master
| 2021-12-15T02:48:49.999597 | 2020-05-27T13:38:58 | 2020-05-27T13:38:58 | 182,988,175 | 0 | 0 | null | 2021-12-14T21:18:57 | 2019-04-23T10:07:38 |
Java
|
UTF-8
|
Java
| false | false | 473 |
java
|
package com.gorilla.test;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.gorilla.pages.HomePage;
import com.gorilla.webDriver.BasePage;
public class BaseTest extends BasePage {
HomePage home = new HomePage();
@BeforeMethod
public void setUpURL() {
openURL();
}
@Test
public void search() {
home.searchTopic();
}
@AfterMethod
public void close() {
tearDown();
}
}
|
[
"[email protected]"
] | |
ab9a8a49706dbee9ad9230aac52c1c32ca3ea191
|
6c06e32cec7ff276eb79e18866d0c51d3cc28d8f
|
/src/main/java/com/service/EmployeeServiceImpl.java
|
596a00d8fba65c9501d888a6e4b99d60a89ad289
|
[] |
no_license
|
Eranwei/Maven-CRM-0824
|
51e989a1c14df7a945ca490fa477855f30731d38
|
aba6869cb4cd8041a160281278a5b079976ea481
|
refs/heads/master
| 2022-12-04T18:48:38.390093 | 2020-08-31T07:12:24 | 2020-08-31T07:12:24 | 291,627,431 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,610 |
java
|
package com.service;
import com.dao.EmployeeMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.model.Emp;
import com.model.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("employeeService")
public class EmployeeServiceImpl implements EmployeeService {
@Autowired
EmployeeMapper employeeMapper;
@Override
public List<Employee> list(Employee emp) {
return employeeMapper.list(emp);
}
@Override
public Employee getById(Integer empid) {
return employeeMapper.getById(empid);
}
@Override
public Employee getByUserName(String userName) {
return employeeMapper.getByUserName(userName);
}
@Override
public int del(Integer empid) {
return employeeMapper.delete(empid);
}
@Override
public int add(Employee record) {
return employeeMapper.insert(record);
}
@Override
public int modifyall( ) {
return employeeMapper.modifyall();
}
@Override
public int edit(Employee record) {
return employeeMapper.insert(record);
}
@Override
public int update(Employee record) {
return employeeMapper.update(record);
}
@Override
public PageInfo<Employee> pageList(Employee emp, int pageNum, int size) {
PageHelper.startPage(pageNum,size);
List<Employee> emps = employeeMapper.list(emp);
PageInfo<Employee> pageInfo = new PageInfo<>(emps);
return pageInfo;
}
}
|
[
"[email protected]"
] | |
dd5634a16b6e645dff8f90ae5d3f20a765e31749
|
8a1114d8e3cd644a9b8fe98695dc5e6ec53b9317
|
/LoginProject.zip_expanded/LoginProject/src/test/java/com/Wipro/LoginProjectApplicationTests.java
|
49d720124603f11d3ef1a21299939145a625809d
|
[] |
no_license
|
tanmay2twr/LoginSpringBoot
|
2617dbf0ea7de3fd66448dd83cee2e38ac894340
|
d57a693f52431b7ebc4c3ad37cea94aced143131
|
refs/heads/master
| 2022-11-05T01:28:56.961250 | 2020-07-01T09:48:24 | 2020-07-01T09:48:24 | 276,151,419 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 207 |
java
|
package com.Wipro;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class LoginProjectApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"[email protected]"
] | |
5ef0e22e985110f2533226602c23de1c9b304d18
|
fd26e904a0059ead8a23d76640c14a9329d946b1
|
/mbti/src/co/yedam/app/board/model/BoardVO.java
|
d343e59c038456416be0c08565f050dc14f12e35
|
[] |
no_license
|
eo339912/mbti
|
d1f04dd1201e4963ebd7e314771af15aa30f194d
|
75d45ef91680768df6f5cf1f2a4df4b72fdc38d6
|
refs/heads/master
| 2022-10-09T11:34:01.325459 | 2020-06-15T01:00:58 | 2020-06-15T01:00:58 | 272,310,682 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,030 |
java
|
package co.yedam.app.board.model;
public class BoardVO {
private String id;
private String title;
private String contents;
private String regdt;
private String seq;
private String star;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContents() {
return contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public String getRegdt() {
return regdt;
}
public void setRegdt(String regdt) {
this.regdt = regdt;
}
public String getSeq() {
return seq;
}
public void setSeq(String seq) {
this.seq = seq;
}
public String getStar() {
return star;
}
public void setStar(String star) {
this.star = star;
}
@Override
public String toString() {
return "BoardVO [id=" + id + ", title=" + title + ", contents=" + contents + ", regdt=" + regdt + ", seq=" + seq
+ ", star=" + star + "]";
}
}
|
[
"[email protected]"
] | |
ca39ead5f51db10c01c74a4b0a82705507f05d13
|
2f00e16736678128f7345b4089623da5058a71b5
|
/presto-main/src/main/java/io/prestosql/operator/scalar/timestamp/TimeWithTimezoneToTimestampCast.java
|
e959393e1944aa03ca15206b36aa5e34d22206a5
|
[
"Apache-2.0"
] |
permissive
|
garywmendel/presto
|
dbf92be2a9f2195bf01dbdf596e3a757afb6ddba
|
0a29a9400ec6d5440da530bf2ebd7e0b10dc5a78
|
refs/heads/master
| 2022-11-11T12:55:14.975971 | 2020-07-03T11:50:32 | 2020-07-03T15:43:24 | 276,984,942 | 1 | 0 |
Apache-2.0
| 2020-07-03T20:48:07 | 2020-07-03T20:48:06 | null |
UTF-8
|
Java
| false | false | 3,201 |
java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.prestosql.operator.scalar.timestamp;
import io.prestosql.spi.connector.ConnectorSession;
import io.prestosql.spi.function.LiteralParameter;
import io.prestosql.spi.function.LiteralParameters;
import io.prestosql.spi.function.ScalarOperator;
import io.prestosql.spi.function.SqlType;
import io.prestosql.spi.type.LongTimestamp;
import io.prestosql.spi.type.StandardTypes;
import org.joda.time.chrono.ISOChronology;
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.temporal.ChronoField;
import static io.prestosql.spi.function.OperatorType.CAST;
import static io.prestosql.spi.type.DateTimeEncoding.unpackMillisUtc;
import static io.prestosql.spi.type.DateTimeEncoding.unpackZoneKey;
import static io.prestosql.type.TimeWithTimeZoneOperators.REFERENCE_TIMESTAMP_UTC;
import static io.prestosql.type.Timestamps.round;
import static io.prestosql.type.Timestamps.scaleEpochMillisToMicros;
import static io.prestosql.util.DateTimeZoneIndex.getChronology;
@ScalarOperator(CAST)
public final class TimeWithTimezoneToTimestampCast
{
private TimeWithTimezoneToTimestampCast() {}
@LiteralParameters("p")
@SqlType("timestamp(p)")
public static long cast(@LiteralParameter("p") long precision, ConnectorSession session, @SqlType(StandardTypes.TIME_WITH_TIME_ZONE) long time)
{
long epochMillis;
if (session.isLegacyTimestamp()) {
epochMillis = unpackMillisUtc(time);
}
else {
// This is hack that we need to use as the timezone interpretation depends on date (not only on time)
// TODO remove REFERENCE_TIMESTAMP_UTC when removing support for political time zones in TIME WITH TIME ZONE
long currentMillisOfDay = ChronoField.MILLI_OF_DAY.getFrom(Instant.ofEpochMilli(REFERENCE_TIMESTAMP_UTC).atZone(ZoneOffset.UTC));
long timeMillisUtcInCurrentDay = REFERENCE_TIMESTAMP_UTC - currentMillisOfDay + unpackMillisUtc(time);
ISOChronology chronology = getChronology(unpackZoneKey(time));
epochMillis = unpackMillisUtc(time) + chronology.getZone().getOffset(timeMillisUtcInCurrentDay);
}
if (precision > 3) {
return scaleEpochMillisToMicros(epochMillis);
}
if (precision < 3) {
return round(epochMillis, (int) (3 - precision));
}
return epochMillis;
}
@LiteralParameters("p")
@SqlType("timestamp(p)")
public static LongTimestamp cast(ConnectorSession session, @SqlType(StandardTypes.TIME_WITH_TIME_ZONE) long time)
{
return new LongTimestamp(cast(6, session, time), 0);
}
}
|
[
"[email protected]"
] | |
1fb98247dd5c221364d61e07fb72470e94d6e65a
|
45203c004ecbe4402b4cd7e13de8d5a2dab19a95
|
/src/main/java/com/lancabbage/gorgeous/bean/vo/git/GitInfoSaveVo.java
|
4c0c50029d09f8b75ee3c3ab30520983f9493a21
|
[
"Apache-2.0"
] |
permissive
|
lanyanhua/gorgoues-doc
|
48acc00b7dbdcd75414aa0a5a8a496ee5df05a81
|
391cd6c0a763a32d8658b25f37a84b025ff99206
|
refs/heads/master
| 2023-05-18T18:07:33.026971 | 2021-05-31T07:58:27 | 2021-05-31T07:58:27 | 335,875,407 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 998 |
java
|
package com.lancabbage.gorgeous.bean.vo.git;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author: lanyanhua
* @date: 2020/12/7 12:46 下午
* @Description:
*/
public class GitInfoSaveVo implements Serializable {
/**
* git用户名
*/
@NotNull
private String username;
/**
* 密码
*/
@NotNull
private String password;
/**
* 本地仓库地址
*/
@NotNull
private String repositoryPath;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRepositoryPath() {
return repositoryPath;
}
public void setRepositoryPath(String repositoryPath) {
this.repositoryPath = repositoryPath;
}
}
|
[
"[email protected]"
] | |
16985ab11e9a7365656cbf8aa2d749bede918c92
|
cb2e0b45e47ebeb518f1c8d7d12dfa0680aed01c
|
/openbanking-api-pdf/src/test/java/com/laegler/openbanking/api/integration/BalancesApiIntegrationTest.java
|
ba2e7580c7e84b04dfd7ca4e6027286e3cfa782d
|
[
"MIT"
] |
permissive
|
thlaegler/openbanking
|
4909cc9e580210267874c231a79979c7c6ec64d8
|
924a29ac8c0638622fba7a5674c21c803d6dc5a9
|
refs/heads/develop
| 2022-12-23T15:50:28.827916 | 2019-10-30T09:11:26 | 2019-10-31T05:43:04 | 213,506,933 | 1 | 0 |
MIT
| 2022-11-16T11:55:44 | 2019-10-07T23:39:49 |
HTML
|
UTF-8
|
Java
| false | false | 963 |
java
|
package com.laegler.openbanking.api.integration;
import com.laegler.openbanking.AbstractIntegrationTest;
import com.laegler.openbanking.api.*;
import com.laegler.openbanking.model.*;
import java.util.ArrayList;
import javax.ws.rs.core.GenericEntity;
import com.laegler.openbanking.model.OBReadBalance1;
import com.laegler.openbanking.model.OBErrorResponse1;
import java.util.List;
import com.laegler.openbanking.api.NotFoundException;
import java.io.InputStream;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import static io.restassured.matcher.RestAssuredMatchers.*;
import static org.hamcrest.Matchers.*;
import static io.restassured.RestAssured.*;
import org.junit.Test;
import org.junit.Ignore;
@javax.annotation.Generated(value = "class com.laegler.openbanking.codegen.module.OpenbankingSpringCodegen", date = "2019-10-19T12:58:35.879+13:00")
public class BalancesApiIntegrationTest extends AbstractIntegrationTest {
}
|
[
"[email protected]"
] | |
cf32797da8fed4f7aeb29a38d55263ef2e0aa96b
|
b08e2a262af38d18dde06ba18402ff48367b732e
|
/app/src/main/java/com/material/design/widget/materailactivity/twofragment/RightFragment.java
|
7c0481c28251ad634ca12d58420281a7f2b37cab
|
[] |
no_license
|
androidxiao/MaterialDesign5.0
|
95e980f12e70d431922f34fabd524535ef70b45b
|
17968dab92c393a77ed245741826184352224c0f
|
refs/heads/master
| 2021-01-01T11:57:16.521653 | 2017-11-19T11:22:50 | 2017-11-19T11:22:50 | 97,576,006 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,149 |
java
|
package com.material.design.widget.materailactivity.twofragment;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.material.design.widget.R;
import static android.R.attr.name;
/**
* Created by chawei on 2017/2/20.
*/
public class RightFragment extends Fragment {
private static final String TAG = "demo";
public static RightFragment newFragment(String str){
Bundle bundle = new Bundle();
bundle.putString("name",str);
RightFragment rightFragment = new RightFragment();
rightFragment.setArguments(bundle);
Log.d(TAG, "newFragment: 2222----->"+str);
return rightFragment;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view=LayoutInflater.from(getContext()).inflate(R.layout.fragment_right_layout, null);
Button btn= (Button) view.findViewById(R.id.id_btn_right);
TextView tv= (TextView) view.findViewById(R.id.id_text_from_right);
Bundle bundle = getArguments();
if(bundle!=null) {
String name = bundle.getString("name");
Log.d(TAG, "onCreateView: 2222"+name);
tv.setText(name);
}
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sendResultData();
}
});
return view;
}
private void sendResultData(){
if(getTargetFragment()==null){
return;
}
Log.d(TAG, "sendResultData: Right2222222222");
Intent intent = new Intent();
intent.putExtra("name", "我是RightFragment中传回来的值");
getTargetFragment().onActivityResult(getTargetRequestCode(), Activity.RESULT_OK,intent);
}
}
|
[
"[email protected]"
] | |
ccfc953f1349d4f42097d8eb01686a15c6fb82c6
|
b280a34244a58fddd7e76bddb13bc25c83215010
|
/scmv6/center-batch/src/main/java/com/smate/center/batch/dao/tmppdwh/NsfcKwsCotfTwoDao.java
|
32dd8f86b1a44f23efa4191ea37b86f1824215b4
|
[] |
no_license
|
hzr958/myProjects
|
910d7b7473c33ef2754d79e67ced0245e987f522
|
d2e8f61b7b99a92ffe19209fcda3c2db37315422
|
refs/heads/master
| 2022-12-24T16:43:21.527071 | 2019-08-16T01:46:18 | 2019-08-16T01:46:18 | 202,512,072 | 2 | 3 | null | 2022-12-16T05:31:05 | 2019-08-15T09:21:04 |
Java
|
UTF-8
|
Java
| false | false | 1,912 |
java
|
package com.smate.center.batch.dao.tmppdwh;
import org.springframework.stereotype.Repository;
import com.smate.center.batch.model.tmppdwh.NsfcKwsCotfTwo;
import com.smate.core.base.utils.constant.DBSessionEnum;
import com.smate.core.base.utils.data.HibernateDao;
@Repository
public class NsfcKwsCotfTwoDao extends HibernateDao<NsfcKwsCotfTwo, Long> {
@Override
public DBSessionEnum getDbSession() {
return DBSessionEnum.TMPPDWH;
}
public void insertIntoNsfcCotfLength2(String discode, String kwsStr, String kw1, String kw2, Integer cotf,
Integer language) {
String sql = "insert into nsfc_kw_cotf_two values (seq_nsfc_kw_wtf.nextval, ?,?,?,?,?,?)";
super.update(sql, new Object[] {discode, kwsStr, kw1, kw2, cotf, language});
}
public void insertIntoNsfcCotfLength3(String discode, String kwsStr, String kw1, String kw2, String kw3,
Integer cotf, Integer language) {
String sql = "insert into nsfc_kw_cotf_three values (seq_nsfc_kw_wtf.nextval, ?,?,?,?,?,?,?)";
super.update(sql, new Object[] {discode, kwsStr, kw1, kw2, kw3, cotf, language});
}
public void insertIntoNsfcCotfLength4(String discode, String kwsStr, String kw1, String kw2, String kw3, String kw4,
Integer cotf, Integer language) {
String sql = "insert into nsfc_kw_cotf_four values (seq_nsfc_kw_wtf.nextval, ?,?,?,?,?,?,?,?)";
super.update(sql, new Object[] {discode, kwsStr, kw1, kw2, kw3, kw4, cotf, language});
}
public void insertIntoNsfcCotfLength5(String discode, String kwsStr, String kw1, String kw2, String kw3, String kw4,
String kw5, Integer cotf, Integer language) {
String sql = "insert into nsfc_kw_cotf_five values (seq_nsfc_kw_wtf.nextval, ?,?,?,?,?,?,?,?,?)";
super.update(sql, new Object[] {discode, kwsStr, kw1, kw2, kw3, kw4, kw5, cotf, language});
}
}
|
[
"[email protected]"
] | |
86a1ba1e56e9eaaa5eb09e525688a3d55e659f91
|
ab6d35515d4e50e53c7ce0c62972a2477a57c93e
|
/src/test/net/spy/util/InstantiatorTest.java
|
7f1a456b74e20a709b321970ec7e740d23e01774
|
[
"MIT"
] |
permissive
|
dustin/spyjar
|
fafb536f6b32d4cd1b0b2b866f13ad17fea00cc4
|
e59543ba81fdc9331189ea8a0d30231e41bcc801
|
refs/heads/master
| 2023-08-18T22:08:58.881191 | 2008-11-26T20:31:35 | 2008-11-26T20:31:35 | 7,283 | 6 | 3 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,418 |
java
|
// Copyright (c) 2006 Dustin Sallings <[email protected]>
package net.spy.util;
import java.util.HashMap;
import java.util.Map;
import junit.framework.TestCase;
/**
* Test the instantiator.
*/
public class InstantiatorTest extends TestCase {
@SuppressWarnings("unchecked")
public void testSimple() throws Exception {
Instantiator<Map> i=new Instantiator<Map>("java.util.HashMap");
assertTrue(i.getInstance() instanceof HashMap);
assertSame(i.getInstance(), i.getInstance());
Instantiator<Map>i2=new Instantiator<Map>("java.util.HashMap");
assertTrue(i2.getInstance() instanceof HashMap);
assertNotSame(i2.getInstance(), i.getInstance());
assertEquals(i.getInstance(), i2.getInstance());
}
@SuppressWarnings("unchecked")
public void testWithClassLoader() throws Exception {
Instantiator<Map> i=new Instantiator<Map>("java.util.HashMap",
getClass().getClassLoader());
Instantiator<Map> i2=new Instantiator<Map>("java.util.HashMap",
String.class.getClassLoader());
assertTrue(i.getInstance() instanceof HashMap);
assertTrue(i2.getInstance() instanceof HashMap);
assertNotSame(i.getInstance(), i2.getInstance());
assertSame(i.getInstance(), i.getInstance());
assertSame(i2.getInstance(), i2.getInstance());
}
public void testCustomInstantiator() throws Exception {
Instantiator<Map<String, String>> i=new TestInstantiator(1);
assertTrue(i.getInstance() instanceof HashMap);
assertEquals(2, i.getInstance().size());
}
public void testUninitialized() throws Exception {
Instantiator<Map<String, String>> i=new TestInstantiator(0);
try {
fail("Shouldn't allow me to get anything, got " + i.getInstance());
} catch(AssertionError e) {
assertEquals("Instance has not been set.", e.getMessage());
}
}
public void testDoubleInitialized() throws Exception {
try {
fail("Shouldn't allow me to get anything, got "
+ new TestInstantiator(2));
} catch(AssertionError e) {
assertEquals("Instance has already been set.", e.getMessage());
}
}
private static final class TestInstantiator
extends Instantiator<Map<String, String>> {
public TestInstantiator(int howMany) throws Exception {
super();
String name="java.util.HashMap";
for(int i=0; i<howMany; i++) {
getLogger().info("Going to make a %s", name);
setInstance(createInstance(name));
getInstance().put("a", "1");
getInstance().put("b", "2");
}
}
}
}
|
[
"[email protected]"
] | |
11ea5dd06bd7695257b039bd66252faee9dc4ba0
|
6c0bb5d055afe0bc625926b6dec6093938c63c95
|
/app/src/main/java/cn/flyrise/android3/test/effectiveloadbitmap/LoadBitmapAsyncActivity.java
|
1d28a07786eb128cb8ed572953381692abde55f3
|
[] |
no_license
|
easionchang/AndroidTest
|
e8b6cd9812bc9bcb49ad89ddaf271516b9661174
|
f9d33d6daf0943aafed468861377ce83474c35c2
|
refs/heads/master
| 2020-05-18T18:03:23.805805 | 2019-02-27T03:26:20 | 2019-02-27T03:26:20 | 28,586,641 | 0 | 0 | null | null | null | null |
GB18030
|
Java
| false | false | 2,299 |
java
|
/*
* Copyright 2012 flyrise. All rights reserved.
* Create at 2012-12-4 下午03:58:35
*/
package cn.flyrise.android3.test.effectiveloadbitmap;
import cn.flyrise.android3.test.R;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import java.lang.ref.WeakReference;
/**
* 类功能描述:</br>
*
* @author zms
* @version 1.0
* </p>
* 修改时间:</br>
* 修改备注:</br>
*/
public class LoadBitmapAsyncActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.loadbitmap);
ImageView iv = (ImageView)findViewById(R.id.iv);
loadBitmap(R.drawable.welcome_fe, iv);
}
public void loadBitmap(int resId, ImageView imageView) {
BitmapWorkerTask task = new BitmapWorkerTask(imageView);
task.execute(resId);
}
class BitmapWorkerTask extends AsyncTask<Integer, Void, Bitmap> {
private final WeakReference<ImageView> imageViewReference;
private int data = 0;
public BitmapWorkerTask(ImageView imageView) {
// Use a WeakReference to ensure the ImageView can be garbage collected
imageViewReference = new WeakReference<ImageView>(imageView);
}
// Decode image in background.
@Override
protected Bitmap doInBackground(Integer... params) {
data = params[0];
return LoadBitmapUtil.decodeSampledBitmapFromResource(
getResources(), data, 100, 100);
}
// Once complete, see if ImageView is still around and set bitmap.
@Override
protected void onPostExecute(Bitmap bitmap) {
if (imageViewReference != null && bitmap != null) {
final ImageView imageView = imageViewReference.get();
if (imageView != null) {
imageView.setImageBitmap(bitmap);
}
}
}
}
}
|
[
"[email protected]"
] | |
587cb1e5e6e02ee9aeb898e36a3b81b890d6392c
|
a669c0722220c73291a358fdbc2811ac034d4857
|
/tau-nucleus/src/test/java/com/srotya/tau/nucleus/api/TestDateInterceptor.java
|
712215d741be4cc204f1767c3e22f79a307ecc26
|
[
"Apache-2.0",
"BSD-3-Clause"
] |
permissive
|
anandkrv/tau
|
aef4dc56304366b7fc5f5547d88477ac7c0c63d2
|
a314e6e03efd454c8e26e3feb304616b1767a8d9
|
refs/heads/master
| 2020-04-10T09:08:09.885400 | 2017-01-30T07:38:56 | 2017-01-30T07:38:56 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,181 |
java
|
/**
* Copyright 2016 Symantec Corporation.
*
* 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.srotya.tau.nucleus.api;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.util.HashMap;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import com.google.gson.JsonObject;
import com.srotya.tau.interceptors.ValidationException;
/**
* Test cases for date interceptor/validator
*
* @author ambud_sharma
*/
public class TestDateInterceptor {
private static final String TIMESTAMP = "@timestamp";
private DateInterceptor interceptor;
private Map<String, String> config;
public TestDateInterceptor() {
}
@Before
public void before() {
this.config = new HashMap<>();
this.config.put(DateInterceptor.DATEFIELD, TIMESTAMP);
this.interceptor = new DateInterceptor();
this.interceptor.configure(config);
}
@Test
public void testISO8601() throws ValidationException {
JsonObject obj = new JsonObject();
obj.addProperty(TIMESTAMP, "2011-04-19T03:44:01.103Z");
interceptor.validate(obj);
obj.remove(TIMESTAMP);
try {
interceptor.validate(obj);
fail("Must have thrown validation exception");
} catch (Exception e) {
}
obj.addProperty(TIMESTAMP, "2016-04-21T20:54:41.103Z");
interceptor.validate(obj);
long ts = obj.get(TIMESTAMP).getAsLong();
assertEquals(1461272081103L, ts);
try {
interceptor.validate(new JsonObject());
fail("Must have thrown validation exception");
} catch (Exception e) {
}
this.config.put(DateInterceptor.DATEFIELD, null);
try{
interceptor.validate(new JsonObject());
} catch (Exception e) {
}
}
}
|
[
"[email protected]"
] | |
7e94c6e137cd12d454d227e702f963723180799b
|
f889cbdbe3b07059e5bb42048a2f8ec8fe30271c
|
/mavenproject1/src/main/java/com/mycompany/mavenproject1/Programs/TelaDeletar.java
|
21f0fb9c8d0e2432de8fd52d67cbd13ef6034e14
|
[] |
no_license
|
lucas-ferreira-croc/LPcontinuada3
|
df6427cd1e0a3a54189749e685109c5ea0611554
|
19c2bf1c90544243c4e38693ac7e3c67d7919cd4
|
refs/heads/main
| 2023-01-22T15:50:13.136873 | 2020-11-29T18:11:01 | 2020-11-29T18:11:01 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 8,732 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.mavenproject1.Programs;
import com.mycompany.mavenproject1.BD.TesteDelete;
/**
*
* @author CLIENTE
*/
public class TelaDeletar extends javax.swing.JFrame {
/**
* Creates new form TelaDeletar
*/
public TelaDeletar() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
tfNick = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
tfSenha = new javax.swing.JPasswordField();
jLabel2 = new javax.swing.JLabel();
btDeletar = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
lbResultado = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("VOCÊ ESTÁ PRESTES A DELETAR UM USUÁRIO");
tfNick.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tfNickActionPerformed(evt);
}
});
jLabel3.setText("Nickname :");
tfSenha.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tfSenhaActionPerformed(evt);
}
});
jLabel2.setText("senha:");
btDeletar.setText("Deletar");
btDeletar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btDeletarActionPerformed(evt);
}
});
jLabel4.setText("CUIDADO, APÓS SER DELETADO, NÃO SERÁ MAIS POSSÍVEL UTILIZAR O USUÁRIO");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(112, 112, 112)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel4))
.addGroup(layout.createSequentialGroup()
.addGap(102, 102, 102)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(lbResultado, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(18, 18, 18)
.addComponent(tfSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(tfNick, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))))))
.addContainerGap(16, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(btDeletar)
.addGap(195, 195, 195))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(8, 8, 8)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tfNick, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(tfSenha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(btDeletar)
.addGap(18, 18, 18)
.addComponent(lbResultado, javax.swing.GroupLayout.DEFAULT_SIZE, 31, Short.MAX_VALUE)
.addGap(26, 26, 26)
.addComponent(jLabel4)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void tfNickActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfNickActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_tfNickActionPerformed
private void tfSenhaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfSenhaActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_tfSenhaActionPerformed
private void btDeletarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btDeletarActionPerformed
String nickCadastrar = tfNick.getText();
String senhaCadastrar = tfSenha.getText();
TesteDelete.Delete(nickCadastrar, senhaCadastrar);
lbResultado.setText("USUÁRIO DELETADO");
}//GEN-LAST:event_btDeletarActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(TelaDeletar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(TelaDeletar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(TelaDeletar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(TelaDeletar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new TelaDeletar().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btDeletar;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel lbResultado;
private javax.swing.JTextField tfNick;
private javax.swing.JPasswordField tfSenha;
// End of variables declaration//GEN-END:variables
}
|
[
"[email protected]"
] | |
a993ecd8379c4a411dba044a8e014e0185757e1a
|
a6b4f8c9703736afebd0b27d081e6e14cdb0d0e0
|
/oasys/.svn/pristine/91/91fc1786fdfd798eddad3428202faa7be460e796.svn-base
|
db2752c611844f74c41aa9e3c65761ad08d6bbe5
|
[] |
no_license
|
QiJiYinQiao/workspaces
|
e644430ea0d021a76dbaaffa6dfc7f30e51a5dac
|
c3bb78f32c67af0ede376251d7ea6f7bf636f344
|
refs/heads/master
| 2021-06-01T06:33:37.637473 | 2016-03-01T07:57:13 | 2016-03-01T07:57:13 | 115,107,254 | 1 | 0 | null | 2017-12-22T10:58:03 | 2017-12-22T10:58:03 | null |
UTF-8
|
Java
| false | false | 2,168 |
package com.oasys.serviceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.oasys.dao.PublicDao;
import com.oasys.model.PpeScrapAppAttach;
import com.oasys.service.PPEScrapAppAttachService;
/**
* @Title: PPEScrapAppAttachServiceImpl
* @Package com.oasys.serviceImpl
* @Description: 固定资产报废附加表Service实现类
* @author lida
* @date 2015/9/21
* @version V1.0
*/
@Service
public class PPEScrapAppAttachServiceImpl implements PPEScrapAppAttachService {
@Autowired
PublicDao<PpeScrapAppAttach> publicDao;
/**
* @Title: saveOrUpdatePpeEntity
* @Description: 新增固定资产报废附加信息
* @param ppeAttach 页面绑定实体对象参数
* @author lida
* @date 2015/9/21
*/
@Override
public void saveOrUpdatePpeEntity(PpeScrapAppAttach ppeAttach) {
// TODO Auto-generated method stub
publicDao.saveOrUpdate(ppeAttach);
}
/**
* @Title: findPpeAttachList
* @Description: 根据appNo加载固定资产报废附加信息
* @param String appNo 申请编号
* @author lida
* @return PpeScrapAppAttach
* @date 2015/9/23
*/
@Override
public List<PpeScrapAppAttach> findPpeAttachList(String appNo) {
String hql = "from PpeScrapAppAttach where appNo = '"+appNo+"'";
List<PpeScrapAppAttach> list = publicDao.find(hql);
return list;
}
/**
* @Title: delPpeScrapAttach
* @Description: 根据ID删除固定资产报废附加表信息 返回受影响行数
* @param ids 附加表id 支持多个一次删除
* @author lida
* @return Integer
* @date 2015/9/22
*/
@Override
public Integer delPpeScrapAttach(String ids) {
// TODO Auto-generated method stub
return publicDao.executeHql("delete from PpeScrapAppAttach where id in ("+ids+")");
}
/**
* @Title: getPpeScrapAttachByID
* @Description: 根据ID加载固定资产报废记录
* @param id id标识
* @author lida
* @return PpeScrapAppAttach
* @date 2015/9/22
*/
@Override
public PpeScrapAppAttach getPpeScrapAttachByID(Integer id) {
return publicDao.get(PpeScrapAppAttach.class, id);
}
}
|
[
"[email protected]"
] | ||
642071bacb75e710e95426c6317ee7ed90968319
|
fd848b3e96b62efafd540f51aae3ddddd29e88e1
|
/homeserver/src/main/java/com/cc/homeserver/config/WebSocketConfig.java
|
7733d3f49e91346f9af7237fdb061cd74537a26e
|
[] |
no_license
|
Brucechen13/homemanager
|
ca55a8d823c2ff0806cf5def5a94675e1629687c
|
250bda94797b7896ed2e770e400e4770237d9c89
|
refs/heads/master
| 2020-03-25T01:19:14.517423 | 2018-10-16T15:44:20 | 2018-10-16T15:44:20 | 143,231,312 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,623 |
java
|
package com.cc.homeserver.config;
import com.cc.homeserver.handle.WebSocketHandler;
import com.cc.homeserver.interceptor.WebSocketHandshakeInterceptor;
import lombok.extern.log4j.Log4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.*;
import org.springframework.web.socket.handler.TextWebSocketHandler;
@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
//1.注册WebSocket
String websocket_url = "/websocket/socketServer.do"; //设置websocket的地址
registry.addHandler(webSocketHandler(), websocket_url). //注册Handler
addInterceptors(new WebSocketHandshakeInterceptor()); //注册Interceptor
//2.注册SockJS,提供SockJS支持(主要是兼容ie8)
String sockjs_url = "/sockjs/socketServer.do"; //设置sockjs的地址
registry.addHandler(webSocketHandler(), sockjs_url). //注册Handler
addInterceptors(new WebSocketHandshakeInterceptor()). //注册Interceptor
withSockJS(); //支持sockjs协议
}
@Bean
public TextWebSocketHandler webSocketHandler() {
return new WebSocketHandler();
}
}
|
[
"[email protected]"
] | |
ae140da71defecfc084cfe50ab7402c1317892ba
|
11083dccdbee27a25d186a6dd1756328c21c412e
|
/src/jdbc/user/dao/UserDAO.java
|
f73b52a7dc0110757b35e257d8df2cda8ca71932
|
[] |
no_license
|
nangzz/spring-JDBC
|
d0e76bc0b67c8282d46fd07babfdf90b51431eef
|
f00742830e55c8f2f7bf1cdeeac2c39b06acd576
|
refs/heads/master
| 2022-04-21T18:32:43.177922 | 2020-04-22T08:50:48 | 2020-04-22T08:50:48 | 255,276,334 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,775 |
java
|
package jdbc.user.dao;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import jdbc.user.vo.UserVO;
public class UserDAO {
String url = "jdbc:oracle:thin:@192.168.2.30:1521:xe";
String user = "hr";
String pass = "hr";
public UserDAO() {
//1. Driver class loading
try {
Class.forName("oracle.jdbc.OracleDriver");
System.out.println("Driver loading OK!!");
} catch (ClassNotFoundException e) {
System.err.println(e.getMessage());
e.printStackTrace();
}
}
public Connection getConnection() throws SQLException {
return DriverManager.getConnection(url, user, pass);
}
public void close(Statement stmt, Connection con) throws SQLException {
if (stmt != null) stmt.close();
if (con != null) con.close();
}
//update 하는 메소드
public int updateUser(UserVO user) {
String sql = "update users set name = ?, gender = ?, city = ? where userid = ?";
Connection con = null;
PreparedStatement stmt = null;
int updateCnt = 0;
try {
con = getConnection();
//auto commit 해제 - 직접 컨트롤하기 위해서는 해제해야 함
con.setAutoCommit(false);
stmt = con.prepareStatement(sql);
stmt.setString(1, user.getName());
stmt.setString(2, Character.toString(user.getGender()));
stmt.setString(3, user.getCity());
stmt.setString(4, user.getUserid());
updateCnt = stmt.executeUpdate();
// 커밋 - 직접 컨트롤 위해
// 원래는 커밋 안해줘도 JDBC는 AutoCommit 됨!
con.commit();
}catch(SQLException e) {
//롤백
try {
con.rollback();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
e.printStackTrace();
}finally {
try {
close(stmt,con);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return updateCnt;
}
//userid를 입력받아서 1개의 row를 반환하는 메소드 - 반환 하나니까 굳이 List 타입일 필요 없음
public UserVO getUser(String userid) {
String sql = "select * from users where userid = ?";
Connection con = null;
PreparedStatement stmt = null;
UserVO user = null;
try {
con = getConnection();
stmt = con.prepareStatement(sql);
stmt.setString(1, userid);
ResultSet rs = stmt.executeQuery();
if(rs.next()) {
user = new UserVO(rs.getString("userid"),
rs.getString("name"),
rs.getString("gender").charAt(0),
rs.getString("city"));
}
}catch(SQLException e) {
e.printStackTrace();
}finally {
try {
close(stmt,con);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return user;
}
//전체 row를 반환하는 메소드 - 반환 여러개니까 List<UserVO>로 타입 설정해줌
public List<UserVO> getUsers() {
String sql = "select * from users order by userid";
Connection con = null;
PreparedStatement stmt = null;
UserVO user = null;
List<UserVO> userList = new ArrayList<>();
try {
con = getConnection();
stmt = con.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while(rs.next()) {
user = new UserVO(rs.getString("userid"),
rs.getString("name"),
rs.getString("gender").charAt(0),
rs.getString("city"));
userList.add(user);
}
}catch(SQLException e) {
e.printStackTrace();
}finally {
try {
close(stmt,con);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return userList;
}//getUserList
}
|
[
"[email protected]"
] | |
fa220e68b3429b8eaa64b269886ac244346745e1
|
afcce1bf850f5d086e19ff5da94a2850816f4f4d
|
/src/main/java/com/atguigu/chapter06/Flink15_ProcessFunction_TimerService.java
|
6aa29d380ae0fef723780ef5f97cb5d80713fb71
|
[] |
no_license
|
cjp-tutorial/Flink0523
|
59c4f83d450dcf307f86003a4a2780f19040ab8a
|
4e4c92df90ae0098709d8c68168774c49a369c22
|
refs/heads/master
| 2023-01-07T16:39:24.443893 | 2020-11-07T09:24:01 | 2020-11-07T09:24:01 | 307,343,980 | 3 | 3 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,506 |
java
|
package com.atguigu.chapter06;
import com.atguigu.bean.WaterSensor;
import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.streaming.api.TimeCharacteristic;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.KeyedProcessFunction;
import org.apache.flink.streaming.api.functions.timestamps.AscendingTimestampExtractor;
import org.apache.flink.streaming.api.functions.timestamps.BoundedOutOfOrdernessTimestampExtractor;
import org.apache.flink.streaming.api.windowing.time.Time;
import org.apache.flink.util.Collector;
/**
* TODO
*
* @author cjp
* @version 1.0
* @date 2020/10/30 14:34
*/
public class Flink15_ProcessFunction_TimerService {
public static void main(String[] args) throws Exception {
// 0.创建执行环境
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(1);
env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);
// 1.读取数据
SingleOutputStreamOperator<WaterSensor> sensorDS = env
// .readTextFile("input/sensor-data.log")
.socketTextStream("localhost", 9999)
.map(new MapFunction<String, WaterSensor>() {
@Override
public WaterSensor map(String value) throws Exception {
String[] datas = value.split(",");
return new WaterSensor(datas[0], Long.valueOf(datas[1]), Integer.valueOf(datas[2]));
}
})
.assignTimestampsAndWatermarks(
// new BoundedOutOfOrdernessTimestampExtractor<WaterSensor>(Time.seconds(3)) {
// @Override
// public long extractTimestamp(WaterSensor element) {
// return element.getTs() * 1000L;
// }
// }
new AscendingTimestampExtractor<WaterSensor>() {
@Override
public long extractAscendingTimestamp(WaterSensor element) {
return element.getTs() * 1000L;
}
}
);
// 2.处理数据
sensorDS
.keyBy(sensor -> sensor.getId())
.process(
new KeyedProcessFunction<String, WaterSensor, String>() {
@Override
public void processElement(WaterSensor value, Context ctx, Collector<String> out) throws Exception {
// 注册一个定时器
// ctx.timerService().registerProcessingTimeTimer(ctx.timerService().currentProcessingTime() + 5000L);
ctx.timerService().registerEventTimeTimer(ctx.timestamp() + 5000L);
// TODO 创建 & 触发 源码分析
// InternalTimerServiceImpl.registerEventTimeTimer()
// => 注册 eventTimeTimersQueue.add(new TimerHeapInternalTimer<>(time, (K) keyContext.getCurrentKey(), namespace));
// =》 为了避免重复注册、重复创建对象,注册定时器的时候,判断一下是否已经注册过了
//
// InternalTimerServiceImpl.advanceWatermark()
// => 触发 timer.getTimestamp() <= time ==========> 定时的时间 <= watermark
}
/**
* 定时器触发,要执行什么操作
* @param timestamp
* @param ctx
* @param out
* @throws Exception
*/
@Override
public void onTimer(long timestamp, OnTimerContext ctx, Collector<String> out) throws Exception {
out.collect("onTimer ts=" + timestamp);
}
}
)
.print();
env.execute();
}
}
|
[
"[email protected]"
] | |
229b15090af5f8d7c9426bc0ac3432245eb50531
|
aba2769746ee2279c6e795edd5370008d43349e9
|
/springboot-security/src/main/java/com/lyoyang/springsecurity/utils/ThreadLocalUtil.java
|
72b1eed3de2164464db278197b1d8104bef6b096
|
[] |
no_license
|
lyoyang/springbootdemo
|
c9a6493bf4340417b7a07ddf2551ebcd91420496
|
e47a00cc225115f0ec3e883a79c99936183a24cf
|
refs/heads/master
| 2022-06-26T03:34:36.837839 | 2021-03-02T03:28:13 | 2021-03-02T03:28:13 | 148,163,508 | 0 | 0 | null | 2022-06-21T00:53:15 | 2018-09-10T13:56:01 |
Java
|
UTF-8
|
Java
| false | false | 827 |
java
|
package com.lyoyang.springsecurity.utils;
import com.lyoyang.springsecurity.dto.UserDetailsResponseDto;
import com.lyoyang.springsecurity.enums.ResponseEnum;
import com.lyoyang.springsecurity.exception.BaseException;
public class ThreadLocalUtil {
private static ThreadLocal<UserDetailsResponseDto> currentUserLocal = new ThreadLocal<>();
public static UserDetailsResponseDto getCurrentUserDetails() {
UserDetailsResponseDto userDetailsResponseDto = currentUserLocal.get();
if (userDetailsResponseDto == null) {
throw new BaseException(ResponseEnum.LOGIN_LOSE);
}
return userDetailsResponseDto;
}
public static void setCurrentUserDetails(UserDetailsResponseDto userDetails) {
currentUserLocal.remove();
currentUserLocal.set(userDetails);
}
}
|
[
"[email protected]"
] | |
0d069363ede693c3cdb817c3a0f16a8af3923900
|
e9b995eda748a9a45c050ed3499a4c9324225be4
|
/hamq/src/main/java/org/os/javaee/jms/core/message/MessageImpl.java
|
aeaf081e4f5477ed96ae7cf4553b8fd3f49741d1
|
[] |
no_license
|
kvmkreddy/HAMQ
|
7a269e2160afd1a8be2ff83f554dd54950c0c00c
|
a57ea69aec3e0506e7887bd6015b426d24b8276e
|
refs/heads/master
| 2021-01-10T00:59:37.137667 | 2013-05-22T18:17:59 | 2013-05-22T18:17:59 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,752 |
java
|
package org.os.javaee.jms.core.message;
import java.io.Serializable;
/**
* <p>Title: MessageImpl.java</p>
* <p>Description: Disconnected Message Object implementation.</p>
* <p>Copyright: Copyright (c) 2013</p>
* <p>Company: Open Source Development.</p>
* @author Murali Reddy
* @version 1.0
*/
public interface MessageImpl extends Serializable{
public static final int TEXT_MESSAGE = 00000000;
public static final int OBJECT_MESSAGE = 00000001;
public static final int MAP_MESSAGE = 00000010;
public static final int BYTES_MESSAGE = 00000011;
public static final int STREAM_MESSAGE = 00000100;
public static final String DEFAULT_DELIVERY_MODE = "DEFAULT_DELIVERY_MODE";
public static final int DELIVERY_MODE_PERSISTENT = javax.jms.DeliveryMode.PERSISTENT;
public static final int DELIVERY_MODE_NON_PERSISTENT = javax.jms.DeliveryMode.NON_PERSISTENT;
/* public Object getProperty(String key) ;
public Map<String,MessagePropertyImpl> getProperties();
public String getDestinationName();
public void setDestinationName(String destinationName);
public int getMessageType();
public void setMessageType(int messageType);
public int getDeliveryMode();
public void setDeliveryMode(int deliveryMode);
public int getPriority();
public void setPriority(int priority);
public long getTimeToLive();
public void setTimeToLive(long timeToLive);
public void setProperty(String key, Object value);
public void setProperty(String key, Object value, int type);
public void setProperties(Properties props, int type);
public void setProperties(Properties props);
public Serializable getPayLoad();
public void setPayLoadData(Serializable payload);
public boolean isAnyMessageSpeificProducerConfigurations();*/
}
|
[
"[email protected]"
] | |
df33c18189752f566e88dcbe3e8d35ccba32f722
|
20d54af513fcedaff4caa9c2e80d09e1b63185a0
|
/Visit/app/src/main/java/com/example/sonu_pc/visit/activities/DataRefreshActivity.java
|
1fff6c34c04b76db7504e0b06513230f4b9280c7
|
[] |
no_license
|
sakshay584/Visit
|
166802a00be83bc405acad5d99d617c30cdb1e54
|
94214263487b12bb39284fdb405368b4ea4e0a46
|
refs/heads/master
| 2020-04-17T10:48:42.582933 | 2018-05-06T21:11:09 | 2018-05-06T21:11:09 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 10,153 |
java
|
package com.example.sonu_pc.visit.activities;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.Toast;
import com.example.sonu_pc.visit.R;
import com.example.sonu_pc.visit.fragments.SuggestionFragment;
import com.example.sonu_pc.visit.model.data_model.SuggestionModel;
import com.example.sonu_pc.visit.model.preference_model.CameraPreference;
import com.example.sonu_pc.visit.model.preference_model.MasterWorkflow;
import com.example.sonu_pc.visit.model.preference_model.Preference;
import com.example.sonu_pc.visit.model.preference_model.RatingPreferenceModel;
import com.example.sonu_pc.visit.model.preference_model.SuggestionPreference;
import com.example.sonu_pc.visit.model.preference_model.SurveyPreferenceModel;
import com.example.sonu_pc.visit.model.preference_model.TextInputPreferenceModel;
import com.example.sonu_pc.visit.model.preference_model.ThankYouPreference;
import com.example.sonu_pc.visit.utils.GsonUtils;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.google.firebase.storage.FileDownloadTask;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.gson.Gson;
import java.io.File;
import android.support.constraint.Group;
import java.util.ArrayList;
public class DataRefreshActivity extends AppCompatActivity implements View.OnClickListener{
private static final String TAG = DataRefreshActivity.class.getSimpleName();
private Button btn_refresh_logo, btn_refresh_wf;
private ProgressBar progressBar;
private Group group;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_data_refresh);
btn_refresh_logo = findViewById(R.id.btn_logo);
btn_refresh_wf = findViewById(R.id.btn_wf);
progressBar = findViewById(R.id.progress_bar);
group = findViewById(R.id.group_refresh);
btn_refresh_wf.setOnClickListener(this);
btn_refresh_logo.setOnClickListener(this);
}
@Override
public void onClick(View view) {
int id = view.getId();
switch (id){
case R.id.btn_logo:
getBrandLogo();
break;
case R.id.btn_wf:
getConfigValues();
break;
}
}
private void getConfigValues(){
showProgressBar();
Log.d(TAG, "getting config values");
DatabaseReference mDatabaseReference = FirebaseDatabase.getInstance().getReference(FirebaseAuth.getInstance().getUid());
mDatabaseReference.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
MasterWorkflow masterWorkflow = dataSnapshot.getValue(MasterWorkflow.class);
Log.d(TAG, "Successfully obtained the masterworkflow object");
for(DataSnapshot child : dataSnapshot.getChildren()){
Log.d(TAG, "children " + child.getKey());
}
DataSnapshot child_map = dataSnapshot.child(MasterWorkflow.WORKFLOW_MAP_KEY); // Name of the map variable in the MasterWorkflow
// Now we can have multiple workflows within a map so iterate over each workflow and substitute for the order of screens
for(DataSnapshot workflow: child_map.getChildren()){
Log.d(TAG, "workflow name = " + workflow.getKey());
// TODO: Find a way to remove the order_of_screens hardcoded value maybe via remoteconfig
DataSnapshot order_of_screens = workflow.child("order_of_screens");
ArrayList<Preference> orderOfScreensList = new ArrayList<>();
for(DataSnapshot screen : order_of_screens.getChildren()){
Log.d(TAG, "screen key = " + screen.getKey());
/*// for testing only
for(DataSnapshot ds : screen.getChildren()){
Log.d(TAG, "screen attrib = " + ds.getKey());
}*/
String type = screen.child(getString(R.string.class_type_firebase_pref)).getValue(String.class);
Log.d(TAG, "screen wipe = " + type);
if(getString(R.string.CLASS_TEXTINPUT).equals(type)){
Log.d(TAG, "got the text input class");
TextInputPreferenceModel textInputPreferenceModel = screen.getValue(TextInputPreferenceModel.class);
Log.d(TAG, "textclass = " + textInputPreferenceModel.getPage_title());
orderOfScreensList.add(textInputPreferenceModel);
}
else if(getString(R.string.CLASS_SURVEYINPUT).equals(type)){
Log.d(TAG, "got the survey input class");
SurveyPreferenceModel surveyPreferenceModel = screen.getValue(SurveyPreferenceModel.class);
Log.d(TAG, "survey class = " + surveyPreferenceModel.getSurvey_title());
orderOfScreensList.add(surveyPreferenceModel);
}
else if(getString(R.string.CLASS_CAMERA).equals(type)){
Log.d(TAG, "got the camera class");
CameraPreference cameraPreference = screen.getValue(CameraPreference.class);
Log.d(TAG, "survey class = " + cameraPreference.getCamera_hint_text());
orderOfScreensList.add(cameraPreference);
}
else if(getString(R.string.CLASS_RATING).equals(type)){
Log.d(TAG, "got the rating class");
RatingPreferenceModel ratingPreferenceModel = screen.getValue(RatingPreferenceModel.class);
//Log.d(TAG, "survey class = " + cameraPreference.getCamera_hint_text());
orderOfScreensList.add(ratingPreferenceModel);
}
else if(getString(R.string.CLASS_SUGGESTION).equals(type)){
Log.d(TAG, "got the rating class");
SuggestionPreference preference = screen.getValue(SuggestionPreference.class);
Log.d(TAG, "suggestion class = " + preference.getSuggestion_text());
orderOfScreensList.add(preference);
}
else if(getString(R.string.CLASS_THANKYOU).equals(type)){
Log.d(TAG, "got the thank you class");
ThankYouPreference thankYouPreference = screen.getValue(ThankYouPreference.class);
Log.d(TAG, "survey class = " +thankYouPreference.getThank_you_text());
orderOfScreensList.add(thankYouPreference);
}
}
masterWorkflow.getWorkflows_map().get(workflow.getKey()).setOrder_of_screens(orderOfScreensList);
}
// Store preference object in shared preferences
SharedPreferences sharedPreferences = getSharedPreferences(getString(R.string.PREF_FILE_MASTERWORKFLOW), MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
Gson gson = GsonUtils.getGsonParser();
String config_string = gson.toJson(masterWorkflow);
Log.d(TAG, config_string);
editor.putString(getString(R.string.PREF_KEY_MASTERWORKFLOW), config_string);
editor.putString("key", "testvalue");
editor.commit();
finish();
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
private void getBrandLogo(){
showProgressBar();
// Download the logo in a file named brand_logo
final File file = new File(getFilesDir().getAbsolutePath(), "brand_logo.png");
StorageReference storageReference = FirebaseStorage.getInstance()
.getReference(FirebaseAuth.getInstance().getUid() + "/Logo/brand_logo.png");
if(file.exists()){
Log.d(TAG, "file already exists");
Log.d(TAG, "delete file result: " + file.delete());
}
else{
storageReference.getFile(file).addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
@Override
public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
Log.d(TAG, "Logo download successful");
finish();
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
Log.e(TAG, "error downloading Logo");
Toast.makeText(DataRefreshActivity.this, "Error downloading Logo", Toast.LENGTH_SHORT).show();
}
});
}
}
private void showProgressBar(){
progressBar.setVisibility(View.VISIBLE);
btn_refresh_logo.setVisibility(View.GONE);
btn_refresh_wf.setVisibility(View.GONE);
group.setVisibility(View.GONE);
}
}
|
[
"[email protected]"
] | |
92ad7a2a3e01be1551b775a5f694a0500c5db7ba
|
485c159abb63027d3865a6cd2812843164927ca4
|
/src/test/java/ru/sbtqa/tag/datajack/callback/SampleDataCache.java
|
ea505dd49cce1c40d3a944a56cbe451ec10e049b
|
[
"Apache-2.0"
] |
permissive
|
sbtqa/datajack-properties-adaptor
|
8add5834142ab4919dde04a84b81084e7ae09e1f
|
9b4020ebd1dffecc6d5cdd1c00984d878ff07e08
|
refs/heads/master
| 2020-03-22T04:57:11.505347 | 2018-08-06T03:54:24 | 2018-08-06T03:54:24 | 139,531,882 | 0 | 0 |
Apache-2.0
| 2018-08-06T03:54:25 | 2018-07-03T05:16:11 |
Java
|
UTF-8
|
Java
| false | false | 343 |
java
|
package ru.sbtqa.tag.datajack.callback;
import java.util.HashMap;
import java.util.Map;
public class SampleDataCache {
private static final Map<String, Object> CACHE = new HashMap<>();
/**
* Return CACHE instance
*
* @return
*/
public static Map<String, Object> getCache() {
return CACHE;
}
}
|
[
"[email protected]"
] | |
7cd7da644cb33107063b38bce1059a199953564e
|
0564b9d345a3670e759505819857477380924dff
|
/src/main/java/com/github/page/CreateAccountPage.java
|
ffe46b41eeed638d60ec1560742b3236c9309896
|
[] |
no_license
|
linguohuairis/NIM-test-master
|
e2290ec940494a91743659ae83ba952365c7c97e
|
534dd21ae6ba3fc3b5a0686ef67ecb6e5d8cb0fb
|
refs/heads/master
| 2021-01-17T10:31:41.263320 | 2017-03-14T08:58:01 | 2017-03-14T08:58:01 | 84,017,313 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 925 |
java
|
package com.github.page;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class CreateAccountPage {
private final WebDriver driver;
public CreateAccountPage(WebDriver driver) {
this.driver = driver;
}
public void createValidAccount(String email, String password){
WebDriverWait wait = new WebDriverWait(driver, 200);
wait.until(ExpectedConditions.elementToBeClickable(By.id("nim_authCreateAcctSubmitBtn")));
driver.findElement(By.id("nim_authCreateAcctUsernameInput")).sendKeys(email);
driver.findElement(By.id("nim_authCreateAcctPasswordInput")).sendKeys(password);
driver.findElement(By.id("nim_authCreateAcctSubmitBtn")).click();
}
public void switchToSignInPage(WebDriver driver){
driver.findElement(By.id("nim_authCreateAcctSignInLink")).click();
}
}
|
[
"[email protected]"
] | |
c8ae14f2ffeb603dacbf199480e3caf0adbd46b2
|
a6122e74b13e0ce1fa9d93a84ad3cc877ac67caf
|
/app/src/test/java/com/example/quizeo/UserTest.java
|
e04206fd5c926591eab8ff434ce9ff581613aea3
|
[
"Unlicense"
] |
permissive
|
ItzRick/Quizeo
|
e4b24c2365b69f6d65d4a3d8ec7fa95baa2d31e9
|
6fc352ad94443e3bf650e89ed1ecd5a8da7196cf
|
refs/heads/main
| 2023-04-21T21:43:42.180233 | 2021-05-05T22:42:06 | 2021-05-05T22:42:06 | 340,883,402 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,601 |
java
|
package com.example.quizeo;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.util.UUID;
import static org.junit.Assert.*;
public class UserTest {
User user;
@Before
public void setUp() {
user = new User();
}
/** Test the setNickName() and getNickName() methods. */
@Test
public void setNickName() {
System.out.println("setNickName()");
// Create a new nickname and set this nickname:
String nickName = "test";
user.setNickName(nickName);
// check if the nickName was correctly set:
Assert.assertEquals(nickName, user.getNickName());
}
/** Test the setUserId() and getUserId() methods. */
@Test
public void setUserId() {
System.out.println("setUserId()");
// Create a new userId and set this userId:
String id = UUID.randomUUID().toString();
user.setUserId(id);
// Check if the userId was correctly set:
Assert.assertEquals(id, user.getUserId());
}
/** test if the initialization works with a nickName and Id. */
@Test
public void initialization() {
System.out.println("Initialization()");
// Create a nickName and userId and pass this while initializing:
String nickName = "test";
String id = UUID.randomUUID().toString();
User user1 = new User(nickName, id);
// Check if both the userId and nickName were correctly passed:
Assert.assertEquals(nickName, user1.getNickName());
Assert.assertEquals(id, user1.getUserId());
}
}
|
[
"[email protected]"
] | |
29ad4e5d31a22dd04297b50048bc60ab933a32c5
|
c662a1f1f4660cc644b63f417f0911cee5e8fbfb
|
/dh.testexcutor/tcexecutor.benchmark/src/main/java/io/hedwig/tcexecutor/benchmark/Freemarker.java
|
1f4faf0475a1ab6c7ce8074ff93ef8240ad65079
|
[] |
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,094 |
java
|
package io.hedwig.tcexecutor.benchmark;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Map;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Setup;
import freemarker.cache.ClassTemplateLoader;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
public class Freemarker extends BaseBenchmark {
private Map<String, Object> context;
private Template template;
@Setup
public void setup() throws IOException {
Configuration configuration = new Configuration(Configuration.VERSION_2_3_22);
configuration.setTemplateLoader(new ClassTemplateLoader(getClass(), "/"));
template = configuration.getTemplate("templates/stocks.freemarker.html");
this.context = getContext();
}
@Benchmark
public String benchmark() throws TemplateException, IOException {
Writer writer = new StringWriter();
template.process(context, writer);
return writer.toString();
}
}
|
[
"[email protected]"
] | |
c525af1c1ef92be049f64d4b8f09f9e98b4c91cc
|
1cdf01e41f055ff9659eef22365525a458feaba2
|
/src/main/java/org/example/pogotrader/PogotraderApplication.java
|
8bbadf2963122e58158289aa18830a15ac35a610
|
[] |
no_license
|
aForsund/pogotrader
|
36fdfca0961c8bee24b349de612f8e9a18d73c92
|
8559d8ee5cde0591e818eaab19609b72ae9273c2
|
refs/heads/master
| 2023-07-15T09:55:11.484893 | 2021-08-24T21:22:59 | 2021-08-24T21:22:59 | 364,474,948 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 465 |
java
|
package org.example.pogotrader;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
@SpringBootApplication(exclude = { SecurityAutoConfiguration.class })
public class PogotraderApplication {
public static void main(String[] args) {
SpringApplication.run(PogotraderApplication.class, args);
}
}
|
[
"[email protected]"
] | |
8b6aac7f3186edd93d4b213a96a3c6398d6dde0a
|
7981b46dd945b80548a3c30c611c4d9ed13fd002
|
/src/main/scala/com/huyong/spark/test/Test.java
|
e7f901fa01c900fb7df5341a8e3e200bf6983e96
|
[] |
no_license
|
namenotolong/spark_test
|
d2f5bd1b1a24aa507a20c8621c5c209a6da4411e
|
bcd1feca210e50aa54de466b4547749a63531702
|
refs/heads/master
| 2023-02-16T02:12:10.304536 | 2021-01-11T15:46:30 | 2021-01-11T15:46:30 | 328,710,977 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 54 |
java
|
package com.huyong.spark.test;
public class Test {
}
|
[
"[email protected]"
] | |
9f891dea5996877f33dca145f53ef5624548ebd2
|
3875c2067ab7b8ab2bba7c5a7ef068c581f3f88c
|
/src/main/java/com/onet/note/service/impl/DirServiceImpl.java
|
02422063e9943b280e10f8aa7fbba87de4d63d66
|
[] |
no_license
|
luojiash/onet
|
b8c80142fad2f9e99f93e594a1b3be28625be97c
|
1cabb3cfb3a44232bfad6adbedc683ad826d2c0c
|
refs/heads/master
| 2021-01-18T14:23:57.365028 | 2015-06-03T05:12:05 | 2015-06-03T05:12:05 | 35,602,584 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,199 |
java
|
package com.onet.note.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import com.onet.common.constant.CommConst;
import com.onet.common.dto.BaseResponse;
import com.onet.common.dto.IBaseResponse;
import com.onet.common.manager.ObjectConvertManager;
import com.onet.note.dao.DirDao;
import com.onet.note.dao.NoteDao;
import com.onet.note.dto.DirDTO;
import com.onet.note.dto.NoteQueryRequest;
import com.onet.note.po.DirPO;
import com.onet.note.service.DirService;
public class DirServiceImpl implements DirService {
@Autowired
private ObjectConvertManager objectConvertManager;
@Autowired
private DirDao dirDao;
@Autowired
private NoteDao noteDao;
@Override
public IBaseResponse addRootCategory(Long userid){
DirPO po = new DirPO();
po.setUserId(userid);
po.setDepth(0);
po.setLeaf(true);
po.setName("root");
po.setPath("/");
po.setPid(CommConst.ROOT_DIR_PID);
dirDao.insertCategory(po);
return new BaseResponse(true);
}
@Override
public IBaseResponse add(String cateName, Long pid, Long userid) {
Assert.notNull(userid, "userid must not be null");
DirPO cPO = dirDao.querySiblingByName(cateName, pid, userid);
if (null != cPO) {
return new BaseResponse(false, "该目录已存在!");
}
DirPO parent = dirDao.queryCategoryById(pid, userid);
if (null == parent) {
return new BaseResponse(false, "失败!父目录不存在。");
}
// 创建新目录
DirPO po = new DirPO();
po.setName(cateName);
po.setPid(pid);
po.setUserId(userid);
po.setDepth(parent.getDepth() + 1);
po.setLeaf(true);
po.setPath(parent.getPath() + "/" + parent.getName());
dirDao.insertCategory(po);
// 更新父目录信息
if (parent.isLeaf()) {
parent.setLeaf(false);
dirDao.updateCategory(parent);
}
return new BaseResponse(true, po.getId().toString(), null);
}
@Override
public IBaseResponse renameCate(Long cid, Long userid, String newName) {
Assert.notNull(userid, "userid must not be null");
DirPO categoryPO = dirDao.queryCategoryById(cid, userid);
if (null == categoryPO) {
return new BaseResponse(false, "目录不存在:cid: "+cid);
}
categoryPO.setName(newName);
dirDao.updateCategory(categoryPO);
return new BaseResponse(true);
}
@Override
public IBaseResponse deleteCategory(Long categoryId, Long userid) {
Assert.notNull(userid, "userid must not be null");
DirPO po = dirDao.queryCategoryById(categoryId, userid);
if (po.getDepth() == 0 || !po.isLeaf()) {
return new BaseResponse(false, "非叶子目录不能删除");
}
Long pid = po.getPid();
// 将该目录里的笔记移到父目录
noteDao.updateNoteCategory(userid, categoryId, pid);
dirDao.deleteCategoryById(categoryId, userid);
// 更新父节点信息
List<DirPO> pos = dirDao.querySubCate(pid, userid);
if (pos.size() == 0) {
DirPO parent = dirDao.queryCategoryById(pid, userid);
parent.setLeaf(true);
dirDao.updateCategory(parent);
}
return new BaseResponse(true);
}
@Override
public DirDTO queryDir(Long dirId, Long userid) {
DirPO po = dirDao.queryCategoryById(dirId, userid);
return objectConvertManager.toDirDTO(po);
}
private List<DirDTO> queryCates(Long pid, Long userid, boolean recuesive) {
List<DirDTO> dtos = new ArrayList<DirDTO>();
List<DirPO> pos = dirDao.querySubCate(pid, userid);
for (DirPO categoryPO : pos) {
DirDTO dto = objectConvertManager.toDirDTO(categoryPO);
NoteQueryRequest request = new NoteQueryRequest(userid);
request.setDirId(dto.getId());
int noteCount = noteDao.queryNoteCountByRequest(request);
dto.setNoteCount(noteCount);
// 递归查询子目录
if (recuesive && !dto.isLeaf()) {
dto.setChildren(queryCates(dto.getId(), userid, recuesive));
}
dtos.add(dto);
}
return dtos;
}
@Override
public List<DirDTO> queryCategories(Long userid) {
Assert.notNull(userid, "userid must not be null");
return queryCates(CommConst.ROOT_DIR_PID, userid, true);
}
@Override
public List<DirDTO> querySubCates(Long pid, Long userid) {
return queryCates(pid, userid, false);
}
}
|
[
"[email protected]"
] | |
086c1372e9f761f911e1ff054dae5d7178e2c3c3
|
4b954dbad1d42681157eee475d6cd1fa57628e1d
|
/module4/bai_11_webservice_restful/bai_tap/blog_manager_restful/src/main/java/com/blog/service/impl/CategoryServiceImpl.java
|
7e2102139c35a6e3b591d54d53f5addfcde64fa7
|
[] |
no_license
|
hongson2410/C1020G1-PhamHongSon
|
c5466a068154f7cfcfb6a2c0c2f47bd90ff9f7ab
|
ae10660a5de6d9c3018a64f238dd34897f6ad2c2
|
refs/heads/main
| 2023-04-11T10:55:26.730907 | 2021-04-18T10:20:00 | 2021-04-18T10:20:00 | 307,275,086 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 531 |
java
|
package com.blog.service.impl;
import com.blog.models.Category;
import com.blog.repository.CategoryRepository;
import com.blog.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService {
@Autowired
CategoryRepository categoryRepository;
@Override
public List<Category> findAllCategory() {
return categoryRepository.findAll();
}
}
|
[
"[email protected]"
] | |
928b3fe07f01cde49f2f077d01fd80ecb160faa2
|
07c16ae3705413e4e35a3330f42ec77d159c2d19
|
/RevelioMoviePlayer/app/src/main/java/maxst/com/reveliomovieplayer/ApplicationUtils.java
|
8cf1907b7e9e5a0b8053e665f8294fc5002a3957
|
[] |
no_license
|
gidools/RevelioMoviePlayer
|
6fc81278755363ff91f9b8d4b37a3d9b6ee5df98
|
890a369383f2383761ec2f3d54372088129c5f1e
|
refs/heads/master
| 2020-04-06T04:15:08.631351 | 2017-02-24T01:01:42 | 2017-02-24T01:01:42 | 82,982,852 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,913 |
java
|
/*
*
* Copyright 2016 Maxst, Inc. All Rights Reserved.
*
* Confidential and Proprietary - Protected under copyright and other laws.
* /
*/
package maxst.com.reveliomovieplayer;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.os.Build.VERSION_CODES;
/**
* Class containing some static utility methods.
*/
public class ApplicationUtils {
private ApplicationUtils() {};
public static boolean hasFroyo() {
// Can use static final constants like FROYO, declared in later versions
// of the OS since they are inlined at compile time. This is guaranteed behavior.
return Build.VERSION.SDK_INT >= VERSION_CODES.FROYO;
}
public static boolean hasGingerbread() {
return Build.VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD;
}
public static boolean hasHoneycomb() {
return Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
}
public static boolean hasHoneycombMR1() {
return Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB_MR1;
}
public static boolean hasJellyBean() {
return Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
}
public static boolean hasKitKat() {
return Build.VERSION.SDK_INT >= VERSION_CODES.KITKAT;
}
/**
* Simple network connection check.
*/
public static boolean isNetworkConnected(Context context) {
final ConnectivityManager cm =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
final NetworkInfo networkInfo = cm.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnectedOrConnecting());
// if (networkInfo == null || !networkInfo.isConnectedOrConnecting()) {
// return false;
// } else {
// return true;
// }
}
}
|
[
"[email protected]"
] | |
3c93e7be3537ee11d2a6fffb276f023f82656215
|
ac191a49b01b2d2adcef4472dd7aa97f858949cf
|
/src/main/java/com/zju/myspring/ioc/beans/factory/BeanFactory.java
|
91ad39e3a8c9e1ab851770a70483786dd97b9de9
|
[] |
no_license
|
Ysoretarted/My-Spring
|
fd6c81220ec2af0079a8bced8aa1c9bae1b8f769
|
79af9b679dba9aa4eb9c6a045b679aeb6911ab30
|
refs/heads/master
| 2020-12-11T22:16:11.169726 | 2020-07-13T03:15:02 | 2020-07-13T03:15:02 | 228,193,809 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 561 |
java
|
package com.zju.myspring.ioc.beans.factory;
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;
import com.zju.myspring.BeanDefinition;
import java.io.IOException;
/**
* @author zcz
* @CreateTime 2020/1/15 9:37
*/
/**
* 这个在stepOne 应该是一个类的,但在step-two 用了Extract interface 的方法,变成接口
*/
public interface BeanFactory {
Object getBean(String beanName) throws Exception;
/* void registerBean();*/
void registerBeanDefinition(String name, BeanDefinition beanDefinition) throws Exception;
}
|
[
"[email protected]"
] | |
a08cad33a2eb88a11f6909797a86c3cd223c9d14
|
b78d3bf1fbaf9a0046bc9028d873ad0aa5815add
|
/mercadoLivre/src/main/java/com/br/mercadoLivre/response/ErroDeFormularioResponse.java
|
3d1b2bf5dadfa591ca2aff0adb2b49459bbb6675
|
[
"Apache-2.0"
] |
permissive
|
UlyssesSavio/orange-talents-03-template-ecommerce
|
f5c449f8590b993db731747b3fa6115e87a0f790
|
5c9814618d7097e2a7c4d87ea10595bce33510f7
|
refs/heads/main
| 2023-03-29T19:14:54.406877 | 2021-03-26T14:28:35 | 2021-03-26T14:28:35 | 349,502,604 | 0 | 0 |
Apache-2.0
| 2021-03-19T17:23:59 | 2021-03-19T17:23:59 | null |
UTF-8
|
Java
| false | false | 329 |
java
|
package com.br.mercadoLivre.response;
public class ErroDeFormularioResponse {
private String campo;
private String erro;
public ErroDeFormularioResponse(String campo, String erro) {
this.campo = campo;
this.erro = erro;
}
public String getCampo() {
return campo;
}
public String getErro() {
return erro;
}
}
|
[
"[email protected]"
] | |
71bde9d7afe9b2d4cd4b462d6233526ace70ba68
|
f1137660fc53bfaeca7c6db4e6556a770617e426
|
/src/pro10/sec04/ex02/Pro10Sec04Ex02LogoutTest.java
|
25036f5ebe69939b6fd27ebce364230c76705b8f
|
[] |
no_license
|
nekisse-lee/java-web-study
|
74cd6471b309c818f25f77f51a80a09f9aa42542
|
fde77f1faca4771c2c543e7bcd0b6d4f2985405f
|
refs/heads/master
| 2022-04-11T22:07:05.334705 | 2020-03-10T07:58:52 | 2020-03-10T07:58:52 | 238,605,441 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,663 |
java
|
package pro10.sec04.ex02;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
@WebServlet(value = "/Pro10Sec04Ex02LogoutTest", name = "Pro10Sec04Ex02LogoutTest")
public class Pro10Sec04Ex02LogoutTest extends HttpServlet {
ServletContext context;
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doHandle(request, response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doHandle(request, response);
}
private void doHandle(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
context = getServletContext();
PrintWriter out = response.getWriter();
HttpSession session = request.getSession();
String user_id = request.getParameter("user_id");
session.invalidate();
List user_list = (ArrayList) context.getAttribute("user_list");
user_list.remove(user_id);
context.removeAttribute("user_list");
context.setAttribute("user_list", user_list);
out.println("<br>로그아웃 했습니다.");
}
}
|
[
"[email protected]"
] | |
a9ea111fc6c7c7cdcb3b6a34e9ed0e1be6d143ce
|
9e28d41a781bdf4823b0a12061a0f9a5cd3a6761
|
/src/main/java/com/myboot/dataprocess/builder/enums/ResearchConclusion.java
|
55bfcfbe938d70f7eef95b0d6db256c572abf592
|
[] |
no_license
|
qxy731/datamanager
|
c578349ba5934250e9fb3f699767f046eb9cc6de
|
1bdd37aef4669e982b66afe1f0f82a6066c606ca
|
refs/heads/master
| 2022-07-11T05:13:57.197867 | 2019-10-24T09:32:03 | 2019-10-24T09:32:03 | 214,570,443 | 0 | 0 | null | 2022-06-29T19:44:09 | 2019-10-12T03:25:03 |
Java
|
UTF-8
|
Java
| false | false | 510 |
java
|
package com.myboot.dataprocess.builder.enums;
public enum ResearchConclusion {
//K,F,S,空
K("K","K"),F("F","F"),S("S","S"),NONE(" "," ");
public String code;
public String text;
ResearchConclusion(String code, String text) {
this.code = code;
this.text = text;
}
public static ResearchConclusion randomType(){
ResearchConclusion[] values = ResearchConclusion.values();
return values[(int)(Math.random()*values.length)];
}
}
|
[
"[email protected]"
] | |
254e2c40cc58f7d03c3358cc7d107056d9f41e52
|
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
|
/aws-java-sdk-mgn/src/main/java/com/amazonaws/services/mgn/model/transform/ListManagedAccountsResultJsonUnmarshaller.java
|
a69e61f3fb1733d537a526148246b91279982f60
|
[
"Apache-2.0"
] |
permissive
|
aws/aws-sdk-java
|
2c6199b12b47345b5d3c50e425dabba56e279190
|
bab987ab604575f41a76864f755f49386e3264b4
|
refs/heads/master
| 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 |
Apache-2.0
| 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null |
UTF-8
|
Java
| false | false | 3,180 |
java
|
/*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.mgn.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.mgn.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* ListManagedAccountsResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListManagedAccountsResultJsonUnmarshaller implements Unmarshaller<ListManagedAccountsResult, JsonUnmarshallerContext> {
public ListManagedAccountsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
ListManagedAccountsResult listManagedAccountsResult = new ListManagedAccountsResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return listManagedAccountsResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("items", targetDepth)) {
context.nextToken();
listManagedAccountsResult.setItems(new ListUnmarshaller<ManagedAccount>(ManagedAccountJsonUnmarshaller.getInstance())
.unmarshall(context));
}
if (context.testExpression("nextToken", targetDepth)) {
context.nextToken();
listManagedAccountsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return listManagedAccountsResult;
}
private static ListManagedAccountsResultJsonUnmarshaller instance;
public static ListManagedAccountsResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new ListManagedAccountsResultJsonUnmarshaller();
return instance;
}
}
|
[
""
] | |
994b450fcb46e831e054e672a62108eed4c320f6
|
f976b907971868b5dbb46d8fe8363c25c725e56b
|
/src/main/java/com/liz/service/TApproveServiceImpl.java
|
53e63b0f1c12de9f116b8ffdc72fb22e4c8d3903
|
[] |
no_license
|
liz1002/kindergarten
|
4c8dacba1b6d07c539aed8b3c6f1d2464d2976cc
|
b91262e2f7643636951b3f8bfdeb92bd953a8254
|
refs/heads/master
| 2022-12-24T16:59:44.778754 | 2020-01-30T07:21:04 | 2020-01-30T07:21:04 | 231,343,325 | 0 | 1 | null | 2022-12-16T09:45:03 | 2020-01-02T08:55:15 |
Java
|
UTF-8
|
Java
| false | false | 738 |
java
|
package com.liz.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.liz.domain.TApproveVO;
import com.liz.persistence.TApproveDAO;
@Service
public class TApproveServiceImpl implements TApproveService{
@Autowired
private TApproveDAO dao;
@Override
public void regist(TApproveVO taVo) {
dao.insert(taVo);
}
@Override
public List<TApproveVO> selectListByKNo(int kNo) {
return dao.selectListByKNo(kNo);
}
@Override
public List<TApproveVO> selectListByMNo(int mNo) {
return dao.selectListByMNo(mNo);
}
@Override
public void removeByMNoAndCNoAndTType(TApproveVO taVo) {
dao.deleteByMNoAndCNoAndTType(taVo);
}
}
|
[
"[email protected]"
] | |
c5ad2381442ff0a0ee9368d6776262b4f88e5d89
|
8067c9564fa7b47a3bc5e5f15b38389a66751e70
|
/The Infinite Stone/core/src/ml/dpgames/infinite/stone/main/screens/game/areas/StoneArea.java
|
d6893792d20043a4e9084f808f8afb4d3735e2a5
|
[] |
no_license
|
BrandonDyer64/The-Infinite-Stone
|
4368a39b7524ffafd239c5fd64a7edadc8e7fc5c
|
dae2f7c35a6c94b48aa51a8ecdc5db46ba0bb218
|
refs/heads/master
| 2016-09-01T04:51:12.153623 | 2015-12-15T02:59:57 | 2015-12-15T02:59:57 | 47,089,746 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,491 |
java
|
package ml.dpgames.infinite.stone.main.screens.game.areas;
import ml.dpgames.infinite.stone.main.Graphics;
import ml.dpgames.infinite.stone.main.IStoneMain;
import ml.dpgames.infinite.stone.main.Lang;
import ml.dpgames.infinite.stone.main.screens.game.Area;
import ml.dpgames.infinite.stone.main.screens.game.GameScreen;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
public class StoneArea extends Area {
public static final TextureRegion stone = new TextureRegion(Graphics.spriteSheet, 0, 0, 32, 32);
@Override
public void render(SpriteBatch batch, int areaX) {
float scroll = -96 * 4.5f;
Catalog.draw(
batch,
new TextureRegion(Graphics.spriteSheet, (int) Graphics.getItemCoords(GameScreen.numGems + 1).x, (int) Graphics
.getItemCoords(GameScreen.numGems + 1).y, 32, 32),
1,
new TextureRegion(Graphics.spriteSheet, (int) Graphics.getItemCoords(GameScreen.numGems + 1).x, (int) Graphics
.getItemCoords(GameScreen.numGems + 1).y, 32, 32), 1, Lang.prop.getProperty("the_stone"), areaX, -IStoneMain.minCamWidth * (1.5f / 4f),
1 * 96 + scroll, IStoneMain.minCamWidth * (3f / 4f));
if (draw(stone, areaX, -128, -128, 256, 256) == 3) {
GameScreen.gems[0]++;
}
Area.drawString(batch, "Stones: " + String.valueOf(GameScreen.gems[0]), Color.WHITE, areaX, -GameScreen.camera.viewportWidth / 2,
-GameScreen.camera.viewportHeight / 2 + 22, 2);
}
}
|
[
"[email protected]"
] | |
2ddf67671ae439db11baad2ecc30703da56693c3
|
e49309ccc4a20c6b20016ca73ac5a043c58e699d
|
/zuoye/Huocheluru.java
|
69908450d48ca7a645ebd2ca3b2d955f5edfa936
|
[] |
no_license
|
dengyanxin/homework
|
1dae157324d02ef57808c6e5992d7f8adb38c706
|
fc047b91a240429b731020e324baab50d4508fbc
|
refs/heads/master
| 2021-01-22T04:23:26.150153 | 2017-05-26T01:42:01 | 2017-05-26T01:42:01 | 92,460,061 | 0 | 0 | null | null | null | null |
GB18030
|
Java
| false | false | 349 |
java
|
public class Huocheluru{
public static void main(String[] arges){
Huoche[] a=new Huoche[2];
Huoche b=new Huoche("钢铁侠","高速列车","上海","2017-3-1","临沂","2017-3-2");
a[0]=b;
Huoche c=new Huoche("蝙蝠侠","电车","北京","2017-3-3","临沂","2017-3-4");
a[1]=c;
for(int i=0;i<a.length;i++){
a[i].say();
}
}
}
|
[
"[email protected]"
] | |
1e2067b082a4c29a296ee25c11ed317cc7960f41
|
fc562b4b16576c8fb9a8bc937898c455b383c761
|
/itemscript_ios/src/org/itemscript/standard/parser/Yytoken.java
|
c1c8026c848b455f40dc08d6e18fb16f5b662d91
|
[
"Apache-2.0"
] |
permissive
|
lenaschimmel/meva
|
ed539adf1c93eb57c84baf067bbf45da1a6641b9
|
1a57ff0e37d394dc6047afc930587311775b2da7
|
refs/heads/master
| 2021-01-01T05:48:56.061455 | 2017-03-27T21:16:07 | 2017-03-27T21:16:07 | 22,265,270 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,949 |
java
|
/*
* $Id: Yytoken.java,v 1.1 2006/04/15 14:10:48 platform Exp $
* Created on 2006-4-15
*/
package org.itemscript.standard.parser;
import org.itemscript.core.values.JsonValue;
/**
* @author FangYidong<[email protected]>
*/
final class Yytoken {
public static final int TYPE_VALUE = 0;//JSON primitive value: string,number,boolean,null
public static final int TYPE_LEFT_BRACE = 1;
public static final int TYPE_RIGHT_BRACE = 2;
public static final int TYPE_LEFT_SQUARE = 3;
public static final int TYPE_RIGHT_SQUARE = 4;
public static final int TYPE_COMMA = 5;
public static final int TYPE_COLON = 6;
public static final int TYPE_EOF = -1;//end of file
public int type = 0;
public JsonValue value = null;
public Yytoken(int type, JsonValue value) {
this.type = type;
this.value = value;
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
switch (type) {
case TYPE_VALUE :
sb.append("VALUE(")
.append(value)
.append(")");
break;
case TYPE_LEFT_BRACE :
sb.append("LEFT BRACE({)");
break;
case TYPE_RIGHT_BRACE :
sb.append("RIGHT BRACE(})");
break;
case TYPE_LEFT_SQUARE :
sb.append("LEFT SQUARE([)");
break;
case TYPE_RIGHT_SQUARE :
sb.append("RIGHT SQUARE(])");
break;
case TYPE_COMMA :
sb.append("COMMA(,)");
break;
case TYPE_COLON :
sb.append("COLON(:)");
break;
case TYPE_EOF :
sb.append("END OF FILE");
break;
}
return sb.toString();
}
}
|
[
"[email protected]"
] | |
2bcf0dfb56088f903af1b584f09f0e089c0582fc
|
69ed2389fdd4ce03b70680c269595ca495668d4d
|
/app/src/main/java/com/watsonlogic/rapidjot/model/ModelOpsExposedToPresenter.java
|
e30a6ba316eecabdc9a05814a2746923f099d92a
|
[
"Apache-2.0"
] |
permissive
|
kelvinwatson/RapidJot
|
892e6b4857fbde8784e0adc60e5cc4b12419068f
|
d433e4f85ea0cbe2542edd0c6fabdc17091c78cb
|
refs/heads/master
| 2021-06-07T04:16:13.753227 | 2016-11-06T07:01:17 | 2016-11-06T07:01:17 | 71,731,019 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,071 |
java
|
package com.watsonlogic.rapidjot.model;
import java.util.List;
/**
* @author: Kelvin Watson
*/
public interface ModelOpsExposedToPresenter {
/**
* Get list of {@Link Jot}s from database
*
* @return a List of {@link Jot}s
*/
List<Jot> fetchJots();
/**
* Get local copy of list of {@Link Jot}s
*
* @return a List of {@link Jot}s
*/
List<Jot> getJots();
/**
* Insert a new {@link Jot} in the database
*
* @param {@link Jot}
*/
void createJot(Jot jot);
/**
* Update an existing {@link Jot} in the database
*
* @param jotUnderEdit {@link Jot}
* @param title
* @param plainTextContent
*/
void updateJot(Jot jotUnderEdit, String title, String plainTextContent);
/**
* Retrieve one {@link Jot} from the list of Jots
*
* @param position
* @return a {@link Jot}
*/
Jot getJot(int position);
/**
* Return the number of {@link Jot}s from the list of Jots
*
* @return
*/
int getJotCount();
}
|
[
"[email protected]"
] | |
a027fdf9e012125ced5d61bd64bc105e6fde7f02
|
49bcae78c02809b3ab7618c550181febecdcde54
|
/src/test/java/br/com/sisbov/test/LoteTest.java
|
aa83406edf875f636d666c72f6623747fe41b2e9
|
[] |
no_license
|
diogogermano/SisBov
|
b17672528f327e5b79628a443f1c7b340a3dae31
|
e3eba4369231a713e8374a75a4029cd9187e832e
|
refs/heads/master
| 2020-04-20T10:47:29.900162 | 2013-12-02T02:22:51 | 2013-12-02T02:22:51 | 14,033,189 | 3 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 567 |
java
|
package br.com.sisbov.test;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import br.com.sisbov.dao.impl.LoteDao;
import br.com.sisbov.persistence.Animal;
import br.com.sisbov.persistence.Lote;
import br.com.sisbov.persistence.Piquete;
public class LoteTest {
@Test
public void test() {
/*Lote lote = new Lote();
Piquete piquete = new Piquete();
Animal anim = new Animal();
lote.setPiquete(piquete);
lote.setAnimal(anim);
LoteDao dao = new LoteDao();
dao.save(lote);*/
}
}
|
[
"[email protected]"
] | |
aea7d9e9309aaedfcb1b589ad8f3dd487197a0f4
|
6e8add1f33043f7b5ceb05f4649e794322fe831c
|
/app/src/androidTest/java/com/example/loginsignupscreen/ExampleInstrumentedTest.java
|
7b949d3af1611ede2ddc016526c75b843b90ef16
|
[] |
no_license
|
ShowBaba/Login-and-sign-up-fragments
|
e7dd9ed2840832abe7cb7fe099773e40960e99ca
|
d2e94a050eb837d108a22e69a619fc781a5499ec
|
refs/heads/master
| 2022-06-16T17:37:38.236430 | 2020-05-08T00:03:34 | 2020-05-08T00:03:34 | 262,184,701 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 774 |
java
|
package com.example.loginsignupscreen;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.loginsignupscreen", appContext.getPackageName());
}
}
|
[
"[email protected]"
] | |
273d469689037d4c2182828278360ba509418ea2
|
5bb9cf36d89f2d797c4acf082bbde7a89509c09f
|
/src/main/java/net/bsuir/client/view/InicioView.java
|
0e45628bc87d8fed1c9d56edafc108ca23fd1e56
|
[] |
no_license
|
aur1m/gis
|
973449f25caf49e53d2b0b8f4700294abbe48ff1
|
63901f0c2f403ff7d0863c8acf5e51b73ae098ab
|
refs/heads/master
| 2016-08-05T05:04:08.489636 | 2012-11-27T11:38:08 | 2012-11-27T11:38:08 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 554 |
java
|
package net.bsuir.client.view;
import com.google.inject.Inject;
import net.bsuir.client.place.NameTokens;
import net.bsuir.client.presenter.InicioPresenter;
import net.bsuir.client.tools.Canvas;
import static net.bsuir.client.presenter.InicioPresenter.*;
public class InicioView extends AbstractAlgoritmView implements InicioPresenter.MyView {
@Inject
public InicioView(Binder binder) {
super(binder);
getCanvas().setAlgoritm(NameTokens.BREZENHEM);
}
public Canvas getCanvas(){
return super.canvas;
}
}
|
[
"[email protected]"
] | |
3ae3983342e3e407937725511353e8e3340e6033
|
e0ce65ca68416abe67d41f340e13d7d7dcec8e0f
|
/src/main/java/org/trypticon/luceneupgrader/lucene4/internal/lucene/codecs/StoredFieldsReader.java
|
3f089794c613868d88364eaff8b7e7788be5c499
|
[
"Apache-2.0"
] |
permissive
|
arandomgal/lucene-one-stop-index-upgrader
|
943264c22e6cadfef13116f41766f7d5fb2d3a7c
|
4c8b35dcda9e57f0507de48d8519e9c31cb8efb6
|
refs/heads/main
| 2023-06-07T04:18:20.805332 | 2021-07-05T22:28:46 | 2021-07-05T22:28:46 | 383,277,257 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 637 |
java
|
package org.trypticon.luceneupgrader.lucene4.internal.lucene.codecs;
import java.io.Closeable;
import java.io.IOException;
import org.trypticon.luceneupgrader.lucene4.internal.lucene.index.StoredFieldVisitor;
import org.trypticon.luceneupgrader.lucene4.internal.lucene.util.Accountable;
public abstract class StoredFieldsReader implements Cloneable, Closeable, Accountable {
protected StoredFieldsReader() {
}
public abstract void visitDocument(int n, StoredFieldVisitor visitor) throws IOException;
@Override
public abstract StoredFieldsReader clone();
public abstract void checkIntegrity() throws IOException;
}
|
[
"[email protected]"
] | |
beafb78ab3510b3bbfc591a21d9f2bd6d523b845
|
f22b63a349d874067dc2eef2b578e04b179fe9ba
|
/src/com/collection/SimpleIteration.java
|
c3a44b5f2bf7bb313a907d16d43e651248a25575
|
[] |
no_license
|
yaoOG/thinkInJava_test
|
67824b36c900132e3d253246d192f635b84f5124
|
a34bc7c76137cb3914e1f7a1ec380932e24927a5
|
refs/heads/master
| 2020-03-21T02:41:15.625120 | 2019-04-11T06:37:32 | 2019-04-11T06:37:32 | 138,012,011 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 729 |
java
|
package com.collection;
import typeinfo.pets.Pet;
import typeinfo.pets.Pets;
import java.util.Iterator;
import java.util.List;
public class SimpleIteration {
public static void main(String[] args) {
List<Pet> pets = Pets.arrayList(12);
Iterator<Pet> it = pets.iterator();
while(it.hasNext()){
Pet p = it.next();
System.out.print(p.id() + ":" + p + " ");
}
System.out.println();
for (Pet p :pets){
System.out.print(p.id() + ":" + p + " ");
}
System.out.println();
it=pets.iterator();
for (int i=0;i<6;i++){
it.next();
it.remove();
}
System.out.println(pets);
}
}
|
[
"[email protected]"
] | |
6c8704f49f14a3ddca96cd677d9c60347f463c7f
|
e76b4c69b90c46bbb7e111793bd849b8bd0fea16
|
/test/source/uniandes/cupi2/impuestosCarro/test/LineaTest.java
|
1883e9f2592639cff5e12a52331c8c50865f6f78
|
[] |
no_license
|
Manre/Calculo-Impuesto
|
118ecff8ca3b6dbc5a34437f89eae5cc7ee81048
|
bf9cc5cd8e9ddcf652bec5f667aee2b101805481
|
refs/heads/master
| 2020-06-03T09:15:10.977151 | 2015-03-29T22:11:30 | 2015-03-29T22:11:30 | 33,091,676 | 1 | 1 | null | null | null | null |
ISO-8859-1
|
Java
| false | false | 4,730 |
java
|
/**
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* $Id$
* Universidad de los Andes (Bogotá - Colombia)
* Departamento de Ingeniería de Sistemas y Computación
* Licenciado bajo el esquema Academic Free License version 2.1
*
* Proyecto Cupi2 (http://cupi2.uniandes.edu.co)
* Ejercicio: Impuestos de Carros
* Autor: Katalina Marcos.
* Modificación: Diana Puentes - Jun 23, 2005
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
package uniandes.cupi2.impuestosCarro.test;
import java.util.ArrayList;
import junit.framework.TestCase;
import uniandes.cupi2.impuestosCarro.mundo.Linea;
import uniandes.cupi2.impuestosCarro.mundo.Modelo;
/**
* Clase de prueba para la línea de un modelo
*/
public class LineaTest extends TestCase
{
//-----------------------------------------------------------------
// Atributos
//-----------------------------------------------------------------
/**
* Nombre de la línea
*/
private String nombre;
/**
* Línea del vehículo
*/
private Linea linea;
/**
* Modelo de vehículo 1
*/
private Modelo modelo1;
/**
* Modelo de vehículo 2
*/
private Modelo modelo2;
//-----------------------------------------------------------------
// Métodos
//-----------------------------------------------------------------
/**
* Escenario con una línea sin modelos
*/
private void setupEscenario1( )
{
nombre = "allegro";
linea = new Linea( nombre );
}
/**
* Escenario de una línea con dos modelos
*/
private void setupEscenario2( )
{
setupEscenario1( );
modelo1 = new Modelo( "2005", 43000000 );
modelo2 = new Modelo( "2004", 40000000 );
linea.adicionarModelo( modelo1 );
linea.adicionarModelo( modelo2 );
}
/**
* Prueba la obtención válida del nombre de la línea
*/
public void testDarNombre( )
{
//Configura el escenario de prueba
setupEscenario1( );
//Valida que el nombre sea el adecuado
assertEquals( nombre, linea.darNombre( ) );
}
/**
* Prueba la correcta adición de un modelo
*/
public void testAdicionarModelo( )
{
ArrayList modelos;
Modelo nuevoModelo;
int antes;
//Configura el escenario de prueba
setupEscenario2( );
//Prueba la correcta adición de modelos
modelos = linea.darModelos( );
antes = modelos.size( );
nuevoModelo = new Modelo( "2000", 30000000 );
linea.adicionarModelo( nuevoModelo );
assertEquals( antes + 1, modelos.size( ) );
assertEquals( nuevoModelo, modelos.get( antes ) );
}
/**
* Prueba la obtención de los modelos en una línea sin modelos
*/
public void testDarModelosVacio( )
{
ArrayList modelos;
//Configura el escenario de prueba
setupEscenario1( );
//Verifica que no hayan modelos
modelos = linea.darModelos( );
assertEquals( 0, modelos.size( ) );
}
/**
* Prueba la obtención de los modelos en una línea con modelos
*/
public void testDarModelos( )
{
ArrayList modelos;
Modelo unModelo;
//Configura el escenario de prueba
setupEscenario2( );
//Verifica que estén los modelos de prueba
modelos = linea.darModelos( );
assertEquals( 2, modelos.size( ) );
unModelo = ( Modelo )modelos.get( 0 );
assertEquals( modelo1, unModelo );
unModelo = ( Modelo )modelos.get( 1 );
assertEquals( modelo2, unModelo );
}
/**
* Prueba la búsqueda de un modelo que existe
*/
public void testBuscarModeloExiste( )
{
Modelo modeloEncontrado;
//Configura el escenario de prueba
setupEscenario2( );
//Verifica que se encuentre un modelo que está en la línea
modeloEncontrado = linea.buscarModelo( modelo1.darAnio( ) );
assertEquals( modelo1, modeloEncontrado );
}
/**
* Prueba la búsqueda de un modelo que no existe
*/
public void testBuscarModeloNoExiste( )
{
Modelo modeloEncontrado;
//Configura el escenario de prueba
setupEscenario1( );
//Verifica que no encuentre un modelo que no está en la línea
modeloEncontrado = linea.buscarModelo( "1800" );
assertNull( modeloEncontrado );
}
}
|
[
"[email protected]"
] | |
c417d8c08e220db8e02694e614d79f80a5392386
|
6e2bf0efc6dec0306ff304fa1ac779823b7fd056
|
/LogParser/src/com/citi/logparser/exception/FilterProcessFailedException.java
|
71876de4e79cd1c4ed10f42277085f10492cdfb7
|
[] |
no_license
|
vamsiprasanth/Morphline
|
6616b7449bc74ce7882212e125230d238fc66f7e
|
ee3a2c4d37fdb1d5a2d7cad937ffc14f2ed1209c
|
refs/heads/master
| 2018-12-28T10:22:07.464057 | 2016-02-27T11:15:22 | 2016-02-27T11:15:22 | 33,440,415 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 345 |
java
|
package com.citi.logparser.exception;
public class FilterProcessFailedException extends RuntimeException {
private static final long serialVersionUID = 1L;
public FilterProcessFailedException(String msg) {
super(msg);
}
public FilterProcessFailedException(String message, Throwable cause) {
super(message, cause);
}
}
|
[
"[email protected]"
] | |
b610de0f42a18e7afbf1c715f3b64969336538ca
|
1722e914ad4f72321b3a29580f08e754ec19b894
|
/crane001/src/main/java/com/hdmes/crane001/Food.java
|
6b62b8142ed69ea2456e769137e4358da1c45077
|
[] |
no_license
|
github001100/androidproj
|
d2585108aa8bfb2ba91937693db09d7fb6557e79
|
5cae6ec811aa4ff7d25426f855f10313d2f98530
|
refs/heads/master
| 2021-07-05T02:50:05.214708 | 2017-09-26T06:30:58 | 2017-09-26T06:30:58 | 103,715,236 | 0 | 0 | null | 2017-09-26T04:07:27 | 2017-09-16T01:29:18 |
Java
|
UTF-8
|
Java
| false | false | 1,176 |
java
|
package com.hdmes.crane001;
/**
* Created by Administrator on 2017/9/11 0011.
*/
import java.io.Serializable;
public class Food implements Serializable {
private int id;
private String name;
private String desc;
private String imgPath;
private byte imgData [];
/* 构造方法
public Food(int id, String name, String desc, String imgPath) {
super();
this.id = id;
this.name = name;
this.desc = desc;
this.imgPath = imgPath;
}*/
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getImgPath() {
return imgPath;
}
public void setImgPath(String imgPath) {
this.imgPath = imgPath;
}
public byte[] getImgData() {
return imgData;
}
public void setImgData(byte[] imgData) {
this.imgData = imgData;
}
}
|
[
"[email protected]"
] | |
df6391d6da9eb25118db6f7d8c133dcccf81eb67
|
06260d6ebdb82a830a7bc3c7e11c309042f5cffc
|
/src/OfficeHours/Practice_03_25_20/ClassNotes.java
|
c788c7255191f9ca38b7924bd1bcb497b4682b5d
|
[] |
no_license
|
wtedros/Spring2020B17_java
|
d13612e8e221d46f0695c966f76bed69ad4856ba
|
c9b67a7d6fb0a71c0c297a970a15f01dbac6ff34
|
refs/heads/master
| 2022-07-07T13:48:52.462564 | 2020-05-09T02:49:52 | 2020-05-09T02:49:52 | 262,474,805 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,602 |
java
|
package OfficeHours.Practice_03_25_20;
public class ClassNotes {
/*
03/25/2020
Practice Topics:
Explicit casting
If statement
Ternary
primtive castings: implicit & explicit castings
implicit casting: done automatically
smaller primitive types can ALWAYS be assigned to larger primitive types
explict casting: MUST be done manually
casting larger primitive types to smaller one
if statements: when we execute a code fragment under certain condition
single if statement: one condition, 1 option, one possiblity
if(Condition){
statementA;
}
statementA: execution depends on the condition
if-else statement: two conditions, 2 options ==> only one can be choosed
if(Condition){
statementA;
}else{ // otherwise
statementB;
}
only one of the blocks gets executed
statementA: gets executed if condition is true
statementB: gets executed if the condition is false
multi-branch if statement: 2+ options, or conditions
if(Condition1){
A;
}else if(Condition2){
B;
}else if(Condition3){
C;
}else{
D;
}
only one of the gets executed
A: if condition1 is true
B: if cindition1 is false, and condition 2 is true
C: if both condition1&2 false, and condition3 is true
D: if condition 1, 2, and 3 are false
nested if statement: when we have pre-condition, and precondition can be evaluate to multiple scenarios
if(Cindition){
if(Condition){
}
}
Friday will be all day reveiw:
Switch statement
Scanner
Teranry
*/
}
|
[
"[email protected]"
] | |
12f63a798c0e7978f6b15eaddadc7bec57f5566e
|
2a11122c803a61158d9ef5b9655ba6b8d61146bd
|
/flink-java-core/src/main/java/com/atguigu/flink/day3/RichFunctionExample.java
|
300384e2ecae625cb48fb3c5da28e5302c10d25a
|
[] |
no_license
|
houmingze/flink
|
738798f186f09d6aabaf0b436bae27b4cb4d2b81
|
93835f6abf3cfd634689c225d36c42c386fad000
|
refs/heads/master
| 2022-12-13T04:46:26.979839 | 2020-09-19T02:06:38 | 2020-09-19T02:06:38 | 294,018,202 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,209 |
java
|
package com.atguigu.flink.day3;
import org.apache.flink.api.common.functions.RichMapFunction;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
/**
* @author :hmz
* @date :Created in 2020/9/12 11:45
*/
public class RichFunctionExample {
public static void main(String[] args) throws Exception{
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(1);
env.fromElements(1,2,3,4)
.map(new RichMapFunction<Integer, Integer>() {
@Override
public void open(Configuration parameters) throws Exception {
System.out.println("open");
}
@Override
public Integer map(Integer value) throws Exception {
return value+1;
}
@Override
public void close() throws Exception {
System.out.println("close");
}
})
.print();
env.execute();
}
}
|
[
"[email protected]"
] | |
61f4bfd36c65ffa21f9683364d713f6bd86df83d
|
e00a0c7af9b02b819dba19fd2916e163868cfc3c
|
/src/main/java/com/mycompany/domain/shop/Breadcrumb.java
|
089e6fb2bb4caf45f1e984a6aed0314389391dec
|
[] |
no_license
|
silentcharacter/jooby-app
|
2d595ca3d76c8b8bb22a95e40d0e98defad1210e
|
f480a0cdd00b3d5bddb9b564077e95a7bf5071e5
|
refs/heads/master
| 2020-04-07T05:29:03.415236 | 2019-02-17T15:33:03 | 2019-02-17T15:33:03 | 48,643,970 | 3 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 267 |
java
|
package com.mycompany.domain.shop;
public class Breadcrumb
{
public Breadcrumb(boolean current, String link, String name)
{
this.current = current;
this.link = link;
this.name = name;
}
public boolean current;
public String link;
public String name;
}
|
[
"[email protected]"
] | |
d0a5857a9ead84d80ef645d7ace2a1ffd6366beb
|
69ddb1f5b9d139bc3bc0ccb24042e0d20c04900a
|
/src/main/java/com/bazarnazar/pgjson/JsonMapType.java
|
0df06a6b4733f2d592d3bb75409e8fc06e492515
|
[] |
no_license
|
fatalliska/pgjson
|
cd7a71d86918dadc48365177db3040786f10eb79
|
448d6ec170813a9d7761e9467a93d52c6bc748bf
|
refs/heads/master
| 2021-11-22T15:49:11.627565 | 2014-10-09T09:25:59 | 2014-10-09T09:25:59 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 209 |
java
|
package com.bazarnazar.pgjson;
/**
* Created by Bazar on 27.08.14.
*/
public class JsonMapType extends PGJsonObject {
@Override
public Class returnedClass() {
return Object.class;
}
}
|
[
"[email protected]"
] | |
bdd8dabed8889bbc0c59a8a9cb0bb6b57a088ec4
|
8f7660f6f5ff807f6d8e57f469e6a40a2d192e75
|
/app/src/test/java/mg/activities/ExampleUnitTest.java
|
9f3ea7c5d0aa794d4afe13b4f07927c6da3e7f1d
|
[] |
no_license
|
mangesh32/Activities
|
6654fa51f9ec48fc73bc6f5e3af76ce8e713f70d
|
edd52e94563ca941ed64bc2b18789df4ece5d05e
|
refs/heads/master
| 2020-03-22T02:01:29.418053 | 2018-07-04T04:02:12 | 2018-07-04T04:02:12 | 139,344,861 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 374 |
java
|
package mg.activities;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
064569a23acf0c6c8e089e80aec139fbae944fd6
|
89ab8b35168a9a80d20cd7147dfbda6b4802a405
|
/ph-schematron-pure/src/test/java/com/helger/schematron/pure/bound/xpath/PSXPathBoundSchemaTest.java
|
3baafeeea6f479580426f97447a54b4b71c6e6f1
|
[
"Apache-2.0"
] |
permissive
|
jdrew1303/ph-schematron
|
cf778f57c2cc4a810aeed05b2493e309357ddfe6
|
bc16df7e3e14390b00c2706a6fc3c51bbfbdca6f
|
refs/heads/master
| 2023-09-05T10:32:00.656740 | 2021-11-19T12:32:55 | 2021-11-19T12:32:55 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 6,058 |
java
|
/*
* Copyright (C) 2014-2021 Philip Helger (www.helger.com)
* philip[at]helger[dot]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.helger.schematron.pure.bound.xpath;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.helger.commons.error.level.EErrorLevel;
import com.helger.commons.io.resource.ClassPathResource;
import com.helger.commons.io.resource.IReadableResource;
import com.helger.commons.junit.DebugModeTestRule;
import com.helger.commons.mock.CommonsTestHelper;
import com.helger.schematron.SchematronException;
import com.helger.schematron.SchematronHelper;
import com.helger.schematron.pure.binding.xpath.PSXPathQueryBinding;
import com.helger.schematron.pure.bound.IPSBoundSchema;
import com.helger.schematron.pure.errorhandler.CollectingPSErrorHandler;
import com.helger.schematron.pure.errorhandler.LoggingPSErrorHandler;
import com.helger.schematron.pure.exchange.PSReader;
import com.helger.schematron.pure.model.PSSchema;
import com.helger.schematron.pure.preprocess.PSPreprocessor;
import com.helger.schematron.svrl.SVRLMarshaller;
import com.helger.schematron.svrl.jaxb.SchematronOutputType;
import com.helger.schematron.testfiles.SchematronTestHelper;
import com.helger.xml.microdom.IMicroDocument;
import com.helger.xml.serialize.read.DOMReader;
/**
* Test class for class {@link PSPreprocessor}.
*
* @author Philip Helger
*/
public final class PSXPathBoundSchemaTest
{
private static final Logger LOGGER = LoggerFactory.getLogger (PSXPathBoundSchemaTest.class);
@Rule
public final TestRule m_aRule = new DebugModeTestRule ();
private static final String [] SCH = new String [] { "valid01.sch",
"valid02.sch",
"biicore/BIICORE-UBL-T01.sch",
"biirules/BIIRULES-UBL-T01.sch",
"CellarBook.sch",
"VariableTests.sch" };
private static final String [] XML = new String [] { "valid01.xml",
"valid01.xml",
"goodOrder01.xml",
"goodOrder01.xml",
"CellarBook.xml",
"valid01.xml" };
@Test
public void testSchematronValidation () throws SchematronException
{
for (int i = 0; i < SCH.length; ++i)
{
final IReadableResource aSchRes = new ClassPathResource ("test-sch/" + SCH[i]);
final IReadableResource aXmlRes = new ClassPathResource ("test-xml/" + XML[i]);
// Resolve all includes
final IMicroDocument aDoc = SchematronHelper.getWithResolvedSchematronIncludes (aSchRes, new LoggingPSErrorHandler ());
assertNotNull (aDoc);
// Read to domain object
final PSReader aReader = new PSReader (aSchRes);
final PSSchema aSchema = aReader.readSchemaFromXML (aDoc.getDocumentElement ());
assertNotNull (aSchema);
// Create a compiled schema
final IPSBoundSchema aBoundSchema = PSXPathQueryBinding.getInstance ().bind (aSchema);
// Validate completely
final SchematronOutputType aSVRL = aBoundSchema.validateComplete (DOMReader.readXMLDOM (aXmlRes),
aXmlRes.getAsURL ().toExternalForm ());
assertNotNull (aSVRL);
if (false)
LOGGER.info (new SVRLMarshaller ().getAsString (aSVRL));
}
}
@Test
public void testBindAllValidSchematrons () throws SchematronException
{
for (final IReadableResource aRes : SchematronTestHelper.getAllValidSchematronFiles ())
{
if (true)
LOGGER.info ("Binding " + aRes.getPath ());
// Parse the schema
final PSSchema aSchema = new PSReader (aRes).readSchema ();
assertNotNull (aSchema);
CommonsTestHelper.testToStringImplementation (aSchema);
final CollectingPSErrorHandler aErrHdl = new CollectingPSErrorHandler ();
if (!aSchema.isValid (aErrHdl))
fail (aRes.getPath () + " - " + aErrHdl.getAllErrors ());
assertTrue (aRes.getPath () + " - " + aErrHdl.getAllErrors (), aErrHdl.isEmpty ());
// Create a compiled schema
final IPSBoundSchema aBoundSchema = PSXPathQueryBinding.getInstance ().bind (aSchema);
assertNotNull (aBoundSchema);
}
}
@Test
public void testBindAllInvalidSchematrons ()
{
for (final IReadableResource aRes : SchematronTestHelper.getAllInvalidSchematronFiles ())
{
LOGGER.info (aRes.toString ());
try
{
// Parse the schema
final PSSchema aSchema = new PSReader (aRes).readSchema ();
final CollectingPSErrorHandler aCEH = new CollectingPSErrorHandler ();
PSXPathQueryBinding.getInstance ().bind (aSchema, null, aCEH, null, null);
// Either an ERROR was collected or an exception was thrown
assertTrue (aCEH.getErrorList ().getMostSevereErrorLevel ().isGE (EErrorLevel.ERROR));
}
catch (final SchematronException ex)
{
LOGGER.error (" " + ex.getMessage ());
}
}
}
}
|
[
"[email protected]"
] | |
473116a32e4da0debf5f13b2cfdd54cdffc03b0b
|
2a60f8bdcfeeab25bab0aa7b6d94827e71d092a9
|
/GRUPO 21/CLASE06/clase04maven/src/main/java/co/edu/utp/misiontic2022/c2/Nota.java
|
ef53488de0157692de462722e7ef98f228501cae
|
[] |
no_license
|
danielinsuasti/EjerciciosMisionTic2022Ciclo2
|
0e81ead6354ded00dc1272bfd4d775a93bfde4d2
|
584caffd050ced99a704fa93beb8a0c7c17f0513
|
refs/heads/master
| 2023-07-13T15:03:45.555674 | 2021-08-19T02:04:42 | 2021-08-19T02:04:42 | 383,004,071 | 1 | 6 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,145 |
java
|
package co.edu.utp.misiontic2022.c2;
public class Nota {
//1)Atributos, variables que antes estaban sueltas
private int escala100;
private double escala5;
private String cualitativa;
private String nombre; //Evaluación, taller, o reto correspondiente
//private static final int NUMERO_NOTAS = 5;
//2)Constructores o Metodos constructores:
Nota(){
this.escala100 = 0;
this.escala5 =0;
this.cualitativa = "";
}
Nota(int pEscala100){
this.escala100 = pEscala100;
this.escala5 = (double)pEscala100 /20;
if(pEscala100 >=60){
this.cualitativa = "Aprobado";
} else{
this.cualitativa = "Reprobado";
}
}
Nota(double pEscala5){
this.escala5 =pEscala5;
this.escala100 = (int)pEscala5*20;
if(pEscala5 >=2.95){
this.cualitativa = "Aprobado";
}else{
this.cualitativa= "Reprobado";
}
}
Nota(double pEscala5, int pEscala100, String pCualitativo){
this.escala100 = pEscala100;
this.escala5 = pEscala5;
this.cualitativa = pCualitativo;
}
//3) Metodos -> Comportamiento que quiero que tenga la clase
//Forma especifica de mostrar información
public void mostrarNotasConsola(){
System.out.println("----------InfoNota--------");
System.out.println("Valor Escala 5 -> " + this.escala5);
System.out.println("Valor Escala 100 -> " +this.escala100);
System.out.println("Valor Escala Cualitativa -> " +this.cualitativa);
}
//4) Getters
public String getCualitativa(){
return cualitativa;
}
public int getEscala100(){
return escala100;
}
public double getEscala5(){
return escala5;
}
//5) Setters
public void setCualitativa(String nuevaCualitativa){
this.cualitativa = nuevaCualitativa;
}
public void setEscala100(int nuevaEscala100){
this.escala100 = nuevaEscala100;
}
public void setEscala5(double nuevaEscala5){
this.escala5 = nuevaEscala5;
}
}
|
[
"[email protected]"
] | |
1b7670b04a7a0bda7fe9fcd3d3ab8ceaa38fc36c
|
55093077d85adafdb08df6c250c45db7a24c410c
|
/spring-demo-one/src/springdemo/Coach.java
|
99372f6adec5ee7940e40ace8abeb5d4e5ed8dc5
|
[] |
no_license
|
mati167/spring
|
120116f292e1a800f25bac3d2139dfe197562614
|
95a272722c2e9edaaa53e53656e8847333535bcb
|
refs/heads/master
| 2020-12-02T09:25:05.872917 | 2019-12-30T18:26:20 | 2019-12-30T18:26:20 | 230,961,470 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 85 |
java
|
package springdemo;
public interface Coach {
public String getDailyWorkout();
}
|
[
"[email protected]"
] | |
78806941fec457810995c1a1a8968f43c65b116c
|
c22fefaa981676735e219cce91ffd1212e87c0f6
|
/v16-temp/springboot-solr/src/test/java/com/cm/springbootsolr/SpringbootSolrApplicationTests.java
|
c6bf24ab5ca6968d7cb6d0c5ad6060fe8d8ab0e5
|
[] |
no_license
|
1984997289/v162
|
d86d339b136d239d43f9084a672a05f496c08d37
|
8c320a8755e7a18e5b460ae4a38a4554763a0ec0
|
refs/heads/master
| 2022-07-08T08:29:08.494275 | 2019-08-17T03:25:34 | 2019-08-17T03:25:34 | 202,557,097 | 2 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,944 |
java
|
package com.cm.springbootsolr;
import com.cm.v16.api.IProductService;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.SolrInputDocument;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.IOException;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SpringbootSolrApplicationTests {
/*@Autowired
private IProductService productService;*/
@Autowired
private SolrClient client;
@Test
public void addOrUpdate() throws IOException, SolrServerException{
SolrInputDocument document=new SolrInputDocument();
document.setField("id","01");
document.setField("product_name","华为");
document.setField("product_price","3999");
document.setField("product_sale_point","通话时长");
document.setField("product_images","aaa");
client.add(document);
client.commit();
}
@Test
public void query() throws IOException, SolrServerException{
SolrQuery query=new SolrQuery();
query.setQuery("product_price:华为");
QueryResponse response=client.query(query);
SolrDocumentList results=response.getResults();
long numFound=results.getNumFound();
System.out.println("numFound:"+numFound);
for(SolrDocument result : results){
System.out.println("product_name::"+result.get("product_name"));
System.out.println("product_price::"+result.get("product_price"));
}
}
@Test
public void delete() throws IOException, SolrServerException{
client.deleteByQuery("product_name:华为");
client.commit();
}
}
|
[
"[email protected]"
] | |
1f02629685976ee357af23402eba742319991306
|
a64022f501a04536401018dfad9b009b33cdcfee
|
/src/custom/objects/dimensions1/UnitVector.java
|
758d4ec736a4b7e3114de7adb6adf76522ef4ed4
|
[] |
no_license
|
genis1/MultiphysicTFG
|
81ecbfa56f24bcee938d26c0d14e38767dca1f03
|
e2d37058581a4d223efe692331ecc48e3aa75323
|
refs/heads/master
| 2022-12-09T17:48:06.154232 | 2020-09-21T08:30:10 | 2020-09-21T08:30:10 | 288,705,351 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 208 |
java
|
package custom.objects.dimensions1;
public class UnitVector extends Vector {
UnitVector(Vector vector) {
super(vector.getXCoordinate(), vector.getYCoordinate(), vector.getZCoordinate());
}
}
|
[
"[email protected]"
] | |
2571505b80defa0e413d9c8fe44883263e81a3a7
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_53cb0d44f137c6dcb137b602061c6a290cd28813/BaseXServer/2_53cb0d44f137c6dcb137b602061c6a290cd28813_BaseXServer_t.java
|
6d4b70955e0b049ab757d8ae31473fda6208a073
|
[] |
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 | 9,293 |
java
|
package org.basex;
import static org.basex.Text.*;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.BindException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import org.basex.core.ClientProcess;
import org.basex.core.CommandParser;
import org.basex.core.Context;
import org.basex.core.Process;
import org.basex.core.Prop;
import org.basex.core.proc.Exit;
import org.basex.core.proc.GetInfo;
import org.basex.core.proc.GetResult;
import org.basex.io.BufferedOutput;
import org.basex.io.PrintOutput;
import org.basex.query.QueryException;
import org.basex.util.Performance;
import org.basex.util.Token;
/**
* This is the starter class for the database server.
* It handles incoming requests and offers some simple threading to
* allow simultaneous database requests.
* Add the '-h' option to get a list on all available command-line arguments.
*
* @author Workgroup DBIS, University of Konstanz 2005-09, ISC License
* @author Christian Gruen
*/
public final class BaseXServer {
/** Database Context. */
final Context context = new Context();
/** Flag for server activity. */
boolean running = true;
/** Verbose mode. */
boolean verbose;
/** Current client connections. */
final ArrayList<BaseXSession> sess = new ArrayList<BaseXSession>();
/**
* Main method, launching the server process.
* Command-line arguments can be listed with the <code>-h</code> argument.
* @param args command line arguments
*/
public static void main(final String[] args) {
new BaseXServer(args);
}
/**
* The server calls this constructor to listen on the given port for incoming
* connections. Protocol version handshake is performed when the connection
* is established. This constructor blocks until a client connects.
* @param args arguments
*/
public BaseXServer(final String... args) {
Prop.server = true;
if(!parseArguments(args)) return;
// guarantee correct shutdown...
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
// interrupt running processes
for(final BaseXSession ss : sess) ss.core.stop();
Prop.write();
context.close();
}
});
// this thread cleans the process stack
new Thread() {
@Override
public void run() {
while(running) {
Performance.sleep(1000);
clean();
}
}
}.start();
try {
final ServerSocket server = new ServerSocket(Prop.port);
BaseX.outln(SERVERSTART);
while(running) serve(server);
context.close();
} catch(final Exception ex) {
BaseX.debug(ex);
if(ex instanceof BindException) {
BaseX.errln(SERVERBIND);
} else if(ex instanceof IOException) {
BaseX.errln(SERVERERR);
} else {
BaseX.errln(ex.getMessage());
}
}
}
/**
* Waits for a network request and evaluates the input.
* @param server server reference
*/
private void serve(final ServerSocket server) {
try {
// get socket and ip address
final Socket s = server.accept();
final Performance perf = new Performance();
// get command and arguments
final DataInputStream dis = new DataInputStream(s.getInputStream());
final String in = dis.readUTF().trim();
final InetAddress addr = s.getInetAddress();
final String ha = addr.getHostAddress();
final int sp = s.getPort();
if(verbose) BaseX.outln("[%:%] %", ha, sp, in);
Process pr = null;
try {
pr = new CommandParser(in).parse()[0];
} catch(final QueryException ex) {
pr = new Process(0) { };
pr.error(ex.extended());
add(new BaseXSession(sp, System.nanoTime(), pr));
send(s, -sp);
return;
}
if(pr instanceof Exit) {
send(s, 1);
running = false;
return;
}
// start session thread
final Process proc = pr;
new Thread() {
@Override
public void run() {
try {
if(proc instanceof GetResult || proc instanceof GetInfo) {
final OutputStream os = s.getOutputStream();
final PrintOutput out = new PrintOutput(new BufferedOutput(os));
final int id = Math.abs(Integer.parseInt(proc.args().trim()));
final Process c = get(id);
if(c == null) {
out.print(BaseX.info(SERVERTIME, Prop.timeout));
} else if(proc instanceof GetResult) {
// the client requests result of the last process
c.output(out);
} else if(proc instanceof GetInfo) {
// the client requests information about the last process
c.info(out);
}
out.close();
} else {
// process a normal request
add(new BaseXSession(sp, System.nanoTime(), proc));
// execute command and return process id (negative: error)
send(s, proc.execute(context) ? sp : -sp);
}
dis.close();
} catch(final Exception ex) {
if(ex instanceof IOException) BaseX.errln(SERVERERR);
ex.printStackTrace();
}
if(verbose) BaseX.outln("[%:%] %", ha, sp, perf.getTimer());
}
}.start();
} catch(final Exception ex) {
if(ex instanceof IOException) BaseX.errln(SERVERERR);
ex.printStackTrace();
}
}
/**
* Caches a user connection and removes out-of-dated entries.
* @param bs session to be added
*/
synchronized void add(final BaseXSession bs) {
clean();
sess.add(bs);
}
/**
* Removes obsolete or too slow processes.
*/
synchronized void clean() {
final long t = System.nanoTime();
for(int i = 0; i < sess.size(); i++) {
if(t - sess.get(i).time > Prop.timeout * 1000000000L) {
final BaseXSession s = sess.remove(sess.size() - 1);
if(i != sess.size()) sess.set(i--, s);
s.stop();
}
}
}
/**
* Returns an answer to the client.
* @param s socket reference
* @param id session id to be returned
* @throws IOException I/O exception
*/
synchronized void send(final Socket s, final int id) throws IOException {
final DataOutputStream dos = new DataOutputStream(s.getOutputStream());
dos.writeInt(id);
dos.close();
}
/**
* Returns the correct client session.
* @param id process id
* @return core reference
*/
synchronized Process get(final int id) {
for(final BaseXSession s : sess) if(s != null && s.pid == id) return s.core;
return null;
}
/**
* Parses the command line arguments.
* @param args the command line arguments
* @return true if all arguments have been correctly parsed
*/
private boolean parseArguments(final String[] args) {
boolean ok = true;
// loop through all arguments
for(int a = 0; a < args.length; a++) {
ok = false;
if(args[a].startsWith("-")) {
for(int i = 1; i < args[a].length(); i++) {
final char c = args[a].charAt(i);
if(c == 'p') {
// parse server port
if(++i == args[a].length()) {
a++;
i = 0;
}
if(a == args.length) break;
final int p = Token.toInt(args[a].substring(i));
if(p <= 0) {
BaseX.errln(SERVERPORT + args[a].substring(i));
break;
}
Prop.port = p;
i = args[a].length();
ok = true;
} else if(c == 'd') {
Prop.debug = true;
ok = true;
} else if(c == 'v') {
verbose = true;
ok = true;
} else {
break;
}
}
} else if(args[a].equals("stop")) {
try {
// run new process, sending the stop command
new ClientProcess("localhost", Prop.port, new Exit()).execute(null);
BaseX.outln(SERVERSTOPPED);
} catch(final Exception ex) {
if(ex instanceof IOException) BaseX.errln(SERVERERR);
else BaseX.errln(ex.getMessage());
BaseX.debug(ex);
}
return false;
}
if(!ok) break;
}
if(!ok) BaseX.errln(SERVERINFO);
return ok;
}
/** Simple session class. */
class BaseXSession {
/** Process id. */
int pid;
/** Timer. */
long time;
/** Process. */
Process core;
/**
* Constructor.
* @param i process id
* @param t timer
* @param c process
*/
BaseXSession(final int i, final long t, final Process c) {
pid = i;
time = t;
core = c;
}
/**
* Stops a process.
*/
void stop() {
core.stop();
}
}
}
|
[
"[email protected]"
] | |
8e2697c8cb2ce0aa7bdcac510465fbf77d9f65c4
|
20a33f5fdbc6152f4cec1cbccde814220ce6f2c4
|
/build/app/generated/not_namespaced_r_class_sources/debug/r/androidx/slidingpanelayout/R.java
|
6a6c2067edfe7629c89873bc8a95a52d50c1d1b2
|
[] |
no_license
|
onuohasilver/weatherAppX
|
a48420ac38e55446aea0ac16795c6d123c3e2bfe
|
8ad0aedbed708a0ee16f7c292a2fe71049a05978
|
refs/heads/master
| 2022-04-21T11:52:43.265615 | 2020-04-20T19:03:24 | 2020-04-20T19:03:24 | 257,181,894 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 10,457 |
java
|
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package androidx.slidingpanelayout;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f020027;
public static final int font = 0x7f020076;
public static final int fontProviderAuthority = 0x7f020078;
public static final int fontProviderCerts = 0x7f020079;
public static final int fontProviderFetchStrategy = 0x7f02007a;
public static final int fontProviderFetchTimeout = 0x7f02007b;
public static final int fontProviderPackage = 0x7f02007c;
public static final int fontProviderQuery = 0x7f02007d;
public static final int fontStyle = 0x7f02007e;
public static final int fontVariationSettings = 0x7f02007f;
public static final int fontWeight = 0x7f020080;
public static final int ttcIndex = 0x7f020109;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f040047;
public static final int notification_icon_bg_color = 0x7f040048;
public static final int ripple_material_light = 0x7f040053;
public static final int secondary_text_default_material_light = 0x7f040055;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f05004b;
public static final int compat_button_inset_vertical_material = 0x7f05004c;
public static final int compat_button_padding_horizontal_material = 0x7f05004d;
public static final int compat_button_padding_vertical_material = 0x7f05004e;
public static final int compat_control_corner_material = 0x7f05004f;
public static final int compat_notification_large_icon_max_height = 0x7f050050;
public static final int compat_notification_large_icon_max_width = 0x7f050051;
public static final int notification_action_icon_size = 0x7f05005b;
public static final int notification_action_text_size = 0x7f05005c;
public static final int notification_big_circle_margin = 0x7f05005d;
public static final int notification_content_margin_start = 0x7f05005e;
public static final int notification_large_icon_height = 0x7f05005f;
public static final int notification_large_icon_width = 0x7f050060;
public static final int notification_main_column_padding_top = 0x7f050061;
public static final int notification_media_narrow_margin = 0x7f050062;
public static final int notification_right_icon_size = 0x7f050063;
public static final int notification_right_side_padding_top = 0x7f050064;
public static final int notification_small_icon_background_padding = 0x7f050065;
public static final int notification_small_icon_size_as_large = 0x7f050066;
public static final int notification_subtext_size = 0x7f050067;
public static final int notification_top_pad = 0x7f050068;
public static final int notification_top_pad_large_text = 0x7f050069;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f06006b;
public static final int notification_bg = 0x7f06006c;
public static final int notification_bg_low = 0x7f06006d;
public static final int notification_bg_low_normal = 0x7f06006e;
public static final int notification_bg_low_pressed = 0x7f06006f;
public static final int notification_bg_normal = 0x7f060070;
public static final int notification_bg_normal_pressed = 0x7f060071;
public static final int notification_icon_background = 0x7f060072;
public static final int notification_template_icon_bg = 0x7f060073;
public static final int notification_template_icon_low_bg = 0x7f060074;
public static final int notification_tile_bg = 0x7f060075;
public static final int notify_panel_notification_icon_bg = 0x7f060076;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f07000e;
public static final int action_divider = 0x7f070010;
public static final int action_image = 0x7f070011;
public static final int action_text = 0x7f070017;
public static final int actions = 0x7f070018;
public static final int async = 0x7f070020;
public static final int blocking = 0x7f070023;
public static final int chronometer = 0x7f07002b;
public static final int forever = 0x7f07003f;
public static final int icon = 0x7f070043;
public static final int icon_group = 0x7f070044;
public static final int info = 0x7f070048;
public static final int italic = 0x7f070049;
public static final int line1 = 0x7f07004c;
public static final int line3 = 0x7f07004d;
public static final int normal = 0x7f070056;
public static final int notification_background = 0x7f070057;
public static final int notification_main_column = 0x7f070058;
public static final int notification_main_column_container = 0x7f070059;
public static final int right_icon = 0x7f07005f;
public static final int right_side = 0x7f070060;
public static final int tag_transition_group = 0x7f07007f;
public static final int tag_unhandled_key_event_manager = 0x7f070080;
public static final int tag_unhandled_key_listeners = 0x7f070081;
public static final int text = 0x7f070082;
public static final int text2 = 0x7f070083;
public static final int time = 0x7f070086;
public static final int title = 0x7f070087;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f080005;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f09001c;
public static final int notification_action_tombstone = 0x7f09001d;
public static final int notification_template_custom_big = 0x7f090024;
public static final int notification_template_icon_group = 0x7f090025;
public static final int notification_template_part_chronometer = 0x7f090029;
public static final int notification_template_part_time = 0x7f09002a;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0b003a;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0c00ec;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00ed;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00ef;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0c00f2;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0c00f4;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0c015d;
public static final int Widget_Compat_NotificationActionText = 0x7f0c015e;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f020078, 0x7f020079, 0x7f02007a, 0x7f02007b, 0x7f02007c, 0x7f02007d };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f020076, 0x7f02007e, 0x7f02007f, 0x7f020080, 0x7f020109 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
|
[
"[email protected]"
] | |
ec0f8870721a10725f4ced536413c5725feab0c1
|
b248dbfa819a51c2471d63ced2bdbd2b8c9d14b1
|
/app/src/main/java/org/andstatus/app/timeline/LoadableListActivity.java
|
9fa1ef0cfa17eb0c4e0167aa0e8891a1edf5fdab
|
[
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] |
permissive
|
dengzhicheng092/andstatus
|
e14c269534a94e1a8786bc7662390f706471c245
|
a8b709cf094ae58eacc83af2d6eb9c3128a1eb99
|
refs/heads/master
| 2022-10-22T14:04:27.736579 | 2020-06-18T07:50:43 | 2020-06-18T07:50:43 | 273,149,945 | 0 | 0 |
Apache-2.0
| 2020-06-18T05:31:27 | 2020-06-18T05:31:27 | null |
UTF-8
|
Java
| false | false | 21,113 |
java
|
/*
* Copyright (c) 2016 yvolk (Yuri Volkov), http://yurivolkov.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.andstatus.app.timeline;
import android.net.Uri;
import android.os.AsyncTask.Status;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import net.jcip.annotations.GuardedBy;
import org.andstatus.app.IntentExtra;
import org.andstatus.app.R;
import org.andstatus.app.context.MyContext;
import org.andstatus.app.data.ParsedUri;
import org.andstatus.app.list.MyBaseListActivity;
import org.andstatus.app.list.SyncLoader;
import org.andstatus.app.os.AsyncTaskLauncher;
import org.andstatus.app.os.MyAsyncTask;
import org.andstatus.app.service.CommandData;
import org.andstatus.app.service.MyServiceEvent;
import org.andstatus.app.service.MyServiceEventsListener;
import org.andstatus.app.service.MyServiceEventsReceiver;
import org.andstatus.app.service.MyServiceManager;
import org.andstatus.app.util.BundleUtils;
import org.andstatus.app.util.MyLog;
import org.andstatus.app.util.MyStringBuilder;
import org.andstatus.app.util.RelativeTime;
import org.andstatus.app.util.StringUtil;
import org.andstatus.app.util.TriState;
import org.andstatus.app.widget.MySearchView;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import static org.andstatus.app.context.MyContextHolder.myContextHolder;
/**
* List, loaded asynchronously. Updated by MyService
*
* @author [email protected]
*/
public abstract class LoadableListActivity<T extends ViewItem<T>> extends MyBaseListActivity implements MyServiceEventsListener {
protected boolean showSyncIndicatorSetting = true;
protected View textualSyncIndicator = null;
protected CharSequence syncingText = "";
protected CharSequence loadingText = "";
private boolean onRefreshHandled = false;
private ParsedUri parsedUri = ParsedUri.fromUri(Uri.EMPTY);
protected MyContext myContext = myContextHolder.getNow();
private long configChangeTime = 0;
MyServiceEventsReceiver myServiceReceiver;
private final Object loaderLock = new Object();
@GuardedBy("loaderLock")
private AsyncLoader mCompletedLoader = new AsyncLoader();
@GuardedBy("loaderLock")
private AsyncLoader mWorkingLoader = mCompletedLoader;
@GuardedBy("loaderLock")
private boolean loaderIsWorking = false;
long lastLoadedAt = 0;
protected final AtomicLong refreshNeededSince = new AtomicLong(0);
protected final AtomicBoolean refreshNeededAfterForegroundCommand = new AtomicBoolean(false);
private static final long NO_AUTO_REFRESH_AFTER_LOAD_SECONDS = 5;
protected CharSequence mSubtitle = "";
/**
* Id of current list item, which is sort of a "center" of the list view
*/
protected long centralItemId = 0;
protected MySearchView searchView = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
myContext = myContextHolder.getNow();
super.onCreate(savedInstanceState);
if (restartMeIfNeeded()) return;
textualSyncIndicator = findViewById(R.id.sync_indicator);
configChangeTime = myContext.preferencesChangeTime();
if (MyLog.isDebugEnabled()) {
MyLog.d(this, "onCreate, config changed " + RelativeTime.secondsAgo(configChangeTime) + " seconds ago"
+ (myContextHolder.getNow().isReady() ? "" : ", MyContext is not ready")
);
}
if (myContext.isReady()) {
MyServiceManager.setServiceAvailable();
}
myServiceReceiver = new MyServiceEventsReceiver(myContext, this);
parsedUri = ParsedUri.fromIntent(getIntent());
centralItemId = getParsedUri().getItemId();
}
protected ParsedUri getParsedUri() {
return parsedUri;
}
@NonNull
public TimelineData<T> getListData() {
return getListAdapter().getListData();
}
public void showList(WhichPage whichPage) {
showList(whichPage.toBundle());
}
protected void showList(Bundle args) {
WhichPage whichPage = WhichPage.load(args);
TriState chainedRequest = TriState.fromBundle(args, IntentExtra.CHAINED_REQUEST);
StringBuilder msgLog = new StringBuilder("showList" + (chainedRequest == TriState.TRUE ? ", chained" : "")
+ ", " + whichPage + " page"
+ (centralItemId == 0 ? "" : ", center:" + centralItemId));
if (whichPage == WhichPage.EMPTY) {
MyLog.v(this, () -> "Ignored Empty page request: " + msgLog);
} else {
MyLog.v(this, () -> "Started " + msgLog);
synchronized (loaderLock) {
if (isLoading() && chainedRequest != TriState.TRUE) {
msgLog.append(", Ignored " + mWorkingLoader);
} else {
AsyncLoader newLoader = new AsyncLoader(instanceTag());
if (new AsyncTaskLauncher<Bundle>().execute(this, newLoader, args).isSuccess()) {
mWorkingLoader = newLoader;
loaderIsWorking = true;
refreshNeededSince.set(0);
refreshNeededAfterForegroundCommand.set(false);
msgLog.append(", Launched");
} else {
msgLog.append(", Couldn't launch");
}
}
}
MyLog.v(this, "Ended " + msgLog);
}
}
public boolean isLoading() {
boolean reset = false;
synchronized (loaderLock) {
if (loaderIsWorking && mWorkingLoader.getStatus() == Status.FINISHED) {
reset = true;
loaderIsWorking = false;
}
}
if (reset) {
MyLog.d(this, "WorkingLoader finished but didn't reset loaderIsWorking flag "
+ mWorkingLoader);
}
return loaderIsWorking;
}
protected boolean isContextNeedsUpdate() {
MyContext myContextNew = myContextHolder.getNow();
return !this.myContext.isReady() || this.myContext != myContextNew || configChangeTime != myContextNew.preferencesChangeTime();
}
/** @return selectedItem or EmptyViewItem */
@NonNull
public ViewItem saveContextOfSelectedItem(View v) {
int position = getListAdapter().getPosition(v);
setPositionOfContextMenu(position);
if (position >= 0) {
Object viewItem = getListAdapter().getItem(position);
if (viewItem != null) {
if (ViewItem.class.isAssignableFrom(viewItem.getClass())) {
return (ViewItem) viewItem;
} else {
MyLog.i(this, "Unexpected type of selected item: " + viewItem.getClass() + ", " + viewItem);
}
}
}
return EmptyViewItem.EMPTY;
}
public MyContext getMyContext() {
return myContext;
}
public LoadableListActivity getActivity() {
return this;
}
public interface ProgressPublisher {
void publish(String progress);
}
/** Called not in UI thread */
protected abstract SyncLoader<T> newSyncLoader(Bundle args);
private class AsyncLoader extends MyAsyncTask<Bundle, String, SyncLoader> implements LoadableListActivity.ProgressPublisher {
private SyncLoader mSyncLoader = null;
public AsyncLoader(String taskId) {
super(taskId, PoolEnum.LONG_UI);
}
public AsyncLoader() {
super(PoolEnum.LONG_UI);
}
SyncLoader getSyncLoader() {
return mSyncLoader == null ? newSyncLoader(null) : mSyncLoader;
}
@Override
protected SyncLoader doInBackground2(Bundle bundle) {
publishProgress("...");
SyncLoader loader = newSyncLoader(BundleUtils.toBundle(bundle, IntentExtra.INSTANCE_ID.key, instanceId));
loader.allowLoadingFromInternet();
loader.load(this);
return loader;
}
@Override
public void publish(String progress) {
publishProgress(progress);
}
@Override
protected void onProgressUpdate(String... values) {
updateTitle(values[0]);
}
@Override
protected void onCancelled2(SyncLoader syncLoader) {
resetIsWorkingFlag();
}
private void resetIsWorkingFlag() {
synchronized (loaderLock) {
if (mWorkingLoader == this) {
loaderIsWorking = false;
}
}
}
@Override
protected void onPostExecute2(SyncLoader loader) {
mSyncLoader = loader;
updateCompletedLoader();
try {
if (isMyResumed()) {
onLoadFinished(getCurrentListPosition());
}
} catch (Exception e) {
MyLog.d(this,"onPostExecute", e);
}
long endedAt = System.currentTimeMillis();
long timeTotal = endedAt - createdAt;
MyLog.v(this, () -> "Load completed, " + (mSyncLoader == null ? "?" : mSyncLoader.size())
+ " items, "
+ timeTotal + "ms total, "
+ (endedAt - backgroundEndedAt) + "ms on UI thread");
resetIsWorkingFlag();
}
@Override
public String toString() {
return super.toString() + (mSyncLoader == null ? "" : "; " + mSyncLoader);
}
}
@NonNull
public LoadableListPosition getCurrentListPosition() {
return LoadableListPosition.getCurrent(getListView(), getListAdapter(), centralItemId);
}
public void onLoadFinished(LoadableListPosition pos) {
updateList(pos);
updateTitle("");
if (onRefreshHandled) {
onRefreshHandled = false;
hideSyncing("onLoadFinished");
}
}
public void updateList(LoadableListPosition pos) {
updateList(pos, LoadableListViewParameters.EMPTY, true);
}
public void updateList(LoadableListViewParameters viewParameters) {
updateList(getCurrentListPosition(), viewParameters, false);
}
private void updateList(LoadableListPosition pos, LoadableListViewParameters viewParameters, boolean newAdapter) {
final String method = "updateList";
ListView list = getListView();
if (list == null) return;
if (MyLog.isVerboseEnabled()) pos.logV(method + "; Before " + (newAdapter
? "setting new adapter"
: "notifying change"));
final BaseTimelineAdapter<T> adapter = newAdapter ? newListAdapter() : getListAdapter();
if (viewParameters.isViewChanging()) {
adapter.getListData().updateView(viewParameters);
}
if (newAdapter) {
setListAdapter(adapter);
} else {
adapter.notifyDataSetChanged();
}
adapter.setPositionRestored(LoadableListPosition.restore(list, adapter, pos));
if (viewParameters.isViewChanging()) {
updateScreen();
}
}
public void updateScreen() {
// Empty
}
protected abstract BaseTimelineAdapter<T> newListAdapter();
@NonNull
@Override
public BaseTimelineAdapter<T> getListAdapter() {
return (BaseTimelineAdapter<T>) super.getListAdapter();
}
private void updateCompletedLoader() {
synchronized(loaderLock) {
mCompletedLoader = mWorkingLoader;
}
lastLoadedAt = System.currentTimeMillis();
}
protected void updateTitle(String progress) {
StringBuilder title = new StringBuilder(getCustomTitle());
if (!StringUtil.isEmpty(progress)) {
MyStringBuilder.appendWithSpace(title, progress);
}
setTitle(title.toString());
setSubtitle(mSubtitle);
}
protected CharSequence getCustomTitle() {
return getTitle();
}
@NonNull
protected SyncLoader getLoaded() {
synchronized(loaderLock) {
return mCompletedLoader.getSyncLoader();
}
}
@Override
protected void onResume() {
String method = "onResume";
super.onResume();
boolean isFinishing = restartMeIfNeeded();
MyLog.v(this, () -> method + (isFinishing ? ", and finishing" : "") );
if (!isFinishing) {
myServiceReceiver.registerReceiver(this);
myContext.setInForeground(true);
if (!isLoading()) {
showList(WhichPage.ANY);
}
}
}
@Override
public void onContentChanged() {
if (MyLog.isLoggable(this, MyLog.DEBUG)) {
MyLog.d(this, "onContentChanged started");
}
super.onContentChanged();
}
@Override
protected void onPause() {
super.onPause();
if (myServiceReceiver != null) {
myServiceReceiver.unregisterReceiver(this);
}
myContextHolder.getNow().setInForeground(false);
getListAdapter().setPositionRestored(false);
}
@Override
public void onReceive(CommandData commandData, MyServiceEvent event) {
switch (event) {
case BEFORE_EXECUTING_COMMAND:
if (isCommandToShowInSyncIndicator(commandData)) {
showSyncing(commandData);
}
break;
case PROGRESS_EXECUTING_COMMAND:
if (isCommandToShowInSyncIndicator(commandData)) {
showSyncing("Show Progress", commandData.toCommandProgress(myContextHolder.getNow()));
}
break;
case AFTER_EXECUTING_COMMAND:
onReceiveAfterExecutingCommand(commandData);
break;
case ON_STOP:
hideSyncing("onReceive STOP");
break;
default:
break;
}
if (isAutoRefreshNow(event == MyServiceEvent.ON_STOP)) {
if (MyLog.isVerboseEnabled()) {
MyLog.v(this, "Auto refresh on content change");
}
showList(WhichPage.CURRENT);
}
}
private void showSyncing(final CommandData commandData) {
new AsyncTaskLauncher<CommandData>().execute(this,
new MyAsyncTask<CommandData, Void, String>("ShowSyncing" + getInstanceId(), MyAsyncTask.PoolEnum.QUICK_UI) {
@Override
protected String doInBackground2(CommandData commandData) {
return commandData.toCommandSummary(myContext);
}
@Override
protected void onPostExecute2(String result) {
showSyncing("Show " + commandData.getCommand(),
getText(R.string.title_preference_syncing) + ": " + result);
}
@Override
public String toString() {
return "ShowSyncing " + super.toString();
}
}
, commandData);
}
protected boolean isCommandToShowInSyncIndicator(CommandData commandData) {
return false;
}
protected void onReceiveAfterExecutingCommand(CommandData commandData) {
if (isRefreshNeededAfterExecuting(commandData)) {
refreshNeededSince.compareAndSet(0, System.currentTimeMillis());
refreshNeededAfterForegroundCommand.compareAndSet(false, commandData.isInForeground());
}
}
/**
* @return true if needed, false means "don't know"
*/
protected boolean isRefreshNeededAfterExecuting(CommandData commandData) {
boolean needed = false;
switch(commandData.getCommand()) {
case GET_NOTE:
case GET_CONVERSATION:
case GET_FOLLOWERS:
case GET_FRIENDS:
if (commandData.getResult().getDownloadedCount() > 0) {
needed = true;
}
break;
case GET_ACTOR:
case UPDATE_NOTE:
case FOLLOW:
case UNDO_FOLLOW:
case LIKE:
case UNDO_LIKE:
case ANNOUNCE:
case UNDO_ANNOUNCE:
case DELETE_NOTE:
case GET_ATTACHMENT:
case GET_AVATAR:
if (!commandData.getResult().hasError()) {
needed = true;
}
break;
default:
break;
}
return needed;
}
protected boolean isAutoRefreshNow(boolean onStop) {
if (refreshNeededSince.get() == 0) {
return false;
} else if (isLoading()) {
if (MyLog.isVerboseEnabled()) {
MyLog.v(this, "Ignoring content change while loading");
}
return false;
} else if (!onStop && !refreshNeededAfterForegroundCommand.get() &&
!RelativeTime.wasButMoreSecondsAgoThan(lastLoadedAt, NO_AUTO_REFRESH_AFTER_LOAD_SECONDS)) {
if (MyLog.isVerboseEnabled()) {
MyLog.v(this, "Ignoring background content change - loaded recently");
}
return false;
}
return true;
}
@Override
public void onDestroy() {
MyLog.v(this, "onDestroy");
if (myServiceReceiver != null) {
myServiceReceiver.unregisterReceiver(this);
}
super.onDestroy();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.sync_menu_item:
showList(BundleUtils.toBundle(WhichPage.CURRENT.toBundle(), IntentExtra.SYNC.key, 1L));
break;
case R.id.refresh_menu_item:
showList(WhichPage.CURRENT);
break;
default:
return super.onOptionsItemSelected(item);
}
return false;
}
public boolean isPositionRestored() {
return getListAdapter().isPositionRestored();
}
protected void showSyncing(String source, CharSequence text) {
if (!showSyncIndicatorSetting || isEditorVisible()) {
return;
}
syncingText = text;
updateTextualSyncIndicator(source);
}
@Override
protected void hideSyncing(String source) {
syncingText = "";
updateTextualSyncIndicator(source);
super.hideSyncing(source);
}
protected void showLoading(String source, String text) {
if (!showSyncIndicatorSetting) {
return;
}
loadingText = text;
updateTextualSyncIndicator(source);
}
protected void hideLoading(String source) {
loadingText = "";
updateTextualSyncIndicator(source);
}
protected void updateTextualSyncIndicator(String source) {
if (textualSyncIndicator == null) {
return;
}
boolean isVisible = (!TextUtils.isEmpty(loadingText) || !TextUtils.isEmpty(syncingText)) && !isEditorVisible();
if (isVisible) {
((TextView) findViewById(R.id.sync_text)).setText(TextUtils.isEmpty(loadingText) ? syncingText : loadingText );
}
if (isVisible
? (textualSyncIndicator.getVisibility() != View.VISIBLE)
: ((textualSyncIndicator.getVisibility() == View.VISIBLE))) {
MyLog.v(this, () -> source + " set textual Sync indicator to " + isVisible);
textualSyncIndicator.setVisibility(isVisible ? View.VISIBLE : View.GONE);
}
}
protected boolean isEditorVisible() {
return false;
}
@Override
public void onRefresh() {
onRefreshHandled = true;
showList(WhichPage.CURRENT);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
if (searchView != null && searchView.getVisibility() == View.VISIBLE) {
searchView.onActionViewCollapsed();
return true;
}
}
return super.onKeyDown(keyCode, event);
}
}
|
[
"[email protected]"
] | |
14a57c94b29236f942f3f022582a33872261b839
|
e441f31c6d8fb081e7a61f83f36cb749d5ec06c5
|
/src/anotations/AM.java
|
b8b59faf1cf4c22500787d59c0a956d28b2ff532
|
[] |
no_license
|
Aniket1245/FrameworkNew
|
d6ccde036b1c08d8dd2b26f0f0ec9999d63d719a
|
570c980aa13f4b60a3a987002bbc3500c10a7333
|
refs/heads/master
| 2021-08-16T02:42:55.882520 | 2017-11-18T21:23:52 | 2017-11-18T21:23:52 | 111,231,898 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 484 |
java
|
package anotations;
import org.testng.Reporter;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class AM {
@BeforeMethod()
public void beforeMethod()
{
Reporter.log("Before Method",true);
}
@AfterMethod()
public void afterMethod()
{
Reporter.log("After Method", true);
}
@Test
public void testA()
{
Reporter.log("testA method of BM",true);
}
}
|
[
"[email protected]"
] | |
6bb1bd7069053417152cb465d440271395e86cea
|
5ac9c577fc57e83583c6ef92c884d5145c5aed4e
|
/java07/src/배열문제/ForTest5.java
|
0ccf85fd4bd5a566686a3707892b3ac71eeb4075
|
[] |
no_license
|
kyungmin90/Java
|
f4abebbe56b86ee6cdf47d881aca2cba5db06f5b
|
4dc9464def2e7ca024cfa8793f5596332ea950b9
|
refs/heads/main
| 2023-01-02T15:37:47.543066 | 2020-11-02T06:08:46 | 2020-11-02T06:08:46 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,981 |
java
|
package 배열문제;
import java.util.Random;
import java.util.Scanner;
public class ForTest5 {
public static void main(String[] args) {
int totalCount = 0, same = 0;
int s = 0, r = 1, p = 2;
int meSWin = 0, meRWin = 0, mePWin = 0;
int computerWin = 0;
Scanner sc = new Scanner(System.in);
Random random = new Random();
while (true) {
System.out.print("가위0, 바위1, 보2 중 하나를 입력해주세요.[종료는 4]>> ");
int me = sc.nextInt();
if (me == 4) {
System.out.println("게임을 종료합니다.===");
break;
}
totalCount++;
int computer = random.nextInt(3);
if (me == 0) {// 가위
if (computer == 0) {// 가위
System.out.println("비겼음.");
same++;
} else if (computer == 1) {// 바위
System.out.println("컴퓨터 승.");
computerWin++;
} else {// 보
System.out.println("내가 승.");
meSWin++;
}
} else if (me == 1) {// 바위
if (computer == 0) {// 가위
System.out.println("내가 승.");
meRWin++;
} else if (computer == 1) {// 바위
System.out.println("비겼음.");
same++;
} else {// 보
System.out.println("컴퓨터 승.");
computerWin++;
}
} else {// 보
if (computer == 0) {// 가위
System.out.println("컴퓨터 승.");
computerWin++;
} else if (computer == 1) {// 바위
System.out.println("내가 승.");
mePWin++;
} else {// 보
System.out.println("비겼음.");
same++;
}
}
System.out.println("★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★");
System.out.println("★★★★★★★★★★★★ Game Start★★★★★★★★★★★★★★");
System.out.println("게임 전체 횟수 " + totalCount + "회");
System.out.println("컴퓨터 전체 승리 횟수 " + computerWin + "회");
System.out.println("나의 가위로 이깃 횟수 " + meSWin + "회");
System.out.println("나의 바위로 이깃 횟수 " + meRWin + "회");
System.out.println("나의 보로 이깃 횟수 " + mePWin + "회");
System.out.println("게임 전체 비긴 횟수 " + same + "회");
System.out.println();
}
}
}
|
[
"[email protected]"
] | |
4a8238f4018054cae0608b9c5cdd74a20a0b4e8e
|
8a2078a501eb4ec5601e300b93d4e369be7f6ae0
|
/core/src/main/java/com/steeleforge/aem/ironsites/wcm/page/filter/property/PropertyEqualsFilter.java
|
9fe4136a9796234246f5e09a838ceea17e27e51d
|
[
"Unlicense"
] |
permissive
|
steeleforge/ironsites
|
e4aad93c583a3aff29b1dfe568733e1c6eed2147
|
5c27b2edba8795233274937521126a8a72dd854c
|
refs/heads/master
| 2016-09-05T13:35:37.094475 | 2015-08-18T04:22:37 | 2015-08-18T04:22:37 | 9,699,024 | 9 | 3 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,455 |
java
|
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* For more information, please refer to <http://unlicense.org/>
*/
package com.steeleforge.aem.ironsites.wcm.page.filter.property;
import org.apache.commons.lang.BooleanUtils;
import com.day.cq.commons.Filter;
import com.day.cq.wcm.api.Page;
/**
* Base class for page filters checking page value equality.
*
* @author David Steele
*/
public abstract class PropertyEqualsFilter implements Filter<Page> {
private final String property;
private final Object value;
private final Boolean negate;
public PropertyEqualsFilter(String property, Object value, Boolean negate) {
this.property = property;
this.value = value;
this.negate = negate;
}
public PropertyEqualsFilter(String property, Object value) {
this(property, value, false);
}
public boolean includes(Page page) {
if (null == page || null == property || null == value) {
return false;
}
if (negate) {
return BooleanUtils.negate(propertyEquals(page, property, value));
} else {
return propertyEquals(page, property, value);
}
}
public abstract boolean propertyEquals(Page page, String property, Object value);
}
|
[
"[email protected]"
] | |
7adb0f6e71b260460a1bee9980a3e316bf1d54e0
|
934df9b5b3fe2af774fae06ed143dc185073f835
|
/Src/MovieRestfulWebService/src/java/service/MoviesFacadeREST.java
|
776110197226f9818798351e90b6e0f856a13081
|
[] |
no_license
|
jbai35/ONLINE-MOVIES-SEARCH-APPLICATION
|
3aa0627be250f4525438570a18e5bd3034b72f31
|
a8272db854eeaf494a6bc8480dda23e1cfc82516
|
refs/heads/master
| 2021-01-17T19:20:52.620476 | 2016-08-07T12:05:17 | 2016-08-07T12:05:43 | 65,130,850 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,564 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package service;
import entity.Movies;
import java.net.URLDecoder;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
/**
*
* @author hp
*/
@Stateless
@Path("entity.movies")
public class MoviesFacadeREST extends AbstractFacade<Movies> {
@PersistenceContext(unitName = "MovieRestfulWebServicePU")
private EntityManager em;
public MoviesFacadeREST() {
super(Movies.class);
}
@POST
@Override
@Consumes({"application/xml", "application/json"})
public void create(Movies entity) {
super.create(entity);
}
@PUT
@Path("{id}")
@Consumes({"application/xml", "application/json"})
public void edit(@PathParam("id") Integer id, Movies entity) {
super.edit(entity);
}
@DELETE
@Path("{id}")
public void remove(@PathParam("id") Integer id) {
super.remove(super.find(id));
}
@GET
@Path("{id}")
@Produces({"application/xml", "application/json"})
public Movies find(@PathParam("id") Integer id) {
return super.find(id);
}
@GET
@Override
@Produces({"application/xml", "application/json"})
public List<Movies> findAll() {
return super.findAll();
}
@GET
@Path("{from}/{to}")
@Produces({"application/xml", "application/json"})
public List<Movies> findRange(@PathParam("from") Integer from, @PathParam("to") Integer to) {
return super.findRange(new int[]{from, to});
}
@GET
@Path("count")
@Produces("text/plain")
public String countREST() {
return String.valueOf(super.count());
}
@Override
protected EntityManager getEntityManager() {
return em;
}
//Extended manually
@GET
@Path("title/{title}")
@Produces({"application/json"})
public List<Movies> find(@PathParam("title") String title) {
System.out.println("WS----------------->" + URLDecoder.decode(title));
return em.createNativeQuery("select * from movies where title like '%" + URLDecoder.decode(title) + "%'", Movies.class).getResultList();
}
}
|
[
"[email protected]"
] | |
a3a0ae3208ca364de16239bb273f1d4cd4409621
|
d60e287543a95a20350c2caeabafbec517cabe75
|
/NLPCCd/Camel/3657_1.java
|
b2b5897b81db928dbf4f925561933f31381211f9
|
[
"MIT"
] |
permissive
|
sgholamian/log-aware-clone-detection
|
242067df2db6fd056f8d917cfbc143615c558b2c
|
9993cb081c420413c231d1807bfff342c39aa69a
|
refs/heads/main
| 2023-07-20T09:32:19.757643 | 2021-08-27T15:02:50 | 2021-08-27T15:02:50 | 337,837,827 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 676 |
java
|
//,temp,sample_2399.java,2,18,temp,sample_2400.java,2,17
//,3
public class xxx {
public void dummy_method(){
MailConfiguration config = getEndpoint().getConfiguration();
String copyTo = in.getHeader("copyTo", config.getCopyTo(), String.class);
boolean delete = in.getHeader("delete", config.isDelete(), boolean.class);
if (config.getProtocol().equals(MailUtils.PROTOCOL_IMAP) || config.getProtocol().equals(MailUtils.PROTOCOL_IMAPS)) {
if (copyTo != null) {
Folder destFolder = store.getFolder(copyTo);
if (!destFolder.exists()) {
destFolder.create(Folder.HOLDS_MESSAGES);
}
folder.copyMessages(new Message[]{mail}, destFolder);
log.info("imap message copied to");
}
}
}
};
|
[
"SHOSHIN\\[email protected]"
] |
SHOSHIN\[email protected]
|
d4f1b23bd12c3128b5a9bea856e1e0252cba2000
|
c8a70a8e81d023789fe48d8065d1265da464968a
|
/mooc_model/src/main/java/com/mooc/model/report/ReportCourse.java
|
6db20ebe24f706515b88c6ac43e1fca27469e132
|
[] |
no_license
|
hcq0514/mooc_parent
|
550e480d6410e9e07f7c911d2b918d4e79fc6c4c
|
1923bed1e5b5ed0d69fd1b3a6ecd5beb237261b8
|
refs/heads/master
| 2022-07-03T02:25:38.516204 | 2019-06-05T08:50:08 | 2019-06-05T08:50:08 | 188,392,696 | 0 | 0 | null | 2022-06-30T14:46:19 | 2019-05-24T09:22:37 |
Java
|
UTF-8
|
Java
| false | false | 570 |
java
|
package com.mooc.model.report;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
/**
* Created by admin on 2018/2/27.
*/
@Data
@ToString
@Document(collection = "report_course")
public class ReportCourse {
@Id
private String id;
private Float evaluation_score;//评价分数
private Long collect_num;//收藏次数
private Long play_num;//播放次数
private Long student_num;//学生人数
private Long timelength;//课程时长
}
|
[
"[email protected]"
] | |
6714cc47ded0abb02ce79a5ad183b4a1c553f4a8
|
49662077964fd9fd90cf8dd1469c82c34d601c1f
|
/src/main/java/org/atmosphere/atmosph4rx/Atmosph4rXApplication.java
|
c204432cfd81b21b2076f28696b99b2634378fe6
|
[
"Apache-2.0"
] |
permissive
|
boob-sbcm/Atmosph4rX
|
419e5f990007076452183d935e2de4bcdbef62ad
|
9fcb519a7d15630de1bdf11ab60e7906538b0259
|
refs/heads/master
| 2020-04-09T02:37:57.883491 | 2018-06-20T17:34:55 | 2018-06-20T17:34:55 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 920 |
java
|
/*
* Copyright 2018 Async-IO.org
*
* 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.atmosphere.atmosph4rx;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Atmosph4rXApplication {
public static void main(String[] args) {
SpringApplication.run(Atmosph4rXApplication.class, args);
}
}
|
[
"[email protected]"
] | |
f2fd6feb14c6f1a20502170f91c8c4fe72df9374
|
fc160694094b89ab09e5c9a0f03db80437eabc93
|
/java-compute/samples/snippets/generated/com/google/cloud/compute/v1/instancegroups/listinstances/AsyncListInstances.java
|
b8ba30f400d68229739c1bb5e58eb97964167504
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
googleapis/google-cloud-java
|
4f4d97a145e0310db142ecbc3340ce3a2a444e5e
|
6e23c3a406e19af410a1a1dd0d0487329875040e
|
refs/heads/main
| 2023-09-04T09:09:02.481897 | 2023-08-31T20:45:11 | 2023-08-31T20:45:11 | 26,181,278 | 1,122 | 685 |
Apache-2.0
| 2023-09-13T21:21:23 | 2014-11-04T17:57:16 |
Java
|
UTF-8
|
Java
| false | false | 2,683 |
java
|
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.compute.v1.samples;
// [START compute_v1_generated_InstanceGroups_ListInstances_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.compute.v1.InstanceGroupsClient;
import com.google.cloud.compute.v1.InstanceGroupsListInstancesRequest;
import com.google.cloud.compute.v1.InstanceWithNamedPorts;
import com.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest;
public class AsyncListInstances {
public static void main(String[] args) throws Exception {
asyncListInstances();
}
public static void asyncListInstances() throws Exception {
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.create()) {
ListInstancesInstanceGroupsRequest request =
ListInstancesInstanceGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setInstanceGroup("instanceGroup-1404696854")
.setInstanceGroupsListInstancesRequestResource(
InstanceGroupsListInstancesRequest.newBuilder().build())
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
ApiFuture<InstanceWithNamedPorts> future =
instanceGroupsClient.listInstancesPagedCallable().futureCall(request);
// Do something.
for (InstanceWithNamedPorts element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
}
}
// [END compute_v1_generated_InstanceGroups_ListInstances_async]
|
[
"[email protected]"
] | |
09af92855aff846b8be691574f40ef45ecba096c
|
fcf663985a8e461bdb5b632f76f4188766f4f151
|
/src/main/java/com/seacon/gdt/xml/objects/Gdt.java
|
afa61405e5d0345ae17b9e325b79003a14aca16f
|
[] |
no_license
|
zelota/GlassfishDeploymentTool
|
a6b009f9def8fe19b7076c10bdab5894b51303d1
|
819e31de30b433635558bda19501b7d383fd4678
|
refs/heads/master
| 2021-01-21T23:44:30.952899 | 2015-03-16T09:49:56 | 2015-03-16T09:49:56 | 31,080,332 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,433 |
java
|
package com.seacon.gdt.xml.objects;
import com.seacon.gdt.xml.Constants;
import com.seacon.gdt.xml.objects.servers.Server;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* @author Peter
*/
@XmlRootElement(name = Constants.gdt)
@XmlType (propOrder={"parameters","servers","data"})
public class Gdt implements Serializable {
public static final long serialVersionUID = 2015012923L;
private Parameters parameters;
private List<Server> servers;
private Data data;
public Gdt() {
this.parameters = new Parameters();
this.servers = new ArrayList<Server>();
this.data = new Data();
}
public Parameters getParameters() {
return parameters;
}
@XmlElement
public void setParameters(Parameters parameters) {
this.parameters = parameters;
}
public List<Server> getServers() {
return servers;
}
@XmlElementWrapper
@XmlElement(name="server")
public void setServers(List<Server> servers) {
this.servers = servers;
}
public Data getData() {
return data;
}
@XmlElement(name="data")
public void setData(Data data) {
this.data = data;
}
}
|
[
"[email protected]"
] | |
00f8220ed89039de1f4e6e7634268cd4d36cfccc
|
505baa84f76eefeb35bd02a5894b5352fb44dc0e
|
/src/main/java/com/cibertec/rest/controller/EditorialRestController.java
|
54e1b8818ea7b8a22ce28308a792056f06c34b20
|
[] |
no_license
|
dionealarcony/api_rest_sistema_biblioteca
|
c0faf7f9df533c79f9bbe378ea64f2d83f647add
|
f90c2ce2a9848e294bc8e7c024cdc89595c37600
|
refs/heads/master
| 2023-07-27T03:30:07.789463 | 2021-09-10T04:05:04 | 2021-09-10T04:05:04 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,670 |
java
|
package com.cibertec.rest.controller;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.cibertec.rest.entity.Editorial;
import com.cibertec.rest.service.EditorialService;
import lombok.extern.slf4j.Slf4j;
@RestController
@Slf4j
@RequestMapping("/servicio/editorial")
public class EditorialRestController {
@Autowired
private EditorialService servicio;
@GetMapping()
public ResponseEntity<List<Editorial>> listaEditorial() {
log.info("METODO --> listaEditorial");
return ResponseEntity.ok(servicio.listaEditorial());
}
@PostMapping
public ResponseEntity<Editorial> registrar(@RequestBody Editorial obj) {
log.info("METODO --> registrar");
return ResponseEntity.ok(servicio.insertaActualizaEditorial(obj));
}
@GetMapping("/{id}")
public ResponseEntity<Editorial> buscarPorId(@PathVariable int id) {
log.info("METODO --> buscarPorId " + id);
Optional<Editorial> obj = servicio.buscarEditorialPorId(id);
if (obj.isPresent()) {
return ResponseEntity.ok(obj.get());
} else {
log.error("Id " + id + " no existe");
return ResponseEntity.notFound().build();
}
}
@PutMapping()
public ResponseEntity<Editorial> actualiza(@RequestBody Editorial Editorial) {
log.info("METODO --> actualiza " + Editorial.getIdEditorial());
Optional<Editorial> obj = servicio.buscarEditorialPorId(Editorial.getIdEditorial());
if (obj.isPresent()) {
return ResponseEntity.ok(servicio.insertaActualizaEditorial(Editorial));
} else {
log.error("Id " + Editorial.getIdEditorial() + " is no existe");
return ResponseEntity.notFound().build();
}
}
@DeleteMapping("/{id}")
public ResponseEntity<Editorial> elimina(@PathVariable int id) {
log.info("METODO --> elimina " + id);
Optional<Editorial> obj = servicio.buscarEditorialPorId(id);
if (obj.isPresent()) {
servicio.eliminaEditorial(id);
return ResponseEntity.ok(obj.get());
} else {
log.error("Id " + id + " no existe");
return ResponseEntity.notFound().build();
}
}
}
|
[
"[email protected]"
] | |
c2eda0fdfd347f2692c8e9d6f67c4b6ca29ae9d2
|
1fd7f5d1c6f8102f19035205a44af760d94913d5
|
/Android_App/stud/app/src/main/java/com/example/stud/ActiveActivity.java
|
cf80b195c4cc60ef7850e00a119bfd93454fc25c
|
[] |
no_license
|
SaitejaChitti/SkillUp-Team-06
|
915fce8fc8af4ed565cf7d0ef69574d308bd7d66
|
e89eb3a1135437505e2e6333fa8028c3bf8f1341
|
refs/heads/master
| 2022-11-14T10:31:45.346583 | 2020-07-03T18:11:09 | 2020-07-03T18:11:09 | 276,116,688 | 0 | 2 | null | 2020-06-30T14:06:03 | 2020-06-30T14:06:03 | null |
UTF-8
|
Java
| false | false | 3,761 |
java
|
package com.example.stud;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ActiveActivity extends Activity {
private static final String url = "jdbc:mysql://skillup-team-06.cxgok3weok8n.ap-south-1.rds.amazonaws.com:3306/project?characterEncoding=utf8&useSSL=false&useUnicode=true&allowMultiQueries=true";
private static final String user = "admin";
private static final String pass = "coscskillup";
ListView lstData;
SimpleAdapter ADAhere;
TextView tv;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_active);
lstData= (ListView)findViewById(R.id.lstData1);
Bundle extras = getIntent().getExtras();
final String name = extras.getString("name");
tv = (TextView)findViewById(R.id.tva);
final String cname = extras.getString("cname");
Bgm bgm = new Bgm();
bgm.execute(cname,name);
}
private class Bgm extends AsyncTask<String, Void, String> {
String res = "";
@Override
protected void onPreExecute() {
super.onPreExecute();
Toast.makeText(ActiveActivity.this, "Loading Activities", Toast.LENGTH_SHORT).show();//.makeText(ListActivity.this, "Please wait...", Toast.LENGTH_SHORT)
// .show();
}
@Override
protected String doInBackground(String... params) {
try {
String tab = params[0];
String can = params[1];
int p = Integer.parseInt(can);
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(url, user, pass);
String result = "Database Connection Successful\n";
PreparedStatement st = con.prepareStatement("select eventname from `"+tab+"` where stuid = ?");
st.setInt(1, p);
ResultSet rs = st.executeQuery();
List<Map<String, String>> data = null;
data = new ArrayList<Map<String, String>>();
while (rs.next()) {
Map<String, String> datanum = new HashMap<String, String>();
datanum.put("A", rs.getString(1).toString());
data.add(datanum);
}
String[] fromwhere = {"A"};
int[] viewswhere = {R.id.lblcountryname};
ADAhere = new SimpleAdapter(ActiveActivity.this, data,
R.layout.listtemplate, fromwhere, viewswhere);
while (rs.next()) {
result += rs.getString(1).toString() + "\n";
}
res = result;
} catch (Exception e) {
e.printStackTrace();
res = e.toString();
}
return res;
}
@Override
protected void onPostExecute(String result) {
lstData.setAdapter(ADAhere);
Toast.makeText(ActiveActivity.this,"Done",Toast.LENGTH_SHORT).show();
}
}
}
|
[
"[email protected]"
] | |
2e481080bfca8a0537177761c9652c1b2c0c8f8d
|
05fd3a1d7001419cea948cb725d2f4ae826e0b32
|
/src/client/controller/Exceptions/DeckHasPassiveAlready.java
|
7131a607f9c296ba78440ce816150616f7a7d62d
|
[] |
no_license
|
aps2019project/project-32
|
ffd7c5666099802c981b951a0d2ecdbe4629bd9e
|
dc5fb57afa8229fc7ef2f32db76cd08e293d6987
|
refs/heads/master
| 2020-05-05T11:25:28.258406 | 2019-07-09T18:41:17 | 2019-07-09T18:41:17 | 179,988,885 | 0 | 0 | null | 2019-04-28T05:04:44 | 2019-04-07T15:58:11 | null |
UTF-8
|
Java
| false | false | 247 |
java
|
package client.controller.Exceptions;
import java.io.Serializable;
public class DeckHasPassiveAlready extends Exception implements Serializable
{
public DeckHasPassiveAlready()
{
super("Deck has Passive Spell Already!");
}
}
|
[
"[email protected]"
] | |
0becaddb65e741609abe2759fda49ce777eb9d76
|
e2db1ffb58a1e78ab02cda2c7411bf56ab65a6b0
|
/src/main/java/com/edication/telegram/bot/telegramboteducationlecture/command/Command.java
|
36073a0376f34498d7ce988f9872f92e7212e4a6
|
[] |
no_license
|
cypher3301/telegramBotForEducation
|
f0501c43d3b7dd13f0578c65743f9070277dbb15
|
70b31852d30beb753286752b14d3e1411ae726d6
|
refs/heads/master
| 2023-07-29T16:49:24.656479 | 2021-09-07T18:47:10 | 2021-09-07T18:47:10 | 403,328,677 | 0 | 0 | null | 2021-09-07T18:47:11 | 2021-09-05T14:24:16 |
Java
|
UTF-8
|
Java
| false | false | 429 |
java
|
package com.edication.telegram.bot.telegramboteducationlecture.command;
import org.telegram.telegrambots.meta.api.objects.Update;
/**
* Command interface for handling telegram-bot commands.
*/
public interface Command {
/**
* Main method, witch is executing command logic
*
* @param update provided {@link Update} object with all data, witch needed for command.
*/
void execute(Update update);
}
|
[
"[email protected]"
] | |
7630a3860b9bcb22a7cd4d60ef02769aa92c4453
|
dcfb0b714db9def44c08fd8501c2e9649b278430
|
/ForkStar/src/com/csumax/maxgithubclient/utils/ToastUtil.java
|
887e6861d43955e91bcd814ed1aa951f6d36e54e
|
[] |
no_license
|
vaginessa/ForkStar
|
e2eac1fa773b66ae8745df744aaaec7c67343bb9
|
dda260c966825a42f820c08577ca697355d6293c
|
refs/heads/master
| 2021-05-28T11:52:17.019600 | 2015-03-12T02:46:22 | 2015-03-12T02:46:22 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,747 |
java
|
package com.csumax.maxgithubclient.utils;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;
public class ToastUtil {
private static Toast mToast = null;
private static final int LENGTH_LONG = Toast.LENGTH_LONG;
private static final int LENGTH_SHORT = Toast.LENGTH_SHORT;
public static void showShort(Context context, String message) {
mToast = Toast.makeText(context, message, LENGTH_SHORT);
mToast.setGravity(Gravity.CENTER, 0, 0);
mToast.show();
}
public static void showShort(Context context, int resId) {
mToast = Toast.makeText(context, resId, LENGTH_SHORT);
mToast.setGravity(Gravity.CENTER, 0, 0);
mToast.show();
}
public static void showLong(Context context, String message) {
mToast = Toast.makeText(context, message, LENGTH_LONG);
mToast.setGravity(Gravity.CENTER, 0, 0);
mToast.show();
}
public static void showLong(Context context, int resId) {
mToast = Toast.makeText(context, resId, LENGTH_LONG);
mToast.setGravity(Gravity.CENTER, 0, 0);
mToast.show();
}
public static void showIconToast(Context context, String message, int iconId) {
mToast = Toast.makeText(context, message, LENGTH_SHORT);
mToast.setGravity(Gravity.CENTER, 0, 0);
View toastView = mToast.getView();
ImageView imageView = new ImageView(context);
imageView.setImageResource(iconId);
LinearLayout linearLayout = new LinearLayout(context);
linearLayout.setOrientation(LinearLayout.HORIZONTAL);
linearLayout.addView(imageView);
linearLayout.addView(toastView);
mToast.setView(linearLayout);
mToast.show();
}
}
|
[
"[email protected]"
] | |
211fbb6a6f26b09f220ee8cce901fb05bf947955
|
e78da9bd47e9bd8050a4045c77375a3e23de4e42
|
/javacw/src/java/dao/RoleDao.java
|
637916616b655e66d00f9273da9994492fc44386
|
[] |
no_license
|
tharindu-dilshan/construction-biding-system
|
55643ceb0d2ed4366791a9620b94d37957198651
|
15837a41b3840cab1dcafeaadeba580bf81c8ca2
|
refs/heads/master
| 2020-04-17T14:47:37.438476 | 2019-01-23T07:12:23 | 2019-01-23T07:12:23 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 444 |
java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package dao;
import java.sql.SQLException;
import model.Role;
/**
*
* @author HaShaN
*/
public interface RoleDao {
public final String GET_BY_ID_SQL = "SELECT * from role WHERE id=?";
Role getById(int id)throws ClassNotFoundException,SQLException;
}
|
[
"[email protected]"
] | |
8976d863eeedf403e26d5220e03be517d521e318
|
3d20370f68354cd7d6e656137c32ea7066e29450
|
/Framework/app/src/test/java/com/dealacceleration/arvind/framework/ExampleUnitTest.java
|
994808bc96bf2115ca4cde4f54cc6ec3623293da
|
[] |
no_license
|
arvipDev/Android-Custom-Framework
|
aa73529e2c7596779a801887427396502ee8c9e3
|
9da4a064d202daa8cc838e80a7197a0216dc32b6
|
refs/heads/master
| 2021-06-11T17:46:12.058812 | 2016-12-14T04:45:08 | 2016-12-14T04:45:08 | 73,426,333 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 415 |
java
|
package com.dealacceleration.arvind.framework;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
|
[
"[email protected]"
] | |
7168808e4bf069e9cb360103bf1ede9590785192
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/8/8_cc7dadbc142a74c42db97aeebd52e90d8020caa1/AllTests/8_cc7dadbc142a74c42db97aeebd52e90d8020caa1_AllTests_s.java
|
ff36760963131d4a1e2cecc3bd87eaa9bbe9b47a
|
[] |
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,261 |
java
|
/*******************************************************************************
* Copyright (c) 2004 - 2006 University Of British Columbia and others.
* 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:
* University Of British Columbia - initial API and implementation
*******************************************************************************/
package org.eclipse.mylar.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.mylar.bugzilla.tests.AllBugzillaTests;
import org.eclipse.mylar.core.tests.AllCoreTests;
import org.eclipse.mylar.ide.tests.AllIdeTests;
import org.eclipse.mylar.internal.core.util.MylarStatusHandler;
import org.eclipse.mylar.internal.ide.MylarIdePlugin;
import org.eclipse.mylar.java.tests.AllJavaTests;
import org.eclipse.mylar.monitor.reports.tests.AllMonitorReportTests;
import org.eclipse.mylar.monitor.tests.AllMonitorTests;
import org.eclipse.mylar.tasklist.tests.AllTasklistTests;
import org.eclipse.mylar.tests.integration.AllIntegrationTests;
import org.eclipse.mylar.tests.misc.AllMiscTests;
import org.eclipse.mylar.tests.xml.AllXmlTests;
/**
* @author Mik Kersten
*/
public class AllTests {
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.mylar.tests");
MylarStatusHandler.setDumpErrors(true);
MylarIdePlugin.getDefault().setResourceMonitoringEnabled(false);
// TODO: the order of these tests matters, but shouldn't
// $JUnit-BEGIN$
suite.addTest(AllMonitorReportTests.suite());
suite.addTest(AllMonitorTests.suite());
suite.addTest(AllIntegrationTests.suite());
suite.addTest(AllCoreTests.suite());
suite.addTest(AllIdeTests.suite());
suite.addTest(AllJavaTests.suite());
suite.addTest(AllTasklistTests.suite());
suite.addTest(AllXmlTests.suite()); // HACK: first because it doesn't
// clean up properly
suite.addTest(AllBugzillaTests.suite());
suite.addTest(AllMiscTests.suite());
// $JUnit-END$
return suite;
}
}
|
[
"[email protected]"
] | |
4040527d3432c55cd07986f183311d4eeb50b3ff
|
f6b720ae493278a2139dd58f2392a023e7bf3726
|
/springDemo/src/main/java/form/PageForm.java
|
0816627eccf6e1f3806d99354f4c439b0a784711
|
[
"Apache-2.0"
] |
permissive
|
YeDaxia/JApiDocs
|
286c0806a7406eed237fbb6c4fde40b1a267c6e8
|
4b92eee3be6a79d49d394253b17c9442c9c337c8
|
refs/heads/master
| 2023-03-08T12:53:31.670611 | 2022-08-17T08:42:45 | 2022-08-17T08:42:45 | 79,034,430 | 1,754 | 353 |
Apache-2.0
| 2022-10-13T08:59:20 | 2017-01-15T13:30:17 |
Java
|
UTF-8
|
Java
| false | false | 201 |
java
|
package form;
/**
* @author yeguozhong yedaxia.github.com
*/
public class PageForm {
private Integer page; //页数
private Integer limit; //每页条数
private String sort; //排序
}
|
[
"[email protected]"
] | |
66f5b282af7d49bbbfae0747fe7bed883368c916
|
b289348bc5b1bbe1c3ded4ba40f34fb752686af4
|
/src/OpinionatedUser.java
|
aa92da6ba59ea64df36070e409066b38de273250
|
[] |
no_license
|
mtcrawshaw/TwitterNLP
|
c68d56fe1aaa75d72b3741daed1a93d631594dbf
|
858c2fb3ad3eb6c0c0bd9b667aa608bb6518f947
|
refs/heads/master
| 2021-09-01T15:44:39.338100 | 2017-12-27T19:41:16 | 2017-12-27T19:41:16 | 115,550,804 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,236 |
java
|
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import twitter4j.Paging;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.conf.ConfigurationBuilder;
public class OpinionatedUser {
//Private data
private String screenName;
private double[] opinions;
private int NUM_OPINION_WORDS;
// Constructors
public OpinionatedUser() {
getOpinionWords();
screenName = "";
opinions = new double[NUM_OPINION_WORDS];
}
public OpinionatedUser(String name, double[] op) {
getOpinionWords();
screenName = name;
opinions = op;
}
public OpinionatedUser(OpinionatedUser U) {
getOpinionWords();
screenName = U.getScreenName();
opinions = Arrays.copyOf(U.getOpinions(), NUM_OPINION_WORDS);
}
// Mutators
public void setScreenName(String name) {
screenName = name;
}
public void setOpinions(double[] o) {
assert o.length == NUM_OPINION_WORDS;
opinions = o;
}
public void setOpinion(int i, double o) {
opinions[i] = o;
}
// Accessors
public String getScreenName() {
return screenName;
}
public double[] getOpinions() {
return opinions;
}
public double getOpinion(int i) {
return opinions[i];
}
// Methods
public void calculateOpinions() {
ArrayList<String> opinionWords = getOpinionWords();
ArrayList<Status> tweets = this.getTweets();
for (int i = 0; i < NUM_OPINION_WORDS; i++) {
int numTweetsWithWord = 0;
int sumSentiments = 0;
for (Status tweet : tweets) {
String text = tweet.getText().trim().toLowerCase();
ArrayList<String> words = new ArrayList<String>(Arrays.asList(text.split(" ")));
if (words.contains(opinionWords.get(i))) {
int sentiment = SentimentAnalysis.getSentiment(tweet.getText());
if (sentiment != -1) {
sumSentiments += sentiment;
numTweetsWithWord++;
}
}
}
if (numTweetsWithWord != 0) {
opinions[i] = (double)sumSentiments / (double)numTweetsWithWord;
} else {
opinions[i] = 2;
}
}
}
private ArrayList<String> getOpinionWords() {
Scanner reader = new Scanner("opinionWords.txt");
ArrayList<String> opinionWords = new ArrayList<String>();
while (reader.hasNext()) {
opinionWords.add(reader.nextLine());
}
NUM_OPINION_WORDS = opinionWords.size();
reader.close();
return opinionWords;
}
public ArrayList<Status> getTweets() {
ConfigurationBuilder cb = new ConfigurationBuilder();
TwitterFactory tf = new TwitterFactory(cb.build());
Twitter twitter = tf.getInstance();
ArrayList<Status> statuses = new ArrayList<Status>();
int pageNumber = 1;
while (true) {
try {
int size = statuses.size();
Paging page = new Paging(pageNumber++, 100);
statuses.addAll(twitter.getUserTimeline(screenName, page));
if (statuses.size() == size) break;
} catch (TwitterException e) {
e.printStackTrace();
}
}
return statuses;
}
public double distanceTo(OpinionatedUser U) {
double dist = 0;
double[] UOpinions = U.getOpinions();
for (int i = 0; i < NUM_OPINION_WORDS; i++) {
dist += (opinions[i] - UOpinions[i]) * (opinions[i] - UOpinions[i]);
}
return Math.sqrt(dist);
}
}
|
[
"[email protected]"
] | |
7129614637ba3b5937f60bf79bbebcdfa0ead775
|
af2b3ba0c64f3b4c9d2059f73e79d4c377a0b5d1
|
/java基础/day0904_窗口启动/src/tarena/day0904/SecondActivity.java
|
dc6be945624404d7ee578c61e1016c707675fdb4
|
[] |
no_license
|
xuelang201201/Android
|
495b411a3bcdf70969ff01cf8fcb7ee8ea5abfd8
|
0829c4904193c07cb41048543defae83f6c5a226
|
refs/heads/master
| 2022-05-06T09:09:48.921737 | 2020-04-22T08:41:15 | 2020-04-22T08:41:15 | 257,838,791 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 512 |
java
|
package tarena.day0904;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class SecondActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.second, menu);
return true;
}
}
|
[
"[email protected]"
] | |
e8adfaf5aadec3ef28f039348ecac801fc592d41
|
fc82425d67d63429adecf14f05523d4ea03dbcdb
|
/library/src/main/java/com/okwyx/client/framework/libs/ui/BaseFragmentActivity.java
|
323e2ba5af8547fd3affe8a0e251e7ab002c5070
|
[] |
no_license
|
a64307410/junggle
|
f1a28b797349e06109534335a994170795a3e4e6
|
24df3dfa93030e2ee99b8b0be619e3d789c066ac
|
refs/heads/master
| 2020-12-02T22:06:52.713531 | 2017-07-03T08:01:18 | 2017-07-03T08:01:18 | 96,085,267 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,364 |
java
|
package com.okwyx.client.framework.libs.ui;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.okwyx.client.framework.libs.Libs;
import com.okwyx.plugin.Plugin;
/**
* 作者:Swei on 2017/4/13 15:53<BR/>
* 邮箱:[email protected]
*/
public class BaseFragmentActivity extends FragmentActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Libs.init(getApplicationContext());
Plugin.init(this);
Plugin.onCreate(this);
}
@Override
protected void onPause() {
super.onPause();
Plugin.onPause(this);
}
@Override
protected void onStop() {
super.onStop();
Plugin.onStop(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
Plugin.onDestory(this);
}
@Override
protected void onResume() {
super.onResume();
Plugin.onResume(this);
}
protected void setAccount(String uid,String channel){
Plugin.setAccount(uid,channel);
}
protected void chargeRequest(String orderId, String pruductName, long currencyAmount ){
Plugin.chargeRequest(orderId,pruductName,currencyAmount);
}
protected void onChargeSuccess(String orderId){
Plugin.onChargeSuccess(orderId);
}
}
|
[
"[email protected]"
] | |
81c665e5586931dad99f974140512368d36ced03
|
943fa6e3ec7bc0f5c48d41b048ba3ff0e2343b0b
|
/src/main/java/com/pillar/demo/Application.java
|
a7622460743c5a0364ac2d10e01a8924cf975d2e
|
[] |
no_license
|
ijabbott/spring-demo
|
55aee4c2e5efea1f1f1d9461d79b1cc0c1b0f238
|
395f22215478b40721d0ba2777426406f040a95c
|
refs/heads/master
| 2020-05-14T21:58:25.954636 | 2019-04-18T14:57:06 | 2019-04-18T14:57:06 | 181,971,856 | 0 | 0 | null | 2019-04-18T14:57:07 | 2019-04-17T21:37:03 |
Java
|
UTF-8
|
Java
| false | false | 1,604 |
java
|
package com.pillar.demo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
@Autowired
private CustomerRepository repository;
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
// @Override
// public void run(String... args) throws Exception {
//
// repository.deleteAll();
//
// // save a couple of customers
// repository.save(new Customer("Alice", "Smith"));
// repository.save(new Customer("Bob", "Smith"));
//
// // fetch all customers
// System.out.println("Customers found with findAll():");
// System.out.println("-------------------------------");
// for (Customer customer : repository.findAll()) {
// System.out.println(customer);
// }
// System.out.println();
//
// // fetch an individual customer
// System.out.println("Customer found with findByFirstName('Alice'):");
// System.out.println("--------------------------------");
// System.out.println(repository.findByFirstName("Alice"));
//
// System.out.println("Customers found with findByLastName('Smith'):");
// System.out.println("--------------------------------");
// for (Customer customer : repository.findByLastName("Smith")) {
// System.out.println(customer);
// }
// }
}
|
[
"[email protected]"
] | |
5c9700252d75dd6d417876eeaccf3b8414fa58ec
|
e8355e7c051bf9c2c1f8af5ed124190a514ba572
|
/DB test/src/MainGui.java
|
0774b02ff9e25ef2295849116c80476a569282fc
|
[] |
no_license
|
binarywoo27/covid_application
|
a36753024c45363441e9fd9cce6f6742acd8e515
|
46524edd7c3ebbd6b4bc4f8200070b93c333ce6a
|
refs/heads/master
| 2022-07-13T03:49:52.450322 | 2020-05-12T10:30:25 | 2020-05-12T10:30:25 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,339 |
java
|
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.*;
public class MainGui extends JFrame implements ActionListener{
JFrame frame = new JFrame();
JButton bt1 = new JButton("위험도 측정");
JButton bt2 = new JButton("코로나 정보");
public MainGui(String str) {
super(str); // frame name
Container cont = frame.getContentPane();
cont.setLayout(null);
bt1.setBounds(100,200,80,50); //set button size, location
bt2.setBounds(300,200,80,50); //set button size, location
cont.add(bt1); //add button on container
cont.add(bt2); //add button on container
bt1.addActionListener(this); //set acitonListener to button
bt2.addActionListener(this); //set acitonListener to button
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// exit button
frame.setSize(500,500); //set frame size
frame.getContentPane().setBackground(Color.black); // set background color
frame.setVisible(true); //프레임이 보이도록 설정
}
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(bt1)) {
new GetInfoGui("감염 위험도 측정");
}
else if(e.getSource().equals(bt2)) {
System.out.println("아직 미구현\n");
}
}
}
|
[
"[email protected]"
] | |
344422c176867e5a69ee8be2bf42d3ffc614cc91
|
4e4bfb6f5713058d50a7bdd021d198476bd8825d
|
/PetPlanner/app/src/main/java/com/example/petplanner/AlarmActivity.java
|
cb20988ae454d3718a5d9b4f321da7810fe067fa
|
[
"MIT"
] |
permissive
|
beejohnson/java-kotlin-bajohnson
|
92adb0c8e15d03b7e3e0710bc2d0308f48b752bf
|
96ec5e14911ab42f578ac799105efccc301f56c5
|
refs/heads/master
| 2023-01-19T23:37:08.989897 | 2020-11-27T20:32:45 | 2020-11-27T20:32:45 | 290,834,190 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,113 |
java
|
package com.example.petplanner;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.ToggleButton;
import java.util.Calendar;
public class AlarmActivity extends Activity {
AlarmManager alarmManager;
private PendingIntent pendingIntent;
private TimePicker alarmTimePicker;
private static AlarmActivity inst;
private TextView alarmTextView;
public static AlarmActivity instance() {
return inst;
}
@Override
public void onStart() {
super.onStart();
inst = this;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_alarm);
alarmTimePicker = (TimePicker) findViewById(R.id.alarmTimePicker);
alarmTextView = (TextView) findViewById(R.id.alarmText);
ToggleButton alarmToggle = (ToggleButton) findViewById(R.id.alarmToggle);
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
}
public void onToggleClicked(View view) {
if (((ToggleButton) view).isChecked()) {
Log.d("MyActivity", "Alarm On");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, alarmTimePicker.getCurrentHour());
calendar.set(Calendar.MINUTE, alarmTimePicker.getCurrentMinute());
Intent myIntent = new Intent(AlarmActivity.this, AlarmReceiver.class);
pendingIntent = PendingIntent.getBroadcast(AlarmActivity.this, 0, myIntent, 0);
alarmManager.set(AlarmManager.RTC, calendar.getTimeInMillis(), pendingIntent);
} else {
alarmManager.cancel(pendingIntent);
setAlarmText("");
Log.d("MyActivity", "Alarm Off");
}
}
public void setAlarmText(String alarmText) {
alarmTextView.setText(alarmText);
}
}
|
[
"[email protected]"
] | |
71517010a5282d9806a5461086a80dc75e495bd8
|
b8cbf4bf4aa422b7afd4fdba673aeb28e69e522d
|
/src/com/luoxn28/tomjson/serializer/ObjectSerializer.java
|
b91bbfc1134da84b4a1d98bb29d90106c9ced134
|
[
"Apache-2.0"
] |
permissive
|
luoxn28/tomjson
|
6b901aa9f14dfe7132cd391197addfb7f87369b3
|
62c59ad4c6cf4756b46a7bf41a86433c161310de
|
refs/heads/master
| 2020-02-26T16:31:17.123886 | 2016-07-29T13:05:24 | 2016-07-29T13:05:24 | 63,688,914 | 3 | 4 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,506 |
java
|
package com.luoxn28.tomjson.serializer;
import com.luoxn28.tomjson.SerializerContext;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/**
* ObjectSerializer - Object序列化类
*
* @author luoxn28
* @date 2016.7.21
*/
public class ObjectSerializer implements JsonSerializer {
private static SerializerContext config = SerializerContext.instance();
@Override
public void write(String name, Object object, SerializerBuffer buffer) {
try {
// name为null表示是Root Object
if (name == null) {
Class clazz = object.getClass();
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
String key = field.getName();
PropertyDescriptor descriptor = new PropertyDescriptor(key, clazz);
Method method = descriptor.getReadMethod();
Object value = method.invoke(object);
JsonSerializer write = config.getObject(value.getClass());
write.write(key, value, buffer);
}
}
else {
SerializerBuffer subBuffer = new SerializerBuffer();
write(null, object, subBuffer);
buffer.append(object, "\"" + name + "\":" + subBuffer.toString());
}
}
catch (Exception e) {
e.printStackTrace();
}
}
}
|
[
"[email protected]"
] | |
4c98655e3baea478197db9bad04c79681d4322c1
|
66ff7b76ac529c3ec524278c1b8eb3b3b22facfe
|
/core/src/test/java/org/bitcoinj/utils/ExchangeRateTest.java
|
c31a28d12695138c4dd6f039416a0aff21ccafd1
|
[
"Apache-2.0"
] |
permissive
|
sdaftuar/bitcoinj
|
a02184eea5212e6e14b460017235e4209e4bacfc
|
953625de9bd9d3ab13536def9368ca0e566ad2ae
|
refs/heads/master
| 2020-12-27T12:02:57.649076 | 2014-10-02T14:19:44 | 2014-10-02T14:19:44 | 24,731,585 | 2 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,027 |
java
|
/*
* Copyright 2014 Andreas Schildbach
*
* 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.bitcoinj.utils;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.bitcoinj.core.Coin;
public class ExchangeRateTest {
@Test
public void normalRate() throws Exception {
ExchangeRate rate = new ExchangeRate(Fiat.parseFiat("EUR", "500"));
assertEquals("0.5", rate.coinToFiat(Coin.MILLICOIN).toPlainString());
assertEquals("0.002", rate.fiatToCoin(Fiat.parseFiat("EUR", "1")).toPlainString());
}
@Test
public void bigRate() throws Exception {
ExchangeRate rate = new ExchangeRate(Coin.parseCoin("0.0001"), Fiat.parseFiat("BYR", "5320387.3"));
assertEquals("53203873000", rate.coinToFiat(Coin.COIN).toPlainString());
assertEquals("0", rate.fiatToCoin(Fiat.parseFiat("BYR", "1")).toPlainString()); // Tiny value!
}
@Test
public void smallRate() throws Exception {
ExchangeRate rate = new ExchangeRate(Coin.parseCoin("1000"), Fiat.parseFiat("XXX", "0.0001"));
assertEquals("0", rate.coinToFiat(Coin.COIN).toPlainString()); // Tiny value!
assertEquals("10000000", rate.fiatToCoin(Fiat.parseFiat("XXX", "1")).toPlainString());
}
@Test(expected = IllegalArgumentException.class)
public void currencyCodeMismatch() throws Exception {
ExchangeRate rate = new ExchangeRate(Fiat.parseFiat("EUR", "500"));
rate.fiatToCoin(Fiat.parseFiat("USD", "1"));
}
}
|
[
"[email protected]"
] | |
e55923d311a1ecfb5ab46ccdfb7e54d6ce193b27
|
06958bedfa3e2372f47531edb5b62e8e37f665e2
|
/src/menu/Item.java
|
36e77ae302cffd652845e7080cea0c279f65d6de
|
[] |
no_license
|
PDF-Origami/CEID-OOP
|
07781f7f122fd7991bb9a5cbffea534a20b118bb
|
a4f2ae2bd2be262ec91053cf5672dde1dd7be511
|
refs/heads/master
| 2023-05-23T17:00:03.986348 | 2021-06-07T19:30:59 | 2021-06-07T19:30:59 | 359,822,926 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,297 |
java
|
package menu;
import users.Organization;
import java.lang.reflect.Method;
public class Item {
private Menu parentMenu;
private Menu nextMenu = null;
private final String label;
private final String actionMethodName;
public Item(String label, String actionMethodName) {
this.label = label;
this.actionMethodName = actionMethodName;
}
public Item(String label, String actionMethodName, Menu nextMenu) {
this.label = label;
this.actionMethodName = actionMethodName;
this.nextMenu = nextMenu;
}
public Menu getNextMenu() {
return nextMenu;
}
public void setParentMenu(Menu parentMenu) {
this.parentMenu = parentMenu;
}
public boolean executeAction() {
if (actionMethodName.equals("")) {
return false;
}
try {
Class<?> cls = Class.forName("menu.Executor");
Method method = cls.getDeclaredMethod(actionMethodName);
return (boolean) method.invoke(null);
} catch (Throwable e) {
System.err.println(e);
return false;
}
}
@Override
public String toString() { return label; }
}
// Item: option that opens a new Menu and/or performs an action
// Menu: list of Items
|
[
"[email protected]"
] | |
b08fda7911cab22a520b4682f15957d8ee36bcad
|
aacb137c54e38e4b43e114959cae846a81143271
|
/springbookCh7/src/springbook/user/sqlservice/SqlRetrievalFailureException.java
|
85468c043913c9a6d4288df0cfa33d6f8c5f38fe
|
[] |
no_license
|
Han-Git/sts_project
|
c6bda636fab466c0a727d40d30f8146ab3f43678
|
e94e1ae29d81ee615d87e2632ccafdf8eef1de62
|
refs/heads/master
| 2020-04-06T07:00:00.196104 | 2017-05-09T11:48:04 | 2017-05-09T11:48:04 | 50,900,633 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 286 |
java
|
package springbook.user.sqlservice;
public class SqlRetrievalFailureException extends RuntimeException {
public SqlRetrievalFailureException(String message){
super(message);
}
public SqlRetrievalFailureException(String message, Throwable cause){
super(message, cause);
}
}
|
[
"[email protected]"
] | |
2aab444b84fbb7bebec1421e25d13b3e68d95498
|
9d32980f5989cd4c55cea498af5d6a413e08b7a2
|
/A1_7_1_1/src/main/java/org/apache/http/UnsupportedHttpVersionException.java
|
1859cdf8734b397803eda1eaf2c4ed0df76510b1
|
[] |
no_license
|
liuhaosource/OppoFramework
|
e7cc3bcd16958f809eec624b9921043cde30c831
|
ebe39acabf5eae49f5f991c5ce677d62b683f1b6
|
refs/heads/master
| 2023-06-03T23:06:17.572407 | 2020-11-30T08:40:07 | 2020-11-30T08:40:07 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,018 |
java
|
package org.apache.http;
/* JADX ERROR: NullPointerException in pass: ExtractFieldInit
java.lang.NullPointerException
at jadx.core.utils.BlockUtils.isAllBlocksEmpty(BlockUtils.java:546)
at jadx.core.dex.visitors.ExtractFieldInit.getConstructorsList(ExtractFieldInit.java:221)
at jadx.core.dex.visitors.ExtractFieldInit.moveCommonFieldsInit(ExtractFieldInit.java:121)
at jadx.core.dex.visitors.ExtractFieldInit.visit(ExtractFieldInit.java:46)
at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:12)
at jadx.core.ProcessClass.process(ProcessClass.java:32)
at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292)
at jadx.api.JavaClass.decompile(JavaClass.java:62)
at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)
*/
@Deprecated
public class UnsupportedHttpVersionException extends ProtocolException {
private static final long serialVersionUID = -1348448090193107031L;
/* JADX ERROR: Method load error
jadx.core.utils.exceptions.DecodeException: Load method exception: bogus opcode: 0073 in method: org.apache.http.UnsupportedHttpVersionException.<init>():void, dex:
at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:118)
at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:248)
at jadx.core.ProcessClass.process(ProcessClass.java:29)
at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292)
at jadx.api.JavaClass.decompile(JavaClass.java:62)
at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)
Caused by: java.lang.IllegalArgumentException: bogus opcode: 0073
at com.android.dx.io.OpcodeInfo.get(OpcodeInfo.java:1227)
at com.android.dx.io.OpcodeInfo.getName(OpcodeInfo.java:1234)
at jadx.core.dex.instructions.InsnDecoder.decode(InsnDecoder.java:581)
at jadx.core.dex.instructions.InsnDecoder.process(InsnDecoder.java:74)
at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:104)
... 5 more
*/
public UnsupportedHttpVersionException() {
/*
// Can't load method instructions: Load method exception: bogus opcode: 0073 in method: org.apache.http.UnsupportedHttpVersionException.<init>():void, dex:
*/
throw new UnsupportedOperationException("Method not decompiled: org.apache.http.UnsupportedHttpVersionException.<init>():void");
}
/* JADX ERROR: Method load error
jadx.core.utils.exceptions.DecodeException: Load method exception: bogus opcode: 0073 in method: org.apache.http.UnsupportedHttpVersionException.<init>(java.lang.String):void, dex:
at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:118)
at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:248)
at jadx.core.ProcessClass.process(ProcessClass.java:29)
at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292)
at jadx.api.JavaClass.decompile(JavaClass.java:62)
at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)
Caused by: java.lang.IllegalArgumentException: bogus opcode: 0073
at com.android.dx.io.OpcodeInfo.get(OpcodeInfo.java:1227)
at com.android.dx.io.OpcodeInfo.getName(OpcodeInfo.java:1234)
at jadx.core.dex.instructions.InsnDecoder.decode(InsnDecoder.java:581)
at jadx.core.dex.instructions.InsnDecoder.process(InsnDecoder.java:74)
at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:104)
... 5 more
*/
public UnsupportedHttpVersionException(java.lang.String r1) {
/*
// Can't load method instructions: Load method exception: bogus opcode: 0073 in method: org.apache.http.UnsupportedHttpVersionException.<init>(java.lang.String):void, dex:
*/
throw new UnsupportedOperationException("Method not decompiled: org.apache.http.UnsupportedHttpVersionException.<init>(java.lang.String):void");
}
}
|
[
"[email protected]"
] | |
5410d4646b21831f73ff646a415be45541c786a7
|
1c92e6924b9fae0ef17959fa6f2d0619643e5a36
|
/src/main/java/elasticSeri/ElasticSearchTestSeri.java
|
bd3a0e8778c0cef09a83f5b129c0709cf3955da5
|
[] |
no_license
|
jiayamy/FEK-log-controller
|
db86736f50656c02d6d587b0e2d7e867f8258fc0
|
60b5d7cbad25a09cefb1acbff24f5c2d2687ca92
|
refs/heads/master
| 2021-07-13T06:54:55.164342 | 2017-10-16T03:17:31 | 2017-10-16T03:17:31 | 107,072,508 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,388 |
java
|
package elasticSeri;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.flume.Context;
import org.apache.flume.Event;
import org.apache.flume.conf.ComponentConfiguration;
import org.apache.flume.sink.elasticsearch.ContentBuilderUtil;
import org.apache.flume.sink.elasticsearch.ElasticSearchEventSerializer;
import org.elasticsearch.common.collect.Maps;
import org.elasticsearch.common.xcontent.XContentBuilder;
/**
* Serialize flume events into the same format LogStash uses</p>
*
* This can be used to send events to ElasticSearch and use clients such as
* Kabana which expect Logstash formated indexes
*
* <pre>
* {
* "@timestamp": "2010-12-21T21:48:33.309258Z",
* "@tags": [ "array", "of", "tags" ],
* "@type": "string",
* "@source": "source of the event, usually a URL."
* "@source_host": ""
* "@source_path": ""
* "@fields":{
* # a set of fields for this event
* "user": "jordan",
* "command": "shutdown -r":
* }
* "@message": "the original plain-text message"
* }
* </pre>
*
* If the following headers are present, they will map to the above logstash
* output as long as the logstash fields are not already present.</p>
*
* <pre>
* timestamp: long -> @timestamp:Date
* host: String -> @source_host: String
* src_path: String -> @source_path: String
* type: String -> @type: String
* source: String -> @source: String
* </pre>
*
* @see https
* ://github.com/logstash/logstash/wiki/logstash%27s-internal-message-
* format
*/
public class ElasticSearchTestSeri implements
ElasticSearchEventSerializer {
private static String[] ignoreStrs = new String[]{"msg","qurity"};
private static List<String> ignores = new ArrayList<String>();
public XContentBuilder getContentBuilder(Event event) throws IOException {
XContentBuilder builder = jsonBuilder().startObject();
init();
appendBody(builder, event);
appendHeaders(builder, event);
return builder;
}
private void init() {
for(String str : ignoreStrs){
ignores.add(str);
}
}
private void appendBody(XContentBuilder builder, Event event)
throws IOException, UnsupportedEncodingException {
byte[] body = event.getBody();
ContentBuilderUtil.appendField(builder, "@message", body);
}
private void appendHeaders(XContentBuilder builder, Event event)
throws IOException {
Map<String, String> headers = Maps.newHashMap(event.getHeaders());
String timestamp = headers.get("timestamp");
if (!StringUtils.isBlank(timestamp)
&& StringUtils.isBlank(headers.get("@timestamp"))) {
long timestampMs = Long.parseLong(timestamp);
builder.field("@timestamp", new Date(timestampMs));
}
String source = headers.get("source");
if (!StringUtils.isBlank(source)
&& StringUtils.isBlank(headers.get("@source"))) {
ContentBuilderUtil.appendField(builder, "@source",
source.getBytes(charset));
}
String type = headers.get("type");
if (!StringUtils.isBlank(type)
&& StringUtils.isBlank(headers.get("@type"))) {
ContentBuilderUtil.appendField(builder, "@type", type.getBytes(charset));
}
String host = headers.get("host");
if (!StringUtils.isBlank(host)
&& StringUtils.isBlank(headers.get("@source_host"))) {
ContentBuilderUtil.appendField(builder, "@source_host",
host.getBytes(charset));
}
String srcPath = headers.get("src_path");
if (!StringUtils.isBlank(srcPath)
&& StringUtils.isBlank(headers.get("@source_path"))) {
ContentBuilderUtil.appendField(builder, "@source_path",
srcPath.getBytes(charset));
}
builder.startObject("@fields");
for (String key : headers.keySet()) {
if(key.equals("cost-time")){
builder.field("@cost-time", Long.parseLong(headers.get(key)));
continue;
}
if(ignores.contains(key)){
continue;
}
byte[] val = headers.get(key).getBytes(charset);
ContentBuilderUtil.appendField(builder, key, val);
}
builder.endObject();
}
public void configure(Context context) {
// NO-OP...
}
public void configure(ComponentConfiguration conf) {
// NO-OP...
}
}
|
[
"[email protected]"
] | |
df3e2e53be4413513176701c1008a643552ddefc
|
5918b3c044cc8896c45ca7a761b8f46dcfdead10
|
/app/src/main/java/com/android/eos/ui/fragment/MineFragment.java
|
27463db2687cd3084f79150c32f892396ce7b932
|
[] |
no_license
|
luojialun/EOS
|
f6feb37e97e6a5cd3b029d8ce0ae84aa16ac21d1
|
8a875b284e3ae74e3d5df506ddaeef3a50504088
|
refs/heads/master
| 2020-04-05T15:15:37.915233 | 2018-11-19T14:51:41 | 2018-11-19T14:51:41 | 156,961,292 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,592 |
java
|
package com.android.eos.ui.fragment;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.android.eos.R;
import com.android.eos.base.BaseFragment;
import com.android.eos.data.UserInfo;
import com.android.eos.ui.activity.AboutUsActivity;
import com.android.eos.ui.activity.CollectionCodeActivity;
import com.android.eos.ui.activity.CreateIdentityActivity;
import com.android.eos.ui.activity.HelpAndFeedbackActivity;
import com.android.eos.ui.activity.MyIdentityActivity;
import com.android.eos.ui.activity.MyRecommandActivity;
import com.android.eos.ui.activity.UseSettingActivity;
import com.android.eos.ui.activity.UserAgreementActivity;
import com.android.eos.utils.ConstantUtils;
import butterknife.BindView;
import butterknife.OnClick;
/**
* 我的页面
*/
public class MineFragment extends BaseFragment {
@BindView(R.id.name_tv)
TextView nameTv;
@BindView(R.id.address_tv)
TextView addressTv;
@Override
public int setViewId() {
return R.layout.fragment_mine;
}
@Override
public void initView() {
nameTv.setText(UserInfo.getAccount());
addressTv.setText(UserInfo.getAccount());
}
@Override
public void initData() {
}
@OnClick({R.id.collectionCode_ll, R.id.use_setting_rl, R.id.avatar_iv, R.id.help_feedback_rl, R.id.user_agreement_rl, R.id.about_us_rl, R.id.my_recommand_btn})
public void onClick(View view) {
switch (view.getId()) {
case R.id.collectionCode_ll:
startActivity(new Intent(getActivity(), CollectionCodeActivity.class).putExtra(ConstantUtils.ACCOUNT, UserInfo.getAccount()));
break;
case R.id.use_setting_rl:
readyGo(UseSettingActivity.class);
break;
case R.id.avatar_iv:
if (TextUtils.isEmpty(UserInfo.getName())) {
readyGo(CreateIdentityActivity.class);
} else {
readyGo(MyIdentityActivity.class);
}
break;
case R.id.help_feedback_rl:
readyGo(HelpAndFeedbackActivity.class);
break;
case R.id.user_agreement_rl:
readyGo(UserAgreementActivity.class);
break;
case R.id.about_us_rl:
readyGo(AboutUsActivity.class);
break;
case R.id.my_recommand_btn:
readyGo(MyRecommandActivity.class);
break;
}
}
}
|
[
"[email protected]"
] | |
8e72e8a3bdcbe73f109edc5088d4d76364461f8d
|
20eb62855cb3962c2d36fda4377dfd47d82eb777
|
/newEvaluatedBugs/Jsoup_2_buggy/mutated/1001/Tokeniser.java
|
185d38a904c8c63c0f81bb919f7e05fbfb60a026
|
[] |
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 | 10,571 |
java
|
package org.jsoup.parser;
import org.jsoup.helper.Validate;
import org.jsoup.nodes.Entities;
import java.util.Arrays;
/**
* Readers the input stream into tokens.
*/
final class Tokeniser {
static final char replacementChar = '\uFFFD'; // replaces null character
private static final char[] notCharRefCharsSorted = new char[]{'\t', '\n', '\r', '\f', ' ', '<', '&'};
static {
Arrays.sort(notCharRefCharsSorted);
}
private final CharacterReader reader; // html input
private final ParseErrorList errors; // errors found while tokenising
private TokeniserState state = TokeniserState.Data; // current tokenisation state
private Token emitPending; // the token we are about to emit on next read
private boolean isEmitPending = false;
private String charsString = null; // characters pending an emit. Will fall to charsBuilder if more than one
private StringBuilder charsBuilder = new StringBuilder(1024); // buffers characters to output as one token, if more than one emit per read
StringBuilder dataBuffer = new StringBuilder(1024); // buffers data looking for </script>
Token.Tag tagPending; // tag we are building up
Token.StartTag startPending = new Token.StartTag();
Token.EndTag endPending = new Token.EndTag();
Token.Character charPending = new Token.Character();
Token.Doctype doctypePending = new Token.Doctype(); // doctype building up
Token.Comment commentPending = new Token.Comment(); // comment building up
private String lastStartTag; // the last start tag emitted, to test appropriate end tag
private boolean selfClosingFlagAcknowledged = true;
Tokeniser(CharacterReader reader, ParseErrorList errors) {
this.reader = reader;
this.errors = errors;
}
Token read() {
if (!selfClosingFlagAcknowledged) {
error("Self closing flag not acknowledged");
selfClosingFlagAcknowledged = true;
}
while (!isEmitPending)
state.read(this, reader);
// if emit is pending, a non-character token was found: return any chars in buffer, and leave token for next read:
if (charsBuilder.length() > 0) {
String str = charsBuilder.toString();
charsBuilder.delete(0, charsBuilder.length());
charsString = null;
return charPending.data(str);
} else if (charsString != null) {
Token token = charPending.data(charsString);
charsString = null;
return token;
} else {
isEmitPending = false;
return emitPending;
}
}
void emit(Token token) {
Validate.isFalse(isEmitPending, "There is an unread token pending!");
emitPending = token;
isEmitPending = true;
if (token.type == Token.TokenType.StartTag) {
Token.StartTag startTag = (Token.StartTag) token;
lastStartTag = startTag.tagName;
if (startTag.selfClosing)
selfClosingFlagAcknowledged = false;
} else if (token.type == Token.TokenType.EndTag) {
Token.EndTag endTag = (Token.EndTag) token;
if (endTag.attributes != null)
error("Attributes incorrectly present on end tag");
}
}
void emit(final String str) {
// buffer strings up until last string token found, to emit only one token for a run of character refs etc.
// does not set isEmitPending; read checks that
if (charsString == null) {
charsString = str;
}
else {
if (charsBuilder.length() == 0) { // switching to string builder as more than one emit before read
charsBuilder.append(charsString);
}
charsBuilder.append(str);
}
}
void emit(char[] chars) {
emit(String.valueOf(chars));
}
void emit(int[] codepoints) {
emit(new String(codepoints, 0, codepoints.length));
}
void emit(char c) {
emit(String.valueOf(c));
}
TokeniserState getState() {
return state;
}
void transition(TokeniserState state) {
this.state = state;
}
void advanceTransition(TokeniserState state) {
reader.advance();
this.state = state;
}
void acknowledgeSelfClosingFlag() {
selfClosingFlagAcknowledged = true;
}
final private int[] codepointHolder = new int[1]; // holder to not have to keep creating arrays
final private int[] multipointHolder = new int[2];
int[] consumeCharacterReference(Character additionalAllowedCharacter, boolean inAttribute) {
if (reader.isEmpty())
return null;
if (additionalAllowedCharacter != null && additionalAllowedCharacter == reader.current())
return null;
if (reader.matchesAnySorted(notCharRefCharsSorted))
return null;
final int[] codeRef = codepointHolder;
reader.mark();
if (reader.matchConsume("#")) { // numbered
boolean isHexMode = reader.matchConsumeIgnoreCase("X");
String numRef = isHexMode ? reader.consumeHexSequence() : reader.consumeDigitSequence();
if (numRef.length() == 0) { // didn't match anything
characterReferenceError("numeric reference with no numerals");
reader.rewindToMark();
return null;
}
if (!reader.matchConsume(";"))
characterReferenceError("missing semicolon"); // missing semi
int charval = -1;
try {
int base = isHexMode ? 16 : 10;
charval = Integer.valueOf(numRef, base);
} catch (NumberFormatException ignored) {
} // skip
if (charval == -1 || (charval >= 0xD800 && charval <= 0xDFFF) || charval > 0x10FFFF) {
characterReferenceError("character outside of valid range");
codeRef[0] = replacementChar;
return codeRef;
} else {
// todo: implement number replacement table
// todo: check for extra illegal unicode points as parse errors
codeRef[0] = charval;
return codeRef;
}
} else { // named
// get as many letters as possible, and look for matching entities.
String nameRef = reader.consumeLetterThenDigitSequence();
boolean looksLegit = reader.matches(';');
// found if a base named entity without a ;, or an extended entity with the ;.
boolean found = (Entities.isBaseNamedEntity(nameRef) || (Entities.isNamedEntity(nameRef) && looksLegit));
if (!found) {
characterReferenceError("missing semicolon");
reader.rewindToMark();
if (looksLegit) // named with semicolon
characterReferenceError(String.format("invalid named referenece '%s'", nameRef));
return null;
}
if (inAttribute && (reader.matchesLetter() || reader.matchesDigit() || reader.matchesAny('=', '-', '_'))) {
// don't want that to match
reader.rewindToMark();
return null;
}
if (!reader.matchConsume(";"))
characterReferenceError("missing semicolon"); // missing semi
int numChars = Entities.codepointsForName(nameRef, multipointHolder);
if (numChars == 1) {
codeRef[0] = multipointHolder[0];
return codeRef;
} else if (numChars ==2) {
return multipointHolder;
} else {
Validate.fail("Unexpected characters returned for " + nameRef);
return multipointHolder;
}
}
}
Token.Tag createTagPending(boolean start) {
tagPending = start ? startPending.reset() : endPending.reset();
return tagPending;
}
void emitTagPending() {
tagPending.finaliseTag();
emit(tagPending);
}
void createCommentPending() {
commentPending.reset();
}
void emitCommentPending() {
emit(commentPending);
}
void createDoctypePending() {
doctypePending.reset();
}
void emitDoctypePending() {
emit(doctypePending);
}
void createTempBuffer() {
Token.reset(dataBuffer);
}
boolean isAppropriateEndTagToken() {
return lastStartTag != null && tagPending.name().equalsIgnoreCase(lastStartTag);
}
String appropriateEndTagName() {
if (lastStartTag == null)
return null;
return lastStartTag;
}
void error(TokeniserState state) {
if (errors.canAddError())
errors.add(new ParseError(reader.pos(), "Unexpected character '%s' in input state [%s]", reader.current(), state));
}
void eofError(TokeniserState state) {
if (errors.canAddError())
errors.add(new ParseError(reader.pos(), "Unexpectedly reached end of file (EOF) in input state [%s]", state));
}
private void characterReferenceError(String message) {
if (errors.canAddError())
errors.add(new ParseError(reader.pos(), "Invalid character reference: %s", message));
}
private void error(String errorMsg) {
if (errors.canAddError())
errors.add(new ParseError(reader.pos(), errorMsg));
}
boolean currentNodeInHtmlNS() {
// todo: implement namespaces correctly
return true;
// Element currentNode = currentNode();
// return currentNode != null && currentNode.namespace().equals("HTML");
}
/**
* Utility method to consume reader and unescape entities found within.
* @param inAttribute
* @return unescaped string from reader
*/
String unescapeEntities(boolean inAttribute) {
StringBuilder builder = new StringBuilder();
while (!reader.isEmpty()) {
builder.append(reader.consumeTo('&'));
if (reader.matches('&')) {
reader.consume();
int[] c = consumeCharacterReference(null, inAttribute);
if (c == null || c.length==0)
builder.append('&');
else {
builder.appendCodePoint(c[0]);
if (c.length == 2)
builder.appendCodePoint(c[1]);
}
}
}
return builder.toString();
}
}
|
[
"[email protected]"
] | |
f00af81e06205e6318537d100ab257433363bc4c
|
8163d35632a93626a683ea4c7b058b1a008d10dd
|
/Game.java
|
6ee876499a661ff77b73405b519730e4207c8b56
|
[] |
no_license
|
KoujiMinamoto/-Worldcup-
|
8f61f9d5f8ef1de9613e756430cbebbd2b8400a6
|
a2640ce57979237ddaf932dbb5192636d13066de
|
refs/heads/master
| 2020-03-14T16:19:13.645283 | 2018-05-28T03:27:06 | 2018-05-28T03:27:06 | 131,695,909 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 22,367 |
java
|
import java.util.*;
import java.lang.*;
import java.io.*;
public class Game
{
private Database newteamList;
Menu menu = new Menu();
RandomGoalsGenerator Random = new RandomGoalsGenerator();
String winner;
String goldenboot;
String FairPlayAward;
String team;
String player;
boolean A = false; //to make sure if it play A first
public Game()
{
newteamList = new Database();
winner = "";
goldenboot = "";
FairPlayAward = "";
team = "";
player = "";
}
public void playGame()
{
Team team = new Team();
readFile();
boolean exit = false;
int i = 0;
while(i < 4)
{
ArrayList<Team> resultList = newteamList.getTeams();
System.out.println("Please insert playername for "+ resultList.get(i).getName());
SetPlayerName(i);
i++;
}
Scanner input = new Scanner(System.in);
while (!exit)
{
menu.displaymenu();
//insert case
String iobuffer = input.nextLine();
System.out.println(" ");
if (validBlank(iobuffer))
{
String iobuffer1 = iobuffer.toUpperCase();
char option = iobuffer1.charAt(0);
switch(option)
{
case 'A': Preliminary();
totalpoint();
sort();
display();
sortPlayer();
A = true;
break;
case 'B': if(A == true)
{
Final();
totalpoint();
sort();
sortFair();
sortPlayer();
}
else
{
System.out.println("Please play Preliminary Stage first ");
}
break;
case 'C': displayC();
break;
case 'D': displayD();
break;
case 'E': Displayfinal();
break;
case 'X': writeFile();
exit = true;
System.out.println("Goodbye. ");
break;
}
}
}
}
public void Displayfinal()
{
System.out.println("Football World Cup Winner: "+winner);
System.out.println("Golden Boot Award: "+goldenboot);
System.out.println("Fair Play Award: "+FairPlayAward);
}
public void Preliminary()
{
int a= 0;
int b;
int goalfora = 0;
int goalforb = 0;
while(a<=3)
{
b= a+1;
while(b<=3)
{
int reda = 0;
int yellowa = 0;
int redb = 0;
int yellowb = 0;
int goala = 0;
int goalb = 0;
ArrayList<Team> resultList = newteamList.getTeams();
if(resultList.get(a).getRank() > resultList.get(b).getRank())
{
goala = Random.GenerateRandomNumber(5-resultList.get(a).getRank()+resultList.get(b).getRank()+Random.GenerateRandomNumber(2));
goalb = Random.GenerateRandomNumber(5+Random.GenerateRandomNumber(2));
}
else if(resultList.get(a).getRank() < resultList.get(b).getRank())
{
goalb = Random.GenerateRandomNumber(5-resultList.get(b).getRank()+resultList.get(a).getRank()+Random.GenerateRandomNumber(2));
goala = Random.GenerateRandomNumber(5+Random.GenerateRandomNumber(2));
}
else
{
}
reda = Random.GenerateRandomNumber(1);
yellowa = Random.GenerateRandomNumber(4);
redb = Random.GenerateRandomNumber(1);
yellowb = Random.GenerateRandomNumber(4);
displayGameResult(resultList.get(a).getName(),resultList.get(b).getName(),goala,goalb,reda,redb,yellowa,yellowb);
if(goala>goalb)
{
newteamList.addwin(1,0,0,yellowa,reda,goala,a);
newteamList.addwin(0,0,1,yellowb,redb,goalb,b);
}
else if(goalb>goala)
{
newteamList.addwin(0,0,1,yellowa,reda,goala,a);
newteamList.addwin(1,0,0,yellowb,redb,goalb,b);
}
else
{
newteamList.addwin(0,1,0,yellowa,reda,goala,a);
newteamList.addwin(0,1,0,yellowb,redb,goalb,b);
}
goalfora = Random.GenerateRandomNumber(goala);
goalforb = Random.GenerateRandomNumber(goalb);
newteamList.addgoal(goalfora,goala-goalfora,a);
newteamList.addgoal(goalforb,goalb-goalforb,b);
b++;
}
a++;
}
}
public void SetPlayerName(int numberofteam)
{
Team ranklist = new Team();
Scanner input = new Scanner(System.in);
System.out.println("=== Add Player ===");
System.out.println("Please insert 1st playername:");
String newname = input.nextLine();
if(validplayername(newname)==false)
{
System.out.println("=== Add Player ===");
System.out.println("Please insert 1st playername again:");
String newname1 = input.nextLine();
if(validplayername(newname1)==false)
{
System.out.println("use default name:");
newname = newteamList.getTeams().get(numberofteam).getName()+"-1-player";
}
else
{
newname = newname1;
}
}
System.out.println("=== Add Player ===");
System.out.println("Please insert 2st playername:");
String new2name = input.nextLine();
if(new2name.equals(newname)||validplayername(new2name)==false)
{
System.out.println("=== Add Player ===");
System.out.println("Please insert 2st playername again:");
String newname2 = input.nextLine();
if(new2name.equals(newname)||validplayername(newname2)==false)
{
System.out.println("use default name:");
new2name = newteamList.getTeams().get(numberofteam).getName()+"-2-player";
}
else
{
new2name = newname2;
}
}
newteamList.addplayer(newname,new2name,numberofteam);
}
public void totalpoint()
{
int totalpoint = 0;
int a = 0 ;
ArrayList<Team> resultList = newteamList.getTeams();
while(a<=3)
{
totalpoint = (resultList.get(a).getWon() * 3 + resultList.get(a).getDrawn());
newteamList.addpoint(totalpoint,a);
a++;
}
}
public void sort()
{
ArrayList<Team> sortlist = newteamList.getTeams();
Team sort;
for(int a = 0; a < 3; a++)
{
for(int b = 1;b < 4 - a; b++)
{
if(sortlist.get(b - 1).getPoint() > sortlist.get(b).getPoint())
{
sort = sortlist.get(b-1);
newteamList.getTeams().set((b-1),sortlist.get(b));
newteamList.getTeams().set(b,sort);
}
if(sortlist.get(b - 1).getPoint() == sortlist.get(b).getPoint())
{
if(sortlist.get(b - 1).getGoal() > sortlist.get(b).getGoal())
{
sort = sort = sortlist.get(b - 1);
newteamList.getTeams().set((b - 1),sortlist.get(b));
newteamList.getTeams().set(b,sort);
}
if(sortlist.get(b - 1).getGoal() == sortlist.get(b).getGoal())
{
int random = Random.GenerateRandomNumber(1);
if(random == 1)
{
sort = sort = sortlist.get(b - 1);
newteamList.getTeams().set((b - 1),sortlist.get(b));
newteamList.getTeams().set(b,sort);
}
}
}
}
}
}
public void sortFair()
{
for(int a = 0; a < 4; a++)
{
newteamList.addfair(a);
}
ArrayList<Team> sortlist = newteamList.getTeams();
ArrayList<Team> sortfairlist = sortlist;
Team sort;
for(int a = 0; a < 3; a++)
{
for(int b=1;b<4-a;b++)
{
if(sortlist.get(b - 1).getFair() > sortlist.get(b).getFair())
{
sort = sortlist.get(b-1);
sortfairlist.set((b-1),sortlist.get(b));
sortfairlist.set(b,sort);
}
}
}
if(sortfairlist.get(0).getFair() == sortfairlist.get(1).getFair() )
{
if(sortfairlist.get(1).getFair() == sortfairlist.get(2).getFair())
{
FairPlayAward = sortfairlist.get(0).getName() + " and " + sortfairlist.get(1).getName() + " and " + sortfairlist.get(2).getName();
}
else
FairPlayAward = sortfairlist.get(0).getName() + " and " + sortfairlist.get(1).getName();
}
else
FairPlayAward = sortfairlist.get(0).getName();
}
public void sortPlayer()
{
ArrayList<Player> sortplayerList;
sortplayerList = new ArrayList<Player>() ;
Player sortplayer;
for(int a = 0; a < 4; a++)
{
sortplayer = new Player();
sortplayer.setName(newteamList.getTeams().get(a).getPlayer1name() + " ("+newteamList.getTeams().get(a).getName() + ")");
sortplayer.setGoals(newteamList.getTeams().get(a).getPlayer1());
sortplayerList.add(sortplayer);
sortplayer = new Player();
sortplayer.setName(newteamList.getTeams().get(a).getPlayer2name() + " (" + newteamList.getTeams().get(a).getName() + ")");
sortplayer.setGoals(newteamList.getTeams().get(a).getPlayer2());
sortplayerList.add(sortplayer);
}
Player sort;
ArrayList<Player> sortlist = sortplayerList ;
for(int a = 0; a < 7; a++)
{
for(int b = 1; b < 8-a; b++)
{
if(sortlist.get(b-1).getGoals() > sortlist.get(b).getGoals())
{
sort = sortlist.get(b-1);
sortplayerList.set((b-1),sortlist.get(b));
sortplayerList.set(b,sort);
}
}
}
if(sortplayerList.get(7).getGoals() == sortplayerList.get(6).getGoals() )
{
if(sortplayerList.get(6).getGoals() == sortplayerList.get(5).getGoals())
{
goldenboot = sortplayerList.get(7).getName() + " and " + sortplayerList.get(6).getName() + " and " + sortplayerList.get(5).getName();
}
else
goldenboot = sortplayerList.get(7).getName() + " and " + sortplayerList.get(6).getName();
}
else
goldenboot = sortplayerList.get(7).getName();
if(A == false)
{
for(int i = 7; i >= 0; i--)
{
player = (player+"\n"+sortplayerList.get(i).getName() + " - " + sortplayerList.get(i).getGoals() + "\n" );
}
}
}
public void Final()
{
int a =3;
int b =2;
int goalfora = 0;
int goalforb = 0;
int reda = 0;
int yellowa = 0;
int redb = 0;
int yellowb = 0;
int goala = 0;
int goalb = 0;
ArrayList<Team> resultList = newteamList.getTeams();
if(resultList.get(a).getRank() > resultList.get(b).getRank())
{
goala = Random.GenerateRandomNumber(5-resultList.get(a).getRank()+resultList.get(b).getRank()+Random.GenerateRandomNumber(2));
goalb = Random.GenerateRandomNumber(5+Random.GenerateRandomNumber(2));
}
else if(resultList.get(a).getRank() < resultList.get(b).getRank())
{
goalb = Random.GenerateRandomNumber(5-resultList.get(b).getRank()+resultList.get(a).getRank()+Random.GenerateRandomNumber(2));
goala = Random.GenerateRandomNumber(5+Random.GenerateRandomNumber(2));
}
else
{
}
reda = Random.GenerateRandomNumber(1);
yellowa = Random.GenerateRandomNumber(4);
redb = Random.GenerateRandomNumber(1);
yellowb = Random.GenerateRandomNumber(4);
displayGameResult(resultList.get(a).getName(),resultList.get(b).getName(),goala,goalb,reda,redb,yellowa,yellowb);
if(goala>goalb)
{
newteamList.addwin(1,0,0,yellowa,reda,goala,a);
newteamList.addwin(0,0,1,yellowb,redb,goalb,b);
winner = resultList.get(a).getName();
}
else if(goalb>goala)
{
newteamList.addwin(0,0,1,yellowa,reda,goala,a);
newteamList.addwin(1,0,0,yellowb,redb,goalb,b);
winner = resultList.get(b).getName();
}
else
{
newteamList.addwin(0,0,0,yellowa,reda,goala,a);
newteamList.addwin(0,0,0,yellowb,redb,goalb,b);
playPenaltyShootOut(a,b);
}
goalfora = Random.GenerateRandomNumber(goala);
goalforb = Random.GenerateRandomNumber(goalb);
newteamList.addgoal(goalfora,goala-goalfora,a);
newteamList.addgoal(goalforb,goalb-goalforb,b);
}
public void displayGameResult(String teama, String teamb , int goala, int goalb ,int reda ,int redb ,int yellowa, int yellowb)
{
System.out.println(teama + goala +" vs. " +teamb + goalb);
if(yellowa > 0)
{
if(reda == 0)
{
System.out.println("Cards awarded:" + teama + "-" + yellowa + "yellowcard");
}
else
{
System.out.println("Cards awarded:" + teama + "-" + yellowa + "yellowcard " + reda + "redcard" );
}
}
if(yellowb > 0)
{
if(redb == 0)
{
System.out.println("Cards awarded:" + teamb + "-" + yellowb + "yellowcard");
}
else
{
System.out.println("Cards awarded:" + teamb + "-" + yellowb + "yellowcard " + redb +"redcard" );
}
}
}
public void playPenaltyShootOut(int a ,int b)
{
int a1,b1 = 0;
a1 = Random.GenerateRandomNumber(5);
b1 = Random.GenerateRandomNumber(5);
if(a1 > b1)
{
winner = newteamList.getTeams().get(a).getName();
newteamList.addwin(1,0,0,0,0,0,a);
newteamList.addwin(0,0,1,0,0,0,b);
}
else if(a1 < b1)
{
winner = newteamList.getTeams().get(b).getName();
newteamList.addwin(0,0,1,0,0,0,a);
newteamList.addwin(1,0,0,0,0,0,b);
}
else
{
while(a1 == b1)
{
a1 = Random.GenerateRandomNumber(1);
b1 = Random.GenerateRandomNumber(1);
}
if(a1 > b1)
{
winner = newteamList.getTeams().get(a).getName();
newteamList.addwin(1,0,0,0,0,0,a);
newteamList.addwin(0,0,1,0,0,0,b);
}
else if(a1 < b1)
{
winner = newteamList.getTeams().get(b).getName();
newteamList.addwin(0,0,1,0,0,0,a);
newteamList.addwin(1,0,0,0,0,0,b);
}
}
System.out.println("winner is :"+ winner );
}
private void readFile()
{
String filename = ("team.txt");
String teams;
Team loadFromFile;
try
{
FileReader inputFile = new FileReader(filename);
Scanner parser = new Scanner(inputFile);
int linecount = 0;
while (parser.hasNextLine())
{
loadFromFile = new Team();
teams = parser.nextLine();
String[] attribute = teams.split(",");
System.out.println ("Team"+ (linecount+1));
loadFromFile.setName(attribute[0]);
loadFromFile.setRank(convertStringtoInt(attribute[1]));
loadFromFile.displayTeamrecord();
newteamList.addteam(loadFromFile);
linecount++;
}
inputFile.close();
}
catch(FileNotFoundException exception)
{
System.out.println(filename + " not found");
}
catch(IOException exception)
{
System.out.println("Unexpected I/O error occured");
}
}
public void display()
{
System.out.println("Name played won lost drawn goals points fairplay");
for(int a = 3; a >= 0; a--)
{
ArrayList<Team> resultList = newteamList.getTeams();
String name = resultList.get(a).getName();
int played = resultList.get(a).getWon()+resultList.get(a).getDrawn()+resultList.get(a).getLost();
int fair = resultList.get(a).getRed()*2+resultList.get(a).getYellow();
System.out.println("\n" + name + " " + played + " " + resultList.get(a).getWon() + " " + resultList.get(a).getDrawn() + " " + resultList.get(a).getLost() + " " + resultList.get(a).getGoal() + " " + resultList.get(a).getPoint() + " " + fair);
team=(team + "\n"+ name + " " + played + " " + resultList.get(a).getWon() + " " + resultList.get(a).getDrawn() + " " + resultList.get(a).getLost() + " " + resultList.get(a).getGoal() + " " + resultList.get(a).getPoint() + " " + fair+"\n");
}
}
public void displayC()
{
System.out.println("Name played won lost drawn goals points fairplay");
System.out.println(team);
}
public void displayD()
{
System.out.println(player);
}
private int convertStringtoInt(String input) //method to convert String to Integer
{
//intialised variables
String S = input;
int number = 0;
//try catch to handle NumberFormatException
try
{
// the String to int conversion happens here
number = Integer.parseInt(input.trim());
// print out the value after the conversion
//System.out.println("int i = " + i);
}
catch (NumberFormatException nfe)
{
System.out.println("NumberFormatException: " + nfe.getMessage() + ", please input an integer!");
}
return number;
}
private boolean validBlank(String iobuffer) //method to check insert any empties or blanks
{
if (iobuffer.matches("[abcdexABCDEX]*"))
{
if (iobuffer.trim().isEmpty() || iobuffer.length() > 1)
{
System.out.println("Error : please insert from A to E OR Z !");
return false;
}
return true;
}
System.out.println("Error: opition shouldn't be #!123...Please enter again:");
return true;
}
private boolean validplayername(String iobuffer) //method to check insert any empties or blanks
{
if (iobuffer.matches("[a-zA-z\\-]*"))
{
if (iobuffer.trim().isEmpty() || iobuffer.length() < 2)
{
System.out.println("Error : please insert more than 2!");
return false;
}
int position = 0;
char hyphen = '-';
int count = 0;
for (position = 0; position < iobuffer.length(); position++)
{
if (iobuffer.charAt(position) == hyphen)
{
count++;
if (count > 1)
return false;
}
if (iobuffer.charAt(0) == hyphen || iobuffer.charAt(iobuffer.length() - 1) == hyphen)
{
return false;
}
}
return true;
}
else
{
System.out.println("Error: opition shouldn't be #!123...Please enter again:");
return false;
}
}
/*public boolean isHyphen(String newPlayerName)
{
int position = 0;
char hyphen = '-';
int count = 0;
for (position = 0; position < newPlayerName.length(); position++)
{
if (newPlayerName.charAt(position) == hyphen)
{
count++;
if (count > 1)
return false;
}
if (newPlayerName.charAt(0) == hyphen || newPlayerName.charAt(newPlayerName.length() - 1) == hyphen)
{
return false;
}
}
return true;
}*/
private void writeFile()
{
String filename = ("statistics.txt");
//try catch to handle IOException
try
{
PrintWriter outputFile = new PrintWriter (filename);
outputFile.println("Football World Cup Winner: " + winner);
outputFile.println("Golden Boot Award: " + goldenboot);
outputFile.println("Fair Play Award: " + FairPlayAward);
outputFile.close();
}
catch(IOException exception)
{
System.out.println("Unexpected I/O error occured");
}
}
}
|
[
"[email protected]"
] | |
0732ce57fb54273312d80986e1c8a639bf0f25c2
|
40947bb1f1a25f6c52fa73e325ffffe733d22907
|
/java-exercises/src/trycatchexeptions/ExampleArrayIndexOutOfBoundsException.java
|
076240ce57215105558af9572666c04a75def211
|
[] |
no_license
|
eriseld181/java-exercises
|
99c41b20a655a06e775d6e45734f64281de80c82
|
3fa93424a8dbec23595533384861f399c8f04d08
|
refs/heads/master
| 2023-03-15T18:53:11.289166 | 2021-02-21T15:26:43 | 2021-02-21T15:26:43 | 329,684,682 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 331 |
java
|
package trycatchexeptions;
public class ExampleArrayIndexOutOfBoundsException {
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
int a[] = new int[10];
a[11] = 9;
}catch(ArrayIndexOutOfBoundsException e ) {
System.out.println("Exception: ArrayIndexOutOfBoundsException");
}
}
}
|
[
"[email protected]"
] | |
0597d7edf275453a7f2ba37f06dce066a974cea3
|
2deec2c4a1b0b1dce306a5a27f1ca8bdad319709
|
/src/dev/tilegame/audio/AudioManager.java
|
355ff0a7130ee2eb61fcc319b1e0a66486d233a4
|
[] |
no_license
|
JamiePurchase/2D-Java-Tile-Game
|
7e0687d5ad6c34d0394374a41029e7d06ccb352e
|
756617163d8993666b8fa7602792907be9791835
|
refs/heads/master
| 2021-01-10T19:25:15.690894 | 2015-02-15T00:24:01 | 2015-02-15T00:24:01 | 29,034,626 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,141 |
java
|
package dev.tilegame.audio;
public class AudioManager
{
private static boolean active = true;
private static AudioFootsteps footstepVariations;
private static boolean musicActive = false;
private static String musicFile;
private static boolean soundActive = false;
private static String soundFile;
private static int soundTick;
private static int volume = 100;
public AudioManager()
{
AudioPlayer.init();
initFootsteps();
initMusic();
initSounds();
}
public int getFootstepVariations(String file)
{
return footstepVariations.getVariations(file);
}
public boolean getMusicActive()
{
return musicActive;
}
public boolean getSoundActive()
{
return soundActive;
}
public void initFootsteps()
{
footstepVariations = new AudioFootsteps();
AudioPlayer.load("/sounds/footstepGrass1.wav", "sfxFootstepGrass1");
AudioPlayer.load("/sounds/footstepGrass2.wav", "sfxFootstepGrass2");
AudioPlayer.load("/sounds/footstepWood1.wav", "sfxFootstepWood1");
AudioPlayer.load("/sounds/footstepWood2.wav", "sfxFootstepWood2");
}
public void initMusic()
{
AudioPlayer.load("/music/bgm1.wav", "music1");
AudioPlayer.load("/music/bgm2.wav", "music2");
}
public void initSounds()
{
// Note: Do we need these?
AudioPlayer.load("/sounds/collectGarnet.wav", "Garnet");
AudioPlayer.load("/sounds/collectMushroom.wav", "Mushroom");
AudioPlayer.load("/sounds/collectTreasure.wav", "Treasure");
}
public void playMusic(String music)
{
AudioPlayer.play(music);
musicActive = true;
musicFile = music;
}
public void playSound(String sound)
{
AudioPlayer.play(sound);
soundActive = true;
soundFile = sound;
soundTick = 0;
}
public void setVolume(int newVolume)
{
volume = newVolume;
if(newVolume<1){active = false;}
else{active = true;}
}
public void stopMusic()
{
AudioPlayer.stop(musicFile);
musicActive = false;
musicFile = "";
}
public void stopSound()
{
//AudioPlayer.stop(soundFile);
soundActive = false;
soundFile = "";
}
public void tick()
{
if(getSoundActive())
{
soundTick += 1;
//if(soundTick>1){stopSound();}
}
}
}
|
[
"[email protected]"
] | |
5a0995e0b993c0cff7c804f85a4023660a213955
|
0e3dde3376dc96230740aa436ad2799bbdcfaa72
|
/src/main/java/com/wqg/boot_db/pojo/Book.java
|
49e417f19796641dd4138ea8650d2e58e093c54e
|
[] |
no_license
|
kangzhan20/boot_db
|
3713dbd2d3a1ed009adcec86e73428f40f4d3c80
|
74662375f2fc86b24bf473a76369cf796b929177
|
refs/heads/master
| 2020-03-19T11:10:35.230454 | 2018-06-08T08:17:23 | 2018-06-08T08:17:23 | 136,436,728 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,020 |
java
|
package com.wqg.boot_db.pojo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class Book {
@Id
@GeneratedValue
private Long id;
private String author;
private String isbn;
private String title;
private String description;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.