blob_id stringlengths 40 40 | __id__ int64 225 39,780B | directory_id stringlengths 40 40 | path stringlengths 6 313 | content_id stringlengths 40 40 | detected_licenses list | license_type stringclasses 2
values | repo_name stringlengths 6 132 | repo_url stringlengths 25 151 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 70 | visit_date timestamp[ns] | revision_date timestamp[ns] | committer_date timestamp[ns] | github_id int64 7.28k 689M ⌀ | star_events_count int64 0 131k | fork_events_count int64 0 48k | gha_license_id stringclasses 23
values | gha_fork bool 2
classes | gha_event_created_at timestamp[ns] | gha_created_at timestamp[ns] | gha_updated_at timestamp[ns] | gha_pushed_at timestamp[ns] | gha_size int64 0 40.4M ⌀ | gha_stargazers_count int32 0 112k ⌀ | gha_forks_count int32 0 39.4k ⌀ | gha_open_issues_count int32 0 11k ⌀ | gha_language stringlengths 1 21 ⌀ | gha_archived bool 2
classes | gha_disabled bool 1
class | content stringlengths 7 4.37M | src_encoding stringlengths 3 16 | language stringclasses 1
value | length_bytes int64 7 4.37M | extension stringclasses 24
values | filename stringlengths 4 174 | language_id stringclasses 1
value | entities list | contaminating_dataset stringclasses 0
values | malware_signatures list | redacted_content stringlengths 7 4.37M | redacted_length_bytes int64 7 4.37M | alphanum_fraction float32 0.25 0.94 | alpha_fraction float32 0.25 0.94 | num_lines int32 1 84k | avg_line_length float32 0.76 99.9 | std_line_length float32 0 220 | max_line_length int32 5 998 | is_vendor bool 2
classes | is_generated bool 1
class | max_hex_length int32 0 319 | hex_fraction float32 0 0.38 | max_unicode_length int32 0 408 | unicode_fraction float32 0 0.36 | max_base64_length int32 0 506 | base64_fraction float32 0 0.5 | avg_csv_sep_count float32 0 4 | is_autogen_header bool 1
class | is_empty_html bool 1
class | shard stringclasses 16
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e30ddce5aca66f47e8029370042a4685d19afb0a | 32,530,082,304,220 | c252d53052fc16a0307511aca193dd200d94d1af | /Backend/UETCodeHub_Backend/src/java/vn/edu/vnu/uet/fit/model/CourseReportModel.java | a7c06e6a4b517a46c14c599aac6ece9f14af76fd | [] | no_license | duonghm/UETCodehub | https://github.com/duonghm/UETCodehub | f29ddb6f17a88abda9b627d1b8f033c3c80c70bf | ac1cceeff8197c65c466688f46bf54d8496eacd7 | refs/heads/master | 2021-01-01T05:25:22.468000 | 2016-06-07T06:18:43 | 2016-06-07T06:18:43 | 58,634,647 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* 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 vn.edu.vnu.uet.fit.model;
import java.util.List;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.Transaction;
import vn.edu.vnu.uet.fit.entity.report.course.CourseReportOverall;
import vn.edu.vnu.uet.fit.entity.report.course.StudentDetailReportByCourse;
import vn.edu.vnu.uet.fit.entity.report.course.StudentReportByCourse;
import vn.edu.vnu.uet.fit.utils.HibernateUtil;
/**
*
* @author hmduong
*/
public class CourseReportModel {
public List<CourseReportOverall> getCourseReports() {
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction trans = session.beginTransaction();
String queryStr
= "select F.courseId as reportId, F.courseId, F.numberOfStudent, F.averageScore ,count(problemId) as numberOfProblem from\n"
+ " (select courseId, count(userId) as numberOfStudent, avg(totalScore) as averageScore from\n"
+ " (select courseId, userId, COALESCE(sum(resultScore),0) as totalScore from \n"
+ " (select C.courseId, courseusers.userId, submit.problemId, submit.result, submit.resultScore, submit.isActive\n"
+ " from courseusers \n"
+ " left join (select submissions.submitId, submissions.courseId, submissions.problemId, submissions.userId, submissions.result, submissions.resultScore, submissions.isActive \n"
+ " from submissions\n"
+ " inner join (select courseId, problemId, userId, max(resultScore) as maxscore from submissions where submissions.courseId is not null and isActive != 0 GROUP BY courseId, problemId, userId) as B\n"
+ " on submissions.courseId = B.courseId and submissions.problemId = B.problemId and submissions.userId = B.userId\n"
+ " where submissions.resultScore = B.maxscore and isActive != 0) as submit on courseusers.courseId = submit.courseId and courseusers.userId = submit.userId\n"
+ " right join (select * from courses) as C on courseusers.courseId = C.courseId) as D\n"
+ " group by courseId, userId) as E\n"
+ " group by courseId\n"
+ " )as F left join courseproblems on F.courseId = courseproblems.courseId\n"
+ " group by F.courseId";
SQLQuery query = session.createSQLQuery(queryStr);
query.addEntity(CourseReportOverall.class);
List<CourseReportOverall> result = query.list();
trans.commit();
session.close();
return result;
}
public List<StudentReportByCourse> getStudentResultByCourse(int courseId) {
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction trans = session.beginTransaction();
String queryStr
= "SELECT @s\\:=@s+1 as reportId, courseId, userId, COALESCE(sum(isActive),0) as summitedExercise, COALESCE(SUM(score), 0) as courseScore FROM\n"
+ " (SELECT \n"
+ " courseusers.courseId as courseId, \n"
+ " courseusers.userId as userId, \n"
+ " B.problemId as problemId, \n"
+ " B.submitId as submitId, \n"
+ " B.result as result, \n"
+ " B.resultScore as score,\n"
+ " B.isActive as isActive\n"
+ " FROM courseusers left outer join (\n"
+ " select submitId, courseId, problemId, userId, result, max(resultScore) as resultScore, isActive from submissions \n"
+ " where submissions.courseId is not null and isActive != 0\n"
+ " GROUP BY courseId, problemId, userId) as B on courseusers.courseId = B.courseId and courseusers.userId = B.userId\n"
+ " ) as C,\n"
+ " (SELECT @s\\:= 0) AS s\n"
+ "GROUP BY courseId, userId \n"
+ "HAVING C.courseId = :courseId";
SQLQuery query = session.createSQLQuery(queryStr);
query.setInteger("courseId", courseId);
query.addEntity(StudentReportByCourse.class);
List<StudentReportByCourse> result = query.list();
trans.commit();
session.close();
return result;
}
public List<StudentDetailReportByCourse> getStudentDetailResultByCourse(int courseId, int userId) {
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction trans = session.beginTransaction();
String queryStr
= "select @s\\:=@s+1 as reportId, submissions.submitId, submissions.courseId, submissions.problemId, submissions.userId, submissions.result, submissions.resultScore, submissions.isActive \n"
+ " from submissions\n"
+ " inner join (select courseId, problemId, userId, max(resultScore) as maxscore from submissions where submissions.courseId is not null and isActive != 0 GROUP BY courseId, problemId, userId) as B\n"
+ " on submissions.courseId = B.courseId and submissions.problemId = B.problemId and submissions.userId = B.userId,\n"
+ " (SELECT @s\\:= 0) AS s\n"
+ " where submissions.resultScore = B.maxscore and submissions.isActive != 0 and submissions.userId = :userId and submissions.courseId = :courseId";
SQLQuery query = session.createSQLQuery(queryStr);
query.setInteger("courseId", courseId);
query.setInteger("userId", userId);
query.addEntity(StudentDetailReportByCourse.class);
List<StudentDetailReportByCourse> result = query.list();
trans.commit();
session.close();
return result;
}
}
| UTF-8 | Java | 5,987 | java | CourseReportModel.java | Java | [
{
"context": "nu.uet.fit.utils.HibernateUtil;\n\n/**\n *\n * @author hmduong\n */\npublic class CourseReportModel {\n\n public ",
"end": 625,
"score": 0.9995836615562439,
"start": 618,
"tag": "USERNAME",
"value": "hmduong"
}
] | null | [] | /*
* 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 vn.edu.vnu.uet.fit.model;
import java.util.List;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.Transaction;
import vn.edu.vnu.uet.fit.entity.report.course.CourseReportOverall;
import vn.edu.vnu.uet.fit.entity.report.course.StudentDetailReportByCourse;
import vn.edu.vnu.uet.fit.entity.report.course.StudentReportByCourse;
import vn.edu.vnu.uet.fit.utils.HibernateUtil;
/**
*
* @author hmduong
*/
public class CourseReportModel {
public List<CourseReportOverall> getCourseReports() {
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction trans = session.beginTransaction();
String queryStr
= "select F.courseId as reportId, F.courseId, F.numberOfStudent, F.averageScore ,count(problemId) as numberOfProblem from\n"
+ " (select courseId, count(userId) as numberOfStudent, avg(totalScore) as averageScore from\n"
+ " (select courseId, userId, COALESCE(sum(resultScore),0) as totalScore from \n"
+ " (select C.courseId, courseusers.userId, submit.problemId, submit.result, submit.resultScore, submit.isActive\n"
+ " from courseusers \n"
+ " left join (select submissions.submitId, submissions.courseId, submissions.problemId, submissions.userId, submissions.result, submissions.resultScore, submissions.isActive \n"
+ " from submissions\n"
+ " inner join (select courseId, problemId, userId, max(resultScore) as maxscore from submissions where submissions.courseId is not null and isActive != 0 GROUP BY courseId, problemId, userId) as B\n"
+ " on submissions.courseId = B.courseId and submissions.problemId = B.problemId and submissions.userId = B.userId\n"
+ " where submissions.resultScore = B.maxscore and isActive != 0) as submit on courseusers.courseId = submit.courseId and courseusers.userId = submit.userId\n"
+ " right join (select * from courses) as C on courseusers.courseId = C.courseId) as D\n"
+ " group by courseId, userId) as E\n"
+ " group by courseId\n"
+ " )as F left join courseproblems on F.courseId = courseproblems.courseId\n"
+ " group by F.courseId";
SQLQuery query = session.createSQLQuery(queryStr);
query.addEntity(CourseReportOverall.class);
List<CourseReportOverall> result = query.list();
trans.commit();
session.close();
return result;
}
public List<StudentReportByCourse> getStudentResultByCourse(int courseId) {
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction trans = session.beginTransaction();
String queryStr
= "SELECT @s\\:=@s+1 as reportId, courseId, userId, COALESCE(sum(isActive),0) as summitedExercise, COALESCE(SUM(score), 0) as courseScore FROM\n"
+ " (SELECT \n"
+ " courseusers.courseId as courseId, \n"
+ " courseusers.userId as userId, \n"
+ " B.problemId as problemId, \n"
+ " B.submitId as submitId, \n"
+ " B.result as result, \n"
+ " B.resultScore as score,\n"
+ " B.isActive as isActive\n"
+ " FROM courseusers left outer join (\n"
+ " select submitId, courseId, problemId, userId, result, max(resultScore) as resultScore, isActive from submissions \n"
+ " where submissions.courseId is not null and isActive != 0\n"
+ " GROUP BY courseId, problemId, userId) as B on courseusers.courseId = B.courseId and courseusers.userId = B.userId\n"
+ " ) as C,\n"
+ " (SELECT @s\\:= 0) AS s\n"
+ "GROUP BY courseId, userId \n"
+ "HAVING C.courseId = :courseId";
SQLQuery query = session.createSQLQuery(queryStr);
query.setInteger("courseId", courseId);
query.addEntity(StudentReportByCourse.class);
List<StudentReportByCourse> result = query.list();
trans.commit();
session.close();
return result;
}
public List<StudentDetailReportByCourse> getStudentDetailResultByCourse(int courseId, int userId) {
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction trans = session.beginTransaction();
String queryStr
= "select @s\\:=@s+1 as reportId, submissions.submitId, submissions.courseId, submissions.problemId, submissions.userId, submissions.result, submissions.resultScore, submissions.isActive \n"
+ " from submissions\n"
+ " inner join (select courseId, problemId, userId, max(resultScore) as maxscore from submissions where submissions.courseId is not null and isActive != 0 GROUP BY courseId, problemId, userId) as B\n"
+ " on submissions.courseId = B.courseId and submissions.problemId = B.problemId and submissions.userId = B.userId,\n"
+ " (SELECT @s\\:= 0) AS s\n"
+ " where submissions.resultScore = B.maxscore and submissions.isActive != 0 and submissions.userId = :userId and submissions.courseId = :courseId";
SQLQuery query = session.createSQLQuery(queryStr);
query.setInteger("courseId", courseId);
query.setInteger("userId", userId);
query.addEntity(StudentDetailReportByCourse.class);
List<StudentDetailReportByCourse> result = query.list();
trans.commit();
session.close();
return result;
}
}
| 5,987 | 0.63404 | 0.632036 | 99 | 59.474747 | 51.04372 | 227 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.080808 | false | false | 1 |
4f71c70158550104a4ba01efe06a0feb50a2d2d8 | 21,534,966,075,223 | 57b93273646ca96403fb34e91dadc54b0d3afda7 | /src/cn/tcl/platform/excelCustomer/service/IExcelCustomerService.java | 40ff38ad5c3df152ae7f6bad8ceb253d1496fd12 | [] | no_license | JackPaiPaiNi/toms | https://github.com/JackPaiPaiNi/toms | dcc032d50823e27642ec746b45a2546a2428de5d | 13b1de9c17bbc3dd7dc795a19d9daf0e2b4787e8 | refs/heads/master | 2020-04-07T22:32:49.982000 | 2018-11-23T03:08:18 | 2018-11-23T03:08:18 | 158,774,833 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.tcl.platform.excelCustomer.service;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import cn.tcl.platform.excel.vo.Excel;
import cn.tcl.platform.excelCustomer.vo.ExcelCustomer;
public interface IExcelCustomerService {
// 查看列表
public List<ExcelCustomer> selectDatas(String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectModelList(String beginDate,
String endDate, String searchStr, String conditions, boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectModel(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectModelTotal(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectTargetByshop(String searchStr, String conditions,String tBeginDate,String tEndDate, boolean isHq,int type);
public List<HashMap<String, Object>> selectSaleDataByshop(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq);
public List<HashMap<String, Object>> selectSaleDataByshopByAc(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq);
public List<HashMap<String, Object>> selectSalerDatas(String searchStr, String conditions) throws Exception;
public List<HashMap<String, Object>> selectStockBymodel(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectStockBymodelByAc(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<ExcelCustomer> selectSaleDataBySum(String beginDate, String endDate,
String searchStr, String conditions,boolean isHq);
public List<ExcelCustomer> selectSaleDataBySumByAc(String beginDate, String endDate,
String searchStr, String conditions,boolean isHq);
public List<ExcelCustomer> selectTargetDataBySum(String beginDate, String endDate,
String searchStr, String conditions,String tBeginDate,String tEndDate,boolean isHq,int type);
public List<HashMap<String, Object>> selectDataByArea(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectDataByAreaByAc(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectTargetByArea( String searchStr, String conditions,String tBeginDate,String tEndDate,boolean isHq,int type)
throws Exception;
public List<HashMap<String, Object>> selectTargetBySaleman(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq,String tBeginDate,String tEndDate) throws Exception;
public List<HashMap<String, Object>> selectTargetBySalemanByAc(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq,String tBeginDate,String tEndDate) throws Exception;
public List<HashMap<String, Object>> selectModelBySpec(String beginDate, String endDate,String spec,
String searchStr, String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelBySpecByAc(String beginDate, String endDate,String spec,
String searchStr, String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelListBySpec(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelListBySpecByAc(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelBySpecTotal(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelBySpecTotalByAc(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelTotalBySpec(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectStockByTotal(String searchStr,
String conditions,String beginDate,String endDate) throws Exception;
public List<HashMap<String, Object>> selectStockByTotalByAc(String searchStr,
String conditions,String beginDate,String endDate) throws Exception;
public List<HashMap<String, Object>> selectSelloutByDealer(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq,String tBeginDate,String tEndDate) throws Exception;
public List<HashMap<String, Object>> selectSelloutByDealerByAc(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq,String tBeginDate,String tEndDate) throws Exception;
public List<HashMap<String, Object>> selectDisplayBymodel(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDisplayBymodelByAc(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectStockByData(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDisplayByData(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectStockByDataByAc(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDisplayByDataByAc(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDisPlayByTotal(String searchStr,
String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectDisPlayByTotalByAc(String searchStr,
String conditions,String beginDate, String endDate) throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleDataBySize(String beginSize,
String endSize, String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleDataBySizeByAc(String beginSize,
String endSize, String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectSaleDataBySizeLast(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleTotalBySize(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleTotalBySizeByAc(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpecType(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpecTypeByAc(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpec(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpecByAc(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleDataByDEALERByAc(
String beginDate,
String endDate,
String searchStr,
String conditions,
boolean isHq);
public List<HashMap<String, Object>> selectSaleTTLByDEALERByAc(
String beginDate,
String endDate,
String searchStr,
String conditions,
boolean isHq);
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpecYear(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectQtyTotalBySpecModelYear(
String spec, String searchStr, String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectQtyTotalBySpecTotalYear(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpecYearByAc(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectQtyTotalBySpecModelYearByAc(
String spec, String searchStr, String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectQtyTotalBySpecTotalYearByAc(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectInfoByCPURH(String beginDate,
String endDate, String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectDataByCPURH(String beginDate,
String endDate, String countryId, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDataHeadByCPURH(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectTargetByAcfo(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,
String tBeginDate,
String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectTargetByAcfoByAc(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,
String tBeginDate,
String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectPartyNameByuser(String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectFpsNameByShop(String beginDate, String endDate, String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectFpsNameByShopByAc(String beginDate, String endDate, String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectTotalByCPURH(String beginDate,
String endDate, String searchStr, String conditions,String countryId,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectTTLByCPURH(String beginDate,
String endDate, String searchStr, String conditions,String countryId,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectSaleTTLByCPURH(String beginDate,
String endDate, String searchStr, String conditions,String countryId,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
/*public List<HashMap<String, Object>> selectTargetTTLByCPURH(
String beginDate, String endDate, String searchStr,
String conditions) throws Exception;
*/
public List<HashMap<String, Object>> selectInfoByCPUSALE(String beginDate,
String endDate, String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectTotalByCPUSALE(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectModelByCPUSALE(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectModelTTLByCPUSALE(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectTTLByCPUSALE(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectInfoByCPUACFO(String beginDate,
String endDate, String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectTotalByCPUACFO(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectModelByCPUACFO(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectModelTTLByCPUACFO(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectTTLByCPUACFO(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleDataByDEALER(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectSaleTTLByDEALER(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDEALER(String searchStr,
String conditions) throws Exception;
public List<HashMap<String, Object>> selectCPUDisplayBYBRANCH(
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCPUInventoryBYBRANCH(
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCPUHeadDisplayBYBRANCH(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectCPUHeadInventoryBYBRANCH(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectCPUInfoByBRANCH(
String searchStr, String conditions) throws Exception;
public List<HashMap<String, Object>> selectSellDataBYBRANCH(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectSellDataByTotal(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCPUDisplayByTotal(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectCPUInventoryByTotal(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectSellDataByTTL(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectCPUDisplayByTTL(
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCPUInventoryByTTL(
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectSellDataBySUM(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectCPUDisplayBySUM(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectCPUInventoryBySUM(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectDataByAreaInfo(String searchStr,
String conditions) throws Exception;
public List<HashMap<String, Object>> selectTargetBySalemanInfo(
String searchStr, String conditions) throws Exception;
public List<HashMap<String, Object>> selectTargetByAcfoInfo(
String searchStr, String conditions) throws Exception;
public List<HashMap<String, Object>> selectSelloutByDealerInfo(
String searchStr, String conditions) throws Exception;
public String selectPartyByUser(String userId) throws Exception;
public List<HashMap<String, Object>> selectRegionalHeadByParty(
String searchStr, String conditions) throws Exception;
public List<HashMap<String, Object>> selectAreaByUser(String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectCoreProductByCountry(
String countryId,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCoreProductByStock(
String countryId,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCoreProductBySample(
String countryId,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCoreLine(String countryId)
throws Exception;
public List<HashMap<String, Object>> selectCoreSellData(String searchStr,
String conditions, String countryId, String beginDate,
String endDate,boolean isHq);
public List<HashMap<String, Object>> selectCoreByTarget(String searchStr,
String conditions, String beginDate,
String endDate,String countryId,String tBeginDate,String tEndDate,boolean isHq);
public List<HashMap<String, Object>> selectCoreSellTotal(String searchStr,
String conditions, String countryId, String beginDate,
String endDate,boolean isHq);
public String selectCountryByUser(String userId);
}
| UTF-8 | Java | 18,878 | java | IExcelCustomerService.java | Java | [] | null | [] | package cn.tcl.platform.excelCustomer.service;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import cn.tcl.platform.excel.vo.Excel;
import cn.tcl.platform.excelCustomer.vo.ExcelCustomer;
public interface IExcelCustomerService {
// 查看列表
public List<ExcelCustomer> selectDatas(String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectModelList(String beginDate,
String endDate, String searchStr, String conditions, boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectModel(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectModelTotal(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectTargetByshop(String searchStr, String conditions,String tBeginDate,String tEndDate, boolean isHq,int type);
public List<HashMap<String, Object>> selectSaleDataByshop(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq);
public List<HashMap<String, Object>> selectSaleDataByshopByAc(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq);
public List<HashMap<String, Object>> selectSalerDatas(String searchStr, String conditions) throws Exception;
public List<HashMap<String, Object>> selectStockBymodel(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectStockBymodelByAc(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<ExcelCustomer> selectSaleDataBySum(String beginDate, String endDate,
String searchStr, String conditions,boolean isHq);
public List<ExcelCustomer> selectSaleDataBySumByAc(String beginDate, String endDate,
String searchStr, String conditions,boolean isHq);
public List<ExcelCustomer> selectTargetDataBySum(String beginDate, String endDate,
String searchStr, String conditions,String tBeginDate,String tEndDate,boolean isHq,int type);
public List<HashMap<String, Object>> selectDataByArea(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectDataByAreaByAc(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectTargetByArea( String searchStr, String conditions,String tBeginDate,String tEndDate,boolean isHq,int type)
throws Exception;
public List<HashMap<String, Object>> selectTargetBySaleman(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq,String tBeginDate,String tEndDate) throws Exception;
public List<HashMap<String, Object>> selectTargetBySalemanByAc(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq,String tBeginDate,String tEndDate) throws Exception;
public List<HashMap<String, Object>> selectModelBySpec(String beginDate, String endDate,String spec,
String searchStr, String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelBySpecByAc(String beginDate, String endDate,String spec,
String searchStr, String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelListBySpec(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelListBySpecByAc(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelBySpecTotal(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelBySpecTotalByAc(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectModelTotalBySpec(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectStockByTotal(String searchStr,
String conditions,String beginDate,String endDate) throws Exception;
public List<HashMap<String, Object>> selectStockByTotalByAc(String searchStr,
String conditions,String beginDate,String endDate) throws Exception;
public List<HashMap<String, Object>> selectSelloutByDealer(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq,String tBeginDate,String tEndDate) throws Exception;
public List<HashMap<String, Object>> selectSelloutByDealerByAc(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq,String tBeginDate,String tEndDate) throws Exception;
public List<HashMap<String, Object>> selectDisplayBymodel(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDisplayBymodelByAc(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectStockByData(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDisplayByData(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectStockByDataByAc(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDisplayByDataByAc(String spec,
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDisPlayByTotal(String searchStr,
String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectDisPlayByTotalByAc(String searchStr,
String conditions,String beginDate, String endDate) throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleDataBySize(String beginSize,
String endSize, String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleDataBySizeByAc(String beginSize,
String endSize, String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectSaleDataBySizeLast(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleTotalBySize(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleTotalBySizeByAc(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpecType(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpecTypeByAc(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpec(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpecByAc(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleDataByDEALERByAc(
String beginDate,
String endDate,
String searchStr,
String conditions,
boolean isHq);
public List<HashMap<String, Object>> selectSaleTTLByDEALERByAc(
String beginDate,
String endDate,
String searchStr,
String conditions,
boolean isHq);
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpecYear(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectQtyTotalBySpecModelYear(
String spec, String searchStr, String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectQtyTotalBySpecTotalYear(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<LinkedHashMap<String, Object>> selectQtyTotalBySpecYearByAc(String spec,
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectQtyTotalBySpecModelYearByAc(
String spec, String searchStr, String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectQtyTotalBySpecTotalYearByAc(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectInfoByCPURH(String beginDate,
String endDate, String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectDataByCPURH(String beginDate,
String endDate, String countryId, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDataHeadByCPURH(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectTargetByAcfo(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,
String tBeginDate,
String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectTargetByAcfoByAc(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,
String tBeginDate,
String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectPartyNameByuser(String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectFpsNameByShop(String beginDate, String endDate, String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectFpsNameByShopByAc(String beginDate, String endDate, String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectTotalByCPURH(String beginDate,
String endDate, String searchStr, String conditions,String countryId,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectTTLByCPURH(String beginDate,
String endDate, String searchStr, String conditions,String countryId,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectSaleTTLByCPURH(String beginDate,
String endDate, String searchStr, String conditions,String countryId,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
/*public List<HashMap<String, Object>> selectTargetTTLByCPURH(
String beginDate, String endDate, String searchStr,
String conditions) throws Exception;
*/
public List<HashMap<String, Object>> selectInfoByCPUSALE(String beginDate,
String endDate, String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectTotalByCPUSALE(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectModelByCPUSALE(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectModelTTLByCPUSALE(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectTTLByCPUSALE(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectInfoByCPUACFO(String beginDate,
String endDate, String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectTotalByCPUACFO(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
public List<HashMap<String, Object>> selectModelByCPUACFO(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectModelTTLByCPUACFO(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectTTLByCPUACFO(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq,String tBeginDate,String tEndDate)
throws Exception;
public List<LinkedHashMap<String, Object>> selectSaleDataByDEALER(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectSaleTTLByDEALER(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectDEALER(String searchStr,
String conditions) throws Exception;
public List<HashMap<String, Object>> selectCPUDisplayBYBRANCH(
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCPUInventoryBYBRANCH(
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCPUHeadDisplayBYBRANCH(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectCPUHeadInventoryBYBRANCH(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectCPUInfoByBRANCH(
String searchStr, String conditions) throws Exception;
public List<HashMap<String, Object>> selectSellDataBYBRANCH(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectSellDataByTotal(
String beginDate, String endDate, String searchStr,
String conditions,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCPUDisplayByTotal(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectCPUInventoryByTotal(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectSellDataByTTL(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectCPUDisplayByTTL(
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCPUInventoryByTTL(
String searchStr, String conditions,String beginDate, String endDate,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectSellDataBySUM(String beginDate,
String endDate, String searchStr, String conditions,boolean isHq)
throws Exception;
public List<HashMap<String, Object>> selectCPUDisplayBySUM(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectCPUInventoryBySUM(
String searchStr, String conditions,String beginDate, String endDate) throws Exception;
public List<HashMap<String, Object>> selectDataByAreaInfo(String searchStr,
String conditions) throws Exception;
public List<HashMap<String, Object>> selectTargetBySalemanInfo(
String searchStr, String conditions) throws Exception;
public List<HashMap<String, Object>> selectTargetByAcfoInfo(
String searchStr, String conditions) throws Exception;
public List<HashMap<String, Object>> selectSelloutByDealerInfo(
String searchStr, String conditions) throws Exception;
public String selectPartyByUser(String userId) throws Exception;
public List<HashMap<String, Object>> selectRegionalHeadByParty(
String searchStr, String conditions) throws Exception;
public List<HashMap<String, Object>> selectAreaByUser(String searchStr, String conditions)
throws Exception;
public List<HashMap<String, Object>> selectCoreProductByCountry(
String countryId,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCoreProductByStock(
String countryId,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCoreProductBySample(
String countryId,boolean isHq) throws Exception;
public List<HashMap<String, Object>> selectCoreLine(String countryId)
throws Exception;
public List<HashMap<String, Object>> selectCoreSellData(String searchStr,
String conditions, String countryId, String beginDate,
String endDate,boolean isHq);
public List<HashMap<String, Object>> selectCoreByTarget(String searchStr,
String conditions, String beginDate,
String endDate,String countryId,String tBeginDate,String tEndDate,boolean isHq);
public List<HashMap<String, Object>> selectCoreSellTotal(String searchStr,
String conditions, String countryId, String beginDate,
String endDate,boolean isHq);
public String selectCountryByUser(String userId);
}
| 18,878 | 0.779014 | 0.779014 | 461 | 38.932755 | 35.637028 | 153 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.902386 | false | false | 1 |
95937bb02c37f77bac73e74af973d5e3d3c35efc | 28,905,129,909,870 | 76b94d44f7d6384dda65c5afeba33d3eaa95530b | /J4Labs/src/com/Junit3/Lab1/Hello.java | 52b4c29eaf5459ae55b027ee2aec9a26b7aa5935 | [] | no_license | sk-shahsi/JunitTest | https://github.com/sk-shahsi/JunitTest | 35735b79ee87234718a9e434d811fc7b3cf25532 | 34bc84d77fb506304c460cafebb505eb106a73ff | refs/heads/main | 2023-06-20T20:11:13.487000 | 2021-07-30T07:35:26 | 2021-07-30T07:35:26 | 390,973,918 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.Junit3.Lab1;
public class Hello {
public String getMessage1() {
return "Hello";
}
public String getMessage2() {
return "hai";
}
}
| UTF-8 | Java | 166 | java | Hello.java | Java | [] | null | [] | package com.Junit3.Lab1;
public class Hello {
public String getMessage1() {
return "Hello";
}
public String getMessage2() {
return "hai";
}
}
| 166 | 0.614458 | 0.590361 | 16 | 9.375 | 10.925172 | 30 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.25 | false | false | 1 |
152c4c49c014019588ce64da8a9268119d52a53d | 19,705,309,962,253 | e09c6f7ef6f01ce2b54993d1876bd1c79c33af57 | /SD1314pl001/src/common/Event.java | 91afd8ec13c866f16424ed63b4964e221a3fc85b | [] | no_license | dafonso/SD-PL001 | https://github.com/dafonso/SD-PL001 | 8f2de67303d9f1c319be43566da513bceff021b4 | 625bf3e9e48de9da99236582057a4e83bde80fad | refs/heads/master | 2021-01-15T09:10:14.039000 | 2013-12-15T16:06:25 | 2013-12-15T16:06:25 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* 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 common;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* @author Emanuel
*/
@DatabaseTable(tableName = "Event")
public class Event implements Serializable{
@DatabaseField(generatedId = true,allowGeneratedIdInsert = true)
private int id;
@DatabaseField(canBeNull = false)
private Date start;
@DatabaseField(canBeNull = false)
private Date end;
@DatabaseField(canBeNull = false)
private String title;
@DatabaseField(canBeNull = false)
private String description;
@DatabaseField(canBeNull = false)
private Date createdAt;
@DatabaseField(canBeNull = false)
private Date modifiedAt;
public Event(){
}
public Event(Date start, Date end, String title, String description) {
this.start = start;
this.end = end;
this.title = title;
this.description = description;
createdAt = new Date();
modifiedAt = new Date();
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Date getStart() {
return start;
}
public void setStart(Date start) {
this.start = start;
}
public Date getEnd() {
return end;
}
public void setEnd(Date end) {
this.end = end;
}
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;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getModifiedAt() {
return modifiedAt;
}
public void setModifiedAt(Date modifiedAt) {
this.modifiedAt = modifiedAt;
}
@Override
public String toString(){
StringBuilder sb = new StringBuilder("event ");
sb.append(id).append(" - ");
sb.append(title);
return sb.toString();
}
}
| UTF-8 | Java | 2,578 | java | Event.java | Java | [
{
"context": "\nimport java.util.Date;\r\n\r\n/**\r\n *\r\n *\r\n * @author Emanuel\r\n */\r\n@DatabaseTable(tableName = \"Event\")\r\npublic",
"end": 388,
"score": 0.9978559613227844,
"start": 381,
"tag": "NAME",
"value": "Emanuel"
}
] | null | [] | /*
* 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 common;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* @author Emanuel
*/
@DatabaseTable(tableName = "Event")
public class Event implements Serializable{
@DatabaseField(generatedId = true,allowGeneratedIdInsert = true)
private int id;
@DatabaseField(canBeNull = false)
private Date start;
@DatabaseField(canBeNull = false)
private Date end;
@DatabaseField(canBeNull = false)
private String title;
@DatabaseField(canBeNull = false)
private String description;
@DatabaseField(canBeNull = false)
private Date createdAt;
@DatabaseField(canBeNull = false)
private Date modifiedAt;
public Event(){
}
public Event(Date start, Date end, String title, String description) {
this.start = start;
this.end = end;
this.title = title;
this.description = description;
createdAt = new Date();
modifiedAt = new Date();
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Date getStart() {
return start;
}
public void setStart(Date start) {
this.start = start;
}
public Date getEnd() {
return end;
}
public void setEnd(Date end) {
this.end = end;
}
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;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getModifiedAt() {
return modifiedAt;
}
public void setModifiedAt(Date modifiedAt) {
this.modifiedAt = modifiedAt;
}
@Override
public String toString(){
StringBuilder sb = new StringBuilder("event ");
sb.append(id).append(" - ");
sb.append(title);
return sb.toString();
}
}
| 2,578 | 0.587665 | 0.585337 | 113 | 20.814159 | 18.013048 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.380531 | false | false | 1 |
1c41c10f8f0a9bace5c3c99c51c8c919f0e9ca5f | 21,406,117,046,108 | ee63930722137539e989a36cdc7a3ac235ca1932 | /app/src/main/java/com/yksj/consultation/im/NIMManager.java | 5b1da8f4badc14127ebc7c67f2b5d7f2c8018cbb | [] | no_license | 13525846841/SixOneD | https://github.com/13525846841/SixOneD | 3189a075ba58e11eedf2d56dc4592f5082649c0b | 199809593df44a7b8e2485ca7d2bd476f8faf43a | refs/heads/master | 2020-05-22T07:21:27.829000 | 2019-06-05T09:59:58 | 2019-06-05T09:59:58 | 186,261,515 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.yksj.consultation.im;
import android.app.Application;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.View;
import com.blankj.utilcode.util.ProcessUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.Utils;
import com.library.base.utils.ResourceHelper;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.SDKOptions;
import com.netease.nimlib.sdk.StatusBarNotificationConfig;
import com.netease.nimlib.sdk.auth.AuthService;
import com.netease.nimlib.sdk.auth.LoginInfo;
import com.netease.nimlib.sdk.avchat.AVChatManager;
import com.netease.nimlib.sdk.avchat.constant.AVChatControlCommand;
import com.netease.nimlib.sdk.avchat.model.AVChatAttachment;
import com.netease.nimlib.sdk.avchat.model.AVChatData;
import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.netease.nimlib.sdk.team.constant.TeamFieldEnum;
import com.netease.nimlib.sdk.team.model.IMMessageFilter;
import com.netease.nimlib.sdk.team.model.UpdateTeamAttachment;
import com.netease.nimlib.sdk.uinfo.UserInfoProvider;
import com.netease.nimlib.sdk.uinfo.model.UserInfo;
import com.yksj.consultation.app.AppContext;
import com.library.base.dialog.ConfirmDialog;
import com.yksj.consultation.dialog.DialogManager;
import com.yksj.consultation.main.MainActivity;
import com.yksj.consultation.sonDoc.R;
import com.yksj.consultation.sonDoc.chatting.avchat.AVChatActivity;
import com.yksj.consultation.sonDoc.chatting.avchat.AVChatProfile;
import com.yksj.consultation.sonDoc.chatting.avchat.cache.DemoCache;
import com.yksj.consultation.sonDoc.chatting.avchat.common.NimUIKit;
import com.yksj.consultation.sonDoc.chatting.avchat.init.UserPreferences;
import com.yksj.consultation.sonDoc.chatting.avchat.receiver.PhoneCallStateObserver;
import com.yksj.consultation.sonDoc.chatting.avchat.team.SessionHelper;
import com.yksj.consultation.sonDoc.chatting.avchat.team.TeamAVChatHelper;
import com.yksj.healthtalk.utils.LogUtil;
import com.library.base.utils.StorageUtils;
import java.util.Map;
public class NIMManager {
public static void init(Application application){
DemoCache.setContext(application);
NIMClient.init(application, null, getDefaultoptions());
if (ProcessUtils.isMainProcess()) {
// 初始化UIKit模块
NimUIKit.init(application);
// 会话窗口的定制初始化。
SessionHelper.init();
TeamAVChatHelper.sharedInstance().registerObserver(true);
// 注册通知消息过滤器
registerIMMessageFilter();
// 初始化消息提醒
NIMClient.toggleNotification(UserPreferences.getNotificationToggle());
// 注册白板会话
// registerRTSIncomingObserver(true);
// // 注册语言变化监听
// registerLocaleReceiver(true);
// 注册网络通话来电
registerAVChatIncomingCallObserver(true);
}
}
/**
* 如果返回值为 null,则全部使用默认参数。
* @return
*/
private static SDKOptions getDefaultoptions() {
SDKOptions options = new SDKOptions();
// 如果将新消息通知提醒托管给 SDK 完成,需要添加以下配置。否则无需设置。
StatusBarNotificationConfig config = new StatusBarNotificationConfig();
config.notificationEntrance = MainActivity.class; // 点击通知栏跳转到该Activity
config.notificationSmallIconId = R.drawable.ic_stat_notify_msg;
// 呼吸灯配置
config.ledARGB = Color.GREEN;
config.ledOnMs = 1000;
config.ledOffMs = 1500;
// 通知铃声的uri字符串
config.notificationSound = "android.resource://com.netease.nim.demo/raw/msg";
options.statusBarNotificationConfig = config;
// 配置保存图片,文件,log 等数据的目录
// 如果 getDefaultoptions 中没有设置这个值,SDK 会使用采用默认路径作为 SDK 的数据目录。
// 该目录目前包含 log, file, image, audio, video, thumb 这6个目录。
String sdkPath = StorageUtils.getImPath(); // 可以不设置,那么将采用默认路径
// 如果第三方 APP 需要缓存清理功能, 清理这个目录下面个子目录的内容即可。
options.sdkStorageRootPath = sdkPath;
// 配置是否需要预下载附件缩略图,默认为 true
options.preloadAttach = true;
// 配置附件缩略图的尺寸大小。表示向服务器请求缩略图文件的大小
// 该值一般应根据屏幕尺寸来确定, 默认值为 Screen.width / 2
options.thumbnailSize = ScreenUtils.getScreenWidth() / 2;
// 用户资料提供者, 目前主要用于提供用户资料,用于新消息通知栏中显示消息来源的头像和昵称
options.userInfoProvider = new UserInfoProvider() {
@Override
public UserInfo getUserInfo(String account) {
return null;
}
@Override
public String getDisplayNameForMessageNotifier(String account, String sessionId, SessionTypeEnum sessionType) {
return null;
}
@Override
public Bitmap getAvatarForMessageNotifier(SessionTypeEnum sessionType, String sessionId) {
return BitmapFactory.decodeResource(Utils.getApp().getResources(), R.drawable.ic_launcher);
}
};
return options;
}
/**
* 通知消息过滤器(如果过滤则该消息不存储不上报)
*/
private static void registerIMMessageFilter() {
NIMClient.getService(MsgService.class).registerIMMessageFilter(new IMMessageFilter() {
@Override
public boolean shouldIgnore(IMMessage message) {
if (UserPreferences.getMsgIgnore() && message.getAttachment() != null) {
if (message.getAttachment() instanceof UpdateTeamAttachment) {
UpdateTeamAttachment attachment = (UpdateTeamAttachment) message.getAttachment();
for (Map.Entry<TeamFieldEnum, Object> field : attachment.getUpdatedFields().entrySet()) {
if (field.getKey() == TeamFieldEnum.ICON) {
return true;
}
}
} else if (message.getAttachment() instanceof AVChatAttachment) {
return true;
}
}
return false;
}
});
}
private static void registerAVChatIncomingCallObserver(boolean register) {
AVChatManager.getInstance().observeIncomingCall(new Observer<AVChatData>() {
@Override
public void onEvent(AVChatData data) {
String extra = data.getExtra();
Log.e("Extra", "Extra Message->" + extra);
if (PhoneCallStateObserver.getInstance().getPhoneCallState() != PhoneCallStateObserver.PhoneCallStateEnum.IDLE
|| AVChatProfile.getInstance().isAVChatting()
|| TeamAVChatHelper.sharedInstance().isTeamAVChatting()
|| AVChatManager.getInstance().getCurrentChatId() != 0) {
LogUtil.i("InitBusiness", "reject incoming call data =" + data.toString() + " as local phone is not idle");
AVChatManager.getInstance().sendControlCommand(data.getChatId(), AVChatControlCommand.BUSY, null);
return;
}
// 有网络来电打开AVChatActivity
AVChatProfile.getInstance().setAVChatting(true);
AVChatProfile.getInstance().launchActivity(data, AVChatActivity.FROM_BROADCASTRECEIVER);
}
}, register);
}
/**
* 登陆
* @param account
* @param token
*/
public static void doLogin(FragmentActivity activity, String account, String token){
LoginInfo loginInfo = new LoginInfo(account, token, ResourceHelper.getString(R.string.nim_appkey));
NIMClient.getService(AuthService.class).login(loginInfo).setCallback(new RequestCallback() {
@Override
public void onSuccess(Object param) {
DemoCache.setAccount(account);
}
@Override
public void onFailed(int code) {
showLoginError(activity, loginInfo);
}
@Override
public void onException(Throwable exception) {
showLoginError(activity, loginInfo);
}
});
}
/**
* 登出
*/
public static void doLogout(){
NIMClient.getService(AuthService.class).logout();
}
/**
* IM登陆失败
* @param activity
* @param loginInfo
*/
private static void showLoginError(FragmentActivity activity, LoginInfo loginInfo) {
DialogManager.getConfrimDialog("IM登陆失败!")
.setActionText("重试", "退出")
.addListener(new ConfirmDialog.SimpleConfirmDialogListener(){
@Override
public void onPositiveClick(ConfirmDialog dialog, View v) {
super.onPositiveClick(dialog, v);
doLogin(activity, loginInfo.getAccount(), loginInfo.getToken());
}
@Override
public void onNegativeClick(ConfirmDialog dialog, View v) {
super.onNegativeClick(dialog, v);
AppContext.exitApp();
}
})
.show(activity.getSupportFragmentManager());
}
}
| UTF-8 | Java | 10,158 | java | NIMManager.java | Java | [] | null | [] | package com.yksj.consultation.im;
import android.app.Application;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.View;
import com.blankj.utilcode.util.ProcessUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.Utils;
import com.library.base.utils.ResourceHelper;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.SDKOptions;
import com.netease.nimlib.sdk.StatusBarNotificationConfig;
import com.netease.nimlib.sdk.auth.AuthService;
import com.netease.nimlib.sdk.auth.LoginInfo;
import com.netease.nimlib.sdk.avchat.AVChatManager;
import com.netease.nimlib.sdk.avchat.constant.AVChatControlCommand;
import com.netease.nimlib.sdk.avchat.model.AVChatAttachment;
import com.netease.nimlib.sdk.avchat.model.AVChatData;
import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.netease.nimlib.sdk.team.constant.TeamFieldEnum;
import com.netease.nimlib.sdk.team.model.IMMessageFilter;
import com.netease.nimlib.sdk.team.model.UpdateTeamAttachment;
import com.netease.nimlib.sdk.uinfo.UserInfoProvider;
import com.netease.nimlib.sdk.uinfo.model.UserInfo;
import com.yksj.consultation.app.AppContext;
import com.library.base.dialog.ConfirmDialog;
import com.yksj.consultation.dialog.DialogManager;
import com.yksj.consultation.main.MainActivity;
import com.yksj.consultation.sonDoc.R;
import com.yksj.consultation.sonDoc.chatting.avchat.AVChatActivity;
import com.yksj.consultation.sonDoc.chatting.avchat.AVChatProfile;
import com.yksj.consultation.sonDoc.chatting.avchat.cache.DemoCache;
import com.yksj.consultation.sonDoc.chatting.avchat.common.NimUIKit;
import com.yksj.consultation.sonDoc.chatting.avchat.init.UserPreferences;
import com.yksj.consultation.sonDoc.chatting.avchat.receiver.PhoneCallStateObserver;
import com.yksj.consultation.sonDoc.chatting.avchat.team.SessionHelper;
import com.yksj.consultation.sonDoc.chatting.avchat.team.TeamAVChatHelper;
import com.yksj.healthtalk.utils.LogUtil;
import com.library.base.utils.StorageUtils;
import java.util.Map;
public class NIMManager {
public static void init(Application application){
DemoCache.setContext(application);
NIMClient.init(application, null, getDefaultoptions());
if (ProcessUtils.isMainProcess()) {
// 初始化UIKit模块
NimUIKit.init(application);
// 会话窗口的定制初始化。
SessionHelper.init();
TeamAVChatHelper.sharedInstance().registerObserver(true);
// 注册通知消息过滤器
registerIMMessageFilter();
// 初始化消息提醒
NIMClient.toggleNotification(UserPreferences.getNotificationToggle());
// 注册白板会话
// registerRTSIncomingObserver(true);
// // 注册语言变化监听
// registerLocaleReceiver(true);
// 注册网络通话来电
registerAVChatIncomingCallObserver(true);
}
}
/**
* 如果返回值为 null,则全部使用默认参数。
* @return
*/
private static SDKOptions getDefaultoptions() {
SDKOptions options = new SDKOptions();
// 如果将新消息通知提醒托管给 SDK 完成,需要添加以下配置。否则无需设置。
StatusBarNotificationConfig config = new StatusBarNotificationConfig();
config.notificationEntrance = MainActivity.class; // 点击通知栏跳转到该Activity
config.notificationSmallIconId = R.drawable.ic_stat_notify_msg;
// 呼吸灯配置
config.ledARGB = Color.GREEN;
config.ledOnMs = 1000;
config.ledOffMs = 1500;
// 通知铃声的uri字符串
config.notificationSound = "android.resource://com.netease.nim.demo/raw/msg";
options.statusBarNotificationConfig = config;
// 配置保存图片,文件,log 等数据的目录
// 如果 getDefaultoptions 中没有设置这个值,SDK 会使用采用默认路径作为 SDK 的数据目录。
// 该目录目前包含 log, file, image, audio, video, thumb 这6个目录。
String sdkPath = StorageUtils.getImPath(); // 可以不设置,那么将采用默认路径
// 如果第三方 APP 需要缓存清理功能, 清理这个目录下面个子目录的内容即可。
options.sdkStorageRootPath = sdkPath;
// 配置是否需要预下载附件缩略图,默认为 true
options.preloadAttach = true;
// 配置附件缩略图的尺寸大小。表示向服务器请求缩略图文件的大小
// 该值一般应根据屏幕尺寸来确定, 默认值为 Screen.width / 2
options.thumbnailSize = ScreenUtils.getScreenWidth() / 2;
// 用户资料提供者, 目前主要用于提供用户资料,用于新消息通知栏中显示消息来源的头像和昵称
options.userInfoProvider = new UserInfoProvider() {
@Override
public UserInfo getUserInfo(String account) {
return null;
}
@Override
public String getDisplayNameForMessageNotifier(String account, String sessionId, SessionTypeEnum sessionType) {
return null;
}
@Override
public Bitmap getAvatarForMessageNotifier(SessionTypeEnum sessionType, String sessionId) {
return BitmapFactory.decodeResource(Utils.getApp().getResources(), R.drawable.ic_launcher);
}
};
return options;
}
/**
* 通知消息过滤器(如果过滤则该消息不存储不上报)
*/
private static void registerIMMessageFilter() {
NIMClient.getService(MsgService.class).registerIMMessageFilter(new IMMessageFilter() {
@Override
public boolean shouldIgnore(IMMessage message) {
if (UserPreferences.getMsgIgnore() && message.getAttachment() != null) {
if (message.getAttachment() instanceof UpdateTeamAttachment) {
UpdateTeamAttachment attachment = (UpdateTeamAttachment) message.getAttachment();
for (Map.Entry<TeamFieldEnum, Object> field : attachment.getUpdatedFields().entrySet()) {
if (field.getKey() == TeamFieldEnum.ICON) {
return true;
}
}
} else if (message.getAttachment() instanceof AVChatAttachment) {
return true;
}
}
return false;
}
});
}
private static void registerAVChatIncomingCallObserver(boolean register) {
AVChatManager.getInstance().observeIncomingCall(new Observer<AVChatData>() {
@Override
public void onEvent(AVChatData data) {
String extra = data.getExtra();
Log.e("Extra", "Extra Message->" + extra);
if (PhoneCallStateObserver.getInstance().getPhoneCallState() != PhoneCallStateObserver.PhoneCallStateEnum.IDLE
|| AVChatProfile.getInstance().isAVChatting()
|| TeamAVChatHelper.sharedInstance().isTeamAVChatting()
|| AVChatManager.getInstance().getCurrentChatId() != 0) {
LogUtil.i("InitBusiness", "reject incoming call data =" + data.toString() + " as local phone is not idle");
AVChatManager.getInstance().sendControlCommand(data.getChatId(), AVChatControlCommand.BUSY, null);
return;
}
// 有网络来电打开AVChatActivity
AVChatProfile.getInstance().setAVChatting(true);
AVChatProfile.getInstance().launchActivity(data, AVChatActivity.FROM_BROADCASTRECEIVER);
}
}, register);
}
/**
* 登陆
* @param account
* @param token
*/
public static void doLogin(FragmentActivity activity, String account, String token){
LoginInfo loginInfo = new LoginInfo(account, token, ResourceHelper.getString(R.string.nim_appkey));
NIMClient.getService(AuthService.class).login(loginInfo).setCallback(new RequestCallback() {
@Override
public void onSuccess(Object param) {
DemoCache.setAccount(account);
}
@Override
public void onFailed(int code) {
showLoginError(activity, loginInfo);
}
@Override
public void onException(Throwable exception) {
showLoginError(activity, loginInfo);
}
});
}
/**
* 登出
*/
public static void doLogout(){
NIMClient.getService(AuthService.class).logout();
}
/**
* IM登陆失败
* @param activity
* @param loginInfo
*/
private static void showLoginError(FragmentActivity activity, LoginInfo loginInfo) {
DialogManager.getConfrimDialog("IM登陆失败!")
.setActionText("重试", "退出")
.addListener(new ConfirmDialog.SimpleConfirmDialogListener(){
@Override
public void onPositiveClick(ConfirmDialog dialog, View v) {
super.onPositiveClick(dialog, v);
doLogin(activity, loginInfo.getAccount(), loginInfo.getToken());
}
@Override
public void onNegativeClick(ConfirmDialog dialog, View v) {
super.onNegativeClick(dialog, v);
AppContext.exitApp();
}
})
.show(activity.getSupportFragmentManager());
}
}
| 10,158 | 0.646476 | 0.645093 | 233 | 39.317596 | 29.545229 | 127 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.592275 | false | false | 1 |
95c336215ecd2f276e042a9c93f4325c36a2d5b7 | 28,484,223,157,358 | 703aa20c4e523413e6092fdf2fcdd5de0a206649 | /src/main/java/nl/hu/v1wac/firstapp/webservices/WorldResource.java | aa025acbd532d0438f618270a39cedcbefbba8ba | [] | no_license | Rheiter/WAC-Practica | https://github.com/Rheiter/WAC-Practica | 770ab8ed8646a1b01c69e0c87bb616f4de8de5e2 | 25a3bb17412aced22d1022c2e9b575a6a4119e68 | refs/heads/master | 2021-01-25T05:09:16.084000 | 2017-06-06T14:21:58 | 2017-06-06T14:21:58 | 93,510,218 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package nl.hu.v1wac.firstapp.webservices;
import java.util.List;
import javax.annotation.security.RolesAllowed;
import javax.json.*;
import javax.ws.rs.*;
import nl.hu.v1wac.firstapp.model.Country;
import nl.hu.v1wac.firstapp.model.ServiceProvider;
import nl.hu.v1wac.firstapp.model.WorldService;
@Path("/countries")
public class WorldResource {
JsonObjectBuilder countryToJson(Country c) {
JsonObjectBuilder job = Json.createObjectBuilder();
job.add("iso2", c.getCode()).add("iso3", c.getIso3Code())
.add("name", c.getName()).add("continent", c.getContinent())
.add("capital", c.getCapital()).add("region", c.getRegion())
.add("surface", c.getSurface()).add("population", c.getPopulation())
.add("government", c.getGovernment());
return job;
}
@GET
@Produces("application/json")
public String getAllCountries() {
WorldService service = ServiceProvider.getWorldService();
JsonArrayBuilder jab = Json.createArrayBuilder();
JsonObjectBuilder job = Json.createObjectBuilder();
if (service.getAllCountries() == null) {
throw new WebApplicationException("No such order!");
}
for (Country c : service.getAllCountries()) {
job.add("iso2", c.getCode()).add("iso3", c.getIso3Code())
.add("name", c.getName()).add("continent", c.getContinent())
.add("capital", c.getCapital()).add("region", c.getRegion())
.add("surface", c.getSurface()).add("population", c.getPopulation())
.add("government", c.getGovernment()).add("lat", c.getLatitude())
.add("lng", c.getLongitude());
jab.add(job);
}
JsonArray array = jab.build();
return array.toString();
}
@GET
@Path("{code}")
@Produces("application/json")
public String getCountryInfo(@PathParam("code") String code) {
WorldService service = ServiceProvider.getWorldService();
Country country = service.getCountryByCode(code);
if (country == null) {
throw new WebApplicationException("No such order!");
}
JsonObjectBuilder job = Json.createObjectBuilder();
job.add("iso2", country.getCode()).add("iso3", country.getIso3Code())
.add("name", country.getName()).add("continent", country.getContinent())
.add("capital", country.getCapital()).add("region", country.getRegion())
.add("surface", country.getSurface())
.add("population", country.getPopulation())
.add("government", country.getGovernment()).add("lat", country.getLatitude())
.add("lng", country.getLongitude());
return job.build().toString();
}
@GET
@Path("/largestsurfaces")
@Produces("application/json")
public String getLargestSurfaces() {
WorldService service = ServiceProvider.getWorldService();
List<Country> largestSurfaces = service.get10LargestSurfaces();
if (largestSurfaces == null) {
throw new WebApplicationException("No such order!");
}
JsonArrayBuilder jab = Json.createArrayBuilder();
JsonObjectBuilder job = Json.createObjectBuilder();
for (Country c : largestSurfaces) {
job.add("iso2", c.getCode()).add("iso3", c.getIso3Code())
.add("name", c.getName()).add("continent", c.getContinent())
.add("capital", c.getCapital()).add("region", c.getRegion())
.add("surface", c.getSurface()).add("population", c.getPopulation())
.add("government", c.getGovernment()).add("lat", c.getLatitude())
.add("lng", c.getLongitude());
jab.add(job);
}
return jab.build().toString();
}
@GET
@Path("/largestpopulations")
@Produces("application/json")
public String getLargestPopulations() {
WorldService service = ServiceProvider.getWorldService();
List<Country> largestPopulations = service.get10LargestPopulations();
if (largestPopulations == null) {
throw new WebApplicationException("No such order!");
}
JsonArrayBuilder jab = Json.createArrayBuilder();
JsonObjectBuilder job = Json.createObjectBuilder();
for (Country c : largestPopulations) {
job.add("iso2", c.getCode()).add("iso3", c.getIso3Code())
.add("name", c.getName()).add("continent", c.getContinent())
.add("capital", c.getCapital()).add("region", c.getRegion())
.add("surface", c.getSurface()).add("population", c.getPopulation())
.add("government", c.getGovernment()).add("lat", c.getLatitude())
.add("lng", c.getLongitude());
jab.add(job);
}
return jab.build().toString();
}
@PUT
@RolesAllowed("user")
@Path("{updateIso3}")
@Produces("application/json")
public String update(@PathParam("updateIso3") String iso3,
@FormParam("updateName") String name,
@FormParam("updateIso2") String iso2,
@FormParam("updateCapital") String capital,
@FormParam("updateContinent") String continent,
@FormParam("updateRegion") String region,
@FormParam("updateSurface") int surface,
@FormParam("updatePopulation") int population,
@FormParam("updateGovernment") String government,
@FormParam("updateLatitude") double latitude,
@FormParam("updateLongitude") double longitude) {
WorldService service = ServiceProvider.getWorldService();
Country found = null;
Country country = new Country(iso2, iso3, name, capital, continent, region,
surface, population, government, latitude, longitude);
found = service.updateCountry(country);
return countryToJson(found).build().toString();
}
@DELETE
@RolesAllowed("user")
@Path("{updateIso3}")
public boolean delete(@PathParam("updateIso3") String iso3,
@FormParam("updateName") String name,
@FormParam("updateIso2") String iso2,
@FormParam("updateCapital") String capital,
@FormParam("updateContinent") String continent,
@FormParam("updateRegion") String region,
@FormParam("updateSurface") int surface,
@FormParam("updatePopulation") int population,
@FormParam("updateGovernment") String government,
@FormParam("updateLatitude") double latitude,
@FormParam("updateLongitude") double longitude) {
WorldService service = ServiceProvider.getWorldService();
Country country = new Country(iso2, iso3, name, capital, continent, region,
surface, population, government, latitude, longitude);
return service.deleteCountry(country);
}
@POST
@RolesAllowed("user")
@Produces("application/json")
public String insert(@FormParam("insertIso3") String iso3,
@FormParam("insertName") String name,
@FormParam("insertIso2") String iso2,
@FormParam("insertCapital") String capital,
@FormParam("insertContinent") String continent,
@FormParam("insertRegion") String region,
@FormParam("insertSurface") int surface,
@FormParam("insertPopulation") int population,
@FormParam("insertGovernment") String government,
@FormParam("insertLatitude") double latitude,
@FormParam("insertLongitude") double longitude) {
WorldService service = ServiceProvider.getWorldService();
Country found = null;
Country country = new Country(iso2, iso3, name, capital, continent, region,
surface, population, government, latitude, longitude);
found = service.insertCountry(country);
return countryToJson(found).build().toString();
}
@GET
@Path("/search/{searchValue}")
@Produces("application/json")
public String search(@PathParam("searchValue") String searchValue) {
WorldService service = ServiceProvider.getWorldService();
JsonArrayBuilder jab = Json.createArrayBuilder();
JsonObjectBuilder job = Json.createObjectBuilder();
if (service.getAllCountries() == null) {
throw new WebApplicationException("No such order!");
}
for (Country c : service.searchCountries(searchValue)) {
job.add("iso2", c.getCode()).add("iso3", c.getIso3Code())
.add("name", c.getName()).add("continent", c.getContinent())
.add("capital", c.getCapital()).add("region", c.getRegion())
.add("surface", c.getSurface()).add("population", c.getPopulation())
.add("government", c.getGovernment()).add("lat", c.getLatitude())
.add("lng", c.getLongitude());
jab.add(job);
}
JsonArray array = jab.build();
return array.toString();
}
}
| UTF-8 | Java | 8,061 | java | WorldResource.java | Java | [] | null | [] | package nl.hu.v1wac.firstapp.webservices;
import java.util.List;
import javax.annotation.security.RolesAllowed;
import javax.json.*;
import javax.ws.rs.*;
import nl.hu.v1wac.firstapp.model.Country;
import nl.hu.v1wac.firstapp.model.ServiceProvider;
import nl.hu.v1wac.firstapp.model.WorldService;
@Path("/countries")
public class WorldResource {
JsonObjectBuilder countryToJson(Country c) {
JsonObjectBuilder job = Json.createObjectBuilder();
job.add("iso2", c.getCode()).add("iso3", c.getIso3Code())
.add("name", c.getName()).add("continent", c.getContinent())
.add("capital", c.getCapital()).add("region", c.getRegion())
.add("surface", c.getSurface()).add("population", c.getPopulation())
.add("government", c.getGovernment());
return job;
}
@GET
@Produces("application/json")
public String getAllCountries() {
WorldService service = ServiceProvider.getWorldService();
JsonArrayBuilder jab = Json.createArrayBuilder();
JsonObjectBuilder job = Json.createObjectBuilder();
if (service.getAllCountries() == null) {
throw new WebApplicationException("No such order!");
}
for (Country c : service.getAllCountries()) {
job.add("iso2", c.getCode()).add("iso3", c.getIso3Code())
.add("name", c.getName()).add("continent", c.getContinent())
.add("capital", c.getCapital()).add("region", c.getRegion())
.add("surface", c.getSurface()).add("population", c.getPopulation())
.add("government", c.getGovernment()).add("lat", c.getLatitude())
.add("lng", c.getLongitude());
jab.add(job);
}
JsonArray array = jab.build();
return array.toString();
}
@GET
@Path("{code}")
@Produces("application/json")
public String getCountryInfo(@PathParam("code") String code) {
WorldService service = ServiceProvider.getWorldService();
Country country = service.getCountryByCode(code);
if (country == null) {
throw new WebApplicationException("No such order!");
}
JsonObjectBuilder job = Json.createObjectBuilder();
job.add("iso2", country.getCode()).add("iso3", country.getIso3Code())
.add("name", country.getName()).add("continent", country.getContinent())
.add("capital", country.getCapital()).add("region", country.getRegion())
.add("surface", country.getSurface())
.add("population", country.getPopulation())
.add("government", country.getGovernment()).add("lat", country.getLatitude())
.add("lng", country.getLongitude());
return job.build().toString();
}
@GET
@Path("/largestsurfaces")
@Produces("application/json")
public String getLargestSurfaces() {
WorldService service = ServiceProvider.getWorldService();
List<Country> largestSurfaces = service.get10LargestSurfaces();
if (largestSurfaces == null) {
throw new WebApplicationException("No such order!");
}
JsonArrayBuilder jab = Json.createArrayBuilder();
JsonObjectBuilder job = Json.createObjectBuilder();
for (Country c : largestSurfaces) {
job.add("iso2", c.getCode()).add("iso3", c.getIso3Code())
.add("name", c.getName()).add("continent", c.getContinent())
.add("capital", c.getCapital()).add("region", c.getRegion())
.add("surface", c.getSurface()).add("population", c.getPopulation())
.add("government", c.getGovernment()).add("lat", c.getLatitude())
.add("lng", c.getLongitude());
jab.add(job);
}
return jab.build().toString();
}
@GET
@Path("/largestpopulations")
@Produces("application/json")
public String getLargestPopulations() {
WorldService service = ServiceProvider.getWorldService();
List<Country> largestPopulations = service.get10LargestPopulations();
if (largestPopulations == null) {
throw new WebApplicationException("No such order!");
}
JsonArrayBuilder jab = Json.createArrayBuilder();
JsonObjectBuilder job = Json.createObjectBuilder();
for (Country c : largestPopulations) {
job.add("iso2", c.getCode()).add("iso3", c.getIso3Code())
.add("name", c.getName()).add("continent", c.getContinent())
.add("capital", c.getCapital()).add("region", c.getRegion())
.add("surface", c.getSurface()).add("population", c.getPopulation())
.add("government", c.getGovernment()).add("lat", c.getLatitude())
.add("lng", c.getLongitude());
jab.add(job);
}
return jab.build().toString();
}
@PUT
@RolesAllowed("user")
@Path("{updateIso3}")
@Produces("application/json")
public String update(@PathParam("updateIso3") String iso3,
@FormParam("updateName") String name,
@FormParam("updateIso2") String iso2,
@FormParam("updateCapital") String capital,
@FormParam("updateContinent") String continent,
@FormParam("updateRegion") String region,
@FormParam("updateSurface") int surface,
@FormParam("updatePopulation") int population,
@FormParam("updateGovernment") String government,
@FormParam("updateLatitude") double latitude,
@FormParam("updateLongitude") double longitude) {
WorldService service = ServiceProvider.getWorldService();
Country found = null;
Country country = new Country(iso2, iso3, name, capital, continent, region,
surface, population, government, latitude, longitude);
found = service.updateCountry(country);
return countryToJson(found).build().toString();
}
@DELETE
@RolesAllowed("user")
@Path("{updateIso3}")
public boolean delete(@PathParam("updateIso3") String iso3,
@FormParam("updateName") String name,
@FormParam("updateIso2") String iso2,
@FormParam("updateCapital") String capital,
@FormParam("updateContinent") String continent,
@FormParam("updateRegion") String region,
@FormParam("updateSurface") int surface,
@FormParam("updatePopulation") int population,
@FormParam("updateGovernment") String government,
@FormParam("updateLatitude") double latitude,
@FormParam("updateLongitude") double longitude) {
WorldService service = ServiceProvider.getWorldService();
Country country = new Country(iso2, iso3, name, capital, continent, region,
surface, population, government, latitude, longitude);
return service.deleteCountry(country);
}
@POST
@RolesAllowed("user")
@Produces("application/json")
public String insert(@FormParam("insertIso3") String iso3,
@FormParam("insertName") String name,
@FormParam("insertIso2") String iso2,
@FormParam("insertCapital") String capital,
@FormParam("insertContinent") String continent,
@FormParam("insertRegion") String region,
@FormParam("insertSurface") int surface,
@FormParam("insertPopulation") int population,
@FormParam("insertGovernment") String government,
@FormParam("insertLatitude") double latitude,
@FormParam("insertLongitude") double longitude) {
WorldService service = ServiceProvider.getWorldService();
Country found = null;
Country country = new Country(iso2, iso3, name, capital, continent, region,
surface, population, government, latitude, longitude);
found = service.insertCountry(country);
return countryToJson(found).build().toString();
}
@GET
@Path("/search/{searchValue}")
@Produces("application/json")
public String search(@PathParam("searchValue") String searchValue) {
WorldService service = ServiceProvider.getWorldService();
JsonArrayBuilder jab = Json.createArrayBuilder();
JsonObjectBuilder job = Json.createObjectBuilder();
if (service.getAllCountries() == null) {
throw new WebApplicationException("No such order!");
}
for (Country c : service.searchCountries(searchValue)) {
job.add("iso2", c.getCode()).add("iso3", c.getIso3Code())
.add("name", c.getName()).add("continent", c.getContinent())
.add("capital", c.getCapital()).add("region", c.getRegion())
.add("surface", c.getSurface()).add("population", c.getPopulation())
.add("government", c.getGovernment()).add("lat", c.getLatitude())
.add("lng", c.getLongitude());
jab.add(job);
}
JsonArray array = jab.build();
return array.toString();
}
}
| 8,061 | 0.691229 | 0.685523 | 234 | 33.448719 | 24.734133 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.290598 | false | false | 1 |
e3c8ca37ace4b8eccdbb5a9351736121062bd295 | 31,430,570,723,474 | bcb24056fde2cb3915508e210250fba1e29bd113 | /3.JavaMultithreading/src/com/javarush/task/task24/task2401/SelfInterfaceMarkerImpl.java | 6157894a7ee0aa81c7c4cc7914250e8d88a401a4 | [] | no_license | s3rji/JavaRush | https://github.com/s3rji/JavaRush | fd8ba2ac8a1b5984813508f695302185a265b5bf | 8ce3a54e89ec0e8ccae4ae6c5598017ed8954abe | refs/heads/master | 2023-07-17T01:43:47.525000 | 2021-08-26T19:01:22 | 2021-08-26T19:01:22 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.javarush.task.task24.task2401;
public class SelfInterfaceMarkerImpl implements SelfInterfaceMarker {
public String getName() {
return null;
}
public void setName(String name) {
}
}
| UTF-8 | Java | 220 | java | SelfInterfaceMarkerImpl.java | Java | [] | null | [] | package com.javarush.task.task24.task2401;
public class SelfInterfaceMarkerImpl implements SelfInterfaceMarker {
public String getName() {
return null;
}
public void setName(String name) {
}
}
| 220 | 0.704545 | 0.677273 | 11 | 19 | 21.92964 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | false | false | 1 |
78ee13bc5e51694542070358f1134e203fe83973 | 13,400,298,008,339 | 849b5825ec542bb4c926dc9522403bdf2a6ceeed | /ClasificacionDePizzas/src/clasificaciondepizzas/classification/base/PoorPressing.java | 4c429074df70955ea540ac441e70659fee1ef617 | [] | no_license | togrulseyid/clasificaciondepizzas | https://github.com/togrulseyid/clasificaciondepizzas | 03d38f0b8aa0dfb43e3570925b10df8a1ab24360 | eff11bc4fe064afee3d6e1931c01fa3a268b0bc6 | refs/heads/master | 2021-01-10T02:44:37.504000 | 2010-02-12T22:51:42 | 2010-02-12T22:51:42 | 45,852,687 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package clasificaciondepizzas.classification.base;
import java.util.Hashtable;
/**
*
* @author Alejandro
*/
public class PoorPressing {
private Hashtable valorMap;
public PoorPressing(){
valorMap =new Hashtable();
valorMap.put("R",3.56193283807882);
valorMap.put("E",0.5316015959350955);
valorMap.put("A1",0.8257241906104942);
valorMap.put("A2",1.1806451612903226);
}
public Hashtable getHash(){
return valorMap;
}
}
| UTF-8 | Java | 640 | java | PoorPressing.java | Java | [
{
"context": "e;\n\nimport java.util.Hashtable;\n\n/**\n *\n * @author Alejandro\n */\n public class PoorPressing {\n\n private Has",
"end": 209,
"score": 0.9997782707214355,
"start": 200,
"tag": "NAME",
"value": "Alejandro"
}
] | null | [] | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package clasificaciondepizzas.classification.base;
import java.util.Hashtable;
/**
*
* @author Alejandro
*/
public class PoorPressing {
private Hashtable valorMap;
public PoorPressing(){
valorMap =new Hashtable();
valorMap.put("R",3.56193283807882);
valorMap.put("E",0.5316015959350955);
valorMap.put("A1",0.8257241906104942);
valorMap.put("A2",1.1806451612903226);
}
public Hashtable getHash(){
return valorMap;
}
}
| 640 | 0.609375 | 0.503125 | 30 | 20.333334 | 19.477053 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 1 |
b929b77de046b4963f7b2318908aeffafdf07b17 | 24,489,903,572,325 | 29159bc4c137fe9104d831a5efe346935eeb2db5 | /mmj-cloud-active/src/main/java/com/mmj/active/coupon/controller/CouponRedeemCodeController.java | 4991bb0bfde5480ea850904d75791d5b5555574d | [] | no_license | xddpool/mmj-cloud | https://github.com/xddpool/mmj-cloud | bfb06d2ef08c9e7b967c63f223fc50b1a56aac1c | de4bcb35db509ce929d516d83de765fdc2afdac5 | refs/heads/master | 2023-06-27T11:16:38.059000 | 2020-07-24T03:23:48 | 2020-07-24T03:23:48 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.mmj.active.coupon.controller;
import com.mmj.active.coupon.model.vo.ExchangeCouponVo;
import com.mmj.active.coupon.model.vo.RedeemCodeVo;
import com.mmj.active.coupon.service.CouponRedeemCodeService;
import com.mmj.common.controller.BaseController;
import com.mmj.common.model.ReturnData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 优惠券兑换码
*/
@Slf4j
@RestController
@RequestMapping("/coupon/couponRedeemCode")
@Api(value = "优惠券兑换码", description = "优惠券兑换码")
public class CouponRedeemCodeController extends BaseController {
@Autowired
private CouponRedeemCodeService couponRedeemCodeService;
/**
* 生成优惠券兑换码
* @param redeemCodeVo
* @return
*/
@RequestMapping(value = "/addRedeemCode", method = RequestMethod.POST)
@ApiOperation(value = "生成优惠券兑换码")
public ReturnData<Object> addRedeemCode(@RequestBody RedeemCodeVo redeemCodeVo) {
return initSuccessObjectResult(couponRedeemCodeService.addRedeemCode(redeemCodeVo));
}
/**
* 下载兑换码
* @param request
* @param response
* @param batchCode
* @return
*/
@RequestMapping(value = "/downloadRedeemCode/{batchCode}", method = RequestMethod.GET)
@ApiOperation(value = "下载兑换码")
public ReturnData<Object> downloadRedeemCode(HttpServletRequest request,
HttpServletResponse response, @PathVariable("batchCode") String batchCode) {
return initSuccessObjectResult(couponRedeemCodeService.downloadRedeemCode(request,response,batchCode));
}
/**
* 兑换优惠券
* @param exchangeCouponVo
* @return
*/
@RequestMapping(value = "/exchangeCoupon", method = RequestMethod.POST)
@ApiOperation(value = "兑换优惠券")
public ReturnData<Object> exchangeCoupon(@RequestBody ExchangeCouponVo exchangeCouponVo) {
return initSuccessObjectResult(couponRedeemCodeService.exchangeCoupon(exchangeCouponVo));
}
/**
* 根据兑换码获取优惠券
* @param exchangeCouponVo
* @return
*/
@RequestMapping(value = "/getRedeemCoupon", method = RequestMethod.POST)
@ApiOperation(value = "根据兑换码获取优惠券")
public ReturnData<Object> getRedeemCoupon(@RequestBody ExchangeCouponVo exchangeCouponVo){
return initSuccessObjectResult(couponRedeemCodeService.getRedeemCoupon(exchangeCouponVo));
}
}
| UTF-8 | Java | 2,831 | java | CouponRedeemCodeController.java | Java | [] | null | [] | package com.mmj.active.coupon.controller;
import com.mmj.active.coupon.model.vo.ExchangeCouponVo;
import com.mmj.active.coupon.model.vo.RedeemCodeVo;
import com.mmj.active.coupon.service.CouponRedeemCodeService;
import com.mmj.common.controller.BaseController;
import com.mmj.common.model.ReturnData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 优惠券兑换码
*/
@Slf4j
@RestController
@RequestMapping("/coupon/couponRedeemCode")
@Api(value = "优惠券兑换码", description = "优惠券兑换码")
public class CouponRedeemCodeController extends BaseController {
@Autowired
private CouponRedeemCodeService couponRedeemCodeService;
/**
* 生成优惠券兑换码
* @param redeemCodeVo
* @return
*/
@RequestMapping(value = "/addRedeemCode", method = RequestMethod.POST)
@ApiOperation(value = "生成优惠券兑换码")
public ReturnData<Object> addRedeemCode(@RequestBody RedeemCodeVo redeemCodeVo) {
return initSuccessObjectResult(couponRedeemCodeService.addRedeemCode(redeemCodeVo));
}
/**
* 下载兑换码
* @param request
* @param response
* @param batchCode
* @return
*/
@RequestMapping(value = "/downloadRedeemCode/{batchCode}", method = RequestMethod.GET)
@ApiOperation(value = "下载兑换码")
public ReturnData<Object> downloadRedeemCode(HttpServletRequest request,
HttpServletResponse response, @PathVariable("batchCode") String batchCode) {
return initSuccessObjectResult(couponRedeemCodeService.downloadRedeemCode(request,response,batchCode));
}
/**
* 兑换优惠券
* @param exchangeCouponVo
* @return
*/
@RequestMapping(value = "/exchangeCoupon", method = RequestMethod.POST)
@ApiOperation(value = "兑换优惠券")
public ReturnData<Object> exchangeCoupon(@RequestBody ExchangeCouponVo exchangeCouponVo) {
return initSuccessObjectResult(couponRedeemCodeService.exchangeCoupon(exchangeCouponVo));
}
/**
* 根据兑换码获取优惠券
* @param exchangeCouponVo
* @return
*/
@RequestMapping(value = "/getRedeemCoupon", method = RequestMethod.POST)
@ApiOperation(value = "根据兑换码获取优惠券")
public ReturnData<Object> getRedeemCoupon(@RequestBody ExchangeCouponVo exchangeCouponVo){
return initSuccessObjectResult(couponRedeemCodeService.getRedeemCoupon(exchangeCouponVo));
}
}
| 2,831 | 0.713008 | 0.71189 | 76 | 33.302631 | 31.812782 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.355263 | false | false | 1 |
3feb96c5f12edaa9d405f2d76e1332d70de16285 | 24,489,903,570,052 | 2070118ec1c9b54ce7ebea5c9f35021e2de0cd1a | /app/src/main/java/com/rasco/myapp/myapplication/db/ColorsDB.java | 5c406006fa6d92671d70506d2f681d148c399877 | [] | no_license | fas2065/MyApplication | https://github.com/fas2065/MyApplication | 77fb87737213b7168a4ec752864671c00dd3e0c3 | 5f07e588141093732e34dcdec8e7afd36a4931c8 | refs/heads/master | 2021-04-26T02:50:04.369000 | 2018-02-18T13:46:09 | 2018-02-18T13:46:09 | 121,401,990 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.rasco.myapp.myapplication.db;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.rasco.myapp.myapplication.base.Colors;
import java.util.ArrayList;
/**
* Created by Admin on 2/15/2018.
*/
public class ColorsDB extends DBHandler {
public static final String TABLE_COLORS = "COLORS";
public static final String COLUMN_COLORS_ID = "colors_id";
public static final String COLUMN_COLORS_NAME ="name";
public static final String COLUMN_COLOR_ONE = "color_one";
public static final String COLUMN_COLOR_TWO = "color_two";
public static final String COLUMN_COLOR_THREE = "color_three";
final static String CREATE_TABLE_COLORS = "CREATE TABLE " + TABLE_COLORS + "(" +
COLUMN_COLORS_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
COLUMN_COLORS_NAME + " TEXT, " +
COLUMN_COLOR_ONE + " TEXT, " +
COLUMN_COLOR_TWO + " TEXT, " +
COLUMN_COLOR_THREE + " TEXT) ";
public ColorsDB(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
super(context, name, factory, version);
}
public Colors getColors(int colorsId) {
SQLiteDatabase db = getWritableDatabase();
String query = "SELECT * FROM " + TABLE_COLORS + " WHERE " +
COLUMN_COLORS_ID + " = " + colorsId;
Cursor c = db.rawQuery(query, null);
//Move to the first row in your results
c.moveToFirst();
Colors colors= new Colors(c.getInt(c.getColumnIndex(COLUMN_COLORS_ID)),
c.getString(c.getColumnIndex(COLUMN_COLORS_NAME)),
c.getString(c.getColumnIndex(COLUMN_COLOR_ONE)),
c.getString(c.getColumnIndex(COLUMN_COLOR_TWO)),
c.getString(c.getColumnIndex(COLUMN_COLOR_THREE)));
return colors;
}
//Add a new row to the database
public void addColors(Colors colors){
ContentValues values = new ContentValues();
values.put(COLUMN_COLORS_NAME, colors.getName());
values.put(COLUMN_COLOR_ONE, colors.getColorOne());
values.put(COLUMN_COLOR_TWO, colors.getColorTwo());
values.put(COLUMN_COLOR_THREE, colors.getColorThree());
SQLiteDatabase db = getWritableDatabase();
db.insert(TABLE_COLORS, null, values);
db.close();
}
public boolean updateColors(Colors colors) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COLUMN_COLORS_NAME, colors.getName());
contentValues.put(COLUMN_COLOR_ONE, colors.getColorOne());
contentValues.put(COLUMN_COLOR_TWO, colors.getColorTwo());
contentValues.put(COLUMN_COLOR_THREE, colors.getColorThree());
db.update(TABLE_COLORS, contentValues, COLUMN_COLORS_ID + " = ? ",
new String[]{Integer.toString(colors.get_id())});
return true;
}
public void deleteColors(Colors colors) {
SQLiteDatabase db = getWritableDatabase();
String query = "DELETE FROM " + TABLE_COLORS + " WHERE " +
COLUMN_COLORS_ID + " = ?" ;
db.execSQL(query, new Integer[] {colors.get_id()});
db.close();
}
public ArrayList<Colors> getAllColors(){
ArrayList<Colors> colorsList = new ArrayList<>();
SQLiteDatabase db = getWritableDatabase();
String query = "SELECT * FROM " + TABLE_COLORS + " WHERE 1";
//Cursor points to a location in your results
Cursor c = db.rawQuery(query, null);
//Move to the first row in your results
c.moveToFirst();
//Position after the last row means the end of the results
while (!c.isAfterLast()) {
if (c.getString(c.getColumnIndex(COLUMN_COLORS_NAME)) != null) {
colorsList.add(new Colors(c.getInt(c.getColumnIndex(COLUMN_COLORS_ID)),
c.getString(c.getColumnIndex(COLUMN_COLORS_NAME)),
c.getString(c.getColumnIndex(COLUMN_COLOR_ONE)),
c.getString(c.getColumnIndex(COLUMN_COLOR_TWO)),
c.getString(c.getColumnIndex(COLUMN_COLOR_THREE))));
}
c.moveToNext();
}
db.close();
return colorsList;
}
} | UTF-8 | Java | 4,399 | java | ColorsDB.java | Java | [
{
"context": "s;\n\nimport java.util.ArrayList;\n\n/**\n * Created by Admin on 2/15/2018.\n */\n\npublic class ColorsDB extends ",
"end": 296,
"score": 0.8292521834373474,
"start": 291,
"tag": "USERNAME",
"value": "Admin"
}
] | null | [] | package com.rasco.myapp.myapplication.db;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.rasco.myapp.myapplication.base.Colors;
import java.util.ArrayList;
/**
* Created by Admin on 2/15/2018.
*/
public class ColorsDB extends DBHandler {
public static final String TABLE_COLORS = "COLORS";
public static final String COLUMN_COLORS_ID = "colors_id";
public static final String COLUMN_COLORS_NAME ="name";
public static final String COLUMN_COLOR_ONE = "color_one";
public static final String COLUMN_COLOR_TWO = "color_two";
public static final String COLUMN_COLOR_THREE = "color_three";
final static String CREATE_TABLE_COLORS = "CREATE TABLE " + TABLE_COLORS + "(" +
COLUMN_COLORS_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
COLUMN_COLORS_NAME + " TEXT, " +
COLUMN_COLOR_ONE + " TEXT, " +
COLUMN_COLOR_TWO + " TEXT, " +
COLUMN_COLOR_THREE + " TEXT) ";
public ColorsDB(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
super(context, name, factory, version);
}
public Colors getColors(int colorsId) {
SQLiteDatabase db = getWritableDatabase();
String query = "SELECT * FROM " + TABLE_COLORS + " WHERE " +
COLUMN_COLORS_ID + " = " + colorsId;
Cursor c = db.rawQuery(query, null);
//Move to the first row in your results
c.moveToFirst();
Colors colors= new Colors(c.getInt(c.getColumnIndex(COLUMN_COLORS_ID)),
c.getString(c.getColumnIndex(COLUMN_COLORS_NAME)),
c.getString(c.getColumnIndex(COLUMN_COLOR_ONE)),
c.getString(c.getColumnIndex(COLUMN_COLOR_TWO)),
c.getString(c.getColumnIndex(COLUMN_COLOR_THREE)));
return colors;
}
//Add a new row to the database
public void addColors(Colors colors){
ContentValues values = new ContentValues();
values.put(COLUMN_COLORS_NAME, colors.getName());
values.put(COLUMN_COLOR_ONE, colors.getColorOne());
values.put(COLUMN_COLOR_TWO, colors.getColorTwo());
values.put(COLUMN_COLOR_THREE, colors.getColorThree());
SQLiteDatabase db = getWritableDatabase();
db.insert(TABLE_COLORS, null, values);
db.close();
}
public boolean updateColors(Colors colors) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COLUMN_COLORS_NAME, colors.getName());
contentValues.put(COLUMN_COLOR_ONE, colors.getColorOne());
contentValues.put(COLUMN_COLOR_TWO, colors.getColorTwo());
contentValues.put(COLUMN_COLOR_THREE, colors.getColorThree());
db.update(TABLE_COLORS, contentValues, COLUMN_COLORS_ID + " = ? ",
new String[]{Integer.toString(colors.get_id())});
return true;
}
public void deleteColors(Colors colors) {
SQLiteDatabase db = getWritableDatabase();
String query = "DELETE FROM " + TABLE_COLORS + " WHERE " +
COLUMN_COLORS_ID + " = ?" ;
db.execSQL(query, new Integer[] {colors.get_id()});
db.close();
}
public ArrayList<Colors> getAllColors(){
ArrayList<Colors> colorsList = new ArrayList<>();
SQLiteDatabase db = getWritableDatabase();
String query = "SELECT * FROM " + TABLE_COLORS + " WHERE 1";
//Cursor points to a location in your results
Cursor c = db.rawQuery(query, null);
//Move to the first row in your results
c.moveToFirst();
//Position after the last row means the end of the results
while (!c.isAfterLast()) {
if (c.getString(c.getColumnIndex(COLUMN_COLORS_NAME)) != null) {
colorsList.add(new Colors(c.getInt(c.getColumnIndex(COLUMN_COLORS_ID)),
c.getString(c.getColumnIndex(COLUMN_COLORS_NAME)),
c.getString(c.getColumnIndex(COLUMN_COLOR_ONE)),
c.getString(c.getColumnIndex(COLUMN_COLOR_TWO)),
c.getString(c.getColumnIndex(COLUMN_COLOR_THREE))));
}
c.moveToNext();
}
db.close();
return colorsList;
}
} | 4,399 | 0.626506 | 0.624687 | 111 | 38.639641 | 26.839796 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.756757 | false | false | 1 |
c0423e3a63c084362e5fcbee9d6acf459dc5cff0 | 17,111,149,772,026 | 4f0e25a0ca3273e7a368b6488da13a40e41f5d48 | /prog_2016_2017__t1c2b/Ejercicio1/src/ejercicio1/Ejercicio1.java | d4b976775ec63620899cfa24ebd814f367232e07 | [] | no_license | fjcmolina/Examenes-1-Trimestre | https://github.com/fjcmolina/Examenes-1-Trimestre | 45f26e39d616a0fc9f8cad472cbd7ce9122a9e69 | 186883be9ab86a9ef20bf2756a88b8ada7f6beb9 | refs/heads/master | 2020-03-12T14:31:24.646000 | 2018-05-15T08:15:57 | 2018-05-15T08:15:57 | 130,669,282 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* Muestra por pantalla una secuencia aleatoria de 10 números múltiplos de 7 comprendidos entre el 140
* y el 210 ambos incluidos.
*
* Ejemplo:
* 203 210 140 175 217 203 175 210 140 182
*/
package ejercicio1;
/**
*
* @author Francis
*/
public class Ejercicio1 {
public static void main(String[] args) {
int contador = 0;
for (int i = 0; contador < 10; i++) {
int numero = (int) ((Math.random() * 71) + 140);
if ((numero % 7) == 0) {
System.out.print(numero + " ");
contador++;
}
}
}
}
| UTF-8 | Java | 570 | java | Ejercicio1.java | Java | [
{
"context": "140 182\n */\npackage ejercicio1;\n\n/**\n *\n * @author Francis\n */\npublic class Ejercicio1 {\n\n public static vo",
"end": 260,
"score": 0.9996696710586548,
"start": 253,
"tag": "NAME",
"value": "Francis"
}
] | null | [] | /*
* Muestra por pantalla una secuencia aleatoria de 10 números múltiplos de 7 comprendidos entre el 140
* y el 210 ambos incluidos.
*
* Ejemplo:
* 203 210 140 175 217 203 175 210 140 182
*/
package ejercicio1;
/**
*
* @author Francis
*/
public class Ejercicio1 {
public static void main(String[] args) {
int contador = 0;
for (int i = 0; contador < 10; i++) {
int numero = (int) ((Math.random() * 71) + 140);
if ((numero % 7) == 0) {
System.out.print(numero + " ");
contador++;
}
}
}
}
| 570 | 0.559859 | 0.46831 | 29 | 18.586206 | 23.262398 | 106 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.241379 | false | false | 1 |
501c9585bfd4b3fc852ea93ff07ed560ee8eec9f | 15,444,702,451,374 | 448e1c8119c24a8916ba8d25a45ee99d5c36b4e1 | /src/miniproject/SelectionSort.java | 4866be48f0033f254b7cef96d3f09bca867576e9 | [] | no_license | Sameeksha7/Sorting-Algorithms-Simulator | https://github.com/Sameeksha7/Sorting-Algorithms-Simulator | b37639be9809057ea47cf8cd07e8a88b86c5a67b | e6a5252c519cfddd5121b483eacf2c97624259f1 | refs/heads/master | 2020-06-21T11:52:48.647000 | 2019-07-17T19:07:16 | 2019-07-17T19:07:16 | 197,441,896 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package miniproject;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import static java.lang.Thread.sleep;
import static java.lang.Thread.sleep;
public class SelectionSort extends Sort {
private Timer timer;
private final int DELAY = 5;
private int flag = 0;
private int complete = 0;
private ArrayList<Integer> num;
private JButton nb[];
SelectionSort(ArrayList<Integer> numbers, ArrayList<JButton> buttons) {
super((ArrayList<Integer>) numbers.clone(), (ArrayList<JButton>) buttons.clone());
}
public int min(int m, int n) {
int min = 100000;
int ind = 0;
for (int i = m; i < n; i++) {
if (getNumarray().get(i) < min) {
min = getNumarray().get(i);
ind = i;
}
}
return ind;
}
public void sort2() {
ArrayList<Integer> arr = new ArrayList<>(getNumarray());
int min;
for (int i = 0; i < arr.size(); i++) {
min = i;
for (int j = i; j < arr.size(); j++) {
if (arr.get(min) > arr.get(j)) {
min = j;
}
}
int temp = arr.get(i);
arr.set(i, arr.get(min));
arr.set(min, temp);
}
}
public void sort() {
JButton B1 = null, B2 = null;
int sI = 0, sJ = 0;
timer = new Timer(DELAY, new BSListener(sI, sJ));
timer.start();
}
Timer getSSTimer() {
return this.timer;
}
private class BSListener implements ActionListener {
private JButton B1;
private JButton B2;
private JButton B3 = getButtonArr().get(0);
private int k = 1, m = 0, j, p = getNumarray().get(0), i = 0;
BSListener(int i, int j) {
m = 0;
k = m + 1;
}
public void actionPerformed(ActionEvent event) {
if (getTimer() == null || getTimerUp() == null || getTimerDn() == null) {
timer.stop();
}
if (getTimer() != null && getTimerUp() != null && getTimerDn() != null) {
if (!getTimer().isRunning() && !getTimerUp().isRunning() && !getTimerDn().isRunning()) {
if (i < getNumarray().size()) {
if (i == getNumarray().size()) {
timer.stop();
complete = 1;
}
for (j = i; j < getNumarray().size(); j++) {
if (getNumarray().get(i) > getNumarray().get(j)) {
int ind = min(j, getNumarray().size());
swap(getButtonArr().get(i), getButtonArr().get(ind));
swapNo(ind, i);
}
}
if (!getTimer().isRunning() && !getTimerUp().isRunning() && !getTimerDn().isRunning()) {
i++;
}
}
k = 0;
}
}
}
}
public int getComplete() {
return complete;
}
}
| UTF-8 | Java | 3,321 | java | SelectionSort.java | Java | [] | null | [] | package miniproject;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import static java.lang.Thread.sleep;
import static java.lang.Thread.sleep;
public class SelectionSort extends Sort {
private Timer timer;
private final int DELAY = 5;
private int flag = 0;
private int complete = 0;
private ArrayList<Integer> num;
private JButton nb[];
SelectionSort(ArrayList<Integer> numbers, ArrayList<JButton> buttons) {
super((ArrayList<Integer>) numbers.clone(), (ArrayList<JButton>) buttons.clone());
}
public int min(int m, int n) {
int min = 100000;
int ind = 0;
for (int i = m; i < n; i++) {
if (getNumarray().get(i) < min) {
min = getNumarray().get(i);
ind = i;
}
}
return ind;
}
public void sort2() {
ArrayList<Integer> arr = new ArrayList<>(getNumarray());
int min;
for (int i = 0; i < arr.size(); i++) {
min = i;
for (int j = i; j < arr.size(); j++) {
if (arr.get(min) > arr.get(j)) {
min = j;
}
}
int temp = arr.get(i);
arr.set(i, arr.get(min));
arr.set(min, temp);
}
}
public void sort() {
JButton B1 = null, B2 = null;
int sI = 0, sJ = 0;
timer = new Timer(DELAY, new BSListener(sI, sJ));
timer.start();
}
Timer getSSTimer() {
return this.timer;
}
private class BSListener implements ActionListener {
private JButton B1;
private JButton B2;
private JButton B3 = getButtonArr().get(0);
private int k = 1, m = 0, j, p = getNumarray().get(0), i = 0;
BSListener(int i, int j) {
m = 0;
k = m + 1;
}
public void actionPerformed(ActionEvent event) {
if (getTimer() == null || getTimerUp() == null || getTimerDn() == null) {
timer.stop();
}
if (getTimer() != null && getTimerUp() != null && getTimerDn() != null) {
if (!getTimer().isRunning() && !getTimerUp().isRunning() && !getTimerDn().isRunning()) {
if (i < getNumarray().size()) {
if (i == getNumarray().size()) {
timer.stop();
complete = 1;
}
for (j = i; j < getNumarray().size(); j++) {
if (getNumarray().get(i) > getNumarray().get(j)) {
int ind = min(j, getNumarray().size());
swap(getButtonArr().get(i), getButtonArr().get(ind));
swapNo(ind, i);
}
}
if (!getTimer().isRunning() && !getTimerUp().isRunning() && !getTimerDn().isRunning()) {
i++;
}
}
k = 0;
}
}
}
}
public int getComplete() {
return complete;
}
}
| 3,321 | 0.450768 | 0.442337 | 124 | 25.782259 | 24.880541 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.612903 | false | false | 1 |
cefab0790fab7b4777c7d45c14c5ee56b3f53194 | 33,715,493,306,496 | 34e2b2f0f1c2b80875dfa14cb79db3801f0dd1e1 | /src/main/java/com/dima/financeapp/model/request/UserEditRequest.java | dc8cb737c0972f8e8c108e8eef06fa3c6f1c119c | [] | no_license | Dmitry374/FinanceSpringWebApp | https://github.com/Dmitry374/FinanceSpringWebApp | ad3788f5ea3afdb5fde07d5c4334eb91a61dee96 | 9efd577675b11865395963161869a1eb40b03fae | refs/heads/master | 2023-07-18T05:31:39.892000 | 2021-08-29T11:14:14 | 2021-08-29T11:43:12 | 401,027,373 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.dima.financeapp.model.request;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class UserEditRequest {
private Long id;
private String name;
private String surname;
private String email;
@JsonProperty("photo_url")
private String photoUrl;
private String datebirth;
private String gender;
}
| UTF-8 | Java | 375 | java | UserEditRequest.java | Java | [] | null | [] | package com.dima.financeapp.model.request;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class UserEditRequest {
private Long id;
private String name;
private String surname;
private String email;
@JsonProperty("photo_url")
private String photoUrl;
private String datebirth;
private String gender;
}
| 375 | 0.744 | 0.744 | 16 | 22.4375 | 14.439394 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.625 | false | false | 1 |
4376b334e251f7017fe6064db8989292ccb2a6ff | 549,755,854,536 | e05dc98ff8f1b9dd0643f7d68fb41a8964702008 | /app/src/main/java/net/arvin/selectordemo/App.java | bc2ec4426fc654fce6ea02727959a90ce5e75baf | [
"Apache-2.0"
] | permissive | arvinljw/PictureSelector | https://github.com/arvinljw/PictureSelector | d8d84d21bedb0c7659bed4de19a05b8d8a8c9b9f | 5521433c6a861f463fa66434b15b49adbaec23f6 | refs/heads/master | 2022-12-21T02:13:17.480000 | 2022-12-17T03:09:03 | 2022-12-17T03:09:03 | 67,299,510 | 184 | 34 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.arvin.selectordemo;
import android.app.Application;
import android.net.Uri;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import net.arvin.selector.SelectorHelper;
import net.arvin.selector.engines.ImageEngine;
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
SelectorHelper.init(new ImageEngine() {
@Override
public void loadImage(ImageView imageView, Uri uri) {
Glide.with(imageView)
.load(uri)
.into(imageView);
}
});
}
}
| UTF-8 | Java | 640 | java | App.java | Java | [] | null | [] | package net.arvin.selectordemo;
import android.app.Application;
import android.net.Uri;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import net.arvin.selector.SelectorHelper;
import net.arvin.selector.engines.ImageEngine;
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
SelectorHelper.init(new ImageEngine() {
@Override
public void loadImage(ImageView imageView, Uri uri) {
Glide.with(imageView)
.load(uri)
.into(imageView);
}
});
}
}
| 640 | 0.61875 | 0.61875 | 25 | 24.6 | 17.419529 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.44 | false | false | 1 |
c2efebc18fea7eba5ffffff7acb95b476bbef71c | 14,516,989,508,786 | fe6d8655ca40b2748f537fbe17a80a1dbc4613ee | /app/src/main/java/com/mssd/adapter/Food_Recycle1.java | e55df0e4f73cc8a58ba806fd5c63a6f9b3726966 | [] | no_license | youareapig/NearXindu | https://github.com/youareapig/NearXindu | e5692768a1c6402666e1c3bd8bd7b54ddd646110 | 93f29aad47123f203aeba1b40c11297576a89963 | refs/heads/master | 2021-01-20T09:29:57.394000 | 2018-05-22T05:26:26 | 2018-05-22T05:26:26 | 101,600,008 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.mssd.adapter;
import android.app.Activity;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.mssd.data.LocationBean;
import com.mssd.zl.JiaYanActivity;
import com.mssd.zl.R;
import com.mssd.zl.ShiJiaActivity;
import com.mssd.zl.ShiTangActivity;
import com.zhy.autolayout.utils.AutoUtils;
import java.util.List;
/**
* Created by DELL on 2017/8/30.
*/
public class Food_Recycle1 extends RecyclerView.Adapter {
private List<LocationBean> list;
private Activity activity;
public Food_Recycle1(List<LocationBean> list, Activity activity) {
this.list = list;
this.activity = activity;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
ViewHolder holder = new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.food_item_top, parent, false));
return holder;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
LocationBean info = list.get(position);
ViewHolder viewHolder = (ViewHolder) holder;
viewHolder.foodtopname.setText(info.getName());
viewHolder.foodtopimg.setImageResource(info.getImg());
AssetManager assetManager = activity.getAssets();
Typeface typeface = Typeface.createFromAsset(assetManager, "fonts/sxsl.ttf");
viewHolder.foodtopname.setTypeface(typeface);
viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (position) {
case 0:
Intent intent = new Intent(v.getContext(), JiaYanActivity.class);
v.getContext().startActivity(intent);
break;
case 1:
Intent intent1 = new Intent(v.getContext(), ShiTangActivity.class);
v.getContext().startActivity(intent1);
break;
case 2:
Intent intent2 = new Intent(v.getContext(), ShiJiaActivity.class);
v.getContext().startActivity(intent2);
break;
}
}
});
}
@Override
public int getItemCount() {
if (list != null) {
return list.size();
}
return 0;
}
private class ViewHolder extends RecyclerView.ViewHolder {
private TextView foodtopname;
private ImageView foodtopimg;
public ViewHolder(View itemView) {
super(itemView);
AutoUtils.autoSize(itemView);
foodtopname = (TextView) itemView.findViewById(R.id.food_itemtop_name);
foodtopimg = (ImageView) itemView.findViewById(R.id.food_itemtop_img);
}
}
}
| UTF-8 | Java | 3,136 | java | Food_Recycle1.java | Java | [
{
"context": "oUtils;\n\nimport java.util.List;\n\n/**\n * Created by DELL on 2017/8/30.\n */\n\npublic class Food_Recycle1 ext",
"end": 621,
"score": 0.9975924491882324,
"start": 617,
"tag": "USERNAME",
"value": "DELL"
}
] | null | [] | package com.mssd.adapter;
import android.app.Activity;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.mssd.data.LocationBean;
import com.mssd.zl.JiaYanActivity;
import com.mssd.zl.R;
import com.mssd.zl.ShiJiaActivity;
import com.mssd.zl.ShiTangActivity;
import com.zhy.autolayout.utils.AutoUtils;
import java.util.List;
/**
* Created by DELL on 2017/8/30.
*/
public class Food_Recycle1 extends RecyclerView.Adapter {
private List<LocationBean> list;
private Activity activity;
public Food_Recycle1(List<LocationBean> list, Activity activity) {
this.list = list;
this.activity = activity;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
ViewHolder holder = new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.food_item_top, parent, false));
return holder;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
LocationBean info = list.get(position);
ViewHolder viewHolder = (ViewHolder) holder;
viewHolder.foodtopname.setText(info.getName());
viewHolder.foodtopimg.setImageResource(info.getImg());
AssetManager assetManager = activity.getAssets();
Typeface typeface = Typeface.createFromAsset(assetManager, "fonts/sxsl.ttf");
viewHolder.foodtopname.setTypeface(typeface);
viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (position) {
case 0:
Intent intent = new Intent(v.getContext(), JiaYanActivity.class);
v.getContext().startActivity(intent);
break;
case 1:
Intent intent1 = new Intent(v.getContext(), ShiTangActivity.class);
v.getContext().startActivity(intent1);
break;
case 2:
Intent intent2 = new Intent(v.getContext(), ShiJiaActivity.class);
v.getContext().startActivity(intent2);
break;
}
}
});
}
@Override
public int getItemCount() {
if (list != null) {
return list.size();
}
return 0;
}
private class ViewHolder extends RecyclerView.ViewHolder {
private TextView foodtopname;
private ImageView foodtopimg;
public ViewHolder(View itemView) {
super(itemView);
AutoUtils.autoSize(itemView);
foodtopname = (TextView) itemView.findViewById(R.id.food_itemtop_name);
foodtopimg = (ImageView) itemView.findViewById(R.id.food_itemtop_img);
}
}
}
| 3,136 | 0.634247 | 0.628508 | 92 | 33.086956 | 27.159214 | 132 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.630435 | false | false | 1 |
dd67af2d789760176de89c91fe241e02b4162925 | 31,396,210,935,028 | 845ddf351c24a556f5a5d11f663e7be39a9dce42 | /Kod zrodlowy/src/rseslib/processing/classification/meta/AdaBoost.java | 23f7de5c3fd2f88041b632dae41ef90aae7f290d | [] | no_license | szusti/projektInz | https://github.com/szusti/projektInz | 8471bf9283b6eaf1ef48a55597aea1a4707f6f06 | e4cfe6d6e50f9435319518fa29107824863b4174 | refs/heads/master | 2020-03-13T01:40:37.445000 | 2018-04-24T21:52:15 | 2018-04-24T21:52:15 | 130,908,675 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* Copyright (C) 2002 - 2016 Logic Group, Institute of Mathematics, Warsaw University
*
* This file is part of Rseslib.
*
* Rseslib is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Rseslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package rseslib.processing.classification.meta;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Properties;
import rseslib.processing.classification.Classifier;
import rseslib.processing.classification.ClassifierFactory;
import rseslib.processing.filtering.Sampler;
import rseslib.structure.attribute.NominalAttribute;
import rseslib.structure.data.DoubleData;
import rseslib.structure.table.ArrayListDoubleDataTable;
import rseslib.structure.table.DoubleDataTable;
import rseslib.system.ConfigurationWithStatistics;
import rseslib.system.PropertyConfigurationException;
import rseslib.system.progress.EmptyProgress;
import rseslib.system.progress.Progress;
/**
* @author Sebastian Stawicki
*
*/
public class AdaBoost extends ConfigurationWithStatistics implements Classifier {
private static final String propertyAdaBoostWeakClassifiersClass = "adaBoostWeakClassifiersClass";
private static final String propertyAdaBoostNumberOfIterations = "adaBoostNumberOfIterations";
private static final String propertyAdaBoostUseWeakClassifiersDefaultProperties = "adaBoostUseWeakClassifiersDefaultProperties";
private ArrayList<Classifier> classifiersEnsemble = new ArrayList<Classifier>();
private ArrayList<Double> classifiersWeights = new ArrayList<Double>();
private ArrayList<DoubleData> trainTableArrayList;
/** Decision attribute */
private int decisionAttributeIndex;
private NominalAttribute nominalDecisionAttribute = null;
//TODO STAWICKI uzupe�ni� opis javadoc, doda� komunikaty dla rzucanych wyj�tk�w, doda� obs�ug� decyzji numerycznych
public AdaBoost(Properties prop, DoubleDataTable trainTable, Progress prog)
throws PropertyConfigurationException, InterruptedException, ClassNotFoundException,
IllegalArgumentException, SecurityException, InstantiationException,
IllegalAccessException, InvocationTargetException, NoSuchMethodException {
super(prop);
if (!trainTable.attributes().attribute(trainTable.attributes().decision()).isNominal())
throw new IllegalArgumentException();
trainTableArrayList = trainTable.getDataObjects();
decisionAttributeIndex = trainTable.attributes().decision();
if (trainTable.attributes().attribute(decisionAttributeIndex).isNominal())
nominalDecisionAttribute = trainTable.attributes().nominalDecisionAttribute();
boolean useWeakClassifiersDefaultProperties = getBoolProperty(propertyAdaBoostUseWeakClassifiersDefaultProperties);
Properties classifiersProperties = useWeakClassifiersDefaultProperties ? null : getProperties();
int numberOfIterations = getIntProperty(propertyAdaBoostNumberOfIterations);
if (numberOfIterations <= 0)
throw new IllegalArgumentException();
Class weakClassifiersClass = Class.forName(getProperty(propertyAdaBoostWeakClassifiersClass));
String statement = "AdaBoost algorithm - creating ensemble of classifiers [";
statement += weakClassifiersClass.getName();
statement += "] from training table";
prog.set(statement, numberOfIterations);
Progress emptyProgress = new EmptyProgress();
ArrayList<Double> distribution = new ArrayList<Double>();
for (int i=0; i<trainTable.noOfObjects(); i++)
distribution.add(1.0/trainTable.noOfObjects());
for (int i=0; i<numberOfIterations; i++) {
ArrayList<DoubleData> trainSampleArrayList =
Sampler.selectWithRepetitionsFromSamplesWithDistribution(trainTableArrayList, distribution, trainTable.noOfObjects());
DoubleDataTable trainSample = new ArrayListDoubleDataTable(trainSampleArrayList);
Classifier classifier = ClassifierFactory.createClassifier(weakClassifiersClass, classifiersProperties, trainSample, emptyProgress);
double epsilon = calculateEpsilon(classifier, distribution);
if (epsilon >= 0.5) {
//TODO STAWICKI doda� lepsz� obs�ug� komunikatu
System.out.println("Error greater than 0.5 - Stop.");
for (int j=i; j<numberOfIterations; j++)
prog.step();
return;
}
classifiersEnsemble.add(classifier);
double alpha = calculateAlpha(epsilon);
classifiersWeights.add(alpha);
distribution = newDistribution(classifier, distribution, alpha);
prog.step();
}
}
private double calculateEpsilon(Classifier classifier, ArrayList<Double> distribution) throws PropertyConfigurationException {
double error = 0;
for (int i=0; i<trainTableArrayList.size(); i++) {
DoubleData obj = trainTableArrayList.get(i);
if (obj.get(decisionAttributeIndex) != classifier.classify(obj))
error += distribution.get(i);
}
return error;
}
private double calculateAlpha(double epsilon) {
return 0.5 * Math.log((1-epsilon)/epsilon);
}
private ArrayList<Double> newDistribution(Classifier classifier, ArrayList<Double> distribution, double alpha) throws PropertyConfigurationException {
ArrayList<Double> newDistribution = new ArrayList<Double>();
double sum = 0;
for (int i=0; i<distribution.size(); i++) {
DoubleData obj = trainTableArrayList.get(i);
double value = distribution.get(i);
double factor = Math.exp(-alpha);
if (obj.get(decisionAttributeIndex) == classifier.classify(obj))
value *= factor;
else
value /= factor;
newDistribution.add(value);
sum += value;
}
for (int i=0; i<newDistribution.size(); i++) {
double value = newDistribution.get(i);
newDistribution.set(i, value/sum);
}
return newDistribution;
}
/**
* Assigns a decision to a single test object.
*
* @param dObj Test object.
* @return Assigned decision.
* @throws PropertyConfigurationException
*/
public double classify(DoubleData obj) throws PropertyConfigurationException {
return classifyNominal(obj);
// //TODO STAWICKI doda� oobs�ug� decyzji numerycznych
// if (nominalDecisionAttribute != null)
// return classifyNominal(obj);
// else
// return classifyNumeric(obj);
}
protected double classifyNominal(DoubleData obj) throws PropertyConfigurationException {
double[] ensembleDecision = new double[nominalDecisionAttribute.noOfValues()];
int best = 0;
for (int i=0; i<classifiersEnsemble.size(); i++) {
int dec = nominalDecisionAttribute.localValueCode(classifiersEnsemble.get(i).classify(obj));
if (dec == -1)
continue;
ensembleDecision[dec] += classifiersWeights.get(i);
if (ensembleDecision[dec] > ensembleDecision[best])
best = dec;
}
return nominalDecisionAttribute.globalValueCode(best);
}
// //TODO STAWICKI doda� oobs�ug� decyzji numerycznych
// //TODO STAWICKI przypatrze� si� przypadkowi gdy sumOFWeights == 0
// protected double classifyNumeric(DoubleData obj) throws PropertyConfigurationException {
// double weightedSum = 0;
// double sumOfWeights = 0;
// for (int i=0; i<classifiersEnsemble.size(); i++) {
// double weight = classifiersWeights.get(i);
// weightedSum += weight * classifiersEnsemble.get(i).classify(obj);
// sumOfWeights += weight;
// }
// return (weightedSum / sumOfWeights);
// }
/**
* Calculates statistics.
*/
public void calculateStatistics() {
}
/**
* Resets statistic.
*/
public void resetStatistics() {
}
}
| UTF-8 | Java | 7,945 | java | AdaBoost.java | Java | [
{
"context": " rseslib.system.progress.Progress;\n\n/**\n * @author Sebastian Stawicki\n *\n */\npublic class AdaBoost extends Configuratio",
"end": 1524,
"score": 0.9998629689216614,
"start": 1506,
"tag": "NAME",
"value": "Sebastian Stawicki"
}
] | null | [] | /*
* Copyright (C) 2002 - 2016 Logic Group, Institute of Mathematics, Warsaw University
*
* This file is part of Rseslib.
*
* Rseslib is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Rseslib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package rseslib.processing.classification.meta;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Properties;
import rseslib.processing.classification.Classifier;
import rseslib.processing.classification.ClassifierFactory;
import rseslib.processing.filtering.Sampler;
import rseslib.structure.attribute.NominalAttribute;
import rseslib.structure.data.DoubleData;
import rseslib.structure.table.ArrayListDoubleDataTable;
import rseslib.structure.table.DoubleDataTable;
import rseslib.system.ConfigurationWithStatistics;
import rseslib.system.PropertyConfigurationException;
import rseslib.system.progress.EmptyProgress;
import rseslib.system.progress.Progress;
/**
* @author <NAME>
*
*/
public class AdaBoost extends ConfigurationWithStatistics implements Classifier {
private static final String propertyAdaBoostWeakClassifiersClass = "adaBoostWeakClassifiersClass";
private static final String propertyAdaBoostNumberOfIterations = "adaBoostNumberOfIterations";
private static final String propertyAdaBoostUseWeakClassifiersDefaultProperties = "adaBoostUseWeakClassifiersDefaultProperties";
private ArrayList<Classifier> classifiersEnsemble = new ArrayList<Classifier>();
private ArrayList<Double> classifiersWeights = new ArrayList<Double>();
private ArrayList<DoubleData> trainTableArrayList;
/** Decision attribute */
private int decisionAttributeIndex;
private NominalAttribute nominalDecisionAttribute = null;
//TODO STAWICKI uzupe�ni� opis javadoc, doda� komunikaty dla rzucanych wyj�tk�w, doda� obs�ug� decyzji numerycznych
public AdaBoost(Properties prop, DoubleDataTable trainTable, Progress prog)
throws PropertyConfigurationException, InterruptedException, ClassNotFoundException,
IllegalArgumentException, SecurityException, InstantiationException,
IllegalAccessException, InvocationTargetException, NoSuchMethodException {
super(prop);
if (!trainTable.attributes().attribute(trainTable.attributes().decision()).isNominal())
throw new IllegalArgumentException();
trainTableArrayList = trainTable.getDataObjects();
decisionAttributeIndex = trainTable.attributes().decision();
if (trainTable.attributes().attribute(decisionAttributeIndex).isNominal())
nominalDecisionAttribute = trainTable.attributes().nominalDecisionAttribute();
boolean useWeakClassifiersDefaultProperties = getBoolProperty(propertyAdaBoostUseWeakClassifiersDefaultProperties);
Properties classifiersProperties = useWeakClassifiersDefaultProperties ? null : getProperties();
int numberOfIterations = getIntProperty(propertyAdaBoostNumberOfIterations);
if (numberOfIterations <= 0)
throw new IllegalArgumentException();
Class weakClassifiersClass = Class.forName(getProperty(propertyAdaBoostWeakClassifiersClass));
String statement = "AdaBoost algorithm - creating ensemble of classifiers [";
statement += weakClassifiersClass.getName();
statement += "] from training table";
prog.set(statement, numberOfIterations);
Progress emptyProgress = new EmptyProgress();
ArrayList<Double> distribution = new ArrayList<Double>();
for (int i=0; i<trainTable.noOfObjects(); i++)
distribution.add(1.0/trainTable.noOfObjects());
for (int i=0; i<numberOfIterations; i++) {
ArrayList<DoubleData> trainSampleArrayList =
Sampler.selectWithRepetitionsFromSamplesWithDistribution(trainTableArrayList, distribution, trainTable.noOfObjects());
DoubleDataTable trainSample = new ArrayListDoubleDataTable(trainSampleArrayList);
Classifier classifier = ClassifierFactory.createClassifier(weakClassifiersClass, classifiersProperties, trainSample, emptyProgress);
double epsilon = calculateEpsilon(classifier, distribution);
if (epsilon >= 0.5) {
//TODO STAWICKI doda� lepsz� obs�ug� komunikatu
System.out.println("Error greater than 0.5 - Stop.");
for (int j=i; j<numberOfIterations; j++)
prog.step();
return;
}
classifiersEnsemble.add(classifier);
double alpha = calculateAlpha(epsilon);
classifiersWeights.add(alpha);
distribution = newDistribution(classifier, distribution, alpha);
prog.step();
}
}
private double calculateEpsilon(Classifier classifier, ArrayList<Double> distribution) throws PropertyConfigurationException {
double error = 0;
for (int i=0; i<trainTableArrayList.size(); i++) {
DoubleData obj = trainTableArrayList.get(i);
if (obj.get(decisionAttributeIndex) != classifier.classify(obj))
error += distribution.get(i);
}
return error;
}
private double calculateAlpha(double epsilon) {
return 0.5 * Math.log((1-epsilon)/epsilon);
}
private ArrayList<Double> newDistribution(Classifier classifier, ArrayList<Double> distribution, double alpha) throws PropertyConfigurationException {
ArrayList<Double> newDistribution = new ArrayList<Double>();
double sum = 0;
for (int i=0; i<distribution.size(); i++) {
DoubleData obj = trainTableArrayList.get(i);
double value = distribution.get(i);
double factor = Math.exp(-alpha);
if (obj.get(decisionAttributeIndex) == classifier.classify(obj))
value *= factor;
else
value /= factor;
newDistribution.add(value);
sum += value;
}
for (int i=0; i<newDistribution.size(); i++) {
double value = newDistribution.get(i);
newDistribution.set(i, value/sum);
}
return newDistribution;
}
/**
* Assigns a decision to a single test object.
*
* @param dObj Test object.
* @return Assigned decision.
* @throws PropertyConfigurationException
*/
public double classify(DoubleData obj) throws PropertyConfigurationException {
return classifyNominal(obj);
// //TODO STAWICKI doda� oobs�ug� decyzji numerycznych
// if (nominalDecisionAttribute != null)
// return classifyNominal(obj);
// else
// return classifyNumeric(obj);
}
protected double classifyNominal(DoubleData obj) throws PropertyConfigurationException {
double[] ensembleDecision = new double[nominalDecisionAttribute.noOfValues()];
int best = 0;
for (int i=0; i<classifiersEnsemble.size(); i++) {
int dec = nominalDecisionAttribute.localValueCode(classifiersEnsemble.get(i).classify(obj));
if (dec == -1)
continue;
ensembleDecision[dec] += classifiersWeights.get(i);
if (ensembleDecision[dec] > ensembleDecision[best])
best = dec;
}
return nominalDecisionAttribute.globalValueCode(best);
}
// //TODO STAWICKI doda� oobs�ug� decyzji numerycznych
// //TODO STAWICKI przypatrze� si� przypadkowi gdy sumOFWeights == 0
// protected double classifyNumeric(DoubleData obj) throws PropertyConfigurationException {
// double weightedSum = 0;
// double sumOfWeights = 0;
// for (int i=0; i<classifiersEnsemble.size(); i++) {
// double weight = classifiersWeights.get(i);
// weightedSum += weight * classifiersEnsemble.get(i).classify(obj);
// sumOfWeights += weight;
// }
// return (weightedSum / sumOfWeights);
// }
/**
* Calculates statistics.
*/
public void calculateStatistics() {
}
/**
* Resets statistic.
*/
public void resetStatistics() {
}
}
| 7,933 | 0.760025 | 0.755851 | 203 | 37.940887 | 32.824303 | 151 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.187192 | false | false | 1 |
ebd5ed49775f1d336896610b29f11be0d0ca1749 | 32,375,463,537,745 | f84e81259a3f86eb7e9f53e2b35234bdbe12d5ba | /cards-java/src/main/java/teamitp/Suit.java | 3909c8bc201cf80abfaaf190067746ee92c88a2c | [] | no_license | yo-naka/workshop | https://github.com/yo-naka/workshop | 9f438dc093a41be17062d609de94709c57caf03f | 4b54be2cebe21bb045f58cc95b50d20e11e09177 | refs/heads/master | 2020-03-23T17:25:35.908000 | 2018-05-12T08:36:20 | 2018-05-12T08:36:20 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package teamitp;
enum Suit {
Club, Diamond, Heart, Spade;
@Override
public String toString() {
switch (this) {
case Club:
return "♠";
case Diamond:
return "♦";
case Heart:
return "♣";
case Spade:
return "♥";
}
throw new IllegalArgumentException();
}
} | UTF-8 | Java | 381 | java | Suit.java | Java | [] | null | [] | package teamitp;
enum Suit {
Club, Diamond, Heart, Spade;
@Override
public String toString() {
switch (this) {
case Club:
return "♠";
case Diamond:
return "♦";
case Heart:
return "♣";
case Spade:
return "♥";
}
throw new IllegalArgumentException();
}
} | 381 | 0.466488 | 0.466488 | 20 | 17.700001 | 11.109005 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 1 |
60e98570a3b5d0e036cfb221a40049a03b84114a | 5,111,011,097,090 | 9c3c82c0f675bd015c501c0fd52821a96fc127ec | /src/main/java/com/majia/concurrentpackage/executors/CompletionServiceExample2.java | 53341ec9a4b02965f97e4f7c9da6e20d1443d1fb | [] | no_license | majia666/multi-threads | https://github.com/majia666/multi-threads | f65d94c4eac2bbaf51156a30946676d3f0881cb5 | bfade3c0fdd7af14d12c2125e192824c035d1b37 | refs/heads/master | 2022-01-13T06:51:53.795000 | 2021-12-28T15:12:37 | 2021-12-28T15:12:37 | 247,425,358 | 0 | 0 | null | false | 2020-10-13T20:22:12 | 2020-03-15T08:05:22 | 2020-03-19T12:22:23 | 2020-10-13T20:22:11 | 96 | 0 | 0 | 2 | Java | false | false | package com.majia.concurrentpackage.executors;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.*;
public class CompletionServiceExample2 {
public static void main(String[] args) throws InterruptedException, ExecutionException {
ExecutorService executorService = Executors.newFixedThreadPool(2);
List<Callable<Integer>> callableList = Arrays.asList(
() -> {
sleepSeconds(10);
System.out.println("The 10 finished.");
return 10;
},
() -> {
sleepSeconds(20);
System.out.println("The 20 finished.");
return 20;
}
);
ExecutorCompletionService<Integer> completionService = new ExecutorCompletionService<>(executorService);
List<Future<Integer>> futures = new ArrayList<Future<Integer>>();
callableList.stream().forEach(callable->futures.add(completionService.submit(callable)));
// Future<Integer> future = null;
// while (null != (future=completionService.take())){
// System.out.println(future.get());
// }
System.out.println(completionService.poll(11,TimeUnit.SECONDS).get());
}
private static void sleepSeconds(long seconds){
try {
TimeUnit.SECONDS.sleep(seconds);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
| UTF-8 | Java | 1,529 | java | CompletionServiceExample2.java | Java | [] | null | [] | package com.majia.concurrentpackage.executors;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.*;
public class CompletionServiceExample2 {
public static void main(String[] args) throws InterruptedException, ExecutionException {
ExecutorService executorService = Executors.newFixedThreadPool(2);
List<Callable<Integer>> callableList = Arrays.asList(
() -> {
sleepSeconds(10);
System.out.println("The 10 finished.");
return 10;
},
() -> {
sleepSeconds(20);
System.out.println("The 20 finished.");
return 20;
}
);
ExecutorCompletionService<Integer> completionService = new ExecutorCompletionService<>(executorService);
List<Future<Integer>> futures = new ArrayList<Future<Integer>>();
callableList.stream().forEach(callable->futures.add(completionService.submit(callable)));
// Future<Integer> future = null;
// while (null != (future=completionService.take())){
// System.out.println(future.get());
// }
System.out.println(completionService.poll(11,TimeUnit.SECONDS).get());
}
private static void sleepSeconds(long seconds){
try {
TimeUnit.SECONDS.sleep(seconds);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
| 1,529 | 0.593198 | 0.582734 | 50 | 29.58 | 29.020744 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.48 | false | false | 1 |
9f53dda1eb265b31c975067480527dee883a26ff | 7,799,660,643,224 | b721d87c8bb42c000b0b64289099ac5553001bb3 | /myjobs/src/main/java/com/dimogo/open/myjobs/manager/admin/controller/Admin.java | 35b339877efc945864e86f4c26425338bbf0a283 | [] | no_license | meeler/mustang | https://github.com/meeler/mustang | e19a70d414adb001fbb5e0d350851073cf5a8f6a | cabcd2a0bc3410993fae8dd37e6064e6e5204ab2 | refs/heads/master | 2020-12-03T01:49:36.062000 | 2017-06-27T07:32:08 | 2017-06-27T07:32:08 | 91,292,885 | 1 | 0 | null | true | 2017-06-30T09:30:23 | 2017-05-15T03:48:17 | 2017-05-15T06:15:05 | 2017-06-30T09:29:47 | 8,283 | 0 | 0 | 1 | Java | null | null | package com.dimogo.open.myjobs.manager.admin.controller;
import com.dimogo.open.myjobs.manager.admin.service.MyJobsService;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.http.HttpRequest;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.context.SecurityContextImpl;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestWrapper;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
/**
* Created by ethanx on 2017/5/10.
*/
@Controller
public class Admin {
@Resource(name = "clusteredJobService")
private MyJobsService service;
@RequestMapping(value = "/index", method = RequestMethod.GET)
public String index(ModelMap model, @RequestParam(required=false, defaultValue = "", value = "error") String error) {
if ("loginFailure".equalsIgnoreCase(error)) {
model.addAttribute("error", "Invalid user name/password");
}
return "index";
}
@RequestMapping(value = "/notpermitted", method = RequestMethod.GET)
public String notPermitted() {
return "notPermitted";
}
public void setService(MyJobsService service) {
this.service = service;
}
}
| UTF-8 | Java | 1,524 | java | Admin.java | Java | [
{
"context": "port javax.annotation.Resource;\n\n/**\n * Created by ethanx on 2017/5/10.\n */\n@Controller\npublic class Admin ",
"end": 869,
"score": 0.9995734095573425,
"start": 863,
"tag": "USERNAME",
"value": "ethanx"
}
] | null | [] | package com.dimogo.open.myjobs.manager.admin.controller;
import com.dimogo.open.myjobs.manager.admin.service.MyJobsService;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.http.HttpRequest;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.context.SecurityContextImpl;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestWrapper;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
/**
* Created by ethanx on 2017/5/10.
*/
@Controller
public class Admin {
@Resource(name = "clusteredJobService")
private MyJobsService service;
@RequestMapping(value = "/index", method = RequestMethod.GET)
public String index(ModelMap model, @RequestParam(required=false, defaultValue = "", value = "error") String error) {
if ("loginFailure".equalsIgnoreCase(error)) {
model.addAttribute("error", "Invalid user name/password");
}
return "index";
}
@RequestMapping(value = "/notpermitted", method = RequestMethod.GET)
public String notPermitted() {
return "notPermitted";
}
public void setService(MyJobsService service) {
this.service = service;
}
}
| 1,524 | 0.801837 | 0.797244 | 42 | 35.285713 | 29.686686 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.142857 | false | false | 1 |
df0e912470cc9578ed50fad1ed9687ee446a3b5c | 7,799,660,644,391 | 3634eded90370ff24ee8f47ccfa19e388d3784ad | /src/main/java/com/douban/book/reader/view/ShareSelectionInfoView.java | 019713f20aa8a6aec6a54f7b4e728c074f166320 | [] | no_license | xiaofans/ResStudyPro | https://github.com/xiaofans/ResStudyPro | 8bc3c929ef7199c269c6250b390d80739aaf50b9 | ac3204b27a65e006ebeb5b522762848ea82d960b | refs/heads/master | 2021-01-25T05:09:52.461000 | 2017-06-06T12:12:41 | 2017-06-06T12:12:41 | 93,514,258 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.douban.book.reader.view;
import android.content.Context;
import android.support.annotation.ArrayRes;
import android.support.annotation.ColorRes;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.douban.book.reader.content.Book;
import com.douban.book.reader.content.Book.ImageSize;
import com.douban.book.reader.content.page.Position;
import com.douban.book.reader.content.page.Range;
import com.douban.book.reader.content.paragraph.IllusParagraph;
import com.douban.book.reader.content.paragraph.Paragraph;
import com.douban.book.reader.entity.Works;
import com.douban.book.reader.manager.WorksManager;
import com.douban.book.reader.manager.exception.DataLoadException;
import com.douban.book.reader.util.ImageLoaderUtils;
import com.douban.book.reader.util.Logger;
import com.douban.book.reader.util.ReaderUri;
import com.douban.book.reader.util.StringUtils;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;
@EViewGroup(2130903188)
public class ShareSelectionInfoView extends RelativeLayout {
private static final String TAG = ShareSelectionInfoView.class.getSimpleName();
@ViewById(2131558504)
ImageView mImageIllus;
@ViewById(2131558936)
ParagraphView mSelection;
@ViewById(2131558462)
TextView mTitle;
@Bean
WorksManager mWorksManager;
public ShareSelectionInfoView(Context context) {
super(context);
}
public ShareSelectionInfoView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ShareSelectionInfoView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public void setData(int worksId, Range range) {
loadData(worksId, range);
}
public void setQuoteLineColor(@ArrayRes @ColorRes int quoteLineColorRes) {
this.mSelection.setBlockQuoteLineColor(quoteLineColorRes);
}
@Background
void loadData(int worksId, Range range) {
try {
Works works = this.mWorksManager.getWorks(worksId);
Book book = Book.get(worksId);
if (works.isGallery()) {
Position startPos = range.startPosition;
Paragraph paragraph = book.getParagraph(startPos);
if (paragraph instanceof IllusParagraph) {
if (StringUtils.isNotEmpty(ReaderUri.illus(worksId, book.getPackageId(startPos.packageIndex), ((IllusParagraph) paragraph).getIllusSeq(), ImageSize.NORMAL).toString())) {
setIllusUrl(ReaderUri.illus(worksId, book.getPackageId(startPos.packageIndex), ((IllusParagraph) paragraph).getIllusSeq(), ImageSize.NORMAL).toString());
return;
}
return;
} else if (paragraph != null) {
setSelection(paragraph.getPrintableText().toString());
return;
} else {
return;
}
}
setSelection(book.getText(range));
} catch (DataLoadException e) {
Logger.e(TAG, e);
}
}
@UiThread
void setSelection(CharSequence selection) {
this.mSelection.setVisibility(0);
this.mSelection.setBlockQuote(true);
this.mSelection.setParagraphText(selection);
}
@UiThread
void setIllusUrl(String url) {
this.mImageIllus.setVisibility(0);
ImageLoaderUtils.displayImage(url, this.mImageIllus);
}
}
| UTF-8 | Java | 3,772 | java | ShareSelectionInfoView.java | Java | [] | null | [] | package com.douban.book.reader.view;
import android.content.Context;
import android.support.annotation.ArrayRes;
import android.support.annotation.ColorRes;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.douban.book.reader.content.Book;
import com.douban.book.reader.content.Book.ImageSize;
import com.douban.book.reader.content.page.Position;
import com.douban.book.reader.content.page.Range;
import com.douban.book.reader.content.paragraph.IllusParagraph;
import com.douban.book.reader.content.paragraph.Paragraph;
import com.douban.book.reader.entity.Works;
import com.douban.book.reader.manager.WorksManager;
import com.douban.book.reader.manager.exception.DataLoadException;
import com.douban.book.reader.util.ImageLoaderUtils;
import com.douban.book.reader.util.Logger;
import com.douban.book.reader.util.ReaderUri;
import com.douban.book.reader.util.StringUtils;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;
@EViewGroup(2130903188)
public class ShareSelectionInfoView extends RelativeLayout {
private static final String TAG = ShareSelectionInfoView.class.getSimpleName();
@ViewById(2131558504)
ImageView mImageIllus;
@ViewById(2131558936)
ParagraphView mSelection;
@ViewById(2131558462)
TextView mTitle;
@Bean
WorksManager mWorksManager;
public ShareSelectionInfoView(Context context) {
super(context);
}
public ShareSelectionInfoView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ShareSelectionInfoView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public void setData(int worksId, Range range) {
loadData(worksId, range);
}
public void setQuoteLineColor(@ArrayRes @ColorRes int quoteLineColorRes) {
this.mSelection.setBlockQuoteLineColor(quoteLineColorRes);
}
@Background
void loadData(int worksId, Range range) {
try {
Works works = this.mWorksManager.getWorks(worksId);
Book book = Book.get(worksId);
if (works.isGallery()) {
Position startPos = range.startPosition;
Paragraph paragraph = book.getParagraph(startPos);
if (paragraph instanceof IllusParagraph) {
if (StringUtils.isNotEmpty(ReaderUri.illus(worksId, book.getPackageId(startPos.packageIndex), ((IllusParagraph) paragraph).getIllusSeq(), ImageSize.NORMAL).toString())) {
setIllusUrl(ReaderUri.illus(worksId, book.getPackageId(startPos.packageIndex), ((IllusParagraph) paragraph).getIllusSeq(), ImageSize.NORMAL).toString());
return;
}
return;
} else if (paragraph != null) {
setSelection(paragraph.getPrintableText().toString());
return;
} else {
return;
}
}
setSelection(book.getText(range));
} catch (DataLoadException e) {
Logger.e(TAG, e);
}
}
@UiThread
void setSelection(CharSequence selection) {
this.mSelection.setVisibility(0);
this.mSelection.setBlockQuote(true);
this.mSelection.setParagraphText(selection);
}
@UiThread
void setIllusUrl(String url) {
this.mImageIllus.setVisibility(0);
ImageLoaderUtils.displayImage(url, this.mImageIllus);
}
}
| 3,772 | 0.696713 | 0.685578 | 100 | 36.720001 | 30.298542 | 190 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.7 | false | false | 1 |
9218384f44ae1db3b55af4ef4df0eb835825a2e1 | 27,144,193,356,386 | fc124604ae539a7439dbaecf8f2cb9242819c58b | /src/main/java/com/iTracMedia/Dao/iTracMedia/MappingDao.java | 7942172c50c86fbf052c2c94ebc9c32e2e7ee89e | [] | no_license | smappshark/iTracMedia | https://github.com/smappshark/iTracMedia | a1419cd926258d562ef2dcea88a6f806cec6dd8f | 037dd94a22e08005081422a26d9baf184ece87be | refs/heads/master | 2020-03-27T05:37:30.644000 | 2014-10-15T04:47:10 | 2014-10-15T04:47:10 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.iTracMedia.Dao.iTracMedia;
import java.sql.Connection;
import java.util.List;
import java.util.ResourceBundle;
import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.lang3.StringUtils;
import com.iTracMedia.Bao.Beans.RequestBeans.ColumnsMapping;
import com.iTracMedia.Bao.Beans.RequestBeans.MappingColumnsRequest;
import com.iTracMedia.Bao.Beans.RequestBeans.MappingObjectsRequest;
import com.iTracMedia.Bao.BusinessObjects.utils.ReadProperties;
import com.iTracMedia.Dao.IMappingDao;
import com.iTracMedia.Dao.utils.DBConnectionUtil;
import com.iTracMedia.Dao.utils.Queries;
public class MappingDao implements IMappingDao
{
static ResourceBundle resource = ReadProperties.getBundle("config");
public String mapColumnsDao(MappingColumnsRequest mappingData) throws Exception
{
Connection conn = null;
DBConnectionUtil objDBConnectionUtil = new DBConnectionUtil();
String sObject = mappingData.getsObject(), tableName = mappingData.getTableName(), orgId = mappingData.getOrgId(), timestamp = mappingData.getTimestamp(), username = mappingData.getUserName();
List<ColumnsMapping> objFields = mappingData.getFields();
int fieldsCount = objFields.size();
if (fieldsCount > 0)
{
Object[][] objBatch = new Object[fieldsCount][7];
int counter = 0;
for (ColumnsMapping field: objFields)
{
objBatch[counter][0] = sObject;
objBatch[counter][1] = tableName;
objBatch[counter][2] = field.getSfField();
objBatch[counter][3] = field.getSelectedField();
objBatch[counter][4] = orgId;
objBatch[counter][5] = username;
objBatch[counter][6] = timestamp;
counter++;
}
QueryRunner query = new QueryRunner();
String strQuery = StringUtils.replace(Queries.inertIntoColumnMappings, "{iTracMediaDatabaseName}", resource.getString("DBNAME"));
try
{
conn = objDBConnectionUtil.getJNDIConnection(resource.getString("JDBCRourceName"));
query.batch(conn, strQuery, objBatch);
}
catch (Exception e)
{
throw e;
}
finally
{
DbUtils.closeQuietly(conn);
}
}
return "Successfully Done";
}
public String mapObjectsDao(MappingObjectsRequest mappingData) throws Exception
{
Connection conn = null;
DBConnectionUtil objDBConnectionUtil = new DBConnectionUtil();
int fieldsCount = mappingData.getFields().size();
if (fieldsCount > 0)
{
List<MappingColumnsRequest> objReq = mappingData.getFields();
Object[][] objBatch = new Object[fieldsCount][5];
int counter = 0;
for (MappingColumnsRequest field: objReq)
{
objBatch[counter][0] = field.getsObject();
objBatch[counter][1] = field.getTableName();
objBatch[counter][2] = mappingData.getOrgId();
objBatch[counter][3] = mappingData.getUserName();
objBatch[counter][4] = mappingData.getTimestamp();
counter++;
}
QueryRunner query = new QueryRunner();
String strQuery = StringUtils.replace(Queries.inertIntoObjectMappings, "{iTracMediaDatabaseName}", resource.getString("DBNAME"));
try
{
conn = objDBConnectionUtil.getJNDIConnection(resource.getString("JDBCRourceName"));
query.batch(conn, strQuery, objBatch);
}
catch (Exception e)
{
throw e;
}
finally
{
DbUtils.closeQuietly(conn);
}
}
return "Successfully Done";
}
} | UTF-8 | Java | 4,015 | java | MappingDao.java | Java | [] | null | [] | package com.iTracMedia.Dao.iTracMedia;
import java.sql.Connection;
import java.util.List;
import java.util.ResourceBundle;
import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.lang3.StringUtils;
import com.iTracMedia.Bao.Beans.RequestBeans.ColumnsMapping;
import com.iTracMedia.Bao.Beans.RequestBeans.MappingColumnsRequest;
import com.iTracMedia.Bao.Beans.RequestBeans.MappingObjectsRequest;
import com.iTracMedia.Bao.BusinessObjects.utils.ReadProperties;
import com.iTracMedia.Dao.IMappingDao;
import com.iTracMedia.Dao.utils.DBConnectionUtil;
import com.iTracMedia.Dao.utils.Queries;
public class MappingDao implements IMappingDao
{
static ResourceBundle resource = ReadProperties.getBundle("config");
public String mapColumnsDao(MappingColumnsRequest mappingData) throws Exception
{
Connection conn = null;
DBConnectionUtil objDBConnectionUtil = new DBConnectionUtil();
String sObject = mappingData.getsObject(), tableName = mappingData.getTableName(), orgId = mappingData.getOrgId(), timestamp = mappingData.getTimestamp(), username = mappingData.getUserName();
List<ColumnsMapping> objFields = mappingData.getFields();
int fieldsCount = objFields.size();
if (fieldsCount > 0)
{
Object[][] objBatch = new Object[fieldsCount][7];
int counter = 0;
for (ColumnsMapping field: objFields)
{
objBatch[counter][0] = sObject;
objBatch[counter][1] = tableName;
objBatch[counter][2] = field.getSfField();
objBatch[counter][3] = field.getSelectedField();
objBatch[counter][4] = orgId;
objBatch[counter][5] = username;
objBatch[counter][6] = timestamp;
counter++;
}
QueryRunner query = new QueryRunner();
String strQuery = StringUtils.replace(Queries.inertIntoColumnMappings, "{iTracMediaDatabaseName}", resource.getString("DBNAME"));
try
{
conn = objDBConnectionUtil.getJNDIConnection(resource.getString("JDBCRourceName"));
query.batch(conn, strQuery, objBatch);
}
catch (Exception e)
{
throw e;
}
finally
{
DbUtils.closeQuietly(conn);
}
}
return "Successfully Done";
}
public String mapObjectsDao(MappingObjectsRequest mappingData) throws Exception
{
Connection conn = null;
DBConnectionUtil objDBConnectionUtil = new DBConnectionUtil();
int fieldsCount = mappingData.getFields().size();
if (fieldsCount > 0)
{
List<MappingColumnsRequest> objReq = mappingData.getFields();
Object[][] objBatch = new Object[fieldsCount][5];
int counter = 0;
for (MappingColumnsRequest field: objReq)
{
objBatch[counter][0] = field.getsObject();
objBatch[counter][1] = field.getTableName();
objBatch[counter][2] = mappingData.getOrgId();
objBatch[counter][3] = mappingData.getUserName();
objBatch[counter][4] = mappingData.getTimestamp();
counter++;
}
QueryRunner query = new QueryRunner();
String strQuery = StringUtils.replace(Queries.inertIntoObjectMappings, "{iTracMediaDatabaseName}", resource.getString("DBNAME"));
try
{
conn = objDBConnectionUtil.getJNDIConnection(resource.getString("JDBCRourceName"));
query.batch(conn, strQuery, objBatch);
}
catch (Exception e)
{
throw e;
}
finally
{
DbUtils.closeQuietly(conn);
}
}
return "Successfully Done";
}
} | 4,015 | 0.609465 | 0.604732 | 104 | 37.615383 | 32.670059 | 200 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.663462 | false | false | 1 |
b9c585f9162b6dc4ad28a0ba35156ee544b1e463 | 27,144,193,357,098 | 4cf4ea94fb20e342aa1564a6f9aed32b1ef6032a | /flyuilib/src/main/java/com/flyzebra/flyui/view/customview/CircleImageView.java | d39681f359cd5ee700ac955d5bdcff8afdbc1a02 | [] | no_license | TTFlyzebra/Launcher2.0 | https://github.com/TTFlyzebra/Launcher2.0 | 2a6684c8be60c10928a7ba6f7f447f8d84a5ec28 | cdc1817ca55347d6253323f2d58cd1803eb902dd | refs/heads/master | 2020-03-26T06:11:17.995000 | 2019-08-06T02:50:07 | 2019-08-06T02:50:07 | 144,593,661 | 5 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.flyzebra.flyui.view.customview;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
/**
* Created by FlyZebra on 2016/3/25.
*/
public class CircleImageView extends ImageView {
private int width;
private int height;
private int borderWidth = 2;
private int borderColor = 0x1FFFFFFF;
private Paint borderPaint;
private Paint bitmapPaint;
private Bitmap mBitmap;
private BitmapShader mBitmapShader;
private ObjectAnimator rotationAnimator;
private boolean animatePlaying = false;
public CircleImageView(Context context) {
this(context, null);
}
public CircleImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
borderPaint = new Paint();
borderPaint.setAntiAlias(true);
borderPaint.setStyle(Paint.Style.STROKE);
borderPaint.setStrokeWidth(borderWidth);
borderPaint.setColor(borderColor);
bitmapPaint = new Paint();
bitmapPaint.setAntiAlias(true);
rotationAnimator = ObjectAnimator.ofFloat(this, "rotation", 0, 360);
rotationAnimator.setDuration(10000);
rotationAnimator.setInterpolator(new LinearInterpolator());
rotationAnimator.setRepeatCount(ObjectAnimator.INFINITE);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
width = MeasureSpec.getSize(widthMeasureSpec);
height = MeasureSpec.getSize(heightMeasureSpec);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
mBitmap = bm;
}
@Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
mBitmap = getBitmapFromDrawable(drawable);
}
@Override
public void setImageResource(int resId) {
super.setImageResource(resId);
mBitmap = getBitmapFromDrawable(getDrawable());
}
private Bitmap getBitmapFromDrawable(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
try {
Bitmap bitmap;
if (drawable instanceof ColorDrawable) {
bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
} else {
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
}
return bitmap;
} catch (OutOfMemoryError e) {
return null;
}
}
@Override
protected void onDraw(Canvas canvas) {
if (mBitmap == null) {
return;
}
// cropBitmap();
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
mBitmapShader.setLocalMatrix(getMatrix(width, height, mBitmap.getWidth(), mBitmap.getHeight()));
bitmapPaint.setShader(mBitmapShader);
int circleRid = Math.min(width, height) / 2;
canvas.drawCircle(width / 2, height / 2, circleRid - borderWidth, bitmapPaint);
canvas.drawCircle(width / 2, height / 2, circleRid - borderWidth / 2, borderPaint);
}
private void cropBitmap() {
width = mBitmap.getWidth();
height = mBitmap.getHeight();
int x = width < height ? 0 : (width - height) / 2;
int y = width < height ? (height - width) / 2 : 0;
int size = Math.min(width, height);
Bitmap oldBitmap = mBitmap;
mBitmap = Bitmap.createBitmap(mBitmap, x, y, size, size);
oldBitmap.recycle();
}
private Matrix getMatrix(int width, int height, int b_width, int b_height) {
float scale;
float dx = 0;
float dy = 0;
Matrix matrix = new Matrix();
int scalefactor;
if (width > height) {
scalefactor = height;
dx = (width - height) / 2;
} else {
scalefactor = width;
dy = (height - width) / 2;
}
if (b_width > b_height) {
scale = (float) scalefactor / (float) b_width;
dx = dx + (scalefactor - b_height * scale) / 2;
} else {
scale = (float) scalefactor / (float) b_height;
dy = dy + (scalefactor - b_width * scale) / 2;
}
matrix.setScale(scale, scale);
matrix.postTranslate(dx, dy);
return matrix;
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (animatePlaying) {
rotationAnimator.resume();
} else {
rotationAnimator.pause();
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
rotationAnimator.end();
}
public void setAnimatePlaying(boolean animatePlaying) {
this.animatePlaying = animatePlaying;
if (animatePlaying) {
rotationAnimator.resume();
} else {
rotationAnimator.pause();
}
}
}
| UTF-8 | Java | 5,771 | java | CircleImageView.java | Java | [
{
"context": "port android.widget.ImageView;\n\n\n/**\n * Created by FlyZebra on 2016/3/25.\n */\npublic class CircleImageView ex",
"end": 601,
"score": 0.9996383786201477,
"start": 593,
"tag": "USERNAME",
"value": "FlyZebra"
}
] | null | [] | package com.flyzebra.flyui.view.customview;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
/**
* Created by FlyZebra on 2016/3/25.
*/
public class CircleImageView extends ImageView {
private int width;
private int height;
private int borderWidth = 2;
private int borderColor = 0x1FFFFFFF;
private Paint borderPaint;
private Paint bitmapPaint;
private Bitmap mBitmap;
private BitmapShader mBitmapShader;
private ObjectAnimator rotationAnimator;
private boolean animatePlaying = false;
public CircleImageView(Context context) {
this(context, null);
}
public CircleImageView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
borderPaint = new Paint();
borderPaint.setAntiAlias(true);
borderPaint.setStyle(Paint.Style.STROKE);
borderPaint.setStrokeWidth(borderWidth);
borderPaint.setColor(borderColor);
bitmapPaint = new Paint();
bitmapPaint.setAntiAlias(true);
rotationAnimator = ObjectAnimator.ofFloat(this, "rotation", 0, 360);
rotationAnimator.setDuration(10000);
rotationAnimator.setInterpolator(new LinearInterpolator());
rotationAnimator.setRepeatCount(ObjectAnimator.INFINITE);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
width = MeasureSpec.getSize(widthMeasureSpec);
height = MeasureSpec.getSize(heightMeasureSpec);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
mBitmap = bm;
}
@Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
mBitmap = getBitmapFromDrawable(drawable);
}
@Override
public void setImageResource(int resId) {
super.setImageResource(resId);
mBitmap = getBitmapFromDrawable(getDrawable());
}
private Bitmap getBitmapFromDrawable(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
try {
Bitmap bitmap;
if (drawable instanceof ColorDrawable) {
bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
} else {
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
}
return bitmap;
} catch (OutOfMemoryError e) {
return null;
}
}
@Override
protected void onDraw(Canvas canvas) {
if (mBitmap == null) {
return;
}
// cropBitmap();
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
mBitmapShader.setLocalMatrix(getMatrix(width, height, mBitmap.getWidth(), mBitmap.getHeight()));
bitmapPaint.setShader(mBitmapShader);
int circleRid = Math.min(width, height) / 2;
canvas.drawCircle(width / 2, height / 2, circleRid - borderWidth, bitmapPaint);
canvas.drawCircle(width / 2, height / 2, circleRid - borderWidth / 2, borderPaint);
}
private void cropBitmap() {
width = mBitmap.getWidth();
height = mBitmap.getHeight();
int x = width < height ? 0 : (width - height) / 2;
int y = width < height ? (height - width) / 2 : 0;
int size = Math.min(width, height);
Bitmap oldBitmap = mBitmap;
mBitmap = Bitmap.createBitmap(mBitmap, x, y, size, size);
oldBitmap.recycle();
}
private Matrix getMatrix(int width, int height, int b_width, int b_height) {
float scale;
float dx = 0;
float dy = 0;
Matrix matrix = new Matrix();
int scalefactor;
if (width > height) {
scalefactor = height;
dx = (width - height) / 2;
} else {
scalefactor = width;
dy = (height - width) / 2;
}
if (b_width > b_height) {
scale = (float) scalefactor / (float) b_width;
dx = dx + (scalefactor - b_height * scale) / 2;
} else {
scale = (float) scalefactor / (float) b_height;
dy = dy + (scalefactor - b_width * scale) / 2;
}
matrix.setScale(scale, scale);
matrix.postTranslate(dx, dy);
return matrix;
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (animatePlaying) {
rotationAnimator.resume();
} else {
rotationAnimator.pause();
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
rotationAnimator.end();
}
public void setAnimatePlaying(boolean animatePlaying) {
this.animatePlaying = animatePlaying;
if (animatePlaying) {
rotationAnimator.resume();
} else {
rotationAnimator.pause();
}
}
}
| 5,771 | 0.632993 | 0.625022 | 179 | 31.240223 | 23.547726 | 131 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.748603 | false | false | 1 |
48b65a3701d2642f8bcdda597bf7ae410405de30 | 20,220,706,078,056 | 3b882b8494818677d2426d0bcc7279011e875a66 | /src/main/java/com/linchproject/servlet/services/ServletLocaleService.java | 3fdeed56b9a56500a6722eb4b216b4e92368b5d9 | [
"Apache-2.0"
] | permissive | linchproject/linch-servlet | https://github.com/linchproject/linch-servlet | 9f8523f5030c6b4f9a9a0dbc202309a66e92810e | ed2d2ba7912f3b47cb32897ab60c1a74f4c7e637 | refs/heads/master | 2016-09-08T02:36:48.335000 | 2014-07-27T19:55:00 | 2014-07-27T19:55:00 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.linchproject.servlet.services;
import com.linchproject.http.LocaleService;
import com.linchproject.servlet.ServletThreadLocal;
import java.util.Locale;
/**
* @author Georg Schmidl
*/
public class ServletLocaleService implements LocaleService {
@Override
public Locale getLocale() {
return ServletThreadLocal.getRequest().getLocale();
}
}
| UTF-8 | Java | 376 | java | ServletLocaleService.java | Java | [
{
"context": "adLocal;\n\nimport java.util.Locale;\n\n/**\n * @author Georg Schmidl\n */\npublic class ServletLocaleService implements ",
"end": 195,
"score": 0.9997158050537109,
"start": 182,
"tag": "NAME",
"value": "Georg Schmidl"
}
] | null | [] | package com.linchproject.servlet.services;
import com.linchproject.http.LocaleService;
import com.linchproject.servlet.ServletThreadLocal;
import java.util.Locale;
/**
* @author <NAME>
*/
public class ServletLocaleService implements LocaleService {
@Override
public Locale getLocale() {
return ServletThreadLocal.getRequest().getLocale();
}
}
| 369 | 0.757979 | 0.757979 | 17 | 21.117647 | 21.746893 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.294118 | false | false | 1 |
5831ef83a56d354b52efcec59830cec3e48df027 | 25,340,307,104,775 | 391b6ca9aac124b3e5d5fe6aa6d3f6012fc83aff | /passwordBoss/src/main/java/com/passwordboss/android/database/bll/FeatureGroupBll.java | 44b457a44c77a0b2ff8556a9209264aa63deb10f | [] | no_license | borisrockstar/PasswordBoss | https://github.com/borisrockstar/PasswordBoss | e051c6e9b968546fb5b86fb838b6f5e0711b4236 | 0156856e4fcde5fc3d8db612929b451b94892ce4 | refs/heads/master | 2021-01-21T17:56:57.706000 | 2017-05-22T02:03:40 | 2017-05-22T02:03:40 | 92,001,702 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.passwordboss.android.database.bll;
import com.passwordboss.android.database.DatabaseHelperSecure;
import com.passwordboss.android.database.beans.FeatureGroup;
import java.sql.SQLException;
public class FeatureGroupBll extends BaseBll<FeatureGroup, String> {
public FeatureGroupBll(DatabaseHelperSecure helperSecure) throws SQLException {
super(helperSecure.getFeatureGroupDao());
}
public void deleteAll() {
try {
mDao.executeRawNoArgs("delete from feature_group");
} catch (Exception e) {
////Log.print(e);
}
}
} | UTF-8 | Java | 602 | java | FeatureGroupBll.java | Java | [] | null | [] | package com.passwordboss.android.database.bll;
import com.passwordboss.android.database.DatabaseHelperSecure;
import com.passwordboss.android.database.beans.FeatureGroup;
import java.sql.SQLException;
public class FeatureGroupBll extends BaseBll<FeatureGroup, String> {
public FeatureGroupBll(DatabaseHelperSecure helperSecure) throws SQLException {
super(helperSecure.getFeatureGroupDao());
}
public void deleteAll() {
try {
mDao.executeRawNoArgs("delete from feature_group");
} catch (Exception e) {
////Log.print(e);
}
}
} | 602 | 0.707641 | 0.707641 | 21 | 27.714285 | 26.813541 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.380952 | false | false | 1 |
ad2862a67184d50601f4c48faefd2d36343850da | 16,844,861,785,094 | 37d524544a3d8b1ead293d759d15a11b4a3151ef | /src/com/vektorel/Runner.java | 14be4ef4810328a5fb7d46ed9255830ecd796b03 | [] | no_license | vektoreljavaali/Java60_008 | https://github.com/vektoreljavaali/Java60_008 | c8917ec235a835eba614f9474f8369c225489870 | c0b583cce11f75d3d813b62db35c4b124106d13a | refs/heads/master | 2023-06-22T15:34:40.245000 | 2021-07-18T15:06:19 | 2021-07-18T15:06:19 | 387,200,031 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.vektorel;
public class Runner {
public static void main(String[] args) {
// Diziler , Arrays
// Sayı Dizisi
// {12,2,344434,323,3}
// Array Syntax
int[] sayi_dizisi = new int[15];
char[] karakter_dizisi = new char[5];
float[] kesirli_diziler = new float[4];
boolean[] anahtar_dizisi = new boolean[5];
String[] ifadeler_dizisi = new String[4];
Runner[] runner_dizisi = new Runner[54];
// bu şekilde yapılan atamalarda
// uzunluk ve içerik bilgisi direkt yazılır.
int[] sa_dizi = {32,3,320,0,123,0};
// dizilerin değerlerini okumak
// 1. köşeli parantes ile değişken işaretlenir.
// okunmak istenilen dizi index değeri yazılır
// NOT: Önemli!!, diziler index değeri olarak
// daima 0(sıfır) dan başlar.
System.out.println(sa_dizi[4]);
// bir diziye değer atamak
int sayi = 3;
System.out.println(sayi);
System.out.println(sayi_dizisi[4]);
sayi_dizisi[4]=45;
for(int i=0;i<sayi_dizisi.length;i++) {
System.out.println(sayi_dizisi[i]);
}
// Object-> tüm sınıfların üst sınıfıdır.
// obje dizisi tüm değişken türlerini
// içinde barındırabilir.
Object[] obje_dizisi = new Object[5];
obje_dizisi[0]= 2;
obje_dizisi[1]= true;
obje_dizisi[2]= '4';
obje_dizisi[3]= "selam napan :)";
obje_dizisi[4]= 43234.43433D;
obje_dizisi[5]= new Runner();
}//Main Sonu
}//Class Sonu
| ISO-8859-9 | Java | 1,473 | java | Runner.java | Java | [] | null | [] | package com.vektorel;
public class Runner {
public static void main(String[] args) {
// Diziler , Arrays
// Sayı Dizisi
// {12,2,344434,323,3}
// Array Syntax
int[] sayi_dizisi = new int[15];
char[] karakter_dizisi = new char[5];
float[] kesirli_diziler = new float[4];
boolean[] anahtar_dizisi = new boolean[5];
String[] ifadeler_dizisi = new String[4];
Runner[] runner_dizisi = new Runner[54];
// bu şekilde yapılan atamalarda
// uzunluk ve içerik bilgisi direkt yazılır.
int[] sa_dizi = {32,3,320,0,123,0};
// dizilerin değerlerini okumak
// 1. köşeli parantes ile değişken işaretlenir.
// okunmak istenilen dizi index değeri yazılır
// NOT: Önemli!!, diziler index değeri olarak
// daima 0(sıfır) dan başlar.
System.out.println(sa_dizi[4]);
// bir diziye değer atamak
int sayi = 3;
System.out.println(sayi);
System.out.println(sayi_dizisi[4]);
sayi_dizisi[4]=45;
for(int i=0;i<sayi_dizisi.length;i++) {
System.out.println(sayi_dizisi[i]);
}
// Object-> tüm sınıfların üst sınıfıdır.
// obje dizisi tüm değişken türlerini
// içinde barındırabilir.
Object[] obje_dizisi = new Object[5];
obje_dizisi[0]= 2;
obje_dizisi[1]= true;
obje_dizisi[2]= '4';
obje_dizisi[3]= "selam napan :)";
obje_dizisi[4]= 43234.43433D;
obje_dizisi[5]= new Runner();
}//Main Sonu
}//Class Sonu
| 1,473 | 0.628134 | 0.586351 | 48 | 27.916666 | 14.319034 | 49 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.520833 | false | false | 1 |
7bc682a56e9afb90918f6c4cc9716f05995ae3dc | 16,844,861,784,168 | e10d4ab56012c62e8348c65cc4b6fe31d393e68d | /core/src/main/java/P3D/Starfish.java | 0d151d6a7f6281e0b1c9a761aea346b8cb233f4a | [] | no_license | lemax97/3dsmpl | https://github.com/lemax97/3dsmpl | 83d62ab2021f2fbb06f668dc9b2e1a90996c96e5 | e6b3ce150cc9e5024ad3cfa3b2500ffd62e7c897 | refs/heads/master | 2023-01-03T11:41:51.678000 | 2020-10-29T07:54:27 | 2020-10-29T07:54:27 | 308,026,229 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package P3D;
public class Starfish extends ObjModel {
public Starfish(float x, float y, float z, Stage3D s) {
super(x, y, z, s);
loadObjModel("assets/star.obj");
setScale(3, 1, 3);
setBasePolygon();
}
public void act(float dt){
super.act(dt);
turn( 90 * dt );
}
}
| UTF-8 | Java | 333 | java | Starfish.java | Java | [] | null | [] | package P3D;
public class Starfish extends ObjModel {
public Starfish(float x, float y, float z, Stage3D s) {
super(x, y, z, s);
loadObjModel("assets/star.obj");
setScale(3, 1, 3);
setBasePolygon();
}
public void act(float dt){
super.act(dt);
turn( 90 * dt );
}
}
| 333 | 0.543544 | 0.522523 | 18 | 17.5 | 17.160192 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.833333 | false | false | 1 |
31293b7bda21aae5068e50926da5f325a95069cf | 30,099,130,853,859 | 840f41d4a024acca97e250b44e0036e14f401874 | /aufgabe2/raytracer/Raytracer.java | 5a54652f5ed6f8c2c039f58078106242deb45661 | [] | no_license | MarkDeuerling/CG1 | https://github.com/MarkDeuerling/CG1 | eec5fdb9b038350f48b3a0ac8a9ae9a27f6952c5 | fd159130cd44432390b5069f0ab756e596b89060 | refs/heads/master | 2021-09-05T19:13:29.564000 | 2018-01-30T13:04:19 | 2018-01-30T13:04:19 | 119,535,280 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package aufgabe2.raytracer;
import MathLib.Normal3;
import MathLib.Point3;
import MathLib.Vector3;
import aufgabe2.camera.Camera;
import aufgabe2.camera.OrthographicCamera;
import aufgabe2.camera.PerspectiveCamera;
import aufgabe2.color.Color;
import aufgabe2.geometry.AxisAlignedBox;
import aufgabe2.geometry.Disk;
import aufgabe2.geometry.Plane;
import aufgabe2.geometry.Sphere;
import aufgabe2.geometry.Triangle;
import aufgabe2.world.World;
import java.awt.Container;
import javax.swing.JFrame;
/**
* This class has the main-methode to render the geometry on screen.
*
* @author Peter Albrecht, Stefan Streichan, Mark Deuerling
*/
public class Raytracer{
public static void main(String[] args){
renderPlane();
renderSphere();
renderTwoSphere();
renderTwoSphereOrthographic();
renderTriangle();
renderAABox();
renderDisk();
}
/**
* Render a single Plane with perspective camera.
*/
public static void renderPlane(){
Camera persCam = new PerspectiveCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1.0), new Vector3(0, 1.0, 0), Math.PI / 8.0);
Plane plane = new Plane(new Normal3(0, 1, 0), new Point3(0, -1, 0), new Color(0, 1, 0));
World world = new World(new aufgabe2.color.Color(0, 0, 0));
world.addGeo(plane);
renderWindow(world, persCam);
}
/**
* Render a single sphere with perspective camera.
*/
public static void renderSphere(){
Camera persCam = new PerspectiveCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1.0), new Vector3(0, 1.0, 0), Math.PI / 8.0);
Sphere sphere = new Sphere(new Point3(0, 0, -3.0), 0.5, new Color(1.0, 0, 0));
World world = new World(new aufgabe2.color.Color(0, 0, 0));
world.addGeo(sphere);
renderWindow(world, persCam);
}
/**
* Render two sphere with a perspective camera.
*/
public static void renderTwoSphere(){
Camera persCam = new PerspectiveCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1), new Vector3(0, 1, 0), Math.PI / 8.0);
Sphere sphereNear = new Sphere(new Point3(-1, 0, -3), 0.5, new Color(1, 0, 0));
Sphere sphereFar = new Sphere(new Point3(1, 0, -6), 0.5, new Color(1, 0, 0));
World world = new World(new Color(0, 0, 0));
world.addGeo(sphereNear);
world.addGeo(sphereFar);
renderWindow(world, persCam);
}
/**
* Render two sphere with a orthographic camera.
*/
public static void renderTwoSphereOrthographic(){
Camera camOrtho = new OrthographicCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1), new Vector3(0, 1, 0), 3);
Sphere sphereNear = new Sphere(new Point3(-1, 0, -3), 0.5, new Color(1, 0, 0));
Sphere sphereFar = new Sphere(new Point3(1, 0, -6), 0.5, new Color(1, 0, 0));
World world = new World(new Color(0, 0, 0));
world.addGeo(sphereNear);
world.addGeo(sphereFar);
renderWindow(world, camOrtho);
}
/**
* Render a triangle with a perspectiv camera.
*/
public static void renderTriangle(){
Camera persCam = new PerspectiveCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1.0), new Vector3(0, 1.0, 0), Math.PI / 8);
Triangle triangle = new Triangle(new Point3(-0.5, 0.5, -3.0), new Point3(0.5, 0.5, -3.0), new Point3(0.5, -0.5, -3.0), new Color(1.0, 0, 1.0));
World world = new World(new Color(0, 0, 0));
world.addGeo(triangle);
renderWindow(world, persCam);
}
/**
* Render a Axis-Aligne-Box with a perspective camera.
*/
public static void renderAABox(){
Camera persCam = new PerspectiveCamera(new Point3(3, 3, 3), new Vector3(-3, -3, -3.0), new Vector3(0, 1.0, 0), Math.PI / 8);
AxisAlignedBox aaBox = new AxisAlignedBox(new Point3(-0.5, 0, -0.5), new Point3(0.5, 1, 0.5), new Color(0, 0, 1));
World world = new World(new Color(0, 0, 0));
world.addGeo(aaBox);
renderWindow(world, persCam);
}
/**
* Render a disk with a perspective camera.
*/
public static void renderDisk(){
Camera persCam = new PerspectiveCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1.0), new Vector3(0, 1.0, 0), Math.PI / 8.0);
Disk disk = new Disk(new Point3(0, -.5, -3), new Normal3(0, 1, 0), .5, new Color(1, 1, 0));
World world = new World(new Color(0, 0, 0));
world.addGeo(disk);
renderWindow(world, persCam);
}
/**
* The frame to be rendered.
* @param world the world where the geometry are to be rendered.
* @param cam the cam to handle the perspective.
*/
public static void renderWindow(World world, Camera cam){
JFrame frame = new JFrame();
Container con = frame.getContentPane();
con.add(new RenderImageCanvas(world, cam, frame));
frame.setSize(640, 480);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
| UTF-8 | Java | 5,153 | java | Raytracer.java | Java | [
{
"context": "e to render the geometry on screen.\n * \n * @author Peter Albrecht, Stefan Streichan, Mark Deuerling\n */\npublic clas",
"end": 603,
"score": 0.9998666048049927,
"start": 589,
"tag": "NAME",
"value": "Peter Albrecht"
},
{
"context": "geometry on screen.\n * \n * @autho... | null | [] | package aufgabe2.raytracer;
import MathLib.Normal3;
import MathLib.Point3;
import MathLib.Vector3;
import aufgabe2.camera.Camera;
import aufgabe2.camera.OrthographicCamera;
import aufgabe2.camera.PerspectiveCamera;
import aufgabe2.color.Color;
import aufgabe2.geometry.AxisAlignedBox;
import aufgabe2.geometry.Disk;
import aufgabe2.geometry.Plane;
import aufgabe2.geometry.Sphere;
import aufgabe2.geometry.Triangle;
import aufgabe2.world.World;
import java.awt.Container;
import javax.swing.JFrame;
/**
* This class has the main-methode to render the geometry on screen.
*
* @author <NAME>, <NAME>, <NAME>
*/
public class Raytracer{
public static void main(String[] args){
renderPlane();
renderSphere();
renderTwoSphere();
renderTwoSphereOrthographic();
renderTriangle();
renderAABox();
renderDisk();
}
/**
* Render a single Plane with perspective camera.
*/
public static void renderPlane(){
Camera persCam = new PerspectiveCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1.0), new Vector3(0, 1.0, 0), Math.PI / 8.0);
Plane plane = new Plane(new Normal3(0, 1, 0), new Point3(0, -1, 0), new Color(0, 1, 0));
World world = new World(new aufgabe2.color.Color(0, 0, 0));
world.addGeo(plane);
renderWindow(world, persCam);
}
/**
* Render a single sphere with perspective camera.
*/
public static void renderSphere(){
Camera persCam = new PerspectiveCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1.0), new Vector3(0, 1.0, 0), Math.PI / 8.0);
Sphere sphere = new Sphere(new Point3(0, 0, -3.0), 0.5, new Color(1.0, 0, 0));
World world = new World(new aufgabe2.color.Color(0, 0, 0));
world.addGeo(sphere);
renderWindow(world, persCam);
}
/**
* Render two sphere with a perspective camera.
*/
public static void renderTwoSphere(){
Camera persCam = new PerspectiveCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1), new Vector3(0, 1, 0), Math.PI / 8.0);
Sphere sphereNear = new Sphere(new Point3(-1, 0, -3), 0.5, new Color(1, 0, 0));
Sphere sphereFar = new Sphere(new Point3(1, 0, -6), 0.5, new Color(1, 0, 0));
World world = new World(new Color(0, 0, 0));
world.addGeo(sphereNear);
world.addGeo(sphereFar);
renderWindow(world, persCam);
}
/**
* Render two sphere with a orthographic camera.
*/
public static void renderTwoSphereOrthographic(){
Camera camOrtho = new OrthographicCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1), new Vector3(0, 1, 0), 3);
Sphere sphereNear = new Sphere(new Point3(-1, 0, -3), 0.5, new Color(1, 0, 0));
Sphere sphereFar = new Sphere(new Point3(1, 0, -6), 0.5, new Color(1, 0, 0));
World world = new World(new Color(0, 0, 0));
world.addGeo(sphereNear);
world.addGeo(sphereFar);
renderWindow(world, camOrtho);
}
/**
* Render a triangle with a perspectiv camera.
*/
public static void renderTriangle(){
Camera persCam = new PerspectiveCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1.0), new Vector3(0, 1.0, 0), Math.PI / 8);
Triangle triangle = new Triangle(new Point3(-0.5, 0.5, -3.0), new Point3(0.5, 0.5, -3.0), new Point3(0.5, -0.5, -3.0), new Color(1.0, 0, 1.0));
World world = new World(new Color(0, 0, 0));
world.addGeo(triangle);
renderWindow(world, persCam);
}
/**
* Render a Axis-Aligne-Box with a perspective camera.
*/
public static void renderAABox(){
Camera persCam = new PerspectiveCamera(new Point3(3, 3, 3), new Vector3(-3, -3, -3.0), new Vector3(0, 1.0, 0), Math.PI / 8);
AxisAlignedBox aaBox = new AxisAlignedBox(new Point3(-0.5, 0, -0.5), new Point3(0.5, 1, 0.5), new Color(0, 0, 1));
World world = new World(new Color(0, 0, 0));
world.addGeo(aaBox);
renderWindow(world, persCam);
}
/**
* Render a disk with a perspective camera.
*/
public static void renderDisk(){
Camera persCam = new PerspectiveCamera(new Point3(0, 0, 0), new Vector3(0, 0, -1.0), new Vector3(0, 1.0, 0), Math.PI / 8.0);
Disk disk = new Disk(new Point3(0, -.5, -3), new Normal3(0, 1, 0), .5, new Color(1, 1, 0));
World world = new World(new Color(0, 0, 0));
world.addGeo(disk);
renderWindow(world, persCam);
}
/**
* The frame to be rendered.
* @param world the world where the geometry are to be rendered.
* @param cam the cam to handle the perspective.
*/
public static void renderWindow(World world, Camera cam){
JFrame frame = new JFrame();
Container con = frame.getContentPane();
con.add(new RenderImageCanvas(world, cam, frame));
frame.setSize(640, 480);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
| 5,127 | 0.602756 | 0.552494 | 132 | 38.03788 | 36.552456 | 179 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.69697 | false | false | 1 |
e6443e18985d313a84facddfff1ae097053d23cb | 32,057,635,953,406 | ed7b851383dba47794a8ee885bee677cda1bf6f5 | /src/main/java/Execute.java | 89ea17ce08cbcf8d747af11420e49783068768ad | [] | no_license | deems111/xmlAdapter | https://github.com/deems111/xmlAdapter | b19b38c5fc98c0ad35e7fc31178d364f5a43b058 | 8fd70beddbec4e1d699d1df50b3fe2e0b6667556 | refs/heads/master | 2022-10-14T07:24:03.369000 | 2019-11-26T18:22:24 | 2019-11-26T18:22:24 | 222,751,983 | 1 | 0 | null | false | 2022-02-16T01:03:52 | 2019-11-19T17:28:54 | 2020-12-12T13:29:47 | 2022-02-16T01:03:52 | 41 | 1 | 0 | 4 | Java | false | false | import bean.Driver;
public class Execute {
public static void main(String[] args) {
new Driver().start("C:\\input.xml", "C:\\output.xml");
}
}
| UTF-8 | Java | 162 | java | Execute.java | Java | [] | null | [] | import bean.Driver;
public class Execute {
public static void main(String[] args) {
new Driver().start("C:\\input.xml", "C:\\output.xml");
}
}
| 162 | 0.598765 | 0.598765 | 9 | 17 | 21.213203 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 1 |
b70d8b293f7f9fe049959d748955bfa53f9a59de | 944,892,860,691 | c2f9d69a16986a2690e72718783472fc624ded18 | /com/whatsapp/dm.java | 65eb325411e72167bf69d84f418c87b5ec47352e | [] | no_license | mithileshongit/WhatsApp-Descompilado | https://github.com/mithileshongit/WhatsApp-Descompilado | bc973e1356eb043661a2efc30db22bcc1392d7f3 | 94a9d0b1c46bb78676ac401572aa11f60e12345e | refs/heads/master | 2021-01-16T20:56:27.864000 | 2015-02-09T04:08:40 | 2015-02-09T04:08:40 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.whatsapp;
import android.util.Pair;
import com.whatsapp.notification.t;
import com.whatsapp.protocol.b;
import com.whatsapp.protocol.c;
import com.whatsapp.protocol.c5;
import com.whatsapp.protocol.m;
import com.whatsapp.util.Log;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.spongycastle.jcajce.provider.symmetric.util.PBE;
import org.whispersystems.libaxolotl.aV;
import org.whispersystems.libaxolotl.aj;
import org.whispersystems.libaxolotl.ay;
class dm implements Runnable {
private static final String[] z;
final int a;
final String b;
final String c;
final c5 d;
final ale e;
static {
String[] strArr = new String[8];
String str = "#\u0018{avwA";
Object obj = -1;
String[] strArr2 = strArr;
String[] strArr3 = strArr;
int i = 0;
while (true) {
char[] toCharArray = str.toCharArray();
int length = toCharArray.length;
char[] cArr = toCharArray;
for (int i2 = 0; length > i2; i2++) {
int i3;
char c = cArr[i2];
switch (i2 % 5) {
case PBE.MD5 /*0*/:
i3 = 3;
break;
case ay.f /*1*/:
i3 = 123;
break;
case ay.n /*2*/:
i3 = 20;
break;
case ay.p /*3*/:
i3 = 20;
break;
default:
i3 = 24;
break;
}
cArr[i2] = (char) (i3 ^ c);
}
str = new String(cArr).intern();
switch (obj) {
case PBE.MD5 /*0*/:
strArr2[i] = str;
str = "r\tKemf\tm;jf\bay},\u0018xqyqT";
i = 2;
strArr2 = strArr3;
obj = 1;
break;
case ay.f /*1*/:
strArr2[i] = str;
str = "t\u001ev";
i = 3;
strArr2 = strArr3;
obj = 2;
break;
case ay.n /*2*/:
strArr2[i] = str;
str = "r\tKemf\tm;jf\bay},\u0018{znf\tgulj\u0014zg7";
i = 4;
strArr2 = strArr3;
obj = 3;
break;
case ay.p /*3*/:
strArr2[i] = str;
i = 5;
strArr2 = strArr3;
str = "r\tKemf\tm;jf\bay},\u001a|qygT";
obj = 4;
break;
case aj.i /*4*/:
strArr2[i] = str;
i = 6;
str = "r\tKemf\tm;jf\bay},\u001fqx}w\u001e;";
obj = 5;
strArr2 = strArr3;
break;
case aV.r /*5*/:
strArr2[i] = str;
i = 7;
str = "#\u0018{avwA";
obj = 6;
strArr2 = strArr3;
break;
case aV.i /*6*/:
strArr2[i] = str;
z = strArr3;
default:
strArr2[i] = str;
str = "r\tKemf\tm;jf\bay},\u0018xqyqTy{|w\u001as;";
i = 1;
strArr2 = strArr3;
obj = null;
break;
}
}
}
dm(ale com_whatsapp_ale, c5 c5Var, String str, int i, String str2) {
this.e = com_whatsapp_ale;
this.d = c5Var;
this.c = str;
this.a = i;
this.b = str2;
}
public void run() {
int i = App.az;
List arrayList = new ArrayList();
List<Pair> arrayList2 = new ArrayList();
HashSet hashSet = new HashSet(v.b());
Iterator it = this.d.j.iterator();
while (it.hasNext()) {
c5 c5Var;
boolean z;
c cVar = (c) it.next();
m mVar = cVar.h;
boolean z2 = cVar.f;
String str = cVar.b;
long j = cVar.g;
int i2 = cVar.a;
boolean z3 = cVar.e;
if (hashSet.contains(str)) {
b B = App.aJ.B(str);
c5 a;
b b;
if (App.aJ.y(str) != cVar.c) {
a = ale.a(str, 1);
b = App.aJ.b(str, ale.b(a.l, cVar.d));
if (b != null) {
arrayList2.add(Pair.create(str, b.e));
a.a = true;
}
Log.i(z[1] + str + z[7] + ale.b(a.l, cVar.d));
c5Var = a;
} else {
if (B != null) {
if (!B.e.equals(mVar)) {
if (App.aJ.b(mVar) != null) {
c5Var = ale.a(str, 0);
arrayList2.add(Pair.create(str, mVar));
c5Var.a = true;
Log.i(z[4] + str);
} else {
a = ale.a(str, 3);
b = App.aJ.b(str, ale.b(a.l, cVar.d));
if (b != null) {
arrayList2.add(Pair.create(str, b.e));
a.a = true;
}
Log.i(z[5] + str + z[0] + ale.b(a.l, cVar.d));
c5Var = a;
}
}
} else if (mVar != null) {
c5Var = ale.a(str, 1);
Log.i(z[2] + str);
}
c5Var = null;
}
} else {
c5Var = new c5();
c5Var.b = str;
c5Var.k = 2;
Log.i(z[6] + str);
}
hashSet.remove(str);
boolean q = App.aJ.q(str);
long c = t.c(App.p, str);
long j2 = (c / 1000) * 1000;
if (!bd.b(str)) {
z = false;
} else if (bd.f(str)) {
z = false;
} else {
z = true;
}
m8 b2 = v.b(str);
int i3 = b2 != null ? b2.a : 0;
if (c5Var == null && !(q == z2 && j2 == j && z == z3 && (b2 == null || i2 == i3))) {
c5Var = new c5();
c5Var.b = str;
}
if (c5Var != null) {
c5Var.g = q;
c5Var.r = c;
c5Var.m = z;
c5Var.e = i3;
arrayList.add(c5Var);
continue;
}
if (i != 0) {
break;
}
}
Iterator it2 = hashSet.iterator();
while (it2.hasNext()) {
String str2 = (String) it2.next();
c5 a2 = ale.a(str2, 0);
a2.g = App.aJ.q(str2);
a2.r = t.c(App.p, str2);
z = bd.b(str2) ? !bd.f(str2) : false;
a2.m = z;
arrayList.add(a2);
arrayList2.add(Pair.create(str2, (m) null));
if (App.aJ.B(str2) != null) {
a2.a = true;
continue;
}
if (i != 0) {
break;
}
}
App.a(this.c, arrayList, this.a);
App.a(this.c, this.b, z[3]);
for (Pair pair : arrayList2) {
List a3 = App.aJ.a((String) pair.first, (m) pair.second);
if (a3 != null) {
App.a(2, a3, false, false, null, null);
continue;
}
if (i != 0) {
return;
}
}
}
}
| UTF-8 | Java | 8,160 | java | dm.java | Java | [] | null | [] | package com.whatsapp;
import android.util.Pair;
import com.whatsapp.notification.t;
import com.whatsapp.protocol.b;
import com.whatsapp.protocol.c;
import com.whatsapp.protocol.c5;
import com.whatsapp.protocol.m;
import com.whatsapp.util.Log;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.spongycastle.jcajce.provider.symmetric.util.PBE;
import org.whispersystems.libaxolotl.aV;
import org.whispersystems.libaxolotl.aj;
import org.whispersystems.libaxolotl.ay;
class dm implements Runnable {
private static final String[] z;
final int a;
final String b;
final String c;
final c5 d;
final ale e;
static {
String[] strArr = new String[8];
String str = "#\u0018{avwA";
Object obj = -1;
String[] strArr2 = strArr;
String[] strArr3 = strArr;
int i = 0;
while (true) {
char[] toCharArray = str.toCharArray();
int length = toCharArray.length;
char[] cArr = toCharArray;
for (int i2 = 0; length > i2; i2++) {
int i3;
char c = cArr[i2];
switch (i2 % 5) {
case PBE.MD5 /*0*/:
i3 = 3;
break;
case ay.f /*1*/:
i3 = 123;
break;
case ay.n /*2*/:
i3 = 20;
break;
case ay.p /*3*/:
i3 = 20;
break;
default:
i3 = 24;
break;
}
cArr[i2] = (char) (i3 ^ c);
}
str = new String(cArr).intern();
switch (obj) {
case PBE.MD5 /*0*/:
strArr2[i] = str;
str = "r\tKemf\tm;jf\bay},\u0018xqyqT";
i = 2;
strArr2 = strArr3;
obj = 1;
break;
case ay.f /*1*/:
strArr2[i] = str;
str = "t\u001ev";
i = 3;
strArr2 = strArr3;
obj = 2;
break;
case ay.n /*2*/:
strArr2[i] = str;
str = "r\tKemf\tm;jf\bay},\u0018{znf\tgulj\u0014zg7";
i = 4;
strArr2 = strArr3;
obj = 3;
break;
case ay.p /*3*/:
strArr2[i] = str;
i = 5;
strArr2 = strArr3;
str = "r\tKemf\tm;jf\bay},\u001a|qygT";
obj = 4;
break;
case aj.i /*4*/:
strArr2[i] = str;
i = 6;
str = "r\tKemf\tm;jf\bay},\u001fqx}w\u001e;";
obj = 5;
strArr2 = strArr3;
break;
case aV.r /*5*/:
strArr2[i] = str;
i = 7;
str = "#\u0018{avwA";
obj = 6;
strArr2 = strArr3;
break;
case aV.i /*6*/:
strArr2[i] = str;
z = strArr3;
default:
strArr2[i] = str;
str = "r\tKemf\tm;jf\bay},\u0018xqyqTy{|w\u001as;";
i = 1;
strArr2 = strArr3;
obj = null;
break;
}
}
}
dm(ale com_whatsapp_ale, c5 c5Var, String str, int i, String str2) {
this.e = com_whatsapp_ale;
this.d = c5Var;
this.c = str;
this.a = i;
this.b = str2;
}
public void run() {
int i = App.az;
List arrayList = new ArrayList();
List<Pair> arrayList2 = new ArrayList();
HashSet hashSet = new HashSet(v.b());
Iterator it = this.d.j.iterator();
while (it.hasNext()) {
c5 c5Var;
boolean z;
c cVar = (c) it.next();
m mVar = cVar.h;
boolean z2 = cVar.f;
String str = cVar.b;
long j = cVar.g;
int i2 = cVar.a;
boolean z3 = cVar.e;
if (hashSet.contains(str)) {
b B = App.aJ.B(str);
c5 a;
b b;
if (App.aJ.y(str) != cVar.c) {
a = ale.a(str, 1);
b = App.aJ.b(str, ale.b(a.l, cVar.d));
if (b != null) {
arrayList2.add(Pair.create(str, b.e));
a.a = true;
}
Log.i(z[1] + str + z[7] + ale.b(a.l, cVar.d));
c5Var = a;
} else {
if (B != null) {
if (!B.e.equals(mVar)) {
if (App.aJ.b(mVar) != null) {
c5Var = ale.a(str, 0);
arrayList2.add(Pair.create(str, mVar));
c5Var.a = true;
Log.i(z[4] + str);
} else {
a = ale.a(str, 3);
b = App.aJ.b(str, ale.b(a.l, cVar.d));
if (b != null) {
arrayList2.add(Pair.create(str, b.e));
a.a = true;
}
Log.i(z[5] + str + z[0] + ale.b(a.l, cVar.d));
c5Var = a;
}
}
} else if (mVar != null) {
c5Var = ale.a(str, 1);
Log.i(z[2] + str);
}
c5Var = null;
}
} else {
c5Var = new c5();
c5Var.b = str;
c5Var.k = 2;
Log.i(z[6] + str);
}
hashSet.remove(str);
boolean q = App.aJ.q(str);
long c = t.c(App.p, str);
long j2 = (c / 1000) * 1000;
if (!bd.b(str)) {
z = false;
} else if (bd.f(str)) {
z = false;
} else {
z = true;
}
m8 b2 = v.b(str);
int i3 = b2 != null ? b2.a : 0;
if (c5Var == null && !(q == z2 && j2 == j && z == z3 && (b2 == null || i2 == i3))) {
c5Var = new c5();
c5Var.b = str;
}
if (c5Var != null) {
c5Var.g = q;
c5Var.r = c;
c5Var.m = z;
c5Var.e = i3;
arrayList.add(c5Var);
continue;
}
if (i != 0) {
break;
}
}
Iterator it2 = hashSet.iterator();
while (it2.hasNext()) {
String str2 = (String) it2.next();
c5 a2 = ale.a(str2, 0);
a2.g = App.aJ.q(str2);
a2.r = t.c(App.p, str2);
z = bd.b(str2) ? !bd.f(str2) : false;
a2.m = z;
arrayList.add(a2);
arrayList2.add(Pair.create(str2, (m) null));
if (App.aJ.B(str2) != null) {
a2.a = true;
continue;
}
if (i != 0) {
break;
}
}
App.a(this.c, arrayList, this.a);
App.a(this.c, this.b, z[3]);
for (Pair pair : arrayList2) {
List a3 = App.aJ.a((String) pair.first, (m) pair.second);
if (a3 != null) {
App.a(2, a3, false, false, null, null);
continue;
}
if (i != 0) {
return;
}
}
}
}
| 8,160 | 0.343382 | 0.316544 | 246 | 32.170731 | 14.594078 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.890244 | false | false | 1 |
8d9cc97f350ee99811446d0903b40a1cd04497f9 | 22,162,031,306,831 | aff9ca5dcf55240ecdf31dd90c647ea02ff516af | /src/aidensplugin/items/base/attribute/AttributeType.java | 8c55b940509d50ed04b0837b31f03467d07218af | [] | no_license | apc4141/aidens-plugin | https://github.com/apc4141/aidens-plugin | 67ddddd70bce869a7e0fa7dd0b982465577826a9 | c65386a95d6f9f1a88aa9900977c2e79bc3ab437 | refs/heads/master | 2023-02-01T17:48:27.904000 | 2020-12-18T01:12:37 | 2020-12-18T01:12:37 | 320,941,358 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package aidensplugin.items.base.attribute;
public enum AttributeType {
ATTACK_DAMAGE("generic.attackDamage"),
ATTACK_SPEED("generic.attackSpeed"),
ATTACK_KNOCKBACK("generic.attackKnockback"),
MAX_HEALTH("generic.maxHealth"),
KNOCKBACK_RESISTANCE("generic.knockbackResistance"),
MOVEMENT_SPEED("generic.movementSpeed"),
ARMOR("generic.armor"),
ARMOR_TOUGHNESS("generic.armorToughness"),
LUCK("generic.luck");
private final String name;
AttributeType(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
| UTF-8 | Java | 603 | java | AttributeType.java | Java | [] | null | [] | package aidensplugin.items.base.attribute;
public enum AttributeType {
ATTACK_DAMAGE("generic.attackDamage"),
ATTACK_SPEED("generic.attackSpeed"),
ATTACK_KNOCKBACK("generic.attackKnockback"),
MAX_HEALTH("generic.maxHealth"),
KNOCKBACK_RESISTANCE("generic.knockbackResistance"),
MOVEMENT_SPEED("generic.movementSpeed"),
ARMOR("generic.armor"),
ARMOR_TOUGHNESS("generic.armorToughness"),
LUCK("generic.luck");
private final String name;
AttributeType(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
| 603 | 0.684909 | 0.684909 | 23 | 25.217392 | 17.710121 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.565217 | false | false | 1 |
9397e5e4a546377f4d23fb521a41b00380902a10 | 22,162,031,306,945 | feb4191a8a6aebdea7cac22cf7a330d0775229ac | /food-dao/src/main/java/edu/nf/food/label/dao/DifficultyDao.java | a0b6fd9ec35a410271d68accc5f2ec9ff20e32d4 | [] | no_license | Admin-IT/food | https://github.com/Admin-IT/food | 029a24306c7749d5a919d29b6b73993adac233be | 9bc910c2957134c97f324b8b237d08e3e6b5e786 | refs/heads/master | 2022-09-30T11:48:17.183000 | 2020-04-22T06:42:50 | 2020-04-22T06:42:50 | 244,671,626 | 1 | 1 | null | false | 2022-09-01T23:24:27 | 2020-03-03T15:26:14 | 2020-04-22T06:42:55 | 2022-09-01T23:24:25 | 50,739 | 0 | 1 | 4 | HTML | false | false | package edu.nf.food.label.dao;
import edu.nf.food.label.entity.Difficulty;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author ljf
* @date 2020/3/20
* 难度
*/
@Mapper
public interface DifficultyDao {
List<Difficulty> listDiffculty();
void addDiffculty(Difficulty difficulty);
void delDiffculty(Difficulty difficulty);
} | UTF-8 | Java | 372 | java | DifficultyDao.java | Java | [
{
"context": "ns.Mapper;\n\nimport java.util.List;\n\n/**\n * @author ljf\n * @date 2020/3/20\n * 难度\n */\n@Mapper\npublic inter",
"end": 164,
"score": 0.9996520280838013,
"start": 161,
"tag": "USERNAME",
"value": "ljf"
}
] | null | [] | package edu.nf.food.label.dao;
import edu.nf.food.label.entity.Difficulty;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author ljf
* @date 2020/3/20
* 难度
*/
@Mapper
public interface DifficultyDao {
List<Difficulty> listDiffculty();
void addDiffculty(Difficulty difficulty);
void delDiffculty(Difficulty difficulty);
} | 372 | 0.736413 | 0.717391 | 20 | 17.450001 | 17.514208 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.35 | false | false | 1 |
4a458ad6cdda7eacf124095a0bf4537582794a30 | 6,476,810,698,475 | b0b89615cd9125c0cf375114867f5eb2e4eccd8c | /src/main/java/com/book/rental/bookrental/model/Cart.java | 23ae9bc910b766a1ae0c0c8a01f0bded73c97584 | [] | no_license | sha1shwat/Rental-Books | https://github.com/sha1shwat/Rental-Books | c2c980d5c7b169a6a516e29fcd29804c3f85ee2d | 67205d7c8fb52ce492aef8804cd3f97cf36757a1 | refs/heads/main | 2023-05-09T08:03:55.739000 | 2021-06-07T03:36:38 | 2021-06-07T03:36:38 | 374,432,563 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.book.rental.bookrental.model;
import lombok.*;
import javax.persistence.*;
@Table(name = "cart")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Data
public class Cart {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String bookName;
private String userId;
}
| UTF-8 | Java | 348 | java | Cart.java | Java | [] | null | [] | package com.book.rental.bookrental.model;
import lombok.*;
import javax.persistence.*;
@Table(name = "cart")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Data
public class Cart {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String bookName;
private String userId;
}
| 348 | 0.735632 | 0.735632 | 21 | 15.571428 | 14.304749 | 55 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | false | false | 1 |
8f1754723b409233f91b6549db6047de0df6d313 | 30,030,411,345,312 | 032f320350f9625e432d98ff4e13d46c07be3ab8 | /magazine/src/main/java/com/magazine/model/Sheet.java | f1b543c131c53d78c1ca2f97ce72d26e0f86622f | [
"Apache-2.0"
] | permissive | alterhz/myTestPro | https://github.com/alterhz/myTestPro | 047db771be55ecfc64a42f52e0f18be3611dce84 | c6ab071d1d47248269f4500a5cc1ca66da4b92a8 | refs/heads/main | 2023-04-24T19:18:50.725000 | 2021-04-29T15:20:57 | 2021-04-29T15:20:57 | 313,941,484 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.magazine.model;
import java.util.*;
import java.util.stream.Collectors;
/**
* 页签数据列表
*
* @author Ziegler
* date 2021/4/12
*/
public class Sheet {
/** 页签名称 */
private String sheetName;
/** 默认搜索字段 */
private String searchField;
/** 排序字段 */
private String sortField;
/** 显示的字段列表 */
private List<ShowField> fields = new ArrayList<>();
/** keyValue格式数据 */
private List<Map<String, Object>> rows;
/**
* 创建应用过滤器过滤后的 {@link Sheet}
* @param sheetName 页签名称
* @param SearchField
* @param sheetFilter 过滤器
* @return 返回经过过滤后的数据页
*/
public static Sheet createSheet(String sheetName, String SearchField, List<Map<String, Object>> rows, SheetFilter sheetFilter) {
final Sheet sheet = new Sheet();
sheet.setSheetName(sheetName);
sheet.setSearchField(SearchField);
sheet.fields.addAll(sheetFilter.getFields());
// 如果存在默认搜索键,则使用默认搜索。否则使用全局默认搜索键
sheet.fields.stream()
.filter(f -> f.getDefaultKey() != null && f.getDefaultKey())
.map(showField -> showField.getField())
.findAny()
.ifPresent(sheet::setSearchField);
// 默认全局搜索键为排序字段
sheet.setSortField(SearchField);
sheet.fields.stream()
.filter(f -> f.getSortKey() != null && f.getSortKey())
.map(showField -> showField.getField())
.findAny()
.ifPresent(sheet::setSortField);
// 按照order排序
sheet.fields.sort(Comparator.comparingInt(ShowField::getOrder));
final List<Map<String, Object>> filterRows = rows.stream()
.map(keyValues -> sheetFilter.applyFilter(keyValues))
.collect(Collectors.toList());
sheet.setRows(filterRows);
return sheet;
}
public String getSheetName() {
return sheetName;
}
public void setSheetName(String sheetName) {
this.sheetName = sheetName;
}
public List<ShowField> getFields() {
return fields;
}
public void setFields(List<ShowField> fields) {
this.fields = fields;
}
public String getSearchField() {
return searchField;
}
public void setSearchField(String searchField) {
this.searchField = searchField;
}
public List<Map<String, Object>> getRows() {
return rows;
}
public void setRows(List<Map<String, Object>> rows) {
this.rows = rows;
}
public String getSortField() {
return sortField;
}
public void setSortField(String sortField) {
this.sortField = sortField;
}
}
| UTF-8 | Java | 2,881 | java | Sheet.java | Java | [
{
"context": "il.stream.Collectors;\n\n/**\n * 页签数据列表\n *\n * @author Ziegler\n * date 2021/4/12\n */\npublic class Sheet {\n\n /",
"end": 121,
"score": 0.998947024345398,
"start": 114,
"tag": "USERNAME",
"value": "Ziegler"
}
] | null | [] | package com.magazine.model;
import java.util.*;
import java.util.stream.Collectors;
/**
* 页签数据列表
*
* @author Ziegler
* date 2021/4/12
*/
public class Sheet {
/** 页签名称 */
private String sheetName;
/** 默认搜索字段 */
private String searchField;
/** 排序字段 */
private String sortField;
/** 显示的字段列表 */
private List<ShowField> fields = new ArrayList<>();
/** keyValue格式数据 */
private List<Map<String, Object>> rows;
/**
* 创建应用过滤器过滤后的 {@link Sheet}
* @param sheetName 页签名称
* @param SearchField
* @param sheetFilter 过滤器
* @return 返回经过过滤后的数据页
*/
public static Sheet createSheet(String sheetName, String SearchField, List<Map<String, Object>> rows, SheetFilter sheetFilter) {
final Sheet sheet = new Sheet();
sheet.setSheetName(sheetName);
sheet.setSearchField(SearchField);
sheet.fields.addAll(sheetFilter.getFields());
// 如果存在默认搜索键,则使用默认搜索。否则使用全局默认搜索键
sheet.fields.stream()
.filter(f -> f.getDefaultKey() != null && f.getDefaultKey())
.map(showField -> showField.getField())
.findAny()
.ifPresent(sheet::setSearchField);
// 默认全局搜索键为排序字段
sheet.setSortField(SearchField);
sheet.fields.stream()
.filter(f -> f.getSortKey() != null && f.getSortKey())
.map(showField -> showField.getField())
.findAny()
.ifPresent(sheet::setSortField);
// 按照order排序
sheet.fields.sort(Comparator.comparingInt(ShowField::getOrder));
final List<Map<String, Object>> filterRows = rows.stream()
.map(keyValues -> sheetFilter.applyFilter(keyValues))
.collect(Collectors.toList());
sheet.setRows(filterRows);
return sheet;
}
public String getSheetName() {
return sheetName;
}
public void setSheetName(String sheetName) {
this.sheetName = sheetName;
}
public List<ShowField> getFields() {
return fields;
}
public void setFields(List<ShowField> fields) {
this.fields = fields;
}
public String getSearchField() {
return searchField;
}
public void setSearchField(String searchField) {
this.searchField = searchField;
}
public List<Map<String, Object>> getRows() {
return rows;
}
public void setRows(List<Map<String, Object>> rows) {
this.rows = rows;
}
public String getSortField() {
return sortField;
}
public void setSortField(String sortField) {
this.sortField = sortField;
}
}
| 2,881 | 0.596031 | 0.593411 | 103 | 24.932039 | 22.803619 | 132 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.359223 | false | false | 1 |
914676eeaa79d386cd59985921e51cd387c74999 | 23,115,514,046,563 | 46404483e5e8a47a2201079fee8d3900c23f8b87 | /app/src/main/java/android/cruciblecrab/quietmusicplayer/MediaControlsActivity.java | 2c3453038464a2452f6c93d9cfddd0053b1c43d6 | [] | no_license | CrusaderCrab/QuietMusicPlayer | https://github.com/CrusaderCrab/QuietMusicPlayer | 16aa1a311e13c66113c78de09c67be9ac0550c3a | 21b000888eaa1a397443a7ea4ba5da2aab464e15 | refs/heads/master | 2021-01-10T18:19:24.557000 | 2016-03-17T22:46:47 | 2016-03-17T22:46:47 | 53,200,905 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | package android.cruciblecrab.quietmusicplayer;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.TextView;
/**
* Created by CrusaderCrab on 16/03/2016.
*/
public abstract class MediaControlsActivity extends AppCompatActivity{
android.os.Handler handler;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
}
protected void setupMediaControls(){
MediaControls mediaControls = new MediaControls();
//seekbar
SeekBar seekBar = (SeekBar) findViewById(R.id.seekBar);
handler = new android.os.Handler();
this.runOnUiThread(new SeekbarRunnable(handler, seekBar));
seekBar.setOnSeekBarChangeListener(mediaControls.seekBarChangeListener());
//current time
TextView durationText = (TextView)findViewById(R.id.timetext);
this.runOnUiThread(new DurationRunnable(handler, durationText));
//song name
TextView nameText = (TextView)findViewById(R.id.songtext);
MediaControls.addSongName(nameText);
//play button
Button playButton = (Button) findViewById(R.id.playbutton);
playButton.setOnClickListener(mediaControls.playButtonListener());
MediaControls.setAllPlayButtons(MediaControls.playerPlaying);
MediaControls.addPlayButton(playButton);
//prev button
Button prevButton = (Button) findViewById(R.id.prevbutton);
prevButton.setOnClickListener(mediaControls.prevButtonListener());
//next button
Button nextButton = (Button) findViewById(R.id.nextbutton);
nextButton.setOnClickListener(mediaControls.nextButtonListener());
}
protected void removeMediaControls(){
//seekbar, no need
//current time, no need
//song name
TextView nameText = (TextView)findViewById(R.id.songtext);
MediaControls.removeSongName(nameText);
//play button
Button playButton = (Button) findViewById(R.id.playbutton);
MediaControls.removePlayButton(playButton);
//next button, no need
//prev button, no need
}
protected void increaseVolume(){
if(MediaLogic.ready())
MediaLogic.getInterface().alterVolume(MediaLogic.VOLUME_STEP);
}
protected void decreaseVolume(){
if(MediaLogic.ready())
MediaLogic.getInterface().alterVolume(-MediaLogic.VOLUME_STEP);
}
}
| UTF-8 | Java | 2,540 | java | MediaControlsActivity.java | Java | [
{
"context": "import android.widget.TextView;\n\n/**\n * Created by CrusaderCrab on 16/03/2016.\n */\npublic abstract class MediaCon",
"end": 247,
"score": 0.9992092251777649,
"start": 235,
"tag": "USERNAME",
"value": "CrusaderCrab"
}
] | null | [] | package android.cruciblecrab.quietmusicplayer;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.TextView;
/**
* Created by CrusaderCrab on 16/03/2016.
*/
public abstract class MediaControlsActivity extends AppCompatActivity{
android.os.Handler handler;
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
}
protected void setupMediaControls(){
MediaControls mediaControls = new MediaControls();
//seekbar
SeekBar seekBar = (SeekBar) findViewById(R.id.seekBar);
handler = new android.os.Handler();
this.runOnUiThread(new SeekbarRunnable(handler, seekBar));
seekBar.setOnSeekBarChangeListener(mediaControls.seekBarChangeListener());
//current time
TextView durationText = (TextView)findViewById(R.id.timetext);
this.runOnUiThread(new DurationRunnable(handler, durationText));
//song name
TextView nameText = (TextView)findViewById(R.id.songtext);
MediaControls.addSongName(nameText);
//play button
Button playButton = (Button) findViewById(R.id.playbutton);
playButton.setOnClickListener(mediaControls.playButtonListener());
MediaControls.setAllPlayButtons(MediaControls.playerPlaying);
MediaControls.addPlayButton(playButton);
//prev button
Button prevButton = (Button) findViewById(R.id.prevbutton);
prevButton.setOnClickListener(mediaControls.prevButtonListener());
//next button
Button nextButton = (Button) findViewById(R.id.nextbutton);
nextButton.setOnClickListener(mediaControls.nextButtonListener());
}
protected void removeMediaControls(){
//seekbar, no need
//current time, no need
//song name
TextView nameText = (TextView)findViewById(R.id.songtext);
MediaControls.removeSongName(nameText);
//play button
Button playButton = (Button) findViewById(R.id.playbutton);
MediaControls.removePlayButton(playButton);
//next button, no need
//prev button, no need
}
protected void increaseVolume(){
if(MediaLogic.ready())
MediaLogic.getInterface().alterVolume(MediaLogic.VOLUME_STEP);
}
protected void decreaseVolume(){
if(MediaLogic.ready())
MediaLogic.getInterface().alterVolume(-MediaLogic.VOLUME_STEP);
}
}
| 2,540 | 0.696063 | 0.69252 | 71 | 34.774647 | 25.821815 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.521127 | false | false | 1 |
2f8f09677a823fb04bb2a069a6b3920e87b9b65a | 22,290,880,333,166 | ecfeaaa7ad6288b7c3910c61e3343e3b573380d4 | /src/extendedButton.java | 9cc4de5b0b4922e0dc29ac6285c994bb5d7234a4 | [] | no_license | Omerbea/Battleship-JavaFX | https://github.com/Omerbea/Battleship-JavaFX | b064e7b5490818ec79ec1a3e1b52269fcfe19ab6 | 7fdf4b2c32ce770a5a67742de6218f24ff2d56d8 | refs/heads/master | 2021-07-03T03:27:52.478000 | 2017-09-24T19:26:00 | 2017-09-24T19:26:00 | 103,403,439 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import javafx.scene.control.Button;
public class extendedButton extends Button {
private int row ;
private int column;
public extendedButton(int i_row, int i_column) {
row = i_row;
column = i_column;
}
public int getRow () {return row;}
public int getColumn () {return column;}
}
| UTF-8 | Java | 324 | java | extendedButton.java | Java | [] | null | [] | import javafx.scene.control.Button;
public class extendedButton extends Button {
private int row ;
private int column;
public extendedButton(int i_row, int i_column) {
row = i_row;
column = i_column;
}
public int getRow () {return row;}
public int getColumn () {return column;}
}
| 324 | 0.641975 | 0.641975 | 15 | 20.6 | 18.168839 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.533333 | false | false | 1 |
f2292d68aac3d423222471299631397a976dace5 | 15,436,112,462,670 | 976190bd603b7ed1e4610648f3dc7bbcaedc491a | /PokerSolitairev1/Model/Suit.java | e8ea8133fb5a6fb7461a2dec185da95874beb39a | [] | no_license | MartinBergstrom/PokerSolitaire | https://github.com/MartinBergstrom/PokerSolitaire | 97b68c4365c00b3aea533240884e9d823cb29b0a | 8a56995050097e683864a1a2353d1d6373be69b3 | refs/heads/master | 2021-01-19T09:05:27.624000 | 2017-04-09T16:11:01 | 2017-04-09T16:11:01 | 87,721,058 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Model;
public enum Suit {
HEARTS,SPADES,CLUBS,DIAMONDS;
}
| UTF-8 | Java | 68 | java | Suit.java | Java | [] | null | [] | package Model;
public enum Suit {
HEARTS,SPADES,CLUBS,DIAMONDS;
}
| 68 | 0.75 | 0.75 | 5 | 12.6 | 11.2 | 30 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.2 | false | false | 1 |
65786135221f59ba28a734a1001a268a4cd43686 | 28,887,950,034,974 | 6f61a47ea87899f7d6886b4964eb0ed68327bf7d | /src/main/com/gmail/mararok/epicwar/controlpoint/ControlPointsUpdater.java | d465875e91cfe1dac65718de17e391d87eaed788 | [
"MIT"
] | permissive | Mararok/EpicWar | https://github.com/Mararok/EpicWar | 4cbc552d086fc528bd96c9be6b66a3bd5e3a3fb3 | 8efa6cf229c130078f7750a5f8ed5031f0671e12 | refs/heads/master | 2021-01-22T08:13:22.410000 | 2014-03-22T09:34:16 | 2014-03-22T09:34:16 | 18,006,022 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* EpicWar
* The MIT License
* Copyright (C) 2013 Mararok <mararok@gmail.com>
*/
package com.gmail.mararok.epicwar.controlpoint;
import org.bukkit.scheduler.BukkitRunnable;
public class ControlPointsUpdater extends BukkitRunnable {
private ControlPointsManager ControlPoints;
private boolean Enabled;
public ControlPointsUpdater(ControlPointsManager controlPoints) {
ControlPoints = controlPoints;
Enabled = true;
}
@Override
public void run() {
if (isEnable()) {
//ControlPoints.getPlugin().logInfo("up");
ControlPoints.update();
}
}
public void setEnabled(boolean enable) {
Enabled = enable;
}
public boolean isEnable() {
return Enabled;
}
}
| UTF-8 | Java | 721 | java | ControlPointsUpdater.java | Java | [
{
"context": "EpicWar\r\n * The MIT License\r\n * Copyright (C) 2013 Mararok <mararok@gmail.com>\r\n */\r\npackage com.gmail.marar",
"end": 66,
"score": 0.9881730675697327,
"start": 59,
"tag": "NAME",
"value": "Mararok"
},
{
"context": "* The MIT License\r\n * Copyright (C) 2013 Mara... | null | [] | /**
* EpicWar
* The MIT License
* Copyright (C) 2013 Mararok <<EMAIL>>
*/
package com.gmail.mararok.epicwar.controlpoint;
import org.bukkit.scheduler.BukkitRunnable;
public class ControlPointsUpdater extends BukkitRunnable {
private ControlPointsManager ControlPoints;
private boolean Enabled;
public ControlPointsUpdater(ControlPointsManager controlPoints) {
ControlPoints = controlPoints;
Enabled = true;
}
@Override
public void run() {
if (isEnable()) {
//ControlPoints.getPlugin().logInfo("up");
ControlPoints.update();
}
}
public void setEnabled(boolean enable) {
Enabled = enable;
}
public boolean isEnable() {
return Enabled;
}
}
| 711 | 0.700416 | 0.694868 | 33 | 19.848484 | 19.227697 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.272727 | false | false | 1 |
74308ba768babc6c92252da885a083aa882a76d5 | 4,097,398,868,688 | 42758d907071bf6e5be495f2d61a2e0469e209c8 | /src/org/rm/genie/vaapp/backend/TestPrepReportService.java | b6b52e63183dbc2cccb9bd5214449250137e93fc | [] | no_license | vs-git/vaapp | https://github.com/vs-git/vaapp | 8ab4c041b05ad62f47d12edf9b81a99ffa56fd0f | d3d0be0412ec48cffbdea1631901884b20104d6b | refs/heads/master | 2021-01-09T21:54:16.449000 | 2015-12-24T11:28:28 | 2015-12-24T11:28:28 | 48,437,320 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.rm.genie.vaapp.backend;
import com.vaadin.ui.Notification;
import org.rm.genie.vaapp.genie.shared.entity.report2.TestPrepReportRequest;
import org.rm.genie.vaapp.genie.shared.entity.report2.TestPrepReportResponse;
import org.rm.genie.vaapp.util.DataMapping;
import org.rm.genie.vaapp.util.VHttpRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
public class TestPrepReportService
{
public static void getReport(TestPrepReportRequest requestData, TestPrepReportResponse response)
{
String url = "/genie2-web/prekserv/report/buildTestPrepReport";
List<TestPrepReportRequest> l = new ArrayList<>();
l.add(requestData);
HashMap<String, Object> data = VHttpRequest.call(VHttpRequest.POST, url, l);
if (data == null)
{
VHttpRequest.resetCookie();
Notification.show("Incorrect login or password", Notification.Type.ERROR_MESSAGE);
}
else
{
try {
//System.out.println("1111111111111111 " + o.getClass().getDeclaredFields());
DataMapping.mapObject(response, (LinkedHashMap) data);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
| UTF-8 | Java | 1,213 | java | TestPrepReportService.java | Java | [] | null | [] | package org.rm.genie.vaapp.backend;
import com.vaadin.ui.Notification;
import org.rm.genie.vaapp.genie.shared.entity.report2.TestPrepReportRequest;
import org.rm.genie.vaapp.genie.shared.entity.report2.TestPrepReportResponse;
import org.rm.genie.vaapp.util.DataMapping;
import org.rm.genie.vaapp.util.VHttpRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
public class TestPrepReportService
{
public static void getReport(TestPrepReportRequest requestData, TestPrepReportResponse response)
{
String url = "/genie2-web/prekserv/report/buildTestPrepReport";
List<TestPrepReportRequest> l = new ArrayList<>();
l.add(requestData);
HashMap<String, Object> data = VHttpRequest.call(VHttpRequest.POST, url, l);
if (data == null)
{
VHttpRequest.resetCookie();
Notification.show("Incorrect login or password", Notification.Type.ERROR_MESSAGE);
}
else
{
try {
//System.out.println("1111111111111111 " + o.getClass().getDeclaredFields());
DataMapping.mapObject(response, (LinkedHashMap) data);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
| 1,213 | 0.723001 | 0.707337 | 42 | 27.857143 | 29.070171 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.595238 | false | false | 1 |
6d8b58a0eec3fb7092d6c240cd14f0d3de9a51f3 | 29,368,986,373,076 | 89d41f665ab72a7f4cf9e6a712bc0732c2c29ce4 | /stone/src/stone/ast/builtin/BuiltinList.java | d6f2aecce4e911821a37a3f83fbf450dc78aca49 | [] | no_license | rundisR/TempRepo | https://github.com/rundisR/TempRepo | 879773547c4a9ea9b3893257e19620a811f5b696 | 1f98c4163d1d00e0b26b098e4540e88d1e4ec47a | refs/heads/master | 2017-12-01T23:45:58.507000 | 2016-06-12T14:19:15 | 2016-06-12T14:19:15 | 60,968,567 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package stone.ast.builtin;
import stone.Environment;
import stone.ast.StoneObject;
/**
* Created by rundis on 15-10-27.
* This class convert the list into built-in object in order to use native list.
* @version 1.0
* @author rundis
*/
public class BuiltinList extends StoneObject
{
public BuiltinList(Environment env)
{
super(env);
}
}
| UTF-8 | Java | 363 | java | BuiltinList.java | Java | [
{
"context": ";\nimport stone.ast.StoneObject;\n\n/**\n * Created by rundis on 15-10-27.\n * This class convert the list into ",
"end": 109,
"score": 0.99711674451828,
"start": 103,
"tag": "USERNAME",
"value": "rundis"
},
{
"context": "der to use native list.\n * @version 1.0\n * @au... | null | [] | package stone.ast.builtin;
import stone.Environment;
import stone.ast.StoneObject;
/**
* Created by rundis on 15-10-27.
* This class convert the list into built-in object in order to use native list.
* @version 1.0
* @author rundis
*/
public class BuiltinList extends StoneObject
{
public BuiltinList(Environment env)
{
super(env);
}
}
| 363 | 0.699724 | 0.677686 | 18 | 19.166666 | 20.30394 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.222222 | false | false | 1 |
6846842590980a8465b5e4407c0eb31c5f2659f9 | 15,994,458,216,923 | e1901ad5e439126ca7f8207e77b5a0dfec17d284 | /src/main/java/com/snake8751/raspberrypi/modules/Buzzer.java | 08bbceb248edf90e8ccbf2fef0fcd954920c49f5 | [] | no_license | snake851/raspberryExamples | https://github.com/snake851/raspberryExamples | 4f9762a6826290ee3325c1b820c7e7c3215519cf | f54c2d6ed4734b74f74e861388affcca164a4c76 | refs/heads/master | 2020-06-21T14:57:55.297000 | 2016-11-27T00:45:31 | 2016-11-27T00:45:31 | 74,782,081 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.snake8751.raspberrypi.modules;
import com.pi4j.io.gpio.*;
import com.pi4j.io.gpio.impl.GpioPinImpl;
/**
* Created by sergeytribe on 05.11.16.
*/
public class Buzzer extends GpioPinImpl {;
public Buzzer(GpioController gpio, GpioProvider provider, Pin pin) {
super(gpio, provider, pin);
}
public void buzz(long buzTime) {
pulse(buzTime, true);
}
public boolean buzz(long buzzTime, long pauseTime) {
buzz(buzzTime);
try {
Thread.sleep(pauseTime);
} catch (InterruptedException e) {
return false;
}
return true;
}
public boolean buzz(long buzzTime, long pauseTime, int times) {
for (int i = 0; i < times; i++) {
buzz(buzzTime, pauseTime);
}
return true;
}
}
| UTF-8 | Java | 713 | java | Buzzer.java | Java | [
{
"context": ".pi4j.io.gpio.impl.GpioPinImpl;\n\n/**\n * Created by sergeytribe on 05.11.16.\n */\npublic class Buzzer extends Gpio",
"end": 143,
"score": 0.9996593594551086,
"start": 132,
"tag": "USERNAME",
"value": "sergeytribe"
}
] | null | [] | package com.snake8751.raspberrypi.modules;
import com.pi4j.io.gpio.*;
import com.pi4j.io.gpio.impl.GpioPinImpl;
/**
* Created by sergeytribe on 05.11.16.
*/
public class Buzzer extends GpioPinImpl {;
public Buzzer(GpioController gpio, GpioProvider provider, Pin pin) {
super(gpio, provider, pin);
}
public void buzz(long buzTime) {
pulse(buzTime, true);
}
public boolean buzz(long buzzTime, long pauseTime) {
buzz(buzzTime);
try {
Thread.sleep(pauseTime);
} catch (InterruptedException e) {
return false;
}
return true;
}
public boolean buzz(long buzzTime, long pauseTime, int times) {
for (int i = 0; i < times; i++) {
buzz(buzzTime, pauseTime);
}
return true;
}
}
| 713 | 0.687237 | 0.669004 | 36 | 18.805555 | 19.676296 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.666667 | false | false | 1 |
120715b31e00f823b2a8518eebd7a0ae28469772 | 24,000,277,255,940 | 173a2f05a7aca377a0bc75dcf4130697d6f3731a | /Lab6/src/quest2/Reader.java | 7db1062662e4e54bb038f46b7d2f333635b4d7b4 | [] | no_license | brunolmourao/SistemasOperacionais | https://github.com/brunolmourao/SistemasOperacionais | f6f2f4b6df494d6405713dd05e599c7439d7a6ff | 40fe1c125c192596bf95bd8ea5cffb23a1a4673f | refs/heads/master | 2021-01-11T03:23:54.264000 | 2016-11-19T19:49:10 | 2016-11-19T19:49:10 | 71,012,951 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package quest2;
public class Reader extends Thread {
private Monitor M;
public Reader(String name, Monitor monitor) {
super(name);
this.M = monitor;
}
public void run() {
for (int i = 0; i < 5; i++) {
M.Start_Read(i);
System.out.println("Reader está lendo " + i);
M.End_Read(i);
}
}
} | UTF-8 | Java | 377 | java | Reader.java | Java | [] | null | [] | package quest2;
public class Reader extends Thread {
private Monitor M;
public Reader(String name, Monitor monitor) {
super(name);
this.M = monitor;
}
public void run() {
for (int i = 0; i < 5; i++) {
M.Start_Read(i);
System.out.println("Reader está lendo " + i);
M.End_Read(i);
}
}
} | 377 | 0.507979 | 0.5 | 19 | 18.842106 | 16.896786 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.526316 | false | false | 1 |
661756255bd2a19d4ec3a12aebf784b3807eb202 | 19,774,029,462,335 | ce4a48b2cf89ef33cc193ff950719ebf5bd6cf34 | /yrb-common/src/main/java/com/lixiang/ssm/quartz/job/PlatformCountJob.java | c6dc94144254e46b52bff42fe5391439556e2f37 | [] | no_license | lixiang-agent/yrb | https://github.com/lixiang-agent/yrb | a7c38207546a0130bda634b2afbbc9971f90b6fa | 7021a4d358f25642fb4aef3c15116667ec8105f0 | refs/heads/master | 2020-03-17T09:16:54.949000 | 2018-05-24T01:37:50 | 2018-05-24T01:37:50 | 133,468,296 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lixiang.ssm.quartz.job;
import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;
import com.lixiang.ssm.redis.RedisUtil;
/**
* 计算平台总数的任务
* 1.计算总投资数
* 2.计算平台注册的总人数
* 3.计算平台总收入
* 4.计算平台的总收益
* @author YI
*
*/
public class PlatformCountJob implements Job{
protected Logger log = Logger.getLogger(PlatformCountJob.class);
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
//获取IOC容器
WebApplicationContext wac = ContextLoader.getCurrentWebApplicationContext();
//获取IOC容器里面的bean
RedisUtil util = wac.getBean(RedisUtil.class);
System.out.println(util);
log.debug("开会执行计算平台总数的任务,当前时间:"+System.currentTimeMillis());
System.out.println("执行任务......");
log.debug("计算平台总数的任务结束,当前时间:"+System.currentTimeMillis());
}
}
| UTF-8 | Java | 1,202 | java | PlatformCountJob.java | Java | [
{
"context": "算平台注册的总人数\r\n * 3.计算平台总收入\r\n * 4.计算平台的总收益\r\n * @author YI\r\n *\r\n */\r\npublic class PlatformCountJob implemen",
"end": 431,
"score": 0.4986044466495514,
"start": 430,
"tag": "NAME",
"value": "Y"
},
{
"context": "台注册的总人数\r\n * 3.计算平台总收入\r\n * 4.计算平台的总收益\r\n * @autho... | null | [] | package com.lixiang.ssm.quartz.job;
import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;
import com.lixiang.ssm.redis.RedisUtil;
/**
* 计算平台总数的任务
* 1.计算总投资数
* 2.计算平台注册的总人数
* 3.计算平台总收入
* 4.计算平台的总收益
* @author YI
*
*/
public class PlatformCountJob implements Job{
protected Logger log = Logger.getLogger(PlatformCountJob.class);
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
//获取IOC容器
WebApplicationContext wac = ContextLoader.getCurrentWebApplicationContext();
//获取IOC容器里面的bean
RedisUtil util = wac.getBean(RedisUtil.class);
System.out.println(util);
log.debug("开会执行计算平台总数的任务,当前时间:"+System.currentTimeMillis());
System.out.println("执行任务......");
log.debug("计算平台总数的任务结束,当前时间:"+System.currentTimeMillis());
}
}
| 1,202 | 0.741245 | 0.736381 | 39 | 24.358974 | 24.079449 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.076923 | false | false | 1 |
2676e02874effd95828287bacd1fce05e13778a5 | 23,063,974,380,722 | 39822bfe674a4ff06528d60552d2cf88ed24b8e7 | /src/main/java/net/sourceforge/fenixedu/domain/resource/ResourceAllocation.java | 62c64b674816e5c143c495f2092bb467ad4c7e35 | [] | no_license | carlosmahumane/fenix | https://github.com/carlosmahumane/fenix | 04d54025247782cf1595b71a6bda7acedc5906a3 | 874f8571eb4737b8f1525072ad7bd8cbd2c61335 | refs/heads/master | 2021-01-24T20:32:52.108000 | 2014-05-01T01:47:41 | 2014-05-01T01:47:41 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.sourceforge.fenixedu.domain.resource;
import net.sourceforge.fenixedu.domain.exceptions.DomainException;
import org.fenixedu.bennu.core.domain.Bennu;
public abstract class ResourceAllocation extends ResourceAllocation_Base {
protected ResourceAllocation() {
super();
setRootDomainObject(Bennu.getInstance());
}
public void delete() {
super.setResource(null);
setRootDomainObject(null);
super.deleteDomainObject();
}
@Override
public void setResource(Resource resource) {
if (resource == null) {
throw new DomainException("error.allocation.no.space");
}
super.setResource(resource);
}
public boolean isSpaceOccupation() {
return false;
}
public boolean isVehicleAllocation() {
return false;
}
public boolean isPersonSpaceOccupation() {
return false;
}
public boolean isMaterialSpaceOccupation() {
return false;
}
public boolean isExtensionSpaceOccupation() {
return false;
}
public boolean isUnitSpaceOccupation() {
return false;
}
public boolean isEventSpaceOccupation() {
return false;
}
public boolean isGenericEventSpaceOccupation() {
return false;
}
public boolean isWrittenEvaluationSpaceOccupation() {
return false;
}
public boolean isLessonSpaceOccupation() {
return false;
}
public boolean isLessonInstanceSpaceOccupation() {
return false;
}
public boolean isNotLessonSpaceOccupation() {
return isLessonInstanceSpaceOccupation() || isLessonSpaceOccupation();
}
@Deprecated
public boolean hasResource() {
return getResource() != null;
}
@Deprecated
public boolean hasBennu() {
return getRootDomainObject() != null;
}
}
| UTF-8 | Java | 1,895 | java | ResourceAllocation.java | Java | [] | null | [] | package net.sourceforge.fenixedu.domain.resource;
import net.sourceforge.fenixedu.domain.exceptions.DomainException;
import org.fenixedu.bennu.core.domain.Bennu;
public abstract class ResourceAllocation extends ResourceAllocation_Base {
protected ResourceAllocation() {
super();
setRootDomainObject(Bennu.getInstance());
}
public void delete() {
super.setResource(null);
setRootDomainObject(null);
super.deleteDomainObject();
}
@Override
public void setResource(Resource resource) {
if (resource == null) {
throw new DomainException("error.allocation.no.space");
}
super.setResource(resource);
}
public boolean isSpaceOccupation() {
return false;
}
public boolean isVehicleAllocation() {
return false;
}
public boolean isPersonSpaceOccupation() {
return false;
}
public boolean isMaterialSpaceOccupation() {
return false;
}
public boolean isExtensionSpaceOccupation() {
return false;
}
public boolean isUnitSpaceOccupation() {
return false;
}
public boolean isEventSpaceOccupation() {
return false;
}
public boolean isGenericEventSpaceOccupation() {
return false;
}
public boolean isWrittenEvaluationSpaceOccupation() {
return false;
}
public boolean isLessonSpaceOccupation() {
return false;
}
public boolean isLessonInstanceSpaceOccupation() {
return false;
}
public boolean isNotLessonSpaceOccupation() {
return isLessonInstanceSpaceOccupation() || isLessonSpaceOccupation();
}
@Deprecated
public boolean hasResource() {
return getResource() != null;
}
@Deprecated
public boolean hasBennu() {
return getRootDomainObject() != null;
}
}
| 1,895 | 0.649077 | 0.649077 | 86 | 21.034883 | 21.104639 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.302326 | false | false | 1 |
6e318f0924e55f3146982ed914507711d741240a | 15,942,918,603,205 | 9aa94f8e5b7bfbb41516bf14459898ae7cb25dda | /src/main/java/Objects/Seed.java | ccf291a6240b6abb3540e47590bc21a061b72002 | [] | no_license | paolaos/SEP_IoC-Implementation | https://github.com/paolaos/SEP_IoC-Implementation | 86f6e67bb5e448a6d354ab40cd52bdadfa81414d | 4a985c89e911ca934309f7f2b0d4819ad6f69329 | refs/heads/master | 2021-07-05T09:11:18.054000 | 2017-10-02T03:10:36 | 2017-10-02T03:10:36 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Objects;
/**
* Created by Paola Ortega S on 9/17/2017.
*/
/**
* A seed consists of a dependency from a Grape. One grape can have multiple seeds.
*/
public class Seed {
/**
* The type of object that will be used.
*/
private Class seedClass;
/**
* The name that *this will be referenced as by both the user and the program
*/
private String id;
/**
* The instance that is stored
*/
private Object value;
private boolean isRef;
private boolean isCons;
public Seed(){
seedClass = null;
id = "";
value = null;
isRef = false;
isCons=false;
}
public void setSeedClass(Class seedClass) {
this.seedClass = seedClass;
}
public void setId(String id) {
this.id = id;
}
public void setValue(Object value) {
this.value = value;
}
public void setIsConstructor(boolean cons){
isCons =cons;
}
public void setRef(boolean ref) {
isRef = ref;
}
public Class getSeedClass() {
return seedClass;
}
public String getId(){
return id;
}
public Object getValue(){
return value;
}
public boolean isConstructor(){
return isCons;
}
public boolean isRef(){
return isRef;
}
}
| UTF-8 | Java | 1,342 | java | Seed.java | Java | [
{
"context": "package Objects;\n\n/**\n * Created by Paola Ortega S on 9/17/2017.\n */\n\n/**\n * A seed consists of a de",
"end": 50,
"score": 0.9998772740364075,
"start": 36,
"tag": "NAME",
"value": "Paola Ortega S"
}
] | null | [] | package Objects;
/**
* Created by <NAME> on 9/17/2017.
*/
/**
* A seed consists of a dependency from a Grape. One grape can have multiple seeds.
*/
public class Seed {
/**
* The type of object that will be used.
*/
private Class seedClass;
/**
* The name that *this will be referenced as by both the user and the program
*/
private String id;
/**
* The instance that is stored
*/
private Object value;
private boolean isRef;
private boolean isCons;
public Seed(){
seedClass = null;
id = "";
value = null;
isRef = false;
isCons=false;
}
public void setSeedClass(Class seedClass) {
this.seedClass = seedClass;
}
public void setId(String id) {
this.id = id;
}
public void setValue(Object value) {
this.value = value;
}
public void setIsConstructor(boolean cons){
isCons =cons;
}
public void setRef(boolean ref) {
isRef = ref;
}
public Class getSeedClass() {
return seedClass;
}
public String getId(){
return id;
}
public Object getValue(){
return value;
}
public boolean isConstructor(){
return isCons;
}
public boolean isRef(){
return isRef;
}
}
| 1,334 | 0.563338 | 0.558122 | 76 | 16.657894 | 17.382351 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.276316 | false | false | 1 |
857385595b22690bd4336a0d95bf40a0b2c08ce9 | 17,051,020,233,876 | a693e3b461e008ef369efa4e3113bada73c5a81f | /miniSCADA/app/src/main/java/com/example/application/miniSCADA/Globals.java | 3ec769af75ca46fecb4b341f55efd51407bf09bd | [] | no_license | ambro01/miniSCADA-for-Android | https://github.com/ambro01/miniSCADA-for-Android | 24e450ab949a2dbb268526b4632bf79f3a591a4b | 462e23a4b3711f1c7e9cf263d35fac77190bad9b | refs/heads/master | 2020-05-21T07:05:22.052000 | 2017-03-28T22:52:15 | 2017-03-28T22:52:15 | 84,591,539 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.application.miniSCADA;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.widget.ImageView;
import java.io.IOException;
import java.io.InputStream;
import Moka7.S7Client;
public class Globals {
public static S7Client s7client = new S7Client();
public static DisplayMetrics displayMetrics;
public static final int posX = 450;
public static final int posY = 150;
public static final int buttonHeight = 50;
public static final int buttonWidth = 100;
public static final int circleDiameter = 50;
public static final int elementSide = 100;
<<<<<<< HEAD
public static final int analogHeight = 25;
public static final int analogWidth = 80;
=======
public static final int popupHeight = 200;
public static final int popupWidth = 400;
>>>>>>> 78fea71660cc1a62ca2ca6efd4e809b224f1afc2
public static void loadImage (Context context, ImageView image, String name){
try {
InputStream ims = context.getAssets().open(name);
Drawable d = Drawable.createFromStream(ims, null);
image.setImageDrawable(d);
}
catch(IOException ex) {
return;
}
}
public static Drawable loadImageToDrawable(Context context, String name){
try {
InputStream ims = context.getAssets().open(name);
return Drawable.createFromStream(ims, null);
}
catch(IOException ex) {
return null;
}
}
public static int dptoPx(int dp){
return Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));
}
}
| UTF-8 | Java | 1,633 | java | Globals.java | Java | [] | null | [] | package com.example.application.miniSCADA;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.widget.ImageView;
import java.io.IOException;
import java.io.InputStream;
import Moka7.S7Client;
public class Globals {
public static S7Client s7client = new S7Client();
public static DisplayMetrics displayMetrics;
public static final int posX = 450;
public static final int posY = 150;
public static final int buttonHeight = 50;
public static final int buttonWidth = 100;
public static final int circleDiameter = 50;
public static final int elementSide = 100;
<<<<<<< HEAD
public static final int analogHeight = 25;
public static final int analogWidth = 80;
=======
public static final int popupHeight = 200;
public static final int popupWidth = 400;
>>>>>>> 78fea71660cc1a62ca2ca6efd4e809b224f1afc2
public static void loadImage (Context context, ImageView image, String name){
try {
InputStream ims = context.getAssets().open(name);
Drawable d = Drawable.createFromStream(ims, null);
image.setImageDrawable(d);
}
catch(IOException ex) {
return;
}
}
public static Drawable loadImageToDrawable(Context context, String name){
try {
InputStream ims = context.getAssets().open(name);
return Drawable.createFromStream(ims, null);
}
catch(IOException ex) {
return null;
}
}
public static int dptoPx(int dp){
return Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));
}
}
| 1,633 | 0.698102 | 0.666258 | 53 | 29.811321 | 22.30666 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.622642 | false | false | 1 |
b535c306e6250755311b8b32d3fd72162bfb87f0 | 14,697,378,155,986 | cfe142a5883d4f7e9a10a7235d7abea5f1bb2be2 | /Main11805.java | 0889f434129ba6d74573c73bd26afdb72e64dd0e | [] | no_license | luisligunas/UVA-Solutions | https://github.com/luisligunas/UVA-Solutions | 6b4849abded256e4eb0d86c08ca74bb30ac65b3c | 450c8fecce63499b884ffcb7ef5dbf78e62566d0 | refs/heads/master | 2020-06-13T05:38:34.571000 | 2018-10-12T12:07:56 | 2018-10-12T12:07:56 | 75,486,374 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.*;
public class Main11805 {
public static void main(String[] args) {
Scanner rennacS = new Scanner(System.in);
int tC = rennacS.nextInt();
for(int z = 0; z < tC; z++) {
int players = rennacS.nextInt();
int start = rennacS.nextInt();
int passes = rennacS.nextInt();
int out = (start + passes)%players;
if(out == 0) out = players;
System.out.println("Case " + (z+1) + ": " + out);
}
}
} | UTF-8 | Java | 558 | java | Main11805.java | Java | [] | null | [] | import java.util.*;
public class Main11805 {
public static void main(String[] args) {
Scanner rennacS = new Scanner(System.in);
int tC = rennacS.nextInt();
for(int z = 0; z < tC; z++) {
int players = rennacS.nextInt();
int start = rennacS.nextInt();
int passes = rennacS.nextInt();
int out = (start + passes)%players;
if(out == 0) out = players;
System.out.println("Case " + (z+1) + ": " + out);
}
}
} | 558 | 0.467742 | 0.453405 | 20 | 26.950001 | 18.526939 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.55 | false | false | 1 |
24a455ddd25787ee481675c40ac2515d75f62bdd | 19,378,892,448,450 | 02e12ecc03acbde403ff0eab53377b86ae2e0031 | /d2/src/main/java/com/linkedin/d2/discovery/stores/zk/ZooKeeper.java | a78f6a63f2c3790c2c178051324131f01b25d529 | [
"Apache-2.0"
] | permissive | linkedin/rest.li | https://github.com/linkedin/rest.li | c9fd54b64c66e17f80f8263ed994d48e36816c7c | 74f51f5bc61ad679af4a5a27e547e6503fd3e574 | refs/heads/master | 2023-08-30T21:08:54.752000 | 2023-08-26T01:05:48 | 2023-08-26T01:05:48 | 6,944,525 | 1,859 | 509 | NOASSERTION | false | 2023-09-11T16:46:17 | 2012-11-30T19:37:51 | 2023-09-08T16:36:29 | 2023-09-11T16:46:16 | 26,620 | 2,346 | 543 | 94 | Java | false | false | /*
Copyright (c) 2014 LinkedIn Corp.
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.linkedin.d2.discovery.stores.zk;
import org.apache.zookeeper.AsyncCallback;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper.States;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Stat;
import java.util.List;
/**
* An interface that abstracts the {@link org.apache.zookeeper.ZooKeeper}.
*
* @author Ang Xu
* @version $Revision: $
*/
public interface ZooKeeper
{
/**
* The session id for this ZooKeeper client instance. The value returned is
* not valid until the client connects to a server and may change after a
* re-connect.
*
* This method is NOT thread safe
*
* @return current session id
*/
public long getSessionId();
/**
* The session password for this ZooKeeper client instance. The value
* returned is not valid until the client connects to a server and may
* change after a re-connect.
*
* This method is NOT thread safe
*
* @return current session password
*/
public byte[] getSessionPasswd();
/**
* The negotiated session timeout for this ZooKeeper client instance. The
* value returned is not valid until the client connects to a server and
* may change after a re-connect.
*
* This method is NOT thread safe
*
* @return current session timeout
*/
public int getSessionTimeout();
/**
* Add the specified scheme:auth information to this connection.
*
* This method is NOT thread safe
*
* @param scheme
* @param auth
*/
public void addAuthInfo(String scheme, byte auth[]);
/**
* Specify the default watcher for the connection (overrides the one
* specified during construction).
*
* @param watcher
*/
public void register(Watcher watcher);
/**
* Close this client object. Once the client is closed, its session becomes
* invalid. All the ephemeral nodes in the ZooKeeper server associated with
* the session will be removed. The watches left on those nodes (and on
* their parents) will be triggered.
*
* @throws InterruptedException
*/
public void close() throws InterruptedException;
/**
* Create a node with the given path. The node data will be the given data,
* and node acl will be the given acl.
* <p>
* The flags argument specifies whether the created node will be ephemeral
* or not.
* <p>
* An ephemeral node will be removed by the ZooKeeper automatically when the
* session associated with the creation of the node expires.
* <p>
* The flags argument can also specify to create a sequential node. The
* actual path name of a sequential node will be the given path plus a
* suffix "i" where i is the current sequential number of the node. The sequence
* number is always fixed length of 10 digits, 0 padded. Once
* such a node is created, the sequential number will be incremented by one.
* <p>
* If a node with the same actual path already exists in the ZooKeeper, a
* KeeperException with error code KeeperException.NodeExists will be
* thrown. Note that since a different actual path is used for each
* invocation of creating sequential node with the same path argument, the
* call will never throw "file exists" KeeperException.
* <p>
* If the parent node does not exist in the ZooKeeper, a KeeperException
* with error code KeeperException.NoNode will be thrown.
* <p>
* An ephemeral node cannot have children. If the parent node of the given
* path is ephemeral, a KeeperException with error code
* KeeperException.NoChildrenForEphemerals will be thrown.
* <p>
* This operation, if successful, will trigger all the watches left on the
* node of the given path by exists and getData API calls, and the watches
* left on the parent node by getChildren API calls.
* <p>
* If a node is created successfully, the ZooKeeper server will trigger the
* watches on the path left by exists calls, and the watches on the parent
* of the node by getChildren calls.
* <p>
* The maximum allowable size of the data array is 1 MB (1,048,576 bytes).
* Arrays larger than this will cause a KeeperExecption to be thrown.
*
* @param path
* the path for the node
* @param data
* the initial data for the node
* @param acl
* the acl for the node
* @param createMode
* specifying whether the node to be created is ephemeral
* and/or sequential
* @return the actual path of the created node
* @throws org.apache.zookeeper.KeeperException if the server returns a non-zero error code
* @throws org.apache.zookeeper.KeeperException.InvalidACLException if the ACL is invalid, null, or empty
* @throws InterruptedException if the transaction is interrupted
* @throws IllegalArgumentException if an invalid path is specified
*/
public String create(final String path, byte data[], List<ACL> acl, CreateMode createMode)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of create. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #create(String, byte[], List, CreateMode)
*/
public void create(final String path, byte data[], List<ACL> acl,
CreateMode createMode, AsyncCallback.StringCallback cb, Object ctx);
/**
* Delete the node with the given path. The call will succeed if such a node
* exists, and the given version matches the node's version (if the given
* version is -1, it matches any node's versions).
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if the nodes does not exist.
* <p>
* A KeeperException with error code KeeperException.BadVersion will be
* thrown if the given version does not match the node's version.
* <p>
* A KeeperException with error code KeeperException.NotEmpty will be thrown
* if the node has children.
* <p>
* This operation, if successful, will trigger all the watches on the node
* of the given path left by exists API calls, and the watches on the parent
* node left by getChildren API calls.
*
* @param path
* the path of the node to be deleted.
* @param version
* the expected node version.
* @throws InterruptedException IF the server transaction is interrupted
* @throws KeeperException If the server signals an error with a non-zero
* return code.
* @throws IllegalArgumentException if an invalid path is specified
*/
public void delete(final String path, int version)
throws InterruptedException, KeeperException;
/**
* The Asynchronous version of delete. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #delete(String, int)
*/
public void delete(final String path, int version, AsyncCallback.VoidCallback cb,
Object ctx);
/**
* Return the stat of the node of the given path. Return null if no such a
* node exists.
* <p>
* If the watch is non-null and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch will be
* triggered by a successful operation that creates/delete the node or sets
* the data on the node.
*
* @param path the node path
* @param watcher explicit watcher
* @return the stat of the node of the given path; return null if no such a
* node exists.
* @throws KeeperException If the server signals an error
* @throws InterruptedException If the server transaction is interrupted.
* @throws IllegalArgumentException if an invalid path is specified
*/
public Stat exists(final String path, Watcher watcher)
throws KeeperException, InterruptedException;
/**
* Return the stat of the node of the given path. Return null if no such a
* node exists.
* <p>
* If the watch is true and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch will be
* triggered by a successful operation that creates/delete the node or sets
* the data on the node.
*
* @param path
* the node path
* @param watch
* whether need to watch this node
* @return the stat of the node of the given path; return null if no such a
* node exists.
* @throws KeeperException If the server signals an error
* @throws InterruptedException If the server transaction is interrupted.
*/
public Stat exists(String path, boolean watch) throws KeeperException,
InterruptedException;
/**
* The Asynchronous version of exists. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #exists(String, boolean)
*/
public void exists(final String path, Watcher watcher,
AsyncCallback.StatCallback cb, Object ctx);
/**
* The Asynchronous version of exists. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #exists(String, boolean)
*/
public void exists(String path, boolean watch, AsyncCallback.StatCallback cb, Object ctx);
/**
* Return the data and the stat of the node of the given path.
* <p>
* If the watch is non-null and the call is successful (no exception is
* thrown), a watch will be left on the node with the given path. The watch
* will be triggered by a successful operation that sets data on the node, or
* deletes the node.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @param path the given path
* @param watcher explicit watcher
* @param stat the stat of the node
* @return the data of the node
* @throws KeeperException If the server signals an error with a non-zero error code
* @throws InterruptedException If the server transaction is interrupted.
* @throws IllegalArgumentException if an invalid path is specified
*/
public byte[] getData(final String path, Watcher watcher, Stat stat)
throws KeeperException, InterruptedException;
/**
* Return the data and the stat of the node of the given path.
* <p>
* If the watch is true and the call is successful (no exception is
* thrown), a watch will be left on the node with the given path. The watch
* will be triggered by a successful operation that sets data on the node, or
* deletes the node.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @param path the given path
* @param watch whether need to watch this node
* @param stat the stat of the node
* @return the data of the node
* @throws KeeperException If the server signals an error with a non-zero error code
* @throws InterruptedException If the server transaction is interrupted.
*/
public byte[] getData(String path, boolean watch, Stat stat)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of getData. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #getData(String, Watcher, Stat)
*/
public void getData(final String path, Watcher watcher,
AsyncCallback.DataCallback cb, Object ctx);
/**
* The Asynchronous version of getData. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #getData(String, boolean, Stat)
*/
public void getData(String path, boolean watch, AsyncCallback.DataCallback cb, Object ctx);
/**
* Set the data for the node of the given path if such a node exists and the
* given version matches the version of the node (if the given version is
* -1, it matches any node's versions). Return the stat of the node.
* <p>
* This operation, if successful, will trigger all the watches on the node
* of the given path left by getData calls.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
* <p>
* A KeeperException with error code KeeperException.BadVersion will be
* thrown if the given version does not match the node's version.
* <p>
* The maximum allowable size of the data array is 1 MB (1,048,576 bytes).
* Arrays larger than this will cause a KeeperExecption to be thrown.
*
* @param path
* the path of the node
* @param data
* the data to set
* @param version
* the expected matching version
* @return the state of the node
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
* @throws IllegalArgumentException if an invalid path is specified
*/
public Stat setData(final String path, byte data[], int version)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of setData. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #setData(String, byte[], int)
*/
public void setData(final String path, byte data[], int version,
AsyncCallback.StatCallback cb, Object ctx);
/**
* Return the ACL and stat of the node of the given path.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @param path
* the given path for the node
* @param stat
* the stat of the node will be copied to this parameter.
* @return the ACL array of the given node.
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
* @throws IllegalArgumentException if an invalid path is specified
*/
public List<ACL> getACL(final String path, Stat stat)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of getACL. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #getACL(String, Stat)
*/
public void getACL(final String path, Stat stat, AsyncCallback.ACLCallback cb,
Object ctx);
/**
* Set the ACL for the node of the given path if such a node exists and the
* given version matches the version of the node. Return the stat of the
* node.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
* <p>
* A KeeperException with error code KeeperException.BadVersion will be
* thrown if the given version does not match the node's version.
*
* @param path
* @param acl
* @param version
* @return the stat of the node.
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
* @throws org.apache.zookeeper.KeeperException.InvalidACLException If the acl is invalide.
* @throws IllegalArgumentException if an invalid path is specified
*/
public Stat setACL(final String path, List<ACL> acl, int version)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of setACL. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #setACL(String, List, int)
*/
public void setACL(final String path, List<ACL> acl, int version,
AsyncCallback.StatCallback cb, Object ctx);
/**
* Return the list of the children of the node of the given path.
* <p>
* If the watch is non-null and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch willbe
* triggered by a successful operation that deletes the node of the given
* path or creates/delete a child under the node.
* <p>
* The list of children returned is not sorted and no guarantee is provided
* as to its natural or lexical order.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @param path
* @param watcher explicit watcher
* @return an unordered array of children of the node with the given path
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
* @throws IllegalArgumentException if an invalid path is specified
*/
public List<String> getChildren(final String path, Watcher watcher)
throws KeeperException, InterruptedException;
/**
* Return the list of the children of the node of the given path.
* <p>
* If the watch is true and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch willbe
* triggered by a successful operation that deletes the node of the given
* path or creates/delete a child under the node.
* <p>
* The list of children returned is not sorted and no guarantee is provided
* as to its natural or lexical order.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @param path
* @param watch
* @return an unordered array of children of the node with the given path
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
*/
public List<String> getChildren(String path, boolean watch)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of getChildren. The request doesn't actually
* until the asynchronous callback is called.
*
* @see #getChildren(String, Watcher)
*/
public void getChildren(final String path, Watcher watcher,
AsyncCallback.ChildrenCallback cb, Object ctx);
/**
* The Asynchronous version of getChildren. The request doesn't actually
* until the asynchronous callback is called.
*
* @see #getChildren(String, boolean)
*/
public void getChildren(String path, boolean watch, AsyncCallback.ChildrenCallback cb,
Object ctx);
/**
* For the given znode path return the stat and children list.
* <p>
* If the watch is non-null and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch willbe
* triggered by a successful operation that deletes the node of the given
* path or creates/delete a child under the node.
* <p>
* The list of children returned is not sorted and no guarantee is provided
* as to its natural or lexical order.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @since 3.3.0
*
* @param path
* @param watcher explicit watcher
* @param stat stat of the znode designated by path
* @return an unordered array of children of the node with the given path
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
* @throws IllegalArgumentException if an invalid path is specified
*/
public List<String> getChildren(final String path, Watcher watcher,
Stat stat)
throws KeeperException, InterruptedException;
/**
* For the given znode path return the stat and children list.
* <p>
* If the watch is true and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch willbe
* triggered by a successful operation that deletes the node of the given
* path or creates/delete a child under the node.
* <p>
* The list of children returned is not sorted and no guarantee is provided
* as to its natural or lexical order.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @since 3.3.0
*
* @param path
* @param watch
* @param stat stat of the znode designated by path
* @return an unordered array of children of the node with the given path
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero
* error code.
*/
public List<String> getChildren(String path, boolean watch, Stat stat)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of getChildren. The request doesn't actually
* until the asynchronous callback is called.
*
* @since 3.3.0
*
* @see #getChildren(String, Watcher, Stat)
*/
public void getChildren(final String path, Watcher watcher,
AsyncCallback.Children2Callback cb, Object ctx);
/**
* The Asynchronous version of getChildren. The request doesn't actually
* until the asynchronous callback is called.
*
* @since 3.3.0
*
* @see #getChildren(String, boolean, Stat)
*/
public void getChildren(String path, boolean watch, AsyncCallback.Children2Callback cb,
Object ctx);
/**
* Asynchronous sync. Flushes channel between process and leader.
* @param path
* @param cb a handler for the callback
* @param ctx context to be provided to the callback
* @throws IllegalArgumentException if an invalid path is specified
*/
public void sync(final String path, AsyncCallback.VoidCallback cb, Object ctx);
public States getState();
}
| UTF-8 | Java | 22,628 | java | ZooKeeper.java | Java | [
{
"context": "ink org.apache.zookeeper.ZooKeeper}.\n *\n * @author Ang Xu\n * @version $Revision: $\n */\npublic interface Zoo",
"end": 1054,
"score": 0.9996482729911804,
"start": 1048,
"tag": "NAME",
"value": "Ang Xu"
}
] | null | [] | /*
Copyright (c) 2014 LinkedIn Corp.
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.linkedin.d2.discovery.stores.zk;
import org.apache.zookeeper.AsyncCallback;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper.States;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Stat;
import java.util.List;
/**
* An interface that abstracts the {@link org.apache.zookeeper.ZooKeeper}.
*
* @author <NAME>
* @version $Revision: $
*/
public interface ZooKeeper
{
/**
* The session id for this ZooKeeper client instance. The value returned is
* not valid until the client connects to a server and may change after a
* re-connect.
*
* This method is NOT thread safe
*
* @return current session id
*/
public long getSessionId();
/**
* The session password for this ZooKeeper client instance. The value
* returned is not valid until the client connects to a server and may
* change after a re-connect.
*
* This method is NOT thread safe
*
* @return current session password
*/
public byte[] getSessionPasswd();
/**
* The negotiated session timeout for this ZooKeeper client instance. The
* value returned is not valid until the client connects to a server and
* may change after a re-connect.
*
* This method is NOT thread safe
*
* @return current session timeout
*/
public int getSessionTimeout();
/**
* Add the specified scheme:auth information to this connection.
*
* This method is NOT thread safe
*
* @param scheme
* @param auth
*/
public void addAuthInfo(String scheme, byte auth[]);
/**
* Specify the default watcher for the connection (overrides the one
* specified during construction).
*
* @param watcher
*/
public void register(Watcher watcher);
/**
* Close this client object. Once the client is closed, its session becomes
* invalid. All the ephemeral nodes in the ZooKeeper server associated with
* the session will be removed. The watches left on those nodes (and on
* their parents) will be triggered.
*
* @throws InterruptedException
*/
public void close() throws InterruptedException;
/**
* Create a node with the given path. The node data will be the given data,
* and node acl will be the given acl.
* <p>
* The flags argument specifies whether the created node will be ephemeral
* or not.
* <p>
* An ephemeral node will be removed by the ZooKeeper automatically when the
* session associated with the creation of the node expires.
* <p>
* The flags argument can also specify to create a sequential node. The
* actual path name of a sequential node will be the given path plus a
* suffix "i" where i is the current sequential number of the node. The sequence
* number is always fixed length of 10 digits, 0 padded. Once
* such a node is created, the sequential number will be incremented by one.
* <p>
* If a node with the same actual path already exists in the ZooKeeper, a
* KeeperException with error code KeeperException.NodeExists will be
* thrown. Note that since a different actual path is used for each
* invocation of creating sequential node with the same path argument, the
* call will never throw "file exists" KeeperException.
* <p>
* If the parent node does not exist in the ZooKeeper, a KeeperException
* with error code KeeperException.NoNode will be thrown.
* <p>
* An ephemeral node cannot have children. If the parent node of the given
* path is ephemeral, a KeeperException with error code
* KeeperException.NoChildrenForEphemerals will be thrown.
* <p>
* This operation, if successful, will trigger all the watches left on the
* node of the given path by exists and getData API calls, and the watches
* left on the parent node by getChildren API calls.
* <p>
* If a node is created successfully, the ZooKeeper server will trigger the
* watches on the path left by exists calls, and the watches on the parent
* of the node by getChildren calls.
* <p>
* The maximum allowable size of the data array is 1 MB (1,048,576 bytes).
* Arrays larger than this will cause a KeeperExecption to be thrown.
*
* @param path
* the path for the node
* @param data
* the initial data for the node
* @param acl
* the acl for the node
* @param createMode
* specifying whether the node to be created is ephemeral
* and/or sequential
* @return the actual path of the created node
* @throws org.apache.zookeeper.KeeperException if the server returns a non-zero error code
* @throws org.apache.zookeeper.KeeperException.InvalidACLException if the ACL is invalid, null, or empty
* @throws InterruptedException if the transaction is interrupted
* @throws IllegalArgumentException if an invalid path is specified
*/
public String create(final String path, byte data[], List<ACL> acl, CreateMode createMode)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of create. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #create(String, byte[], List, CreateMode)
*/
public void create(final String path, byte data[], List<ACL> acl,
CreateMode createMode, AsyncCallback.StringCallback cb, Object ctx);
/**
* Delete the node with the given path. The call will succeed if such a node
* exists, and the given version matches the node's version (if the given
* version is -1, it matches any node's versions).
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if the nodes does not exist.
* <p>
* A KeeperException with error code KeeperException.BadVersion will be
* thrown if the given version does not match the node's version.
* <p>
* A KeeperException with error code KeeperException.NotEmpty will be thrown
* if the node has children.
* <p>
* This operation, if successful, will trigger all the watches on the node
* of the given path left by exists API calls, and the watches on the parent
* node left by getChildren API calls.
*
* @param path
* the path of the node to be deleted.
* @param version
* the expected node version.
* @throws InterruptedException IF the server transaction is interrupted
* @throws KeeperException If the server signals an error with a non-zero
* return code.
* @throws IllegalArgumentException if an invalid path is specified
*/
public void delete(final String path, int version)
throws InterruptedException, KeeperException;
/**
* The Asynchronous version of delete. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #delete(String, int)
*/
public void delete(final String path, int version, AsyncCallback.VoidCallback cb,
Object ctx);
/**
* Return the stat of the node of the given path. Return null if no such a
* node exists.
* <p>
* If the watch is non-null and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch will be
* triggered by a successful operation that creates/delete the node or sets
* the data on the node.
*
* @param path the node path
* @param watcher explicit watcher
* @return the stat of the node of the given path; return null if no such a
* node exists.
* @throws KeeperException If the server signals an error
* @throws InterruptedException If the server transaction is interrupted.
* @throws IllegalArgumentException if an invalid path is specified
*/
public Stat exists(final String path, Watcher watcher)
throws KeeperException, InterruptedException;
/**
* Return the stat of the node of the given path. Return null if no such a
* node exists.
* <p>
* If the watch is true and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch will be
* triggered by a successful operation that creates/delete the node or sets
* the data on the node.
*
* @param path
* the node path
* @param watch
* whether need to watch this node
* @return the stat of the node of the given path; return null if no such a
* node exists.
* @throws KeeperException If the server signals an error
* @throws InterruptedException If the server transaction is interrupted.
*/
public Stat exists(String path, boolean watch) throws KeeperException,
InterruptedException;
/**
* The Asynchronous version of exists. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #exists(String, boolean)
*/
public void exists(final String path, Watcher watcher,
AsyncCallback.StatCallback cb, Object ctx);
/**
* The Asynchronous version of exists. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #exists(String, boolean)
*/
public void exists(String path, boolean watch, AsyncCallback.StatCallback cb, Object ctx);
/**
* Return the data and the stat of the node of the given path.
* <p>
* If the watch is non-null and the call is successful (no exception is
* thrown), a watch will be left on the node with the given path. The watch
* will be triggered by a successful operation that sets data on the node, or
* deletes the node.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @param path the given path
* @param watcher explicit watcher
* @param stat the stat of the node
* @return the data of the node
* @throws KeeperException If the server signals an error with a non-zero error code
* @throws InterruptedException If the server transaction is interrupted.
* @throws IllegalArgumentException if an invalid path is specified
*/
public byte[] getData(final String path, Watcher watcher, Stat stat)
throws KeeperException, InterruptedException;
/**
* Return the data and the stat of the node of the given path.
* <p>
* If the watch is true and the call is successful (no exception is
* thrown), a watch will be left on the node with the given path. The watch
* will be triggered by a successful operation that sets data on the node, or
* deletes the node.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @param path the given path
* @param watch whether need to watch this node
* @param stat the stat of the node
* @return the data of the node
* @throws KeeperException If the server signals an error with a non-zero error code
* @throws InterruptedException If the server transaction is interrupted.
*/
public byte[] getData(String path, boolean watch, Stat stat)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of getData. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #getData(String, Watcher, Stat)
*/
public void getData(final String path, Watcher watcher,
AsyncCallback.DataCallback cb, Object ctx);
/**
* The Asynchronous version of getData. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #getData(String, boolean, Stat)
*/
public void getData(String path, boolean watch, AsyncCallback.DataCallback cb, Object ctx);
/**
* Set the data for the node of the given path if such a node exists and the
* given version matches the version of the node (if the given version is
* -1, it matches any node's versions). Return the stat of the node.
* <p>
* This operation, if successful, will trigger all the watches on the node
* of the given path left by getData calls.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
* <p>
* A KeeperException with error code KeeperException.BadVersion will be
* thrown if the given version does not match the node's version.
* <p>
* The maximum allowable size of the data array is 1 MB (1,048,576 bytes).
* Arrays larger than this will cause a KeeperExecption to be thrown.
*
* @param path
* the path of the node
* @param data
* the data to set
* @param version
* the expected matching version
* @return the state of the node
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
* @throws IllegalArgumentException if an invalid path is specified
*/
public Stat setData(final String path, byte data[], int version)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of setData. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #setData(String, byte[], int)
*/
public void setData(final String path, byte data[], int version,
AsyncCallback.StatCallback cb, Object ctx);
/**
* Return the ACL and stat of the node of the given path.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @param path
* the given path for the node
* @param stat
* the stat of the node will be copied to this parameter.
* @return the ACL array of the given node.
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
* @throws IllegalArgumentException if an invalid path is specified
*/
public List<ACL> getACL(final String path, Stat stat)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of getACL. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #getACL(String, Stat)
*/
public void getACL(final String path, Stat stat, AsyncCallback.ACLCallback cb,
Object ctx);
/**
* Set the ACL for the node of the given path if such a node exists and the
* given version matches the version of the node. Return the stat of the
* node.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
* <p>
* A KeeperException with error code KeeperException.BadVersion will be
* thrown if the given version does not match the node's version.
*
* @param path
* @param acl
* @param version
* @return the stat of the node.
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
* @throws org.apache.zookeeper.KeeperException.InvalidACLException If the acl is invalide.
* @throws IllegalArgumentException if an invalid path is specified
*/
public Stat setACL(final String path, List<ACL> acl, int version)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of setACL. The request doesn't actually until
* the asynchronous callback is called.
*
* @see #setACL(String, List, int)
*/
public void setACL(final String path, List<ACL> acl, int version,
AsyncCallback.StatCallback cb, Object ctx);
/**
* Return the list of the children of the node of the given path.
* <p>
* If the watch is non-null and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch willbe
* triggered by a successful operation that deletes the node of the given
* path or creates/delete a child under the node.
* <p>
* The list of children returned is not sorted and no guarantee is provided
* as to its natural or lexical order.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @param path
* @param watcher explicit watcher
* @return an unordered array of children of the node with the given path
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
* @throws IllegalArgumentException if an invalid path is specified
*/
public List<String> getChildren(final String path, Watcher watcher)
throws KeeperException, InterruptedException;
/**
* Return the list of the children of the node of the given path.
* <p>
* If the watch is true and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch willbe
* triggered by a successful operation that deletes the node of the given
* path or creates/delete a child under the node.
* <p>
* The list of children returned is not sorted and no guarantee is provided
* as to its natural or lexical order.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @param path
* @param watch
* @return an unordered array of children of the node with the given path
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
*/
public List<String> getChildren(String path, boolean watch)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of getChildren. The request doesn't actually
* until the asynchronous callback is called.
*
* @see #getChildren(String, Watcher)
*/
public void getChildren(final String path, Watcher watcher,
AsyncCallback.ChildrenCallback cb, Object ctx);
/**
* The Asynchronous version of getChildren. The request doesn't actually
* until the asynchronous callback is called.
*
* @see #getChildren(String, boolean)
*/
public void getChildren(String path, boolean watch, AsyncCallback.ChildrenCallback cb,
Object ctx);
/**
* For the given znode path return the stat and children list.
* <p>
* If the watch is non-null and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch willbe
* triggered by a successful operation that deletes the node of the given
* path or creates/delete a child under the node.
* <p>
* The list of children returned is not sorted and no guarantee is provided
* as to its natural or lexical order.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @since 3.3.0
*
* @param path
* @param watcher explicit watcher
* @param stat stat of the znode designated by path
* @return an unordered array of children of the node with the given path
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero error code.
* @throws IllegalArgumentException if an invalid path is specified
*/
public List<String> getChildren(final String path, Watcher watcher,
Stat stat)
throws KeeperException, InterruptedException;
/**
* For the given znode path return the stat and children list.
* <p>
* If the watch is true and the call is successful (no exception is thrown),
* a watch will be left on the node with the given path. The watch willbe
* triggered by a successful operation that deletes the node of the given
* path or creates/delete a child under the node.
* <p>
* The list of children returned is not sorted and no guarantee is provided
* as to its natural or lexical order.
* <p>
* A KeeperException with error code KeeperException.NoNode will be thrown
* if no node with the given path exists.
*
* @since 3.3.0
*
* @param path
* @param watch
* @param stat stat of the znode designated by path
* @return an unordered array of children of the node with the given path
* @throws InterruptedException If the server transaction is interrupted.
* @throws KeeperException If the server signals an error with a non-zero
* error code.
*/
public List<String> getChildren(String path, boolean watch, Stat stat)
throws KeeperException, InterruptedException;
/**
* The Asynchronous version of getChildren. The request doesn't actually
* until the asynchronous callback is called.
*
* @since 3.3.0
*
* @see #getChildren(String, Watcher, Stat)
*/
public void getChildren(final String path, Watcher watcher,
AsyncCallback.Children2Callback cb, Object ctx);
/**
* The Asynchronous version of getChildren. The request doesn't actually
* until the asynchronous callback is called.
*
* @since 3.3.0
*
* @see #getChildren(String, boolean, Stat)
*/
public void getChildren(String path, boolean watch, AsyncCallback.Children2Callback cb,
Object ctx);
/**
* Asynchronous sync. Flushes channel between process and leader.
* @param path
* @param cb a handler for the callback
* @param ctx context to be provided to the callback
* @throws IllegalArgumentException if an invalid path is specified
*/
public void sync(final String path, AsyncCallback.VoidCallback cb, Object ctx);
public States getState();
}
| 22,628 | 0.697764 | 0.695819 | 574 | 38.421604 | 30.02844 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.327526 | false | false | 1 |
9ea12b74c0b58501ba879419e4e26ec8ca8152d8 | 8,177,617,773,945 | 8eb052bb4eb69dc231670d858fc65cd5198113ca | /src/test/java/io/artsoftware/timesheet/jdbc/JdbcTimeSheetTest.java | 5bcb25f2df104ab50399f6b6c383ef6f0717a178 | [
"Apache-2.0"
] | permissive | artsoftware-io/law-office-spring-learning-ref | https://github.com/artsoftware-io/law-office-spring-learning-ref | ef85a0160a4e02fd87ec64141363eadad7f55439 | 944ab2ba3bb5b9eaf81939f463de5a5d51306a3c | refs/heads/master | 2021-06-16T18:00:11.664000 | 2017-02-24T14:28:50 | 2017-02-24T14:28:50 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package io.artsoftware.timesheet.jdbc;
import io.artsoftware.jdbc.DatabaseSchema;
import io.artsoftware.jdbc.HsqldbDS;
import io.artsoftware.organization.Organization;
import io.artsoftware.organization.Organizations;
import io.artsoftware.organization.People;
import io.artsoftware.organization.Person;
import io.artsoftware.organization.jdbc.JdbcOrganizations;
import io.artsoftware.organization.jdbc.JdbcPeople;
import io.artsoftware.timesheet.Task;
import io.artsoftware.timesheet.Tasks;
import io.artsoftware.timesheet.TimeSheet;
import io.artsoftware.timesheet.TimeSpent;
import java.time.Duration;
import java.time.LocalDate;
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public final class JdbcTimeSheetTest {
private People people;
private Organizations organizations;
private Tasks tasks;
private TimeSheet timeSheet;
@Before
public void before() throws Exception {
final DataSource source = new HsqldbDS("tsrnts");
new DatabaseSchema(source, "db/changelog/db.changelog-master.yaml").createSchema();
this.people = new JdbcPeople(source);
this.organizations = new JdbcOrganizations(source);
this.tasks = new JdbcTasks(source);
this.timeSheet = new JdbcTimeSheet(source);
}
@Test
public void shouldRecordAnNewTimeSpent() throws Exception {
final Organization organization = this.organizations.addOrganization("Test Organization");
final Task task = this.tasks.addTask("Test task", organization);
final Person person = this.people.onBoard("emailggg@email.com");
organization.join(person);
final Duration amountTimeSpent = Duration.ZERO.plusHours(1).plusMinutes(5);
final TimeSpent timeSpent = this.timeSheet.recordTimeSpent(
person,
task,
amountTimeSpent,
LocalDate.now()
);
assertThat(timeSpent.toMap()).containsKeys("id", "task_id", "person_id", "amount_seconds", "day");
}
} | UTF-8 | Java | 2,092 | java | JdbcTimeSheetTest.java | Java | [
{
"context": " final Person person = this.people.onBoard(\"emailggg@email.com\");\n\n organization.join(person);\n\n f",
"end": 1675,
"score": 0.9881095886230469,
"start": 1657,
"tag": "EMAIL",
"value": "emailggg@email.com"
}
] | null | [] | package io.artsoftware.timesheet.jdbc;
import io.artsoftware.jdbc.DatabaseSchema;
import io.artsoftware.jdbc.HsqldbDS;
import io.artsoftware.organization.Organization;
import io.artsoftware.organization.Organizations;
import io.artsoftware.organization.People;
import io.artsoftware.organization.Person;
import io.artsoftware.organization.jdbc.JdbcOrganizations;
import io.artsoftware.organization.jdbc.JdbcPeople;
import io.artsoftware.timesheet.Task;
import io.artsoftware.timesheet.Tasks;
import io.artsoftware.timesheet.TimeSheet;
import io.artsoftware.timesheet.TimeSpent;
import java.time.Duration;
import java.time.LocalDate;
import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public final class JdbcTimeSheetTest {
private People people;
private Organizations organizations;
private Tasks tasks;
private TimeSheet timeSheet;
@Before
public void before() throws Exception {
final DataSource source = new HsqldbDS("tsrnts");
new DatabaseSchema(source, "db/changelog/db.changelog-master.yaml").createSchema();
this.people = new JdbcPeople(source);
this.organizations = new JdbcOrganizations(source);
this.tasks = new JdbcTasks(source);
this.timeSheet = new JdbcTimeSheet(source);
}
@Test
public void shouldRecordAnNewTimeSpent() throws Exception {
final Organization organization = this.organizations.addOrganization("Test Organization");
final Task task = this.tasks.addTask("Test task", organization);
final Person person = this.people.onBoard("<EMAIL>");
organization.join(person);
final Duration amountTimeSpent = Duration.ZERO.plusHours(1).plusMinutes(5);
final TimeSpent timeSpent = this.timeSheet.recordTimeSpent(
person,
task,
amountTimeSpent,
LocalDate.now()
);
assertThat(timeSpent.toMap()).containsKeys("id", "task_id", "person_id", "amount_seconds", "day");
}
} | 2,081 | 0.730402 | 0.729446 | 68 | 29.779411 | 27.148745 | 106 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.661765 | false | false | 1 |
c10501d70c5f99e7b475647590a416c2520676b3 | 22,153,441,327,598 | b2aa6c57a2dc2e1a5e4b2e0921e3eeae9ff4f75b | /star-framework-module/star-framework-module-common/src/main/java/com/star/truffle/common/config/StaticAutoConfig.java | 5cd7e4bf04201c0ed2c8d258f7a3bdca77d9ebd6 | [] | no_license | 284288787/star11 | https://github.com/284288787/star11 | 6a02f5105edc4003948427ebf3ceb4092e56b75d | 11cd39f36f0b717909f04503d5bcf2deeddf37fb | refs/heads/master | 2020-05-07T21:35:51.036000 | 2019-05-15T09:11:32 | 2019-05-15T09:11:32 | 180,907,824 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**create by liuhua at 2018年7月16日 下午4:25:07**/
package com.star.truffle.common.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan(basePackages = {
"com.star.truffle.common.service",
"com.star.truffle.common.controller",
"com.star.truffle.common.properties"
})
public class StaticAutoConfig {
}
| UTF-8 | Java | 422 | java | StaticAutoConfig.java | Java | [
{
"context": "/**create by liuhua at 2018年7月16日 下午4:25:07**/\npackage com.star.truff",
"end": 19,
"score": 0.9963901042938232,
"start": 13,
"tag": "USERNAME",
"value": "liuhua"
}
] | null | [] | /**create by liuhua at 2018年7月16日 下午4:25:07**/
package com.star.truffle.common.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan(basePackages = {
"com.star.truffle.common.service",
"com.star.truffle.common.controller",
"com.star.truffle.common.properties"
})
public class StaticAutoConfig {
}
| 422 | 0.791262 | 0.762136 | 15 | 26.466667 | 21.156139 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 1 |
3a884c2605f20274c360b2ec9404495cd4f85148 | 22,153,441,325,090 | f468cfcd2672ea112c8817904c113b5bf07370b5 | /src/main/java/utilities/excel_utility.java | 67756bd2751644db366f35cc7722bbefa55f71c4 | [] | no_license | Rashmikumari0809/DummyRepo | https://github.com/Rashmikumari0809/DummyRepo | cd9514b378aa757c844e1f254c5e1062f508c101 | fa739b0cf356e5369edeb6595f0f7bb9a19afb5e | refs/heads/master | 2020-09-05T09:16:02.920000 | 2019-11-10T15:14:25 | 2019-11-10T15:14:25 | 220,054,122 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package utilities;
import java.io.File;
import java.io.FileInputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.ss.usermodel.CellType;
public class excel_utility {
FileInputStream fis;
XSSFWorkbook wb;
XSSFSheet sh;
XSSFRow row;
XSSFCell cell;
excel_utility(String path)
{
try {
fis= new FileInputStream(new File(path));
wb= new XSSFWorkbook(fis);
}
catch(Exception e)
{
e.printStackTrace();
}
}
public int getRowCount(String Sheetname)
{
int rowcount=-1;
sh=wb.getSheet(Sheetname);
rowcount=sh.getPhysicalNumberOfRows();
return rowcount;
}
public int getColCount(String Sheetname)
{
int colcount=-1;
sh=wb.getSheet(Sheetname);
colcount=sh.getRow(0).getPhysicalNumberOfCells();
return colcount;
}
public String getCellValue(String SheetName,String ColName,int rowNum)
{
String cellValue=null;
int ColNum=-1;
row=sh.getRow(0);
for(int i=0;i<row.getPhysicalNumberOfCells();i++)
{
if(row.getCell(i).getStringCellValue().equalsIgnoreCase(ColName))
{
ColNum=i;
}
}
row=sh.getRow(rowNum-1);
cell=row.getCell(ColNum);
if(cell.getCellType()==CellType.STRING)
{
cellValue=cell.getStringCellValue();
}
if(cell.getCellType()==CellType.NUMERIC || cell.getCellType()==CellType.FORMULA)
{
cellValue= String.valueOf(cell.getNumericCellValue());
}
/* if(HSSFDateUtil.isCellDateFormatted(cell))
{
Date dt=cell.getDateCellValue();
SimpleDateFormat sd= new SimpleDateFormat("dd/mm/yy");
cellValue=sd.format(dt);
}*/
if(cell.getCellType()==CellType.BOOLEAN)
{
cellValue=String.valueOf(cell.getBooleanCellValue());
}
if(cell.getCellType()==CellType.BLANK) {
cellValue="";
}
return cellValue;
}
}
| UTF-8 | Java | 2,116 | java | excel_utility.java | Java | [] | null | [] | package utilities;
import java.io.File;
import java.io.FileInputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.ss.usermodel.CellType;
public class excel_utility {
FileInputStream fis;
XSSFWorkbook wb;
XSSFSheet sh;
XSSFRow row;
XSSFCell cell;
excel_utility(String path)
{
try {
fis= new FileInputStream(new File(path));
wb= new XSSFWorkbook(fis);
}
catch(Exception e)
{
e.printStackTrace();
}
}
public int getRowCount(String Sheetname)
{
int rowcount=-1;
sh=wb.getSheet(Sheetname);
rowcount=sh.getPhysicalNumberOfRows();
return rowcount;
}
public int getColCount(String Sheetname)
{
int colcount=-1;
sh=wb.getSheet(Sheetname);
colcount=sh.getRow(0).getPhysicalNumberOfCells();
return colcount;
}
public String getCellValue(String SheetName,String ColName,int rowNum)
{
String cellValue=null;
int ColNum=-1;
row=sh.getRow(0);
for(int i=0;i<row.getPhysicalNumberOfCells();i++)
{
if(row.getCell(i).getStringCellValue().equalsIgnoreCase(ColName))
{
ColNum=i;
}
}
row=sh.getRow(rowNum-1);
cell=row.getCell(ColNum);
if(cell.getCellType()==CellType.STRING)
{
cellValue=cell.getStringCellValue();
}
if(cell.getCellType()==CellType.NUMERIC || cell.getCellType()==CellType.FORMULA)
{
cellValue= String.valueOf(cell.getNumericCellValue());
}
/* if(HSSFDateUtil.isCellDateFormatted(cell))
{
Date dt=cell.getDateCellValue();
SimpleDateFormat sd= new SimpleDateFormat("dd/mm/yy");
cellValue=sd.format(dt);
}*/
if(cell.getCellType()==CellType.BOOLEAN)
{
cellValue=String.valueOf(cell.getBooleanCellValue());
}
if(cell.getCellType()==CellType.BLANK) {
cellValue="";
}
return cellValue;
}
}
| 2,116 | 0.68242 | 0.679112 | 94 | 21.510639 | 20.362535 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.531915 | false | false | 1 |
2b93248ef4cac3f4a2bd6e2304176255e9e274d6 | 17,695,265,291,791 | eff8ce68689f66bbc09724ba687da8b8edb0bed9 | /src/main/java/br/com/rodolfo/loja/repositories/EstadoRepository.java | 8eb6ec9abd52e64a16af364ea3522105f0fbf4b2 | [] | no_license | RodolfoHerman/modelo-conceitual-uml | https://github.com/RodolfoHerman/modelo-conceitual-uml | b98675a3aa4c1934a4946f886979e98b7d2334e2 | 86b95108c25b63f5862250c684eea28e3d517c5a | refs/heads/master | 2020-04-24T17:29:52.795000 | 2019-02-25T14:19:18 | 2019-02-25T14:19:18 | 172,149,347 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.com.rodolfo.loja.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import br.com.rodolfo.loja.domain.Estado;
/**
* EstadoRepository
*/
@Repository
public interface EstadoRepository extends JpaRepository<Estado, Integer>{
} | UTF-8 | Java | 320 | java | EstadoRepository.java | Java | [] | null | [] | package br.com.rodolfo.loja.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import br.com.rodolfo.loja.domain.Estado;
/**
* EstadoRepository
*/
@Repository
public interface EstadoRepository extends JpaRepository<Estado, Integer>{
} | 320 | 0.803125 | 0.803125 | 15 | 20.4 | 24.613817 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 1 |
937a073c51e3cc8480018ae0812ecc939b8eb218 | 18,983,755,488,571 | 88b8df90e40e6c23824d640172a0bb0af0716f54 | /ObjetosOnline/src/excepciones/AlumnoExitenteException.java | e61641c08eee30e4574898a3a6ac3ba4107e7eee | [] | no_license | ivan01A/Ordinario | https://github.com/ivan01A/Ordinario | 3c83d0d64b9376f9958e946e17c6181740db998f | babd8b8e760e2c4635056e9e6ae6c68f7a1dbe3c | refs/heads/master | 2022-11-10T05:10:35.462000 | 2020-06-09T18:14:27 | 2020-06-09T18:14:27 | 271,075,916 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package excepciones;
/*
* 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.
*/
/**
*
* @author Ivan
*/
public class AlumnoExitenteException extends Exception {
/**
* Creates a new instance of <code>AlumnoExitenteException</code> without
* detail message.
*/
public AlumnoExitenteException() {
}
/**
* Constructs an instance of <code>AlumnoExitenteException</code> with the
* specified detail message.
*
* @param msg the detail message.
*/
public AlumnoExitenteException(String msg) {
super(msg);
}
}
| UTF-8 | Java | 706 | java | AlumnoExitenteException.java | Java | [
{
"context": "the template in the editor.\n */\n\n/**\n *\n * @author Ivan\n */\npublic class AlumnoExitenteException extends ",
"end": 230,
"score": 0.9994825124740601,
"start": 226,
"tag": "NAME",
"value": "Ivan"
}
] | null | [] | package excepciones;
/*
* 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.
*/
/**
*
* @author Ivan
*/
public class AlumnoExitenteException extends Exception {
/**
* Creates a new instance of <code>AlumnoExitenteException</code> without
* detail message.
*/
public AlumnoExitenteException() {
}
/**
* Constructs an instance of <code>AlumnoExitenteException</code> with the
* specified detail message.
*
* @param msg the detail message.
*/
public AlumnoExitenteException(String msg) {
super(msg);
}
}
| 706 | 0.66289 | 0.66289 | 31 | 21.774193 | 25.010592 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.16129 | false | false | 1 |
4191fb19aee31dcae9b3ea4e72377f18639ecbe4 | 962,072,695,696 | 1289b665d728b200c35c0ea0a635cca41103a907 | /scada-lts-e2e-test/scada-lts-e2e-test-impl/src/main/java/org/scadalts/e2e/test/impl/groovy/GroovyEngine.java | 8cff2b8106e4272063f89bf988962cfe1d748514 | [
"Apache-2.0"
] | permissive | SCADA-LTS/Scada-LTS-E2E | https://github.com/SCADA-LTS/Scada-LTS-E2E | c65ddf7d1d1fa1402df3b1e02c82215f3396e55c | a8d4485b7aff273bb0edb97e7111756d5db1e21b | refs/heads/master | 2023-07-21T01:22:29.384000 | 2023-05-21T10:35:59 | 2023-05-21T10:35:59 | 227,887,796 | 7 | 1 | Apache-2.0 | false | 2023-08-24T14:50:26 | 2019-12-13T17:11:11 | 2023-03-08T03:02:37 | 2023-08-24T14:50:25 | 78,880 | 2 | 1 | 18 | Java | false | false | package org.scadalts.e2e.test.impl.groovy;
import lombok.extern.log4j.Log4j2;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.scadalts.e2e.common.core.config.E2eConfiguration;
import org.scadalts.e2e.page.core.config.PageConfiguration;
import org.scadalts.e2e.page.impl.groovy.*;
import org.scadalts.e2e.page.impl.pages.navigation.NavigationPage;
import org.scadalts.e2e.test.impl.utils.TestWithPageUtil;
import org.scadalts.e2e.test.impl.utils.TestWithoutPageUtil;
import java.util.Collection;
import static org.scadalts.e2e.test.impl.groovy.CreatorUtil.deleteObjects;
import static org.scadalts.e2e.test.impl.groovy.GroovyUtil.getGroovyExecutes;
@Log4j2
@RunWith(Parameterized.class)
public class GroovyEngine {
@Parameterized.Parameters(name = "number test: {index}, script: {0}")
public static Collection<GroovyExecute> data() {
return getGroovyExecutes();
}
private final GroovyExecute execute;
public GroovyEngine(GroovyExecute execute) {
this.execute = execute;
}
@Before
public void config() {
_preconfig(execute);
_config(execute);
}
@Test
public void execute() {
_test(execute);
}
@After
public void after() {
if(ConfigurationUtil.isPageMode()) {
if (TestWithPageUtil.isLogged())
TestWithPageUtil.close();
} else {
if(!E2eConfiguration.checkAuthentication || TestWithoutPageUtil.isApiLogged())
TestWithoutPageUtil.close();
}
ConfigurationUtil.pageMode(false);
}
@AfterClass
public static void clean() {
_clean();
}
private static void _clean() {
deleteObjects();
ConfigurationUtil.headless(PageConfiguration.headless);
ConfigurationUtil.path(PageConfiguration.reportsUrl);
if(ConfigurationUtil.isPageMode()) {
if (TestWithPageUtil.isLogged())
TestWithPageUtil.close();
} else {
if(TestWithoutPageUtil.isApiLogged())
TestWithoutPageUtil.close();
}
System.gc();
}
private void _preconfig(GroovyExecute execute) {
execute.getGroovyObject().invokeMethod("preconfig", new Object[0]);
if(ConfigurationUtil.isPageMode()) {
NavigationPage navigationPage = TestWithPageUtil.openNavigationPage();
NavigationUtil.init(navigationPage);
OperationUtil.init(navigationPage);
OperationPageUtil.init(navigationPage);
CreatorUtil.init(navigationPage);
EditorUtil.init(navigationPage);
} else {
TestWithoutPageUtil.preparingTest();
}
}
private void _config(GroovyExecute execute) {
execute.getGroovyObject().invokeMethod("config", new Object[0]);
}
private void _test(GroovyExecute execute) {
if(!execute.getData().isEmpty()) {
execute.getGroovyObject().invokeMethod("test", execute.getData());
} else {
execute.getGroovyObject().invokeMethod("test", new Object[0]);
}
}
}
| UTF-8 | Java | 3,241 | java | GroovyEngine.java | Java | [] | null | [] | package org.scadalts.e2e.test.impl.groovy;
import lombok.extern.log4j.Log4j2;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.scadalts.e2e.common.core.config.E2eConfiguration;
import org.scadalts.e2e.page.core.config.PageConfiguration;
import org.scadalts.e2e.page.impl.groovy.*;
import org.scadalts.e2e.page.impl.pages.navigation.NavigationPage;
import org.scadalts.e2e.test.impl.utils.TestWithPageUtil;
import org.scadalts.e2e.test.impl.utils.TestWithoutPageUtil;
import java.util.Collection;
import static org.scadalts.e2e.test.impl.groovy.CreatorUtil.deleteObjects;
import static org.scadalts.e2e.test.impl.groovy.GroovyUtil.getGroovyExecutes;
@Log4j2
@RunWith(Parameterized.class)
public class GroovyEngine {
@Parameterized.Parameters(name = "number test: {index}, script: {0}")
public static Collection<GroovyExecute> data() {
return getGroovyExecutes();
}
private final GroovyExecute execute;
public GroovyEngine(GroovyExecute execute) {
this.execute = execute;
}
@Before
public void config() {
_preconfig(execute);
_config(execute);
}
@Test
public void execute() {
_test(execute);
}
@After
public void after() {
if(ConfigurationUtil.isPageMode()) {
if (TestWithPageUtil.isLogged())
TestWithPageUtil.close();
} else {
if(!E2eConfiguration.checkAuthentication || TestWithoutPageUtil.isApiLogged())
TestWithoutPageUtil.close();
}
ConfigurationUtil.pageMode(false);
}
@AfterClass
public static void clean() {
_clean();
}
private static void _clean() {
deleteObjects();
ConfigurationUtil.headless(PageConfiguration.headless);
ConfigurationUtil.path(PageConfiguration.reportsUrl);
if(ConfigurationUtil.isPageMode()) {
if (TestWithPageUtil.isLogged())
TestWithPageUtil.close();
} else {
if(TestWithoutPageUtil.isApiLogged())
TestWithoutPageUtil.close();
}
System.gc();
}
private void _preconfig(GroovyExecute execute) {
execute.getGroovyObject().invokeMethod("preconfig", new Object[0]);
if(ConfigurationUtil.isPageMode()) {
NavigationPage navigationPage = TestWithPageUtil.openNavigationPage();
NavigationUtil.init(navigationPage);
OperationUtil.init(navigationPage);
OperationPageUtil.init(navigationPage);
CreatorUtil.init(navigationPage);
EditorUtil.init(navigationPage);
} else {
TestWithoutPageUtil.preparingTest();
}
}
private void _config(GroovyExecute execute) {
execute.getGroovyObject().invokeMethod("config", new Object[0]);
}
private void _test(GroovyExecute execute) {
if(!execute.getData().isEmpty()) {
execute.getGroovyObject().invokeMethod("test", execute.getData());
} else {
execute.getGroovyObject().invokeMethod("test", new Object[0]);
}
}
}
| 3,241 | 0.663375 | 0.657205 | 105 | 29.866667 | 23.944407 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.485714 | false | false | 1 |
f877150dc71b031db9bace7ffc2fafc0f36d2ee3 | 584,115,590,803 | fb530a7aa2546ee9796fbc63951904ec6606864b | /jbpm-mvn-example-bpms640/jbpm-mvn-rest-controller/src/main/java/com/sample/DisposeContainerViaControllerExample.java | 5df2482cf735ef351097b89c0fc15fb551c84d4f | [] | no_license | ranjay2017/jbpm6example | https://github.com/ranjay2017/jbpm6example | 08985b0cb27d8143778b7ebb7c29138995459d9a | a1a0612eeef748d7253064d07e0b7c474aae703f | refs/heads/master | 2023-04-07T13:41:23.511000 | 2018-10-17T02:57:29 | 2018-10-17T02:57:29 | 117,191,733 | 0 | 0 | null | true | 2018-01-12T04:20:23 | 2018-01-12T04:20:22 | 2017-08-09T19:42:03 | 2017-10-10T08:28:51 | 1,843 | 0 | 0 | 0 | null | false | null | package com.sample;
import org.kie.server.api.marshalling.MarshallingFormat;
import org.kie.server.api.model.KieContainerResource;
import org.kie.server.api.model.KieContainerResourceList;
import org.kie.server.api.model.KieContainerStatus;
import org.kie.server.api.model.KieServerInfo;
import org.kie.server.api.model.ReleaseId;
import org.kie.server.api.model.ServiceResponse;
import org.kie.server.client.KieServicesClient;
import org.kie.server.client.KieServicesConfiguration;
import org.kie.server.client.KieServicesFactory;
public class DisposeContainerViaControllerExample {
private static final String KIESERVER_ID = "local-server-123";
private static final String CONTROLLER_URL = "http://localhost:8080/business-central/rest/controller";
private static final String USERNAME = "kieserver";
private static final String PASSWORD = "kieserver1!";
private static final String GROUP_ID = "com.sample";
private static final String ARTIFACT_ID = "drools-mvn-kjar";
private static final String VERSION = "1.0.0-SNAPSHOT";
private static final String CONTAINER_ID = "MyContainer";
public static void main(String[] args) {
// Controller Client
KieServerControllerClient controllerClient = new KieServerControllerClient(CONTROLLER_URL, USERNAME, PASSWORD);
controllerClient.setMarshallingFormat(MarshallingFormat.JAXB);
// Undeploy container for kie server instance.
controllerClient.disposeContainer(KIESERVER_ID, CONTAINER_ID);
}
} | UTF-8 | Java | 1,536 | java | DisposeContainerViaControllerExample.java | Java | [
{
"context": "ler\";\n private static final String USERNAME = \"kieserver\";\n private static final String PASSWORD = \"kie",
"end": 815,
"score": 0.9965543746948242,
"start": 806,
"tag": "USERNAME",
"value": "kieserver"
},
{
"context": "ver\";\n private static final String ... | null | [] | package com.sample;
import org.kie.server.api.marshalling.MarshallingFormat;
import org.kie.server.api.model.KieContainerResource;
import org.kie.server.api.model.KieContainerResourceList;
import org.kie.server.api.model.KieContainerStatus;
import org.kie.server.api.model.KieServerInfo;
import org.kie.server.api.model.ReleaseId;
import org.kie.server.api.model.ServiceResponse;
import org.kie.server.client.KieServicesClient;
import org.kie.server.client.KieServicesConfiguration;
import org.kie.server.client.KieServicesFactory;
public class DisposeContainerViaControllerExample {
private static final String KIESERVER_ID = "local-server-123";
private static final String CONTROLLER_URL = "http://localhost:8080/business-central/rest/controller";
private static final String USERNAME = "kieserver";
private static final String PASSWORD = "<PASSWORD>!";
private static final String GROUP_ID = "com.sample";
private static final String ARTIFACT_ID = "drools-mvn-kjar";
private static final String VERSION = "1.0.0-SNAPSHOT";
private static final String CONTAINER_ID = "MyContainer";
public static void main(String[] args) {
// Controller Client
KieServerControllerClient controllerClient = new KieServerControllerClient(CONTROLLER_URL, USERNAME, PASSWORD);
controllerClient.setMarshallingFormat(MarshallingFormat.JAXB);
// Undeploy container for kie server instance.
controllerClient.disposeContainer(KIESERVER_ID, CONTAINER_ID);
}
} | 1,536 | 0.768229 | 0.761068 | 38 | 39.447369 | 30.453327 | 119 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.657895 | false | false | 1 |
4261bfa75fa482b1b4470f9664e3661e69b4e942 | 584,115,587,369 | 7b97ee25d3abfbd83bd226c7e83ca0e4088d778a | /app/src/main/java/com/allg/asteroides/game/objects/AsteroideManager.java | 9c917b4c5af6a7e7b5ab4fe052f3595dfa85b215 | [] | no_license | julio96najera/asteroides-1 | https://github.com/julio96najera/asteroides-1 | 2066d604705288a23defec3e465e8e761c437cc2 | 699724fefff956bdb7c5a876ac2e98d60ced8c7e | refs/heads/master | 2021-06-09T15:02:22.370000 | 2017-01-15T17:07:05 | 2017-01-15T17:07:05 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.allg.asteroides.game.objects;
import android.content.Context;
import android.graphics.Canvas;
import android.util.Log;
import com.allg.asteroides.engine.GameObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class AsteroideManager extends GameObject {
private List<Asteroide> asteroides;
private int asteroidesQuantity;
private int velocity;
private int creationInterval; //interações por criação de asteroide
private int creationSteps = 0;
private int asteroidesOutOfDisplay;
public AsteroideManager(Context context, int asteroidesQuantity, int velocity) {
super(context, 0, 0);
this.asteroides = new ArrayList<>();
this.asteroidesQuantity = asteroidesQuantity;
this.velocity = velocity;
this.creationInterval = 40;
}
public List<Asteroide> getAsteroides() {
return asteroides;
}
@Override
public void initObject(Canvas canvas) {
}
@Override
public void step(Canvas canvas) {
createAsteroide(canvas);
asteroidesOutOfDisplay = 0;
for (Asteroide a : asteroides) {
if (a.isBottom(canvas))
asteroidesOutOfDisplay++;
else
a.step(canvas);
}
}
@Override
public void draw(Canvas canvas) {
for (Asteroide a : asteroides)
if (!a.isBottom(canvas))
a.draw(canvas);
}
private void createAsteroide(Canvas canvas) {
if (asteroides.size() < asteroidesQuantity) {
if (creationSteps >= creationInterval) {
Random random = new Random();
Asteroide asteroide = new Asteroide(getContext(),
48 + random.nextInt(canvas.getWidth() - 96), 0, velocity);
asteroides.add(asteroide);
creationSteps = 0;
if (creationInterval > 30)
creationInterval--;
}
creationSteps++;
}
}
public boolean isAllAsteroidesCreated() {
return (asteroidesOutOfDisplay >= asteroidesQuantity);
}
}
| UTF-8 | Java | 2,174 | java | AsteroideManager.java | Java | [] | null | [] | package com.allg.asteroides.game.objects;
import android.content.Context;
import android.graphics.Canvas;
import android.util.Log;
import com.allg.asteroides.engine.GameObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class AsteroideManager extends GameObject {
private List<Asteroide> asteroides;
private int asteroidesQuantity;
private int velocity;
private int creationInterval; //interações por criação de asteroide
private int creationSteps = 0;
private int asteroidesOutOfDisplay;
public AsteroideManager(Context context, int asteroidesQuantity, int velocity) {
super(context, 0, 0);
this.asteroides = new ArrayList<>();
this.asteroidesQuantity = asteroidesQuantity;
this.velocity = velocity;
this.creationInterval = 40;
}
public List<Asteroide> getAsteroides() {
return asteroides;
}
@Override
public void initObject(Canvas canvas) {
}
@Override
public void step(Canvas canvas) {
createAsteroide(canvas);
asteroidesOutOfDisplay = 0;
for (Asteroide a : asteroides) {
if (a.isBottom(canvas))
asteroidesOutOfDisplay++;
else
a.step(canvas);
}
}
@Override
public void draw(Canvas canvas) {
for (Asteroide a : asteroides)
if (!a.isBottom(canvas))
a.draw(canvas);
}
private void createAsteroide(Canvas canvas) {
if (asteroides.size() < asteroidesQuantity) {
if (creationSteps >= creationInterval) {
Random random = new Random();
Asteroide asteroide = new Asteroide(getContext(),
48 + random.nextInt(canvas.getWidth() - 96), 0, velocity);
asteroides.add(asteroide);
creationSteps = 0;
if (creationInterval > 30)
creationInterval--;
}
creationSteps++;
}
}
public boolean isAllAsteroidesCreated() {
return (asteroidesOutOfDisplay >= asteroidesQuantity);
}
}
| 2,174 | 0.612903 | 0.606452 | 88 | 23.65909 | 21.561691 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.443182 | false | false | 1 |
de6eb86c059a6081d3924547e48ab9f9f4823d5a | 13,950,053,819,642 | 5930783f619f0eeb0f5809de7f710b5dd2ef8267 | /Project_172/src/framework_testng/DP/Excel/Excel_DataProvider_Intergration.java | 82f312b41e18c43937e5f2e578863a4cd7ceb487 | [] | no_license | sunilreddyg/22nd_Aug_10-30_2019 | https://github.com/sunilreddyg/22nd_Aug_10-30_2019 | 7899cc29fb2fe716ab32a603e622db00b0525f6d | 0180b9dd68a266a95545bd383d1edbf744d85fc9 | refs/heads/master | 2020-07-14T13:05:22.973000 | 2020-01-23T09:29:43 | 2020-01-23T09:29:43 | 205,323,350 | 1 | 6 | null | null | null | null | null | null | null | null | null | null | null | null | null | package framework_testng.DP.Excel;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class Excel_DataProvider_Intergration
{
XSSFWorkbook book;
XSSFSheet sht;
XSSFRow row;
XSSFCell cell;
String filepath="TestData\\InputData.xlsx";
@Test(dataProvider="get_data")
public void userLogin(String UID,String PWD)
{
}
@DataProvider
public String [][] get_data()
{
int Rcount=sht.getLastRowNum();
String data[][];
data=new String[Rcount+1][2];
for (int i = 0; i <= Rcount; i++)
{
//Iterate for number of cells
for (int j = 0; j < 2; j++)
{
data[i][j]=sht.getRow(i).getCell(j).getStringCellValue();
}
}
return data;
}
@AfterClass
public void Pre_Condition() throws IOException
{
FileInputStream fi=new FileInputStream(filepath);
book=new XSSFWorkbook(fi);
sht=book.getSheet("Sheet7");
}
@BeforeClass
public void Createoutput() throws IOException
{
FileOutputStream fo=new FileOutputStream("TestData\\OP1.xlsx");
book.write(fo);
book.close();
}
}
| UTF-8 | Java | 1,513 | java | Excel_DataProvider_Intergration.java | Java | [] | null | [] | package framework_testng.DP.Excel;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class Excel_DataProvider_Intergration
{
XSSFWorkbook book;
XSSFSheet sht;
XSSFRow row;
XSSFCell cell;
String filepath="TestData\\InputData.xlsx";
@Test(dataProvider="get_data")
public void userLogin(String UID,String PWD)
{
}
@DataProvider
public String [][] get_data()
{
int Rcount=sht.getLastRowNum();
String data[][];
data=new String[Rcount+1][2];
for (int i = 0; i <= Rcount; i++)
{
//Iterate for number of cells
for (int j = 0; j < 2; j++)
{
data[i][j]=sht.getRow(i).getCell(j).getStringCellValue();
}
}
return data;
}
@AfterClass
public void Pre_Condition() throws IOException
{
FileInputStream fi=new FileInputStream(filepath);
book=new XSSFWorkbook(fi);
sht=book.getSheet("Sheet7");
}
@BeforeClass
public void Createoutput() throws IOException
{
FileOutputStream fo=new FileOutputStream("TestData\\OP1.xlsx");
book.write(fo);
book.close();
}
}
| 1,513 | 0.686054 | 0.681428 | 70 | 19.614286 | 18.745127 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.628571 | false | false | 1 |
a6ec522dccff8e76da3288b2b8b661b9858acaaa | 13,073,880,472,977 | de43dcc65fd6a6bc17a1de9ddfbba3cd7417c2a6 | /src/main/java/com/example/springfun/AppConfig.java | e6742d880e94452884fc7c8db7cfdc83deb69483 | [] | no_license | GlennPacker/JavaIntelliJIntegrationPlay | https://github.com/GlennPacker/JavaIntelliJIntegrationPlay | 31686e91babfa9f40fb55ba6d06fbf65cfe69f22 | 44988791c58322ef44b373c8f4bbffb10eb168ef | refs/heads/main | 2022-12-31T02:33:37.762000 | 2020-10-19T07:46:11 | 2020-10-19T07:46:11 | 305,301,014 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.springfun;
import com.example.springfun.repositories.HibernateSpeakerRepositoryImpl;
import com.example.springfun.repositories.SpeakerRepository;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import services.SpeakerService;
import services.SpeakerServiceImpl;
@Configuration
public class AppConfig {
@Bean(name = "speakerService")
public SpeakerService getSpeakerService() {
return new SpeakerServiceImpl(getSpeakerRepository());
}
@Bean(name = "speakerRepository")
public SpeakerRepository getSpeakerRepository() {
return new HibernateSpeakerRepositoryImpl();
}
}
| UTF-8 | Java | 696 | java | AppConfig.java | Java | [] | null | [] | package com.example.springfun;
import com.example.springfun.repositories.HibernateSpeakerRepositoryImpl;
import com.example.springfun.repositories.SpeakerRepository;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import services.SpeakerService;
import services.SpeakerServiceImpl;
@Configuration
public class AppConfig {
@Bean(name = "speakerService")
public SpeakerService getSpeakerService() {
return new SpeakerServiceImpl(getSpeakerRepository());
}
@Bean(name = "speakerRepository")
public SpeakerRepository getSpeakerRepository() {
return new HibernateSpeakerRepositoryImpl();
}
}
| 696 | 0.793103 | 0.793103 | 22 | 30.636364 | 23.818529 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.409091 | false | false | 1 |
c9f53ab9baa8eda393def2975ce1cd08e238f49e | 25,555,055,458,026 | f82e7d96342223f2125cf7ad8a2d4eef4450bd3d | /src/java/sia/rf/contabilidad/sistemas/mipf/modDescarga/CuentaPorLiquidar.java | 7b784b072d66aabf86329d00442e25505130fd5c | [] | no_license | cristianArevaloTorres/sia-conta | https://github.com/cristianArevaloTorres/sia-conta | b10636fa50f9afe9e1de2ea0fdeb2f2a69e40abf | 473351524b369038e0f2c91b34d2691e7a94f01d | refs/heads/master | 2020-03-25T12:41:14.079000 | 2018-08-06T20:04:48 | 2018-08-06T20:04:48 | 143,787,954 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package sia.rf.contabilidad.sistemas.mipf.modDescarga;
import java.sql.*;
import sun.jdbc.rowset.CachedRowSet;
public class CuentaPorLiquidar{
public CuentaPorLiquidar(){
}
private String unidad;
private String mes;
private String tipoeje;
private String cxlc;
private String anticipo;
private String totbruto;
private String totneto;
private String concepto;
private String fechaaut;
private String fechacap;
private String ident;
private String poliza;
private String pagocen;
private String ctadisp;
private String cajachi;
private String oridocto;
private String ejercicio;
private String referencia;
private String idctaxliq;
/**
* unidad
* @return unidad
*/
public String getUnidad() {
return unidad;
}
/**
* unidad
* @param unidad
*/
public void setUnidad( String unidad ) {
this.unidad=unidad;
}
/**
* mes
* @return mes
*/
public String getMes() {
return mes;
}
/**
* mes
* @param mes
*/
public void setMes( String mes ) {
this.mes=mes;
}
/**
* tipoeje
* @return tipoeje
*/
public String getTipoeje() {
return tipoeje;
}
/**
* tipoeje
* @param tipoeje
*/
public void setTipoeje( String tipoeje ) {
this.tipoeje=tipoeje;
}
/**
* cxlc
* @return cxlc
*/
public String getCxlc() {
return cxlc;
}
/**
* cxlc
* @param cxlc
*/
public void setCxlc( String cxlc ) {
this.cxlc=cxlc;
}
/**
* anticipo
* @return anticipo
*/
public String getAnticipo() {
return anticipo;
}
/**
* anticipo
* @param anticipo
*/
public void setAnticipo( String anticipo ) {
this.anticipo=anticipo;
}
/**
* totbruto
* @return totbruto
*/
public String getTotbruto() {
return totbruto;
}
/**
* totbruto
* @param totbruto
*/
public void setTotbruto( String totbruto ) {
this.totbruto=totbruto;
}
/**
* totneto
* @return totneto
*/
public String getTotneto() {
return totneto;
}
/**
* totneto
* @param totneto
*/
public void setTotneto( String totneto ) {
this.totneto=totneto;
}
/**
* concepto
* @return concepto
*/
public String getConcepto() {
return concepto;
}
/**
* concepto
* @param concepto
*/
public void setConcepto( String concepto ) {
this.concepto=concepto;
}
/**
* fechaaut
* @return fechaaut
*/
public String getFechaaut() {
return fechaaut;
}
/**
* fechaaut
* @param fechaaut
*/
public void setFechaaut( String fechaaut ) {
this.fechaaut=fechaaut;
}
/**
* fechacap
* @return fechacap
*/
public String getFechacap() {
return fechacap;
}
/**
* fechacap
* @param fechacap
*/
public void setFechacap( String fechacap ) {
this.fechacap=fechacap;
}
/**
* ident
* @return ident
*/
public String getIdent() {
return ident;
}
/**
* ident
* @param ident
*/
public void setIdent( String ident ) {
this.ident=ident;
}
/**
* poliza
* @return poliza
*/
public String getPoliza() {
return poliza;
}
/**
* poliza
* @param poliza
*/
public void setPoliza( String poliza ) {
this.poliza=poliza;
}
/**
* pagocen
* @return pagocen
*/
public String getPagocen() {
return pagocen;
}
/**
* pagocen
* @param pagocen
*/
public void setPagocen( String pagocen ) {
this.pagocen=pagocen;
}
/**
* ctadisp
* @return ctadisp
*/
public String getCtadisp() {
return ctadisp;
}
/**
* ctadisp
* @param ctadisp
*/
public void setCtadisp( String ctadisp ) {
this.ctadisp=ctadisp;
}
/**
* cajachi
* @return cajachi
*/
public String getCajachi() {
return cajachi;
}
/**
* cajachi
* @param cajachi
*/
public void setCajachi( String cajachi ) {
this.cajachi=cajachi;
}
/**
* oridocto
* @return oridocto
*/
public String getOridocto() {
return oridocto;
}
/**
* oridocto
* @param oridocto
*/
public void setOridocto( String oridocto ) {
this.oridocto=oridocto;
}
/**
* ejercicio
* @return ejercicio
*/
public String getEjercicio() {
return ejercicio;
}
/**
* ejercicio
* @param ejercicio
*/
public void setEjercicio( String ejercicio ) {
this.ejercicio=ejercicio;
}
/**
* referencia
* @return referencia
*/
public String getReferencia() {
return referencia;
}
/**
* referencia
* @param referencia
*/
public void setReferencia( String referencia ) {
this.referencia=referencia;
}
/**
* idctaxliq
* @return idctaxliq
*/
public String getIdctaxliq() {
return idctaxliq;
}
/**
* idctaxliq
* @param idctaxliq
*/
public void setIdctaxliq( String idctaxliq ) {
this.idctaxliq=idctaxliq;
}
/**
* Metodo que lee la informacion de rf_tr_ctaxliq, el query viene como parametro
* Fecha de creacion:
* Autor:
* Fecha de modificacion:
* Modificado por:
*/
public CachedRowSet select_rf_tr_ctaxliq_bd(Connection con, String query)throws SQLException, Exception{
CachedRowSet rsQuery=null;
StringBuffer SQL=new StringBuffer("");
try{
rsQuery = new CachedRowSet();
SQL.append(query);
rsQuery.setCommand(SQL.toString());
rsQuery.execute(con);
} //Fin try
catch(Exception e){
System.out.println("Ocurrio un error al accesar al metodo select_rf_tr_ctaxliq_bd "+e.getMessage());
System.out.println(SQL.toString());
throw e;
} //Fin catch
finally{
} //Fin finally
return rsQuery;
} //Fin metodo select_rf_tr_ctaxliq_bd
/**
* Metodo que lee la informacion de rf_tr_ctaxliq
* Fecha de creacion:
* Autor:
* Fecha de modificacion:
* Modificado por:
*/
public void select_rf_tr_ctaxliq(Connection con, String clave)throws SQLException, Exception{
Statement stQuery=null;
ResultSet rsQuery=null;
try{
stQuery=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
StringBuffer SQL=new StringBuffer("SELECT a.unidad,a.mes,a.tipoeje,a.cxlc,a.anticipo,a.totbruto,a.totneto,a.concepto,a.fechaaut,a.fechacap,a.ident,a.poliza,a.pagocen,a.ctadisp,a.cajachi,a.oridocto,a.ejercicio,a.referencia,a.idctaxliq");
SQL.append(" FROM rf_tr_ctaxliq a ");
SQL.append(" WHERE a.idctaxliq=").append(clave).append(" ");
System.out.println(SQL.toString());
rsQuery=stQuery.executeQuery(SQL.toString());
while (rsQuery.next()){
unidad=(rsQuery.getString("unidad")==null) ? "" : rsQuery.getString("unidad");
mes=(rsQuery.getString("mes")==null) ? "" : rsQuery.getString("mes");
tipoeje=(rsQuery.getString("tipoeje")==null) ? "" : rsQuery.getString("tipoeje");
cxlc=(rsQuery.getString("cxlc")==null) ? "" : rsQuery.getString("cxlc");
anticipo=(rsQuery.getString("anticipo")==null) ? "" : rsQuery.getString("anticipo");
totbruto=(rsQuery.getString("totbruto")==null) ? "" : rsQuery.getString("totbruto");
totneto=(rsQuery.getString("totneto")==null) ? "" : rsQuery.getString("totneto");
concepto=(rsQuery.getString("concepto")==null) ? "" : rsQuery.getString("concepto");
fechaaut=(rsQuery.getString("fechaaut")==null) ? "" : rsQuery.getString("fechaaut");
fechacap=(rsQuery.getString("fechacap")==null) ? "" : rsQuery.getString("fechacap");
ident=(rsQuery.getString("ident")==null) ? "" : rsQuery.getString("ident");
poliza=(rsQuery.getString("poliza")==null) ? "" : rsQuery.getString("poliza");
pagocen=(rsQuery.getString("pagocen")==null) ? "" : rsQuery.getString("pagocen");
ctadisp=(rsQuery.getString("ctadisp")==null) ? "" : rsQuery.getString("ctadisp");
cajachi=(rsQuery.getString("cajachi")==null) ? "" : rsQuery.getString("cajachi");
oridocto=(rsQuery.getString("oridocto")==null) ? "" : rsQuery.getString("oridocto");
ejercicio=(rsQuery.getString("ejercicio")==null) ? "" : rsQuery.getString("ejercicio");
referencia=(rsQuery.getString("referencia")==null) ? "" : rsQuery.getString("referencia");
idctaxliq=(rsQuery.getString("idctaxliq")==null) ? "" : rsQuery.getString("idctaxliq");
} // Fin while
} //Fin try
catch(Exception e){
System.out.println("Ocurrio un error al accesar al metodo select_rf_tr_ctaxliq "+e.getMessage());
throw e;
} //Fin catch
finally{
if (rsQuery!=null){
rsQuery.close();
rsQuery=null;
}
if (stQuery!=null){
stQuery.close();
stQuery=null;
}
} //Fin finally
} //Fin metodo select_rf_tr_ctaxliq
/**
* Metodo que inserta la informacion de rf_tr_ctaxliq
* Fecha de creacion:
* Autor:
* Fecha de modificacion:
* Modificado por:
*/
public void insert_rf_tr_ctaxliq(Connection con)throws SQLException, Exception{
Statement stQuery=null;
try{
stQuery=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
StringBuffer SQL=new StringBuffer("INSERT INTO rf_tr_ctaxliq( unidad,mes,tipoeje,cxlc,anticipo,totbruto,totneto,concepto,fechaaut,fechacap,ident,poliza,pagocen,ctadisp,cajachi,oridocto,ejercicio,referencia,idctaxliq) ");
SQL.append("VALUES(");
SQL.append("'").append(unidad).append("',");
SQL.append(mes).append(",");
SQL.append(tipoeje).append(",");
SQL.append("'").append(cxlc).append("',");
SQL.append(anticipo).append(",");
SQL.append(totbruto).append(",");
SQL.append(totneto).append(",");
SQL.append("'").append(concepto).append("',");
SQL.append("'").append(fechaaut).append("',");
SQL.append("'").append(fechacap).append("',");
SQL.append("'").append(ident).append("',");
SQL.append("'").append(poliza).append("',");
SQL.append(pagocen).append(",");
SQL.append("'").append(ctadisp).append("',");
SQL.append(cajachi).append(",");
SQL.append("'").append(oridocto).append("',");
SQL.append(ejercicio).append(",");
SQL.append("'").append(referencia).append("',");
SQL.append(idctaxliq).append(")");
System.out.println(SQL.toString());
int rs=-1;
rs=stQuery.executeUpdate(SQL.toString());
} //Fin try
catch(Exception e){
System.out.println("Ocurrio un error al accesar al metodo insert_rf_tr_ctaxliq "+e.getMessage());
throw e;
} //Fin catch
finally{
if (stQuery!=null){
stQuery.close();
stQuery=null;
}
} //Fin finally
} //Fin metodo insert_rf_tr_ctaxliq
/**
* Metodo que modifica la informacion de rf_tr_ctaxliq
* Fecha de creacion:
* Autor:
* Fecha de modificacion:
* Modificado por:
*/
public void update_rf_tr_ctaxliq(Connection con, String clave)throws SQLException, Exception{
Statement stQuery=null;
try{
stQuery=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
StringBuffer SQL=new StringBuffer("UPDATE rf_tr_ctaxliq");
SQL.append(" SET unidad=").append("'").append(unidad).append("',");
SQL.append("mes=").append(mes).append(",");
SQL.append("tipoeje=").append(tipoeje).append(",");
SQL.append("cxlc=").append("'").append(cxlc).append("',");
SQL.append("anticipo=").append(anticipo).append(",");
SQL.append("totbruto=").append(totbruto).append(",");
SQL.append("totneto=").append(totneto).append(",");
SQL.append("concepto=").append("'").append(concepto).append("',");
SQL.append("fechaaut=").append("'").append(fechaaut).append("',");
SQL.append("fechacap=").append("'").append(fechacap).append("',");
SQL.append("ident=").append("'").append(ident).append("',");
SQL.append("poliza=").append("'").append(poliza).append("',");
SQL.append("pagocen=").append(pagocen).append(",");
SQL.append("ctadisp=").append("'").append(ctadisp).append("',");
SQL.append("cajachi=").append(cajachi).append(",");
SQL.append("oridocto=").append("'").append(oridocto).append("',");
SQL.append("ejercicio=").append(ejercicio).append(",");
SQL.append("referencia=").append("'").append(referencia).append("',");
SQL.append("idctaxliq=").append(idctaxliq);
SQL.append(" WHERE idctaxliq=").append(clave).append(" ");
System.out.println(SQL.toString());
int rs=-1;
rs=stQuery.executeUpdate(SQL.toString());
} //Fin try
catch(Exception e){
System.out.println("Ocurrio un error al accesar al metodo update_rf_tr_ctaxliq "+e.getMessage());
throw e;
} //Fin catch
finally{
if (stQuery!=null){
stQuery.close();
stQuery=null;
}
} //Fin finally
} //Fin metodo update_rf_tr_ctaxliq
/**
* Metodo que borra la informacion de rf_tr_ctaxliq
* Fecha de creacion:
* Autor:
* Fecha de modificacion:
* Modificado por:
*/
public void delete_rf_tr_ctaxliq(Connection con, String clave)throws SQLException, Exception{
Statement stQuery=null;
try{
stQuery=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
StringBuffer SQL=new StringBuffer("DELETE FROM rf_tr_ctaxliq a ");
SQL.append("WHERE a.idctaxliq=").append(clave).append(" ");
System.out.println(SQL.toString());
int rs=-1;
rs=stQuery.executeUpdate(SQL.toString());
} //Fin try
catch(Exception e){
System.out.println("Ocurrio un error al accesar al metodo delete_rf_tr_ctaxliq "+e.getMessage());
throw e;
} //Fin catch
finally{
if (stQuery!=null){
stQuery.close();
stQuery=null;
}
} //Fin finally
} //Fin metodo delete_rf_tr_ctaxliq
} //Fin clase CuentaPorLiquidar
| UTF-8 | Java | 14,973 | java | CuentaPorLiquidar.java | Java | [] | null | [] | package sia.rf.contabilidad.sistemas.mipf.modDescarga;
import java.sql.*;
import sun.jdbc.rowset.CachedRowSet;
public class CuentaPorLiquidar{
public CuentaPorLiquidar(){
}
private String unidad;
private String mes;
private String tipoeje;
private String cxlc;
private String anticipo;
private String totbruto;
private String totneto;
private String concepto;
private String fechaaut;
private String fechacap;
private String ident;
private String poliza;
private String pagocen;
private String ctadisp;
private String cajachi;
private String oridocto;
private String ejercicio;
private String referencia;
private String idctaxliq;
/**
* unidad
* @return unidad
*/
public String getUnidad() {
return unidad;
}
/**
* unidad
* @param unidad
*/
public void setUnidad( String unidad ) {
this.unidad=unidad;
}
/**
* mes
* @return mes
*/
public String getMes() {
return mes;
}
/**
* mes
* @param mes
*/
public void setMes( String mes ) {
this.mes=mes;
}
/**
* tipoeje
* @return tipoeje
*/
public String getTipoeje() {
return tipoeje;
}
/**
* tipoeje
* @param tipoeje
*/
public void setTipoeje( String tipoeje ) {
this.tipoeje=tipoeje;
}
/**
* cxlc
* @return cxlc
*/
public String getCxlc() {
return cxlc;
}
/**
* cxlc
* @param cxlc
*/
public void setCxlc( String cxlc ) {
this.cxlc=cxlc;
}
/**
* anticipo
* @return anticipo
*/
public String getAnticipo() {
return anticipo;
}
/**
* anticipo
* @param anticipo
*/
public void setAnticipo( String anticipo ) {
this.anticipo=anticipo;
}
/**
* totbruto
* @return totbruto
*/
public String getTotbruto() {
return totbruto;
}
/**
* totbruto
* @param totbruto
*/
public void setTotbruto( String totbruto ) {
this.totbruto=totbruto;
}
/**
* totneto
* @return totneto
*/
public String getTotneto() {
return totneto;
}
/**
* totneto
* @param totneto
*/
public void setTotneto( String totneto ) {
this.totneto=totneto;
}
/**
* concepto
* @return concepto
*/
public String getConcepto() {
return concepto;
}
/**
* concepto
* @param concepto
*/
public void setConcepto( String concepto ) {
this.concepto=concepto;
}
/**
* fechaaut
* @return fechaaut
*/
public String getFechaaut() {
return fechaaut;
}
/**
* fechaaut
* @param fechaaut
*/
public void setFechaaut( String fechaaut ) {
this.fechaaut=fechaaut;
}
/**
* fechacap
* @return fechacap
*/
public String getFechacap() {
return fechacap;
}
/**
* fechacap
* @param fechacap
*/
public void setFechacap( String fechacap ) {
this.fechacap=fechacap;
}
/**
* ident
* @return ident
*/
public String getIdent() {
return ident;
}
/**
* ident
* @param ident
*/
public void setIdent( String ident ) {
this.ident=ident;
}
/**
* poliza
* @return poliza
*/
public String getPoliza() {
return poliza;
}
/**
* poliza
* @param poliza
*/
public void setPoliza( String poliza ) {
this.poliza=poliza;
}
/**
* pagocen
* @return pagocen
*/
public String getPagocen() {
return pagocen;
}
/**
* pagocen
* @param pagocen
*/
public void setPagocen( String pagocen ) {
this.pagocen=pagocen;
}
/**
* ctadisp
* @return ctadisp
*/
public String getCtadisp() {
return ctadisp;
}
/**
* ctadisp
* @param ctadisp
*/
public void setCtadisp( String ctadisp ) {
this.ctadisp=ctadisp;
}
/**
* cajachi
* @return cajachi
*/
public String getCajachi() {
return cajachi;
}
/**
* cajachi
* @param cajachi
*/
public void setCajachi( String cajachi ) {
this.cajachi=cajachi;
}
/**
* oridocto
* @return oridocto
*/
public String getOridocto() {
return oridocto;
}
/**
* oridocto
* @param oridocto
*/
public void setOridocto( String oridocto ) {
this.oridocto=oridocto;
}
/**
* ejercicio
* @return ejercicio
*/
public String getEjercicio() {
return ejercicio;
}
/**
* ejercicio
* @param ejercicio
*/
public void setEjercicio( String ejercicio ) {
this.ejercicio=ejercicio;
}
/**
* referencia
* @return referencia
*/
public String getReferencia() {
return referencia;
}
/**
* referencia
* @param referencia
*/
public void setReferencia( String referencia ) {
this.referencia=referencia;
}
/**
* idctaxliq
* @return idctaxliq
*/
public String getIdctaxliq() {
return idctaxliq;
}
/**
* idctaxliq
* @param idctaxliq
*/
public void setIdctaxliq( String idctaxliq ) {
this.idctaxliq=idctaxliq;
}
/**
* Metodo que lee la informacion de rf_tr_ctaxliq, el query viene como parametro
* Fecha de creacion:
* Autor:
* Fecha de modificacion:
* Modificado por:
*/
public CachedRowSet select_rf_tr_ctaxliq_bd(Connection con, String query)throws SQLException, Exception{
CachedRowSet rsQuery=null;
StringBuffer SQL=new StringBuffer("");
try{
rsQuery = new CachedRowSet();
SQL.append(query);
rsQuery.setCommand(SQL.toString());
rsQuery.execute(con);
} //Fin try
catch(Exception e){
System.out.println("Ocurrio un error al accesar al metodo select_rf_tr_ctaxliq_bd "+e.getMessage());
System.out.println(SQL.toString());
throw e;
} //Fin catch
finally{
} //Fin finally
return rsQuery;
} //Fin metodo select_rf_tr_ctaxliq_bd
/**
* Metodo que lee la informacion de rf_tr_ctaxliq
* Fecha de creacion:
* Autor:
* Fecha de modificacion:
* Modificado por:
*/
public void select_rf_tr_ctaxliq(Connection con, String clave)throws SQLException, Exception{
Statement stQuery=null;
ResultSet rsQuery=null;
try{
stQuery=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
StringBuffer SQL=new StringBuffer("SELECT a.unidad,a.mes,a.tipoeje,a.cxlc,a.anticipo,a.totbruto,a.totneto,a.concepto,a.fechaaut,a.fechacap,a.ident,a.poliza,a.pagocen,a.ctadisp,a.cajachi,a.oridocto,a.ejercicio,a.referencia,a.idctaxliq");
SQL.append(" FROM rf_tr_ctaxliq a ");
SQL.append(" WHERE a.idctaxliq=").append(clave).append(" ");
System.out.println(SQL.toString());
rsQuery=stQuery.executeQuery(SQL.toString());
while (rsQuery.next()){
unidad=(rsQuery.getString("unidad")==null) ? "" : rsQuery.getString("unidad");
mes=(rsQuery.getString("mes")==null) ? "" : rsQuery.getString("mes");
tipoeje=(rsQuery.getString("tipoeje")==null) ? "" : rsQuery.getString("tipoeje");
cxlc=(rsQuery.getString("cxlc")==null) ? "" : rsQuery.getString("cxlc");
anticipo=(rsQuery.getString("anticipo")==null) ? "" : rsQuery.getString("anticipo");
totbruto=(rsQuery.getString("totbruto")==null) ? "" : rsQuery.getString("totbruto");
totneto=(rsQuery.getString("totneto")==null) ? "" : rsQuery.getString("totneto");
concepto=(rsQuery.getString("concepto")==null) ? "" : rsQuery.getString("concepto");
fechaaut=(rsQuery.getString("fechaaut")==null) ? "" : rsQuery.getString("fechaaut");
fechacap=(rsQuery.getString("fechacap")==null) ? "" : rsQuery.getString("fechacap");
ident=(rsQuery.getString("ident")==null) ? "" : rsQuery.getString("ident");
poliza=(rsQuery.getString("poliza")==null) ? "" : rsQuery.getString("poliza");
pagocen=(rsQuery.getString("pagocen")==null) ? "" : rsQuery.getString("pagocen");
ctadisp=(rsQuery.getString("ctadisp")==null) ? "" : rsQuery.getString("ctadisp");
cajachi=(rsQuery.getString("cajachi")==null) ? "" : rsQuery.getString("cajachi");
oridocto=(rsQuery.getString("oridocto")==null) ? "" : rsQuery.getString("oridocto");
ejercicio=(rsQuery.getString("ejercicio")==null) ? "" : rsQuery.getString("ejercicio");
referencia=(rsQuery.getString("referencia")==null) ? "" : rsQuery.getString("referencia");
idctaxliq=(rsQuery.getString("idctaxliq")==null) ? "" : rsQuery.getString("idctaxliq");
} // Fin while
} //Fin try
catch(Exception e){
System.out.println("Ocurrio un error al accesar al metodo select_rf_tr_ctaxliq "+e.getMessage());
throw e;
} //Fin catch
finally{
if (rsQuery!=null){
rsQuery.close();
rsQuery=null;
}
if (stQuery!=null){
stQuery.close();
stQuery=null;
}
} //Fin finally
} //Fin metodo select_rf_tr_ctaxliq
/**
* Metodo que inserta la informacion de rf_tr_ctaxliq
* Fecha de creacion:
* Autor:
* Fecha de modificacion:
* Modificado por:
*/
public void insert_rf_tr_ctaxliq(Connection con)throws SQLException, Exception{
Statement stQuery=null;
try{
stQuery=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
StringBuffer SQL=new StringBuffer("INSERT INTO rf_tr_ctaxliq( unidad,mes,tipoeje,cxlc,anticipo,totbruto,totneto,concepto,fechaaut,fechacap,ident,poliza,pagocen,ctadisp,cajachi,oridocto,ejercicio,referencia,idctaxliq) ");
SQL.append("VALUES(");
SQL.append("'").append(unidad).append("',");
SQL.append(mes).append(",");
SQL.append(tipoeje).append(",");
SQL.append("'").append(cxlc).append("',");
SQL.append(anticipo).append(",");
SQL.append(totbruto).append(",");
SQL.append(totneto).append(",");
SQL.append("'").append(concepto).append("',");
SQL.append("'").append(fechaaut).append("',");
SQL.append("'").append(fechacap).append("',");
SQL.append("'").append(ident).append("',");
SQL.append("'").append(poliza).append("',");
SQL.append(pagocen).append(",");
SQL.append("'").append(ctadisp).append("',");
SQL.append(cajachi).append(",");
SQL.append("'").append(oridocto).append("',");
SQL.append(ejercicio).append(",");
SQL.append("'").append(referencia).append("',");
SQL.append(idctaxliq).append(")");
System.out.println(SQL.toString());
int rs=-1;
rs=stQuery.executeUpdate(SQL.toString());
} //Fin try
catch(Exception e){
System.out.println("Ocurrio un error al accesar al metodo insert_rf_tr_ctaxliq "+e.getMessage());
throw e;
} //Fin catch
finally{
if (stQuery!=null){
stQuery.close();
stQuery=null;
}
} //Fin finally
} //Fin metodo insert_rf_tr_ctaxliq
/**
* Metodo que modifica la informacion de rf_tr_ctaxliq
* Fecha de creacion:
* Autor:
* Fecha de modificacion:
* Modificado por:
*/
public void update_rf_tr_ctaxliq(Connection con, String clave)throws SQLException, Exception{
Statement stQuery=null;
try{
stQuery=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
StringBuffer SQL=new StringBuffer("UPDATE rf_tr_ctaxliq");
SQL.append(" SET unidad=").append("'").append(unidad).append("',");
SQL.append("mes=").append(mes).append(",");
SQL.append("tipoeje=").append(tipoeje).append(",");
SQL.append("cxlc=").append("'").append(cxlc).append("',");
SQL.append("anticipo=").append(anticipo).append(",");
SQL.append("totbruto=").append(totbruto).append(",");
SQL.append("totneto=").append(totneto).append(",");
SQL.append("concepto=").append("'").append(concepto).append("',");
SQL.append("fechaaut=").append("'").append(fechaaut).append("',");
SQL.append("fechacap=").append("'").append(fechacap).append("',");
SQL.append("ident=").append("'").append(ident).append("',");
SQL.append("poliza=").append("'").append(poliza).append("',");
SQL.append("pagocen=").append(pagocen).append(",");
SQL.append("ctadisp=").append("'").append(ctadisp).append("',");
SQL.append("cajachi=").append(cajachi).append(",");
SQL.append("oridocto=").append("'").append(oridocto).append("',");
SQL.append("ejercicio=").append(ejercicio).append(",");
SQL.append("referencia=").append("'").append(referencia).append("',");
SQL.append("idctaxliq=").append(idctaxliq);
SQL.append(" WHERE idctaxliq=").append(clave).append(" ");
System.out.println(SQL.toString());
int rs=-1;
rs=stQuery.executeUpdate(SQL.toString());
} //Fin try
catch(Exception e){
System.out.println("Ocurrio un error al accesar al metodo update_rf_tr_ctaxliq "+e.getMessage());
throw e;
} //Fin catch
finally{
if (stQuery!=null){
stQuery.close();
stQuery=null;
}
} //Fin finally
} //Fin metodo update_rf_tr_ctaxliq
/**
* Metodo que borra la informacion de rf_tr_ctaxliq
* Fecha de creacion:
* Autor:
* Fecha de modificacion:
* Modificado por:
*/
public void delete_rf_tr_ctaxliq(Connection con, String clave)throws SQLException, Exception{
Statement stQuery=null;
try{
stQuery=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
StringBuffer SQL=new StringBuffer("DELETE FROM rf_tr_ctaxliq a ");
SQL.append("WHERE a.idctaxliq=").append(clave).append(" ");
System.out.println(SQL.toString());
int rs=-1;
rs=stQuery.executeUpdate(SQL.toString());
} //Fin try
catch(Exception e){
System.out.println("Ocurrio un error al accesar al metodo delete_rf_tr_ctaxliq "+e.getMessage());
throw e;
} //Fin catch
finally{
if (stQuery!=null){
stQuery.close();
stQuery=null;
}
} //Fin finally
} //Fin metodo delete_rf_tr_ctaxliq
} //Fin clase CuentaPorLiquidar
| 14,973 | 0.573766 | 0.573566 | 540 | 26.716667 | 27.856033 | 246 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.481481 | false | false | 1 |
875cd37f8c1a7f154aa6f76cc9326953e75465c2 | 5,634,997,111,362 | dbc451f8b3a4e3514c504e7f71691ed4724ad8eb | /Core/org.mondo.collaboration.security.lens/src/org/mondo/collaboration/security/lens/emf/ModelIndexer.java | 00fb93bbedcce63c6f5c1d28339df28826a4a78e | [] | no_license | baloghtimi/Onlab | https://github.com/baloghtimi/Onlab | f3eb1e99f30e0a276fd45761e8c42d43a02c60f2 | e874e1ba22ac9bde7ccd7b7145a3cd73f920ec49 | refs/heads/master | 2021-01-19T08:10:41.797000 | 2017-06-01T16:52:56 | 2017-06-01T16:52:56 | 82,070,545 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*******************************************************************************
* Copyright (c) 2004-2015 Gabor Bergmann and Daniel Varro
* 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:
* Gabor Bergmann - initial API and implementation
*******************************************************************************/
package org.mondo.collaboration.security.lens.emf;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.viatra.query.runtime.base.api.BaseIndexOptions;
import org.eclipse.viatra.query.runtime.base.api.NavigationHelper;
import org.eclipse.viatra.query.runtime.base.comprehension.EMFModelComprehension;
import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
import org.mondo.collaboration.security.lens.util.ILiveRelation;
import org.mondo.collaboration.security.lens.util.LiveTable;
import org.mondo.collaboration.security.lens.util.uri.URIRelativiser;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
/**
* Indexes the contents of a given EMF model.
* <p> The EMF model is indexed and exposed as {@link LiveTable}s.
*
* @author Bergmann Gabor
*
*/
public class ModelIndexer {
private ResourceSet root;
//private Resource unrootedElements = new XMIResourceImpl();
private URI baseURI;
NavigationHelper daisyChainedIndexer; // cheapMoveTo() is daisy-chained to this indexer
EMFModelComprehension comprehension = new EMFModelComprehension(new BaseIndexOptions(false, true));
URIRelativiser uriRelativiser;
Set<EObject> unrootedObjects = new HashSet<>();
LiveTable indexedResources = new LiveTable();
LiveTable indexedResourceRootContents = new LiveTable();
LiveTable indexedEObjects = new LiveTable();
LiveTable indexedEObjectReferences = new LiveTable();
LiveTable indexedEObjectAttributes = new LiveTable();
Map<ModelFactInputKey, LiveTable> liveIndexTables = Maps.immutableEnumMap(ImmutableMap.of(
ModelFactInputKey.ATTRIBUTE_KEY, indexedEObjectAttributes,
ModelFactInputKey.EOBJECT_KEY, indexedEObjects,
ModelFactInputKey.REFERENCE_KEY, indexedEObjectReferences,
ModelFactInputKey.RESOURCE_KEY, indexedResources,
ModelFactInputKey.RESOURCE_ROOT_CONTENTS_KEY, indexedResourceRootContents
));
Map<ModelFactInputKey, ILiveRelation> liveIndexRelations = ImmutableMap.copyOf(liveIndexTables);
public ModelIndexer(URI baseURI, ResourceSet root, NavigationHelper daisyChainedIndexer) {
super();
this.root = root;
this.baseURI = baseURI;
this.daisyChainedIndexer = daisyChainedIndexer;
this.uriRelativiser = new URIRelativiser(baseURI);
final EMFAdapter emfAdapter = new EMFAdapter(this);
this.adapter = emfAdapter;
emfAdapter.addAdapter(root);
//emfAdapter.addAdapter(dummyResource);
}
public ModelIndexer(URI baseURI, ResourceSet root) {
this(baseURI, root, null);
}
public URI getBaseURI() {
return baseURI;
}
public URIRelativiser getUriRelativiser() {
return uriRelativiser;
}
public ResourceSet getRoot() {
return root;
}
// /**
// * A dummy resource that contains unrooted elements,
// * i.e. model element created by a transformation but not yet placed in the actual containment hierarchy of the model,
// * or elements removed from the containment hierarchy but not yet deleted.
// */
// public Resource getDummyResource() {
// return dummyResource;
// }
public Map<ModelFactInputKey, LiveTable> getLiveIndexTables() {
return liveIndexTables;
}
public Map<ModelFactInputKey, ILiveRelation> getLiveIndexRelations() {
return liveIndexRelations;
}
EMFAdapter adapter;
public Iterable<EObject> getAllEObjects() {
Collection<EObject> objects = new HashSet<>();
for (Tuple tuple : indexedEObjects.getTuplesForSeed(new FlatTuple(null, null))) {
objects.add((EObject) tuple.get(0));
}
for (Tuple tuple : indexedEObjectReferences.getTuplesForSeed(new FlatTuple(null, null, null))) {
objects.add((EObject) tuple.get(2));
}
return objects;
}
public void addUnrooted(EObject instance) {
unrootedObjects.add(instance);
adapter.addAdapter(instance);
}
public boolean removeUnrooted(EObject element) {
boolean removed = unrootedObjects.remove(element);
if (removed) {
adapter.removeAdapter(element);
} else { // not unrooted?
removeFromContainment(element);
}
return removed;
}
/**
* @param containedObject
*/
public void cheapUnroot(EObject element) {
if (element.eAdapters().contains(adapter)) {
adapter.ignoreInsertionAndDeletion = element;
try {
unrootedObjects.add(element);
removeFromContainment(element);
// if (daisyChainedIndexer == null)
// targetContainmentReferenceList.add(element);
// else
// daisyChainedIndexer.cheapMoveTo(element, targetContainmentReferenceList);
} finally {
adapter.ignoreInsertionAndDeletion = null;
}
} else {
addUnrooted(element);
}
}
private void removeFromContainment(EObject element) {
EObject eContainer = element.eContainer();
if (eContainer != null) {
EReference feature = element.eContainmentFeature();
if (feature.isMany())
((Collection<?>) eContainer.eGet(feature)).remove(element);
else
eContainer.eUnset(feature);
}
final Resource eResource = element.eResource();
if (eResource != null) {
eResource.getContents().remove(element);
}
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public void cheapMoveTo(EObject element, Notifier parent, EList targetContainmentReferenceList) {
if (element.eAdapters().contains(adapter) && parent.eAdapters().contains(adapter)) {
adapter.ignoreInsertionAndDeletion = element;
try {
if (unrootedObjects.contains(element))
unrootedObjects.remove(element);
if (daisyChainedIndexer == null)
targetContainmentReferenceList.add(element);
else
daisyChainedIndexer.cheapMoveTo(element, targetContainmentReferenceList);
} finally {
adapter.ignoreInsertionAndDeletion = null;
}
} else {
targetContainmentReferenceList.add(element);
}
}
@SuppressWarnings("rawtypes")
public void cheapMoveTo(EObject element, EObject parent, EReference containmentFeature) {
if (containmentFeature.isMany())
cheapMoveTo(element, parent, (EList)parent.eGet(containmentFeature));
else if (element.eAdapters().contains(adapter) &&
parent.eAdapters().contains(adapter))
{
adapter.ignoreInsertionAndDeletion = element;
try {
if (unrootedObjects.contains(element))
unrootedObjects.remove(element);
if (daisyChainedIndexer == null)
parent.eSet(containmentFeature, element);
else
daisyChainedIndexer.cheapMoveTo(element, parent, containmentFeature);
} finally {
adapter.ignoreInsertionAndDeletion = null;
}
} else {
parent.eSet(containmentFeature, element);
}
}
}
| UTF-8 | Java | 7,758 | java | ModelIndexer.java | Java | [
{
"context": "***********************\n * Copyright (c) 2004-2015 Gabor Bergmann and Daniel Varro\n * All rights reserved. This pro",
"end": 122,
"score": 0.9998612403869629,
"start": 108,
"tag": "NAME",
"value": "Gabor Bergmann"
},
{
"context": "****\n * Copyright (c) 2004-2015 Gabo... | null | [] | /*******************************************************************************
* Copyright (c) 2004-2015 <NAME> and <NAME>
* 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:
* <NAME> - initial API and implementation
*******************************************************************************/
package org.mondo.collaboration.security.lens.emf;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.viatra.query.runtime.base.api.BaseIndexOptions;
import org.eclipse.viatra.query.runtime.base.api.NavigationHelper;
import org.eclipse.viatra.query.runtime.base.comprehension.EMFModelComprehension;
import org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple;
import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
import org.mondo.collaboration.security.lens.util.ILiveRelation;
import org.mondo.collaboration.security.lens.util.LiveTable;
import org.mondo.collaboration.security.lens.util.uri.URIRelativiser;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
/**
* Indexes the contents of a given EMF model.
* <p> The EMF model is indexed and exposed as {@link LiveTable}s.
*
* @author <NAME>
*
*/
public class ModelIndexer {
private ResourceSet root;
//private Resource unrootedElements = new XMIResourceImpl();
private URI baseURI;
NavigationHelper daisyChainedIndexer; // cheapMoveTo() is daisy-chained to this indexer
EMFModelComprehension comprehension = new EMFModelComprehension(new BaseIndexOptions(false, true));
URIRelativiser uriRelativiser;
Set<EObject> unrootedObjects = new HashSet<>();
LiveTable indexedResources = new LiveTable();
LiveTable indexedResourceRootContents = new LiveTable();
LiveTable indexedEObjects = new LiveTable();
LiveTable indexedEObjectReferences = new LiveTable();
LiveTable indexedEObjectAttributes = new LiveTable();
Map<ModelFactInputKey, LiveTable> liveIndexTables = Maps.immutableEnumMap(ImmutableMap.of(
ModelFactInputKey.ATTRIBUTE_KEY, indexedEObjectAttributes,
ModelFactInputKey.EOBJECT_KEY, indexedEObjects,
ModelFactInputKey.REFERENCE_KEY, indexedEObjectReferences,
ModelFactInputKey.RESOURCE_KEY, indexedResources,
ModelFactInputKey.RESOURCE_ROOT_CONTENTS_KEY, indexedResourceRootContents
));
Map<ModelFactInputKey, ILiveRelation> liveIndexRelations = ImmutableMap.copyOf(liveIndexTables);
public ModelIndexer(URI baseURI, ResourceSet root, NavigationHelper daisyChainedIndexer) {
super();
this.root = root;
this.baseURI = baseURI;
this.daisyChainedIndexer = daisyChainedIndexer;
this.uriRelativiser = new URIRelativiser(baseURI);
final EMFAdapter emfAdapter = new EMFAdapter(this);
this.adapter = emfAdapter;
emfAdapter.addAdapter(root);
//emfAdapter.addAdapter(dummyResource);
}
public ModelIndexer(URI baseURI, ResourceSet root) {
this(baseURI, root, null);
}
public URI getBaseURI() {
return baseURI;
}
public URIRelativiser getUriRelativiser() {
return uriRelativiser;
}
public ResourceSet getRoot() {
return root;
}
// /**
// * A dummy resource that contains unrooted elements,
// * i.e. model element created by a transformation but not yet placed in the actual containment hierarchy of the model,
// * or elements removed from the containment hierarchy but not yet deleted.
// */
// public Resource getDummyResource() {
// return dummyResource;
// }
public Map<ModelFactInputKey, LiveTable> getLiveIndexTables() {
return liveIndexTables;
}
public Map<ModelFactInputKey, ILiveRelation> getLiveIndexRelations() {
return liveIndexRelations;
}
EMFAdapter adapter;
public Iterable<EObject> getAllEObjects() {
Collection<EObject> objects = new HashSet<>();
for (Tuple tuple : indexedEObjects.getTuplesForSeed(new FlatTuple(null, null))) {
objects.add((EObject) tuple.get(0));
}
for (Tuple tuple : indexedEObjectReferences.getTuplesForSeed(new FlatTuple(null, null, null))) {
objects.add((EObject) tuple.get(2));
}
return objects;
}
public void addUnrooted(EObject instance) {
unrootedObjects.add(instance);
adapter.addAdapter(instance);
}
public boolean removeUnrooted(EObject element) {
boolean removed = unrootedObjects.remove(element);
if (removed) {
adapter.removeAdapter(element);
} else { // not unrooted?
removeFromContainment(element);
}
return removed;
}
/**
* @param containedObject
*/
public void cheapUnroot(EObject element) {
if (element.eAdapters().contains(adapter)) {
adapter.ignoreInsertionAndDeletion = element;
try {
unrootedObjects.add(element);
removeFromContainment(element);
// if (daisyChainedIndexer == null)
// targetContainmentReferenceList.add(element);
// else
// daisyChainedIndexer.cheapMoveTo(element, targetContainmentReferenceList);
} finally {
adapter.ignoreInsertionAndDeletion = null;
}
} else {
addUnrooted(element);
}
}
private void removeFromContainment(EObject element) {
EObject eContainer = element.eContainer();
if (eContainer != null) {
EReference feature = element.eContainmentFeature();
if (feature.isMany())
((Collection<?>) eContainer.eGet(feature)).remove(element);
else
eContainer.eUnset(feature);
}
final Resource eResource = element.eResource();
if (eResource != null) {
eResource.getContents().remove(element);
}
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public void cheapMoveTo(EObject element, Notifier parent, EList targetContainmentReferenceList) {
if (element.eAdapters().contains(adapter) && parent.eAdapters().contains(adapter)) {
adapter.ignoreInsertionAndDeletion = element;
try {
if (unrootedObjects.contains(element))
unrootedObjects.remove(element);
if (daisyChainedIndexer == null)
targetContainmentReferenceList.add(element);
else
daisyChainedIndexer.cheapMoveTo(element, targetContainmentReferenceList);
} finally {
adapter.ignoreInsertionAndDeletion = null;
}
} else {
targetContainmentReferenceList.add(element);
}
}
@SuppressWarnings("rawtypes")
public void cheapMoveTo(EObject element, EObject parent, EReference containmentFeature) {
if (containmentFeature.isMany())
cheapMoveTo(element, parent, (EList)parent.eGet(containmentFeature));
else if (element.eAdapters().contains(adapter) &&
parent.eAdapters().contains(adapter))
{
adapter.ignoreInsertionAndDeletion = element;
try {
if (unrootedObjects.contains(element))
unrootedObjects.remove(element);
if (daisyChainedIndexer == null)
parent.eSet(containmentFeature, element);
else
daisyChainedIndexer.cheapMoveTo(element, parent, containmentFeature);
} finally {
adapter.ignoreInsertionAndDeletion = null;
}
} else {
parent.eSet(containmentFeature, element);
}
}
}
| 7,728 | 0.70727 | 0.705465 | 227 | 33.176212 | 28.020521 | 123 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.845815 | false | false | 1 |
3e8b386ffbcc81423277bba12a51ba11185ab6e0 | 15,470,472,262,835 | 86f8ead7531ff11e9044f08eae22661889f1c26f | /src/me/extain/game/objects/BloodCell.java | d3c52597bed69911fec275e8f0137e8c45bbd662 | [] | no_license | Extain/ludumdare38 | https://github.com/Extain/ludumdare38 | c7dfd978a1f009a660fc9a01bcbc91e0ca0c289f | d0d0852e7e19f49c657230f056aea84012c6bdb1 | refs/heads/master | 2021-01-20T00:16:50.598000 | 2017-04-23T19:52:59 | 2017-04-23T19:52:59 | 89,105,711 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package me.extain.game.objects;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import me.extain.game.Main;
import me.extain.game.graphics.image.ImageLoader;
import me.extain.game.objects.component.Collider;
import me.extain.game.state.GameState;
public class BloodCell extends GameObject {
private boolean isVirus;
private GameState state;
private BufferedImage cell;
public BloodCell(Main main, GameState state, float posX, float posY) {
super(main, posX, posY);
this.state = state;
cell = ImageLoader.loadImage("/blood-cell.png");
this.addComponent(new Collider());
width = 24;
height = 24;
}
@Override
public void update() {
updateComponents();
}
@Override
public void render(Graphics2D graphics) {
graphics.drawImage(cell, (int) posX, (int) posY, null);
}
@Override
public void componentEvent(String tag, GameObject object) {
}
public void turnToVirus() {
this.isInfected = true;
}
}
| UTF-8 | Java | 989 | java | BloodCell.java | Java | [] | null | [] | package me.extain.game.objects;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import me.extain.game.Main;
import me.extain.game.graphics.image.ImageLoader;
import me.extain.game.objects.component.Collider;
import me.extain.game.state.GameState;
public class BloodCell extends GameObject {
private boolean isVirus;
private GameState state;
private BufferedImage cell;
public BloodCell(Main main, GameState state, float posX, float posY) {
super(main, posX, posY);
this.state = state;
cell = ImageLoader.loadImage("/blood-cell.png");
this.addComponent(new Collider());
width = 24;
height = 24;
}
@Override
public void update() {
updateComponents();
}
@Override
public void render(Graphics2D graphics) {
graphics.drawImage(cell, (int) posX, (int) posY, null);
}
@Override
public void componentEvent(String tag, GameObject object) {
}
public void turnToVirus() {
this.isInfected = true;
}
}
| 989 | 0.728008 | 0.721941 | 50 | 18.780001 | 19.154415 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.48 | false | false | 1 |
c15f7ad272a674b087d7ea4e590226bc71d56435 | 33,122,787,788,069 | 04bc8c0a45fc18bd2dd29c5c3841a78328e9735c | /src/sample/CheckValue.java | 56f0d71e8429c55f484a7e234f038716fb394d4b | [
"Unlicense"
] | permissive | gauer10/Mask | https://github.com/gauer10/Mask | 393eeb1e4c5373967c37b27c923f0261ea8c729e | cf87bd781658913fa18ab464a1a340e27a10c3ee | refs/heads/master | 2021-04-27T20:33:22.583000 | 2018-02-21T19:15:33 | 2018-02-21T19:15:33 | 122,381,368 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package sample;
public class CheckValue
{
public boolean checkCode(String kod, int lenght, int endConstant, String constant)
{
if (kod.length() == lenght)
{
if (kod.substring(0, endConstant).equals(constant))
return true;
else
return false;
}
else
return false;
}
public boolean checkCode2(String kod, int lenght)
{
if (kod.length() == lenght)
{
return true;
}
else
return false;
}
}
| UTF-8 | Java | 565 | java | CheckValue.java | Java | [] | null | [] | package sample;
public class CheckValue
{
public boolean checkCode(String kod, int lenght, int endConstant, String constant)
{
if (kod.length() == lenght)
{
if (kod.substring(0, endConstant).equals(constant))
return true;
else
return false;
}
else
return false;
}
public boolean checkCode2(String kod, int lenght)
{
if (kod.length() == lenght)
{
return true;
}
else
return false;
}
}
| 565 | 0.499115 | 0.495575 | 26 | 20.73077 | 20.215298 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.423077 | false | false | 1 |
1138662f4353d01b3c1e1035f6d32e7a5d89ffc5 | 7,078,106,156,539 | c94888699c4961de138b0d74a3f9fdae00c5d240 | /src/test/java/HandAssert.java | 6e00c61f6df43db7dc4518e1681666163dddf748 | [] | no_license | tpeyrard/PaperRockScissors | https://github.com/tpeyrard/PaperRockScissors | 4664277d804da550e2f2a5cffab99c34e24c7422 | 93e30f6eb6520816ded90705aca159b453092ab6 | refs/heads/master | 2020-12-03T19:16:58.812000 | 2016-08-22T15:49:55 | 2016-08-22T15:49:55 | 66,200,796 | 0 | 0 | null | false | 2016-08-22T11:30:13 | 2016-08-21T13:42:36 | 2016-08-21T13:43:14 | 2016-08-22T11:30:12 | 8 | 0 | 0 | 0 | Java | null | null | import org.fest.assertions.api.Assertions;
import org.fest.assertions.api.ObjectAssert;
public final class HandAssert extends ObjectAssert<Hand> {
private HandAssert(Hand actual) {
super(actual);
}
public static HandAssert assertThat(Hand result) {
return new HandAssert(result);
}
public void beats(Hand other) {
Assertions.assertThat(actual.beats(other)).isEqualTo(1);
}
}
| UTF-8 | Java | 418 | java | HandAssert.java | Java | [] | null | [] | import org.fest.assertions.api.Assertions;
import org.fest.assertions.api.ObjectAssert;
public final class HandAssert extends ObjectAssert<Hand> {
private HandAssert(Hand actual) {
super(actual);
}
public static HandAssert assertThat(Hand result) {
return new HandAssert(result);
}
public void beats(Hand other) {
Assertions.assertThat(actual.beats(other)).isEqualTo(1);
}
}
| 418 | 0.712919 | 0.710526 | 17 | 23.588236 | 22.507669 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.294118 | false | false | 1 |
242eff2fa8aa553d1c18f82385664459b7c316bf | 9,010,841,438,404 | f382dd8c3402b22fa268f6da19c15a514938b4a3 | /departComponent/src/main/java/dww/com/demo/depart/DepartApplicationAgent.java | 891c15ab4e28d364dd446e3a2b8f9f081ff93461 | [
"Apache-2.0"
] | permissive | dingdoublewei/MyComponentDemo | https://github.com/dingdoublewei/MyComponentDemo | 8abbb38ae48004099f91907b2e01477e953d12b4 | 47666801f8be5b882bcc7bc973cfce9e4901102e | refs/heads/master | 2020-03-28T15:13:28.435000 | 2019-01-24T05:15:06 | 2019-01-24T05:15:06 | 148,568,968 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package dww.com.demo.depart;
import android.util.Log;
import com.dww.demo.componentlib.interfaces.IApplication;
import com.dww.demo.componentlib.router.Router;
import com.dww.demo.componentservice.ui.FragmentService;
import com.luojilab.component.componentlib.router.ui.UIRouter;
import dww.com.demo.depart.serviceimlp.FragmentServiceImpl;
/**
* Created by dww on 2018/7/13.
*/
public class DepartApplicationAgent implements IApplication {
Router router = Router.getInstance();
UIRouter uiRouter = UIRouter.getInstance();
String TAG = DepartApplicationAgent.class.getSimpleName();
@Override
public void onCreate() {
uiRouter.registerUI("depart");
router.addService(FragmentService.class.getSimpleName(), new FragmentServiceImpl());
Log.d(TAG, "onCreate");
}
@Override
public void onTerminate() {
uiRouter.unregisterUI("depart");
router.removeService(FragmentService.class.getSimpleName());
Log.d(TAG, "onTerminate");
}
}
| UTF-8 | Java | 1,014 | java | DepartApplicationAgent.java | Java | [
{
"context": "erviceimlp.FragmentServiceImpl;\n\n/**\n * Created by dww on 2018/7/13.\n */\n\npublic class DepartApplication",
"end": 365,
"score": 0.9995846748352051,
"start": 362,
"tag": "USERNAME",
"value": "dww"
}
] | null | [] | package dww.com.demo.depart;
import android.util.Log;
import com.dww.demo.componentlib.interfaces.IApplication;
import com.dww.demo.componentlib.router.Router;
import com.dww.demo.componentservice.ui.FragmentService;
import com.luojilab.component.componentlib.router.ui.UIRouter;
import dww.com.demo.depart.serviceimlp.FragmentServiceImpl;
/**
* Created by dww on 2018/7/13.
*/
public class DepartApplicationAgent implements IApplication {
Router router = Router.getInstance();
UIRouter uiRouter = UIRouter.getInstance();
String TAG = DepartApplicationAgent.class.getSimpleName();
@Override
public void onCreate() {
uiRouter.registerUI("depart");
router.addService(FragmentService.class.getSimpleName(), new FragmentServiceImpl());
Log.d(TAG, "onCreate");
}
@Override
public void onTerminate() {
uiRouter.unregisterUI("depart");
router.removeService(FragmentService.class.getSimpleName());
Log.d(TAG, "onTerminate");
}
}
| 1,014 | 0.727811 | 0.720907 | 34 | 28.82353 | 25.349871 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.558824 | false | false | 1 |
8d41ade529056815e040f49205effae93e27e0ca | 9,010,841,440,396 | 8cdf551163626a86ba62e94c4eb60a3e114aa77b | /src/main/java/com/github/mr/impossibru/sudoku/solver/SudokuSolver.java | 642914c445bbbfe71d4a7eb36736575cdf8128de | [] | no_license | mr-impossibru/sudoku-solver | https://github.com/mr-impossibru/sudoku-solver | f13f6b22447ca7b491425e8d74dbe802bc954495 | 827880e780f91ce2319824e0001c104a3a05227f | refs/heads/master | 2023-01-03T09:41:31.039000 | 2020-10-19T13:25:48 | 2020-10-19T13:25:48 | 299,577,185 | 1 | 0 | null | false | 2020-10-19T13:25:50 | 2020-09-29T10:05:22 | 2020-10-19T11:19:49 | 2020-10-19T13:25:49 | 28 | 1 | 0 | 0 | Java | false | false | package com.github.mr.impossibru.sudoku.solver;
import java.util.List;
public interface SudokuSolver {
List<Integer[][]> solve(int[][] initialData);
}
| UTF-8 | Java | 159 | java | SudokuSolver.java | Java | [] | null | [] | package com.github.mr.impossibru.sudoku.solver;
import java.util.List;
public interface SudokuSolver {
List<Integer[][]> solve(int[][] initialData);
}
| 159 | 0.72327 | 0.72327 | 9 | 16.666666 | 19.877401 | 49 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 1 |
892d3de79615447c82e0fa3036d2f7ad6699ce6f | 9,929,964,394,750 | 11f07f841ac0178f057a8b0343c3971eb1a09279 | /f28sg-2020-21-lab2/test/RecursionTest.java | 8095ba21a88f6749983c5194901912c514036b52 | [] | no_license | nmp4/Data-Structures-University | https://github.com/nmp4/Data-Structures-University | 08e8ceb62a2c492c6356af37933f3f6cd2f62d8b | 3b4a0125ab3e88f3c08a2ba268b9ddefba55ab0b | refs/heads/master | 2023-04-14T17:03:15.133000 | 2021-04-21T17:41:32 | 2021-04-21T17:41:32 | 360,256,195 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | import static org.junit.Assert.*;
import org.junit.Test;
public class RecursionTest {
@Test
public void testSum() {
assertEquals(1,Recursion.sum(1));
assertEquals(3,Recursion.sum(2));
assertEquals(6,Recursion.sum(3));
assertEquals(10,Recursion.sum(4));
}
@Test
public void testMultiply() {
assertEquals(1,Recursion.multiply(1,1));
assertEquals(-1,Recursion.multiply(-1,1));
assertEquals(-1,Recursion.multiply(1,-1));
assertEquals(21,Recursion.multiply(7,3));
assertEquals(-21,Recursion.multiply(7,-3));
assertEquals(-21,Recursion.multiply(-7,3));
assertEquals(21,Recursion.multiply(-7,-3));
}
@Test
public void fibonacciTest() {
assertEquals(21, Recursion.Fibonacci(8));
}
}
| UTF-8 | Java | 716 | java | RecursionTest.java | Java | [] | null | [] | import static org.junit.Assert.*;
import org.junit.Test;
public class RecursionTest {
@Test
public void testSum() {
assertEquals(1,Recursion.sum(1));
assertEquals(3,Recursion.sum(2));
assertEquals(6,Recursion.sum(3));
assertEquals(10,Recursion.sum(4));
}
@Test
public void testMultiply() {
assertEquals(1,Recursion.multiply(1,1));
assertEquals(-1,Recursion.multiply(-1,1));
assertEquals(-1,Recursion.multiply(1,-1));
assertEquals(21,Recursion.multiply(7,3));
assertEquals(-21,Recursion.multiply(7,-3));
assertEquals(-21,Recursion.multiply(-7,3));
assertEquals(21,Recursion.multiply(-7,-3));
}
@Test
public void fibonacciTest() {
assertEquals(21, Recursion.Fibonacci(8));
}
}
| 716 | 0.709497 | 0.657821 | 31 | 22.096775 | 17.997051 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.193548 | false | false | 1 |
d89972b8ac6bcb9d01bcf572f458d549f16944af | 12,627,203,920,969 | a1e1de31928f6d42fbc57187e4e6f097d8f3e561 | /app/src/main/java/com/ekc/swiperight/ui/main/MainView.java | d980871e48e9ba0d6c4f1b2c3d5d4391970f0432 | [
"Apache-2.0"
] | permissive | ekchang/SwipeRight | https://github.com/ekchang/SwipeRight | 4226822e7a38b69275754b7936985ce8f18c4576 | 421af0b810b5b652b5b94aa3102d382845526d56 | refs/heads/master | 2019-12-02T02:32:48.516000 | 2016-06-29T18:26:40 | 2016-06-29T18:26:40 | 51,660,284 | 30 | 4 | null | false | 2016-02-24T04:36:27 | 2016-02-13T18:52:43 | 2016-02-18T07:45:26 | 2016-02-24T04:36:26 | 854 | 24 | 1 | 1 | Java | null | null | package com.ekc.swiperight.ui.main;
import com.ekc.swiperight.model.Match;
import com.ekc.swiperight.model.Recommendation;
import com.ekc.swiperight.ui.base.BaseView;
import java.util.List;
public interface MainView extends BaseView {
MainView EMPTY = new MainView() {
@Override public void loadRecommendations(List<Recommendation> results) {
}
@Override public void failure(String errorMessage) {
}
@Override public void showLoading() {
}
@Override public void hideLoading() {
}
@Override public void likeResponse(Match match, boolean likeAllInProgress) {
}
@Override public void showAuthError() {
}
@Override public void hideAuthError() {
}
@Override public void hideErrorViews() {
}
@Override public void showLimitReached() {
}
@Override public void hideLimitReached() {
}
@Override public void showConnectionError() {
}
@Override public void hideConnectionError() {
}
@Override public void showRecExhausted() {
}
@Override public void hideRecExhausted() {
}
};
void loadRecommendations(List<Recommendation> results);
void failure(String errorMessage);
void showLoading();
void hideLoading();
void likeResponse(Match match, boolean likeAllInProgress);
void showAuthError();
void hideAuthError();
void hideErrorViews();
void showLimitReached();
void hideLimitReached();
void showConnectionError();
void hideConnectionError();
void showRecExhausted();
void hideRecExhausted();
}
| UTF-8 | Java | 1,567 | java | MainView.java | Java | [] | null | [] | package com.ekc.swiperight.ui.main;
import com.ekc.swiperight.model.Match;
import com.ekc.swiperight.model.Recommendation;
import com.ekc.swiperight.ui.base.BaseView;
import java.util.List;
public interface MainView extends BaseView {
MainView EMPTY = new MainView() {
@Override public void loadRecommendations(List<Recommendation> results) {
}
@Override public void failure(String errorMessage) {
}
@Override public void showLoading() {
}
@Override public void hideLoading() {
}
@Override public void likeResponse(Match match, boolean likeAllInProgress) {
}
@Override public void showAuthError() {
}
@Override public void hideAuthError() {
}
@Override public void hideErrorViews() {
}
@Override public void showLimitReached() {
}
@Override public void hideLimitReached() {
}
@Override public void showConnectionError() {
}
@Override public void hideConnectionError() {
}
@Override public void showRecExhausted() {
}
@Override public void hideRecExhausted() {
}
};
void loadRecommendations(List<Recommendation> results);
void failure(String errorMessage);
void showLoading();
void hideLoading();
void likeResponse(Match match, boolean likeAllInProgress);
void showAuthError();
void hideAuthError();
void hideErrorViews();
void showLimitReached();
void hideLimitReached();
void showConnectionError();
void hideConnectionError();
void showRecExhausted();
void hideRecExhausted();
}
| 1,567 | 0.691768 | 0.691768 | 94 | 15.670213 | 20.739206 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.234043 | false | false | 1 |
7fee2b40176e4dda6ccd6e330433e0e3a5472e8a | 17,360,257,848,863 | 7b48b1908f2e23b1d594c3fb0c175364cad8ac6d | /edu.pdx.svl.coDoc.cdc/src/edu/pdx/svl/coDoc/cdc/handles/DeleteReference.java | 603edb1ef2f7c6e3b3d8ef9e6e581798ef00d20e | [] | no_license | hellozt/coDoc | https://github.com/hellozt/coDoc | 89bd3928a289dc5a1a53ef81d8048c82eb0cdf46 | 7015c431c9b903a19c0785631c7eb76d857e23cf | refs/heads/master | 2021-01-17T18:23:57.253000 | 2013-05-04T16:09:52 | 2013-05-04T16:09:52 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*******************************************************************************
* Copyright (c) 2011 Boris von Loesch.
* 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:
* Boris von Loesch - initial API and implementation
******************************************************************************/
package edu.pdx.svl.coDoc.cdc.handles;
import java.util.Iterator;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.texteditor.ITextEditor;
import edu.pdx.svl.coDoc.cdc.Global;
import edu.pdx.svl.coDoc.cdc.datacenter.CDCModel;
import edu.pdx.svl.coDoc.cdc.editor.CDCEditor;
import edu.pdx.svl.coDoc.cdc.editor.EntryEditor;
import edu.pdx.svl.coDoc.cdc.editor.IReferenceExplorer;
import edu.pdx.svl.coDoc.cdc.referencemodel.Reference;
import edu.pdx.svl.coDoc.cdc.referencemodel.References;
/**
* Triggers a forward search in all open pdf editors. Opens the first
* editor for which the search was successful.
*
* @author Boris von Loesch
*
*/
public class DeleteReference extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
// IEditorPart e = HandlerUtil.getActiveEditor(event);
CDCEditor.deleteEntry();
return null;
}
}
| UTF-8 | Java | 2,091 | java | DeleteReference.java | Java | [
{
"context": "***************************\r\n * Copyright (c) 2011 Boris von Loesch.\r\n * All rights reserved. This program and the ac",
"end": 120,
"score": 0.999881386756897,
"start": 104,
"tag": "NAME",
"value": "Boris von Loesch"
},
{
"context": "/legal/epl-v10.html\r\n * \r\n *... | null | [] | /*******************************************************************************
* Copyright (c) 2011 <NAME>.
* 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:
* <NAME> - initial API and implementation
******************************************************************************/
package edu.pdx.svl.coDoc.cdc.handles;
import java.util.Iterator;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.texteditor.ITextEditor;
import edu.pdx.svl.coDoc.cdc.Global;
import edu.pdx.svl.coDoc.cdc.datacenter.CDCModel;
import edu.pdx.svl.coDoc.cdc.editor.CDCEditor;
import edu.pdx.svl.coDoc.cdc.editor.EntryEditor;
import edu.pdx.svl.coDoc.cdc.editor.IReferenceExplorer;
import edu.pdx.svl.coDoc.cdc.referencemodel.Reference;
import edu.pdx.svl.coDoc.cdc.referencemodel.References;
/**
* Triggers a forward search in all open pdf editors. Opens the first
* editor for which the search was successful.
*
* @author <NAME>
*
*/
public class DeleteReference extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
// IEditorPart e = HandlerUtil.getActiveEditor(event);
CDCEditor.deleteEntry();
return null;
}
}
| 2,061 | 0.714491 | 0.710665 | 56 | 35.339287 | 23.318659 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.696429 | false | false | 1 |
a9d27e4a80da10802b87c5ba58f02cb80b5eee66 | 17,669,495,506,425 | 37f7d014544e91d6e3ae5e6a51ba1405ab13eba9 | /app/src/main/java/net/nwatmb/equipmentsmanager/EquipmentInfo.java | 3024aaf3d2140236d8ad3c9263c35b96970a4632 | [] | no_license | TreeNewBeeee/EquipmentManager | https://github.com/TreeNewBeeee/EquipmentManager | f2184ddde8e7425d54f82e37c9fc465b0b345e75 | dbc7b51abc0f0f6987c0aace0b0e05511d666c66 | refs/heads/master | 2021-08-07T18:15:12.272000 | 2017-11-08T17:22:23 | 2017-11-08T17:22:23 | 109,556,783 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.nwatmb.equipmentsmanager;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
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.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.zxing.activity.CaptureActivity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
/**
* Created by NWATMB on 2015/7/7.
*/
public class EquipmentInfo extends Fragment {
private ImageButton mCamera;
private String spareID;
private LinearLayout mContentBlock; //内容块
private LinearLayout mCameraWrap; //照相机块
private TextView mName;
private TextView mSpareDivision;
private TextView mSpareHouse;
private TextView mLocation;
private TextView mSpareSystem;
private TextView mSpareType;
private TextView mLabel;
private TextView mModel;
private TextView mSN;
private TextView mSeller;
private TextView mManufacture;
private TextView mPrice;
private TextView mOrderDate;
private TextView mTestPeriod;
private TextView mQuantity;
private TextView mCreateDate;
private TextView mUpdateDate;
private TextView mOperator;
/*数据库读取*/
private static final String url_spare_detials =
"http://192.168.8.105/androidHTTP/DB_OPE/get_spare_details.php";
private static final String url_id_name =
"http://192.168.8.105/androidHTTP/DB_OPE/get_id_name.php";
// Progress Dialog
private ProgressDialog pDialog;
// JSON parser class
JSONParser jsonParser = new JSONParser();
// JSON Node names
private static final String TAG_SUCCESS = "success";
private static final String TAG_SPARE = "spare_info";
private static final String TAG_AUTHORITY = "result";
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_equipment_info,container,false);
/* regist the module */
mCamera = (ImageButton) v.findViewById(R.id.camera);
mContentBlock = (LinearLayout) v.findViewById(R.id.content_block);
mCameraWrap = (LinearLayout) v.findViewById(R.id.camera_wrap);
mName = (TextView) v.findViewById(R.id.name);
mSpareDivision = (TextView) v.findViewById(R.id.spare_division);
mSpareHouse = (TextView) v.findViewById(R.id.spare_house);
mLocation = (TextView) v.findViewById(R.id.location);
mSpareSystem = (TextView) v.findViewById(R.id.spare_system);
mSpareType = (TextView) v.findViewById(R.id.spare_type);
mLabel = (TextView) v.findViewById(R.id.label);
mModel = (TextView) v.findViewById(R.id.model);
mSN = (TextView) v.findViewById(R.id.SN);
mSeller = (TextView) v.findViewById(R.id.seller);
mManufacture = (TextView) v.findViewById(R.id.manufacture);
mPrice = (TextView) v.findViewById(R.id.price);
mOrderDate = (TextView) v.findViewById(R.id.orderDate);
mTestPeriod = (TextView) v.findViewById(R.id.testPeriod);
mQuantity = (TextView) v.findViewById(R.id.quantity);
mCreateDate = (TextView) v.findViewById(R.id.createDate);
mUpdateDate = (TextView) v.findViewById(R.id.updateDate);
mOperator = (TextView) v.findViewById(R.id.operator);
mCamera.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent startScan = new Intent(EquipmentInfo.this.getActivity(), CaptureActivity.class);
startActivityForResult(startScan, 999);
}
});
return v;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
/*扫码后获取备件ID*/
if (requestCode == 999){
spareID = data.getExtras().getString("result");
mContentBlock.setVisibility(View.VISIBLE); // 显示表单
mCameraWrap.setVisibility(View.GONE); // 隐藏相机按钮
// Toast.makeText(getActivity(),result,Toast.LENGTH_SHORT).show();
// TODO: 后期二维码扫描后为URL格式,需提取相应参数
LoadSpareDetail spareDetail = new LoadSpareDetail();
JSONObject object = new JSONObject();
try {
object = spareDetail.execute().get();
// 获取最后经手人
String[] vars = new String[]{"user_id",object.getString("user_id")};
getIdName getOperatorName = new getIdName();
String operator = getOperatorName.execute(vars).get();
// 获取部门名称
vars = new String[]{"division_id",object.getString("division_id")};
getIdName getDivisionName = new getIdName();
String division = getDivisionName.execute(vars).get();
// 获取库房名称
vars = new String[]{"spare_house_id",object.getString("spare_house_id")};
getIdName getSpareHouseName = new getIdName();
String spareHouse = getSpareHouseName.execute(vars).get();
// 获取所属系统
vars = new String[]{"spare_system_id",object.getString("spare_system_id")};
getIdName getSystemName = new getIdName();
String system = getSystemName.execute(vars).get();
// 获取备件分类
vars = new String[]{"spare_type_id",object.getString("spare_type_id")};
getIdName getTypeName = new getIdName();
String type = getTypeName.execute(vars).get();
mName.setText(object.getString("name"));
mSpareDivision.setText(division);
mSpareHouse.setText(spareHouse);
mLocation.setText(object.getString("location"));
mSpareSystem.setText(system);
mSpareType.setText(type);
mLabel.setText(object.getString("label"));
mModel.setText(object.getString("model"));
mSN.setText(object.getString("sn"));
mSeller.setText(object.getString("seller"));
mManufacture.setText(object.getString("manufacturer"));
mPrice.setText(object.getString("orderprice"));
mOrderDate.setText(object.getString("orderdate"));
mTestPeriod.setText(object.getString("testperiod"));
mQuantity.setText(object.getString("quantity"));
mCreateDate.setText(object.getString("created_at"));
mUpdateDate.setText(object.getString("updated_at"));
mOperator.setText(operator);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
}
}
@SuppressLint("StaticFieldLeak")
class getIdName extends AsyncTask<String,Void,String>{
@Override
protected String doInBackground(String... strings) {
int success;
List<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair(strings[0], strings[1]));
//Log.d("PARAMS", params.toString());
JSONObject json = jsonParser.makeHttpRequest(url_id_name, "GET", params);
try {
success = json.getInt(TAG_SUCCESS);
if (success == 1) {
String name = json.getString("name");
return name;
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
}
}
/**
* Background Async Task to Get Spare info
*/
@SuppressLint("StaticFieldLeak")
class LoadSpareDetail extends AsyncTask<Void, Void, JSONObject> {
/**
* Before starting background thread Show Progress Dialog
*/
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(getActivity());
pDialog.setMessage(getString(R.string.loading));
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
}
/**
* Getting product details in background thread
*/
@Override
protected JSONObject doInBackground(Void... voids) {
int success;
List<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("spareID", spareID));
//Log.d("PARAMS", params.toString());
JSONObject json = jsonParser.makeHttpRequest(url_spare_detials, "GET", params);
Log.d("Spare Details", json.toString());
try {
success = json.getInt(TAG_SUCCESS);
if (success == 1) {
JSONArray userOBJ = json.getJSONArray(TAG_SPARE);
JSONObject user = userOBJ.getJSONObject(0);
return user;
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
/**
* After completing background task Dismiss the progress dialog
**/
@Override
protected void onPostExecute(JSONObject jsonObject) {
super.onPostExecute(jsonObject);
pDialog.dismiss();
}
}
}
| UTF-8 | Java | 10,463 | java | EquipmentInfo.java | Java | [
{
"context": ".concurrent.ExecutionException;\n\n/**\n * Created by NWATMB on 2015/7/7.\n */\npublic class EquipmentInfo exten",
"end": 851,
"score": 0.9996392130851746,
"start": 845,
"tag": "USERNAME",
"value": "NWATMB"
},
{
"context": "al String url_spare_detials =\n \"h... | null | [] | package net.nwatmb.equipmentsmanager;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
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.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.zxing.activity.CaptureActivity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
/**
* Created by NWATMB on 2015/7/7.
*/
public class EquipmentInfo extends Fragment {
private ImageButton mCamera;
private String spareID;
private LinearLayout mContentBlock; //内容块
private LinearLayout mCameraWrap; //照相机块
private TextView mName;
private TextView mSpareDivision;
private TextView mSpareHouse;
private TextView mLocation;
private TextView mSpareSystem;
private TextView mSpareType;
private TextView mLabel;
private TextView mModel;
private TextView mSN;
private TextView mSeller;
private TextView mManufacture;
private TextView mPrice;
private TextView mOrderDate;
private TextView mTestPeriod;
private TextView mQuantity;
private TextView mCreateDate;
private TextView mUpdateDate;
private TextView mOperator;
/*数据库读取*/
private static final String url_spare_detials =
"http://192.168.8.105/androidHTTP/DB_OPE/get_spare_details.php";
private static final String url_id_name =
"http://1172.16.31.10/androidHTTP/DB_OPE/get_id_name.php";
// Progress Dialog
private ProgressDialog pDialog;
// JSON parser class
JSONParser jsonParser = new JSONParser();
// JSON Node names
private static final String TAG_SUCCESS = "success";
private static final String TAG_SPARE = "spare_info";
private static final String TAG_AUTHORITY = "result";
@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_equipment_info,container,false);
/* regist the module */
mCamera = (ImageButton) v.findViewById(R.id.camera);
mContentBlock = (LinearLayout) v.findViewById(R.id.content_block);
mCameraWrap = (LinearLayout) v.findViewById(R.id.camera_wrap);
mName = (TextView) v.findViewById(R.id.name);
mSpareDivision = (TextView) v.findViewById(R.id.spare_division);
mSpareHouse = (TextView) v.findViewById(R.id.spare_house);
mLocation = (TextView) v.findViewById(R.id.location);
mSpareSystem = (TextView) v.findViewById(R.id.spare_system);
mSpareType = (TextView) v.findViewById(R.id.spare_type);
mLabel = (TextView) v.findViewById(R.id.label);
mModel = (TextView) v.findViewById(R.id.model);
mSN = (TextView) v.findViewById(R.id.SN);
mSeller = (TextView) v.findViewById(R.id.seller);
mManufacture = (TextView) v.findViewById(R.id.manufacture);
mPrice = (TextView) v.findViewById(R.id.price);
mOrderDate = (TextView) v.findViewById(R.id.orderDate);
mTestPeriod = (TextView) v.findViewById(R.id.testPeriod);
mQuantity = (TextView) v.findViewById(R.id.quantity);
mCreateDate = (TextView) v.findViewById(R.id.createDate);
mUpdateDate = (TextView) v.findViewById(R.id.updateDate);
mOperator = (TextView) v.findViewById(R.id.operator);
mCamera.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent startScan = new Intent(EquipmentInfo.this.getActivity(), CaptureActivity.class);
startActivityForResult(startScan, 999);
}
});
return v;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
/*扫码后获取备件ID*/
if (requestCode == 999){
spareID = data.getExtras().getString("result");
mContentBlock.setVisibility(View.VISIBLE); // 显示表单
mCameraWrap.setVisibility(View.GONE); // 隐藏相机按钮
// Toast.makeText(getActivity(),result,Toast.LENGTH_SHORT).show();
// TODO: 后期二维码扫描后为URL格式,需提取相应参数
LoadSpareDetail spareDetail = new LoadSpareDetail();
JSONObject object = new JSONObject();
try {
object = spareDetail.execute().get();
// 获取最后经手人
String[] vars = new String[]{"user_id",object.getString("user_id")};
getIdName getOperatorName = new getIdName();
String operator = getOperatorName.execute(vars).get();
// 获取部门名称
vars = new String[]{"division_id",object.getString("division_id")};
getIdName getDivisionName = new getIdName();
String division = getDivisionName.execute(vars).get();
// 获取库房名称
vars = new String[]{"spare_house_id",object.getString("spare_house_id")};
getIdName getSpareHouseName = new getIdName();
String spareHouse = getSpareHouseName.execute(vars).get();
// 获取所属系统
vars = new String[]{"spare_system_id",object.getString("spare_system_id")};
getIdName getSystemName = new getIdName();
String system = getSystemName.execute(vars).get();
// 获取备件分类
vars = new String[]{"spare_type_id",object.getString("spare_type_id")};
getIdName getTypeName = new getIdName();
String type = getTypeName.execute(vars).get();
mName.setText(object.getString("name"));
mSpareDivision.setText(division);
mSpareHouse.setText(spareHouse);
mLocation.setText(object.getString("location"));
mSpareSystem.setText(system);
mSpareType.setText(type);
mLabel.setText(object.getString("label"));
mModel.setText(object.getString("model"));
mSN.setText(object.getString("sn"));
mSeller.setText(object.getString("seller"));
mManufacture.setText(object.getString("manufacturer"));
mPrice.setText(object.getString("orderprice"));
mOrderDate.setText(object.getString("orderdate"));
mTestPeriod.setText(object.getString("testperiod"));
mQuantity.setText(object.getString("quantity"));
mCreateDate.setText(object.getString("created_at"));
mUpdateDate.setText(object.getString("updated_at"));
mOperator.setText(operator);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
}
}
@SuppressLint("StaticFieldLeak")
class getIdName extends AsyncTask<String,Void,String>{
@Override
protected String doInBackground(String... strings) {
int success;
List<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair(strings[0], strings[1]));
//Log.d("PARAMS", params.toString());
JSONObject json = jsonParser.makeHttpRequest(url_id_name, "GET", params);
try {
success = json.getInt(TAG_SUCCESS);
if (success == 1) {
String name = json.getString("name");
return name;
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
}
}
/**
* Background Async Task to Get Spare info
*/
@SuppressLint("StaticFieldLeak")
class LoadSpareDetail extends AsyncTask<Void, Void, JSONObject> {
/**
* Before starting background thread Show Progress Dialog
*/
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(getActivity());
pDialog.setMessage(getString(R.string.loading));
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
}
/**
* Getting product details in background thread
*/
@Override
protected JSONObject doInBackground(Void... voids) {
int success;
List<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("spareID", spareID));
//Log.d("PARAMS", params.toString());
JSONObject json = jsonParser.makeHttpRequest(url_spare_detials, "GET", params);
Log.d("Spare Details", json.toString());
try {
success = json.getInt(TAG_SUCCESS);
if (success == 1) {
JSONArray userOBJ = json.getJSONArray(TAG_SPARE);
JSONObject user = userOBJ.getJSONObject(0);
return user;
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
/**
* After completing background task Dismiss the progress dialog
**/
@Override
protected void onPostExecute(JSONObject jsonObject) {
super.onPostExecute(jsonObject);
pDialog.dismiss();
}
}
}
| 10,463 | 0.614168 | 0.61048 | 273 | 36.747253 | 25.150358 | 123 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.677656 | false | false | 1 |
82ea63140c6cc3845bbcee80f468f7747b847703 | 23,914,377,906,514 | 3e3986b3752fd252cd758d7d0c76fc6e01445b68 | /src/test/java/org/wisefull/tests/CommonAreasTests.java | 0cad370df9b8782949b4dc0b51aa7c9bc7f61c22 | [] | no_license | nurBetul/WiseFullAcademyProject | https://github.com/nurBetul/WiseFullAcademyProject | 547839a2a56a00e353a979dee603d907f3430c7c | 0578ac09bb7a5ce1aeb6a3aa1e46e0ed7befe3bf | refs/heads/master | 2023-05-14T06:21:36.911000 | 2020-01-07T03:56:05 | 2020-01-07T03:56:05 | 232,235,366 | 0 | 0 | null | false | 2023-05-09T18:37:30 | 2020-01-07T03:32:23 | 2020-01-07T03:56:37 | 2023-05-09T18:37:27 | 28 | 0 | 0 | 1 | Java | false | false | package org.wisefull.tests;
import org.testng.annotations.Test;
import org.wisefull.common.TestBase;
import org.wisefull.pages.CommonAreas;
public class CommonAreasTests extends TestBase {
CommonAreas commonAreas = new CommonAreas();
@Test
public void verifyIfTheMagnifierGlassIsClickable() throws InterruptedException {
commonAreas.clickMagnifyingGlass();
}
@Test
public void verifyIfScrollsDownAndClicksWorldMapImage() throws InterruptedException {
commonAreas.scrollDownClickWorldMapImage();
}
@Test
public void verifyIfCanNavigateAcademicCoachingPage() throws InterruptedException {
commonAreas.navigateAcademicCoachingPage();
}
}
| UTF-8 | Java | 705 | java | CommonAreasTests.java | Java | [] | null | [] | package org.wisefull.tests;
import org.testng.annotations.Test;
import org.wisefull.common.TestBase;
import org.wisefull.pages.CommonAreas;
public class CommonAreasTests extends TestBase {
CommonAreas commonAreas = new CommonAreas();
@Test
public void verifyIfTheMagnifierGlassIsClickable() throws InterruptedException {
commonAreas.clickMagnifyingGlass();
}
@Test
public void verifyIfScrollsDownAndClicksWorldMapImage() throws InterruptedException {
commonAreas.scrollDownClickWorldMapImage();
}
@Test
public void verifyIfCanNavigateAcademicCoachingPage() throws InterruptedException {
commonAreas.navigateAcademicCoachingPage();
}
}
| 705 | 0.765957 | 0.765957 | 21 | 32.57143 | 28.70137 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.380952 | false | false | 1 |
f472225f3733361412aac43a6a2a78d538db474e | 24,326,694,788,978 | 15ca2deaf56fe0a2f81ff4dcc5e7f2195c9123c6 | /analytics-service/src/main/java/com/hayba/microservices/analytics/service/dataaccess/entity/BaseEntity.java | 3de485a4727305aecdbfeea5ee53c482da0fcdbd | [] | no_license | AbassAdeyemi/microservice | https://github.com/AbassAdeyemi/microservice | b6c4f27c60d72ce13c7d4e8a83dded99f05860c0 | 42401f6241c74bcf34e79167b9f8a4a99ef728b2 | refs/heads/master | 2023-06-30T00:42:43.849000 | 2021-07-26T14:09:42 | 2021-07-26T14:09:42 | 357,533,556 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.hayba.microservices.analytics.service.dataaccess.entity;
public interface BaseEntity<PK> {
PK getId();
}
| UTF-8 | Java | 122 | java | BaseEntity.java | Java | [] | null | [] | package com.hayba.microservices.analytics.service.dataaccess.entity;
public interface BaseEntity<PK> {
PK getId();
}
| 122 | 0.770492 | 0.770492 | 5 | 23.4 | 25.302965 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false | 13 |
8b24d462681bf85edcbdcc7ca102bef6b80ce602 | 1,271,310,355,105 | ffc952ce7c807496667e709b047430462c345c47 | /pa/src/plugin/java/com.lehow.pa/MyApp.java | 170f8d80cb52878e42b3f90bc45ab78fc808dcc5 | [] | no_license | luohaoxuan320/RePluginDemo | https://github.com/luohaoxuan320/RePluginDemo | f1ffda6fe22fa54567d4c7d15f26ad6c5678549f | 33ab665c897a09f6f1f6af63c8e3fec54a9649fa | refs/heads/master | 2021-09-13T00:13:22.815000 | 2018-04-21T07:45:55 | 2018-04-21T07:45:55 | 114,355,135 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lehow.pa;
import android.app.Application;
import android.util.Log;
import com.qihoo360.replugin.RePlugin;
public class MyApp extends Application {
@Override public void onCreate() {
super.onCreate();
Log.i("MyApp", "onCreate: getHostContext="+ RePlugin.getHostContext());
Log.i("MyApp", "onCreate: getPluginContext="+ RePlugin.getPluginContext());
Log.i("MyApp", "onCreate: Application="+this);
}
}
| UTF-8 | Java | 434 | java | MyApp.java | Java | [] | null | [] | package com.lehow.pa;
import android.app.Application;
import android.util.Log;
import com.qihoo360.replugin.RePlugin;
public class MyApp extends Application {
@Override public void onCreate() {
super.onCreate();
Log.i("MyApp", "onCreate: getHostContext="+ RePlugin.getHostContext());
Log.i("MyApp", "onCreate: getPluginContext="+ RePlugin.getPluginContext());
Log.i("MyApp", "onCreate: Application="+this);
}
}
| 434 | 0.718894 | 0.711982 | 15 | 27.933332 | 25.074467 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.733333 | false | false | 13 |
9adbf75ac8dd04e4e8ee6d40019e639535154237 | 8,263,517,119,890 | c2048673a7f0e4208e5bddc404bcd035de7a5e38 | /app/src/main/java/com/dimaoprog/sportsconnectivity/receiptViews/MyReceiptDetailViewModel.java | 3a415c9d5ea898fe510b15ac4b32f27ee4a4617f | [] | no_license | DimaOvsyanyk/Sports-Connectivity | https://github.com/DimaOvsyanyk/Sports-Connectivity | 9e37cfe8d83b340882655d4eaebd85cc5cf85ad5 | 4f40ba4eb39008d014940c0b4b766996c41f0c35 | refs/heads/master | 2020-05-01T11:47:39.560000 | 2019-05-26T20:24:23 | 2019-05-26T20:24:23 | 177,452,085 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.dimaoprog.sportsconnectivity.receiptViews;
import android.app.Application;
import android.arch.lifecycle.AndroidViewModel;
import android.support.annotation.NonNull;
import com.dimaoprog.sportsconnectivity.dbEntities.MealDBFavorite;
import com.dimaoprog.sportsconnectivity.dbRepos.MealDBRepository;
public class MyReceiptDetailViewModel extends AndroidViewModel {
private MealDBFavorite currentMealDBFavorite;
private MealDBRepository mealDBRepo;
public MyReceiptDetailViewModel(@NonNull Application application) {
super(application);
mealDBRepo = new MealDBRepository(application);
}
public void setCurrentMealDBFavorite(long id) {
currentMealDBFavorite = mealDBRepo.getMealDBFavotireById(id);
}
public MealDBFavorite getCurrentMealDBFavorite() {
return currentMealDBFavorite;
}
}
| UTF-8 | Java | 865 | java | MyReceiptDetailViewModel.java | Java | [] | null | [] | package com.dimaoprog.sportsconnectivity.receiptViews;
import android.app.Application;
import android.arch.lifecycle.AndroidViewModel;
import android.support.annotation.NonNull;
import com.dimaoprog.sportsconnectivity.dbEntities.MealDBFavorite;
import com.dimaoprog.sportsconnectivity.dbRepos.MealDBRepository;
public class MyReceiptDetailViewModel extends AndroidViewModel {
private MealDBFavorite currentMealDBFavorite;
private MealDBRepository mealDBRepo;
public MyReceiptDetailViewModel(@NonNull Application application) {
super(application);
mealDBRepo = new MealDBRepository(application);
}
public void setCurrentMealDBFavorite(long id) {
currentMealDBFavorite = mealDBRepo.getMealDBFavotireById(id);
}
public MealDBFavorite getCurrentMealDBFavorite() {
return currentMealDBFavorite;
}
}
| 865 | 0.79422 | 0.79422 | 27 | 31.037037 | 26.553205 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false | 13 |
1971f05f29c9536dbd64825ef4f2145906bec2e5 | 30,047,591,210,571 | 7f11f6bd1ace8890187d0ebc13f6d0eac91ee859 | /src/com/example/activity/MenuControllerListener.java | a3c027d7e8e22f3525215e1094ce98aab3450406 | [] | no_license | wu162/cddGame | https://github.com/wu162/cddGame | c90210490405895b639810319160e5f1ba75c234 | 43107e5561f64af3986e3a7fb69f5f9e9f1d9cf6 | refs/heads/master | 2020-06-01T15:27:01.466000 | 2019-06-08T01:55:53 | 2019-06-08T01:55:53 | 190,833,351 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.activity;
public interface MenuControllerListener {
public void onStartGame();
public void onHelp();
public void onAbout();
}
| UTF-8 | Java | 150 | java | MenuControllerListener.java | Java | [] | null | [] | package com.example.activity;
public interface MenuControllerListener {
public void onStartGame();
public void onHelp();
public void onAbout();
}
| 150 | 0.773333 | 0.773333 | 7 | 20.428572 | 13.854934 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false | 13 |
e5129d9c90be1e8247234bc9b20b41c2f565e26b | 31,877,247,308,162 | d9cd01130f95f38801cb8bea8a37d99ea749f911 | /server/src/main/java/server/Registration.java | 6d286de6ebcb3ce6359976e825dd69f5fb42cb58 | [] | no_license | NickMus/chat_geekchat_16012021 | https://github.com/NickMus/chat_geekchat_16012021 | bec6f521db3080998795294037ec69bd4e27e0fa | 841594c3e1954cf9e6dd2432d26bee554e51bc85 | refs/heads/master | 2023-03-01T05:45:32.385000 | 2021-02-09T16:51:10 | 2021-02-09T16:51:10 | 333,019,452 | 0 | 0 | null | false | 2021-02-09T16:51:11 | 2021-01-26T08:28:21 | 2021-01-27T11:52:05 | 2021-02-09T16:51:11 | 16 | 0 | 0 | 1 | Java | false | false | package server;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
public class Registration {
@FXML
private ResourceBundle resources;
@FXML
private URL location;
@FXML
private TextField loginField;
@FXML
private Button signUpButton;
@FXML
private PasswordField passField;
@FXML
private TextField name;
@FXML
private TextField lastname;
@FXML
private TextField mail;
@FXML
private TextField passField2;
@FXML
private Button backButton;
@FXML
void initialize() {
backButton.setOnAction(event -> {
backButton.getScene().getWindow().hide();
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("/sample/sample.fxml"));
try {
loader.load();
} catch (IOException e) {
e.printStackTrace();
}
Parent root = loader.getRoot();
Stage stage = new Stage();
stage.setScene(new Scene(root));
stage.show();
});
signUpButton.setOnAction(event -> {
signUpNewUser();
});
}
private void signUpNewUser() {
DatabaseHandler dbHandler = new DatabaseHandler();
String firstName = name.getText();
String lastName = lastname.getText();
String login = loginField.getText();
String password = passField.getText();
String email = mail.getText();
User user = new User(firstName, lastName, login, password, email);
dbHandler.singUpUser(user);
}
}
| UTF-8 | Java | 1,914 | java | Registration.java | Java | [
{
"context": " = loginField.getText();\n String password = passField.getText();\n String email = mail.getText();\n\n ",
"end": 1749,
"score": 0.9063469171524048,
"start": 1732,
"tag": "PASSWORD",
"value": "passField.getText"
}
] | null | [] | package server;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
public class Registration {
@FXML
private ResourceBundle resources;
@FXML
private URL location;
@FXML
private TextField loginField;
@FXML
private Button signUpButton;
@FXML
private PasswordField passField;
@FXML
private TextField name;
@FXML
private TextField lastname;
@FXML
private TextField mail;
@FXML
private TextField passField2;
@FXML
private Button backButton;
@FXML
void initialize() {
backButton.setOnAction(event -> {
backButton.getScene().getWindow().hide();
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("/sample/sample.fxml"));
try {
loader.load();
} catch (IOException e) {
e.printStackTrace();
}
Parent root = loader.getRoot();
Stage stage = new Stage();
stage.setScene(new Scene(root));
stage.show();
});
signUpButton.setOnAction(event -> {
signUpNewUser();
});
}
private void signUpNewUser() {
DatabaseHandler dbHandler = new DatabaseHandler();
String firstName = name.getText();
String lastName = lastname.getText();
String login = loginField.getText();
String password = <PASSWORD>();
String email = mail.getText();
User user = new User(firstName, lastName, login, password, email);
dbHandler.singUpUser(user);
}
}
| 1,907 | 0.621212 | 0.62069 | 88 | 20.75 | 18.684734 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.522727 | false | false | 13 |
28443cd8852a40e88189df03e8dd6cf60600039b | 12,610,023,995,777 | fc18354cf3f2bf356dfe9125208a0190d0f2dc12 | /src/main/java/com/colorit/backend/repositories/UserRepositoryList.java | 9171aea747287f5757c2afe1f3ebf6a90aac1b30 | [] | no_license | HustonMmmavr/test | https://github.com/HustonMmmavr/test | cd342cd5d6ef4e4356ac8fd25f53be8a5f7cb32e | a94399ee0ca041878136f263f2dfa32b84f3b943 | refs/heads/master | 2020-02-20T02:13:44.994000 | 2018-03-27T02:56:15 | 2018-03-27T02:56:15 | 126,894,276 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.colorit.backend.repositories;
import com.colorit.backend.entities.UserEntity;
import java.util.ArrayList;
import java.util.List;
public class UserRepositoryList {
private final List<UserEntity> db;
public UserRepositoryList() {
db = new ArrayList<>();
}
public UserEntity getByNickame(String nickname) throws NoResultException {
final UserEntity userEntity = searchByNickname(nickname);
if (userEntity == null) {
throw new NoResultException();
}
return userEntity;
}
public void save(UserEntity userEntity) throws ConstraintNameException, ConstraintEmailException {
UserEntity existingUser = searchByNickname(userEntity.getNickname());
if (existingUser != null) {
throw new ConstraintNameException();
}
existingUser = searchByEmail(userEntity.getEmail());
if (existingUser != null) {
throw new ConstraintEmailException();
}
db.add(userEntity);
}
public void changePassword(String nickname, String password) throws NoResultException {
final UserEntity existringUser = getByNickame(nickname);
existringUser.setPasswordHash(password);
}
public void changeEmail(String nickname, String email) throws NoResultException, ConstraintEmailException {
final UserEntity existringUser = getByNickame(nickname);
final UserEntity checkMailEntity = searchByEmail(email);
if (checkMailEntity != null) {
throw new ConstraintEmailException();
}
existringUser.setEmail(email);
}
public static class RepositoryException extends Exception {
}
public static class ConstraintNameException extends RepositoryException {
}
public static class ConstraintEmailException extends RepositoryException {
}
public static class NoResultException extends RepositoryException {
}
private UserEntity searchByNickname(String nickname) {
return db.stream()
.filter(user -> user.getNickname().equals(nickname))
.findAny().orElse(null);
}
private UserEntity searchByEmail(String email) {
return db.stream()
.filter(user -> user.getEmail().equals(email))
.findAny().orElse(null);
}
}
| UTF-8 | Java | 2,342 | java | UserRepositoryList.java | Java | [] | null | [] | package com.colorit.backend.repositories;
import com.colorit.backend.entities.UserEntity;
import java.util.ArrayList;
import java.util.List;
public class UserRepositoryList {
private final List<UserEntity> db;
public UserRepositoryList() {
db = new ArrayList<>();
}
public UserEntity getByNickame(String nickname) throws NoResultException {
final UserEntity userEntity = searchByNickname(nickname);
if (userEntity == null) {
throw new NoResultException();
}
return userEntity;
}
public void save(UserEntity userEntity) throws ConstraintNameException, ConstraintEmailException {
UserEntity existingUser = searchByNickname(userEntity.getNickname());
if (existingUser != null) {
throw new ConstraintNameException();
}
existingUser = searchByEmail(userEntity.getEmail());
if (existingUser != null) {
throw new ConstraintEmailException();
}
db.add(userEntity);
}
public void changePassword(String nickname, String password) throws NoResultException {
final UserEntity existringUser = getByNickame(nickname);
existringUser.setPasswordHash(password);
}
public void changeEmail(String nickname, String email) throws NoResultException, ConstraintEmailException {
final UserEntity existringUser = getByNickame(nickname);
final UserEntity checkMailEntity = searchByEmail(email);
if (checkMailEntity != null) {
throw new ConstraintEmailException();
}
existringUser.setEmail(email);
}
public static class RepositoryException extends Exception {
}
public static class ConstraintNameException extends RepositoryException {
}
public static class ConstraintEmailException extends RepositoryException {
}
public static class NoResultException extends RepositoryException {
}
private UserEntity searchByNickname(String nickname) {
return db.stream()
.filter(user -> user.getNickname().equals(nickname))
.findAny().orElse(null);
}
private UserEntity searchByEmail(String email) {
return db.stream()
.filter(user -> user.getEmail().equals(email))
.findAny().orElse(null);
}
}
| 2,342 | 0.675064 | 0.675064 | 73 | 31.082191 | 29.145245 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.356164 | false | false | 13 |
7b6d0a64a55f2f84ef1e804c519270db3356d57f | 28,389,733,838,196 | 01e8b8d014c31565e02a1e8a348980b0ef579eeb | /src/main/java/com/employee/portal/employeeportalservice/service/EmployeeService.java | 6132f80da2bc3f0fb0c9e575083fc799477e5692 | [] | no_license | jogeswar13/employee-portal-service | https://github.com/jogeswar13/employee-portal-service | 238a348f42e30e67205af0fa84215d23f4fb5f67 | 5b728b91a2763b29f640004f4daa6cd2cd8a9f7e | refs/heads/master | 2020-09-12T23:39:34.908000 | 2019-11-19T03:18:06 | 2019-11-19T03:18:06 | 222,594,622 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.employee.portal.employeeportalservice.service;
import org.springframework.data.domain.Sort;
import org.springframework.http.ResponseEntity;
import com.employee.portal.employeeportalservice.bean.EmployeeBean;
import com.employee.portal.employeeportalservice.core.bean.DataTablePagination;
import com.employee.portal.employeeportalservice.exception.InternalServerError;
/**
*
* @author jogeswar.sahu
*
*/
/**
* The Class EmployeeService.
*/
public interface EmployeeService {
/**
*
* @param dataTablePagination
* @param sort
* @return ResponseEntity<Object>
* @throws InternalServerError
*/
public ResponseEntity<Object> getAllEmployees(DataTablePagination dataTablePagination, Sort sort)
throws InternalServerError;
/**
*
* @param id
* @return ResponseEntity<Object>
* @throws InternalServerError
*/
public ResponseEntity<Object> getEmployeeById(Long id) throws InternalServerError;
/**
*
* @param employeeBean
* @return ResponseEntity<Object>
* @throws InternalServerError
*/
public ResponseEntity<Object> createEmployee(EmployeeBean employeeBean) throws InternalServerError;
/**
*
* @param employeeBean
* @return ResponseEntity<Object>
* @throws InternalServerError
*/
public ResponseEntity<Object> updateEmployee(EmployeeBean employeeBean) throws InternalServerError;
/**
*
* @param id
* @return ResponseEntity<Object>
* @throws InternalServerError
*/
public ResponseEntity<Object> deleteEmployeeById(Long id) throws InternalServerError;
} | UTF-8 | Java | 1,600 | java | EmployeeService.java | Java | [
{
"context": "ption.InternalServerError;\r\n\r\n/**\r\n * \r\n * @author jogeswar.sahu\r\n *\r\n */\r\n/**\r\n * The Class EmployeeService.\r\n */",
"end": 426,
"score": 0.762897253036499,
"start": 413,
"tag": "NAME",
"value": "jogeswar.sahu"
}
] | null | [] | package com.employee.portal.employeeportalservice.service;
import org.springframework.data.domain.Sort;
import org.springframework.http.ResponseEntity;
import com.employee.portal.employeeportalservice.bean.EmployeeBean;
import com.employee.portal.employeeportalservice.core.bean.DataTablePagination;
import com.employee.portal.employeeportalservice.exception.InternalServerError;
/**
*
* @author jogeswar.sahu
*
*/
/**
* The Class EmployeeService.
*/
public interface EmployeeService {
/**
*
* @param dataTablePagination
* @param sort
* @return ResponseEntity<Object>
* @throws InternalServerError
*/
public ResponseEntity<Object> getAllEmployees(DataTablePagination dataTablePagination, Sort sort)
throws InternalServerError;
/**
*
* @param id
* @return ResponseEntity<Object>
* @throws InternalServerError
*/
public ResponseEntity<Object> getEmployeeById(Long id) throws InternalServerError;
/**
*
* @param employeeBean
* @return ResponseEntity<Object>
* @throws InternalServerError
*/
public ResponseEntity<Object> createEmployee(EmployeeBean employeeBean) throws InternalServerError;
/**
*
* @param employeeBean
* @return ResponseEntity<Object>
* @throws InternalServerError
*/
public ResponseEntity<Object> updateEmployee(EmployeeBean employeeBean) throws InternalServerError;
/**
*
* @param id
* @return ResponseEntity<Object>
* @throws InternalServerError
*/
public ResponseEntity<Object> deleteEmployeeById(Long id) throws InternalServerError;
} | 1,600 | 0.736875 | 0.736875 | 62 | 23.838709 | 28.399338 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.822581 | false | false | 13 |
edb31d66ffffdd9ff5db30fae2840da571f75392 | 6,373,731,485,803 | 202ba39af0c386ff322da1bf75cd0a060ba91c5f | /development/ALGator/src/si/fri/algotest/entities/EQuery.java | 81779fa1e159321d797490c810419d80d25d9db0 | [] | no_license | ALGatorDevel/Algator | https://github.com/ALGatorDevel/Algator | 0d04ebe5722c5313eaaa008dda9d2b48aa515f3b | e3664959b5d1846d0e2b13e0c9dd8bef22c63f54 | refs/heads/master | 2023-05-27T19:38:33.531000 | 2023-05-23T13:01:03 | 2023-05-23T13:01:03 | 151,378,725 | 3 | 3 | null | null | null | null | null | null | null | null | null | null | null | null | null | package si.fri.algotest.entities;
import java.io.File;
import org.json.JSONArray;
/**
*
* @author tomaz
*/
public class EQuery extends Entity {
// Entity identifier
public static final String ID_Query = "Query";
//Fields
public static final String ID_Description = "Description"; // String
public static final String ID_Algorithms = "Algorithms"; // NameAndAbrev []
public static final String ID_TestSets = "TestSets"; // NameAndAbrev []
public static final String ID_Parameters = "Parameters"; // String []
public static final String ID_Indicators = "Indicators"; // String []
public static final String ID_GroupBy = "GroupBy"; // String []
public static final String ID_Filter = "Filter"; // String []
public static final String ID_SortBy = "SortBy"; // String []
public static final String ID_Count = "Count"; // String (1-true, other-false)
public static final String ID_ComputerID = "ComputerID"; // ID of computer that provides the results file; if null or "", the most suitable result file is selected
public EQuery() {
super(ID_Query,
new String [] {ID_Description, ID_Algorithms, ID_TestSets, ID_Parameters, ID_Indicators,
ID_GroupBy, ID_Filter, ID_SortBy, ID_Count, ID_ComputerID});
setRepresentatives(ID_Algorithms, ID_TestSets);
}
public EQuery(String [] algs, String [] tsts, String [] inParams, String [] outParams,
String [] groupby, String [] filter, String [] sortby, String count,
String computerID) {
this();
set(ID_Algorithms, new JSONArray(algs));
set(ID_TestSets, new JSONArray(tsts));
set(ID_Parameters, new JSONArray(inParams));
set(ID_Indicators, new JSONArray(outParams));
set(ID_GroupBy, new JSONArray(groupby));
set(ID_Filter, new JSONArray(filter));
set(ID_SortBy, new JSONArray(sortby));
set(ID_Count, count);
set(ID_ComputerID, computerID);
}
public EQuery(File fileName) {
this();
initFromFile(fileName);
}
public EQuery(File fileName, String [] params) {
this();
entityParams = params;
initFromFile(fileName);
}
public EQuery(String json, String [] params) {
this();
entityParams = params;
initFromJSON(json);
}
/**
* Return an aray of NameAndAbrev for parameter of type String [] with vaules
* of form "name as abrev".
* Note: algorithms and testsets are given in json file as array of string
* values of form "name as abrev".
* @param id ID of parameter (i.e. ID_Algorithms)
* @return
*/
public NameAndAbrev [] getNATabFromJSONArray(String [] entities) {
NameAndAbrev [] result = new NameAndAbrev[entities.length];
for (int i = 0; i < entities.length; i++) {
result[i] = new NameAndAbrev(entities[i]);
}
return result;
}
public NameAndAbrev[] getNATabFromJSONArray(String id) {
String[] entities = getStringArray(id);
return getNATabFromJSONArray(entities);
}
/**
* Method produces an json array of string of form "name as abrev" from a given
* array of NameAndAbrev entities.
*/
public void setJSONArrayFromNATab(NameAndAbrev [] entities, String id) {
String [] strEntities = new String[entities.length];
for (int i = 0; i < entities.length; i++) {
strEntities[i] = entities[i].toString();
}
JSONArray jTab = new JSONArray(strEntities);
set(id, jTab);
}
public boolean isCount() {
Object count = get(ID_Count);
return (count != null && count.equals("1"));
}
public void applyParameters(String [] parameters) {
}
public String getCacheKey() {
Object algs = get(ID_Algorithms);
Object ts = get(ID_TestSets);
Object params = get(ID_Parameters);
Object indicators = get(ID_Indicators);
Object compId = get(ID_ComputerID);
return ((algs == null ? "" : algs.toString())
+ (ts == null ? "" : ts.toString())
+ (params == null ? "" : params.toString())
+ (indicators == null ? "" : indicators.toString())
+ ((get(ID_Count) == null) ? "" : get(ID_Count).toString())
+ (compId == null ? "" : compId.toString()));
}
}
| UTF-8 | Java | 4,401 | java | EQuery.java | Java | [
{
"context": "ile;\nimport org.json.JSONArray;\n\n/**\n *\n * @author tomaz\n */\npublic class EQuery extends Entity {\n // Ent",
"end": 107,
"score": 0.999555230140686,
"start": 102,
"tag": "USERNAME",
"value": "tomaz"
}
] | null | [] | package si.fri.algotest.entities;
import java.io.File;
import org.json.JSONArray;
/**
*
* @author tomaz
*/
public class EQuery extends Entity {
// Entity identifier
public static final String ID_Query = "Query";
//Fields
public static final String ID_Description = "Description"; // String
public static final String ID_Algorithms = "Algorithms"; // NameAndAbrev []
public static final String ID_TestSets = "TestSets"; // NameAndAbrev []
public static final String ID_Parameters = "Parameters"; // String []
public static final String ID_Indicators = "Indicators"; // String []
public static final String ID_GroupBy = "GroupBy"; // String []
public static final String ID_Filter = "Filter"; // String []
public static final String ID_SortBy = "SortBy"; // String []
public static final String ID_Count = "Count"; // String (1-true, other-false)
public static final String ID_ComputerID = "ComputerID"; // ID of computer that provides the results file; if null or "", the most suitable result file is selected
public EQuery() {
super(ID_Query,
new String [] {ID_Description, ID_Algorithms, ID_TestSets, ID_Parameters, ID_Indicators,
ID_GroupBy, ID_Filter, ID_SortBy, ID_Count, ID_ComputerID});
setRepresentatives(ID_Algorithms, ID_TestSets);
}
public EQuery(String [] algs, String [] tsts, String [] inParams, String [] outParams,
String [] groupby, String [] filter, String [] sortby, String count,
String computerID) {
this();
set(ID_Algorithms, new JSONArray(algs));
set(ID_TestSets, new JSONArray(tsts));
set(ID_Parameters, new JSONArray(inParams));
set(ID_Indicators, new JSONArray(outParams));
set(ID_GroupBy, new JSONArray(groupby));
set(ID_Filter, new JSONArray(filter));
set(ID_SortBy, new JSONArray(sortby));
set(ID_Count, count);
set(ID_ComputerID, computerID);
}
public EQuery(File fileName) {
this();
initFromFile(fileName);
}
public EQuery(File fileName, String [] params) {
this();
entityParams = params;
initFromFile(fileName);
}
public EQuery(String json, String [] params) {
this();
entityParams = params;
initFromJSON(json);
}
/**
* Return an aray of NameAndAbrev for parameter of type String [] with vaules
* of form "name as abrev".
* Note: algorithms and testsets are given in json file as array of string
* values of form "name as abrev".
* @param id ID of parameter (i.e. ID_Algorithms)
* @return
*/
public NameAndAbrev [] getNATabFromJSONArray(String [] entities) {
NameAndAbrev [] result = new NameAndAbrev[entities.length];
for (int i = 0; i < entities.length; i++) {
result[i] = new NameAndAbrev(entities[i]);
}
return result;
}
public NameAndAbrev[] getNATabFromJSONArray(String id) {
String[] entities = getStringArray(id);
return getNATabFromJSONArray(entities);
}
/**
* Method produces an json array of string of form "name as abrev" from a given
* array of NameAndAbrev entities.
*/
public void setJSONArrayFromNATab(NameAndAbrev [] entities, String id) {
String [] strEntities = new String[entities.length];
for (int i = 0; i < entities.length; i++) {
strEntities[i] = entities[i].toString();
}
JSONArray jTab = new JSONArray(strEntities);
set(id, jTab);
}
public boolean isCount() {
Object count = get(ID_Count);
return (count != null && count.equals("1"));
}
public void applyParameters(String [] parameters) {
}
public String getCacheKey() {
Object algs = get(ID_Algorithms);
Object ts = get(ID_TestSets);
Object params = get(ID_Parameters);
Object indicators = get(ID_Indicators);
Object compId = get(ID_ComputerID);
return ((algs == null ? "" : algs.toString())
+ (ts == null ? "" : ts.toString())
+ (params == null ? "" : params.toString())
+ (indicators == null ? "" : indicators.toString())
+ ((get(ID_Count) == null) ? "" : get(ID_Count).toString())
+ (compId == null ? "" : compId.toString()));
}
}
| 4,401 | 0.609634 | 0.608725 | 128 | 33.382813 | 30.711134 | 175 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.71875 | false | false | 13 |
b1c21086f5a2c82c20959a85749c3d1359c26e20 | 31,336,081,409,068 | f74a9b401d3c5943537415cd2517b0abb5fc4c11 | /dice-server/src/main/java/com/bihell/dice/commons/utils/VerificationCode.java | f6eb2c3a4ee898afc0a935ca595b94987128c0af | [
"MIT"
] | permissive | bihell/Dice | https://github.com/bihell/Dice | e0340eed7786b0e85317a56473273379b05b3c16 | 877a14f478721d924236c2223592ba503b2dc011 | refs/heads/master | 2023-09-03T16:49:38.309000 | 2023-08-28T02:16:24 | 2023-08-28T02:16:24 | 196,830,665 | 449 | 131 | MIT | false | 2023-02-11T23:13:19 | 2019-07-14T11:54:46 | 2023-02-11T10:55:08 | 2023-02-11T23:13:18 | 11,941 | 357 | 116 | 22 | Vue | false | false | package com.bihell.dice.commons.utils;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.Random;
public class VerificationCode {
/**
* 验证码图片的长
**/
private int weight = 110;
/**
* 验证码图片的高
*/
private int height = 38;
/**
* 用来保存验证码的文本内容
**/
private String text;
/**
* 获取随机数对象
**/
private Random r = new Random();
/**
* 字体数组
**/
private String[] fontNames = {"宋体", "华文楷体", "黑体", "微软雅黑", "楷体_GB2312"};
/**
* 验证码数组
**/
private String codes = "23456789acdefghjkmnopqrstuvwxyzACDEFGHJKMNPQRSTUVWXYZ";
/**
* 生成的验证码的个数
**/
private int codeNum = 4;
/**
* 255
**/
private static int TWO_FIVE_FIVE = 255;
/**
* 获取随机的颜色
*/
private Color randomColor() {
//这里为什么是150,因为当r,g,b都为255时,即为白色,为了好辨认,需要颜色深一点。
int r = this.r.nextInt(150);
int g = this.r.nextInt(150);
int b = this.r.nextInt(150);
//返回一个随机颜色
return new Color(r, g, b);
}
/**
* 获取随机字体
*/
private Font randomFont() {
//获取随机的字体
int index = r.nextInt(fontNames.length);
String fontName = fontNames[index];
//随机获取字体的样式,0是无样式,1是加粗,2是斜体,3是加粗加斜体
int style = r.nextInt(4);
//随机获取字体的大小
int size = r.nextInt(5) + 24;
//返回一个随机的字体
return new Font(fontName, style, size);
}
/**
* 获取随机字符
*/
private char randomChar() {
int index = r.nextInt(codes.length());
return codes.charAt(index);
}
/**
* 画干扰线,验证码干扰线用来防止计算机解析图片
*/
private void drawLine(BufferedImage image) {
int num = 155;
//定义干扰线的数量
Graphics2D g = (Graphics2D) image.getGraphics();
for (int i = 0; i < num; i++) {
int x = r.nextInt(weight);
int y = r.nextInt(height);
int xl = r.nextInt(weight);
int yl = r.nextInt(height);
g.setColor(getRandColor(160, 200));
g.drawLine(x, y, x + xl, y + yl);
}
}
/**
* 创建图片的方法
*/
private BufferedImage createImage() {
//创建图片缓冲区
BufferedImage image = new BufferedImage(weight, height, BufferedImage.TYPE_INT_RGB);
//获取画笔
Graphics2D g = (Graphics2D) image.getGraphics();
// 设定图像背景色(因为是做背景,所以偏淡)
g.setColor(getRandColor(200, 250));
g.fillRect(0, 0, weight, height);
//返回一个图片
return image;
}
/**
* 获取验证码图片的方法
*/
public BufferedImage getImage() {
BufferedImage image = createImage();
//获取画笔
Graphics2D g = (Graphics2D) image.getGraphics();
StringBuilder sb = new StringBuilder();
drawLine(image);
//画四个字符即可
for (int i = 0; i < codeNum; i++) {
//随机生成字符,因为只有画字符串的方法,没有画字符的方法,所以需要将字符变成字符串再画
String s = randomChar() + "";
//添加到StringBuilder里面
sb.append(s);
//定义字符的x坐标
float x = i * 1.0F * weight / 4;
//设置字体,随机
g.setFont(randomFont());
//设置颜色,随机
g.setColor(randomColor());
g.drawString(s, x, height - 5);
}
this.text = sb.toString();
return image;
}
/**
* 给定范围获得随机颜色
*/
Color getRandColor(int fc, int bc) {
Random random = new Random();
if (fc > TWO_FIVE_FIVE) {
fc = TWO_FIVE_FIVE;
}
if (bc > TWO_FIVE_FIVE) {
bc = TWO_FIVE_FIVE;
}
int r = fc + random.nextInt(bc - fc);
int g = fc + random.nextInt(bc - fc);
int b = fc + random.nextInt(bc - fc);
return new Color(r, g, b);
}
/**
* 获取验证码文本的方法
*/
public String getText() {
return text;
}
}
| UTF-8 | Java | 4,565 | java | VerificationCode.java | Java | [] | null | [] | package com.bihell.dice.commons.utils;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.Random;
public class VerificationCode {
/**
* 验证码图片的长
**/
private int weight = 110;
/**
* 验证码图片的高
*/
private int height = 38;
/**
* 用来保存验证码的文本内容
**/
private String text;
/**
* 获取随机数对象
**/
private Random r = new Random();
/**
* 字体数组
**/
private String[] fontNames = {"宋体", "华文楷体", "黑体", "微软雅黑", "楷体_GB2312"};
/**
* 验证码数组
**/
private String codes = "23456789acdefghjkmnopqrstuvwxyzACDEFGHJKMNPQRSTUVWXYZ";
/**
* 生成的验证码的个数
**/
private int codeNum = 4;
/**
* 255
**/
private static int TWO_FIVE_FIVE = 255;
/**
* 获取随机的颜色
*/
private Color randomColor() {
//这里为什么是150,因为当r,g,b都为255时,即为白色,为了好辨认,需要颜色深一点。
int r = this.r.nextInt(150);
int g = this.r.nextInt(150);
int b = this.r.nextInt(150);
//返回一个随机颜色
return new Color(r, g, b);
}
/**
* 获取随机字体
*/
private Font randomFont() {
//获取随机的字体
int index = r.nextInt(fontNames.length);
String fontName = fontNames[index];
//随机获取字体的样式,0是无样式,1是加粗,2是斜体,3是加粗加斜体
int style = r.nextInt(4);
//随机获取字体的大小
int size = r.nextInt(5) + 24;
//返回一个随机的字体
return new Font(fontName, style, size);
}
/**
* 获取随机字符
*/
private char randomChar() {
int index = r.nextInt(codes.length());
return codes.charAt(index);
}
/**
* 画干扰线,验证码干扰线用来防止计算机解析图片
*/
private void drawLine(BufferedImage image) {
int num = 155;
//定义干扰线的数量
Graphics2D g = (Graphics2D) image.getGraphics();
for (int i = 0; i < num; i++) {
int x = r.nextInt(weight);
int y = r.nextInt(height);
int xl = r.nextInt(weight);
int yl = r.nextInt(height);
g.setColor(getRandColor(160, 200));
g.drawLine(x, y, x + xl, y + yl);
}
}
/**
* 创建图片的方法
*/
private BufferedImage createImage() {
//创建图片缓冲区
BufferedImage image = new BufferedImage(weight, height, BufferedImage.TYPE_INT_RGB);
//获取画笔
Graphics2D g = (Graphics2D) image.getGraphics();
// 设定图像背景色(因为是做背景,所以偏淡)
g.setColor(getRandColor(200, 250));
g.fillRect(0, 0, weight, height);
//返回一个图片
return image;
}
/**
* 获取验证码图片的方法
*/
public BufferedImage getImage() {
BufferedImage image = createImage();
//获取画笔
Graphics2D g = (Graphics2D) image.getGraphics();
StringBuilder sb = new StringBuilder();
drawLine(image);
//画四个字符即可
for (int i = 0; i < codeNum; i++) {
//随机生成字符,因为只有画字符串的方法,没有画字符的方法,所以需要将字符变成字符串再画
String s = randomChar() + "";
//添加到StringBuilder里面
sb.append(s);
//定义字符的x坐标
float x = i * 1.0F * weight / 4;
//设置字体,随机
g.setFont(randomFont());
//设置颜色,随机
g.setColor(randomColor());
g.drawString(s, x, height - 5);
}
this.text = sb.toString();
return image;
}
/**
* 给定范围获得随机颜色
*/
Color getRandColor(int fc, int bc) {
Random random = new Random();
if (fc > TWO_FIVE_FIVE) {
fc = TWO_FIVE_FIVE;
}
if (bc > TWO_FIVE_FIVE) {
bc = TWO_FIVE_FIVE;
}
int r = fc + random.nextInt(bc - fc);
int g = fc + random.nextInt(bc - fc);
int b = fc + random.nextInt(bc - fc);
return new Color(r, g, b);
}
/**
* 获取验证码文本的方法
*/
public String getText() {
return text;
}
}
| 4,565 | 0.50716 | 0.487373 | 160 | 23.00625 | 17.857595 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.51875 | false | false | 13 |
814fdc470a97338322fdb3ce5e377f46533e69c5 | 8,280,696,967,736 | 84eab63dd07a8cc6d0a0243025e37cf523674dc9 | /src/main/java/javapersianutils/core/validators/IranShetabUtils.java | 726a397e2271040d6f830b37792735242142bbff | [
"Apache-2.0"
] | permissive | M-Razavi/JavaPersianUtils.Core | https://github.com/M-Razavi/JavaPersianUtils.Core | f735aade1d54f1811eab3e472a4a402871d47def | f9c77560d44fb25971c6798351c7f0e2da84e4b0 | refs/heads/master | 2022-12-11T13:27:07.743000 | 2021-09-30T15:54:31 | 2021-09-30T15:54:31 | 174,744,749 | 9 | 3 | Apache-2.0 | false | 2021-04-10T23:58:36 | 2019-03-09T20:50:07 | 2020-12-28T19:44:40 | 2021-04-10T23:58:36 | 110 | 7 | 3 | 5 | Java | false | false | package javapersianutils.core.validators;
import org.apache.commons.lang3.StringUtils;
import java.util.regex.Pattern;
import static javapersianutils.core.string.StringUtil.isNullOrEmpty;
/**
* Credit and Debit Card (Shetab) validation
*/
public class IranShetabUtils {
private static final Pattern _matchIranShetab = Pattern.compile("[0-9]{16}", Pattern.CASE_INSENSITIVE);
private IranShetabUtils() {
}
/**
* validate Shetab card numbers
*
* @param creditCardNumber Shetab card number
* @return boolean
*/
public static boolean isValidIranShetabNumber(String creditCardNumber) {
if (isNullOrEmpty(creditCardNumber)) {
return false;
}
creditCardNumber = creditCardNumber.replace("-", StringUtils.EMPTY).replace(" ", StringUtils.EMPTY);
if (creditCardNumber.length() != 16) {
return false;
}
if (!_matchIranShetab.matcher(creditCardNumber).matches()) {
return false;
}
int sumOfDigits = 0;
int result = 0;
for (int i = 1; i <= creditCardNumber.length(); i++) {
int number = Integer.parseInt(creditCardNumber.charAt(i - 1) + "");
sumOfDigits += ((result = number * (i % 2 == 0 ? 1 : 2)) > 9 ? (result - 9) : result);
}
return sumOfDigits % 10 == 0;
}
}
| UTF-8 | Java | 1,370 | java | IranShetabUtils.java | Java | [] | null | [] | package javapersianutils.core.validators;
import org.apache.commons.lang3.StringUtils;
import java.util.regex.Pattern;
import static javapersianutils.core.string.StringUtil.isNullOrEmpty;
/**
* Credit and Debit Card (Shetab) validation
*/
public class IranShetabUtils {
private static final Pattern _matchIranShetab = Pattern.compile("[0-9]{16}", Pattern.CASE_INSENSITIVE);
private IranShetabUtils() {
}
/**
* validate Shetab card numbers
*
* @param creditCardNumber Shetab card number
* @return boolean
*/
public static boolean isValidIranShetabNumber(String creditCardNumber) {
if (isNullOrEmpty(creditCardNumber)) {
return false;
}
creditCardNumber = creditCardNumber.replace("-", StringUtils.EMPTY).replace(" ", StringUtils.EMPTY);
if (creditCardNumber.length() != 16) {
return false;
}
if (!_matchIranShetab.matcher(creditCardNumber).matches()) {
return false;
}
int sumOfDigits = 0;
int result = 0;
for (int i = 1; i <= creditCardNumber.length(); i++) {
int number = Integer.parseInt(creditCardNumber.charAt(i - 1) + "");
sumOfDigits += ((result = number * (i % 2 == 0 ? 1 : 2)) > 9 ? (result - 9) : result);
}
return sumOfDigits % 10 == 0;
}
}
| 1,370 | 0.616788 | 0.60219 | 49 | 26.959183 | 29.970707 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.387755 | false | false | 13 |
3ec47b1da4418cd63aeca3e01f7b59e1e50280a0 | 8,280,696,966,484 | cc953f667e11f32d4119ac827d9378ed477b7706 | /backend-servers/purchase-server/src/main/java/com/stosz/purchase/fsm/errorGoodsFsm/CompletingErrorGoodsAfter.java | 95ddb2b2c7be199d929569f2de2c214456cfcbcb | [] | no_license | ttggaa/erp | https://github.com/ttggaa/erp | e20ed03ecf6965da95c9fc472d505ae8ef4f3902 | 167f5d60d085d016b08452083f172df654a7c5c5 | refs/heads/master | 2020-04-22T12:03:43.913000 | 2018-12-05T16:16:11 | 2018-12-05T16:16:11 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.stosz.purchase.fsm.errorGoodsFsm;
import com.stosz.fsm.handle.IFsmHandler;
import com.stosz.fsm.model.EventModel;
import com.stosz.plat.utils.CollectionUtils;
import com.stosz.purchase.ext.enums.ErrorGoodsItemEvent;
import com.stosz.purchase.ext.model.ErrorGoods;
import com.stosz.purchase.ext.model.ErrorGoodsItem;
import com.stosz.purchase.service.ErrorGoodsItemService;
import com.stosz.purchase.service.ErrorGoodsService;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import javax.annotation.Resource;
import java.util.List;
/**
* @author xiongchenyang
* @version [1.0 , 2018/1/8]
*/
@Component
public class CompletingErrorGoodsAfter extends IFsmHandler<ErrorGoods> {
@Resource
private ErrorGoodsItemService errorGoodsItemService;
@Resource
private ErrorGoodsService errorGoodsService;
@Override
public void execute(ErrorGoods errorGoods, EventModel event) {
errorGoodsService.update(errorGoods);
Integer errorId = errorGoods.getId();
List<ErrorGoodsItem> errorGoodsItemList = errorGoodsItemService.findByErrorId(errorId);
Assert.isTrue(CollectionUtils.isNotNullAndEmpty(errorGoodsItemList),"该错货单"+errorId+"没有错货明细!!!");
for (ErrorGoodsItem errorGoodsItem : errorGoodsItemList){
errorGoodsItemService.processEvent(errorGoodsItem.getId(), ErrorGoodsItemEvent.completing,"错货单已完成,所有明细完成!!!",null);
}
}
}
| UTF-8 | Java | 1,513 | java | CompletingErrorGoodsAfter.java | Java | [
{
"context": "n.Resource;\nimport java.util.List;\n\n/**\n * @author xiongchenyang\n * @version [1.0 , 2018/1/8]\n */\n@Component\npubli",
"end": 615,
"score": 0.9987772703170776,
"start": 602,
"tag": "USERNAME",
"value": "xiongchenyang"
}
] | null | [] | package com.stosz.purchase.fsm.errorGoodsFsm;
import com.stosz.fsm.handle.IFsmHandler;
import com.stosz.fsm.model.EventModel;
import com.stosz.plat.utils.CollectionUtils;
import com.stosz.purchase.ext.enums.ErrorGoodsItemEvent;
import com.stosz.purchase.ext.model.ErrorGoods;
import com.stosz.purchase.ext.model.ErrorGoodsItem;
import com.stosz.purchase.service.ErrorGoodsItemService;
import com.stosz.purchase.service.ErrorGoodsService;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import javax.annotation.Resource;
import java.util.List;
/**
* @author xiongchenyang
* @version [1.0 , 2018/1/8]
*/
@Component
public class CompletingErrorGoodsAfter extends IFsmHandler<ErrorGoods> {
@Resource
private ErrorGoodsItemService errorGoodsItemService;
@Resource
private ErrorGoodsService errorGoodsService;
@Override
public void execute(ErrorGoods errorGoods, EventModel event) {
errorGoodsService.update(errorGoods);
Integer errorId = errorGoods.getId();
List<ErrorGoodsItem> errorGoodsItemList = errorGoodsItemService.findByErrorId(errorId);
Assert.isTrue(CollectionUtils.isNotNullAndEmpty(errorGoodsItemList),"该错货单"+errorId+"没有错货明细!!!");
for (ErrorGoodsItem errorGoodsItem : errorGoodsItemList){
errorGoodsItemService.processEvent(errorGoodsItem.getId(), ErrorGoodsItemEvent.completing,"错货单已完成,所有明细完成!!!",null);
}
}
}
| 1,513 | 0.778694 | 0.773196 | 39 | 36.307693 | 30.421951 | 127 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false | 13 |
c1948827e40070ae68eee1d3f2cba6d180fbf004 | 6,871,947,695,900 | 3f845116d80abb16569c069d3c917245f6fe2359 | /gitTest/src/gittest/GitTest.java | 828ca9a769f054593b8e4c36147cff01c52e0a3c | [] | no_license | SIHop/test | https://github.com/SIHop/test | 50266fb5d037c1fa842ae946b62d563143eeeab3 | 8bdcdbd92616b73069b0c6066982f5786923252e | refs/heads/master | 2021-01-12T00:01:10.262000 | 2017-01-11T17:29:17 | 2017-01-11T17:29:17 | 78,659,849 | 0 | 0 | null | false | 2017-01-11T17:29:17 | 2017-01-11T16:58:23 | 2017-01-11T17:04:45 | 2017-01-11T17:29:17 | 0 | 0 | 0 | 0 | Java | null | null |
package gittest;
public class GitTest {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
//test 4
//test 5
}
}
| UTF-8 | Java | 215 | java | GitTest.java | Java | [] | null | [] |
package gittest;
public class GitTest {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
//test 4
//test 5
}
}
| 215 | 0.483721 | 0.474419 | 15 | 12.2 | 14.42313 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.066667 | false | false | 13 |
fa3eb6b17b6e1fd0064d36449110d60fcee723ab | 24,927,990,209,197 | ffeaf567e9b1aadb4c00d95cd3df4e6484f36dcd | /Hotgram/org/telegram/ui/-$$Lambda$MediaActivity$MediaSearchAdapter$VRYl3PP_Z3UXWvfCBf3wim5v314.java | 9504af5701f1221230800821cbb95340666e4fd7 | [] | no_license | danielperez9430/Third-party-Telegram-Apps-Spy | https://github.com/danielperez9430/Third-party-Telegram-Apps-Spy | dfe541290c8512ca366e401aedf5cc5bfcaa6c3e | f6fc0f9c677bd5d5cd3585790b033094c2f0226d | refs/heads/master | 2020-04-11T23:26:06.025000 | 2018-12-18T10:07:20 | 2018-12-18T10:07:20 | 162,166,647 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.telegram.ui;
import java.util.ArrayList;
public final class -$$Lambda$MediaActivity$MediaSearchAdapter$VRYl3PP_Z3UXWvfCBf3wim5v314 implements Runnable {
public -$$Lambda$MediaActivity$MediaSearchAdapter$VRYl3PP_Z3UXWvfCBf3wim5v314(MediaSearchAdapter arg1, ArrayList arg2) {
super();
this.f$0 = arg1;
this.f$1 = arg2;
}
public final void run() {
MediaSearchAdapter.lambda$updateSearchResults$4(this.f$0, this.f$1);
}
}
| UTF-8 | Java | 482 | java | -$$Lambda$MediaActivity$MediaSearchAdapter$VRYl3PP_Z3UXWvfCBf3wim5v314.java | Java | [] | null | [] | package org.telegram.ui;
import java.util.ArrayList;
public final class -$$Lambda$MediaActivity$MediaSearchAdapter$VRYl3PP_Z3UXWvfCBf3wim5v314 implements Runnable {
public -$$Lambda$MediaActivity$MediaSearchAdapter$VRYl3PP_Z3UXWvfCBf3wim5v314(MediaSearchAdapter arg1, ArrayList arg2) {
super();
this.f$0 = arg1;
this.f$1 = arg2;
}
public final void run() {
MediaSearchAdapter.lambda$updateSearchResults$4(this.f$0, this.f$1);
}
}
| 482 | 0.711618 | 0.6639 | 15 | 31.066668 | 38.816605 | 124 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.533333 | false | false | 13 |
6a6449f00fc480fb990544a7bde00631a8a495bf | 5,007,931,897,463 | 9b64876b397fc15e45f43e10029168b3441c74af | /src/main/java/de/rwth/visualization/track/Track.java | 012f3f674f674148ecfdc2ac83270bd298c78a68 | [] | no_license | ikasu93/Driving-Visualization | https://github.com/ikasu93/Driving-Visualization | fe5ecfd138ee9adf3a20515c5c34d7a8e3fe67c8 | a0e24b6341836c5332a01427f5343bff68956aef | refs/heads/master | 2023-01-19T13:58:11.900000 | 2020-11-06T22:26:36 | 2020-11-06T22:26:36 | 309,790,270 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package de.rwth.visualization.track;
import org.apache.commons.math3.linear.ArrayRealVector;
import org.apache.commons.math3.linear.RealVector;
import java.util.ArrayList;
import java.util.List;
public abstract class Track {
public static List<Wall> walls;
static {
init();
}
private static void init() {
walls = new ArrayList<>();
addWall1();
addWall2();
addWall3();
addWall4();
addWall5();
addWall6();
addWall7();
addWall8();
addWall9();
addWall10();
addWall11();
addWall12();
addWall13();
addWall14();
addWall15();
addWall16();
addWall17();
addWall18();
}
private static void addWall1() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, -9.5);
pointLeft.setEntry(0, 58);
pointRight.setEntry(1, -9.5);
pointRight.setEntry(0, -122);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall2() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 10);
pointLeft.setEntry(0, 58);
pointRight.setEntry(1, 10);
pointRight.setEntry(0, -122);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall3() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, -36);
pointLeft.setEntry(0, 109);
pointRight.setEntry(1, -9.5);
pointRight.setEntry(0, 58);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall4() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, -18);
pointLeft.setEntry(0, 114);
pointRight.setEntry(1, 10);
pointRight.setEntry(0, 58);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall5() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 60;
pointMiddle.setEntry(1, 22);
pointMiddle.setEntry(0, 123);
pointLower.setEntry(1, 22);
pointLower.setEntry(0, 184);
pointUpper.setEntry(1, -36);
pointUpper.setEntry(0, 109);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall6() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 41;
pointMiddle.setEntry(1, 22);
pointMiddle.setEntry(0, 123);
pointLower.setEntry(1, 22);
pointLower.setEntry(0, 164);
pointUpper.setEntry(1, -18);
pointUpper.setEntry(0, 114);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall7() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 60;
pointMiddle.setEntry(1, 22);
pointMiddle.setEntry(0, 123);
pointLower.setEntry(1, 79);
pointLower.setEntry(0, 137.6);
pointUpper.setEntry(1, 22);
pointUpper.setEntry(0, 184);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall8() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 41;
pointMiddle.setEntry(1, 22);
pointMiddle.setEntry(0, 123);
pointLower.setEntry(1, 60.6);
pointLower.setEntry(0, 133);
pointUpper.setEntry(1, 22);
pointUpper.setEntry(0, 164);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall9() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 60.6);
pointLeft.setEntry(0, 133);
pointRight.setEntry(1, 65.8);
pointRight.setEntry(0, 98.5);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall10() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 79);
pointLeft.setEntry(0, 137.6);
pointRight.setEntry(1, 83.5);
pointRight.setEntry(0, 108);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall11() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 65.8);
pointLeft.setEntry(0, 98.5);
pointRight.setEntry(1, 90);
pointRight.setEntry(0, 58);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall12() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 83.5);
pointLeft.setEntry(0, 108);
pointRight.setEntry(1, 110);
pointRight.setEntry(0, 59);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall13() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 90);
pointLeft.setEntry(0, 58);
pointRight.setEntry(1, 90.8);
pointRight.setEntry(0, -122);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall14() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 110);
pointLeft.setEntry(0, 59);
pointRight.setEntry(1, 110);
pointRight.setEntry(0, -121);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall15() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 61;
pointMiddle.setEntry(1, 51.3);
pointMiddle.setEntry(0, -123);
pointLower.setEntry(1, 110);
pointLower.setEntry(0, -121);
pointUpper.setEntry(1, 51.3);
pointUpper.setEntry(0, -183);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall16() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 41;
pointMiddle.setEntry(1, 51.3);
pointMiddle.setEntry(0, -123);
pointLower.setEntry(1, 90.8);
pointLower.setEntry(0, -123);
pointUpper.setEntry(1, 51.3);
pointUpper.setEntry(0, -164);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall17() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 61;
pointMiddle.setEntry(1, 51.3);
pointMiddle.setEntry(0, -123);
pointLower.setEntry(1, 51.3);
pointLower.setEntry(0, -183);
pointUpper.setEntry(1, -9.5);
pointUpper.setEntry(0, -122);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall18() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 41;
pointMiddle.setEntry(1, 51.3);
pointMiddle.setEntry(0, -123);
pointLower.setEntry(1, 51.3);
pointLower.setEntry(0, -164);
pointUpper.setEntry(1, 10);
pointUpper.setEntry(0, -122);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
/*private static void initParts() {
parts = new ArrayList<>();
TrackPart firstLinear = Track.createFirstLinear();
TrackPart secondLinear = Track.createSecondLinear();
TrackPart firstCircle = Track.createFirstCircle();
TrackPart thirdLinear = Track.createThirdLinear();
TrackPart fourthLinear = Track.createFourthLinear();
TrackPart fifthLinear = Track.createFifthLinear();
TrackPart secondCircle = Track.createSecondCircle();
parts.add(firstLinear);
parts.add(secondLinear);
parts.add(firstCircle);
parts.add(thirdLinear);
parts.add(fourthLinear);
parts.add(fifthLinear);
parts.add(secondCircle);
}
private static TrackPart createFirstLinear() {
RealVector pointUpperLeft = new ArrayRealVector(2);
RealVector pointUpperRight = new ArrayRealVector(2);
RealVector pointLowerLeft = new ArrayRealVector(2);
RealVector pointLowerRight = new ArrayRealVector(2);
pointUpperLeft.setEntry(0, -9.5);
pointUpperLeft.setEntry(1, 58);
pointUpperRight.setEntry(0, -9.5);
pointUpperRight.setEntry(1, -122);
pointLowerLeft.setEntry(0, 10);
pointLowerLeft.setEntry(1, 58);
pointLowerRight.setEntry(0, 10);
pointLowerRight.setEntry(1, -122);
return new TrackPartLinear(pointUpperLeft, pointUpperRight, pointLowerLeft, pointLowerRight);
}
private static TrackPart createSecondLinear() {
RealVector pointUpperLeft = new ArrayRealVector(2);
RealVector pointUpperRight = new ArrayRealVector(2);
RealVector pointLowerLeft = new ArrayRealVector(2);
RealVector pointLowerRight = new ArrayRealVector(2);
pointUpperLeft.setEntry(0, -36);
pointUpperLeft.setEntry(1, 109);
pointUpperRight.setEntry(0, -9.5);
pointUpperRight.setEntry(1, 58);
pointLowerLeft.setEntry(0, -18);
pointLowerLeft.setEntry(1, 114);
pointLowerRight.setEntry(0, 10);
pointLowerRight.setEntry(1, 58);
return new TrackPartLinear(pointUpperLeft, pointUpperRight, pointLowerLeft, pointLowerRight);
}
private static TrackPart createFirstCircle() {
RealVector point = new ArrayRealVector(2);
point.setEntry(0, 22);
point.setEntry(1, 123);
double radiusInner = 41;
double radiusOuter = 60;
return new TrackPartCircle(point, radiusInner, radiusOuter);
}
private static TrackPart createThirdLinear() {
RealVector pointUpperLeft = new ArrayRealVector(2);
RealVector pointUpperRight = new ArrayRealVector(2);
RealVector pointLowerLeft = new ArrayRealVector(2);
RealVector pointLowerRight = new ArrayRealVector(2);
pointUpperLeft.setEntry(0, 60.6);
pointUpperLeft.setEntry(1, 133);
pointUpperRight.setEntry(0, 65.8);
pointUpperRight.setEntry(1, 98.5);
pointLowerLeft.setEntry(0, 79);
pointLowerLeft.setEntry(1, 137.6);
pointLowerRight.setEntry(0, 83.5);
pointLowerRight.setEntry(1, 108);
return new TrackPartLinear(pointUpperLeft, pointUpperRight, pointLowerLeft, pointLowerRight);
}
private static TrackPart createFourthLinear() {
RealVector pointUpperLeft = new ArrayRealVector(2);
RealVector pointUpperRight = new ArrayRealVector(2);
RealVector pointLowerLeft = new ArrayRealVector(2);
RealVector pointLowerRight = new ArrayRealVector(2);
pointUpperLeft.setEntry(0, 65.8);
pointUpperLeft.setEntry(1, 98.5);
pointUpperRight.setEntry(0, 90);
pointUpperRight.setEntry(1, 58);
pointLowerLeft.setEntry(0, 83.5);
pointLowerLeft.setEntry(1, 108);
pointLowerRight.setEntry(0, 110);
pointLowerRight.setEntry(1, 59);
return new TrackPartLinear(pointUpperLeft, pointUpperRight, pointLowerLeft, pointLowerRight);
}
private static TrackPart createFifthLinear() {
RealVector pointUpperLeft = new ArrayRealVector(2);
RealVector pointUpperRight = new ArrayRealVector(2);
RealVector pointLowerLeft = new ArrayRealVector(2);
RealVector pointLowerRight = new ArrayRealVector(2);
pointUpperLeft.setEntry(0, 90);
pointUpperLeft.setEntry(1, 58);
pointUpperRight.setEntry(0, 90.8);
pointUpperRight.setEntry(1, -122);
pointLowerLeft.setEntry(0, 110);
pointLowerLeft.setEntry(1, 59);
pointLowerRight.setEntry(0, 110);
pointLowerRight.setEntry(1, -121);
return new TrackPartLinear(pointUpperLeft, pointUpperRight, pointLowerLeft, pointLowerRight);
}
private static TrackPart createSecondCircle() {
RealVector point = new ArrayRealVector(2);
point.setEntry(0, 51.3);
point.setEntry(1, -123);
double radiusInner = 41;
double radiusOuter = 61;
return new TrackPartCircle(point, radiusInner, radiusOuter);
}*/
} | UTF-8 | Java | 13,852 | java | Track.java | Java | [] | null | [] | package de.rwth.visualization.track;
import org.apache.commons.math3.linear.ArrayRealVector;
import org.apache.commons.math3.linear.RealVector;
import java.util.ArrayList;
import java.util.List;
public abstract class Track {
public static List<Wall> walls;
static {
init();
}
private static void init() {
walls = new ArrayList<>();
addWall1();
addWall2();
addWall3();
addWall4();
addWall5();
addWall6();
addWall7();
addWall8();
addWall9();
addWall10();
addWall11();
addWall12();
addWall13();
addWall14();
addWall15();
addWall16();
addWall17();
addWall18();
}
private static void addWall1() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, -9.5);
pointLeft.setEntry(0, 58);
pointRight.setEntry(1, -9.5);
pointRight.setEntry(0, -122);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall2() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 10);
pointLeft.setEntry(0, 58);
pointRight.setEntry(1, 10);
pointRight.setEntry(0, -122);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall3() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, -36);
pointLeft.setEntry(0, 109);
pointRight.setEntry(1, -9.5);
pointRight.setEntry(0, 58);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall4() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, -18);
pointLeft.setEntry(0, 114);
pointRight.setEntry(1, 10);
pointRight.setEntry(0, 58);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall5() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 60;
pointMiddle.setEntry(1, 22);
pointMiddle.setEntry(0, 123);
pointLower.setEntry(1, 22);
pointLower.setEntry(0, 184);
pointUpper.setEntry(1, -36);
pointUpper.setEntry(0, 109);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall6() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 41;
pointMiddle.setEntry(1, 22);
pointMiddle.setEntry(0, 123);
pointLower.setEntry(1, 22);
pointLower.setEntry(0, 164);
pointUpper.setEntry(1, -18);
pointUpper.setEntry(0, 114);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall7() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 60;
pointMiddle.setEntry(1, 22);
pointMiddle.setEntry(0, 123);
pointLower.setEntry(1, 79);
pointLower.setEntry(0, 137.6);
pointUpper.setEntry(1, 22);
pointUpper.setEntry(0, 184);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall8() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 41;
pointMiddle.setEntry(1, 22);
pointMiddle.setEntry(0, 123);
pointLower.setEntry(1, 60.6);
pointLower.setEntry(0, 133);
pointUpper.setEntry(1, 22);
pointUpper.setEntry(0, 164);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall9() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 60.6);
pointLeft.setEntry(0, 133);
pointRight.setEntry(1, 65.8);
pointRight.setEntry(0, 98.5);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall10() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 79);
pointLeft.setEntry(0, 137.6);
pointRight.setEntry(1, 83.5);
pointRight.setEntry(0, 108);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall11() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 65.8);
pointLeft.setEntry(0, 98.5);
pointRight.setEntry(1, 90);
pointRight.setEntry(0, 58);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall12() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 83.5);
pointLeft.setEntry(0, 108);
pointRight.setEntry(1, 110);
pointRight.setEntry(0, 59);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall13() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 90);
pointLeft.setEntry(0, 58);
pointRight.setEntry(1, 90.8);
pointRight.setEntry(0, -122);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall14() {
RealVector pointLeft = new ArrayRealVector(2);
RealVector pointRight = new ArrayRealVector(2);
pointLeft.setEntry(1, 110);
pointLeft.setEntry(0, 59);
pointRight.setEntry(1, 110);
pointRight.setEntry(0, -121);
walls.add(new WallLinear(pointLeft, pointRight));
}
private static void addWall15() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 61;
pointMiddle.setEntry(1, 51.3);
pointMiddle.setEntry(0, -123);
pointLower.setEntry(1, 110);
pointLower.setEntry(0, -121);
pointUpper.setEntry(1, 51.3);
pointUpper.setEntry(0, -183);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall16() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 41;
pointMiddle.setEntry(1, 51.3);
pointMiddle.setEntry(0, -123);
pointLower.setEntry(1, 90.8);
pointLower.setEntry(0, -123);
pointUpper.setEntry(1, 51.3);
pointUpper.setEntry(0, -164);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall17() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 61;
pointMiddle.setEntry(1, 51.3);
pointMiddle.setEntry(0, -123);
pointLower.setEntry(1, 51.3);
pointLower.setEntry(0, -183);
pointUpper.setEntry(1, -9.5);
pointUpper.setEntry(0, -122);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
private static void addWall18() {
RealVector pointMiddle = new ArrayRealVector(2);
RealVector pointLower = new ArrayRealVector(2);
RealVector pointUpper = new ArrayRealVector(2);
double radius = 41;
pointMiddle.setEntry(1, 51.3);
pointMiddle.setEntry(0, -123);
pointLower.setEntry(1, 51.3);
pointLower.setEntry(0, -164);
pointUpper.setEntry(1, 10);
pointUpper.setEntry(0, -122);
walls.add(new WallCurved(pointMiddle, radius, pointLower, pointUpper));
}
/*private static void initParts() {
parts = new ArrayList<>();
TrackPart firstLinear = Track.createFirstLinear();
TrackPart secondLinear = Track.createSecondLinear();
TrackPart firstCircle = Track.createFirstCircle();
TrackPart thirdLinear = Track.createThirdLinear();
TrackPart fourthLinear = Track.createFourthLinear();
TrackPart fifthLinear = Track.createFifthLinear();
TrackPart secondCircle = Track.createSecondCircle();
parts.add(firstLinear);
parts.add(secondLinear);
parts.add(firstCircle);
parts.add(thirdLinear);
parts.add(fourthLinear);
parts.add(fifthLinear);
parts.add(secondCircle);
}
private static TrackPart createFirstLinear() {
RealVector pointUpperLeft = new ArrayRealVector(2);
RealVector pointUpperRight = new ArrayRealVector(2);
RealVector pointLowerLeft = new ArrayRealVector(2);
RealVector pointLowerRight = new ArrayRealVector(2);
pointUpperLeft.setEntry(0, -9.5);
pointUpperLeft.setEntry(1, 58);
pointUpperRight.setEntry(0, -9.5);
pointUpperRight.setEntry(1, -122);
pointLowerLeft.setEntry(0, 10);
pointLowerLeft.setEntry(1, 58);
pointLowerRight.setEntry(0, 10);
pointLowerRight.setEntry(1, -122);
return new TrackPartLinear(pointUpperLeft, pointUpperRight, pointLowerLeft, pointLowerRight);
}
private static TrackPart createSecondLinear() {
RealVector pointUpperLeft = new ArrayRealVector(2);
RealVector pointUpperRight = new ArrayRealVector(2);
RealVector pointLowerLeft = new ArrayRealVector(2);
RealVector pointLowerRight = new ArrayRealVector(2);
pointUpperLeft.setEntry(0, -36);
pointUpperLeft.setEntry(1, 109);
pointUpperRight.setEntry(0, -9.5);
pointUpperRight.setEntry(1, 58);
pointLowerLeft.setEntry(0, -18);
pointLowerLeft.setEntry(1, 114);
pointLowerRight.setEntry(0, 10);
pointLowerRight.setEntry(1, 58);
return new TrackPartLinear(pointUpperLeft, pointUpperRight, pointLowerLeft, pointLowerRight);
}
private static TrackPart createFirstCircle() {
RealVector point = new ArrayRealVector(2);
point.setEntry(0, 22);
point.setEntry(1, 123);
double radiusInner = 41;
double radiusOuter = 60;
return new TrackPartCircle(point, radiusInner, radiusOuter);
}
private static TrackPart createThirdLinear() {
RealVector pointUpperLeft = new ArrayRealVector(2);
RealVector pointUpperRight = new ArrayRealVector(2);
RealVector pointLowerLeft = new ArrayRealVector(2);
RealVector pointLowerRight = new ArrayRealVector(2);
pointUpperLeft.setEntry(0, 60.6);
pointUpperLeft.setEntry(1, 133);
pointUpperRight.setEntry(0, 65.8);
pointUpperRight.setEntry(1, 98.5);
pointLowerLeft.setEntry(0, 79);
pointLowerLeft.setEntry(1, 137.6);
pointLowerRight.setEntry(0, 83.5);
pointLowerRight.setEntry(1, 108);
return new TrackPartLinear(pointUpperLeft, pointUpperRight, pointLowerLeft, pointLowerRight);
}
private static TrackPart createFourthLinear() {
RealVector pointUpperLeft = new ArrayRealVector(2);
RealVector pointUpperRight = new ArrayRealVector(2);
RealVector pointLowerLeft = new ArrayRealVector(2);
RealVector pointLowerRight = new ArrayRealVector(2);
pointUpperLeft.setEntry(0, 65.8);
pointUpperLeft.setEntry(1, 98.5);
pointUpperRight.setEntry(0, 90);
pointUpperRight.setEntry(1, 58);
pointLowerLeft.setEntry(0, 83.5);
pointLowerLeft.setEntry(1, 108);
pointLowerRight.setEntry(0, 110);
pointLowerRight.setEntry(1, 59);
return new TrackPartLinear(pointUpperLeft, pointUpperRight, pointLowerLeft, pointLowerRight);
}
private static TrackPart createFifthLinear() {
RealVector pointUpperLeft = new ArrayRealVector(2);
RealVector pointUpperRight = new ArrayRealVector(2);
RealVector pointLowerLeft = new ArrayRealVector(2);
RealVector pointLowerRight = new ArrayRealVector(2);
pointUpperLeft.setEntry(0, 90);
pointUpperLeft.setEntry(1, 58);
pointUpperRight.setEntry(0, 90.8);
pointUpperRight.setEntry(1, -122);
pointLowerLeft.setEntry(0, 110);
pointLowerLeft.setEntry(1, 59);
pointLowerRight.setEntry(0, 110);
pointLowerRight.setEntry(1, -121);
return new TrackPartLinear(pointUpperLeft, pointUpperRight, pointLowerLeft, pointLowerRight);
}
private static TrackPart createSecondCircle() {
RealVector point = new ArrayRealVector(2);
point.setEntry(0, 51.3);
point.setEntry(1, -123);
double radiusInner = 41;
double radiusOuter = 61;
return new TrackPartCircle(point, radiusInner, radiusOuter);
}*/
} | 13,852 | 0.639186 | 0.594066 | 470 | 28.474468 | 23.575104 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.980851 | false | false | 13 |
f88cc2249953b4adbb80028612c6896517dffefb | 7,911,329,787,646 | e127a97a2d56c479505fb52fe8462657251ff07a | /src/main/java/com/jacstuff/msscbeerservice/web/model/BeerStyle.java | 967fc1c2c6f80ff359483572131671ebf89bbb7c | [] | no_license | johncrawley/mssc-beer-service | https://github.com/johncrawley/mssc-beer-service | 7d8393a046d8968e82488cb0a03b1b4563955020 | 2fed87b96af92931d57d6dea8e7e702e6f492a75 | refs/heads/master | 2023-02-04T11:50:17.209000 | 2020-12-22T21:17:03 | 2020-12-22T21:17:03 | 300,259,907 | 0 | 0 | null | false | 2020-10-20T17:46:02 | 2020-10-01T11:47:36 | 2020-10-15T20:40:10 | 2020-10-20T16:20:10 | 85 | 0 | 0 | 1 | Java | false | false | package com.jacstuff.msscbeerservice.web.model;
public enum BeerStyle {
LAGER, PILSNER, ALE, STOUT, GOSE, IPA, PORTER, WHEAT, PALE_ALE, SAISON;
}
| UTF-8 | Java | 150 | java | BeerStyle.java | Java | [] | null | [] | package com.jacstuff.msscbeerservice.web.model;
public enum BeerStyle {
LAGER, PILSNER, ALE, STOUT, GOSE, IPA, PORTER, WHEAT, PALE_ALE, SAISON;
}
| 150 | 0.74 | 0.74 | 7 | 20.428572 | 26.730705 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.714286 | false | false | 13 |
cbdf13bb944578830ceedefe18f7d1b941a69750 | 566,935,710,451 | d8bb9c3d863b2abfd5adb45bcd06f68e943874bb | /src/test/java/com/imooc/bigdata/hbase/HBaseAppCopy.java | 5ea417fe961e473a19163ddeecd5d31e5f268579 | [] | no_license | dudu8246/spark-project-train-chris | https://github.com/dudu8246/spark-project-train-chris | 5b70b7ac878d5c67f3a009f6762e6fe46664d014 | 713d9d6a6b1c98ffdd78546a3679c3eb60f02b29 | refs/heads/master | 2022-07-13T15:27:29.874000 | 2019-12-24T10:19:12 | 2019-12-24T10:19:12 | 229,920,288 | 0 | 0 | null | false | 2022-07-01T17:43:03 | 2019-12-24T10:18:37 | 2019-12-24T10:20:01 | 2022-07-01T17:43:02 | 4,777 | 0 | 0 | 4 | Scala | false | false | package com.imooc.bigdata.hbase;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.*;
import org.apache.hadoop.hbase.client.*;
import org.apache.hadoop.hbase.filter.*;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import javax.swing.plaf.PanelUI;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class HBaseAppCopy
{
Connection connection = null ;
Table table = null;
Admin admin = null;
String tableName = "hbase_java_api" ;
@Before
public void setUp() {
Configuration configuration = new Configuration();
configuration.set("hbase.rootdir", "hdfs://hadoop000:8020/hbase");
configuration.set("hbase.zookeeper.quorum", "hadoop000:2181");
// System.setProperty("hadoop.home.dir", "D:\\hadoop\\");
try {
connection = ConnectionFactory.createConnection(configuration);
admin = connection.getAdmin();
Assert.assertNotNull(connection);
Assert.assertNotNull(admin);
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
public void getConnecton(){
}
@Test
public void createTable(){
TableName table = TableName.valueOf(tableName);
try {
if(admin.tableExists(table)){
System.out.println(tableName+ "已经存在");
}
else{
/***
* HTableDescriptor ===> 表的描述符
* HColumnDescriptor ===> 列族的描述符
*/
HTableDescriptor descriptor = new HTableDescriptor(table);
descriptor.addFamily(new HColumnDescriptor("info"));
descriptor.addFamily(new HColumnDescriptor("ADDRESS"));
admin.createTable(descriptor);
System.out.println(tableName + "创建成功");
}
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
public void queryTableInfos(){
try {
HTableDescriptor[] tables = admin.listTables();
if(tables.length >0){
for(HTableDescriptor table: tables){
System.out.println(table.getNameAsString());
HColumnDescriptor[] columnDescriptors = table.getColumnFamilies();
for(HColumnDescriptor c_f: columnDescriptors){
System.out.println("\t"+c_f.getNameAsString());
}
System.out.println("------------------------------------");
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
public void testPut() throws IOException {
table = connection.getTable(TableName.valueOf(tableName));
// Put put = new Put(Bytes.toBytes("chris"));
// // 通过Put设置要添加数据的cf、qualifier(column)、value
// put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("age"), Bytes.toBytes("26"));
// put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("birthday"), Bytes.toBytes("1993-06-16"));
// put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("company"), Bytes.toBytes("28"));
// put.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("country"), Bytes.toBytes("CN"));
// put.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("province"), Bytes.toBytes("jilin"));
// put.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("city"), Bytes.toBytes("changchun"));
//将数据put到hbase中去
// table.put(put);
List<Put> puts = new ArrayList<>();
Put put1 = new Put(Bytes.toBytes("sunshine"));
// 通过Put设置要添加数据的cf、qualifier(column)、value
put1.addColumn(Bytes.toBytes("info"), Bytes.toBytes("age"), Bytes.toBytes("26"));
put1.addColumn(Bytes.toBytes("info"), Bytes.toBytes("birthday"), Bytes.toBytes("1993-03-16"));
put1.addColumn(Bytes.toBytes("info"), Bytes.toBytes("company"), Bytes.toBytes("apple"));
put1.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("country"), Bytes.toBytes("CN"));
put1.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("province"), Bytes.toBytes("jilin"));
put1.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("city"), Bytes.toBytes("changchun"));
Put put2 = new Put(Bytes.toBytes("dark"));
// 通过Put设置要添加数据的cf、qualifier(column)、value
put2.addColumn(Bytes.toBytes("info"), Bytes.toBytes("age"), Bytes.toBytes("27"));
put2.addColumn(Bytes.toBytes("info"), Bytes.toBytes("birthday"), Bytes.toBytes("1992-03-16"));
put2.addColumn(Bytes.toBytes("info"), Bytes.toBytes("company"), Bytes.toBytes("sums"));
put2.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("country"), Bytes.toBytes("CN"));
put2.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("province"), Bytes.toBytes("dongbei"));
put2.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("city"), Bytes.toBytes("heilong"));
puts.add(put1);
puts.add(put2);
table.put(puts);
}
@Test
public void testGet01() throws IOException {
table = connection.getTable(TableName.valueOf(tableName));
Get get = new Get("chris".getBytes());
get.addColumn(Bytes.toBytes("info"), (Bytes.toBytes("age")));
Result result = table.get(get);
printRequest(result);
}
@Test
public void testScan01() throws IOException {
table = connection.getTable(TableName.valueOf(tableName));
Scan scan =new Scan();
// scan.addFamily(Bytes.toBytes("info"));
scan.addColumn(Bytes.toBytes("info"),Bytes.toBytes("company"));
// Scan scan = new Scan(Bytes.toBytes("chris"));
// Scan scan = new Scan(new Get(Bytes.toBytes("chris")));
// Scan scan = new Scan(Bytes.toBytes("chris"),Bytes.toBytes("sunshine"));
ResultScanner rs = table.getScanner(scan);
for(Result result : rs){
printRequest(result);
System.out.println("~~~~~~~~~~~~~~~~~");
}
}
private void printRequest(Result result){
for(Cell cell :result.rawCells()){
System.out.println(Bytes.toString(result.getRow())+ "\t"
+Bytes.toString(CellUtil.cloneFamily(cell))+ "\t"
+Bytes.toString(CellUtil.cloneQualifier(cell))+ "\t"
+Bytes.toString(CellUtil.cloneValue(cell))+ "\t"
+cell.getTimestamp());
}
}
@Test
public void testFilter() throws IOException {
table = connection.getTable(TableName.valueOf(tableName));
Scan scan = new Scan();
// String reg = "^c";
// // RowFilter 过滤行, RegexStringComparator 通过正则匹配的方式
// Filter filter = new RowFilter(CompareFilter.CompareOp.EQUAL, new RegexStringComparator(reg));
// scan.setFilter(filter);
// Filter filter = new PrefixFilter(Bytes.toBytes("d"));
// scan.setFilter(filter);
ResultScanner rs = table.getScanner(scan);
for(Result result : rs){
printRequest(result);
System.out.println("~~~~~~~~~~~~~~~~~");
}
}
@After
public void tearDown(){
try {
connection.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| UTF-8 | Java | 7,555 | java | HBaseAppCopy.java | Java | [
{
"context": "e.valueOf(tableName));\n Get get = new Get(\"chris\".getBytes());\n get.addColumn(Bytes.toBytes",
"end": 5328,
"score": 0.7062182426452637,
"start": 5323,
"tag": "NAME",
"value": "chris"
}
] | null | [] | package com.imooc.bigdata.hbase;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.*;
import org.apache.hadoop.hbase.client.*;
import org.apache.hadoop.hbase.filter.*;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import javax.swing.plaf.PanelUI;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class HBaseAppCopy
{
Connection connection = null ;
Table table = null;
Admin admin = null;
String tableName = "hbase_java_api" ;
@Before
public void setUp() {
Configuration configuration = new Configuration();
configuration.set("hbase.rootdir", "hdfs://hadoop000:8020/hbase");
configuration.set("hbase.zookeeper.quorum", "hadoop000:2181");
// System.setProperty("hadoop.home.dir", "D:\\hadoop\\");
try {
connection = ConnectionFactory.createConnection(configuration);
admin = connection.getAdmin();
Assert.assertNotNull(connection);
Assert.assertNotNull(admin);
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
public void getConnecton(){
}
@Test
public void createTable(){
TableName table = TableName.valueOf(tableName);
try {
if(admin.tableExists(table)){
System.out.println(tableName+ "已经存在");
}
else{
/***
* HTableDescriptor ===> 表的描述符
* HColumnDescriptor ===> 列族的描述符
*/
HTableDescriptor descriptor = new HTableDescriptor(table);
descriptor.addFamily(new HColumnDescriptor("info"));
descriptor.addFamily(new HColumnDescriptor("ADDRESS"));
admin.createTable(descriptor);
System.out.println(tableName + "创建成功");
}
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
public void queryTableInfos(){
try {
HTableDescriptor[] tables = admin.listTables();
if(tables.length >0){
for(HTableDescriptor table: tables){
System.out.println(table.getNameAsString());
HColumnDescriptor[] columnDescriptors = table.getColumnFamilies();
for(HColumnDescriptor c_f: columnDescriptors){
System.out.println("\t"+c_f.getNameAsString());
}
System.out.println("------------------------------------");
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
public void testPut() throws IOException {
table = connection.getTable(TableName.valueOf(tableName));
// Put put = new Put(Bytes.toBytes("chris"));
// // 通过Put设置要添加数据的cf、qualifier(column)、value
// put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("age"), Bytes.toBytes("26"));
// put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("birthday"), Bytes.toBytes("1993-06-16"));
// put.addColumn(Bytes.toBytes("info"), Bytes.toBytes("company"), Bytes.toBytes("28"));
// put.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("country"), Bytes.toBytes("CN"));
// put.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("province"), Bytes.toBytes("jilin"));
// put.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("city"), Bytes.toBytes("changchun"));
//将数据put到hbase中去
// table.put(put);
List<Put> puts = new ArrayList<>();
Put put1 = new Put(Bytes.toBytes("sunshine"));
// 通过Put设置要添加数据的cf、qualifier(column)、value
put1.addColumn(Bytes.toBytes("info"), Bytes.toBytes("age"), Bytes.toBytes("26"));
put1.addColumn(Bytes.toBytes("info"), Bytes.toBytes("birthday"), Bytes.toBytes("1993-03-16"));
put1.addColumn(Bytes.toBytes("info"), Bytes.toBytes("company"), Bytes.toBytes("apple"));
put1.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("country"), Bytes.toBytes("CN"));
put1.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("province"), Bytes.toBytes("jilin"));
put1.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("city"), Bytes.toBytes("changchun"));
Put put2 = new Put(Bytes.toBytes("dark"));
// 通过Put设置要添加数据的cf、qualifier(column)、value
put2.addColumn(Bytes.toBytes("info"), Bytes.toBytes("age"), Bytes.toBytes("27"));
put2.addColumn(Bytes.toBytes("info"), Bytes.toBytes("birthday"), Bytes.toBytes("1992-03-16"));
put2.addColumn(Bytes.toBytes("info"), Bytes.toBytes("company"), Bytes.toBytes("sums"));
put2.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("country"), Bytes.toBytes("CN"));
put2.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("province"), Bytes.toBytes("dongbei"));
put2.addColumn(Bytes.toBytes("ADDRESS"), Bytes.toBytes("city"), Bytes.toBytes("heilong"));
puts.add(put1);
puts.add(put2);
table.put(puts);
}
@Test
public void testGet01() throws IOException {
table = connection.getTable(TableName.valueOf(tableName));
Get get = new Get("chris".getBytes());
get.addColumn(Bytes.toBytes("info"), (Bytes.toBytes("age")));
Result result = table.get(get);
printRequest(result);
}
@Test
public void testScan01() throws IOException {
table = connection.getTable(TableName.valueOf(tableName));
Scan scan =new Scan();
// scan.addFamily(Bytes.toBytes("info"));
scan.addColumn(Bytes.toBytes("info"),Bytes.toBytes("company"));
// Scan scan = new Scan(Bytes.toBytes("chris"));
// Scan scan = new Scan(new Get(Bytes.toBytes("chris")));
// Scan scan = new Scan(Bytes.toBytes("chris"),Bytes.toBytes("sunshine"));
ResultScanner rs = table.getScanner(scan);
for(Result result : rs){
printRequest(result);
System.out.println("~~~~~~~~~~~~~~~~~");
}
}
private void printRequest(Result result){
for(Cell cell :result.rawCells()){
System.out.println(Bytes.toString(result.getRow())+ "\t"
+Bytes.toString(CellUtil.cloneFamily(cell))+ "\t"
+Bytes.toString(CellUtil.cloneQualifier(cell))+ "\t"
+Bytes.toString(CellUtil.cloneValue(cell))+ "\t"
+cell.getTimestamp());
}
}
@Test
public void testFilter() throws IOException {
table = connection.getTable(TableName.valueOf(tableName));
Scan scan = new Scan();
// String reg = "^c";
// // RowFilter 过滤行, RegexStringComparator 通过正则匹配的方式
// Filter filter = new RowFilter(CompareFilter.CompareOp.EQUAL, new RegexStringComparator(reg));
// scan.setFilter(filter);
// Filter filter = new PrefixFilter(Bytes.toBytes("d"));
// scan.setFilter(filter);
ResultScanner rs = table.getScanner(scan);
for(Result result : rs){
printRequest(result);
System.out.println("~~~~~~~~~~~~~~~~~");
}
}
@After
public void tearDown(){
try {
connection.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| 7,555 | 0.594168 | 0.585122 | 203 | 35.487686 | 30.074842 | 103 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.684729 | false | false | 13 |
8a5282b47cad93928503630b5e53c68538d314e0 | 17,678,085,416,590 | 9820100d3284a61d2cb7780418af44fe255eda62 | /examples/test/src/test/java/org/parceler/ABTest.java | d4853f91637226667b510b30ea979f5f8bacd192 | [
"Apache-2.0"
] | permissive | DanielGunna/parceler | https://github.com/DanielGunna/parceler | 8d0a30e5168ae7b0abfcf9f2e41d7d70651737a5 | 57fe69eee02f4fc9ab9d7f450f2259af281b7838 | refs/heads/master | 2020-04-06T15:34:29.480000 | 2018-11-18T22:11:14 | 2018-11-18T22:11:14 | 157,583,878 | 1 | 0 | Apache-2.0 | true | 2018-11-18T22:11:15 | 2018-11-14T17:12:52 | 2018-11-14T17:12:54 | 2018-11-18T22:11:14 | 1,541 | 0 | 0 | 0 | Java | false | null | /**
* Copyright 2011-2015 John Ericksen
*
* 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.parceler;
import org.junit.Test;
import java.util.Collections;
import java.util.List;
import static org.junit.Assert.assertEquals;
/**
* @author John Ericksen
*/
public class ABTest {
@ParcelClasses({
@ParcelClass(A.class),
@ParcelClass(B.class)
})
public static class A {
}
public static class B {
List<A> a;
}
@Test
public void testList(){
B b = new B();
A a = new A();
b.a = Collections.singletonList(a);
B output = Parcels.unwrap(new ABTest$B$$Parcelable(b));
assertEquals(1, output.a.size());
}
}
| UTF-8 | Java | 1,234 | java | ABTest.java | Java | [
{
"context": "/**\n * Copyright 2011-2015 John Ericksen\n *\n * Licensed under the Apache License, Version ",
"end": 40,
"score": 0.9998030662536621,
"start": 27,
"tag": "NAME",
"value": "John Ericksen"
},
{
"context": "tic org.junit.Assert.assertEquals;\n\n/**\n * @author John Erick... | null | [] | /**
* Copyright 2011-2015 <NAME>
*
* 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.parceler;
import org.junit.Test;
import java.util.Collections;
import java.util.List;
import static org.junit.Assert.assertEquals;
/**
* @author <NAME>
*/
public class ABTest {
@ParcelClasses({
@ParcelClass(A.class),
@ParcelClass(B.class)
})
public static class A {
}
public static class B {
List<A> a;
}
@Test
public void testList(){
B b = new B();
A a = new A();
b.a = Collections.singletonList(a);
B output = Parcels.unwrap(new ABTest$B$$Parcelable(b));
assertEquals(1, output.a.size());
}
}
| 1,220 | 0.658023 | 0.647488 | 50 | 23.68 | 22.968187 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.36 | false | false | 13 |
70767500ec4ab4ffadfb9a0fff3f93df2c5ca3f7 | 20,426,864,490,108 | 741e45031776819fb6f0c22dc13dbb920e4c0501 | /app/src/main/java/com/lzhy/moneyhll/me/mine/adapter/BaseAbstractAdapter.java | b4c0aa9c4bd247d60dedc51f30b268046667a4bb | [] | no_license | cmmzjwz99/MyfristProject | https://github.com/cmmzjwz99/MyfristProject | c8eb3c2aef494f8089548ff00404273c37b5dd22 | 1934e0a698049f8178addae047e34e755af68fff | refs/heads/master | 2020-03-23T06:45:11.032000 | 2018-07-17T03:42:24 | 2018-07-17T03:42:24 | 141,227,385 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lzhy.moneyhll.me.mine.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.BaseAdapter;
import java.util.ArrayList;
import java.util.List;
/**
* Created by cmm on 2016/11/1.
*/
public abstract class BaseAbstractAdapter<T> extends BaseAdapter {
protected List<T> list;
protected LayoutInflater mInflater;
protected Context context;
public BaseAbstractAdapter(Context context) {
list = new ArrayList<>();
this.context = context;
mInflater = LayoutInflater.from(context);
}
public BaseAbstractAdapter() {
}
public void add(T t) {
list.add(t);
}
public void addList(List<T> list) {
if (list == null || list.size() == 0) {
return;
}
this.list.addAll(list);
notifyDataSetChanged();
}
public void remove(int position) {
if (position >= 0 && position < list.size()) {
list.remove(position);
}
}
public void removeAll() {
if (null != list) {
list.clear();
}
notifyDataSetChanged();
}
public void setList(List<T> list) {
this.list = list;
notifyDataSetChanged();
}
public List getList() {
return list;
}
@Override
public int getCount() {
return list != null ? list.size() : 0;
}
@Override
public T getItem(int position) {
if (position < 0 || position >= list.size())
return null;
T t = list.get(position);
return null != t ? t : null;
}
@Override
public long getItemId(int position) {
return position;
}
}
| UTF-8 | Java | 1,782 | java | BaseAbstractAdapter.java | Java | [
{
"context": "ist;\r\nimport java.util.List;\r\n\r\n/**\r\n * Created by cmm on 2016/11/1.\r\n */\r\n\r\npublic abstract class BaseA",
"end": 231,
"score": 0.9973434209823608,
"start": 228,
"tag": "USERNAME",
"value": "cmm"
}
] | null | [] | package com.lzhy.moneyhll.me.mine.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.BaseAdapter;
import java.util.ArrayList;
import java.util.List;
/**
* Created by cmm on 2016/11/1.
*/
public abstract class BaseAbstractAdapter<T> extends BaseAdapter {
protected List<T> list;
protected LayoutInflater mInflater;
protected Context context;
public BaseAbstractAdapter(Context context) {
list = new ArrayList<>();
this.context = context;
mInflater = LayoutInflater.from(context);
}
public BaseAbstractAdapter() {
}
public void add(T t) {
list.add(t);
}
public void addList(List<T> list) {
if (list == null || list.size() == 0) {
return;
}
this.list.addAll(list);
notifyDataSetChanged();
}
public void remove(int position) {
if (position >= 0 && position < list.size()) {
list.remove(position);
}
}
public void removeAll() {
if (null != list) {
list.clear();
}
notifyDataSetChanged();
}
public void setList(List<T> list) {
this.list = list;
notifyDataSetChanged();
}
public List getList() {
return list;
}
@Override
public int getCount() {
return list != null ? list.size() : 0;
}
@Override
public T getItem(int position) {
if (position < 0 || position >= list.size())
return null;
T t = list.get(position);
return null != t ? t : null;
}
@Override
public long getItemId(int position) {
return position;
}
}
| 1,782 | 0.54826 | 0.542088 | 81 | 20 | 17.032286 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.382716 | false | false | 13 |
4063604b0b93c32bd4137b2e95ee59fc9f711569 | 19,963,008,021,709 | 1713d734d4ed857fb517b50fd7d03987282917b6 | /src/main/java/com/burakcekil/springbootmongoogm/repository/CustomerRepository.java | 809d446a8ba53bc26610be6a9b89479ccc27bf81 | [
"MIT"
] | permissive | cekil/spring-boot-mongo-ogm | https://github.com/cekil/spring-boot-mongo-ogm | 5f25e298fdccdf74e9b4ec7eff0b3514f5c30411 | 0cf16ac3f3a141c6e304ac5f4b7fe95030d285bb | refs/heads/master | 2022-04-21T17:25:43.578000 | 2020-04-19T17:17:28 | 2020-04-19T17:17:28 | 256,624,418 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.burakcekil.springbootmongoogm.repository;
import com.burakcekil.springbootmongoogm.model.entity.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
/**
* Summary
* <p>
* Description
*
* @author Burak Cekil (burakcekil.com)
* @version 1.0
* @since 4/18/2020
*/
@Component
public class CustomerRepository {
@Autowired
private EntityManagerFactory entityManagerFactory;
public Customer save(Customer customer) {
EntityManager entityManager = entityManagerFactory.createEntityManager();
entityManager.getTransaction().begin();
entityManager.persist(customer);
entityManager.getTransaction().commit();
entityManager.close();
entityManager = entityManagerFactory.createEntityManager();
// load it back
entityManager.getTransaction().begin();
Customer loadedCustomer = entityManager.find(Customer.class, customer.getId());
entityManager.getTransaction().commit();
entityManager.close();
return loadedCustomer;
}
}
| UTF-8 | Java | 1,208 | java | CustomerRepository.java | Java | [
{
"context": "/**\n * Summary\n * <p>\n * Description\n *\n * @author Burak Cekil (burakcekil.com)\n * @version 1.0\n * @since 4/18/2",
"end": 382,
"score": 0.9998855590820312,
"start": 371,
"tag": "NAME",
"value": "Burak Cekil"
},
{
"context": "\n * <p>\n * Description\n *\n * @auth... | null | [] | package com.burakcekil.springbootmongoogm.repository;
import com.burakcekil.springbootmongoogm.model.entity.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
/**
* Summary
* <p>
* Description
*
* @author <NAME> (<EMAIL>)
* @version 1.0
* @since 4/18/2020
*/
@Component
public class CustomerRepository {
@Autowired
private EntityManagerFactory entityManagerFactory;
public Customer save(Customer customer) {
EntityManager entityManager = entityManagerFactory.createEntityManager();
entityManager.getTransaction().begin();
entityManager.persist(customer);
entityManager.getTransaction().commit();
entityManager.close();
entityManager = entityManagerFactory.createEntityManager();
// load it back
entityManager.getTransaction().begin();
Customer loadedCustomer = entityManager.find(Customer.class, customer.getId());
entityManager.getTransaction().commit();
entityManager.close();
return loadedCustomer;
}
}
| 1,196 | 0.730132 | 0.722682 | 46 | 25.26087 | 24.8897 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.413043 | false | false | 13 |
81205e47515b3211bec8a8076895d49e45a20955 | 29,094,108,524,234 | 94f11ee1b824e6ac14a0195b53685819ef6e7790 | /src/main/java/com/lhh/volunteerservicemanagement/utils/RandomCode.java | 46af63519be51f2b340a7b87c5385bf95d23c84a | [] | no_license | 747677492/lhh | https://github.com/747677492/lhh | e7a2e024a7f40ab4dab2d4c01828d6df793e0182 | fdaf1febf7ab5a3a26f7c5a9310d87208561355f | refs/heads/main | 2023-04-12T06:05:40.174000 | 2021-05-08T09:47:34 | 2021-05-08T09:47:34 | 365,079,063 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lhh.volunteerservicemanagement.utils;
import java.text.SimpleDateFormat;
/**
* @author lhh
* @date 2021/5/5 16:59
* 概要:
*/
public class RandomCode {
public static String getRandomCode(){
SimpleDateFormat tempDate = new SimpleDateFormat("yyMMddHHmmss");
String random = tempDate.format(new java.util.Date());
return random;
}
}
| UTF-8 | Java | 383 | java | RandomCode.java | Java | [
{
"context": "import java.text.SimpleDateFormat;\n\n/**\n * @author lhh\n * @date 2021/5/5 16:59\n * 概要:\n */\npublic class R",
"end": 105,
"score": 0.9996430277824402,
"start": 102,
"tag": "USERNAME",
"value": "lhh"
}
] | null | [] | package com.lhh.volunteerservicemanagement.utils;
import java.text.SimpleDateFormat;
/**
* @author lhh
* @date 2021/5/5 16:59
* 概要:
*/
public class RandomCode {
public static String getRandomCode(){
SimpleDateFormat tempDate = new SimpleDateFormat("yyMMddHHmmss");
String random = tempDate.format(new java.util.Date());
return random;
}
}
| 383 | 0.687003 | 0.660477 | 16 | 22.5625 | 22.610752 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3125 | false | false | 13 |
8bb48fff9e16b38c9bc810487db85de84a90556e | 11,982,958,809,903 | 9bcbf083e902085693a895332dced1093fe1d83c | /src/main/java/me/cominixo/betterf3/config/gui/modules/ModulesScreen.java | e1fb3034c9386c9e0259fa102e53db13cac5daa8 | [
"MIT"
] | permissive | qsefthuopq/BetterF3 | https://github.com/qsefthuopq/BetterF3 | 6db17df8bdf479ac3507e5ffea9299ca099da7e6 | 6a97d880ba3bc5eeff7b8b04f1ab77eef15df1d8 | refs/heads/master | 2022-12-03T08:50:58.239000 | 2020-08-15T11:39:44 | 2020-08-15T11:39:44 | 287,929,002 | 0 | 0 | null | true | 2020-08-16T11:19:03 | 2020-08-16T11:19:03 | 2020-08-15T14:57:01 | 2020-08-15T15:13:52 | 131 | 0 | 0 | 0 | null | false | false | package me.cominixo.betterf3.config.gui.modules;
import me.cominixo.betterf3.config.ModConfigFile;
import me.cominixo.betterf3.modules.BaseModule;
import me.cominixo.betterf3.utils.PositionEnum;
import net.minecraft.client.gui.screen.*;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.TranslatableText;
import java.util.Objects;
public class ModulesScreen extends Screen {
Screen parent;
ModuleListWidget modulesListWidget;
private boolean initialized = false;
private ButtonWidget editButton, deleteButton;
public PositionEnum side;
public ModulesScreen(Screen parent, PositionEnum side) {
super(new TranslatableText("config.betterf3.title.modules"));
this.parent = parent;
this.side = side;
}
@Override
protected void init() {
super.init();
if (this.initialized) {
this.modulesListWidget.updateSize(this.width, this.height, 32, this.height - 64);
} else {
this.initialized = true;
this.modulesListWidget = new ModuleListWidget(this, this.client, this.width, this.height, 32, this.height - 64, 36);
if (this.side == PositionEnum.LEFT) {
this.modulesListWidget.setModules(BaseModule.modules);
} else if (this.side == PositionEnum.RIGHT) {
this.modulesListWidget.setModules(BaseModule.modulesRight);
}
}
this.editButton = this.addButton(new ButtonWidget(this.width / 2 - 50, this.height - 50, 100, 20, new TranslatableText("config.betterf3.modules.edit_button"), (buttonWidget) -> {
Screen screen = (EditModulesScreen.getConfigBuilder(Objects.requireNonNull(this.modulesListWidget.getSelected()).module).build());
client.openScreen(screen);
}));
this.addButton(new ButtonWidget(this.width / 2 + 4 + 50, this.height - 50, 100, 20, new TranslatableText("config.betterf3.modules.add_button"), (buttonWidget) -> client.openScreen(AddModuleScreen.getConfigBuilder(this).build())));
this.deleteButton = this.addButton(new ButtonWidget(this.width / 2 - 154, this.height - 50, 100, 20, new TranslatableText("config.betterf3.modules.delete_button"), (buttonWidget) -> this.modulesListWidget.removeModule(this.modulesListWidget.moduleEntries.indexOf(Objects.requireNonNull(this.modulesListWidget.getSelected())))));
this.addButton(new ButtonWidget(this.width / 2 - 154, this.height - 30 + 4, 300 + 8, 20, new TranslatableText("config.betterf3.modules.done_button"), (buttonWidget) -> {
this.onClose();
client.openScreen(parent);
}));
updateButtons();
this.children.add(this.modulesListWidget);
}
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.modulesListWidget.render(matrices, mouseX, mouseY, delta);
this.drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 20, 0xFFFFFF);
super.render(matrices, mouseX, mouseY, delta);
}
@Override
public void onClose() {
if (this.side == PositionEnum.LEFT) {
BaseModule.modules.clear();
for (ModuleListWidget.ModuleEntry entry : this.modulesListWidget.moduleEntries) {
BaseModule.modules.add(entry.module);
}
} else if (this.side == PositionEnum.RIGHT) {
BaseModule.modulesRight.clear();
for (ModuleListWidget.ModuleEntry entry : this.modulesListWidget.moduleEntries) {
BaseModule.modulesRight.add(entry.module);
}
}
this.client.openScreen(parent);
ModConfigFile.saveRunnable.run();
}
public void select(ModuleListWidget.ModuleEntry entry) {
this.modulesListWidget.setSelected(entry);
updateButtons();
}
public void updateButtons() {
if (this.modulesListWidget.getSelected() != null) {
editButton.active = true;
deleteButton.active = true;
} else {
editButton.active = false;
deleteButton.active = false;
}
}
}
| UTF-8 | Java | 4,219 | java | ModulesScreen.java | Java | [] | null | [] | package me.cominixo.betterf3.config.gui.modules;
import me.cominixo.betterf3.config.ModConfigFile;
import me.cominixo.betterf3.modules.BaseModule;
import me.cominixo.betterf3.utils.PositionEnum;
import net.minecraft.client.gui.screen.*;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.TranslatableText;
import java.util.Objects;
public class ModulesScreen extends Screen {
Screen parent;
ModuleListWidget modulesListWidget;
private boolean initialized = false;
private ButtonWidget editButton, deleteButton;
public PositionEnum side;
public ModulesScreen(Screen parent, PositionEnum side) {
super(new TranslatableText("config.betterf3.title.modules"));
this.parent = parent;
this.side = side;
}
@Override
protected void init() {
super.init();
if (this.initialized) {
this.modulesListWidget.updateSize(this.width, this.height, 32, this.height - 64);
} else {
this.initialized = true;
this.modulesListWidget = new ModuleListWidget(this, this.client, this.width, this.height, 32, this.height - 64, 36);
if (this.side == PositionEnum.LEFT) {
this.modulesListWidget.setModules(BaseModule.modules);
} else if (this.side == PositionEnum.RIGHT) {
this.modulesListWidget.setModules(BaseModule.modulesRight);
}
}
this.editButton = this.addButton(new ButtonWidget(this.width / 2 - 50, this.height - 50, 100, 20, new TranslatableText("config.betterf3.modules.edit_button"), (buttonWidget) -> {
Screen screen = (EditModulesScreen.getConfigBuilder(Objects.requireNonNull(this.modulesListWidget.getSelected()).module).build());
client.openScreen(screen);
}));
this.addButton(new ButtonWidget(this.width / 2 + 4 + 50, this.height - 50, 100, 20, new TranslatableText("config.betterf3.modules.add_button"), (buttonWidget) -> client.openScreen(AddModuleScreen.getConfigBuilder(this).build())));
this.deleteButton = this.addButton(new ButtonWidget(this.width / 2 - 154, this.height - 50, 100, 20, new TranslatableText("config.betterf3.modules.delete_button"), (buttonWidget) -> this.modulesListWidget.removeModule(this.modulesListWidget.moduleEntries.indexOf(Objects.requireNonNull(this.modulesListWidget.getSelected())))));
this.addButton(new ButtonWidget(this.width / 2 - 154, this.height - 30 + 4, 300 + 8, 20, new TranslatableText("config.betterf3.modules.done_button"), (buttonWidget) -> {
this.onClose();
client.openScreen(parent);
}));
updateButtons();
this.children.add(this.modulesListWidget);
}
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.modulesListWidget.render(matrices, mouseX, mouseY, delta);
this.drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 20, 0xFFFFFF);
super.render(matrices, mouseX, mouseY, delta);
}
@Override
public void onClose() {
if (this.side == PositionEnum.LEFT) {
BaseModule.modules.clear();
for (ModuleListWidget.ModuleEntry entry : this.modulesListWidget.moduleEntries) {
BaseModule.modules.add(entry.module);
}
} else if (this.side == PositionEnum.RIGHT) {
BaseModule.modulesRight.clear();
for (ModuleListWidget.ModuleEntry entry : this.modulesListWidget.moduleEntries) {
BaseModule.modulesRight.add(entry.module);
}
}
this.client.openScreen(parent);
ModConfigFile.saveRunnable.run();
}
public void select(ModuleListWidget.ModuleEntry entry) {
this.modulesListWidget.setSelected(entry);
updateButtons();
}
public void updateButtons() {
if (this.modulesListWidget.getSelected() != null) {
editButton.active = true;
deleteButton.active = true;
} else {
editButton.active = false;
deleteButton.active = false;
}
}
}
| 4,219 | 0.666035 | 0.649917 | 106 | 38.801888 | 49.946842 | 336 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.877358 | false | false | 13 |
30f84f304bf2733583502c585272eec3a01602cf | 25,769,855,718 | fa3a67d894945101103cfb09a3db84c5cb8cbb14 | /src/main/java/ar/com/hjg/pngj/chunks/PngChunkHIST.java | 618e117057a34abc6abef927d36b67cae4811b27 | [
"Apache-2.0"
] | permissive | alexdupre/pngj | https://github.com/alexdupre/pngj | 2098194e82e20d54aa492e137ed063c7320e7d7e | a46ad86e2674fafdf048a812d98a180da166b5f9 | refs/heads/master | 2021-12-31T12:21:10.462000 | 2021-08-19T19:59:59 | 2021-08-19T19:59:59 | 181,631,864 | 5 | 2 | null | true | 2021-08-19T19:59:59 | 2019-04-16T06:51:29 | 2020-05-26T14:49:08 | 2021-08-19T19:59:59 | 10,436 | 3 | 2 | 0 | Java | false | false | package ar.com.hjg.pngj.chunks;
import ar.com.hjg.pngj.ImageInfo;
import ar.com.hjg.pngj.PngHelperInternal;
import ar.com.hjg.pngj.PngjException;
/**
* hIST chunk.
* <p>
* see http://www.w3.org/TR/PNG/#11hIST <br>
* only for palette images
*/
public class PngChunkHIST extends PngChunkSingle {
public final static String ID = ChunkHelper.hIST;
private int[] hist = new int[0]; // should have same lenght as palette
public PngChunkHIST(ImageInfo info) {
super(ID, info);
}
@Override
public ChunkOrderingConstraint getOrderingConstraint() {
return ChunkOrderingConstraint.AFTER_PLTE_BEFORE_IDAT;
}
@Override
public void parseFromRaw(ChunkRaw c) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images accept a HIST chunk");
int nentries = c.data.length / 2;
hist = new int[nentries];
for (int i = 0; i < hist.length; i++) {
hist[i] = PngHelperInternal.readInt2fromBytes(c.data, i * 2);
}
}
@Override
public ChunkRaw createRawChunk() {
if (!imgInfo.indexed)
throw new PngjException("only indexed images accept a HIST chunk");
ChunkRaw c = null;
c = createEmptyChunk(hist.length * 2, true);
for (int i = 0; i < hist.length; i++) {
PngHelperInternal.writeInt2tobytes(hist[i], c.data, i * 2);
}
return c;
}
public int[] getHist() {
return hist;
}
public void setHist(int[] hist) {
this.hist = hist;
}
}
| UTF-8 | Java | 1,384 | java | PngChunkHIST.java | Java | [] | null | [] | package ar.com.hjg.pngj.chunks;
import ar.com.hjg.pngj.ImageInfo;
import ar.com.hjg.pngj.PngHelperInternal;
import ar.com.hjg.pngj.PngjException;
/**
* hIST chunk.
* <p>
* see http://www.w3.org/TR/PNG/#11hIST <br>
* only for palette images
*/
public class PngChunkHIST extends PngChunkSingle {
public final static String ID = ChunkHelper.hIST;
private int[] hist = new int[0]; // should have same lenght as palette
public PngChunkHIST(ImageInfo info) {
super(ID, info);
}
@Override
public ChunkOrderingConstraint getOrderingConstraint() {
return ChunkOrderingConstraint.AFTER_PLTE_BEFORE_IDAT;
}
@Override
public void parseFromRaw(ChunkRaw c) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images accept a HIST chunk");
int nentries = c.data.length / 2;
hist = new int[nentries];
for (int i = 0; i < hist.length; i++) {
hist[i] = PngHelperInternal.readInt2fromBytes(c.data, i * 2);
}
}
@Override
public ChunkRaw createRawChunk() {
if (!imgInfo.indexed)
throw new PngjException("only indexed images accept a HIST chunk");
ChunkRaw c = null;
c = createEmptyChunk(hist.length * 2, true);
for (int i = 0; i < hist.length; i++) {
PngHelperInternal.writeInt2tobytes(hist[i], c.data, i * 2);
}
return c;
}
public int[] getHist() {
return hist;
}
public void setHist(int[] hist) {
this.hist = hist;
}
}
| 1,384 | 0.692919 | 0.684249 | 58 | 22.862068 | 21.979181 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.5 | false | false | 13 |
0d7da5a957f435322d0fc7de9dbf305b3a032e88 | 798,863,968,426 | 34b6e394599f7265c5f734cb84ddfd6a307e8fa0 | /tievoli-dao/src/main/java/org/tievoli/mapper/UserMapper.java | 8fed91507082160b52c83c95cea11e871020f291 | [] | no_license | tievoli/tievoli_singleton | https://github.com/tievoli/tievoli_singleton | 3b13616af343e2ea3ae31d1cc6b0f00bca8a608c | 356dd70252f2b28e2bd71d6685bfdce54ffd13d2 | refs/heads/master | 2021-06-14T15:02:11.742000 | 2017-02-07T06:29:51 | 2017-02-07T06:29:51 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.tievoli.mapper;
import org.tievoli.framework.base.BaseMapper;
import org.tievoli.model.User;
import org.tievoli.model.UserCriteria;
public interface UserMapper extends BaseMapper<User, UserCriteria> {
} | UTF-8 | Java | 217 | java | UserMapper.java | Java | [] | null | [] | package org.tievoli.mapper;
import org.tievoli.framework.base.BaseMapper;
import org.tievoli.model.User;
import org.tievoli.model.UserCriteria;
public interface UserMapper extends BaseMapper<User, UserCriteria> {
} | 217 | 0.820276 | 0.820276 | 9 | 23.222221 | 23.260735 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.555556 | false | false | 13 |
1f0b6ecf6d3fe27ffa5fe33712149c3d231f1c8f | 34,548,716,938,033 | 51f57878a43f0f98f384b4610d52ffa95e9fe38b | /common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/ft/FTCALFactory.java | 666bf5b8fdb3bfe59d20feafc31a988ef7fe10d2 | [] | no_license | JeffersonLab/clas12-offline-software | https://github.com/JeffersonLab/clas12-offline-software | 32b36544693f286acb038d571d78eaf668ddf414 | 483790902ebaf7fa0c739531930b9924aad26bc7 | refs/heads/development | 2023-05-24T21:21:19.375000 | 2023-05-18T12:54:39 | 2023-05-18T12:54:39 | 84,985,373 | 16 | 231 | null | false | 2023-05-16T17:17:35 | 2017-03-14T18:46:14 | 2023-01-31T16:48:32 | 2023-05-16T17:17:34 | 445,507 | 10 | 73 | 48 | Java | false | false | package org.jlab.geom.detector.ft;
import org.jlab.geom.base.ConstantProvider;
import org.jlab.geom.base.DetectorTransformation;
import org.jlab.geom.base.Factory;
import org.jlab.geom.component.ScintillatorPaddle;
import org.jlab.geom.prim.Triangle3D;
import org.jlab.geom.prim.Point3D;
import org.jlab.geom.prim.Transformation3D;
/**
* A Forward Tagger Calorimeter (FTCAL) {@link org.jlab.geom.base.Factory Factory}.
* <p>
* Factory: <b>{@link org.jlab.geom.detector.ft.FTCALFactory FTCALFactory}</b><br>
* Hierarchy:
* <code>
* {@link org.jlab.geom.detector.ft.FTCALDetector FTCALDetector} →
* {@link org.jlab.geom.detector.ft.FTCALSector FTCALSector} →
* {@link org.jlab.geom.detector.ft.FTCALSuperlayer FTCALSuperlayer} →
* {@link org.jlab.geom.detector.ft.FTCALLayer FTCALLayer} →
* {@link org.jlab.geom.component.ScintillatorPaddle ScintillatorPaddle}
* </code>
*
* @author jnhankins
*/
public class FTCALFactory implements Factory <FTCALDetector, FTCALSector, FTCALSuperlayer, FTCALLayer> {
// Detectors are arranged in a 22x22 grid. In the following array a 1
// denotes the presence of a detector while a 0 denotes an absence.
private static final char[][] geom = new char[][] {
// 11 10 9 8 7 6 5 4 3 2 1 -1 -2 -3 -4 -5 -6 -7 -8 -9-10-11
{0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}, // 11 00
{0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10 01
{0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}, // 9 02
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, // 8 03
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, // 7 04
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // 6 05
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // 5 06
{0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // 4 07
{1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}, // 3 08
{1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1}, // 2 09
{1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1}, // 1 10
{1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1}, // -1 11
{1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1}, // -2 12
{1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}, // -3 13
{0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // -4 14
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // -5 15
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // -6 16
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, // -7 17
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, // -8 18
{0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}, // -9 19
{0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}, //-10 20
{0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}, //-11 21
};
@Override
public FTCALDetector createDetectorCLAS(ConstantProvider cp) {
return createDetectorSector(cp);
}
@Override
public FTCALDetector createDetectorSector(ConstantProvider cp) {
return createDetectorTilted(cp);
}
@Override
public FTCALDetector createDetectorTilted(ConstantProvider cp) {
FTCALDetector detector = createDetectorLocal(cp);
for (FTCALSector sector: detector.getAllSectors()) {
for (FTCALSuperlayer superlayer: sector.getAllSuperlayers()) {
double Cfront = cp.getDouble("/geometry/ft/ftcal/Cfront", 0)*0.1;
Transformation3D trans = new Transformation3D();
trans.translateXYZ(0, 0, Cfront);
superlayer.setTransformation(trans);
}
}
return detector;
}
@Override
public FTCALDetector createDetectorLocal(ConstantProvider cp) {
FTCALDetector detector = new FTCALDetector();
for (int sectorId=0; sectorId<1; sectorId++)
detector.addSector(createSector(cp, sectorId));
return detector;
}
@Override
public FTCALSector createSector(ConstantProvider cp, int sectorId) {
if(!(0<=sectorId && sectorId<1))
throw new IllegalArgumentException("Error: invalid sector="+sectorId);
FTCALSector sector = new FTCALSector(sectorId);
for (int superlayerId=0; superlayerId<1; superlayerId++)
sector.addSuperlayer(createSuperlayer(cp, sectorId, superlayerId));
return sector;
}
@Override
public FTCALSuperlayer createSuperlayer(ConstantProvider cp, int sectorId, int superlayerId) {
if(!(0<=sectorId && sectorId<1))
throw new IllegalArgumentException("Error: invalid sector="+sectorId);
if(!(0<=superlayerId && superlayerId<1))
throw new IllegalArgumentException("Error: invalid superlayer="+superlayerId);
FTCALSuperlayer superlayer = new FTCALSuperlayer(sectorId, superlayerId);
for (int layerId=0; layerId<1; layerId++)
superlayer.addLayer(createLayer(cp, sectorId, superlayerId, layerId));
return superlayer;
}
@Override
public FTCALLayer createLayer(ConstantProvider cp, int sectorId, int superlayerId, int layerId) {
if(!(0<=sectorId && sectorId<1))
throw new IllegalArgumentException("Error: invalid sector="+sectorId);
if(!(0<=superlayerId && superlayerId<1))
throw new IllegalArgumentException("Error: invalid superlayer="+superlayerId);
if(!(0<=layerId && layerId<1))
throw new IllegalArgumentException("Error: invalid layer="+layerId);
double Clength = cp.getDouble("/geometry/ft/ftcal/Clength", 0)*0.1;
double Cwidth = cp.getDouble("/geometry/ft/ftcal/Cwidth", 0)*0.1;
double VM2000 = cp.getDouble("/geometry/ft/ftcal/VM2000", 0)*0.1;
double Agap = cp.getDouble("/geometry/ft/ftcal/Agap", 0)*0.1;
double Vwidth = Cwidth + VM2000 + Agap;
FTCALLayer layer = new FTCALLayer(sectorId, superlayerId, layerId);
double xmin = Double.POSITIVE_INFINITY;
double xmax = Double.NEGATIVE_INFINITY;
double ymin = Double.POSITIVE_INFINITY;
double ymax = Double.NEGATIVE_INFINITY;
for (int row=0; row<22; row++) {
for (int col=0; col<22; col++) {
if (geom[row][col] == 1) {
int componentId = row*22+col;
int idX = col<11 ? 11-col : 10-col;
int idY = row<11 ? 11-row : 10-row;
double x = Vwidth*(Math.abs(idX)-0.5)*Math.signum(idX);
double y = Vwidth*(Math.abs(idY)-0.5)*Math.signum(idY);
ScintillatorPaddle paddle = new ScintillatorPaddle(componentId, Cwidth, Clength, Cwidth);
paddle.rotateX(Math.toRadians(90));
paddle.rotateZ(Math.toRadians(180));
paddle.translateXYZ(x, y, Clength/2);
layer.addComponent(paddle);
xmin = Math.min(xmin, x-Cwidth/2);
xmax = Math.max(xmax, x+Cwidth/2);
ymin = Math.min(ymin, y-Cwidth/2);
ymax = Math.max(ymax, y+Cwidth/2);
}
}
}
layer.getPlane().set(0, 0, 0, 0, 0, 1);
Point3D p0 = new Point3D(xmin, ymin, 0);
Point3D p1 = new Point3D(xmax, ymin, 0);
Point3D p2 = new Point3D(xmax, ymax, 0);
Point3D p3 = new Point3D(xmin, ymax, 0);
layer.getBoundary().addFace(new Triangle3D(p0, p3, p1));
layer.getBoundary().addFace(new Triangle3D(p2, p1, p3));
return layer;
}
/**
* Returns "FTCAL Factory".
* @return "FTCAL Factory"
*/
@Override
public String getType() {
return "FTCAL Factory";
}
@Override
public void show() {
System.out.println(this);
}
@Override
public String toString() {
return getType();
}
@Override
public Transformation3D getTransformation(ConstantProvider cp, int sector, int superlayer, int layer) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public DetectorTransformation getDetectorTransform(ConstantProvider cp) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
} | UTF-8 | Java | 8,939 | java | FTCALFactory.java | Java | [
{
"context": "ddle ScintillatorPaddle}\n * </code>\n * \n * @author jnhankins\n */\npublic class FTCALFactory implements Factory ",
"end": 912,
"score": 0.9994136691093445,
"start": 903,
"tag": "USERNAME",
"value": "jnhankins"
}
] | null | [] | package org.jlab.geom.detector.ft;
import org.jlab.geom.base.ConstantProvider;
import org.jlab.geom.base.DetectorTransformation;
import org.jlab.geom.base.Factory;
import org.jlab.geom.component.ScintillatorPaddle;
import org.jlab.geom.prim.Triangle3D;
import org.jlab.geom.prim.Point3D;
import org.jlab.geom.prim.Transformation3D;
/**
* A Forward Tagger Calorimeter (FTCAL) {@link org.jlab.geom.base.Factory Factory}.
* <p>
* Factory: <b>{@link org.jlab.geom.detector.ft.FTCALFactory FTCALFactory}</b><br>
* Hierarchy:
* <code>
* {@link org.jlab.geom.detector.ft.FTCALDetector FTCALDetector} →
* {@link org.jlab.geom.detector.ft.FTCALSector FTCALSector} →
* {@link org.jlab.geom.detector.ft.FTCALSuperlayer FTCALSuperlayer} →
* {@link org.jlab.geom.detector.ft.FTCALLayer FTCALLayer} →
* {@link org.jlab.geom.component.ScintillatorPaddle ScintillatorPaddle}
* </code>
*
* @author jnhankins
*/
public class FTCALFactory implements Factory <FTCALDetector, FTCALSector, FTCALSuperlayer, FTCALLayer> {
// Detectors are arranged in a 22x22 grid. In the following array a 1
// denotes the presence of a detector while a 0 denotes an absence.
private static final char[][] geom = new char[][] {
// 11 10 9 8 7 6 5 4 3 2 1 -1 -2 -3 -4 -5 -6 -7 -8 -9-10-11
{0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}, // 11 00
{0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10 01
{0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}, // 9 02
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, // 8 03
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, // 7 04
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // 6 05
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // 5 06
{0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // 4 07
{1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}, // 3 08
{1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1}, // 2 09
{1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1}, // 1 10
{1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1}, // -1 11
{1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1}, // -2 12
{1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}, // -3 13
{0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // -4 14
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // -5 15
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, // -6 16
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, // -7 17
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, // -8 18
{0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}, // -9 19
{0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}, //-10 20
{0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}, //-11 21
};
@Override
public FTCALDetector createDetectorCLAS(ConstantProvider cp) {
return createDetectorSector(cp);
}
@Override
public FTCALDetector createDetectorSector(ConstantProvider cp) {
return createDetectorTilted(cp);
}
@Override
public FTCALDetector createDetectorTilted(ConstantProvider cp) {
FTCALDetector detector = createDetectorLocal(cp);
for (FTCALSector sector: detector.getAllSectors()) {
for (FTCALSuperlayer superlayer: sector.getAllSuperlayers()) {
double Cfront = cp.getDouble("/geometry/ft/ftcal/Cfront", 0)*0.1;
Transformation3D trans = new Transformation3D();
trans.translateXYZ(0, 0, Cfront);
superlayer.setTransformation(trans);
}
}
return detector;
}
@Override
public FTCALDetector createDetectorLocal(ConstantProvider cp) {
FTCALDetector detector = new FTCALDetector();
for (int sectorId=0; sectorId<1; sectorId++)
detector.addSector(createSector(cp, sectorId));
return detector;
}
@Override
public FTCALSector createSector(ConstantProvider cp, int sectorId) {
if(!(0<=sectorId && sectorId<1))
throw new IllegalArgumentException("Error: invalid sector="+sectorId);
FTCALSector sector = new FTCALSector(sectorId);
for (int superlayerId=0; superlayerId<1; superlayerId++)
sector.addSuperlayer(createSuperlayer(cp, sectorId, superlayerId));
return sector;
}
@Override
public FTCALSuperlayer createSuperlayer(ConstantProvider cp, int sectorId, int superlayerId) {
if(!(0<=sectorId && sectorId<1))
throw new IllegalArgumentException("Error: invalid sector="+sectorId);
if(!(0<=superlayerId && superlayerId<1))
throw new IllegalArgumentException("Error: invalid superlayer="+superlayerId);
FTCALSuperlayer superlayer = new FTCALSuperlayer(sectorId, superlayerId);
for (int layerId=0; layerId<1; layerId++)
superlayer.addLayer(createLayer(cp, sectorId, superlayerId, layerId));
return superlayer;
}
@Override
public FTCALLayer createLayer(ConstantProvider cp, int sectorId, int superlayerId, int layerId) {
if(!(0<=sectorId && sectorId<1))
throw new IllegalArgumentException("Error: invalid sector="+sectorId);
if(!(0<=superlayerId && superlayerId<1))
throw new IllegalArgumentException("Error: invalid superlayer="+superlayerId);
if(!(0<=layerId && layerId<1))
throw new IllegalArgumentException("Error: invalid layer="+layerId);
double Clength = cp.getDouble("/geometry/ft/ftcal/Clength", 0)*0.1;
double Cwidth = cp.getDouble("/geometry/ft/ftcal/Cwidth", 0)*0.1;
double VM2000 = cp.getDouble("/geometry/ft/ftcal/VM2000", 0)*0.1;
double Agap = cp.getDouble("/geometry/ft/ftcal/Agap", 0)*0.1;
double Vwidth = Cwidth + VM2000 + Agap;
FTCALLayer layer = new FTCALLayer(sectorId, superlayerId, layerId);
double xmin = Double.POSITIVE_INFINITY;
double xmax = Double.NEGATIVE_INFINITY;
double ymin = Double.POSITIVE_INFINITY;
double ymax = Double.NEGATIVE_INFINITY;
for (int row=0; row<22; row++) {
for (int col=0; col<22; col++) {
if (geom[row][col] == 1) {
int componentId = row*22+col;
int idX = col<11 ? 11-col : 10-col;
int idY = row<11 ? 11-row : 10-row;
double x = Vwidth*(Math.abs(idX)-0.5)*Math.signum(idX);
double y = Vwidth*(Math.abs(idY)-0.5)*Math.signum(idY);
ScintillatorPaddle paddle = new ScintillatorPaddle(componentId, Cwidth, Clength, Cwidth);
paddle.rotateX(Math.toRadians(90));
paddle.rotateZ(Math.toRadians(180));
paddle.translateXYZ(x, y, Clength/2);
layer.addComponent(paddle);
xmin = Math.min(xmin, x-Cwidth/2);
xmax = Math.max(xmax, x+Cwidth/2);
ymin = Math.min(ymin, y-Cwidth/2);
ymax = Math.max(ymax, y+Cwidth/2);
}
}
}
layer.getPlane().set(0, 0, 0, 0, 0, 1);
Point3D p0 = new Point3D(xmin, ymin, 0);
Point3D p1 = new Point3D(xmax, ymin, 0);
Point3D p2 = new Point3D(xmax, ymax, 0);
Point3D p3 = new Point3D(xmin, ymax, 0);
layer.getBoundary().addFace(new Triangle3D(p0, p3, p1));
layer.getBoundary().addFace(new Triangle3D(p2, p1, p3));
return layer;
}
/**
* Returns "FTCAL Factory".
* @return "FTCAL Factory"
*/
@Override
public String getType() {
return "FTCAL Factory";
}
@Override
public void show() {
System.out.println(this);
}
@Override
public String toString() {
return getType();
}
@Override
public Transformation3D getTransformation(ConstantProvider cp, int sector, int superlayer, int layer) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public DetectorTransformation getDetectorTransform(ConstantProvider cp) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
} | 8,939 | 0.54977 | 0.470944 | 195 | 44.80513 | 31.99604 | 135 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.184615 | false | false | 13 |
8f3afece4c2ef9a4389a2df67ccc91e8734ff244 | 29,188,597,776,190 | 8aa0e14dcd48acc2f11b187fd9d18f0d45673d92 | /src/main/java/com/autodesk/crm/pageobjects/InvoicePage.java | 8a4ea1670c88f3baa0804ee5c0063e3ad118e5bc | [] | no_license | manasgupta017/autodesk_maven_project | https://github.com/manasgupta017/autodesk_maven_project | 34e02209518b32d99edc6a8dcccac185f7f5903d | b0c362e51b6a89309d5b0665ad18de01ec34dc53 | refs/heads/master | 2021-07-12T11:02:23.652000 | 2020-03-10T05:47:49 | 2020-03-10T05:47:49 | 244,305,855 | 0 | 0 | null | false | 2021-04-26T20:00:41 | 2020-03-02T07:20:59 | 2020-03-10T05:48:11 | 2021-04-26T20:00:41 | 11,822 | 0 | 0 | 1 | Java | false | false | package com.autodesk.crm.pageobjects;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class InvoicePage {
@FindBy(className="hdrLink")
private WebElement invoiceHdrLink;
@FindBy(xpath="//a[text()='Go to Advanced Search']")
private WebElement advSearchLink;
@FindBy(xpath="//a[text()='Create Filter']")
private WebElement createFilterLink;
public InvoicePage(WebDriver driver)
{
PageFactory.initElements(driver, this);
}
public WebElement getInvoiceHdrLink() {
return invoiceHdrLink;
}
public WebElement getAdvSearchLink() {
return advSearchLink;
}
public WebElement getCreateFilterLink() {
return createFilterLink;
}
}
| UTF-8 | Java | 772 | java | InvoicePage.java | Java | [] | null | [] | package com.autodesk.crm.pageobjects;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class InvoicePage {
@FindBy(className="hdrLink")
private WebElement invoiceHdrLink;
@FindBy(xpath="//a[text()='Go to Advanced Search']")
private WebElement advSearchLink;
@FindBy(xpath="//a[text()='Create Filter']")
private WebElement createFilterLink;
public InvoicePage(WebDriver driver)
{
PageFactory.initElements(driver, this);
}
public WebElement getInvoiceHdrLink() {
return invoiceHdrLink;
}
public WebElement getAdvSearchLink() {
return advSearchLink;
}
public WebElement getCreateFilterLink() {
return createFilterLink;
}
}
| 772 | 0.777202 | 0.777202 | 28 | 26.571428 | 17.215916 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.285714 | false | false | 13 |
16aba32326e08a52a90650242983fa0e0bcd3417 | 30,288,109,399,900 | 91b4824b06a6972ff35d9857da77a86ac9058dfb | /src/test/java/DeadlineTest.java | b54a6968286aa8d7409957062ee35968843d0eea | [] | no_license | eejian97/duke | https://github.com/eejian97/duke | 5997e517c182baf2cc37859a63501d68ed68955a | 0ddb360d01d5ec5e9f2bf110049460fe2859b928 | refs/heads/master | 2020-07-06T18:29:03.737000 | 2019-09-30T15:12:13 | 2019-09-30T15:12:13 | 203,104,804 | 1 | 0 | null | true | 2019-09-30T15:12:14 | 2019-08-19T05:34:24 | 2019-09-30T15:08:06 | 2019-09-30T15:12:14 | 2,384 | 0 | 0 | 4 | Java | false | false | import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
class DeadlineTest {
@Test
void toDataFormatTest() {
Deadline d = Deadline.genDeadlineTask("Deadline return book /by 2/12/2019 1800");
assertTrue(d.toDataFormat().equals("D | 0 | return book | 2/12/2019, 1800"));
}
/*
@Test
void toStringTest() {
Deadline d = new Deadline("return book", "2/12/2019", "1800");
assertTrue(d.toString().equals("[D][\u2718] return book (by: 2 Dec 2019, 6:00 PM)"));
}
*/
} | UTF-8 | Java | 561 | java | DeadlineTest.java | Java | [] | null | [] | import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
class DeadlineTest {
@Test
void toDataFormatTest() {
Deadline d = Deadline.genDeadlineTask("Deadline return book /by 2/12/2019 1800");
assertTrue(d.toDataFormat().equals("D | 0 | return book | 2/12/2019, 1800"));
}
/*
@Test
void toStringTest() {
Deadline d = new Deadline("return book", "2/12/2019", "1800");
assertTrue(d.toString().equals("[D][\u2718] return book (by: 2 Dec 2019, 6:00 PM)"));
}
*/
} | 561 | 0.625668 | 0.543672 | 18 | 30.222221 | 32.425224 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.722222 | false | false | 13 |
54a43d430b100bc7c692f392c09704ce61f0aef8 | 1,245,540,584,307 | a6978318b2202c1c2ab7014d73b6c069fb7e6de0 | /thread-safety-agent/src/main/java/fi/jumi/threadsafetyagent/AddThreadSafetyChecks.java | 39f5242a481ae6cc053818c595ebaac363ba9f3b | [
"Apache-2.0"
] | permissive | luontola/jumi-actors | https://github.com/luontola/jumi-actors | ee0d929d85ff8b4ac5e8970261fac761e2aa6ed6 | 3a75888b183dcd006cbdfc0e0ad270347a303761 | refs/heads/master | 2021-09-20T12:10:16.616000 | 2018-08-09T12:15:26 | 2018-08-09T12:15:26 | 6,426,667 | 15 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | // Copyright © 2011-2014, Esko Luontola <www.orfjackal.net>
// This software is released under the Apache License 2.0.
// The license text is at http://www.apache.org/licenses/LICENSE-2.0
package fi.jumi.threadsafetyagent;
import fi.jumi.threadsafetyagent.util.DoNotTransformException;
import org.objectweb.asm.*;
import static java.lang.Math.max;
import static org.objectweb.asm.Opcodes.*;
public class AddThreadSafetyChecks extends ClassVisitor {
private static final String CHECKER_CLASS = "fi/jumi/threadsafetyagent/ThreadSafetyChecker";
private static final String CHECKER_CLASS_DESC = "L" + CHECKER_CLASS + ";";
private static final String CHECKER_FIELD = "$Jumi$threadSafetyChecker";
private String myClassName;
public AddThreadSafetyChecks(ClassVisitor next) {
super(Opcodes.ASM5, next);
}
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
if ((access & ACC_INTERFACE) == ACC_INTERFACE) {
throw new DoNotTransformException();
}
myClassName = name;
super.visit(version, access, name, signature, superName, interfaces);
}
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
MethodVisitor next = super.visitMethod(access, name, desc, signature, exceptions);
if (isConstructor(name)) {
next = new InstantiateChecker(next);
} else if (isInstanceMethod(access)) {
next = new CallChecker(next);
}
return next;
}
@Override
public void visitEnd() {
createCheckerField();
super.visitEnd();
}
private void createCheckerField() {
FieldVisitor fv = this.visitField(ACC_PRIVATE + ACC_FINAL, CHECKER_FIELD, CHECKER_CLASS_DESC, null, null);
fv.visitEnd();
}
private static boolean isConstructor(String name) {
return name.equals("<init>");
}
private static boolean isInstanceMethod(int access) {
return (access & ACC_STATIC) == 0;
}
// method transformers
private class InstantiateChecker extends MethodVisitor {
public InstantiateChecker(MethodVisitor next) {
super(Opcodes.ASM5, next);
}
@Override
public void visitInsn(int opcode) {
// instantiate the checker at the end of the constructor
if (opcode == RETURN) {
super.visitVarInsn(ALOAD, 0);
super.visitTypeInsn(NEW, CHECKER_CLASS);
super.visitInsn(DUP);
super.visitMethodInsn(INVOKESPECIAL, CHECKER_CLASS, "<init>", "()V", false);
super.visitFieldInsn(PUTFIELD, myClassName, CHECKER_FIELD, CHECKER_CLASS_DESC);
}
super.visitInsn(opcode);
}
@Override
public void visitMaxs(int maxStack, int maxLocals) {
// XXX: the stack is not guaranteed to be empty right before a RETURN statement, so this maxStack can be too optimistic
super.visitMaxs(max(3, maxStack), maxLocals);
}
}
private class CallChecker extends MethodVisitor {
private Label lastGeneratedCode;
public CallChecker(MethodVisitor next) {
super(Opcodes.ASM5, next);
}
@Override
public void visitCode() {
super.visitCode();
// use the line number of the first non-generated instruction
lastGeneratedCode = new Label();
super.visitLabel(lastGeneratedCode);
// call the checker in the beginning of the method
super.visitVarInsn(ALOAD, 0);
super.visitFieldInsn(GETFIELD, myClassName, CHECKER_FIELD, CHECKER_CLASS_DESC);
super.visitMethodInsn(INVOKEVIRTUAL, CHECKER_CLASS, "checkCurrentThread", "()V", false);
}
@Override
public void visitLineNumber(int line, Label start) {
if (lastGeneratedCode != null) {
super.visitLineNumber(line, lastGeneratedCode);
lastGeneratedCode = null;
}
super.visitLineNumber(line, start);
}
@Override
public void visitMaxs(int maxStack, int maxLocals) {
super.visitMaxs(max(1, maxStack), maxLocals);
}
}
}
| UTF-8 | Java | 4,391 | java | AddThreadSafetyChecks.java | Java | [
{
"context": "// Copyright © 2011-2014, Esko Luontola <www.orfjackal.net>\n// This software is released ",
"end": 39,
"score": 0.9998735785484314,
"start": 26,
"tag": "NAME",
"value": "Esko Luontola"
}
] | null | [] | // Copyright © 2011-2014, <NAME> <www.orfjackal.net>
// This software is released under the Apache License 2.0.
// The license text is at http://www.apache.org/licenses/LICENSE-2.0
package fi.jumi.threadsafetyagent;
import fi.jumi.threadsafetyagent.util.DoNotTransformException;
import org.objectweb.asm.*;
import static java.lang.Math.max;
import static org.objectweb.asm.Opcodes.*;
public class AddThreadSafetyChecks extends ClassVisitor {
private static final String CHECKER_CLASS = "fi/jumi/threadsafetyagent/ThreadSafetyChecker";
private static final String CHECKER_CLASS_DESC = "L" + CHECKER_CLASS + ";";
private static final String CHECKER_FIELD = "$Jumi$threadSafetyChecker";
private String myClassName;
public AddThreadSafetyChecks(ClassVisitor next) {
super(Opcodes.ASM5, next);
}
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
if ((access & ACC_INTERFACE) == ACC_INTERFACE) {
throw new DoNotTransformException();
}
myClassName = name;
super.visit(version, access, name, signature, superName, interfaces);
}
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
MethodVisitor next = super.visitMethod(access, name, desc, signature, exceptions);
if (isConstructor(name)) {
next = new InstantiateChecker(next);
} else if (isInstanceMethod(access)) {
next = new CallChecker(next);
}
return next;
}
@Override
public void visitEnd() {
createCheckerField();
super.visitEnd();
}
private void createCheckerField() {
FieldVisitor fv = this.visitField(ACC_PRIVATE + ACC_FINAL, CHECKER_FIELD, CHECKER_CLASS_DESC, null, null);
fv.visitEnd();
}
private static boolean isConstructor(String name) {
return name.equals("<init>");
}
private static boolean isInstanceMethod(int access) {
return (access & ACC_STATIC) == 0;
}
// method transformers
private class InstantiateChecker extends MethodVisitor {
public InstantiateChecker(MethodVisitor next) {
super(Opcodes.ASM5, next);
}
@Override
public void visitInsn(int opcode) {
// instantiate the checker at the end of the constructor
if (opcode == RETURN) {
super.visitVarInsn(ALOAD, 0);
super.visitTypeInsn(NEW, CHECKER_CLASS);
super.visitInsn(DUP);
super.visitMethodInsn(INVOKESPECIAL, CHECKER_CLASS, "<init>", "()V", false);
super.visitFieldInsn(PUTFIELD, myClassName, CHECKER_FIELD, CHECKER_CLASS_DESC);
}
super.visitInsn(opcode);
}
@Override
public void visitMaxs(int maxStack, int maxLocals) {
// XXX: the stack is not guaranteed to be empty right before a RETURN statement, so this maxStack can be too optimistic
super.visitMaxs(max(3, maxStack), maxLocals);
}
}
private class CallChecker extends MethodVisitor {
private Label lastGeneratedCode;
public CallChecker(MethodVisitor next) {
super(Opcodes.ASM5, next);
}
@Override
public void visitCode() {
super.visitCode();
// use the line number of the first non-generated instruction
lastGeneratedCode = new Label();
super.visitLabel(lastGeneratedCode);
// call the checker in the beginning of the method
super.visitVarInsn(ALOAD, 0);
super.visitFieldInsn(GETFIELD, myClassName, CHECKER_FIELD, CHECKER_CLASS_DESC);
super.visitMethodInsn(INVOKEVIRTUAL, CHECKER_CLASS, "checkCurrentThread", "()V", false);
}
@Override
public void visitLineNumber(int line, Label start) {
if (lastGeneratedCode != null) {
super.visitLineNumber(line, lastGeneratedCode);
lastGeneratedCode = null;
}
super.visitLineNumber(line, start);
}
@Override
public void visitMaxs(int maxStack, int maxLocals) {
super.visitMaxs(max(1, maxStack), maxLocals);
}
}
}
| 4,384 | 0.633941 | 0.629385 | 129 | 33.031006 | 30.897917 | 131 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.751938 | false | false | 13 |
5e43e574c95e4899b804e6422310ce3f777c51f7 | 35,296,041,285,234 | 762dc7fc6fbc24c7fca197027fa99441556a80c3 | /app/src/main/java/com/hloong/mydemo/activity/CircleBarActivity.java | 2f7b3e8ccc0d2904d366028f2ee2eb80f7f968e6 | [] | no_license | hloong/mydemo | https://github.com/hloong/mydemo | d100cdee361c1ca01d0bfbbbfe52422d1fe0b0ae | f6792e983d4e61f0ed942ae68b2eb619ed4496f6 | refs/heads/master | 2021-04-18T22:56:26.243000 | 2017-06-22T09:15:47 | 2017-06-22T09:15:47 | 56,049,098 | 1 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.hloong.mydemo.activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import com.hloong.mydemo.BaseActivity;
import com.hloong.mydemo.R;
import com.hloong.mydemo.ui.CircleBar;
import com.hloong.mydemo.ui.CircleBarTwoSider;
public class CircleBarActivity extends BaseActivity {
private CircleBarTwoSider circleBar;
private CircleBar circleBar2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_circle_bar);
circleBar = getView(R.id.circle);
circleBar.setSweepAngle(120);
circleBar.setText("27000");
circleBar.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View view){
circleBar.startCustomAnimation();
}
});
// circleBar2 = getView(R.id.circle2);
// circleBar2.setSweepAngle(120);
// circleBar2.setText("500");
// circleBar2.setOnClickListener(new OnClickListener(){
// @Override
// public void onClick(View view){
// circleBar2.startCustomAnimation();
// }
// });
}
}
| UTF-8 | Java | 1,278 | java | CircleBarActivity.java | Java | [] | null | [] | package com.hloong.mydemo.activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import com.hloong.mydemo.BaseActivity;
import com.hloong.mydemo.R;
import com.hloong.mydemo.ui.CircleBar;
import com.hloong.mydemo.ui.CircleBarTwoSider;
public class CircleBarActivity extends BaseActivity {
private CircleBarTwoSider circleBar;
private CircleBar circleBar2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_circle_bar);
circleBar = getView(R.id.circle);
circleBar.setSweepAngle(120);
circleBar.setText("27000");
circleBar.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View view){
circleBar.startCustomAnimation();
}
});
// circleBar2 = getView(R.id.circle2);
// circleBar2.setSweepAngle(120);
// circleBar2.setText("500");
// circleBar2.setOnClickListener(new OnClickListener(){
// @Override
// public void onClick(View view){
// circleBar2.startCustomAnimation();
// }
// });
}
}
| 1,278 | 0.643975 | 0.627543 | 41 | 30.170732 | 18.140244 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.536585 | false | false | 13 |
8bc20ab643b5b1e7fcb3e5e0862bbf0b5b6712de | 35,433,480,237,552 | 267cc6a95af4444a9764613910a6ea015b813e52 | /src/com/example/bg_media_test/Play.java | 5a6357fa30fc10a965bf76fbcdbe44826a3b9dc6 | [] | no_license | NadaIsleem/test2 | https://github.com/NadaIsleem/test2 | af541c6e2a41c2296879c751ded176fde9a54364 | 1e69c799a56a213e8f4be7a7a53452d2b4bdc25c | refs/heads/master | 2020-05-17T20:18:03.485000 | 2013-09-02T09:42:43 | 2013-09-02T09:42:43 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.bg_media_test;
import java.io.IOException;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.net.Uri;
import android.os.IBinder;
import android.widget.MediaController;
public class Play extends Service implements OnPreparedListener,
OnCompletionListener {
MediaPlayer mediaPlayer;
AudioManager audio;
public IBinder onBind(Intent arg0) {
// TODO Auto-generated method stub
return null;
}
public void onCreate() {
super.onCreate();
}
@SuppressWarnings("deprecation")
@Override
public void onStart(Intent intent, int startId) {
String url = "http://chinvi.org/Music.mp3"; // your URL here
mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
try {
mediaPlayer.setDataSource(url);
mediaPlayer.prepare(); // might take long! (for buffering, etc)
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
/*
* mp.setLooping(false); mp.setVolume(3.90f,3.90f);
*/
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
int max = audio.getStreamMaxVolume(AudioManager.STREAM_SYSTEM);
mediaPlayer.setVolume(max, max);
MediaController mc = new MediaController(this);
mc.setMediaPlayer(null);
// mc.setMediaPlayer(mp);
mediaPlayer.setOnPreparedListener(this);
mediaPlayer.setOnCompletionListener(this);
// this.setsetVolumeControlStream(AudioManager.STREAM_MUSIC);
// TODO Auto-generated method stub
super.onStart(intent, startId);
}
public void onDestroy() {
super.onDestroy();
mediaPlayer.stop();
}
@Override
public void onPrepared(MediaPlayer mp) {
mediaPlayer.start();
}
@Override
public void onCompletion(MediaPlayer mp) {
MainActivity.onSongComplete();
}
}
| UTF-8 | Java | 2,288 | java | Play.java | Java | [] | null | [] | package com.example.bg_media_test;
import java.io.IOException;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.net.Uri;
import android.os.IBinder;
import android.widget.MediaController;
public class Play extends Service implements OnPreparedListener,
OnCompletionListener {
MediaPlayer mediaPlayer;
AudioManager audio;
public IBinder onBind(Intent arg0) {
// TODO Auto-generated method stub
return null;
}
public void onCreate() {
super.onCreate();
}
@SuppressWarnings("deprecation")
@Override
public void onStart(Intent intent, int startId) {
String url = "http://chinvi.org/Music.mp3"; // your URL here
mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
try {
mediaPlayer.setDataSource(url);
mediaPlayer.prepare(); // might take long! (for buffering, etc)
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
/*
* mp.setLooping(false); mp.setVolume(3.90f,3.90f);
*/
audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
int max = audio.getStreamMaxVolume(AudioManager.STREAM_SYSTEM);
mediaPlayer.setVolume(max, max);
MediaController mc = new MediaController(this);
mc.setMediaPlayer(null);
// mc.setMediaPlayer(mp);
mediaPlayer.setOnPreparedListener(this);
mediaPlayer.setOnCompletionListener(this);
// this.setsetVolumeControlStream(AudioManager.STREAM_MUSIC);
// TODO Auto-generated method stub
super.onStart(intent, startId);
}
public void onDestroy() {
super.onDestroy();
mediaPlayer.stop();
}
@Override
public void onPrepared(MediaPlayer mp) {
mediaPlayer.start();
}
@Override
public void onCompletion(MediaPlayer mp) {
MainActivity.onSongComplete();
}
}
| 2,288 | 0.744318 | 0.740822 | 93 | 23.60215 | 19.692333 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.709677 | false | false | 13 |
df0d516a653e48b997d970888240a21cd1dca26f | 35,158,602,336,660 | 37d8b470e71ea6edff6ed108ffd2b796322b7943 | /joffice/src/com/htsoft/oa/dao/document/DocPrivilegeDao.java | 3ae8a109c722cde29c4926cfdd675a5182f3e3fe | [] | no_license | haifeiforwork/myfcms | https://github.com/haifeiforwork/myfcms | ef9575be5fc7f476a048d819e7c0c0f2210be8ca | fefce24467df59d878ec5fef2750b91a29e74781 | refs/heads/master | 2020-05-15T11:37:50.734000 | 2014-06-28T08:31:55 | 2014-06-28T08:31:55 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.htsoft.oa.dao.document;
import java.util.List;
import com.htsoft.core.dao.BaseDao;
import com.htsoft.core.web.paging.PagingBean;
import com.htsoft.oa.model.document.DocPrivilege;
import com.htsoft.oa.model.system.AppUser;
public abstract interface DocPrivilegeDao extends BaseDao<DocPrivilege> {
public abstract List<DocPrivilege> getAll(DocPrivilege paramDocPrivilege, Long paramLong,
PagingBean paramPagingBean);
public abstract List<DocPrivilege> getByPublic(DocPrivilege paramDocPrivilege, Long paramLong);
public abstract List<Integer> getRightsByFolder(AppUser paramAppUser, Long paramLong);
public abstract Integer getRightsByDocument(AppUser paramAppUser, Long paramLong);
public abstract Integer countPrivilege();
}
| UTF-8 | Java | 790 | java | DocPrivilegeDao.java | Java | [] | null | [] | package com.htsoft.oa.dao.document;
import java.util.List;
import com.htsoft.core.dao.BaseDao;
import com.htsoft.core.web.paging.PagingBean;
import com.htsoft.oa.model.document.DocPrivilege;
import com.htsoft.oa.model.system.AppUser;
public abstract interface DocPrivilegeDao extends BaseDao<DocPrivilege> {
public abstract List<DocPrivilege> getAll(DocPrivilege paramDocPrivilege, Long paramLong,
PagingBean paramPagingBean);
public abstract List<DocPrivilege> getByPublic(DocPrivilege paramDocPrivilege, Long paramLong);
public abstract List<Integer> getRightsByFolder(AppUser paramAppUser, Long paramLong);
public abstract Integer getRightsByDocument(AppUser paramAppUser, Long paramLong);
public abstract Integer countPrivilege();
}
| 790 | 0.787342 | 0.787342 | 21 | 34.809525 | 33.457321 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.142857 | false | false | 13 |
f451c1b3d7241bc2e549791cbf84701cc06fb361 | 39,556,648,824,404 | fb916e95bebd1a1cb556e62d2f530d2fde10adf7 | /src/main/java/com/mint/cms/entity/base/BaseRelatedgoods.java | 77f810b19ca11bf68949fb78aee37f2ca10f917c | [] | no_license | xrogzu/mint | https://github.com/xrogzu/mint | 9dfcdaf0ae4b8dcd3430025326fb2b16e4dab4f6 | d1595d8e826b751915ad95b95715326216b4500a | refs/heads/master | 2021-04-12T09:36:51.369000 | 2018-02-07T07:31:08 | 2018-02-07T07:31:08 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.mint.cms.entity.base;
import com.mint.cms.entity.Address;
import java.io.Serializable;
public abstract class BaseRelatedgoods
implements Serializable {
private static final long serialVersionUID = 1L;
public static String PROP_PRODUCTIDS = "productIds";
public static String PROP_PRODUCTID = "productId";
public static String PROP_ID = "id";
private int hashCode = -2147483648;
private Long id;
private Long productId;
private Long productIds;
public BaseRelatedgoods() {
initialize();
}
public BaseRelatedgoods(Long id) {
setId(id);
initialize();
}
public BaseRelatedgoods(Long id, Long productId, Long productIds) {
setId(id);
setProductId(productId);
setProductIds(productIds);
initialize();
}
protected void initialize() {
}
public Long getProductId() {
return this.productId;
}
public void setProductId(Long productId) {
this.productId = productId;
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
this.hashCode = -2147483648;
}
public Long getProductIds() {
return this.productIds;
}
public void setProductIds(Long productIds) {
this.productIds = productIds;
}
public boolean equals(Object obj) {
if (obj == null) return false;
if (!(obj instanceof Address)) return false;
Address address = (Address) obj;
if ((getId() == null) || (address.getId() == null)) return false;
return getId().equals(address.getId());
}
public int hashCode() {
if (-2147483648 == this.hashCode) {
if (getId() == null) return super.hashCode();
String hashStr = getClass().getName() + ":" + getId().hashCode();
this.hashCode = hashStr.hashCode();
}
return this.hashCode;
}
public String toString() {
return super.toString();
}
}
| UTF-8 | Java | 2,043 | java | BaseRelatedgoods.java | Java | [] | null | [] | package com.mint.cms.entity.base;
import com.mint.cms.entity.Address;
import java.io.Serializable;
public abstract class BaseRelatedgoods
implements Serializable {
private static final long serialVersionUID = 1L;
public static String PROP_PRODUCTIDS = "productIds";
public static String PROP_PRODUCTID = "productId";
public static String PROP_ID = "id";
private int hashCode = -2147483648;
private Long id;
private Long productId;
private Long productIds;
public BaseRelatedgoods() {
initialize();
}
public BaseRelatedgoods(Long id) {
setId(id);
initialize();
}
public BaseRelatedgoods(Long id, Long productId, Long productIds) {
setId(id);
setProductId(productId);
setProductIds(productIds);
initialize();
}
protected void initialize() {
}
public Long getProductId() {
return this.productId;
}
public void setProductId(Long productId) {
this.productId = productId;
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
this.hashCode = -2147483648;
}
public Long getProductIds() {
return this.productIds;
}
public void setProductIds(Long productIds) {
this.productIds = productIds;
}
public boolean equals(Object obj) {
if (obj == null) return false;
if (!(obj instanceof Address)) return false;
Address address = (Address) obj;
if ((getId() == null) || (address.getId() == null)) return false;
return getId().equals(address.getId());
}
public int hashCode() {
if (-2147483648 == this.hashCode) {
if (getId() == null) return super.hashCode();
String hashStr = getClass().getName() + ":" + getId().hashCode();
this.hashCode = hashStr.hashCode();
}
return this.hashCode;
}
public String toString() {
return super.toString();
}
}
| 2,043 | 0.602545 | 0.587372 | 86 | 22.744186 | 20.019285 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.453488 | false | false | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.