blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
99eb3d4079dd67efb41409e6a10ec78b40a72fcb | 093d37050606aa5a49644150cc40af5cf78dc360 | /src/main/java/leetcode/solution/backtrace/q51/Solution.java | b98cfc25c1d4bd991773065479d88a9371cf56ab | [] | no_license | Grootzz/LeetCode-Solution | 07f83c5698170f91f7a1459741a77cbf8ad6e2bb | b90af81cb3a4b18cef7fa7fea58d4c8ae7061fdc | refs/heads/master | 2021-07-12T10:57:38.622509 | 2020-08-14T13:34:50 | 2020-08-14T13:34:50 | 200,228,141 | 2 | 0 | null | 2020-10-13T15:03:37 | 2019-08-02T12:07:34 | Java | UTF-8 | Java | false | false | 469 | java | package leetcode.solution.backtrace.q51;
import java.util.List;
/*
在n×n格的国际象棋上摆放n个皇后,使其不能互相攻击,即任意两个皇后都不能处于同一行、同一列或同一斜线上,问有多少种摆法。
*/
/**
* 51. N皇后
* https://leetcode-cn.com/problems/n-queens/
*
* @author noodle
* @date 2019/8/19 15:49
*/
public class Solution {
public List<List<String>> solveNQueens(int n) {
return null;
}
} | [
"noodle.ax@gmail.com"
] | noodle.ax@gmail.com |
b9061ed418e563347d07cbe736d907822f8d94df | 7b0be484b97e7db65b2bb74d7e881ce3cc3d4bf1 | /NioStudy/src/com/wql/biotime/TimeClient.java | bbb4e5a320c92180aea39038bf3e600c7a5f0c4e | [
"MIT"
] | permissive | hellowql/NioStudy | 048645b5d89f90f548d4975a652a5c455359fa3b | 3db507b6b995cf5dee26f3a4084ff3c2662d8625 | refs/heads/master | 2021-01-16T18:42:30.414236 | 2015-07-20T10:00:02 | 2015-07-20T10:00:02 | 39,079,712 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,279 | java | package com.wql.biotime;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
/**
* @author wuqinglong
* @date 2015年4月10日 下午2:27:22
*/
public class TimeClient {
/**
* @param args
*/
public static void main(String[] args) {
int port = 8000;
Socket socket = null;
BufferedReader in = null;
PrintWriter out = null;
try {
socket = new Socket("localhost", port);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out = new PrintWriter(socket.getOutputStream(), true);
out.println("query");
System.out.println("Send order 2 server succedd.");
String resp = in.readLine();
System.out.println("Now is: " + resp);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (out != null) {
out.close();
out = null;
}
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
in = null;
}
if (socket != null) {
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
socket = null;
}
}
}
}
| [
"hellowql@126.com"
] | hellowql@126.com |
80483ad2bd2f46730c482ca7e7f8b745beb5285f | 1578b9c48d2482b82465ae373144d6db43429d5f | /src/main/java/WK2/Chcksoted.java | 679a675019e2be41c71887b9a103cf4921c26541 | [] | no_license | nhat117/OOP_NEW | 538ce75058411a4c67832443b87e0c56ae34bda7 | ce075521b9f0bcf86b688491bc28a71d779dce3a | refs/heads/master | 2023-07-16T08:15:16.355247 | 2021-09-07T09:54:19 | 2021-09-07T09:54:19 | 373,016,963 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,019 | java | import java.util.Scanner;
public class Chcksoted {
public static boolean ifsorted (int [] array) {
for (int i = 0; i < array.length -1; i ++) {
if (array[i] > array [i+1]) {
return false;
}
}
return true;
}
public static void display(int [] array) {
if (!ifsorted(array) ) {
System.out.println(" The list is not sorted");
} else {
System.out.println("The list is sorted");
}
}
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter size of list");
int size = input.nextInt();
int [] array = new int[size];
System.out.println("Enter a list of number : ");
for (int i = 0; i < array.length ; i ++) {
array[i] = input.nextInt();
}
for (int i = 0; i < array.length; i ++) {
System.out.println(array[i]);
}
display(array);
}
}
| [
"s3878174@rmit.edu.vn"
] | s3878174@rmit.edu.vn |
d4d9b2a54d23b8592f41503af399632bc932354a | 923d86f1b32eef2ccd953e7c11b027f59f905603 | /PriorityExample.java | 483b1eae8ecb02c05fb2040ff95bf120c70373f6 | [] | no_license | IamRajeshVA/Selenium-Learning | b71996cb783408bb11ba5723b094bc0e1de3a254 | d3d11e88fe4f12fc711af82f8df9af6512c68bff | refs/heads/main | 2023-01-13T20:07:44.708511 | 2020-11-23T11:29:06 | 2020-11-23T11:29:06 | 315,225,060 | 0 | 0 | null | 2020-11-23T11:23:53 | 2020-11-23T06:48:30 | Java | UTF-8 | Java | false | false | 592 | java | package TestNGLearning;
import org.testng.annotations.Test;
public class PriorityExample {
@Test(priority = 0)
public void firstmethod()
{
System.out.println("first method");
}
@Test(priority = 1)
public void secondmethod()
{
System.out.println("second method");
}
@Test(priority =2 )
public void thirdmethod()
{
System.out.println("third method");
}
@Test(priority = 3)
public void fourthmethod()
{
System.out.println("fourth method");
}
@Test(priority = 4)
public void fifthmethod()
{
System.out.println("fifth method");
}
}
| [
"noreply@github.com"
] | IamRajeshVA.noreply@github.com |
8b5c8f15bf062dacef4776287513dce3c196fad2 | 0c06945fd60df3e4da320443e0624a2de36a0077 | /Main.java | 4eefc15f51a2ab6b91a8f4d42a35b7c1914a24ae | [] | no_license | ckddn9496/Programmers.Level3_Java_HanoiTower | cf0264b6696ccfcb4c29c1a3a3ab9560597842b1 | ddaf9d61b02accad9501d7e77c26bf7af3e74efb | refs/heads/master | 2020-08-11T15:42:53.052964 | 2019-10-12T06:27:03 | 2019-10-12T06:27:03 | 214,589,940 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 667 | java | import java.util.Arrays;
public class Main {
public static void main(String[] args) {
int n = 2;
// result [[1,2], [1,3], [2,3]]
for (int[] r : new Solution().solution(n)) {
System.out.print(Arrays.toString(r) + " ");
}
}
}
class Solution {
int[][] result;
int idx = 0;
public int[][] solution(int n) {
result = new int[(int) Math.pow(2, n) - 1][2];
simulateHanoi(1, 3, 2, n);
return result;
}
private void simulateHanoi(int start, int dest, int temp, int n) {
if (n >= 1) {
simulateHanoi(start, temp, dest, n-1);
result[idx][0] = start;
result[idx][1] = dest;
idx++;
simulateHanoi(temp, dest, start, n-1);
}
}
} | [
"ckddn9496@gmail.com"
] | ckddn9496@gmail.com |
a0fb950fddcfb8631f505346e69886a7e464f197 | d027e573602749ec1bd98027ca5eea6c0469501d | /app/src/main/java/com/rhg/qf/adapter/FoodsDetailAdapter.java | d7505dd76910a25277f03ed783e55e7379769ec9 | [] | no_license | remmeber/QF | 252d6250f9c937c38ada2e24b6b2dc2464ffbb9a | 33e4de5e1de267b406255bb70e4db01ea3090459 | refs/heads/master | 2021-04-26T16:51:26.534082 | 2017-01-24T06:40:52 | 2017-01-24T06:41:02 | 74,256,915 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,246 | java | package com.rhg.qf.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.rhg.qf.R;
import com.rhg.qf.application.InitApplication;
import com.rhg.qf.bean.OrderDetailUrlBean;
import java.util.List;
import java.util.Locale;
import butterknife.Bind;
import butterknife.ButterKnife;
/*
*desc
*author rhg
*time 2016/7/10 20:32
*email 1013773046@qq.com
*/
public class FoodsDetailAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final static int TYPE_HEADER = 1;
private final static int TYPE_BODY = 2;
private List<OrderDetailUrlBean.OrderDetailBean.FoodsBean> foodsBeanList;
int type;
public FoodsDetailAdapter(Context context, List<OrderDetailUrlBean.OrderDetailBean.FoodsBean> foodsBeanList) {
this.foodsBeanList = foodsBeanList;
}
@Override
public int getItemViewType(int position) {
if ((position != (getItemCount() - 1)) && foodsBeanList.get(position).getNum() == null)
return TYPE_HEADER;
return TYPE_BODY;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
if (viewType == TYPE_HEADER)
return new FoodHeaderViewHolder(inflater.inflate(R.layout.item_order_header, parent, false));
return new FoodListViewHolder(inflater.inflate(R.layout.item_food, parent, false));
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
OrderDetailUrlBean.OrderDetailBean.FoodsBean _data = foodsBeanList.get(position);
if (getItemViewType(position) == TYPE_HEADER)
((FoodHeaderViewHolder) holder).tvMerchantName.setText(_data.getRName());
else {
((FoodListViewHolder) holder).tvFoodName.setText(_data.getFName());
((FoodListViewHolder) holder).tvFoodPrice.setText(String.format(Locale.ENGLISH, InitApplication.getInstance().getString(R.string.countMoney),
_data.getPrice()));
((FoodListViewHolder) holder).tvFoodNum.setText(String.format(Locale.ENGLISH, InitApplication.getInstance().getString(R.string.countNumber),
_data.getNum()));
}
}
@Override
public int getItemCount() {
return foodsBeanList == null ? 0 : foodsBeanList.size();/*1是给最后的配送费用*/
}
class FoodListViewHolder extends RecyclerView.ViewHolder {
@Bind(R.id.tv_food_name)
TextView tvFoodName;
@Bind(R.id.tv_food_price)
TextView tvFoodPrice;
@Bind(R.id.tv_food_num)
TextView tvFoodNum;
FoodListViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
}
class FoodHeaderViewHolder extends RecyclerView.ViewHolder {
@Bind(R.id.tvMerchantName)
TextView tvMerchantName;
FoodHeaderViewHolder(View headerView) {
super(headerView);
ButterKnife.bind(this, headerView);
}
}
}
| [
"1013773046@qq.com"
] | 1013773046@qq.com |
b84f7a62dde194782b346126d4d60572a250fd13 | 528ad7fe0e935f0019b25a27bbb4a9dd9462c364 | /src/main/java/com/medical/manager/product/web/model/TblMachineUse.java | 333416871f8b2ba2aacde94f5dd8ea63a22e3112 | [] | no_license | wushiju/medicalmanager | affdd02ad3b39e39eb04d0d57643536ebdb511d8 | 4ed18796bb7817f46c9589e3ec760d0c3a47c0c1 | refs/heads/master | 2021-01-15T08:37:19.722764 | 2016-01-15T03:05:46 | 2016-01-15T03:05:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,678 | java | package com.medical.manager.product.web.model;
public class TblMachineUse {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column tbl_machine_use.ID
*
* @mbggenerated
*/
private Long id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column tbl_machine_use.OPEN_TIME
*
* @mbggenerated
*/
private String openTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column tbl_machine_use.USER_ID
*
* @mbggenerated
*/
private Long userId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column tbl_machine_use.USER_NAME
*
* @mbggenerated
*/
private String userName;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column tbl_machine_use.PHONE_NUMBER
*
* @mbggenerated
*/
private String phoneNumber;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column tbl_machine_use.MACHINE_ID
*
* @mbggenerated
*/
private Long machineId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column tbl_machine_use.MACHINE_CODE
*
* @mbggenerated
*/
private String machineCode;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column tbl_machine_use.REMARK
*
* @mbggenerated
*/
private String remark;
public TblMachineUse() {
}
public TblMachineUse(String openTime, Long userId, String userName,
String phoneNumber, Long machineId, String machineCode,
String remark) {
this.openTime = openTime;
this.userId = userId;
this.userName = userName;
this.phoneNumber = phoneNumber;
this.machineId = machineId;
this.machineCode = machineCode;
this.remark = remark;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column tbl_machine_use.ID
*
* @return the value of tbl_machine_use.ID
*
* @mbggenerated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column tbl_machine_use.ID
*
* @param id the value for tbl_machine_use.ID
*
* @mbggenerated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column tbl_machine_use.OPEN_TIME
*
* @return the value of tbl_machine_use.OPEN_TIME
*
* @mbggenerated
*/
public String getOpenTime() {
return openTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column tbl_machine_use.OPEN_TIME
*
* @param openTime the value for tbl_machine_use.OPEN_TIME
*
* @mbggenerated
*/
public void setOpenTime(String openTime) {
this.openTime = openTime == null ? null : openTime.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column tbl_machine_use.USER_ID
*
* @return the value of tbl_machine_use.USER_ID
*
* @mbggenerated
*/
public Long getUserId() {
return userId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column tbl_machine_use.USER_ID
*
* @param userId the value for tbl_machine_use.USER_ID
*
* @mbggenerated
*/
public void setUserId(Long userId) {
this.userId = userId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column tbl_machine_use.USER_NAME
*
* @return the value of tbl_machine_use.USER_NAME
*
* @mbggenerated
*/
public String getUserName() {
return userName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column tbl_machine_use.USER_NAME
*
* @param userName the value for tbl_machine_use.USER_NAME
*
* @mbggenerated
*/
public void setUserName(String userName) {
this.userName = userName == null ? null : userName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column tbl_machine_use.PHONE_NUMBER
*
* @return the value of tbl_machine_use.PHONE_NUMBER
*
* @mbggenerated
*/
public String getPhoneNumber() {
return phoneNumber;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column tbl_machine_use.PHONE_NUMBER
*
* @param phoneNumber the value for tbl_machine_use.PHONE_NUMBER
*
* @mbggenerated
*/
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column tbl_machine_use.MACHINE_ID
*
* @return the value of tbl_machine_use.MACHINE_ID
*
* @mbggenerated
*/
public Long getMachineId() {
return machineId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column tbl_machine_use.MACHINE_ID
*
* @param machineId the value for tbl_machine_use.MACHINE_ID
*
* @mbggenerated
*/
public void setMachineId(Long machineId) {
this.machineId = machineId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column tbl_machine_use.MACHINE_CODE
*
* @return the value of tbl_machine_use.MACHINE_CODE
*
* @mbggenerated
*/
public String getMachineCode() {
return machineCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column tbl_machine_use.MACHINE_CODE
*
* @param machineCode the value for tbl_machine_use.MACHINE_CODE
*
* @mbggenerated
*/
public void setMachineCode(String machineCode) {
this.machineCode = machineCode == null ? null : machineCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column tbl_machine_use.REMARK
*
* @return the value of tbl_machine_use.REMARK
*
* @mbggenerated
*/
public String getRemark() {
return remark;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column tbl_machine_use.REMARK
*
* @param remark the value for tbl_machine_use.REMARK
*
* @mbggenerated
*/
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
} | [
"swpigris81@126.com"
] | swpigris81@126.com |
243e3e4f4bce12324b22f94f64ed7eea391fdbbd | 7c500dcf4762733535a27288eae9d70b76de10bc | /src/main/java/fremad/processor/ArticleProcessor.java | 471eafe7ee324cf14266515742cc8b675c4fca10 | [] | no_license | oysteigr/Fremad | 62abcfda6519a97c39eebf7f88f03e705828ea16 | a8c48ca611159bd9c254eec2722d6b925571ae6a | refs/heads/master | 2020-05-22T14:33:36.405062 | 2015-04-14T18:57:08 | 2015-04-14T18:57:08 | 24,322,055 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,049 | java | package fremad.processor;
import java.util.Collections;
import java.util.Comparator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import fremad.domain.ArticleObject;
import fremad.domain.MatchObject;
import fremad.domain.MatchReportObject;
import fremad.domain.PageObject;
import fremad.domain.list.ArticleListObject;
import fremad.domain.list.MatchReportListObject;
import fremad.domain.list.PageListObject;
import fremad.domain.user.UserRoleEnum;
import fremad.security.SessionSecurityContext;
import fremad.service.ArticleService;
import fremad.service.MatchService;
import fremad.service.TeamService;
@Component
@Scope("request")
public class ArticleProcessor {
private static final Logger LOG = LoggerFactory
.getLogger(ArticleProcessor.class);
@Autowired
private ArticleService articleService;
@Autowired
private MatchService matchService;
@Autowired
private TeamService teamService;
@Autowired
SessionSecurityContext securityContext;
//----------------------ARTICLE METHODS----------------------
public ArticleListObject getArticles(String articleType) {
return articleService.getArticles(articleType);
}
public ArticleListObject getArticleHeaders() {
ArticleListObject articleHeaders = articleService.getArticles("MATCH");
articleHeaders = decorateMatchHeaders(articleHeaders);
articleHeaders.addAll(articleService.getArticles("NEWS"));
removeContent(articleHeaders);
sortArticles(articleHeaders);
return articleHeaders;
}
public ArticleListObject getArticleHeadersShort() {
int maxSize = 5;
ArticleListObject articleList = getArticleHeaders();
if(maxSize > articleList.getList().size()){
maxSize = articleList.getList().size();
}
ArticleListObject shortList = new ArticleListObject();
shortList.addAll(articleList.getList().subList(0, maxSize));
return shortList;
}
public ArticleObject getArticle(int id) {
return articleService.getArticle(id);
}
public ArticleObject addArticle(ArticleObject article) {
securityContext.checkUserPremission(UserRoleEnum.EDITOR);
article.setAuthorId(securityContext.getUserId());
return articleService.addArticle(article);
}
public ArticleObject updateArticle(ArticleObject article) {
securityContext.checkUserPremission(UserRoleEnum.EDITOR);
return articleService.updateArticle(article);
}
public ArticleObject deleteArticle(ArticleObject article) {
securityContext.checkUserPremission(UserRoleEnum.EDITOR);
return articleService.deleteArticle(article);
}
public ArticleObject getArticleFromUrl(String url){
return articleService.getArticle(articleService.getPage(url).getArticleId());
}
private ArticleListObject decorateMatchHeaders(ArticleListObject articleHeaders) {
ArticleListObject filteredArticleList = new ArticleListObject();
for(ArticleObject article : articleHeaders){
MatchReportObject report = null;
MatchReportListObject reports = articleService.getMatchReports();
for(MatchReportObject currentReport : reports){
if(article.getId() == currentReport.getArticleId()){
report = currentReport;
}
}
if(report == null){
LOG.debug("Missmatch");
}else{
article.setContext(decorateContext(article.getContext(), report));
filteredArticleList.add(article);
}
}
return filteredArticleList;
}
private String decorateContext(String context, MatchReportObject report) {
LOG.debug("dud0");
LOG.debug("matchService.getMatch(report.getMatchId(" + report.getMatchId() + "))");
MatchObject match = matchService.getMatch(report.getMatchId());
LOG.debug("dud1");
String fremadName = teamService.getTeam(match.getFremadTeam()).getName();
LOG.debug("dud2");
String homeTeam = match.isHomeMatch() ? fremadName : match.getOpposingTeamName();
LOG.debug("dud3");
String awayTeam = match.isHomeMatch() ? match.getOpposingTeamName() : fremadName;
LOG.debug("dud4");
context = homeTeam.toUpperCase() + " - " + awayTeam.toUpperCase() + " "
+ report.getHomeScore() + "-" + report.getAwayScore() + " ("
+ report.getHomeScorePause() + "-" + report.getAwayScorePause() + "): "
+ context;
LOG.debug("dud5");
return context;
}
private void removeContent(ArticleListObject articleHeaders) {
for (ArticleObject article : articleHeaders){
article.setContent("");
}
}
private void sortArticles(ArticleListObject articleHeaders) {
if (articleHeaders.size() > 0){
Collections.sort(articleHeaders.getList(), new Comparator<ArticleObject>(){
@Override
public int compare(final ArticleObject obj2, final ArticleObject obj1){
return obj1.getDate().compareTo(obj2.getDate());
}
});
}
}
//----------------------PAGE METHODS----------------------
public PageListObject getPages(){
return articleService.getPages();
}
public PageListObject getPublishedPages() {
return articleService.getPublishedPages();
}
public PageObject addPage(PageObject page){
securityContext.checkUserPremission(UserRoleEnum.EDITOR);
return articleService.addPage(page);
}
public PageObject updatePage(PageObject page){
securityContext.checkUserPremission(UserRoleEnum.EDITOR);
return articleService.updatePage(page);
}
//----------------------MATCH REPORT METHODS----------------------
public MatchReportListObject getMatchReports(){
return articleService.getMatchReports();
}
public MatchReportObject getMatchReport(int articleId){
return articleService.getMatchReport(articleId);
}
public MatchReportObject addMatchReport(MatchReportObject report){
securityContext.checkUserPremission(UserRoleEnum.EDITOR);
return articleService.addMatchReport(report);
}
public MatchReportObject updateMatchReport(MatchReportObject report){
securityContext.checkUserPremission(UserRoleEnum.EDITOR);
return articleService.updateMatchReport(report);
}
}
| [
"oysteigr@gmail.com"
] | oysteigr@gmail.com |
dd40738a06be51b542a2957621153e83e4e14f27 | 72020b1000253675da53d782ada302cf1e22e9d9 | /android/ToDoList/src/mk/ukim/finki/jmm/todolist/adapters/TodoItemsAdapter.java | 7036d488e89357f0d2e06a849fb710e5b4837dae | [] | no_license | SofijaShi/finki-jmm | 285e61991e05676003fe19f303648e76731ee6d8 | 9f7716ebb5c0afa6d67c4ac0af7771980795214a | refs/heads/master | 2021-01-18T20:44:49.291970 | 2014-12-07T19:49:58 | 2014-12-07T19:49:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,744 | java | package mk.ukim.finki.jmm.todolist.adapters;
import java.util.ArrayList;
import java.util.List;
import mk.ukim.finki.jmm.todolist.R;
import mk.ukim.finki.jmm.todolist.model.TodoItem;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class TodoItemsAdapter extends BaseAdapter implements
OnItemClickListener {
private List<TodoItem> items;
private Context ctx;
private LayoutInflater inflater;
public TodoItemsAdapter(Context ctx) {
items = new ArrayList<TodoItem>();
this.ctx = ctx;
inflater = (LayoutInflater) ctx
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public TodoItemsAdapter(List<TodoItem> items, Context ctx) {
this.items = items;
this.ctx = ctx;
inflater = (LayoutInflater) this.ctx
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return items.size();
}
@Override
public Object getItem(int position) {
return items.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
class TodoHoler {
public RelativeLayout itemLayout;
public TextView name;
public TextView dueDate;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TodoItem item = items.get(position);
TodoHoler holder = null;
if (convertView == null) {
holder = new TodoHoler();
holder.itemLayout = (RelativeLayout) inflater.inflate(
R.layout.item_todo, null);
holder.name = (TextView) holder.itemLayout
.findViewById(R.id.todoName);
holder.dueDate = (TextView) holder.itemLayout
.findViewById(R.id.todoDate);
convertView = holder.itemLayout;
convertView.setTag(holder);
}
holder = (TodoHoler) convertView.getTag();
holder.name.setText(item.getName());
holder.dueDate.setText(item.getDueDate().toString());
if (item.isDone()) {
holder.itemLayout.setBackgroundColor(Color.GREEN);
} else {
holder.itemLayout.setBackgroundColor(Color.RED);
}
return convertView;
}
public void add(TodoItem item) {
items.add(item);
notifyDataSetChanged();
}
public void addAll(List<TodoItem> items) {
this.items.addAll(items);
notifyDataSetChanged();
}
public void clear(){
items.clear();
notifyDataSetInvalidated();
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
TodoItem item = items.get(position);
item.setDone(!item.isDone());
notifyDataSetChanged();
}
}
| [
"riste.stojanov@finki.ukim.mk"
] | riste.stojanov@finki.ukim.mk |
d90400781e69cae038dc5263699019ae119044a3 | 02533ed4e8c8e15d4b60d9804a57a29c8c82825b | /olaf/app/src/main/java/com/hq/app/olaf/push/Helper.java | dadfb48f81d5419b1543834827427b89458fc604 | [] | no_license | douglashu/hq-forecast | 804449d11c5e39f0cfa110214b6431d1d7ac8e23 | 7aa8d9c459d4aa1e62ed3827e1f951773ac249a9 | refs/heads/master | 2021-06-15T15:19:14.566905 | 2017-04-12T07:54:17 | 2017-04-12T07:54:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 852 | java | package com.hq.app.olaf.push;
import android.app.ActivityManager;
import android.content.Context;
import android.text.TextUtils;
import java.util.List;
public class Helper {
public static boolean isServiceRunning(Context context, String className) {
boolean isRunning = false;
ActivityManager activityManager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningServiceInfo> serviceList = activityManager.getRunningServices(Integer.MAX_VALUE);
if(serviceList == null || serviceList.isEmpty())
return false;
for(int i = 0; i < serviceList.size(); i++) {
if(serviceList.get(i).service.getClassName().equals(className) && TextUtils.equals(
serviceList.get(i).service.getPackageName(), context.getPackageName())) {
isRunning = true;
break;
}
}
return isRunning;
}
}
| [
"46773109@qq.com"
] | 46773109@qq.com |
f15730a9fa88f3ffae2cbcf093867f3f2e1168ca | 772035006049839a30dec653457931c269aa844c | /Data Structures/LinkedList/TestLinkedStack.java | 1bad37561ba17e2117a7df84ccce0d98942e99ff | [] | no_license | ceeeztheday/SchoolWork | 6843ad3aa742dbc0f4f6a81eaf2c8d4ee148e9cc | c7f07c3e870e67a343ebc47bc9dc6b64afef6119 | refs/heads/master | 2022-12-21T04:43:32.385816 | 2020-09-18T16:17:27 | 2020-09-18T16:17:27 | 295,881,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,470 | java |
// Test driver for the LinkedNumberStack and PostFixCalculator classes
import java.util.*;
import java.io.*;
public class TestLinkedStack {
public static void main(String[] args) {
System.out.println("================ Problem 1 ================");
TestP1();
System.out.println("================ End of Problem 1 ================\n\n");
System.out.print("Press any key to test Problem 2...");
try {
System.in.read();
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("================ Problem 2 ================");
TestP2();
System.out.println("================ End of Problem 2 ================");
}
public static void TestP1() {
NumberStack myStack = new LinkedNumberStack();
int numPassedTests = 0;
int numTotalTests = 0;
String testResult;
// Test 1
numTotalTests++;
int iReturn = -1;
testResult = "[Failed]";
String eMsg = "N/A";
try {
iReturn = myStack.size();
if (iReturn == 0) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": size() ==> " + testResult + "\n Expected: 0");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 2
numTotalTests++;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.pop();
} catch (RuntimeException e) {
if (!(e instanceof NullPointerException)) {
numPassedTests++;
testResult = "[Passed]";
}
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": pop() ==> " + testResult + "\n Expected: a RuntimeException");
System.out.println(" Yours: " + eMsg + "\n");
// Test 3
numTotalTests++;
boolean bReturn = false;
testResult = "[Failed]";
eMsg = "N/A";
try {
myStack.push(10);
bReturn = myStack.isEmpty();
if (bReturn == false) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println(
"Test " + numTotalTests + ": push(10) and then isEmpty() ==> " + testResult + "\n Expected: false");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + bReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 4
numTotalTests++;
String sReturn = myStack.toString();
if (sReturn.equals("10 ")) {
numPassedTests++;
testResult = "[Passed]";
} else
testResult = "[Failed]";
System.out.println(
"Test " + numTotalTests + ": toString() ==> " + testResult + "\n Expected (from top to bottom): 10 ");
System.out.println(" Yours (from top to bottom): " + sReturn + "\n");
// Test 5
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.top();
if (iReturn == 10) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": top() ==> " + testResult + "\n Expected: 10");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 6
numTotalTests++;
sReturn = "";
testResult = "[Failed]";
eMsg = "N/A";
try {
myStack.push(20);
sReturn = myStack.toString();
if (sReturn.equals("20 10 ")) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": push(20) and then toString() ==> " + testResult
+ "\n Expected (from top to bottom): 20 10 ");
if (eMsg.equals("N/A"))
System.out.println(" Yours (from top to bottom): " + sReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 7
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.top();
if (iReturn == 20) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": top() ==> " + testResult + "\n Expected: 20");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 8
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.pop();
if (iReturn == 20) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": pop() ==> " + testResult + "\n Expected: 20");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 9
numTotalTests++;
sReturn = myStack.toString();
if (sReturn.equals("10 ")) {
numPassedTests++;
testResult = "[Passed]";
} else
testResult = "[Failed]";
System.out.println(
"Test " + numTotalTests + ": toString() ==> " + testResult + "\n Expected (from top to bottom): 10 ");
System.out.println(" Yours (from top to bottom): " + sReturn + "\n");
// Test 10
numTotalTests++;
sReturn = "";
testResult = "[Failed]";
eMsg = "N/A";
try {
myStack.push(30);
myStack.push(40);
myStack.push(50);
sReturn = myStack.toString();
if (sReturn.equals("50 40 30 10 ")) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": push(30), push(40), push(50), and then toString() ==> "
+ testResult + "\n Expected (from top to bottom): 50 40 30 10 ");
if (eMsg.equals("N/A"))
System.out.println(" Yours (from top to bottom): " + sReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 11
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.size();
if (iReturn == 4) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": size() ==> " + testResult + "\n Expected: 4");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 12
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.pop();
iReturn = myStack.top();
if (iReturn == 40) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": pop() and then top() ==> " + testResult + "\n Expected: 40");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 13
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.pop();
iReturn = myStack.size();
if (iReturn == 2) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": pop() and then size() ==> " + testResult + "\n Expected: 2");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 14
numTotalTests++;
sReturn = "";
testResult = "[Failed]";
eMsg = "N/A";
try {
myStack.push(20);
sReturn = myStack.toString();
if (sReturn.equals("20 30 10 ")) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": push(20) and then toString() ==> " + testResult
+ "\n Expected (from top to bottom): 20 30 10 ");
if (eMsg.equals("N/A"))
System.out.println(" Yours (from top to bottom): " + sReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 15
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.size();
if (iReturn == 3) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": size() ==> " + testResult + "\n Expected: 3");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 16
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.pop();
iReturn = myStack.pop();
iReturn = myStack.top();
if (iReturn == 10) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println(
"Test " + numTotalTests + ": pop() twice and then top() ==> " + testResult + "\n Expected: 10");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 17
numTotalTests++;
sReturn = "";
testResult = "[Failed]";
eMsg = "N/A";
try {
sReturn = myStack.toString();
if (sReturn.equals("10 ")) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println(
"Test " + numTotalTests + ": toString() ==> " + testResult + "\n Expected (from top to bottom): 10 ");
if (eMsg.equals("N/A"))
System.out.println(" Yours (from top to bottom): " + sReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 18
numTotalTests++;
bReturn = false;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.pop();
bReturn = myStack.isEmpty();
if (bReturn == true) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println(
"Test " + numTotalTests + ": pop() and then isEmpty() ==> " + testResult + "\n Expected: true");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + bReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 19
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.size();
if (iReturn == 0) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": size() ==> " + testResult + "\n Expected: 0");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 20
numTotalTests++;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.pop();
} catch (RuntimeException e) {
if (!(e instanceof NullPointerException)) {
numPassedTests++;
testResult = "[Passed]";
}
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": pop() ==> " + testResult + "\n Expected: a RuntimeException");
System.out.println(" Yours: " + eMsg + "\n");
// Test 21
numTotalTests++;
sReturn = "";
testResult = "[Failed]";
eMsg = "N/A";
try {
myStack.push(70);
sReturn = myStack.toString();
if (sReturn.equals("70 ")) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": push(70) and then toString() ==> " + testResult
+ "\n Expected (from top to bottom): 70 ");
if (eMsg.equals("N/A"))
System.out.println(" Yours (from top to bottom): " + sReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 22
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.top();
if (iReturn == 70) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": top() ==> " + testResult + "\n Expected: 70");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
// Test 23
numTotalTests++;
iReturn = -1;
testResult = "[Failed]";
eMsg = "N/A";
try {
iReturn = myStack.pop();
iReturn = myStack.size();
if (iReturn == 0) {
numPassedTests++;
testResult = "[Passed]";
}
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.println("Test " + numTotalTests + ": pop() and then size() ==> " + testResult + "\n Expected: 0");
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + iReturn + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
System.out.println("Total test cases: " + numTotalTests + "\nCorrect: " + numPassedTests + "\nWrong: "
+ (numTotalTests - numPassedTests));
}
public static void TestP2() {
/*
* try { File f = new File("testExpressions.txt"); Scanner fileIn = new
* Scanner(f); PostFixCalculator myCalculator = new PostFixCalculator();
* ArrayList<Integer> results = new ArrayList<Integer>(); ArrayList<String>
* expressions = new ArrayList<String>(); ArrayList<String> exceptions = new
* ArrayList<String>(); int r; String eMsg; String postFixExp; int numTotalTests
* = 0;
*
* while (true) { if (fileIn.hasNext()) { numTotalTests++; postFixExp =
* fileIn.nextLine(); myCalculator.setPostfix(postFixExp);
*
* r = -1; eMsg = "N/A"; try { r = myCalculator.calculate(); } catch
* (RuntimeException e) { eMsg = "RuntimeException - \"" + e.getMessage() +
* "\""; }
*
* System.out.println("Test " + numTotalTests + ": (" + postFixExp + ")"); if
* (eMsg.equals("N/A")) System.out.println(" Output: " + r + "\n"); else
* System.out.println(" Output: " + eMsg + "\n");
*
* // add result and error message (if any) to the arraylists results.add(r);
* expressions.add(postFixExp); exceptions.add(eMsg); } else break; }
*
* // write the arraylists to file ObjectOutputStream out = new
* ObjectOutputStream(new FileOutputStream("testExpressions.dat"));
* out.writeObject(results); out.writeObject(expressions);
* out.writeObject(exceptions); out.close(); } catch (Exception e) {
* System.out.println("Error occurred: " + e.getMessage()); }
*/
try {
ObjectInputStream in = new ObjectInputStream(new FileInputStream("testExpressions.dat"));
PostFixCalculator myCalculator = new PostFixCalculator();
ArrayList<Integer> results = new ArrayList<Integer>();
ArrayList<String> expressions = new ArrayList<String>();
ArrayList<String> exceptions = new ArrayList<String>();
results = (ArrayList<Integer>) in.readObject();
expressions = (ArrayList<String>) in.readObject();
exceptions = (ArrayList<String>) in.readObject();
int r;
String eMsg;
String postFixExp;
int numPassedTests = 0;
int numTotalTests = 0;
for (int i = 0; i < expressions.size(); i++) {
numTotalTests++;
postFixExp = expressions.get(i);
myCalculator.setPostfix(postFixExp);
r = -1;
eMsg = "N/A";
try {
r = myCalculator.calculate();
} catch (RuntimeException e) {
eMsg = "RuntimeException - \"" + e.getMessage() + "\"";
}
System.out.print("Test " + numTotalTests + ": (" + postFixExp + ") ==> ");
if (exceptions.get(i).equals("N/A")) {
if (eMsg.equals("N/A") && r == results.get(i)) {
System.out.println("[Passed]");
numPassedTests++;
} else
System.out.println("[Failed]");
System.out.println(" Expected: " + results.get(i));
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + r + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
} else {
if (exceptions.get(i).equalsIgnoreCase(eMsg)) {
System.out.println("[Passed]");
numPassedTests++;
} else {
if (eMsg.equals("N/A"))
System.out.println("[Failed]");
else
System.out.println("[Mismatched exception message]");
}
System.out.println(" Expected: " + exceptions.get(i));
if (eMsg.equals("N/A"))
System.out.println(" Yours: " + r + "\n");
else
System.out.println(" Yours: " + eMsg + "\n");
}
}
System.out.println("Total test cases: " + numTotalTests + "\nCorrect: " + numPassedTests + "\nWrong: "
+ (numTotalTests - numPassedTests));
} catch (Exception e) {
System.out.println("Error occurred: " + e.getMessage());
}
}
} | [
"noreply@github.com"
] | ceeeztheday.noreply@github.com |
a3b4647db974eb8cfd9c9432aacea582fe89bd2a | dd75cc973206d37731a851b35a518a6630876555 | /kv5.1.8_oct5.0/src/main/java/com/openkm/frontend/client/util/QueryParamsComparator.java | 3de034c2a659a3c016312df6e856d6991d94d84d | [] | no_license | itxingqing/knowledge_vault | 553b50573045a7b2bba78ac4c2550f04d27682c4 | 92fc2781fa1feb2a1ee25d098d859f38569902de | refs/heads/master | 2020-04-05T07:39:19.730689 | 2012-05-23T05:46:08 | 2012-05-23T05:46:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,538 | java | /**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2011 Paco Avila & Josep Llort
*
* No bytes were intentionally harmed during the development of this application.
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.openkm.frontend.client.util;
import java.util.Comparator;
import com.openkm.frontend.client.bean.GWTQueryParams;
/**
* QueryParamsComparator
*
* @author jllort
*
*/
public class QueryParamsComparator implements Comparator<GWTQueryParams> {
private static final Comparator<GWTQueryParams> INSTANCE = new QueryParamsComparator();
public static Comparator<GWTQueryParams> getInstance() {
return INSTANCE;
}
public int compare(GWTQueryParams arg0, GWTQueryParams arg1) {
return arg1.getQueryName().compareTo(arg0.getQueryName()); // inverse comparation
}
} | [
"viswanadh.sripada@realution.in"
] | viswanadh.sripada@realution.in |
b945828821e0fa50abf776acdcbc26d0c9aa2a2e | 0746290f6cd63cd2e33f0e18352091a7ea8f0ac1 | /app/src/main/java/com/letmeexplore/lme/PlaylistDataRandom.java | 413cb1a4eb744c0e3dce15eb5782646bba3bfaf0 | [] | no_license | LMETEAM/LetMeExplore | 89cfdf35e87470cfed90861cf706156dc0184214 | a81015e950e68ca7afb4119481ddd0a69817076b | refs/heads/master | 2021-06-11T05:04:16.623889 | 2018-05-08T21:45:49 | 2018-05-08T21:45:49 | 128,410,344 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 839 | java | package com.letmeexplore.lme;
public class PlaylistDataRandom {
private String uid;
private String playlistname;
private String photoUrl;
public PlaylistDataRandom(){
}
public PlaylistDataRandom(String uid, String playlistname, String photoUrl) {
this.uid = uid;
this.playlistname=playlistname;
this.photoUrl=photoUrl;
}
public String getPhotoUrl() {
return photoUrl;
}
public void setPhotoUrl(String photoUrl) {
this.photoUrl = photoUrl;
}
public String getPlaylistname() {
return playlistname;
}
public void setPlaylistname(String playlistname) {
this.playlistname = playlistname;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
}
| [
"ilkeratabay@yahoo.com"
] | ilkeratabay@yahoo.com |
124d49f13e0795778067100465c639d7cbf6f7af | e535dcb02d4c1839180b6a0baa758e765e03ba2c | /App/src/main/java/com/sastore/web/domain/NameDomain.java | 0df9ad7272f844e86b2b66b56220c5614c78cc8c | [] | no_license | aarshinkov/SAStore | 857f9a047cb31a2b6adfecb70d8730c57791c5ec | 7cc15f717bde84dbfb6232aaea33fc4ca23136f2 | refs/heads/main | 2023-01-06T18:08:13.519273 | 2023-01-02T01:46:39 | 2023-01-02T01:46:39 | 185,270,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 614 | java | package com.sastore.web.domain;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
*
* @author Atanas Yordanov Arshinkov
* @since 1.0.0
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class NameDomain implements Serializable {
private String firstName;
private String lastName;
public String getFullName() {
return (lastName != null) ? firstName + ' ' + lastName : firstName;
}
@Override
public String toString() {
return getFullName();
}
}
| [
"a.arshinkov97@gmail.com"
] | a.arshinkov97@gmail.com |
85a5b0c43e91ed6cb90d2f3a3f29abfc81bcc21c | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/dev/morphia/mapping/lazy/TestLazyCollectionReference.java | e3ba2e04aa455b6d6f46aaa9e5c95d36e0a693d1 | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 2,728 | java | package dev.morphia.mapping.lazy;
import dev.morphia.annotations.Reference;
import dev.morphia.mapping.lazy.proxy.LazyReferenceFetchingException;
import dev.morphia.testutil.TestEntity;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
public class TestLazyCollectionReference extends ProxyTestBase {
@Test(expected = LazyReferenceFetchingException.class)
public final void testCreateProxy() {
if (!(LazyFeatureDependencies.testDependencyFullFilled())) {
return;
}
// Create a root entity with 2 referenced entities
TestLazyCollectionReference.RootEntity root = new TestLazyCollectionReference.RootEntity();
final TestLazyCollectionReference.ReferencedEntity referenced1 = new TestLazyCollectionReference.ReferencedEntity();
referenced1.setFoo("bar1");
final TestLazyCollectionReference.ReferencedEntity referenced2 = new TestLazyCollectionReference.ReferencedEntity();
referenced2.setFoo("bar2");
List<TestLazyCollectionReference.ReferencedEntity> references = new ArrayList<TestLazyCollectionReference.ReferencedEntity>();
references.add(referenced1);
references.add(referenced2);
root.references = references;
// save to DB
getDs().save(referenced1);
getDs().save(referenced2);
getDs().save(root);
// read root entity from DB
root = getDs().get(root);
assertNotFetched(root.references);
// use the lazy collection
Collection<TestLazyCollectionReference.ReferencedEntity> retrievedReferences = root.references;
Assert.assertEquals(2, retrievedReferences.size());
assertFetched(root.references);
Iterator<TestLazyCollectionReference.ReferencedEntity> it = retrievedReferences.iterator();
Assert.assertEquals("bar1", it.next().getFoo());
Assert.assertEquals("bar2", it.next().getFoo());
// read root entity from DB again
root = getDs().get(root);
assertNotFetched(root.references);
// remove the first referenced entity from DB
getDs().delete(referenced1);
// must fail
root.references.size();
}
public static class RootEntity extends TestEntity {
@Reference(lazy = true)
private Collection<TestLazyCollectionReference.ReferencedEntity> references;
}
public static class ReferencedEntity extends TestEntity {
private String foo;
public void setFoo(final String string) {
foo = string;
}
public String getFoo() {
return foo;
}
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
d78e32790b2ee20746357e46d58cc80e45c72fe8 | 574b4e8553166e120340da8adfa0f6ebd0e37b30 | /WIP-XI/src/III/Output/Print.java | 5b2943a94ff9ab73ce8bede4f74fee4c1749090a | [] | no_license | linpmbl/WIPCAMP11-programming | e9a2627fe1e8b2de44a994a21b6c63227670b07e | 070b2ce0382a5397f1ae8941e8f0f83a02cccc88 | refs/heads/master | 2020-05-29T13:30:16.202954 | 2019-05-31T04:48:31 | 2019-05-31T04:48:31 | 189,165,431 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 420 | java | /*
* WIP XI Computer Programing
*/
package III.Output;
/**
*
* @author sittiwatlcp
*/
public class Print {
public static void main(String[] args) {
System.out.print("Lin \n");
System.out.print("Baek \n");
// \n <-- new line (ชี้นบรรทัดใหม่)
System.out.print("voen \n");
System.out.print("mold");
}
}
| [
"51120256+linpmbl@users.noreply.github.com"
] | 51120256+linpmbl@users.noreply.github.com |
60738e521392482da59f44ac6d4d4f56e1326809 | a93ef819914c43e9beb410137bab82501cfee4aa | /old/csit_java/2016/data_src/RandomJankenPlayer.java | 1babb5d354748f4a64eabb19ed8f0acd274593da | [] | no_license | itakigawa/itakigawa.github.io | 403d5feea20b14552210f5c05f508414cfc39311 | 95e0a37c25b6c3277b5f31b63bb8a271738edd4d | refs/heads/master | 2023-06-21T22:58:06.615691 | 2023-06-14T12:56:43 | 2023-06-14T12:56:43 | 187,968,906 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 945 | java | public class RandomJankenPlayer {
public String name;
public RandomJankenPlayer(String name){
this.name = name;
}
public Hand showHand(){
Hand play;
double rnd = Math.random();
if(rnd < 1.0/3.0){
play = Hand.ROCK;
}else if (rnd < 2.0/3.0){
play = Hand.PAPER;
}else{
play = Hand.SCISSORS;
}
return play;
}
// main
public static void main(String[] args){
RandomJankenPlayer player1 = new RandomJankenPlayer("Yamada");
RandomJankenPlayer player2 = new RandomJankenPlayer("Suzuki");
Hand hand1, hand2;
for(int i=0; i<10; i++){
hand1 = player1.showHand();
hand2 = player2.showHand();
System.out.println(i+")"+
"["+player1.name+"]"+hand1+" vs "+
"["+player2.name+"]"+hand2);
}
}
}
| [
"ichigaku.takigawa@riken.jp"
] | ichigaku.takigawa@riken.jp |
abd5cefdf8539c162a4394142af8a79d79908336 | 0dfdc585caccc458fb8ca583ebb4bf41f102726b | /ucenter-api/src/main/java/cn/ztuo/bitrade/config/HttpSessionConfig.java | e8de3af082078c6d6b077adde84fc96b3ba06207 | [] | no_license | q-exchange/framework | 1f016a642eff09840b802dfb62b542d76f87dc2c | d2e488c52ccaa93f862c10f935d5d2cd9ec59af2 | refs/heads/master | 2022-11-17T06:52:16.693355 | 2020-01-10T08:37:46 | 2020-01-10T08:37:46 | 233,000,909 | 1 | 4 | null | 2022-11-16T08:56:17 | 2020-01-10T08:26:56 | Java | UTF-8 | Java | false | false | 984 | java | package cn.ztuo.bitrade.config;
import cn.ztuo.bitrade.ext.SmartHttpSessionStrategy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.web.http.CookieHttpSessionStrategy;
import org.springframework.session.web.http.HeaderHttpSessionStrategy;
import org.springframework.session.web.http.HttpSessionStrategy;
/**
* 一个小时过期
*/
@Configuration
@EnableRedisHttpSession(maxInactiveIntervalInSeconds =3600)
public class HttpSessionConfig {
@Bean
public HttpSessionStrategy httpSessionStrategy(){
HeaderHttpSessionStrategy headerSession = new HeaderHttpSessionStrategy();
CookieHttpSessionStrategy cookieSession = new CookieHttpSessionStrategy();
headerSession.setHeaderName("x-auth-token");
return new SmartHttpSessionStrategy(cookieSession,headerSession);
}
}
| [
"3402309136@qq.com"
] | 3402309136@qq.com |
9b429ee7dcbcd9789beb27bb735417877d46297a | a18165e68e236ac7d6cc6f8c494a71b192ca650c | /src/PToolBar.java | 8615c7ddcc5f33753e4c19aa0ab7499ac23a2d5f | [] | no_license | SerhiiHavryliuk/Java_GUI_Painter | c0adc821d6b1a9ded5d39819643ac140ba6ee50c | 6bb9f93c7fcd5868930250a2c234d4fb8f774733 | refs/heads/master | 2016-08-12T13:06:02.949476 | 2015-06-02T12:44:26 | 2015-06-02T12:45:06 | 36,732,266 | 0 | 0 | null | null | null | null | WINDOWS-1251 | Java | false | false | 1,951 | java |
import javax.swing.JButton;
import javax.swing.JSlider;
import javax.swing.JToolBar;
import javax.swing.event.ChangeListener;
public class PToolBar extends JToolBar
{
private static final long serialVersionUID = 1L;
PListCommand comList = null;
public PToolBar(PListCommand comList)
{
this.comList = comList;
JButton btnOpen = new JButton("Open");
btnOpen.addActionListener(comList.fileOpen);
JButton btnSave = new JButton("Save");
btnSave.addActionListener(comList.fileSave);
JButton btnColor = new JButton("Color");
btnColor.addActionListener(comList.editColor);
JButton btnClear = new JButton("Clear");
btnClear.addActionListener(comList.editClear);
JSlider slider = new JSlider(JSlider.HORIZONTAL, 1, 15, 3);
slider.setMajorTickSpacing(3); // позволяет задать расстояние, через которое будут выводиться большие деления
slider.setMinorTickSpacing(1); // расстояние, через которые будут выводиться маленькие деления
slider.setPaintTicks(true); // включает или отключает прорисовку этих делений
slider.setPaintLabels(true); // включает или отключает прорисовку меток под большими делениями.
slider.setSnapToTicks(true); // включает или отключает «прилипание» ползунка к делениям: если вызвать этот метод с параметром true, пользователь сможет выбрать при помощи ползунка только значения, соответствующие делениям.
slider.addChangeListener((ChangeListener) comList.editLine);
add(btnOpen);
add(btnSave);
addSeparator();
add(btnColor);
add(btnClear);
addSeparator();
add(slider);
addSeparator();
addSeparator();
}
}
| [
"havryliuk.serhii@gmail.com"
] | havryliuk.serhii@gmail.com |
e7e0a6d4c225688c4a9e539b44084472ab377218 | 3cb868fd0b2ca499bee0b7c20644d696c10fcd53 | /numberPlay/src/numberPlay/processing/NumberProcessor.java | 06385e483af67d474ac8d7795b552e6f7da13e43 | [] | no_license | kenneth-fernandes/cs542-design-patterns-assign-2 | 728b18fe5aa0163f3baf84281b9aa7e50d65a884 | 63d961fe44a4d001327d818ad02cd4130a9e170d | refs/heads/master | 2023-04-05T03:41:30.962020 | 2021-04-06T06:49:39 | 2021-04-06T06:49:39 | 350,887,202 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,274 | java | package numberPlay.processing;
import java.text.DecimalFormat;
import numberPlay.filter.FloatingPointEventFilter;
import numberPlay.filter.IntegerEventFilter;
import numberPlay.subject.MetricsSubject;
import numberPlay.util.UtilityConstants;
/**
* Class for processing the string number to Integer or Float depending on the
* type of the number
*/
public class NumberProcessor {
// Data member of NumberProcessor storing its own object
private static NumberProcessor numProcessorObj;
// Data member of NumberProcessor storing the current number as string
private String currentNumberStr;
/**
* Function that returns the singleton object of the NumberProcessor class
*
* @return - Singleton object of NumberProcessor class
*/
public static NumberProcessor getInstance() {
if (numProcessorObj == null) {
numProcessorObj = new NumberProcessor();
}
return numProcessorObj;
}
/**
* Function tha eturns the string value of cureent number that is being
* processed
*
* @return - Current number string that is being processed
*/
public String getCurrentNumStr() {
return currentNumberStr;
}
/**
* Empty private NumberProcessor constructor
*/
private NumberProcessor() {
}
/**
* Function that processes the current number read from the file
*
* @param numString - Number in the form of string
*/
public void processNumber(String numString) throws Exception{
currentNumberStr = numString;
MetricsSubject.getInstance().notifyAllObservers(FloatingPointEventFilter.getInstance(), numString);
MetricsSubject.getInstance().notifyAllObservers(IntegerEventFilter.getInstance(), numString);
}
/**
* Function to round the number
*
* @param number - The number that needs to be rounded
* @return - The rounded float value of a number
*/
public double roundNumber(double number) {
DecimalFormat df = new DecimalFormat(UtilityConstants.getInstance().DECIMAL_FORMAT_STRING);
return Double.parseDouble(df.format(number));
}
@Override
public String toString(){
return "Number Processor class";
}
} | [
"kenferns9339@gmail.com"
] | kenferns9339@gmail.com |
e4340a042cbf77ae8688554ddf0961d44c0dae3d | bc873a249f231e88515ca24d97923f4882bfd873 | /fixeala-core/src/main/java/ar/com/urbanusjam/fixeala/model/IssueVerification.java | 41c884c22b4ad319df2a401a1fe2f4a44cfe0061 | [] | no_license | urbanusjam/fixeala | ecba8bf4ba9767b996285425cab18fc266d87a83 | 039d7482912d8e20ef2d580ae2e4a20dd1edf550 | refs/heads/master | 2021-01-23T13:58:18.383128 | 2015-04-21T13:03:45 | 2015-04-21T13:03:45 | 32,404,015 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 590 | java | package ar.com.urbanusjam.fixeala.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name="issue_verification_request")
public class IssueVerification extends IssueMainAbstract implements Serializable {
private static final long serialVersionUID = 1L;
@Column(name = "is_verified")
private boolean isVerified;
public boolean isVerified() {
return isVerified;
}
public void setVerified(boolean isVerified) {
this.isVerified = isVerified;
}
}
| [
"urbanusjam@gmail.com"
] | urbanusjam@gmail.com |
29207205b1c8493506e0f5a095e5cd4a31cf6544 | a8c540307ac00379eaf6ee7969e8e1e3d19633f0 | /src/main/java/com/jinshi/wxPay/WxConst.java | 392aa8531a210789a6b0d0fffd96420d2bc237a7 | [] | no_license | dingjing0518/carManager | e890d12d4c4598c7d266a68da1d605b76af86497 | 9386cf03c4883c4121fac4a1fcd2404767706ab1 | refs/heads/master | 2023-02-10T20:11:43.071749 | 2021-01-10T14:44:22 | 2021-01-10T14:44:22 | 328,405,383 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,302 | java | package com.jinshi.wxPay;
public class WxConst {
// //微信小程序appid
// public static String appId = "wxd440bee620002bdc";
// //微信小程序appsecret
// public static String appSecret = "855a1757db22d24419cd14363fa5ff09";
//公司服务号
// public static String appId = "wxa93aeac9e8d90a60";
// public static String appSecret = "51e6b653a0b5267f580afc3dee52c184";
//金石客户wx568c587ae29d2733
public static String appId = "wx568c587ae29d2733";
public static String appSecret = "786a3488d271f75b16ea847dd4150b75";
//微信支付主体
public static String title = "停车场支付";
//订单号随机生成
public static String orderNo = PayUtils.order();
//微信商户号
public static String mch_id="1546856631";
//微信支付的商户密钥
public static final String key = "Fancynetworkwangluokeji888888888";
//支付成功后的服务器回调url
public static final String notify_url="https://api.weixin.qq.com/sns/jscode2session";
//签名方式
public static final String SIGNTYPE = "MD5";
//交易类型
public static final String TRADETYPE = "JSAPI";
//微信统一下单接口地址
public static final String pay_url = "https://api.mch.weixin.qq.com/pay/unifiedorder";
}
| [
"dingjing@wx.bigcloudsys.com"
] | dingjing@wx.bigcloudsys.com |
374f6124f143c401308f90bbce607af5666017d3 | 8a6caa5579e3f80033a6a2d4d57774a76f0e4e7f | /presentation/src/main/java/ru/vladislav/razgonyaev/weather/ui/weather/WeatherListBindings.java | fa40b80e97823f5d2d649328eb95aa2462ee372b | [] | no_license | vladcrash/Weather | 23a2eaf942749f071efc81c24b76805acfc261d1 | dcb44c5b252cb1e3e186b7f7c708d2dacd6b2e11 | refs/heads/master | 2020-03-26T08:49:35.027000 | 2018-08-19T21:28:08 | 2018-08-19T21:28:08 | 144,721,923 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 571 | java | package ru.vladislav.razgonyaev.weather.ui.weather;
import android.databinding.BindingAdapter;
import android.databinding.ObservableField;
import android.support.v7.widget.RecyclerView;
import java.util.List;
import ru.vladislav.razgonyaev.domain.model.Forecast;
public class WeatherListBindings {
@BindingAdapter({"adapter", "data"})
public static void bind(RecyclerView recyclerView, WeatherAdapter adapter, ObservableField<List<Forecast>> forecasts) {
recyclerView.setAdapter(adapter);
adapter.setDailyForecasts(forecasts.get());
}
}
| [
"vladcrash1147@yandex.ru"
] | vladcrash1147@yandex.ru |
dd2e78251b0d4c4739d7285f61289d3e8545d7f2 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/21/21_15435d52e0043b77beed0c57cc63158c93266059/APIEndpoint/21_15435d52e0043b77beed0c57cc63158c93266059_APIEndpoint_s.java | 26397ed89ac437725a13b5f2d59053bda7a68072 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 15,929 | java | package com.dozuki.ifixit.util;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import org.json.JSONException;
import android.util.Log;
import com.dozuki.ifixit.dozuki.model.Site;
/**
* Defines all APIEndpoints.
*/
public enum APIEndpoint {
CATEGORIES(
new Endpoint() {
public String createUrl(String query) {
return "categories/";
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.Categories().setResult(JSONHelper.parseTopics(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.Categories();
}
},
false,
"GET",
false
),
GUIDE(
new Endpoint() {
public String createUrl(String query) {
return "guides/" + query;
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.Guide().setResult(JSONHelper.parseGuide(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.Guide();
}
},
false,
"GET",
false
),
TOPIC(
new Endpoint() {
public String createUrl(String query) {
try {
return "topics/" + URLEncoder.encode(query, "UTF-8");
} catch (Exception e) {
Log.w("iFixit", "Encoding error: " + e.getMessage());
return null;
}
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.Topic().setResult(JSONHelper.parseTopicLeaf(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.Topic();
}
},
false,
"GET",
false
),
LOGIN(
new Endpoint() {
public String createUrl(String query) {
return "user/token";
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.Login().setResult(JSONHelper.parseLoginInfo(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.Login();
}
},
false,
"POST",
true
),
LOGOUT(
new Endpoint() {
public String createUrl(String query) {
return "user/token";
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.Logout();
}
public APIEvent<?> getEvent() {
return new APIEvent.Logout();
}
},
true,
"DELETE",
false
),
REGISTER(
new Endpoint() {
public String createUrl(String query) {
return "user";
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.Register().setResult(JSONHelper.parseLoginInfo(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.Register();
}
},
false,
"POST",
true
),
USER_IMAGES(
new Endpoint() {
public String createUrl(String query) {
return "user/media/images" + query;
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.UserImages().setResult(JSONHelper.parseUserImages(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.UserImages();
}
},
true,
"GET",
false
),
USER_VIDEOS(
new Endpoint() {
public String createUrl(String query) {
return "user/media/videos" + query;
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.UserVideos().setResult(JSONHelper.parseUserVideos(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.UserVideos();
}
},
true,
"GET",
false
),
USER_EMBEDS(
new Endpoint() {
public String createUrl(String query) {
return "user/media/embeds" + query;
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.UserEmbeds().setResult(JSONHelper.parseUserEmbeds(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.UserVideos();
}
},
true,
"GET",
false
),
UPLOAD_IMAGE(
new Endpoint() {
public String createUrl(String query) {
String fileName;
try {
fileName = URLEncoder.encode(getFileNameFromFilePath(query), "UTF-8");
} catch (UnsupportedEncodingException e) {
// Provide a default file name.
fileName = "uploaded_image.jpg";
}
return "user/media/images?file=" + fileName;
}
private String getFileNameFromFilePath(String filePath) {
int index = filePath.lastIndexOf('/');
if (index == -1) {
/**
* filePath doesn't have a '/' in it. That's weird but just
* return the whole file path.
*/
return filePath;
}
return filePath.substring(index + 1);
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.UploadImage().setResult(JSONHelper.parseUploadedImageInfo(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.UploadImage();
}
},
true,
"POST",
false
),
DELETE_IMAGE(
new Endpoint() {
public String createUrl(String query) {
return "user/media/images" + query;
}
public APIEvent<?> parse(String json) throws JSONException {
// TODO: Actually look at the response?
return new APIEvent.DeleteImage().setResult("");
}
public APIEvent<?> getEvent() {
return new APIEvent.DeleteImage();
}
},
true,
"DELETE",
false
),
USER_GUIDES(
new Endpoint() {
public String createUrl(String query) {
return "user/guides";
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.UserGuides().setResult(JSONHelper.parseUserGuides(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.UserGuides();
}
},
true,
"GET",
false
),
GUIDE_FOR_EDIT(
new Endpoint() {
public String createUrl(String query) {
return "guides/" + query + "?edit&noPrereqSteps";
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.GuideForEdit().setResult(JSONHelper.parseUserGuide(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.GuideForEdit();
}
},
true,
"GET",
false
),
CREATE_GUIDE(
new Endpoint() {
public String createUrl(String query) {
return "guides";
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.CreateGuide().setResult(JSONHelper.parseUserGuide(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.CreateGuide();
}
},
true,
"POST",
false
),
EDIT_GUIDE(
new Endpoint() {
public String createUrl(String query) {
return "guides/" + query;
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.EditGuide().setResult(JSONHelper.parseUserGuide(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.EditGuide();
}
},
true,
"PATCH",
false
),
DELETE_GUIDE(
new Endpoint() {
public String createUrl(String query) {
return "guides/" + query;
}
public APIEvent<?> parse(String json) throws JSONException {
return null;
//return new APIEvent.CreateGuide().setResult(JSONHelper.parseUserGuide(json));
}
public APIEvent<?> getEvent() {
return null;
// return new APIEvent.CreateGuide();
}
},
true,
"DELETE",
false
),
UPDATE_GUIDE(
new Endpoint() {
public String createUrl(String query) {
return "guides/" + query;
}
public APIEvent<?> parse(String json) throws JSONException {
return null;
//return new APIEvent.CreateGuide().setResult(JSONHelper.parseUserGuide(json));
}
public APIEvent<?> getEvent() {
return null;
// return new APIEvent.CreateGuide();
}
},
true,
"PATCH",
false
),
PUBLISH_GUIDE(
new Endpoint() {
public String createUrl(String query) {
return "guides/" + query + "/public";
}
public APIEvent<?> parse(String json) throws JSONException {
return null;
//return new APIEvent.CreateGuide().setResult(JSONHelper.parseUserGuide(json));
}
public APIEvent<?> getEvent() {
return null;
// return new APIEvent.CreateGuide();
}
},
true,
"PUT",
false
),
UNPUBLISH_GUIDE(
new Endpoint() {
public String createUrl(String query) {
return "guides/" + query + "/public";
}
public APIEvent<?> parse(String json) throws JSONException {
return null;
//return new APIEvent.CreateGuide().setResult(JSONHelper.parseUserGuide(json));
}
public APIEvent<?> getEvent() {
return null;
// return new APIEvent.CreateGuide();
}
},
true,
"DELETE",
false
),
REORDER_GUIDE_STEPS(
new Endpoint() {
public String createUrl(String query) {
return "guides/" + query + "/steporder";
}
public APIEvent<?> parse(String json) throws JSONException {
return null;
//return new APIEvent.CreateGuide().setResult(JSONHelper.parseUserGuide(json));
}
public APIEvent<?> getEvent() {
return null;
// return new APIEvent.CreateGuide();
}
},
true,
"PUT",
false
),
UPDATE_GUIDE_STEP(
new Endpoint() {
public String createUrl(String query) {
return "guides/" + query;
}
public APIEvent<?> parse(String json) throws JSONException {
return null;
//return new APIEvent.CreateGuide().setResult(JSONHelper.parseUserGuide(json));
}
public APIEvent<?> getEvent() {
return null;
// return new APIEvent.CreateGuide();
}
},
true,
"PATCH",
false
),
SITES(
new Endpoint() {
public String createUrl(String query) {
return "sites?limit=1000";
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.Sites().setResult(JSONHelper.parseSites(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.Sites();
}
},
false,
"GET",
false
),
USER_INFO(
new Endpoint() {
public String createUrl(String query) {
return "user";
}
public APIEvent<?> parse(String json) throws JSONException {
return new APIEvent.UserInfo().setResult(JSONHelper.parseLoginInfo(json));
}
public APIEvent<?> getEvent() {
return new APIEvent.UserInfo();
}
},
false,
"GET",
false
);
/**
* Current version of the API to use.
*/
private static final String API_VERSION = "1.1";
/**
* Defines various methods that each endpoint must provide.
*/
private interface Endpoint {
/**
* Returns the end of a URL that defines this endpoint.
*
* The full URL is then: protocol + domain + "/api/" + api version + "/" + createUrl
*/
public String createUrl(String query);
/**
* Returns an APIEvent given the JSON response of the request.
*/
public APIEvent<?> parse(String json) throws JSONException;
/**
* Returns an empty APIEvent that is used for events for this endpoint.
*
* This is typically used to put errors into so they still get to the right place.
*/
public APIEvent<?> getEvent();
}
/**
* Endpoint's functionality.
*/
private final Endpoint mEndpoint;
/**
* Whether or not this is an authenticated endpoint. If true, sends the
* user's auth token along in a header.
*/
public final boolean mAuthenticated;
/**
* Request method for this endpoint e.g. GET, POST, DELETE
*/
public final String mMethod;
/**
* True if endpoint must be public. This is primarily for login and register so
* users can actually log in without being prompted for login repeatedly.
*/
public final boolean mForcePublic;
private APIEndpoint(Endpoint endpoint, boolean authenticated,
String method, boolean forcePublic) {
mEndpoint = endpoint;
mAuthenticated = authenticated;
mMethod = method;
mForcePublic = forcePublic;
}
/**
* Returns a unique integer for this endpoint.
*
* This value is passed around in Intents to identify what request is being
* made. It will also be used in the database to store results.
*/
protected int getTarget() {
/**
* Just use the enum's unique integer that auto increments from 0.
*/
return ordinal();
}
public String getUrl(Site site) {
return getUrl(site, null);
}
/**
* Returns an absolute URL for this endpoint for the given site and query.
*/
public String getUrl(Site site, String query) {
String domain;
String protocol;
String url;
if (site != null) {
domain = site.mDomain;
} else {
domain = "www.ifixit.com";
}
protocol = "https://";
url = "/api/" + API_VERSION + "/" + mEndpoint.createUrl(query);
return protocol + domain + url;
}
public APIEvent<?> parseResult(String json) throws JSONException {
return mEndpoint.parse(json).setResponse(json);
}
/**
* Returns a "plain" event that is the correct type for this endpoint.
*/
public APIEvent<?> getEvent() {
return mEndpoint.getEvent();
}
public static APIEndpoint getByTarget(int target) {
for (APIEndpoint endpoint : APIEndpoint.values()) {
if (endpoint.ordinal() == target) {
return endpoint;
}
}
return null;
}
public String toString() {
return mAuthenticated + " | " + ordinal();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
bfd36a5842e1da6cdb3074c55c70d9c819ba5a54 | 56ae790ef1b0a65643a5e8c7e14a6f5d2e88cbdd | /ged/web/src/main/java/com/t2tierp/model/bean/tributacao/TributPisCodApuracao.java | e82914a5ec70b70bed68b3a94a34d33d7080c08b | [
"MIT"
] | permissive | herculeshssj/T2Ti-ERP-2.0-Java-WEB | 6751db19b82954116f855fe107c4ac188524d7d5 | 275205e05a0522a2ba9c36d36ba577230e083e72 | refs/heads/master | 2023-01-04T21:06:24.175662 | 2020-10-30T11:00:46 | 2020-10-30T11:00:46 | 286,570,333 | 0 | 0 | null | 2020-08-10T20:16:56 | 2020-08-10T20:16:56 | null | UTF-8 | Java | false | false | 4,923 | java | /*
* The MIT License
*
* Copyright: Copyright (C) 2014 T2Ti.COM
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* The author may be contacted at: t2ti.com@gmail.com
*
* @author Claudio de Barros (T2Ti.com)
* @version 2.0
*/
package com.t2tierp.model.bean.tributacao;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "TRIBUT_PIS_COD_APURACAO")
public class TributPisCodApuracao implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "ID")
private Integer id;
@Column(name = "CST_PIS")
private String cstPis;
@Column(name = "EFD_TABELA_435")
private String efdTabela435;
@Column(name = "MODALIDADE_BASE_CALCULO")
private String modalidadeBaseCalculo;
@Column(name = "PORCENTO_BASE_CALCULO")
private BigDecimal porcentoBaseCalculo;
@Column(name = "ALIQUOTA_PORCENTO")
private BigDecimal aliquotaPorcento;
@Column(name = "ALIQUOTA_UNIDADE")
private BigDecimal aliquotaUnidade;
@Column(name = "VALOR_PRECO_MAXIMO")
private BigDecimal valorPrecoMaximo;
@Column(name = "VALOR_PAUTA_FISCAL")
private BigDecimal valorPautaFiscal;
@JoinColumn(name = "ID_TRIBUT_CONFIGURA_OF_GT", referencedColumnName = "ID")
@ManyToOne(optional = false)
private TributConfiguraOfGt tributConfiguraOfGt;
public TributPisCodApuracao() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCstPis() {
return cstPis;
}
public void setCstPis(String cstPis) {
this.cstPis = cstPis;
}
public String getEfdTabela435() {
return efdTabela435;
}
public void setEfdTabela435(String efdTabela435) {
this.efdTabela435 = efdTabela435;
}
public String getModalidadeBaseCalculo() {
return modalidadeBaseCalculo;
}
public void setModalidadeBaseCalculo(String modalidadeBaseCalculo) {
this.modalidadeBaseCalculo = modalidadeBaseCalculo;
}
public BigDecimal getPorcentoBaseCalculo() {
return porcentoBaseCalculo;
}
public void setPorcentoBaseCalculo(BigDecimal porcentoBaseCalculo) {
this.porcentoBaseCalculo = porcentoBaseCalculo;
}
public BigDecimal getAliquotaPorcento() {
return aliquotaPorcento;
}
public void setAliquotaPorcento(BigDecimal aliquotaPorcento) {
this.aliquotaPorcento = aliquotaPorcento;
}
public BigDecimal getAliquotaUnidade() {
return aliquotaUnidade;
}
public void setAliquotaUnidade(BigDecimal aliquotaUnidade) {
this.aliquotaUnidade = aliquotaUnidade;
}
public BigDecimal getValorPrecoMaximo() {
return valorPrecoMaximo;
}
public void setValorPrecoMaximo(BigDecimal valorPrecoMaximo) {
this.valorPrecoMaximo = valorPrecoMaximo;
}
public BigDecimal getValorPautaFiscal() {
return valorPautaFiscal;
}
public void setValorPautaFiscal(BigDecimal valorPautaFiscal) {
this.valorPautaFiscal = valorPautaFiscal;
}
public TributConfiguraOfGt getTributConfiguraOfGt() {
return tributConfiguraOfGt;
}
public void setTributConfiguraOfGt(TributConfiguraOfGt tributConfiguraOfGt) {
this.tributConfiguraOfGt = tributConfiguraOfGt;
}
@Override
public String toString() {
return "com.t2tierp.model.bean.tributacao.TributPisCodApuracao[id=" + id + "]";
}
}
| [
"claudiobsi@gmail.com"
] | claudiobsi@gmail.com |
f14024894c513fea64fe77087d80229b9b40898a | f0d4e76b473925dfae973bc8f01a6a4d3adec436 | /characterTests/BastyaTest.java | 139a5b765ea5c7ca1efc3e69cc344a380ae3d171 | [] | no_license | balazsderwolf/Chess_Game_project | d7e73a503035fe27b1374d2e18d5138ddf457543 | 0a820af5304af9ed3f709740248fa7513ddee3c4 | refs/heads/main | 2023-05-28T21:50:07.896020 | 2021-06-09T21:02:23 | 2021-06-09T21:02:23 | 371,077,396 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 363 | java | package com.company.characterTests;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class BastyaTest {
@BeforeEach
void setUp() {
}
@AfterEach
void tearDown() {
}
@Test
void validateRequestedMove() {
}
} | [
"72218495+balazsderwolf@users.noreply.github.com"
] | 72218495+balazsderwolf@users.noreply.github.com |
9ea68edbff5015c792e46616a2322ce29aaafdbc | 474a1246d11f3cf962f8fa72c0776f1e74ee68d8 | /adt/src/test/java/ch/qos/ringBuffer/JCtoolsTBTest.java | 93084c763bd7b8cfa9eeea80f2e50ace2d9683a4 | [] | no_license | ceki/trie2 | 051577e66fb6586575ee4cecc24a0477b68f720c | 771aff7d7d0fb66c745e1b2530e9d9d90d990f80 | refs/heads/master | 2022-01-29T12:47:47.352669 | 2022-01-17T18:52:43 | 2022-01-17T18:52:43 | 10,791,540 | 2 | 1 | null | 2022-01-17T18:44:29 | 2013-06-19T12:34:13 | Java | UTF-8 | Java | false | false | 329 | java | package ch.qos.ringBuffer;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class JCtoolsTBTest {
JCToolsRB<Integer> jctoolsRB = new JCToolsRB<>(16);
@Test
public void smokeABQ() {
jctoolsRB.put(1);
Integer val = jctoolsRB.take();
Integer expected = 1;
assertEquals(expected, val);
}
}
| [
"ceki@qos.ch"
] | ceki@qos.ch |
a660928f944a7087f6b69aa31d6414e19d727dd2 | c0df9bf54f9b99515905698e98836c7b89ef499c | /src/main/java/com/test/org/pojo/QaContent.java | ff555d349c6c2b8721c6298568614265e21604c9 | [
"MIT"
] | permissive | cytzrs/mybatisDemo | 6c2d984d5627158d5a0269dbef74898361322bf8 | 94f102aaf9d90ab629d86db16add74a0a009219b | refs/heads/master | 2021-01-19T05:46:30.732501 | 2017-10-20T07:36:14 | 2017-10-20T07:36:14 | 87,447,749 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,837 | java | package com.test.org.pojo;
import java.util.Date;
public class QaContent {
private String id;
private String creatorId;
private String parentId;
private String regionId;
private String regionName;
private Byte hasAttachment;
private String type;
private Long forwardCount;
private Integer concernCount;
private Integer likeCount;
private Integer replyCount;
private Byte isForward;
private String forwardPostId;
private Byte isBestPost;
private String aliveFlag;
private String marketId;
private String updateUser;
private Date updateDate;
private String createUser;
private Date createDate;
private String ext1;
private String ext2;
private String ext3;
private String ext4;
private String ext5;
private String ext6;
private String ext7;
private String ext8;
private String ext9;
private String ext10;
private String postParentId;
private String browseCount;
private String isShare;
private String shareUrl;
private Integer isAsker;
private Boolean isRecommend;
private Date verfiyDate;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCreatorId() {
return creatorId;
}
public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getRegionId() {
return regionId;
}
public void setRegionId(String regionId) {
this.regionId = regionId;
}
public String getRegionName() {
return regionName;
}
public void setRegionName(String regionName) {
this.regionName = regionName;
}
public Byte getHasAttachment() {
return hasAttachment;
}
public void setHasAttachment(Byte hasAttachment) {
this.hasAttachment = hasAttachment;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Long getForwardCount() {
return forwardCount;
}
public void setForwardCount(Long forwardCount) {
this.forwardCount = forwardCount;
}
public Integer getConcernCount() {
return concernCount;
}
public void setConcernCount(Integer concernCount) {
this.concernCount = concernCount;
}
public Integer getLikeCount() {
return likeCount;
}
public void setLikeCount(Integer likeCount) {
this.likeCount = likeCount;
}
public Integer getReplyCount() {
return replyCount;
}
public void setReplyCount(Integer replyCount) {
this.replyCount = replyCount;
}
public Byte getIsForward() {
return isForward;
}
public void setIsForward(Byte isForward) {
this.isForward = isForward;
}
public String getForwardPostId() {
return forwardPostId;
}
public void setForwardPostId(String forwardPostId) {
this.forwardPostId = forwardPostId;
}
public Byte getIsBestPost() {
return isBestPost;
}
public void setIsBestPost(Byte isBestPost) {
this.isBestPost = isBestPost;
}
public String getAliveFlag() {
return aliveFlag;
}
public void setAliveFlag(String aliveFlag) {
this.aliveFlag = aliveFlag;
}
public String getMarketId() {
return marketId;
}
public void setMarketId(String marketId) {
this.marketId = marketId;
}
public String getUpdateUser() {
return updateUser;
}
public void setUpdateUser(String updateUser) {
this.updateUser = updateUser;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
public String getExt4() {
return ext4;
}
public void setExt4(String ext4) {
this.ext4 = ext4;
}
public String getExt5() {
return ext5;
}
public void setExt5(String ext5) {
this.ext5 = ext5;
}
public String getExt6() {
return ext6;
}
public void setExt6(String ext6) {
this.ext6 = ext6;
}
public String getExt7() {
return ext7;
}
public void setExt7(String ext7) {
this.ext7 = ext7;
}
public String getExt8() {
return ext8;
}
public void setExt8(String ext8) {
this.ext8 = ext8;
}
public String getExt9() {
return ext9;
}
public void setExt9(String ext9) {
this.ext9 = ext9;
}
public String getExt10() {
return ext10;
}
public void setExt10(String ext10) {
this.ext10 = ext10;
}
public String getPostParentId() {
return postParentId;
}
public void setPostParentId(String postParentId) {
this.postParentId = postParentId;
}
public String getBrowseCount() {
return browseCount;
}
public void setBrowseCount(String browseCount) {
this.browseCount = browseCount;
}
public String getIsShare() {
return isShare;
}
public void setIsShare(String isShare) {
this.isShare = isShare;
}
public String getShareUrl() {
return shareUrl;
}
public void setShareUrl(String shareUrl) {
this.shareUrl = shareUrl;
}
public Integer getIsAsker() {
return isAsker;
}
public void setIsAsker(Integer isAsker) {
this.isAsker = isAsker;
}
public Boolean getIsRecommend() {
return isRecommend;
}
public void setIsRecommend(Boolean isRecommend) {
this.isRecommend = isRecommend;
}
public Date getVerfiyDate() {
return verfiyDate;
}
public void setVerfiyDate(Date verfiyDate) {
this.verfiyDate = verfiyDate;
}
} | [
"Bldz@lyang"
] | Bldz@lyang |
193923edfe71cbb3ccb1fbb5ed0e442e441e49d8 | 69cf1ba5d69a5f963f2d759ec8f8b9d9f17fd7e7 | /service/service-edu/src/main/java/com/atguigu/serviceedu/service/EduCourseDescriptionService.java | 57243b43f92b3489fa2216687b8ae8a792eb634c | [
"Apache-2.0"
] | permissive | chencong888/guli-parent | 30b3865ce60925e844301265906963d96ea42748 | 24c7b3396920f9b72c8a6fa321f7bab448ece8d6 | refs/heads/master | 2023-04-29T16:11:31.185163 | 2021-05-17T09:04:27 | 2021-05-17T09:04:27 | 367,832,881 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 342 | java | package com.atguigu.serviceedu.service;
import com.atguigu.serviceedu.entity.EduCourseDescription;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 课程简介 服务类
* </p>
*
* @author atguigu
* @since 2021-05-10
*/
public interface EduCourseDescriptionService extends IService<EduCourseDescription> {
}
| [
"86768998@qq.com"
] | 86768998@qq.com |
99d1e33051119073b0c9c09d37c2fc8c5fb1d84c | 58ce44ff5fcc13be7876dd903e700b5be989ab19 | /JavaWork/Jungol_기초다지기/src/입력/자가진단01/Main.java | 984671e542ba598b5d1747eb43c2db38d6f2cb4f | [] | no_license | binna/full-stack | eb78836414a8d60d5dc5e78f5abc57b9348af48d | 9e6990e1ce7eff8a515603b1cd71b25660b40f80 | refs/heads/main | 2023-04-23T08:50:52.441080 | 2021-05-15T15:33:05 | 2021-05-15T15:33:05 | 320,798,523 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 152 | java | package 입력.자가진단01;
public class Main {
public static void main(String[] args) {
int num = -100;
System.out.println(num);
}
} | [
"every5116@naver.com"
] | every5116@naver.com |
9270042d065f606c23497c0a25425e0ccdbea87c | 91c7c1ae36a2b37d68e90a809e6148bb8ef38086 | /app/src/main/java/com/dictionary/dictionary/RestApi/RestApiClient.java | d96fb59b3e69eeba43e1e56ab4d7b0757ef07518 | [] | no_license | merveyavuz/DictionaryApp | 0045f0927428a0c5570b18e457fba224c35b25ee | b3362d444ee2ff2b92be256228ea0652dd1c753d | refs/heads/master | 2022-02-04T16:22:17.494211 | 2019-08-08T10:33:04 | 2019-08-08T10:33:04 | 201,235,872 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 930 | java | package com.dictionary.dictionary.RestApi;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class RestApiClient {
private RestApi mRestApi;
public RestApiClient(String restApiServiceUrl){
OkHttpClient.Builder builder= new OkHttpClient.Builder()
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.connectTimeout(3, TimeUnit.SECONDS);
OkHttpClient okHttpClient= builder.build();
Retrofit retrofit= new Retrofit.Builder()
.baseUrl(restApiServiceUrl)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create())
.build();
mRestApi=retrofit.create(RestApi.class);
}
public RestApi getRestApi(){
return mRestApi;
}
}
| [
"myavuz-53@hotmail.com"
] | myavuz-53@hotmail.com |
8ae025f9936588232bc61422e4d2ad806760b808 | ac71ed51c5a314c20cb384bec6bcd407d779e3c0 | /target/scala-2.11/classes/edu/nyu/oop/util/JavaFiveImportParser.java | 119aeb85f22236d523cdf47aebc8aedf5ff05fe7 | [] | no_license | liamlin1230/Java-to-CPP | 1f9bf9fa032194e1d24e18f23fe97f4ee383b6b0 | 7f4a5b962245517d4146c9ec0ed7beaa7aea842f | refs/heads/master | 2021-07-08T06:20:41.433066 | 2017-10-06T07:20:04 | 2017-10-06T07:20:04 | 105,977,272 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,208 | java | package edu.nyu.oop.util;
import org.slf4j.Logger;
import xtc.parser.ParseException;
import xtc.tree.Node;
import xtc.tree.GNode;
import xtc.tree.Visitor;
import java.io.*;
import java.util.Set;
import java.util.HashSet;
import java.util.List;
import java.util.LinkedList;
/**
* This is a utility class which will load the source files for anything referenced by the primary source.
* Note that it does *not* do this recursively. In other words, it will not return nodes representing the
* dependencies of the dependencies. You can obviously do that yourself using this class if necessary.
*
* It will look for the files in the locations specified in xtc.properties's input.locations property.
* If you have two packages named the same thing under more than one input location, it will return
* which ever one it finds first.
*/
public class JavaFiveImportParser {
private static Logger logger = org.slf4j.LoggerFactory.getLogger(JavaFiveImportParser.class);
private static List<String> inputLocations = loadInputLocations();
public static List<GNode> parse(final GNode primarySrc) {
final List<GNode> importedSources = new LinkedList<GNode>();
new Visitor() {
public void visitPackageDeclaration(GNode node) throws IOException, ParseException {
String relPath = NodeUtil.mkString(node.getNode(1), File.separator);
importedSources.addAll(loadNodesFromDirectory(relPath));
}
public void visitImportDeclaration(GNode node) {
if (node.getString(2) == null) { // There is no '*' character in the import, import single file.
String relPath = NodeUtil.mkString(node.getNode(1), File.separator) + ".java";
importedSources.add(loadNodeForFile(relPath));
} else {
String relPath = NodeUtil.mkString(node.getNode(1), File.separator);
importedSources.addAll(loadNodesFromDirectory(relPath));
}
}
public void visit(Node n) {
for (Object o : n) if (o instanceof Node) dispatch((Node) o);
}
private GNode loadNodeForFile(String relPath) {
GNode source = null;
for(String l : inputLocations) {
String absPath = System.getProperty("user.dir") + File.separator + l + File.separator + relPath;
File f = loadSourceFile(absPath);
if(f != null) {
source = (GNode) NodeUtil.parseJavaFile(f);
break;
}
}
if(source == null) {
logger.warn("Unable to find any source file for path " + relPath);
}
return source;
}
private List<GNode> loadNodesFromDirectory(String relPath) {
List<GNode> sources = new LinkedList<GNode>();
for(String l : inputLocations) {
String absPath = System.getProperty("user.dir") + File.separator + l + File.separator + relPath;
Set<File> files = loadFilesInDirectory(absPath);
if(files != null) {
for(File f : files) {
GNode n = (GNode) NodeUtil.parseJavaFile(f);
if(!n.equals(primarySrc)) sources.add(n); // Don't include the primary source.
}
break; // stop at the first input location containing the package of the primary source
}
}
return sources;
}
} .dispatch(primarySrc);
return importedSources;
}
private static Set<File> loadFilesInDirectory(String path) {
File[] directory = new File(path).listFiles();
if(directory == null) {
logger.debug("Did not find a directory at " + path);
return null;
}
Set<File> files = new HashSet<File>();
for(File f : new File(path).listFiles()) {
File source = loadSourceFile(f.getAbsolutePath());
if(source != null) files.add(source);
}
if (files.size() == 0) {
logger.warn("Path with no source files. " + path);
return null;
}
return files;
}
private static File loadSourceFile(String path) {
File f = new File(path);
if(f == null) {
logger.warn("Invalid path provided for file. " + path);
return null;
}
if(f.isFile() && f.getName().endsWith(".java")) {
logger.debug("Loading " + f.getName());
return f;
} else {
return null;
}
}
private static List<String> loadInputLocations() {
// Load input locations with correct file separator for system
List<String> inputLocations = new LinkedList<String>();
for (String l : XtcProps.getList("input.locations")) {
inputLocations.add(l.replaceAll("/", "\\" + File.separator));
}
return inputLocations;
}
}
| [
"ygl209@nyu.edu"
] | ygl209@nyu.edu |
27c2c008fa261e5401f79eef77a7248e94eb8a1e | 23814daa89f2df669e327b3f7d90af4fb63c435c | /app/src/main/java/beerly/ansteph/beerlybiz/utils/RandomStringUtils.java | 3ccd8fb73d96ab7ceb170d2d0ed77ae77cd9de59 | [] | no_license | LoicAN/BeerlyBiz | 447f9bc569c388ea79849a6db59c560a235d4f4e | 4f4c784d7572cd91e6b73bd432004a5ba5f60f38 | refs/heads/master | 2020-05-26T11:59:56.934903 | 2019-05-23T11:59:31 | 2019-05-23T11:59:31 | 188,225,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,641 | java | package beerly.ansteph.beerlybiz.utils;
import java.security.SecureRandom;
import java.util.Locale;
import java.util.Objects;
import java.util.Random;
/**
* Created by loicstephan on 2017/11/27.
*/
public class RandomStringUtils {
/**
* Generate a random string.
*/
public String nextString() {
for (int idx = 0; idx < buf.length; ++idx)
buf[idx] = symbols[random.nextInt(symbols.length)];
return new String(buf);
}
public static final String upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
public static final String lower = upper.toLowerCase(Locale.ROOT);
public static final String digits = "0123456789";
public static final String alphanum = upper + lower + digits;
private final Random random;
private final char[] symbols;
private final char[] buf;
public RandomStringUtils(int length, Random random, String symbols) {
if (length < 1) throw new IllegalArgumentException();
if (symbols.length() < 2) throw new IllegalArgumentException();
this.random = Objects.requireNonNull(random);
this.symbols = symbols.toCharArray();
this.buf = new char[length];
}
/**
* Create an alphanumeric string generator.
*/
public RandomStringUtils(int length, Random random) {
this(length, random, alphanum);
}
/**
* Create an alphanumeric strings from a secure generator.
*/
public RandomStringUtils(int length) {
this(length, new SecureRandom());
}
/**
* Create session identifiers.
*/
public RandomStringUtils() {
this(21);
}
}
| [
"loic.ndame@superbalist.com"
] | loic.ndame@superbalist.com |
834dd9ae7708309d93b0bb62df60e61dc81beba9 | d8f838d2c4f66a6c930f062a865ac14cb22c5e0b | /java8fundamentals/app/elly/c/ch5/FlowEx3_2.java | 60e8150df038e2477578a98c7fe60680e70fd3a0 | [] | no_license | dachaja/hookeycamp | 3ff4f91cede8b45bb79e077b7bbbbc3d1df4b6c3 | 13bf00dba73f730f4ca457320369c56104f3c2af | refs/heads/master | 2021-01-21T04:27:31.867051 | 2016-04-10T03:30:54 | 2016-04-10T03:30:54 | 34,712,772 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | package elly.c.ch5;
public class FlowEx3_2 {
public static void main(String[] args) {
int score = 99;
String grade = "";
if(score <= 100 && score >= 98) {
grade = "+A";
} else if(score <= 97 && score >= 94) {
grade = "A";
} else if(score <= 93 && score >= 90) {
grade = "-A";
} else if(score <= 89 && score >= 88) {
grade = "+B";
} else if(score <= 87 && score >= 84) {
grade = "B";
} else if(score <= 83 && score >= 80) {
grade = "-B";
} else {
grade = "c";
}
}
}
| [
"click373@gmail.com"
] | click373@gmail.com |
5682797cda73dc98dda200654f6494e60022e348 | d1199af17c9a3061be50b0f167ff2afa0e943004 | /FastBiz/core/com/fastbiz/core/web/spring/security/authentication/MultiTenantAuthentication.java | 7535566a8af693134b30749708abfc8aee4b131e | [] | no_license | sala223/FastBiz | 7259bdbf3ee46f6c26d5bc67c276e030e49c4305 | 031b445f3b11ac38f594aad48ad6557ae356031d | refs/heads/master | 2021-01-19T21:28:30.434797 | 2012-12-18T11:24:14 | 2012-12-18T11:24:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 232 | java | package com.fastbiz.core.web.spring.security.authentication;
import org.springframework.security.core.Authentication;
public interface MultiTenantAuthentication extends Authentication{
public String getTenantId();
}
| [
"sala223@msn.com"
] | sala223@msn.com |
99e822fbbbec6c32efac384e46aa4f3847947fa4 | 00b1c96ed7c023606f70f9d3d52499f152a59cde | /CameraDemo/popupbar/src/main/java/com/example/liuxiangfeng/popupbar/ModeOptions.java | 51c8818c73de25379b0b0a60759d3b63cb958412 | [] | no_license | pinguo-liuxiangfeng/Camera_Demo | 82ec5d7c95f5d5205ec1d7fe5cf99628c7cb510d | 418863f382da650c64810c623b1708a49af19f01 | refs/heads/master | 2021-01-20T08:48:59.746497 | 2015-06-03T09:19:55 | 2015-06-03T09:19:55 | 28,850,208 | 0 | 0 | null | 2015-03-10T10:35:41 | 2015-01-06T06:33:08 | Java | UTF-8 | Java | false | false | 13,536 | java | /*
* Copyright (C) 2014 The Android Open Source Project
*
* 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.example.liuxiangfeng.popupbar;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import java.util.ArrayList;
public class ModeOptions extends FrameLayout {
private int mBackgroundColor;
private final Paint mPaint = new Paint();
private boolean mIsHiddenOrHiding;
private RectF mAnimateFrom = new RectF();
private View mViewToShowHide;
private TopRightWeightedLayout mModeOptionsButtons;
private RadioOptions mModeOptionsPano;
private RadioOptions mModeOptionsExposure;
private AnimatorSet mVisibleAnimator;
private AnimatorSet mHiddenAnimator;
private boolean mDrawCircle;
private boolean mFill;
private static final int RADIUS_ANIMATION_TIME = 250;
private static final int SHOW_ALPHA_ANIMATION_TIME = 350;
private static final int HIDE_ALPHA_ANIMATION_TIME = 200;
private static final int PADDING_ANIMATION_TIME = 350;
private ViewGroup mMainBar;
private ViewGroup mActiveBar;
public static final int BAR_INVALID = -1;
public static final int BAR_STANDARD = 0;
public static final int BAR_PANO = 1;
private boolean mIsPortrait;
private float mRadius = 0f;
public ModeOptions(Context context, AttributeSet attrs) {
super(context, attrs);
}
public void setViewToShowHide(View v) {
mViewToShowHide = v;
}
@Override
public void onFinishInflate() {
mIsHiddenOrHiding = true;
mBackgroundColor = getResources().getColor(R.color.mode_options_background);
mPaint.setAntiAlias(true);
mPaint.setColor(mBackgroundColor);
mModeOptionsButtons = (TopRightWeightedLayout) findViewById(R.id.mode_options_buttons);
mModeOptionsPano = (RadioOptions) findViewById(R.id.mode_options_pano);
mModeOptionsExposure = (RadioOptions) findViewById(R.id.mode_options_exposure);
mMainBar = mActiveBar = mModeOptionsButtons;
ImageButton exposureButton = (ImageButton) findViewById(R.id.exposure_button);
exposureButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mActiveBar = mModeOptionsExposure;
mMainBar.setVisibility(View.INVISIBLE);
mActiveBar.setVisibility(View.VISIBLE);
}
});
}
public void setMainBar(int b) {
for (int i = 0; i < getChildCount(); i++) {
getChildAt(i).setVisibility(View.INVISIBLE);
}
switch (b) {
case BAR_STANDARD:
mMainBar = mActiveBar = mModeOptionsButtons;
break;
case BAR_PANO:
mMainBar = mActiveBar = mModeOptionsPano;
break;
}
mMainBar.setVisibility(View.VISIBLE);
}
public int getMainBar() {
if (mMainBar == mModeOptionsButtons) {
return BAR_STANDARD;
}
if (mMainBar == mModeOptionsPano) {
return BAR_PANO;
}
return BAR_INVALID;
}
@Override
public void onWindowVisibilityChanged(int visibility) {
super.onWindowVisibilityChanged(visibility);
if (visibility != VISIBLE && !mIsHiddenOrHiding) {
// Collapse mode options when window is not visible.
setVisibility(INVISIBLE);
if (mMainBar != null) {
mMainBar.setVisibility(VISIBLE);
}
if (mActiveBar != null && mActiveBar != mMainBar) {
mActiveBar.setVisibility(INVISIBLE);
}
if (mViewToShowHide != null) {
mViewToShowHide.setVisibility(VISIBLE);
}
mIsHiddenOrHiding = true;
}
}
@Override
public void onLayout(boolean changed, int left, int top, int right, int bottom) {
if (changed) {
mIsPortrait = (getResources().getConfiguration().orientation ==
Configuration.ORIENTATION_PORTRAIT);
int buttonSize = getResources()
.getDimensionPixelSize(R.dimen.option_button_circle_size);
int buttonPadding = getResources()
.getDimensionPixelSize(R.dimen.mode_options_toggle_padding);
float rLeft, rRight, rTop, rBottom;
if (mIsPortrait) {
rLeft = getWidth() - buttonPadding - buttonSize;
rTop = (getHeight() - buttonSize) / 2.0f;
} else {
rLeft = buttonPadding;
rTop = buttonPadding;
}
rRight = rLeft + buttonSize;
rBottom = rTop + buttonSize;
mAnimateFrom.set(rLeft, rTop, rRight, rBottom);
setupAnimators();
setupToggleButtonParams();
}
super.onLayout(changed, left, top, right, bottom);
}
@Override
public void onDraw(Canvas canvas) {
if (mDrawCircle) {
canvas.drawCircle(mAnimateFrom.centerX(), mAnimateFrom.centerY(), mRadius, mPaint);
} else if (mFill) {
canvas.drawPaint(mPaint);
}
super.onDraw(canvas);
}
private void setupToggleButtonParams() {
int size = (mIsPortrait ? getHeight() : getWidth());
for (int i = 0; i < mModeOptionsButtons.getChildCount(); i++) {
View button = mModeOptionsButtons.getChildAt(i);
if (button instanceof MultiToggleImageButton) {
MultiToggleImageButton toggleButton = (MultiToggleImageButton) button;
toggleButton.setParentSize(size);
toggleButton.setAnimDirection(mIsPortrait ?
MultiToggleImageButton.ANIM_DIRECTION_VERTICAL :
MultiToggleImageButton.ANIM_DIRECTION_HORIZONTAL);
}
}
}
private void setupAnimators() {
if (mVisibleAnimator != null) {
mVisibleAnimator.end();
}
if (mHiddenAnimator != null) {
mHiddenAnimator.end();
}
final float fullSize = (mIsPortrait ? (float) getWidth() : (float) getHeight());
// show
{
final ValueAnimator radiusAnimator =
ValueAnimator.ofFloat(mAnimateFrom.width() / 2.0f,
fullSize - mAnimateFrom.width() / 2.0f);
radiusAnimator.setDuration(RADIUS_ANIMATION_TIME);
radiusAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mRadius = (Float) animation.getAnimatedValue();
mDrawCircle = true;
mFill = false;
}
});
radiusAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mDrawCircle = false;
mFill = true;
}
});
final ValueAnimator alphaAnimator = ValueAnimator.ofFloat(0.0f, 1.0f);
alphaAnimator.setDuration(SHOW_ALPHA_ANIMATION_TIME);
alphaAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mActiveBar.setAlpha((Float) animation.getAnimatedValue());
}
});
alphaAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mActiveBar.setAlpha(1.0f);
}
});
final int deltaX = getResources()
.getDimensionPixelSize(R.dimen.mode_options_buttons_anim_delta_x);
int childCount = mActiveBar.getChildCount();
ArrayList<Animator> paddingAnimators = new ArrayList<Animator>();
for (int i = 0; i < childCount; i++) {
final View button;
if (mIsPortrait) {
button = mActiveBar.getChildAt(i);
} else {
button = mActiveBar.getChildAt(childCount-1-i);
}
final ValueAnimator paddingAnimator =
ValueAnimator.ofFloat(deltaX * (childCount - i), 0.0f);
paddingAnimator.setDuration(PADDING_ANIMATION_TIME);
paddingAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
if (mIsPortrait) {
button.setTranslationX((Float) animation.getAnimatedValue());
} else {
button.setTranslationY(-((Float) animation.getAnimatedValue()));
}
invalidate();
}
});
paddingAnimators.add(paddingAnimator);
}
AnimatorSet paddingAnimatorSet = new AnimatorSet();
paddingAnimatorSet.playTogether(paddingAnimators);
mVisibleAnimator = new AnimatorSet();
mVisibleAnimator.setInterpolator(Gusterpolator.INSTANCE);
mVisibleAnimator.playTogether(radiusAnimator, alphaAnimator, paddingAnimatorSet);
}
// hide
{
final ValueAnimator radiusAnimator =
ValueAnimator.ofFloat(fullSize - mAnimateFrom.width() / 2.0f,
mAnimateFrom.width() / 2.0f);
radiusAnimator.setDuration(RADIUS_ANIMATION_TIME);
radiusAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mRadius = (Float) animation.getAnimatedValue();
mDrawCircle = true;
mFill = false;
invalidate();
}
});
radiusAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (mViewToShowHide != null) {
mViewToShowHide.setVisibility(View.VISIBLE);
mDrawCircle = false;
mFill = false;
invalidate();
}
}
});
final ValueAnimator alphaAnimator = ValueAnimator.ofFloat(1.0f, 0.0f);
alphaAnimator.setDuration(HIDE_ALPHA_ANIMATION_TIME);
alphaAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mActiveBar.setAlpha((Float) animation.getAnimatedValue());
invalidate();
}
});
alphaAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
setVisibility(View.INVISIBLE);
if (mActiveBar != mMainBar) {
mActiveBar.setAlpha(1.0f);
mActiveBar.setVisibility(View.INVISIBLE);
}
mMainBar.setAlpha(1.0f);
mMainBar.setVisibility(View.VISIBLE);
mActiveBar = mMainBar;
invalidate();
}
});
mHiddenAnimator = new AnimatorSet();
mHiddenAnimator.setInterpolator(Gusterpolator.INSTANCE);
mHiddenAnimator.playTogether(radiusAnimator, alphaAnimator);
}
}
public void animateVisible() {
if (mIsHiddenOrHiding) {
if (mViewToShowHide != null) {
mViewToShowHide.setVisibility(View.INVISIBLE);
}
mHiddenAnimator.cancel();
mVisibleAnimator.end();
setVisibility(View.VISIBLE);
mVisibleAnimator.start();
}
mIsHiddenOrHiding = false;
}
public void animateHidden() {
if (!mIsHiddenOrHiding) {
mVisibleAnimator.cancel();
mHiddenAnimator.end();
mHiddenAnimator.start();
}
mIsHiddenOrHiding = true;
}
} | [
"liuxiangfeng@camera360.com"
] | liuxiangfeng@camera360.com |
9ee151261a61bf02aa423a05096e5038c27b5adc | 8a64a7b7910bf5679daf0f70fd0ac409df5bad72 | /jspackage-maven-plugin/src/main/java/org/slieb/tools/jspackage/internal/SourceSet.java | 2a5ff553fb583ffa97375d3e370899f8c38ff037 | [] | no_license | StefanLiebenberg/jspackage | e87f95ef2a5ba73f379f2a397064c49660a69467 | e52bae1d8f0236ab40cf4b999cf9a6e9379d25d5 | refs/heads/master | 2021-01-20T09:01:39.140173 | 2016-02-27T10:59:31 | 2016-02-27T10:59:31 | 33,916,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 827 | java | package org.slieb.tools.jspackage.internal;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.Set;
import static java.util.Collections.unmodifiableSet;
import static java.util.Optional.ofNullable;
public interface SourceSet {
@Nonnull
default Set<String> getSources() {
return unmodifiableSet(Collections.emptySet());
}
@Nonnull
default Set<String> getIncludes() {
return unmodifiableSet(Collections.emptySet());
}
@Nonnull
default Set<String> getExcludes() {
return unmodifiableSet(Collections.emptySet());
}
@Nonnull
static Set<String> populatedSetOrEmpty(@Nullable Set<String> sources) {
return unmodifiableSet(ofNullable(sources).orElseGet(Collections::emptySet));
}
}
| [
"siga.fredo@gmail.com"
] | siga.fredo@gmail.com |
102415930d7f8ee9795ffb7cb0cfead241d66dd2 | 8737cccf1bc81a3d70ca1dd0aea4449d9b5237bf | /src/main/java/com/sha/springbootmicroservice1product/security/SecurityConfig.java | 759b3a8d0cab6f5daa41ee8024382f3e50d726b2 | [] | no_license | enalcaci/spring-boot-microservice-1-product | 4ca78cb6d75c61d5ac88e3b34dd8d7486a44a84f | cede046cbfa96d999938b21229bb360c5b9839ec | refs/heads/main | 2023-05-03T23:31:13.213820 | 2021-05-24T14:03:20 | 2021-05-24T14:03:20 | 370,371,717 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,865 | java | package com.sha.springbootmicroservice1product.security;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
//api/product erişim yapmak istiyor ama credential lazım httpFilterlara gelen isteklerin headerlerı kontrol edilir
// username ve password bilgilerini denetler farklı roller için farklı yetkiler
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Value("${service.security.secure-key-username}")
private String SECURE_KEY_USERNAME;
@Value("${service.security.secure-key-password}")
private String SECURE_KEY_PASSWORD;
@Override
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
http.csrf().disable(); //cross side request forgery session kullanarak saldırı cookilere ulaşır
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//bellek için kimlik doğrulama
PasswordEncoder encoder = new BCryptPasswordEncoder(); //güçlü bir hashing sağlar şifreleri açık gösterme
auth.inMemoryAuthentication()
.passwordEncoder(encoder)
.withUser(SECURE_KEY_USERNAME)
.password(encoder.encode(SECURE_KEY_PASSWORD)) //clear text is not secure
.roles("USER");
}
}
| [
"eceenalcaci@yahoo.com"
] | eceenalcaci@yahoo.com |
dd3d54e82e1d0663066b116222434f6666d8fc6f | f208902c4ea0208867a22ef8ce69c1b5f8ad95a0 | /src/test/java/WizardTest.java | 727b89a5c0559ed52dfd5d4480c24877788a94de | [] | no_license | ndvdsn/FantasyLab | 127ce463fe594b7870306bae9d0b954aaf6b3b20 | e9a4a44cd5958df3c3178d26118121b2d4c46b9c | refs/heads/master | 2020-04-07T20:33:50.350310 | 2018-11-22T16:01:39 | 2018-11-22T16:01:39 | 158,693,891 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,092 | java | import Fighters.Dwarf;
import Fighters.Weapons.Club;
import Magicians.Mythicals.Dragon;
import Magicians.Spells.EmilyBronte;
import Magicians.Wizard;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class WizardTest {
Wizard wizard;
Dragon dragon;
EmilyBronte emilyBronte;
Dwarf dwarf;
Club club;
@Before
public void setUp() throws Exception {
dragon = new Dragon(70);
club = new Club(60);
dwarf = new Dwarf("Sleepy", 40, club);
emilyBronte = new EmilyBronte(10);
wizard = new Wizard("Svalbard", 80, dragon, emilyBronte);
}
@Test
public void wizardCanAttackDwarf() {
wizard.attack(dwarf);
assertEquals(35, dwarf.getHealthValue());
}
@Test
public void canGetMythicalCreature(){
assertEquals(dragon, wizard.getMythical());
}
@Test
public void wizardCanBeAttacked() {
dwarf.attack(wizard);
assertEquals(80, wizard.getHealthValue());
assertEquals(10, dragon.getShieldValue());
}
}
| [
"alpha121bravo@gmail.com"
] | alpha121bravo@gmail.com |
7d9cde18fe242deec27f6eff50ac741b81efac32 | d2539195b5c71a059431b37848e330ac7edfb25c | /src/main/java/com/mycompany/webapp/controller/EventController.java | 2e555bd5241104fb34306bc864a38bb4aa43a2a6 | [] | no_license | wwwwoww7/TeamProject | 16debe649fd7b35ea3b045629c48868dfc950af9 | 856ed96aeebad4c4e06b0b341f144b3d767e3458 | refs/heads/master | 2023-06-02T10:21:34.107472 | 2021-06-27T08:39:24 | 2021-06-27T08:39:24 | 313,551,113 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 10,694 | java | package com.mycompany.webapp.controller;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.mycompany.webapp.dto.EventDto;
import com.mycompany.webapp.dto.EventPagerDto;
import com.mycompany.webapp.service.EventService;
/**
* 2020. 11. 17
*
*/
@Controller
@RequestMapping("/event")
//@WebServlet("/event") extends HttpServlet
public class EventController {
private static final Logger logger = LoggerFactory.getLogger(EventController.class);
@InitBinder
protected void initBinder(WebDataBinder binder){
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat,true));
}
/* @GetMapping("/eventList")
public String eventList(String ingend, Model model) {
logger.info("ingend : "+ingend);
if(ingend.equals("ing")) {
model.addAttribute("ingend", "ing");
}else {
model.addAttribute("ingend", "end");
return "event/eventList2";
}
return "event/eventList";
}
*/
@Resource
private EventService service;
/* @GetMapping("/eventList")
public String eventList(int eenable, Model model) {
List<EventDto> all = service.getEventList(eenable);
model.addAttribute("all", all);
return "event/eventList";
}
*/
@GetMapping("/eventList2")
public String eventList2(@RequestParam(defaultValue = "1") int pageNo, int eenable, Model model) {
int totalRows = service.getTotalRows(eenable);
EventPagerDto pager = new EventPagerDto(5, 5, totalRows, pageNo,eenable);
List<EventDto> all2 = service.getEndEventList(pager);
model.addAttribute("all2", all2);
model.addAttribute("pager", pager);
return "event/eventList2";
}
//이벤트 상세페이지 불러오기 (현재 진행중인 페이지)
@GetMapping("/eventDetail")
public String eventDetail(int event_no, Model model) {
EventDto eventD = service.getEventDetail(event_no);
model.addAttribute("eventD", eventD);
return "event/eventDetail";
}
//이벤트 상세페이지 불러오기 (마감된 페이지)
@GetMapping("/eventDetail2")
public String eventDetail2(int event_no, Model model) {
EventDto eventD2 = service.getEventDetail(event_no);
model.addAttribute("eventD", eventD2);
return "event/eventDetail";
}
@GetMapping("/eventList")
public String eventList(@RequestParam(defaultValue = "1") int pageNo, int eenable, Model model) {
int totalRows = service.getTotalRows(eenable);
EventPagerDto pager = new EventPagerDto(5, 5, totalRows, pageNo,eenable);
List<EventDto> all = service.getEventList(pager);
model.addAttribute("all", all);
model.addAttribute("pager", pager);
return "event/eventList";
}
//admin이 들어왔을때만 이벤트 등록 버튼이 보이도록
//이벤트 등록
@GetMapping("/eventWriteForm")
public String eventWriteForm() {
return "event/eventWriteForm";
}
@PostMapping("/eventWriteForm")
public String eventWrite(EventDto event) throws Exception {
logger.info("event.getEventIMG() =========================================="+event.getEventIMG());
logger.info("event.getEventIMG().getOriginalFilename() =========================================="+event.getEventIMG().getOriginalFilename());
if(!event.getEventIMG().isEmpty() && !event.getEventIMGDetail().isEmpty()) {
//썸네일 저장
String originalFileName = event.getEventIMG().getOriginalFilename();
/*String extName = originalFileName.substring(originalFileName.lastIndexOf("."));*/
String saveName = event.getEvent_no()+"_"+originalFileName;
File dest = new File("D:/MyWorkspace/event/thum/" + saveName);
event.getEventIMG().transferTo(dest);
event.setEvent_img(saveName);
//상세이미지 저장
String originalFileNameDetail = event.getEventIMGDetail().getOriginalFilename();
/*String extNameDetail = originalFileNameDetail.substring(originalFileNameDetail.lastIndexOf("."));*/
String saveNameDetail = event.getEvent_no()+"_"+originalFileNameDetail;
File destDetail = new File("D:/MyWorkspace/event/detail/"+ saveNameDetail);
event.getEventIMGDetail().transferTo(destDetail);
event.setEvent_detail(saveNameDetail);
} /*else {
event.setEvent_img("unnamed.png");
}*/
service.eventWrite(event);
return "redirect:/event";
}
//이벤트 수정
@GetMapping("/eventUpdateForm")
public String eventUpdateForm(int event_no, Model model) {
EventDto event = service.getevent(event_no);
model.addAttribute("event", event);
return "event/eventUpdateForm";
}
@PostMapping("/eventUpdate")
public String eventUpdate (EventDto event, HttpServletResponse response,Model model) throws IOException {
if(!event.getEventIMG().isEmpty() && !event.getEventIMGDetail().isEmpty()) {
//썸네일 저장
String originalFileName = event.getEventIMG().getOriginalFilename();
/*String extName = originalFileName.substring(originalFileName.lastIndexOf("."));*/
String saveName = event.getEvent_no()+"_"+originalFileName;
File dest = new File("D:/MyWorkspace/event/thum/" + saveName);
event.getEventIMG().transferTo(dest);
event.setEvent_img(saveName);
//상세이미지 저장
String originalFileNameDetail = event.getEventIMGDetail().getOriginalFilename();
/*String extNameDetail = originalFileNameDetail.substring(originalFileNameDetail.lastIndexOf("."));*/
String saveNameDetail = event.getEvent_no()+"_"+originalFileNameDetail;
File destDetail = new File("D:/MyWorkspace/event/detail/"+ saveNameDetail);
event.getEventIMGDetail().transferTo(destDetail);
event.setEvent_detail(saveNameDetail);
}
//서비스를 이용해서 게시물 수정
int res = service.eventUpdate(event);
if (res == 0) {
logger.info("이벤트 수정 실패");
}
EventDto eventD = service.getEventDetail(event.getEvent_no());
model.addAttribute("eventD", eventD);
return "event/eventDetail";
}
@RequestMapping("/eventDetailDownload")
public void myphotoDownload(String event_detail,HttpServletResponse response, HttpServletRequest request) throws Exception{
String fileName = event_detail;
//파일의 데이터를 읽기 위한 입력 스트림 얻기
String saveFilePath = "D:/MyWorkspace/event/detail/" + fileName;
InputStream is = new FileInputStream(saveFilePath);
//응답 HTTP 헤더 구성
//1)Content-Type 헤더 구성(파일의 종류 지정)
ServletContext application = request.getServletContext();
String fileType = application.getMimeType(fileName); //fileName의 확장명을 알려줌.
response.setContentType(fileType);
//2)Content-Disposition 헤더 구성(다운로드할 파일의 이름을 지정)
//한글을 변환해서 넣어야함.한글을 아스키로 바꿔준다.브라우저마다 한글변환방식이다르지만 최신브라우저는 거의 다 이거.
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); //실제 다운로드되는 파일의 이름이 들어간다. 파일이름에 한글이 포함되어있으면 한글이 꺠진다.
//3)Content-Length 헤더 구성(다운로드 할 파일의 크기를 지정)
int fileSize = (int)new File(saveFilePath).length(); //file size를 얻을 수 있음. long size임.
response.setContentLength(fileSize);
//응답 HTTP의 본문(바디) 구성
//본문은 철저하게 출력으로 처리한다.
OutputStream os = response.getOutputStream();//파일이니까 outputstream
FileCopyUtils.copy(is, os);
os.flush();
os.close();
is.close();
}
@RequestMapping("/event_imgDownload")
public void eventDownload(String event_img, HttpServletResponse response, HttpServletRequest request) throws Exception{
String fileName = event_img;
//파일의 데이터를 읽기 위한 입력 스트림 얻기
String saveFilePath = "D:/MyWorkspace/event/thum/" + fileName;
InputStream is = new FileInputStream(saveFilePath);
//응답 HTTP 헤더 구성
//1)Content-Type 헤더 구성(파일의 종류 지정)
ServletContext application = request.getServletContext();
String fileType = application.getMimeType(fileName); //fileName의 확장명을 알려줌.
response.setContentType(fileType);
//2)Content-Disposition 헤더 구성(다운로드할 파일의 이름을 지정)
//한글을 변환해서 넣어야함.한글을 아스키로 바꿔준다.브라우저마다 한글변환방식이다르지만 최신브라우저는 거의 다 이거.
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); //실제 다운로드되는 파일의 이름이 들어간다. 파일이름에 한글이 포함되어있으면 한글이 꺠진다.
//3)Content-Length 헤더 구성(다운로드 할 파일의 크기를 지정)
int fileSize = (int)new File(saveFilePath).length(); //file size를 얻을 수 있음. long size임.
response.setContentLength(fileSize);
//응답 HTTP의 본문(바디) 구성
//본문은 철저하게 출력으로 처리한다.
OutputStream os = response.getOutputStream();//파일이니까 outputstream
FileCopyUtils.copy(is, os);
os.flush();
os.close();
is.close();
}
@GetMapping("/eventDelete")
public String eventDelete(int event_no) throws Exception {
//서비스를 이용해서 게시물 삭제
int res=service.eventDelete(event_no);
if(res ==0) {
logger.info("이벤트 삭제 실~~~패~~~");
}
return "redirect:/event";
}
}
| [
"COM@DESKTOP-TH36TT5"
] | COM@DESKTOP-TH36TT5 |
4718b6252ede123386c6ebc36489876829aeb378 | 445834c90dd41b51b1140139b6335e51da1e9e2d | /scanAttendeeTablet/scanAttendeeTablet/src/main/java/com/globalnest/classes/TokenTextview.java | fdf652ff10e8fa547dd22d170d445c63c3d073df | [] | no_license | sailakshmi45/ScanAttendee-ScanAttendee-Main-Branch | dc81a9e94029665f95098f7b9b536beacd2c9346 | 5269c34430f08c30683830d21914d559bd0d6c5f | refs/heads/master | 2023-05-27T22:19:17.642176 | 2021-06-10T10:28:47 | 2021-06-10T10:28:47 | 375,638,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 627 | java | package com.globalnest.classes;
import android.content.Context;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;
import com.globalnest.scanattendee.R;
public class TokenTextview extends AppCompatTextView {
public TokenTextview(Context context) {
super(context);
}
public TokenTextview(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public void setSelected(boolean selected) {
super.setSelected(selected);
setCompoundDrawablesWithIntrinsicBounds(0, 0, selected ? R.drawable.img_cross : 0, 0);
}
}
| [
"sailakshmi.c@globalnest.com"
] | sailakshmi.c@globalnest.com |
e9a0605ac44416f5473e82b69c326a9b9a61bafd | a23f160cb964674da1b4b2875a5821d2a46f6bf2 | /FewSimpleTasks/zadatak2/VehicleType.java | d98a3f5a2f8e2ba08b82c2b636b9463b6547ae6e | [] | no_license | Mario173/Java-study | 2e1f7107b335882bebf034698936d2fb118ec041 | 078bf4f6b4ea1be6d1cbc6a0a32c17bafcebd6db | refs/heads/main | 2023-06-15T03:43:15.515544 | 2021-07-02T14:46:44 | 2021-07-02T14:46:44 | 374,084,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 644 | java | package hr.vestigo.java.tecaj.zadatak2;
/**
* Enum representing vehicle type, regular or handicapped
* @author Mario
*
*/
public enum VehicleType {
REGULAR (false),
HANDICAPPED (true);
boolean isHandicapped;
/**
* Constructor for vehicle type
* @param isHandicapped is the vehicle for handicapped people or not
*/
private VehicleType(boolean isHandicapped) {
this.isHandicapped = isHandicapped;
}
/**
* Get is vehicle for handicapped people or not
* @return true if it is for handicapped people, false otherwise
*/
public boolean isHandicapped() {
return this.isHandicapped;
}
}
| [
"noreply@github.com"
] | Mario173.noreply@github.com |
f0f38213306637ed828c784364aeeabc0e47c004 | e53844aa2672df49c5d6ef73f0f8ad3519b63737 | /myBatisApp/src/main/java/com/mybatis3/util/TestDataPopulatorMain.java | 47f4a259c2dd498e1da0899a803dc840aa17fc92 | [] | no_license | tn841/JAVA_Spring | 105b518b0b305981eae446961b0f7c954a9dd4aa | fa3475315183c28bc00ba8a43c99668676146195 | refs/heads/master | 2020-06-14T17:44:36.278892 | 2017-02-11T04:16:59 | 2017-02-11T04:16:59 | 75,350,686 | 0 | 0 | null | 2016-12-16T01:54:39 | 2016-12-02T02:01:32 | Java | UTF-8 | Java | false | false | 2,394 | java | /**
*
*/
package com.mybatis3.util;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Properties;
import org.apache.ibatis.datasource.DataSourceFactory;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.jdbc.ScriptRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Siva
*
*/
public class TestDataPopulatorMain {
private static Logger logger = LoggerFactory.getLogger(TestDataPopulatorMain.class);
private static final Properties PROPERTIES = new Properties();
/**************** ScriptRunner **********************/
static {
try {
InputStream is = DataSourceFactory.class.getResourceAsStream("/jdbc.properties");
PROPERTIES.load(is);
} catch (IOException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
initDatabase();
}
public static Connection getConnection() {
String driver = PROPERTIES.getProperty("jdbc.driverClassName");
String url = PROPERTIES.getProperty("jdbc.url");
String username = PROPERTIES.getProperty("jdbc.username");
String password = PROPERTIES.getProperty("jdbc.password");
Connection connection = null;
try {
Class.forName(driver);
connection = DriverManager.getConnection(url, username, password);
} catch (Exception e) {
throw new RuntimeException(e);
}
return connection;
}
/*******************************************************/
public static void initDatabase() {
Connection connection = null;
Reader reader = null;
try {
connection = getConnection();
ScriptRunner scriptRunner = new ScriptRunner(connection);
reader = Resources.getResourceAsReader("sql/drop_tables.sql");
scriptRunner.runScript(reader);
logger.info("drop_tables.sql executed successfully");
reader = Resources.getResourceAsReader("sql/create_tables.sql");
scriptRunner.runScript(reader);
logger.info("create_tables.sql executed successfully");
reader = Resources.getResourceAsReader("sql/sample_data.sql");
scriptRunner.runScript(reader);
logger.info("sample_data.sql executed successfully");
connection.commit();
reader.close();
scriptRunner.closeConnection();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
| [
"tn841@naver.com"
] | tn841@naver.com |
41f750a48d60fe7d2cd1a268f337219438be21c1 | 95ea24f2e585b42e67c51b61a0448182ffc7fda2 | /main/java/com/Splosions/ModularBosses/client/render/entity/RenderEyeballOctopus.java | 5456e4e667efdf4188fea6534314bdbd636aedd7 | [] | no_license | gummby8/ModularBosses | 22718f7c5cc47db2873422d2d178baa1a5209c4e | d62524b007705eb0af7e064f960fc2efcc530010 | refs/heads/master | 2022-01-28T02:01:11.953464 | 2017-10-15T15:26:18 | 2017-10-15T15:26:18 | 47,521,161 | 3 | 2 | null | 2022-08-22T18:24:54 | 2015-12-07T01:07:49 | Java | UTF-8 | Java | false | false | 4,696 | java | package com.Splosions.ModularBosses.client.render.entity;
import java.util.logging.Level;
import com.Splosions.ModularBosses.entity.EntityEyeballOctopus;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class RenderEyeballOctopus extends RenderLiving {
private static final ResourceLocation enderDragonCrystalBeamTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png");
ResourceLocation texture = new ResourceLocation("mb:textures/mobs/EyeballOctopus.png");
public RenderEyeballOctopus(RenderManager renderManager, ModelBase model, float shadowSize) {
super(renderManager, model, shadowSize);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return texture;
}
@Override
public void doRender(EntityLiving entity, double x, double y, double z, float p_76986_8_, float partialTicks) {
super.doRender(entity, x, y, z, p_76986_8_, partialTicks);
EntityEyeballOctopus octo = (EntityEyeballOctopus) entity;
if (octo.target != null && octo.attackCounter > 0) {
this.drawRechargeRay(octo, x, y, z, partialTicks);
}
}
/**
* Draws the ray from the dragon to it's crystal
*/
protected void drawRechargeRay(EntityMob ent, double x, double y, double z, float partialTicks) {
EntityEyeballOctopus octo = (EntityEyeballOctopus) ent;
float f1 = (float) 10 + partialTicks;
float f2 = MathHelper.sin(f1 * 0F) / 2.0F + 0.9F;
f2 = (f2 * f2 + f2) * 0.4F;
float f3 = (float) (octo.target.posX - ent.posX - (ent.prevPosX - ent.posX) * (double) (1.0F - partialTicks));
float f4 = (float) ((double) f2 + octo.target.posY - 0.5D - ent.posY - (ent.prevPosY - ent.posY) * (double) (1.0F - partialTicks));
float f5 = (float) (octo.target.posZ - ent.posZ - (ent.prevPosZ - ent.posZ) * (double) (1.0F - partialTicks));
float f6 = MathHelper.sqrt_float(f3 * f3 + f5 * f5);
float f7 = MathHelper.sqrt_float(f3 * f3 + f4 * f4 + f5 * f5);
GlStateManager.pushMatrix();
GlStateManager.translate((float) x, (float) y + 0.8F, (float) z);
GlStateManager.rotate((float) (-Math.atan2((double) f5, (double) f3)) * 180.0F / (float) Math.PI - 90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate((float) (-Math.atan2((double) f6, (double) f4)) * 180.0F / (float) Math.PI - 90.0F, 1.0F, 0.0F, 0.0F);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
RenderHelper.disableStandardItemLighting();
GlStateManager.disableCull();
this.bindTexture(enderDragonCrystalBeamTextures);
GlStateManager.shadeModel(GL11.GL_FLAT);
float f8 = 0.0F - ((float) ent.ticksExisted + partialTicks) * 0.01F;
float f9 = MathHelper.sqrt_float(f3 * f3 + f4 * f4 + f5 * f5) / -32.0F - ((float) ent.ticksExisted + partialTicks) * 0.01F; // set
// the
// 32
// to
// positive
// to
// reverse
// beam
worldrenderer.startDrawing(5);
byte b0 = 8;
for (int i = 0; i <= b0; ++i) {
float f10 = MathHelper.sin((float) (i % b0) * (float) Math.PI * 2.0F / (float) b0) * 0.45F;
float f11 = MathHelper.cos((float) (i % b0) * (float) Math.PI * 2.0F / (float) b0) * 0.45F;
float f12 = 1;// (float) (i % b0) * 1.0F / (float) b0;
worldrenderer.setColorOpaque_I(16711680);
worldrenderer.addVertexWithUV((double) f10, (double) f11, (double) f7, (double) f12, (double) f8 + 0.2D); // 0.23D
// is
// the
// beam
// speed
worldrenderer.addVertexWithUV((double) (f10 * 0.2F), (double) (f11 * 0.2F), 0.0D, (double) f12, (double) f9);
}
tessellator.draw();
GlStateManager.enableCull();
GlStateManager.shadeModel(7424);
RenderHelper.enableStandardItemLighting();
GlStateManager.popMatrix();
}
}
| [
"gummby8@gmail.com"
] | gummby8@gmail.com |
f023d00f09c434bdb0f7a5778739dfc5c961442f | 3d5f58c0f45312db8ad14e733c952c8daba678ee | /src/main/java/me/lewin/dellunabank/gui/InventoryIcon.java | 49627d45d8854c9326f9377d0ba36a77d9f14a67 | [] | no_license | Lewin2/Java-minecraft-plugin-Bank | c93476861a5dbd25b76271eb74b829a65d29d6c4 | 8f0830b9805ef8e8753a91437a17c0a0de9559a1 | refs/heads/main | 2023-06-01T07:04:14.297174 | 2021-06-30T10:17:31 | 2021-06-30T10:17:31 | 381,660,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,301 | java | package me.lewin.dellunabank.gui;
import me.lewin.dellunabank.Reference;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class InventoryIcon
{
// 입금 아이콘
public static ItemStack iconDeposit() {
List<String> lore = new ArrayList<>();
lore.add("§7 우클릭 시§a 입금페이지§7로 이동합니다");
return Reference.iconDefault(Material.CHEST, "§x§5§0§f§4§4§3[입금]", lore);
}
// 입금 상호작용 버튼
public static ItemStack iconInteractDeposit(int model) {
List<String> lore = new ArrayList<>();
lore.add("§7 좌클릭: +1");
lore.add("§7 우클릭: -1");
lore.add("§7 쉬프트+좌클릭: +10");
lore.add("§7 쉬프트+우클릭: -10");
return Reference.iconDefault(Material.LIME_STAINED_GLASS_PANE, "◆", lore, model);
}
// 출금 아이콘
public static ItemStack iconWithdraw() {
List<String> lore = new ArrayList<>();
lore.add("§7 우클릭 시§d 출금페이지§7로 이동합니다");
return Reference.iconDefault(Material.FURNACE, "§x§f§5§4§a§a§e[출금]", lore);
}
// 출금 상호작용 버튼
public static ItemStack iconInteractWithdraw(int model) {
List<String> lore = new ArrayList<>();
lore.add("§7 좌클릭: +1");
lore.add("§7 우클릭: -1");
lore.add("§7 쉬프트+좌클릭: +10");
lore.add("§7 쉬프트+우클릭: -10");
return Reference.iconDefault(Material.PINK_STAINED_GLASS_PANE, "◆", lore, model);
}
// 재화 아이콘
public static ItemStack iconMoney(UUID uuid) {
List<String> lore = new ArrayList<>();
lore.add("§x§F§F§D§7§0§0 금화 : " + Reference.getMoneyGold(uuid, 0));
lore.add("§x§C§0§C§0§C§0 은화 : " + Reference.getMoneyGold(uuid, 1));
lore.add("§x§C§D§7§F§3§2 동화 : " + Reference.getMoneyGold(uuid, 2));
return Reference.iconDefault(Material.EMERALD, "§x§0§c§d§4§9§d[통장잔고]", lore);
}
//금화
public static ItemStack iconGold() {
List<String> lore = new ArrayList<>();
lore.add("§a설명 §7: 델루나 서버 화폐입니다.");
return Reference.iconDefault(Material.RED_DYE, "§x§f§f§d§7§0§0델루나 금화", lore, 1000);
}
//은화
public static ItemStack iconSilver() {
List<String> lore = new ArrayList<>();
lore.add("§a설명 §7: 델루나 서버 화폐입니다.");
return Reference.iconDefault(Material.BLUE_DYE, "§x§c§b§c§b§c§b델루나 은화", lore, 1000);
}
//동화
public static ItemStack iconCopper() {
List<String> lore = new ArrayList<>();
lore.add("§a설명 §7: 델루나 서버 화폐입니다.");
return Reference.iconDefault(Material.GREEN_DYE, "§x§b§f§8§0§6§9델루나 동화", lore, 1000);
}
//금화 - 아이콘
public static ItemStack iconGoldButton() {
return Reference.iconDefault(Material.RED_DYE, "§x§f§f§d§7§0§0델루나 금화", 1000);
}
//은화 - 아이콘
public static ItemStack iconSilverButton() {
return Reference.iconDefault(Material.BLUE_DYE, "§x§c§b§c§b§c§b델루나 은화", 1000);
}
//동화 - 아이콘
public static ItemStack iconCopperButton() {
return Reference.iconDefault(Material.GREEN_DYE, "§x§b§f§8§0§6§9델루나 동화", 1000);
}
// 확인 버튼
public static ItemStack iconAccess() {
return Reference.iconDefault(Material.NETHER_STAR, "§e확인");
}
// 뒤로가기 버튼
public static ItemStack iconBack() { return Reference.iconDefault(Material.BARRIER, "§c뒤로가기"); }
// 검정 바탕 아이콘
public static ItemStack iconNull() {
return Reference.iconDefault(Material.BLACK_STAINED_GLASS_PANE, " ");
}
// 흰색 바탕 아이콘
public static ItemStack iconNull2() {
return Reference.iconDefault(Material.WHITE_STAINED_GLASS_PANE, " ");
}
} | [
"noreply@github.com"
] | Lewin2.noreply@github.com |
737fc891b8b188ca2483f8b05d8f7cc65a2daaf8 | e6be22aa660a8412ac61f41e1e90febe59916afa | /src/main/java/org/primefaces/examples/service/TwitterRSSService.java | 8396e6d18666f2f9f6f043fdad397eb5c5eab120 | [] | no_license | teodesson/primefaces-showcase | cda2dde46b31e6a8d4db91a161853d54e64d8243 | da3c22525dfa989eb1b72cca2be602cc62502e8b | refs/heads/master | 2021-01-01T17:06:11.267222 | 2019-03-26T14:31:12 | 2019-03-26T14:31:12 | 15,037,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,650 | java | /*
* Copyright 2009 Prime Technology.
*
* 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.primefaces.examples.service;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;
public class TwitterRSSService implements TwitterService {
private static final Logger logger = Logger.getLogger(TwitterRSSService.class.getName());
public List<String> getTweets(String username) {
List<String> tweets = new ArrayList<String>();
try {
URL feedSource = new URL("http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=" + username);
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(feedSource));
for(Object f : feed.getEntries()) {
SyndEntry entry = (SyndEntry) f;
tweets.add(entry.getTitle().substring(username.length() + 2));
}
}catch(Exception e) {
logger.severe(e.getMessage());
}
return tweets;
}
} | [
"teodesson@gmail.com"
] | teodesson@gmail.com |
ce197f670b59fd5be45883a210abdcfda22e87fd | 9396d84d6fc23c88f23809c1a30c6ff20b0ce19f | /svision/src/main/java/com/rmbank/supervision/service/impl/PermissionServiceimpl.java | 4284e719332d1972ff7e109518a49ad61c601d55 | [] | no_license | supervisions/supervision-manager | 9e6882676f6dd104e0d5254647a11b2f045fff81 | 6f2cbf1dec77c79a7e8d508b2c75b2263922037f | refs/heads/master | 2021-01-19T21:58:37.623434 | 2018-05-17T03:18:19 | 2018-05-17T03:18:19 | 88,729,267 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,451 | java | package com.rmbank.supervision.service.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.rmbank.supervision.dao.PermissionMapper;
import com.rmbank.supervision.model.Permission;
import com.rmbank.supervision.service.PermissionService;
@Service("PermissionService")
public class PermissionServiceimpl implements PermissionService {
@Resource
private PermissionMapper permissionMapper;
@Override
public int deleteByPrimaryKey(Integer id) {
// TODO Auto-generated method stub
return 0;
}
@Override
public int insert(Permission record) {
// TODO Auto-generated method stub
return 0;
}
@Override
public int insertSelective(Permission record) {
// TODO Auto-generated method stub
return 0;
}
@Override
public Permission selectByPrimaryKey(Integer id) {
// TODO Auto-generated method stub
return permissionMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(Permission record) {
// TODO Auto-generated method stub
return 0;
}
@Override
public int updateByPrimaryKey(Permission record) {
// TODO Auto-generated method stub
return 0;
}
@Override
public List<Permission> getPermissionList(Permission permission) {
// TODO Auto-generated method stub
return permissionMapper.getPermissionList(permission);
}
@Override
public int getPermissionCount(Permission permission) {
// TODO Auto-generated method stub
return permissionMapper.getPermissionCount(permission);
}
@Override
public boolean saveOrUpdatePermission(Permission permission) {
// TODO Auto-generated method stub
boolean isSuccess = false;
try{
//id存在则为修改操作
if(permission.getId()>0){
permissionMapper.updateByPrimaryKeySelective(permission);
isSuccess = true;
}else{
permissionMapper.insert(permission);
isSuccess = true;
}
}catch(Exception ex){
ex.printStackTrace();
}
return isSuccess;
}
@Override
public List<Permission> getExistPermission(Permission per) {
// TODO Auto-generated method stub
return permissionMapper.getExistPermission(per);
}
@Override
public boolean deletePermissionById(Integer id) {
// TODO Auto-generated method stub
boolean isSuccess = false;
try{
permissionMapper.deleteByPrimaryKey(id);
isSuccess=true;
}catch(Exception ex){
ex.printStackTrace();
}
return isSuccess;
}
}
| [
"xiaohutuxian5212@163.com"
] | xiaohutuxian5212@163.com |
0348e76a8c61a94c838f3644e9d34a51cf2a6f0d | 2204e79af42f8402ff59354de250a4dea63b2c0a | /PingPong/src/com/thor/pingpong/Spilleflade.java | 670f7696c41acecec2a2775913a3d71ec79a31f9 | [] | no_license | Thor1416/Ping-Pong | 148b1c9b2ff25519b9a6e3f9e6965bc73e356f90 | 221217743d20023f5e1c09b99522bd1f5685bacf | refs/heads/master | 2021-01-22T23:15:16.666006 | 2015-01-05T21:10:11 | 2015-01-05T21:10:11 | 27,303,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 250 | java | package com.thor.pingpong;
import java.awt.Dimension;
import javax.swing.*;
public class Spilleflade extends JPanel {
public void paintComponent(Graphics g)
{
super.repaint();
}
public Dimension getPrefferedSize()
}
| [
"ts4516@gmail.com"
] | ts4516@gmail.com |
5e091f556e0bd4e514b3c0bba677501a6e2d7af1 | 67984d7d945b67709b24fda630efe864b9ae9c72 | /core/src/main/java/com/ey/piit/core/paginator/dialect/OracleDialect.java | 443d7ac151d52361aecc8647d70d9240e5765630 | [] | no_license | JackPaiPaiNi/Piit | 76c7fb6762912127a665fa0638ceea1c76893fc6 | 89b8d79487e6d8ff21319472499b6e255104e1f6 | refs/heads/master | 2020-04-07T22:30:35.105370 | 2018-11-23T02:58:31 | 2018-11-23T02:58:31 | 158,773,760 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,482 | java | package com.ey.piit.core.paginator.dialect;
import com.ey.piit.core.paginator.domain.PageBounds;
import com.ey.piit.core.paginator.dialect.Dialect;
import org.apache.ibatis.mapping.MappedStatement;
/**
* @author badqiu
* @author miemiedev
*/
public class OracleDialect extends Dialect{
public OracleDialect(MappedStatement mappedStatement, Object parameterObject, PageBounds pageBounds) {
super(mappedStatement, parameterObject, pageBounds);
}
protected String getLimitString(String sql, String offsetName,int offset, String limitName, int limit) {
sql = sql.trim();
boolean isForUpdate = false;
if ( sql.toLowerCase().endsWith(" for update") ) {
sql = sql.substring( 0, sql.length()-11 );
isForUpdate = true;
}
StringBuffer pagingSelect = new StringBuffer( sql.length()+100 );
if (offset > 0) {
pagingSelect.append("select * from ( select row_.*, rownum rownum_ from ( ");
}
else {
pagingSelect.append("select * from ( ");
}
pagingSelect.append(sql);
if (offset > 0) {
pagingSelect.append(" ) row_ ) where rownum_ <= ? and rownum_ > ?");
setPageParameter("__offsetEnd",offset+limit,Integer.class);
setPageParameter(offsetName,offset,Integer.class);
}
else {
pagingSelect.append(" ) where rownum <= ?");
setPageParameter(limitName,limit,Integer.class);
}
if ( isForUpdate ) {
pagingSelect.append( " for update" );
}
return pagingSelect.toString();
}
}
| [
"1210287515@master"
] | 1210287515@master |
39dcfd2e2962de57dd1dec761bc964e26666d8d8 | 218b37b605040f626ad94203368e8de9b504b91a | /src/helloworld.java | f867aa8f35bf689f66bb852648b47b705dff282e | [] | no_license | tevez1732/Git_java | 46581bcbb66b713e5abdf5a79fce85c22284b617 | 3c525ca25da66107e141cbfced4a0746e6c46f2d | refs/heads/master | 2021-03-12T18:13:42.157279 | 2017-05-16T11:30:24 | 2017-05-16T11:30:24 | 91,451,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 123 | java |
public class helloworld {
public static void main(String[] args){
System.out.println("hello world");
return;
}
}
| [
"tjh1015@naver.com"
] | tjh1015@naver.com |
e4748289e7efdd8c52fa97326a832a2e46c2937c | fc19358b00ca504d5d807ddfd52b15c78f7488ba | /TriliAppForms/src/co/com/triliapp/forms/FXMLUsuarioController.java | b77c16093d763fc398c6ee5b881f8189d692f5a1 | [] | no_license | santiagowac/Trili-App | 5872d07959d725825b4e0ad5fa73457afd2245ba | 34160ac5dd5f1e68fb371936c51dbce410a87762 | refs/heads/master | 2020-12-14T04:51:11.237452 | 2020-01-17T22:26:41 | 2020-01-17T22:26:41 | 234,645,918 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,623 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package co.com.triliapp.forms;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.text.Text;
import co.com.triliapp.bl.GestionDeUsuariosBL;
import co.com.triliapp.dao.UsuarioDAO;
import co.com.triliapp.dto.Usuario;
import co.com.triliapp.dto.Rango;
import co.com.triliapp.dto.Rol;
import java.net.URL;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Node;
//=================================Funciones==================================//
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
import javafx.scene.control.SelectionMode;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.stage.Stage;
/**
*
* @author cerqu
*/
public class FXMLUsuarioController implements Initializable {
GestionDeUsuariosBL gestUsuarios = new GestionDeUsuariosBL();
Usuario usuDTO = new Usuario();
Rango rangDTO = new Rango();
Rol rolDTO = new Rol();
//=============================Cajas de textos=======================//
@FXML
private TextField txtDisplayName;
@FXML
private TextField txtContraseniaUsuario;
@FXML
private TextField txtCorreoUsuario;
@FXML
private TextField txtImagenUsuario;
@FXML
private Text actiontarget;
@Override
public void initialize(URL url, ResourceBundle rb) {
}
//================Alertas========================//
Alert alerta = new Alert(Alert.AlertType.INFORMATION);
Alert alertaError = new Alert(Alert.AlertType.ERROR);
/**
* Funcion Para Limpiar Los Campos Los Cuales Son (Nombre
* Rango,Descripcion,Imagen).
*/
@FXML
public void limpiar(ActionEvent event) {
txtDisplayName.setText("");
txtContraseniaUsuario.setText("");
txtCorreoUsuario.setText("");
txtImagenUsuario.setText("");
}
/**
* Funcion Para Mostrar mensaje de Registro Usuarios Ingresado correctamente
* Valores A necesitar son (DyspalyName,Imagen,Correo y contraseña De
* Usuario)
*
*/
@FXML
public void mensajeCategoriaIngresoCorrecto(ActionEvent event) {
alerta.setTitle("Information Dialog");
alerta.setHeaderText(null);
alerta.setContentText("Categoria Ingresada");
alerta.showAndWait();
}
/**
* Funcion Para Mostrar mensaje de Registro Usuarios Ingresado
* Incorrectamente (DyspalyName,Imagen,Correo y contraseña De Usuario)
*
*/
public void mensajeRegistroInCorrecto(ActionEvent event) {
alertaError.setTitle("Error Dialog");
alertaError.setContentText("Registro No Realizado Faltan Campos");
alertaError.showAndWait();
}
//=================================Funciones===============================//
public void RegistroUsuario(ActionEvent event) throws Exception {
// Integer RANGOVARIABLE = 1;
// Integer ROLVARIABLE = 2;
usuDTO.setDisplayName(txtDisplayName.getText());
usuDTO.setImagenUsu(txtImagenUsuario.getText());
usuDTO.setContraseniaUsu(txtContraseniaUsuario.getText());
usuDTO.setCorreoUsu(txtCorreoUsuario.getText());
//--------------------------------------------------------------------//
rangDTO.setIdRango(1);
rolDTO.setIdRol(1);
usuDTO.setRango(rangDTO);
usuDTO.setRol(rolDTO);
try {
gestUsuarios.IngresarUsuario(usuDTO);
mensajeCategoriaIngresoCorrecto(event);
limpiar(event);
} catch (Exception e) {
mensajeRegistroInCorrecto(event);
e.getMessage();
}
}
@FXML
public void regresarMenu(ActionEvent event) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("FXMLMenuInicial.fxml"));
Scene scene = new Scene(root, 466, 832);
Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
stage.hide();
stage.setScene(scene);
stage.setTitle("TriliAplicativo - Ingreso de sesion");
stage.show();
}
}
| [
"santiagoamadolml@hotmail.com"
] | santiagoamadolml@hotmail.com |
1e7297965dcf97d734987488ba127aed02d46a25 | 8ed13620c33959fbe5daf5f6c00e176283d867af | /app/src/test/java/com/weddingwire/animazing/ExampleUnitTest.java | d941b83256361c38a043f3234db53851f20a3bc7 | [] | no_license | matthew-reilly/Animazing | 39e4130cd5a62b04aaa4927afa0fc0c74fee47b6 | 16d0bff77db663968258303fde81da102e6cffae | refs/heads/master | 2020-12-24T21:01:00.052315 | 2016-05-06T18:17:54 | 2016-05-06T18:17:54 | 58,224,308 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package com.weddingwire.animazing;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"mreilly@weddingwire.com"
] | mreilly@weddingwire.com |
50cb02d9dc99c97560bdcc2657af7f33ade2385d | 3f6d177778238f9ffc6bdd9680c7096652c680e6 | /src/MyJavaFXButton.java | d7d3b4f5d7f07109865cef9f9dd7dd416f743b15 | [] | no_license | RabeaGleissner/javafx-spike | 4ee07ce20241f0cfaa30607581bce3b268fb7cab | 6b46da6d5ace76cc4bc05f0ac088e3f60ad4e328 | refs/heads/master | 2021-01-10T16:11:37.247351 | 2016-02-10T14:16:02 | 2016-02-10T14:16:02 | 51,431,629 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 454 | java | import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
public class MyJavaFXButton implements ButtonInterface {
private Button button;
public MyJavaFXButton(Button button) {
this.button = button;
}
@Override
public void setOnAction(EventHandler<ActionEvent> value) {
button.setOnAction(value);
}
public Button actualButton() {
return button;
}
}
| [
"rabeagleissner@gmail.com"
] | rabeagleissner@gmail.com |
00951f84a1674856b23767cfecad6fe606346e47 | b5ca83e952d50bc31cf9f34a90855d7f889736e8 | /src/day38/jz37/Codec.java | f1fb4ba32c3e6aef25c1582986b833e61f0b4512 | [] | no_license | by-2019/LeetCode-Daily-Practice | 339837d164c21d09c4fdf204a3c249df7ab9ced3 | 1ae7413227672cc698e5b4772f02e1ec5bd42684 | refs/heads/main | 2023-06-11T07:50:24.005761 | 2021-07-07T09:36:24 | 2021-07-07T09:36:24 | 353,250,320 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,397 | java | package day38.jz37;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
public class Codec {
// Encodes a tree to a single string.
public String serialize(TreeNode root) {
if (null == root) {
return "null";
}
Queue<TreeNode> queue = new ArrayDeque<>();
queue.add(root);
StringBuilder sb = new StringBuilder();
sb.append(root.val);
while (!queue.isEmpty()) {
TreeNode node = queue.poll();
sb.append(",");
if (null != node.left) {
queue.add(node.left);
sb.append(node.left.val);
} else {
sb.append("null");
}
sb.append(",");
if (null != node.right) {
queue.add(node.right);
sb.append(node.right.val);
} else {
sb.append("null");
}
}
return sb.toString();
}
// Decodes your encoded data to tree.
public TreeNode deserialize(String data) {
if (null == data || "null".equals(data)) {
return null;
}
LinkedList<String> datas = new LinkedList<>(Arrays.asList(data.split(",")));
Queue<TreeNode> queue = new ArrayDeque<>();
TreeNode root = new TreeNode(Integer.parseInt(datas.removeFirst()));
queue.add(root);
while (!queue.isEmpty() && !datas.isEmpty()) {
TreeNode node = queue.poll();
String left = datas.removeFirst();
if (!"null".equals(left)) {
node.left = new TreeNode(Integer.parseInt(left));
queue.add(node.left);
}
if (!datas.isEmpty()) {
String right = datas.removeFirst();
if (!"null".equals(right)) {
node.right = new TreeNode(Integer.parseInt(right));
queue.add(node.right);
}
}
}
return root;
}
static class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) {
val = x;
}
}
public static void main(String[] args) {
Codec c = new Codec();
TreeNode des = c.deserialize("1,2,3,null,null,4,5");
System.out.println(c.serialize(des));
}
}
| [
"rc_baiyu@163.com"
] | rc_baiyu@163.com |
49aa8c81a97f0183f95dba25200b774059f555b1 | f5c30fd4998304cc35cdecebf9294fe3628323b7 | /codjo-broadcast-common/src/main/java/net/codjo/broadcast/common/columns/GeneratorExpression.java | 28230b81597e5027e34a2003501f045d8b3d747e | [] | no_license | codjo-sandbox/codjo-broadcast | 44f5374ccd807e5f83f470a1b67cc5f8af252afb | 617654a9e0b497f5b8d5f4ca69ce9b337540d6ee | refs/heads/master | 2021-01-14T08:51:56.160462 | 2014-02-11T10:04:09 | 2014-02-11T10:04:09 | 3,590,536 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,532 | java | /*
* codjo.net
*
* Common Apache License 2.0
*/
package net.codjo.broadcast.common.columns;
import net.codjo.expression.Expression;
import net.codjo.expression.ExpressionException;
import java.sql.Types;
import java.util.ArrayList;
import java.util.List;
/**
* Gestionnaire d'expression pour l'export.
*
* @author $Author: galaber $
* @version $Revision: 1.2 $
*/
class GeneratorExpression {
private AbstractFileColumnGenerator generator;
private Expression expression;
GeneratorExpression(String expressionString, int inputSqlType, FunctionHolder funcs) {
Expression.Variable[] inputs = new Expression.Variable[1];
inputs[0] =
new Expression.Variable(Expression.DEFAULT_STRING_VALUE, inputSqlType);
FunctionHolder[] funcHolders = new FunctionHolder[2];
funcHolders[0] = funcs;
funcHolders[1] = new GeneratorFunctions();
String[] st = {Expression.DEFAULT_STRING_NULL_VALUE};
expression =
new Expression(expressionString, inputs, funcHolders, Types.VARCHAR, st);
}
GeneratorExpression(String expressionString, int inputSqlType) {
expression =
new Expression(expressionString, inputSqlType, new GeneratorFunctions(),
Types.VARCHAR);
}
public String computeToString(Object value) throws GenerationException {
try {
Object result = expression.compute(value);
if (result == null) {
return "";
}
else {
return result.toString();
}
}
catch (ExpressionException ex) {
throw new GenerationException("Evaluation de l'expression impossible :"
+ expression, ex);
}
}
public void init(AbstractFileColumnGenerator columnGenerator) {
this.generator = columnGenerator;
}
/**
* Transfert l'appel de formattage sur le generateur.
*
* @author $Author: galaber $
* @version $Revision: 1.2 $
*/
public class GeneratorFunctions implements FunctionHolder {
public List<String> getAllFunctions() {
List<String> allFunction = new ArrayList<String>();
allFunction.add("outil.format(value)");
return allFunction;
}
public String getName() {
return "outil";
}
public String format(Object obj) {
return generator.format(obj);
}
}
}
| [
"admin@codjo.net"
] | admin@codjo.net |
732cd94093d8832ebdc0e46d80b24c7f6728f0ba | 8eb33c5fe74f3ae62b074084b8042d261940ee89 | /src/main/java/com/example/demo/DemoApplication.java | 77b54577c1c7d4222f7d49d6591c1fade51d57d5 | [] | no_license | miniprojet1/spring | 5c28c8ced78fbc4246bc06121d0af5d0bebba964 | e1ddc86161e2d68fb3c5369d7c3eab76bb44a552 | refs/heads/master | 2020-04-07T05:12:56.556434 | 2018-11-22T11:11:29 | 2018-11-22T11:11:29 | 158,087,768 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 426 | java | package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
| [
"ismai@ismail"
] | ismai@ismail |
7a71145db62dcc50af85818978f2f29931ce19de | 04c80a87a04159f83cce3f6379f4eb43799d4571 | /week-09/day-01/src/main/java/com/greenfoxacademy/frontend/Controllers/MainController.java | af91005532b6e018c307a615132df53d017833ca | [] | no_license | green-fox-academy/takieszabie | c3507c077fdbc14e3088fe2962f447d18f142ae0 | 322eeb991b124b8c1037b49510fffc3ce8392931 | refs/heads/master | 2021-09-13T03:08:48.466973 | 2018-04-24T09:55:57 | 2018-04-24T09:55:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 279 | java | package com.greenfoxacademy.frontend.Controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class MainController {
@GetMapping("/")
public String showIndex(){
return "index";
}
}
| [
"szabolcs.tak@gmail.com"
] | szabolcs.tak@gmail.com |
021f03311b2e3b7154eddba1a6df093db2a5213f | 37c0d1f6dd50eb64ce71ada956c407fb1233ef03 | /core/src/com/avanderbeck/tiledmap/TileSet.java | bb4a62a9b3dc5725758e7e7eeec7e62eaff35b22 | [] | no_license | gatesandlogic/septembersortie | 751a83e569a5eb9c61159a88ef09f26812bfa128 | 5e86a399503283e91373c2c94f69832420a69091 | refs/heads/master | 2020-05-24T17:44:32.525400 | 2017-03-28T17:31:28 | 2017-03-28T17:31:28 | 84,863,014 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 503 | java | package com.avanderbeck.tiledmap;
public class TileSet {
public int columns;//"columns":8,
public int firstgid; //"firstgid":1,
public String image;//"image":"terraintiles.png",
public int imageheight, imagewidth;//"imageheight":128,
//"imagewidth":128,
public int margin; // "margin":0,
public String name; //"name":"terrain",
public int spacing; //"spacing":0,
public int tilecount, tileheight, tilewidth;//"tilecount":64,
//"tileheight":16,
//"tilewidth":16
}
| [
"avanderbeck@gmail.com"
] | avanderbeck@gmail.com |
1c8de1c354f2c04ca1f79beba65f1989ee965cc2 | 59f0dae3e153fa2f7c7dc3e7d1c09b35788585da | /src/main/java/guru/springframework/spring5recipeapp/domain/Category.java | 2b4b548481f6fc775ccc45040244600b64ebda3e | [] | no_license | minarazi/spring-recipe | 098cbc92a5e81bf6f084f62193e35fc47c753656 | d769dcbb74ee02fb4882e65be3d0d5b9b0d96b46 | refs/heads/master | 2020-05-30T22:38:33.209494 | 2019-06-19T18:22:38 | 2019-06-19T18:22:38 | 189,996,174 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 573 | java | package guru.springframework.spring5recipeapp.domain;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(exclude = { "recipes" })
@Entity
public class Category {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String description;
@ManyToMany(mappedBy = "categories")
private Set<Recipe> recipes;
}
| [
"razimina76@gmail.com"
] | razimina76@gmail.com |
75aece0676f7631eddfaba83e58936d2e903998a | 0d2194883ca967a95b07fa2b36be943a45fca565 | /src/main/java/com/exigen/timetable/repository/RoleRepository.java | aa889cf5722db5c2b761858e7f95d0ad8647b7b9 | [
"Apache-2.0"
] | permissive | Practice-2016-2017/task-5 | 6928545b501916d1fc8a98282421bb810ab56d72 | f7a3feb2dc7e10edc8e25f625f4f09368f6406c1 | refs/heads/master | 2021-01-22T20:12:53.972806 | 2017-05-26T03:34:39 | 2017-05-26T03:34:39 | 85,294,879 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 247 | java | package com.exigen.timetable.repository;
import com.exigen.timetable.pojo.Role;
import org.springframework.data.jpa.repository.JpaRepository;
public interface RoleRepository extends JpaRepository<Role, Long>{
Role findByName(String name);
}
| [
"artem.ananchenko@yandex.ru"
] | artem.ananchenko@yandex.ru |
d407f4b81a7b3bfa76a767dcd47b907b8fb7e6bc | dfa9576fb9f08f5865371858e4474d8a0c4dd8a1 | /ydq_device/src/main/java/com/conagra/mvp/presenter/BloodPressurePresenter.java | 5b8fe05b60f4235f5fed78328bc978d936b820a9 | [] | no_license | dongqin50/IOCDemo | a79a1abf3d49f130e67d0279a6fa0d6790517765 | 08689bcacdc00ec1fff6a412e2c8e0b43bc9cc17 | refs/heads/master | 2022-12-10T01:49:57.806959 | 2020-09-17T22:50:57 | 2020-09-17T22:50:57 | 296,457,960 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,444 | java | package com.conagra.mvp.presenter;
import com.conagra.di.UseCase;
import com.conagra.di.interactor.bloodpressure.BloodPressureCreate;
import com.conagra.di.interactor.bloodpressure.BloodPressureIsExist;
import com.conagra.di.interactor.bloodsugar.BloodSugarGetALLList;
import com.conagra.di.interactor.hardwaremanager.HardwareManagerCreate;
import com.conagra.hardware.model.BloodPressureModel;
import com.conagra.mvp.model.BloodPressureListModel;
import com.conagra.mvp.model.BloodSugarIsExistModel;
import com.conagra.mvp.model.MySubscriber;
import com.conagra.mvp.ui.view.BloodPressureView;
import java.util.HashMap;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Named;
import rx.Subscriber;
public class BloodPressurePresenter extends BasePresenter<BloodPressureView> {
@Inject
@Named("bloodPressureIsExit")
UseCase mUCBloodPressureIsExit;
@Inject
@Named("bloodPressureCreate")
UseCase mUCCreate;
@Inject
@Named("bloodPressureGetAllList")
UseCase mUCGetAllList;
private String userId;
private String time;
@Inject
public BloodPressurePresenter() {
}
public void setTime(String time) {
this.time = time;
}
public void setUserId(String userId) {
this.userId = userId;
}
public void isExist(BloodPressureModel model) {
Map map = new HashMap();
map.put(BloodPressureIsExist.CUSTOMER_ID, userId);
mUCBloodPressureIsExit.execute(new MySubscriber<BloodSugarIsExistModel>() {
@Override
public void onBackError(String message) {
super.onBackError(message);
getView().showServerError(message);
}
@Override
public void onBackNext(BloodSugarIsExistModel o) {
getView().isExist(model,o.isIsExist());
}
}, map);
}
public void create(BloodPressureModel model) {
Map map = new HashMap();
map.put(BloodPressureCreate.CUSTOMER_ID, model.getCustomerNo());
map.put(BloodPressureCreate.SYSTOLIC_PRESSURE, model.getSystolicPressure());
map.put(BloodPressureCreate.DIASTOLIC_PRESSURE, model.getDiastolicPressure());
map.put(BloodPressureCreate.HEART_RATE, model.getHeartRate());
map.put(BloodPressureCreate.STATE, model.getState());
getView().showLoading();
mUCCreate.execute(new MySubscriber<String>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
getView().hideLoading();
getView().showServerError("网络异常");
}
@Override
public void onBackError(String message) {
super.onBackError(message);
getView().hideLoading();
getView().showServerError(message);
}
@Override
public void onBackNext(String model) {
getView().hideLoading();
getView().createOrUpdateSuccess();
}
}, map);
}
public void GetALLList(String startTime,String endTime) {
Map map = new HashMap();
map.put(BloodSugarGetALLList.CUSTOMER_ID, userId);
map.put(BloodSugarGetALLList.PAGE, 1);
map.put(BloodSugarGetALLList.ROWS,100);
map.put(BloodSugarGetALLList.BEGIN_DATE, startTime);
map.put(BloodSugarGetALLList.END_DATA, endTime);
mUCGetAllList.execute(new MySubscriber<BloodPressureListModel> (){
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
getView().showServerError("网络错误");
}
@Override
public void onBackNext(BloodPressureListModel model) {
getView().renderAllData(model);
}
}, map);
}
@Inject
@Named("hardwareManagerGetDeviceByMac")
UseCase mDeviceIsExist;
@Inject
@Named("hardwareManagerCreate")
UseCase mDeviceCreate;
public void addDevice(String mac) {
Map map = new HashMap();
map.put(HardwareManagerCreate.DEVICE_NAME, "BloodPressure_"+System.currentTimeMillis());
map.put(HardwareManagerCreate.DEVICE_MAC_ADDRESS, mac);
map.put(HardwareManagerCreate.DEVICE_USER_ID, userId);
map.put(HardwareManagerCreate.DEVICE_TYPE, "3");
mDeviceCreate.execute(new MySubscriber<Object> (){
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
getView().showServerError();
getView().addDeviceStatus(false);
}
@Override
public void onBackNext(Object model) {
getView().addDeviceStatus(true);
}
}, map);
}
public void isExistDevice(String mac) {
mDeviceIsExist.execute(new Subscriber<Boolean>(){
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
getView().showServerError();
}
@Override
public void onNext(Boolean model) {
getView().isExistDevice(model,mac);
}
}, mac);
}
}
| [
"dongqin50@163.com"
] | dongqin50@163.com |
d5fc2c5627bfcf9deff0bc95061c1c0ac51bc05b | b0f4a552103a46c104b57491633441198302c385 | /bookstore-project/src/test/java/com/icl/m2/bookstore/test/UserServiceTest.java | 810a57d29a08d722f85d1fc86a0b40a1b8f8866a | [] | no_license | Waspische/bookstore | aef2ec6da70894a979e3f3b9ca1029a6fb7ecfec | 0b4c3790191b1888690720d12ab2d9a48a0b9459 | refs/heads/master | 2020-12-30T21:34:59.029089 | 2015-01-18T23:30:42 | 2015-01-18T23:30:42 | 26,628,543 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,453 | java | package com.icl.m2.bookstore.test;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import com.bookstore.entities.User;
import com.bookstore.service.UserService;
public class UserServiceTest {
UserService userService = null;
@Before
public void init(){
userService = new UserService();
}
@Test
public void testLogin(){
// test avec identifiants corrects
String userLogin = "adrien";
String userPassword = "adr";
User u = userService.login(userLogin, userPassword);
Assert.assertNotNull("The user should not be null", u);
Assert.assertEquals("The user login should be 'adrien'", userLogin, u.getLogin());
// test avec mauvais mot de passe
String wrongPassword = "adrr";
u = userService.login(userLogin, wrongPassword);
Assert.assertNull("The user should be null", u);
// test avec mauvais login
String wrongLogin = "adrienn";
u = userService.login(wrongLogin, userPassword);
Assert.assertNull("The user should be null", u);
// test avec tout de mauvais
u = userService.login(wrongLogin, wrongPassword);
Assert.assertNull("The user should be null", u);
}
@Test
public void testAddUser(){
// test avec un utilisateur n'existant pas
String testLogin = "testLogin";
String testMail = "testMail";
String testPassword = "testPassword";
try {
userService.addUser(testLogin, testMail, testPassword);
} catch (Exception e) {
Assert.fail("L'utilisateur ne devrait pas déjà exister : " + e.getMessage());
}
// test pour voir s'il est bien créé
User u = userService.login(testLogin, testPassword);
Assert.assertNotNull("The user should not be null : il vient d'être créé", u);
Assert.assertEquals("Le login ne correspond pas", testLogin, u.getLogin());
Assert.assertEquals("Le mot de passe ne correspond pas", testPassword, u.getPassword());
Assert.assertEquals("Le mail ne correspond pas", testMail, u.getEmail());
// test avec un utilisateur qui existe déjà
String userLogin = "adrien";
String userPassword = "adr";
String userMail = "adrien.stadler@gmail.com";
try {
userService.addUser(userLogin, userMail, userPassword);
Assert.fail("L'utilisateur existe déjà et une exception devrait être levée");
} catch (Exception e) {
// cas normal
}
}
}
| [
"adrien.stadler@gmail.com"
] | adrien.stadler@gmail.com |
ef7f10d7de3f5385b39d747a9309c71ded4f9427 | 727791432026cd92922a420037799196f7ee2f65 | /A2Prj/src/com/mycompany/myapp/CommandSound.java | 9121745d18273d9338082534f09e18f6b50d5dcb | [] | no_license | ctlevinsky/CSC-133 | 64533a696169b769f2b225aacc27416849ef8ef4 | d65ca3c3dd1efd7f35023b555e1d342fcd17bf06 | refs/heads/master | 2021-07-23T02:57:17.593047 | 2017-11-02T19:12:01 | 2017-11-02T19:12:01 | 109,036,335 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 668 | java | package com.mycompany.myapp;
import com.codename1.ui.Command;
import com.codename1.ui.events.ActionEvent;
public class CommandSound extends Command {
private GameWorld gw;
/**
* Constructor
* @param command, a String that will appear on the label of the command in the GUI
* @param world, the GameWorld that this command points to and effects
*/
public CommandSound(String command, GameWorld world) {
super(command);
gw = world;
}
/**
* When command invoked, call method in GameWorld and prints message to console
*/
public void actionPerformed(ActionEvent evt) {
gw.toggleSound();
System.out.println("Sound Checkbox clicked");
}
}
| [
"ctlevinsky@gmail.com"
] | ctlevinsky@gmail.com |
d30464f63b82dd91aa167c886f7d636c231b49b5 | 7fb14b5b6cfbc8f7c4fac18f2f90070335df3ff3 | /squidApp/src/main/java/org/cirdles/squid/gui/RunsViewModel.java | 9038d4cf8d0a7210f2f93833b7a7acd3333da9fd | [
"Apache-2.0"
] | permissive | GarreBrenn/Squid | 4b0995104ef4152d3c2fc3cd3735eda75c41a0dc | 5920786179725f1816d698dd178b9a29cef853a9 | refs/heads/master | 2023-07-18T01:48:02.519989 | 2021-08-29T14:45:46 | 2021-08-29T14:45:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,980 | java | /*
* Copyright 2017 James F. Bowring and CIRDLES.org.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.cirdles.squid.gui;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
import javafx.scene.control.ListCell;
import org.cirdles.squid.prawn.PrawnFile;
import org.cirdles.squid.prawn.PrawnFile.Run;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.function.Predicate;
/**
* @author James F. Bowring
*/
public class RunsViewModel {
public RunsViewModel() {
}
private final ObservableList<PrawnFile.Run> shrimpRuns
= FXCollections.observableArrayList();
public ReadOnlyObjectProperty<ObservableList<PrawnFile.Run>> shrimpRunsProperty() {
return new SimpleObjectProperty<>(shrimpRuns);
}
private final FilteredList<PrawnFile.Run> viewableShrimpRuns = new FilteredList<>(shrimpRuns);
public ReadOnlyObjectProperty<ObservableList<PrawnFile.Run>> viewableShrimpRunsProperty() {
return new SimpleObjectProperty<>(viewableShrimpRuns);
}
public ObjectProperty<Predicate<? super PrawnFile.Run>> filterProperty() {
return viewableShrimpRuns.predicateProperty();
}
public void addRunsList(List<PrawnFile.Run> myShrimpRuns) {
shrimpRuns.clear();
viewableShrimpRuns.clear();
this.shrimpRuns.addAll(myShrimpRuns);
}
/**
* Remove a run (ShrimpRun or spot) from the model
* <p>
* Will also affect viewableShrimpRuns if the Player being removed adheres
* to the filter
*
* @param run - the run to remove
*/
public void remove(Run run) {
shrimpRuns.remove(run);
}
public String showFilteredOverAllCount() {
return " : " + viewableShrimpRuns.size() + " / " + shrimpRuns.size() + " shown";
}
static class SpotNameMatcher implements Predicate<PrawnFile.Run> {
private final String spotName;
public SpotNameMatcher(String spotName) {
this.spotName = spotName;
}
@Override
public boolean test(PrawnFile.Run run) {
return run.getPar().get(0).getValue().toUpperCase(Locale.ENGLISH).trim().startsWith(spotName);
}
}
static class ShrimpFractionListCell extends ListCell<PrawnFile.Run> {
@Override
protected void updateItem(PrawnFile.Run run, boolean empty) {
super.updateItem(run, empty);
if (run == null || empty) {
setText(null);
} else {
setText(
String.format("%1$-" + 20 + "s", run.getPar().get(0).getValue()) // name
+ String.format("%1$-" + 12 + "s", run.getSet().getPar().get(0).getValue())//date
+ String.format("%1$-" + 12 + "s", run.getSet().getPar().get(1).getValue()) //time
+ String.format("%1$-" + 6 + "s", run.getPar().get(2).getValue()) //peaks
+ String.format("%1$-" + 6 + "s", run.getPar().get(3).getValue())); //scans
}
}
}
;
static class ShrimpFractionAbbreviatedListCell extends ListCell<PrawnFile.Run> {
@Override
protected void updateItem(PrawnFile.Run run, boolean empty) {
super.updateItem(run, empty);
if (run == null || empty) {
setText(null);
} else {
setText(
String.format("%1$-" + 20 + "s", run.getPar().get(0).getValue()) // name
+ String.format("%1$-" + 12 + "s", run.getSet().getPar().get(0).getValue())//date
+ String.format("%1$-" + 12 + "s", run.getSet().getPar().get(1).getValue()));
}
}
}
;
/**
* @return the viewableShrimpRuns
*/
public ObservableList<PrawnFile.Run> getViewableShrimpRuns() {
List<PrawnFile.Run> viewableShrimpRunsCopy = new ArrayList<>();
for (int i = 0; i < viewableShrimpRuns.size(); i++) {
viewableShrimpRunsCopy.add(viewableShrimpRuns.get(i));
}
return FXCollections.observableArrayList(viewableShrimpRunsCopy);
}
} | [
"noreply@github.com"
] | GarreBrenn.noreply@github.com |
524058cc942f73d41d7a0ee1887856d2f5535bca | f5e35c20583318b10e3d9c32d447eab599c94734 | /src/com/purchases/dao/UserDAO.java | 7eedc83ff112c265c9f394f5c7b3156f1b36d57e | [] | no_license | GoodbyePlanet/PopularPurchases | a4aee8cd2843c95fc17f5d4007ff0ef9f8a403b8 | cffb36e1ab71f9b99966d050e76daf647aa85876 | refs/heads/master | 2021-06-28T12:05:55.584664 | 2017-09-16T09:11:05 | 2017-09-16T09:11:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 401 | java | package com.purchases.dao;
import java.io.IOException;
import java.util.List;
import com.purchases.entyties.User;
public interface UserDAO {
/**
* Method returns List of all users data on the page: http://localhost:8000/api/users.
* @return
* @throws IOException
*/
public List<User> getAllUsers() throws IOException;
public User getUserByName(String userName) throws IOException;
}
| [
"nemanjavasa@gmail.com"
] | nemanjavasa@gmail.com |
577dfa9cc8c7ce2ceace8c84ac04bb2334ff594a | 80cc33efe7415b17f100b24c13f96ca8ba8269bd | /src/com/posim/depot.java | b92d352c6144064842b9dfb46a79e913cc87cfab | [] | no_license | FishTribe/POS-sim | cb4cef7c1b237373acc6682122a8ee4f59de8d0f | b310c05c094a5c7bd1a52cbf2540e3e73fdff254 | refs/heads/master | 2021-01-10T17:22:28.142460 | 2016-01-05T06:36:32 | 2016-01-05T06:36:32 | 48,971,374 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,420 | java | package com.posim;
/**
* Created by Tomas on 2016/1/5.
* 这是仓库类
* 一个仓库存放若干个商品
* 仓库设定了自己的容量上限,存放了里面商品的数量
*/
public class depot {
public item itemlist[];
public int itemNumber;
public int maxNumber;
depot(int num){
/**
* 初始化仓库
* 新建一个 商品列表[最大容量]
* 获得仓库最大容量
* 设置当前商品数为0
*/
this.itemlist=new item[num];
this.maxNumber=num;
this.itemNumber=0;
}
public int addItem(item add)
/**
* Param:(待添加商品)
* 增加商品
*/
{
if(itemNumber<maxNumber)
{
itemlist[itemNumber]=add;
itemNumber++;
return 1;
}
else
System.out.println("该仓库已满,不能添加商品!");
return 0;
}
public int delItem(item del)
/**
* Param:(待删除商品)
* 删除商品
*/
{
for(int i=0;i<itemNumber;i++)
{
if(itemlist[i]== searchItemById(del.barcode))
{
itemNumber--;
for(int j=i;j<itemNumber;j++)
{
itemlist[j]=itemlist[j+1];
}
return 1;
}
}
System.out.println("商品删除出现错误,商品不存在于该仓库!");
return 0;
}
public int modItem(item modify,item toModify)
/**
* Param:(待修改商品,已修改商品)
* 修改商品属性,将指定商品更换为修改后的商品
*/
{
for(int i=0;i<itemNumber;i++)
{
if(itemlist[i]==searchItemById(modify.barcode))
{
itemlist[i]=toModify;
return 1;
}
}
System.out.println("修改商品属性出错,可能没有这个商品,或格式有误!");
return 0;
}
public item searchItemById(String bar)
/**
* Param:(待查条码)
* 通过条形码查找商品
*/
{
for(int i=0;i<itemNumber;i++)
{
if(itemlist[i].barcode.equals(bar))
{
return itemlist[i];
}
}
System.out.println("所请求的商品不在这个仓库里!");
return null;
}
}
| [
"tomaschow95@outlook.com"
] | tomaschow95@outlook.com |
2a8ab1d7ec7d8238f3275b8fcca98d155f335078 | d7080175f71da784365c77f8d41ab6c2f7879098 | /src/test/java/pages/MoviesPage.java | bf41a182b75c4dd533730534feabe9af2d453a38 | [] | no_license | nelaecoplanet/practico2ejercicio1 | 61b57b87c69eea1e7cb1751cd2b01cf46caaaa34 | d3788a0b23b98c4e6e97e268d136eb85c5cb51cb | refs/heads/master | 2020-09-19T21:58:18.915971 | 2019-12-04T00:55:17 | 2019-12-04T00:55:17 | 224,307,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 45 | java | package pages;
public class MoviesPage {
}
| [
"renzo.parente@abstracta.com.uy"
] | renzo.parente@abstracta.com.uy |
83dbf091f56d3831f3a9f37257b29bd424ae69ed | 18da0c396342249888e5e122c1bc7a8e69ae0a51 | /05-interface/src/shapes/Circle.java | 9d077165fd73eae55d0e8bfbd8ad8b6053671093 | [] | no_license | MoonAzi/COMP-1502-002-W19 | 0aed2cf45ca5b7e9860219fb821fc4422138a013 | 7f08c5259ae3f0d985fc5c627d762a6259361339 | refs/heads/master | 2020-04-25T07:12:35.420331 | 2019-03-26T01:34:57 | 2019-03-26T01:34:57 | 172,606,957 | 0 | 0 | null | 2019-02-26T00:21:07 | 2019-02-26T00:21:06 | null | UTF-8 | Java | false | false | 314 | java | package shapes;
public class Circle extends Shape {
private double r;
public Circle(Point centre, double r) {
points.add(centre);
this.r = r;
}
@Override
public void draw() {
System.out.println("\u25CB");
}
@Override
public double getArea() {
return Math.PI * r * r;
}
}
| [
"jhudson3@mtroyal.ca"
] | jhudson3@mtroyal.ca |
d85b41feb364ea424312d0b890ff78b5a3da9f0a | 63b681d9add8b39dc0f0d6c6f85c73355e984e46 | /src/main/java/com/kissss/appender/AliLogAppender.java | fbad0b282b4b3626414b086fe536f40f901e84ef | [] | no_license | kissss/logback-alilog | 03511c79f327f8bcb9c9bc5d3775574166b6f21e | 5995392247dba2e0edda5e642bb5f5feeb6774f4 | refs/heads/master | 2021-07-13T02:21:54.016982 | 2017-10-18T10:29:54 | 2017-10-18T10:29:54 | 107,392,071 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,192 | java | package com.kissss.appender;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.AppenderBase;
import ch.qos.logback.core.Layout;
import com.aliyun.openservices.log.Client;
import com.aliyun.openservices.log.common.LogItem;
import com.aliyun.openservices.log.exception.LogException;
import com.aliyun.openservices.log.request.PutLogsRequest;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
* Created by XiaoLei on 2017/5/24.
*/
public class AliLogAppender extends AppenderBase<ILoggingEvent> {
private Layout<ILoggingEvent> layout;
private String host;
//存储所有的 logItem
private Map<Integer, LogItem> logItemMap = new ConcurrentHashMap<>();
private String endpoint;
private String accessKeyId;
private String accessKeySecret;
private String projectName;
private String logStore;
private String topic;
private long periodPush = 1000;
private boolean enable;
private String source = "";
private Client logClient;
//1秒钟推送一次
private static final String LEVEL = "level";
private static final String MSG = "_msg";
private static final String TIME = "time";
private static String formatDate(String formatStr) {
SimpleDateFormat sdf = new SimpleDateFormat(formatStr);
return sdf.format(new Date());
}
@Override
protected void append(ILoggingEvent eventObject) {
LogItem logItem = new LogItem();
eventObject.getMDCPropertyMap().forEach(logItem::PushBack);
//索引
logItem.PushBack(LEVEL, eventObject.getLevel().toString());
logItem.PushBack(TIME, formatDate("yyyy-MM-dd HH:mm:ss.SSS"));
logItem.PushBack(MSG, layout.doLayout(eventObject));
logItemMap.put(logItem.hashCode(), logItem);
}
class PutLogsTask extends TimerTask {
@Override
public void run() {
//如果为空 取消
if (logItemMap.isEmpty()) {
return;
}
Vector<LogItem> logGroup = new Vector<>();
logItemMap.entrySet().parallelStream().forEach(entity -> {
logGroup.add(entity.getValue());
//删除
logItemMap.remove(entity.getKey());
});
PutLogsRequest req2 = new PutLogsRequest(projectName, logStore, topic, source, logGroup);
try {
logClient.PutLogs(req2);
} catch (LogException e) {
e.printStackTrace();
}
}
}
@Override
public void start() {
//只有存在值得情况下 才初始化
if (endpoint.contains("_IS_UNDEFINED") || !enable) {
return;
}
logClient = new Client(endpoint, accessKeyId, accessKeySecret);
Timer timer = new Timer();
timer.schedule(new PutLogsTask(), 0, periodPush);
super.start();
}
@Override
public void stop() {
super.stop();
}
public String getEndpoint() {
return endpoint;
}
public void setEndpoint(String endpoint) {
this.endpoint = endpoint;
}
public String getAccessKeyId() {
return accessKeyId;
}
public void setAccessKeyId(String accessKeyId) {
this.accessKeyId = accessKeyId;
}
public String getAccessKeySecret() {
return accessKeySecret;
}
public void setAccessKeySecret(String accessKeySecret) {
this.accessKeySecret = accessKeySecret;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getLogStore() {
return logStore;
}
public void setLogStore(String logStore) {
this.logStore = logStore;
}
public String getTopic() {
return topic;
}
public void setTopic(String topic) {
this.topic = topic;
}
public long getPeriodPush() {
return periodPush;
}
public void setPeriodPush(long periodPush) {
this.periodPush = periodPush;
}
}
| [
"Mr_death@163.com"
] | Mr_death@163.com |
ca4c1650b52c87500576c2b19f1f7e00acd39d28 | 565fc7b1df3466c7102e4edb4189b78bab895819 | /src/main/java/datasource/mybatisconfig/MybatisLocalDataSourceConfig.java | bb654f8dcd5e1c67affee052453647862bbc0965 | [] | no_license | 768001076/zb-util | 63234819daf45f91d0eb40a7c4422fb6a37be5a7 | 324a8bc341e8d1337ce45f4b916e73f07f4b69dd | refs/heads/master | 2020-03-14T22:55:54.991433 | 2018-08-22T06:48:10 | 2018-08-22T06:48:10 | 131,832,169 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,372 | java | package datasource.mybatisconfig;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import javax.sql.DataSource;
/**
* @Description: Local Mapper DataSource 配置
*
* @Author:shijialei
* @Version:1.0
* @Date:2018/3/21
*/
@Component
@MapperScan(basePackages = {"mapper.local"},sqlSessionTemplateRef = "sqlSessionTemplateLocal",sqlSessionFactoryRef = "sqlSessionFactoryLocal")
public class MybatisLocalDataSourceConfig {
@Autowired
@Qualifier("local") DataSource localSource;
@Bean
public SqlSessionFactory sqlSessionFactoryLocal() throws Exception{
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(localSource);
return sqlSessionFactoryBean.getObject();
}
@Bean
public SqlSessionTemplate sqlSessionTemplateLocal() throws Exception{
SqlSessionTemplate sqlSessionTemplate = new SqlSessionTemplate(sqlSessionFactoryLocal());
return sqlSessionTemplate;
}
}
| [
"shijialei"
] | shijialei |
5026221a5fbb04b97221ff4da3e535dcd816dc5f | 06ca8723b737a840f59a9123201dd740d0fbab0b | /src/test/java/CommentTest.java | aeb8264f196854aa76e449a206ddf4b83181a787 | [] | no_license | joe-kramer/seattle-dog-friendly-bars | b7bf42530431306295fbdbe4c7f2a057b827f4a1 | 08988b324f736624fc6c83845ed17676343447a8 | refs/heads/master | 2020-06-27T14:40:16.348971 | 2017-07-13T21:13:54 | 2017-07-13T21:13:54 | 97,060,863 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | import org.junit.*;
import static org.junit.Assert.*;
import org.sql2o.*;
public class CommentTest {
@Rule
public DatabaseRule database = new DatabaseRule();
@Test
public void comment_instanceOf_true() {
Comment commentTest = new Comment("Shitty bar", 1, 1, "Joe");
assertTrue(commentTest instanceof Comment);
}
}
| [
"joekramer1125@gmail.com"
] | joekramer1125@gmail.com |
52e92b4b0ca873d4754bd9a953e45e34158f8597 | 58df55b0daff8c1892c00369f02bf4bf41804576 | /src/um.java | b099073d98c326790180d11311d4db32157d755a | [] | no_license | gafesinremedio/com.google.android.gm | 0b0689f869a2a1161535b19c77b4b520af295174 | 278118754ea2a262fd3b5960ef9780c658b1ce7b | refs/heads/master | 2020-05-04T15:52:52.660697 | 2016-07-21T03:39:17 | 2016-07-21T03:39:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,573 | java | import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
import android.view.accessibility.AccessibilityNodeInfo.CollectionInfo;
import android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo;
class um
extends ut
{
public final Object a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, boolean paramBoolean1, boolean paramBoolean2)
{
return AccessibilityNodeInfo.CollectionItemInfo.obtain(paramInt1, paramInt2, paramInt3, paramInt4, paramBoolean1, false);
}
public final Object a(int paramInt1, int paramInt2, boolean paramBoolean, int paramInt3)
{
return AccessibilityNodeInfo.CollectionInfo.obtain(paramInt1, paramInt2, false, 0);
}
public final Object a(int paramInt, CharSequence paramCharSequence)
{
return new AccessibilityNodeInfo.AccessibilityAction(paramInt, paramCharSequence);
}
public final void a(Object paramObject, CharSequence paramCharSequence)
{
((AccessibilityNodeInfo)paramObject).setError(paramCharSequence);
}
public final void a(Object paramObject1, Object paramObject2)
{
((AccessibilityNodeInfo)paramObject1).addAction((AccessibilityNodeInfo.AccessibilityAction)paramObject2);
}
public final boolean b(Object paramObject1, Object paramObject2)
{
return ((AccessibilityNodeInfo)paramObject1).removeAction((AccessibilityNodeInfo.AccessibilityAction)paramObject2);
}
}
/* Location:
* Qualified Name: um
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
b2764133fb110265d052a0dd864283abddf3ad90 | 53d94add81bd71fb0c46abc2d9b6cd546a30f817 | /src/pousadaprojectjava/Quarto.java | 2eb682aa33a8e1b14f2573daa927872d71113e43 | [] | no_license | L7R0ck/PousadaProject | 72ac69fa09f61c51122ad53ae56682b163181931 | 729d910c9528002471fe0584aded6f5c0df72da6 | refs/heads/master | 2021-08-29T22:14:59.682947 | 2017-12-15T01:45:44 | 2017-12-15T01:45:44 | 114,311,139 | 0 | 1 | null | 2017-12-15T04:08:46 | 2017-12-15T00:56:19 | Java | UTF-8 | Java | false | false | 1,217 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pousadaprojectjava;
/**
*
* @authors
* Gabrielle Rosa
* George Lucas
* José Inaldo
* Jhonatas
* Saionara
*/
public class Quarto {
private int id;
private int NumeroDoQuarto;
private String TipoQuarto;
private float preco;
private String status;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getNumeroDoQuarto() {
return NumeroDoQuarto;
}
public void setNumeroDoQuarto(int NumeroDoQuarto) {
this.NumeroDoQuarto = NumeroDoQuarto;
}
public String getTipoQuarto() {
return TipoQuarto;
}
public void setTipoQuarto(String TipoQuarto) {
this.TipoQuarto = TipoQuarto;
}
public float getPreco() {
return preco;
}
public void setPreco(float preco) {
this.preco = preco;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
| [
"George Lucas Rocha"
] | George Lucas Rocha |
74ce679980b86e26e89adb620b55b469ca360391 | e2f2326ef807eef64c7a8b85c999fe902b80c072 | /src/main/java/com/howtodoinjava/algorithms/MergeSort.java | 713a95987469477af7ee032e25f2a5940b908986 | [
"Apache-2.0"
] | permissive | lokeshgupta1981/Core-Java | e867a9929d654bf9ddbe95708bca80ecfe757232 | a1e249f6bf43898b6e293d41900f68fbc3afbaa2 | refs/heads/master | 2023-08-09T19:05:12.740014 | 2023-08-04T16:49:32 | 2023-08-04T16:49:32 | 213,713,246 | 54 | 89 | Apache-2.0 | 2023-09-05T08:16:19 | 2019-10-08T17:53:32 | Java | UTF-8 | Java | false | false | 1,968 | java | package com.howtodoinjava.algorithms;
import java.util.Arrays;
public class MergeSort {
/* Combining two sub-arrays of arr[] where the
first sub-array consists of elements in the range of arr[l] to arr[m], and the
second sub-array consists of elements in the range of arr[m+1] to arr[r]. */
void merge(int arr[], int l, int m, int r) {
// find out the sizes of the two subarrays that are going to be merged.
int n1 = m - l + 1;
int n2 = r - m;
// Create temporary arrays
int L[] = new int[n1];
int R[] = new int[n2];
// Copy all elements into temporary arrays
for (int i = 0; i < n1; ++i) {
L[i] = arr[l + i];
}
for (int j = 0; j < n2; ++j) {
R[j] = arr[m + 1 + j];
}
// Merge temporary arrays
int i = 0, j = 0; // starting indexes of array L and R
int k = l; // starting index of merged sub-arrays
while (i < n1 && j < n2) {
if (L[i] <= R[j]) {
arr[k] = L[i];
i++;
} else {
arr[k] = R[j];
j++;
}
k++;
}
// copy the elements which are remaining in L sub-array.
while (i < n1) {
arr[k] = L[i];
i++;
k++;
}
// copy the elements which are remaining in R sub-array.
while (j < n2) {
arr[k] = R[j];
j++;
k++;
}
}
void sort(int arr[], int l, int r) {
// check if size of an array is greater than 1 or not
if (l < r) {
int m = (l + r) / 2; // find middle index of an array
sort(arr, l, m); // sort left sub-array
sort(arr, m + 1, r); // sort right sub-array
merge(arr, l, m, r); // merge both sorted sub-arrays
}
}
public static void main(String args[]) {
int arr[] = {10, 8, 9, 4, 3, 2};
System.out.println("Original Array: " + Arrays.toString(arr));
MergeSort ob = new MergeSort();
ob.sort(arr, 0, arr.length - 1);
System.out.println("\nSorted array: " + Arrays.toString(arr));
}
} | [
"howtodoinjava@gmail.com"
] | howtodoinjava@gmail.com |
6f10a805606aa13ad2a825b2c7e0db68ee2bf96f | 3c2e796524ff4b7e8c97eb5c9b07854a302d3fc5 | /src/main/java/ba/infostudio/com/web/rest/errors/ExceptionTranslator.java | b44b872236c8b3bebc2abcf85940bac076ed1247 | [] | no_license | operta/hcmAbsMicroservice | d6d39fd7109694fcfd742bc6ae82f67ea290d6f0 | b5a3dfb57220c7d1ee2f1e83b514a24f40c2748a | refs/heads/master | 2020-03-08T14:17:25.357090 | 2019-05-17T12:09:52 | 2019-05-17T12:09:52 | 128,181,049 | 0 | 1 | null | 2018-11-09T13:46:05 | 2018-04-05T08:49:38 | Java | UTF-8 | Java | false | false | 4,604 | java | package ba.infostudio.com.web.rest.errors;
import ba.infostudio.com.web.rest.util.HeaderUtil;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.NativeWebRequest;
import org.zalando.problem.DefaultProblem;
import org.zalando.problem.Problem;
import org.zalando.problem.ProblemBuilder;
import org.zalando.problem.Status;
import org.zalando.problem.spring.web.advice.ProblemHandling;
import org.zalando.problem.spring.web.advice.validation.ConstraintViolationProblem;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.stream.Collectors;
/**
* Controller advice to translate the server side exceptions to client-friendly json structures.
* The error response follows RFC7807 - Problem Details for HTTP APIs (https://tools.ietf.org/html/rfc7807)
*/
@ControllerAdvice
public class ExceptionTranslator implements ProblemHandling {
/**
* Post-process Problem payload to add the message key for front-end if needed
*/
@Override
public ResponseEntity<Problem> process(@Nullable ResponseEntity<Problem> entity, NativeWebRequest request) {
if (entity == null || entity.getBody() == null) {
return entity;
}
Problem problem = entity.getBody();
if (!(problem instanceof ConstraintViolationProblem || problem instanceof DefaultProblem)) {
return entity;
}
ProblemBuilder builder = Problem.builder()
.withType(Problem.DEFAULT_TYPE.equals(problem.getType()) ? ErrorConstants.DEFAULT_TYPE : problem.getType())
.withStatus(problem.getStatus())
.withTitle(problem.getTitle())
.with("path", request.getNativeRequest(HttpServletRequest.class).getRequestURI());
if (problem instanceof ConstraintViolationProblem) {
builder
.with("violations", ((ConstraintViolationProblem) problem).getViolations())
.with("message", ErrorConstants.ERR_VALIDATION);
return new ResponseEntity<>(builder.build(), entity.getHeaders(), entity.getStatusCode());
} else {
builder
.withCause(((DefaultProblem) problem).getCause())
.withDetail(problem.getDetail())
.withInstance(problem.getInstance());
problem.getParameters().forEach(builder::with);
if (!problem.getParameters().containsKey("message") && problem.getStatus() != null) {
builder.with("message", "error.http." + problem.getStatus().getStatusCode());
}
return new ResponseEntity<>(builder.build(), entity.getHeaders(), entity.getStatusCode());
}
}
@Override
public ResponseEntity<Problem> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, @Nonnull NativeWebRequest request) {
BindingResult result = ex.getBindingResult();
List<FieldErrorVM> fieldErrors = result.getFieldErrors().stream()
.map(f -> new FieldErrorVM(f.getObjectName(), f.getField(), f.getCode()))
.collect(Collectors.toList());
Problem problem = Problem.builder()
.withType(ErrorConstants.CONSTRAINT_VIOLATION_TYPE)
.withTitle("Method argument not valid")
.withStatus(defaultConstraintViolationStatus())
.with("message", ErrorConstants.ERR_VALIDATION)
.with("fieldErrors", fieldErrors)
.build();
return create(ex, problem, request);
}
@ExceptionHandler(BadRequestAlertException.class)
public ResponseEntity<Problem> handleBadRequestAlertException(BadRequestAlertException ex, NativeWebRequest request) {
return create(ex, request, HeaderUtil.createFailureAlert(ex.getEntityName(), ex.getErrorKey(), ex.getMessage()));
}
@ExceptionHandler(ConcurrencyFailureException.class)
public ResponseEntity<Problem> handleConcurrencyFailure(ConcurrencyFailureException ex, NativeWebRequest request) {
Problem problem = Problem.builder()
.withStatus(Status.CONFLICT)
.with("message", ErrorConstants.ERR_CONCURRENCY_FAILURE)
.build();
return create(ex, problem, request);
}
}
| [
"dzanoperta@yahoo.com"
] | dzanoperta@yahoo.com |
a9cef99ea6cf67daa2373226651661b6d8457716 | 2e032b350dc3bf8260140d2482104f8a225d22cb | /src/ue3/Taschenrechner.java | d5806b8ab6b56d94349bcda380e30270b4a69dd5 | [] | no_license | AK4738/1810653260_UE3 | fcd4a38aafc8ae73ced130e50643d10aa9d90033 | f00c6f733cb50230d2b6329ddcc92d931ec82614 | refs/heads/master | 2020-04-08T19:05:40.439483 | 2018-12-05T20:42:49 | 2018-12-05T20:42:49 | 159,639,353 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package ue3;
public class Taschenrechner {
public static double addition (double a, double b){
return a+b;
}
public static double subtraktion (double a, double b){
return a-b;
}
public static double multiplikation (double a, double b){
return a*b;
}
public static double division (double a, double b){
return a/b;
}
}
| [
"1810653260@stud.fh-kufstein.ac.at"
] | 1810653260@stud.fh-kufstein.ac.at |
b5b208e4c00ff7ca04949f020c54c757afe14b26 | 93243fb514900ed82f06008daabafde48c7110ec | /app/src/main/java/de/codecrafters/tableviewexample/data/DataFactory.java | bee5ba41c6330d34c795b7d8be5716403ed0b18b | [
"Apache-2.0"
] | permissive | Euktl/SortableTableView | 631e7a110d4923f72b92c282328c5e5e0bf21578 | d3f4bde8952128049ed8556288dc16ceb70d328c | refs/heads/master | 2023-04-16T19:38:47.187816 | 2021-04-17T13:39:19 | 2021-04-17T13:39:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,202 | java | package de.codecrafters.tableviewexample.data;
import de.codecrafters.tableviewexample.R;
import java.util.ArrayList;
import java.util.List;
/**
* A factory that provides data for demonstration porpuses.
*
* @author ISchwarz
*/
public final class DataFactory {
/**
* Creates a list of cars.
*
* @return The created list of cars.
*/
public static List<Car> createCarList() {
final CarProducer audi = new CarProducer(R.mipmap.audi, "Audi");
final Car audiA1 = new Car(audi, "A1", 150, 25000);
final Car audiA3 = new Car(audi, "A3", 120, 35000);
final Car audiA4 = new Car(audi, "A4", 210, 42000);
final Car audiA5 = new Car(audi, "S5", 333, 60000);
final Car audiA6 = new Car(audi, "A6", 250, 55000);
final Car audiA7 = new Car(audi, "A7", 420, 87000);
final Car audiA8 = new Car(audi, "A8", 320, 110000);
final CarProducer bmw = new CarProducer(R.mipmap.bmw, "BMW");
final Car bmw1 = new Car(bmw, "1er", 170, 25000);
final Car bmw3 = new Car(bmw, "3er", 230, 42000);
final Car bmwX3 = new Car(bmw, "X3", 230, 45000);
final Car bmw4 = new Car(bmw, "4er", 250, 39000);
final Car bmwM4 = new Car(bmw, "M4", 350, 60000);
final Car bmw5 = new Car(bmw, "5er", 230, 46000);
final CarProducer porsche = new CarProducer(R.mipmap.porsche, "Porsche");
final Car porsche911 = new Car(porsche, "911", 280, 45000);
final Car porscheCayman = new Car(porsche, "Cayman", 330, 52000);
final Car porscheCaymanGT4 = new Car(porsche, "Cayman GT4", 385, 86000);
final List<Car> cars = new ArrayList<>();
cars.add(audiA3);
cars.add(audiA1);
cars.add(porscheCayman);
cars.add(audiA7);
cars.add(audiA8);
cars.add(audiA4);
cars.add(bmwX3);
cars.add(porsche911);
cars.add(bmw1);
cars.add(audiA6);
cars.add(audiA5);
cars.add(bmwM4);
cars.add(bmw5);
cars.add(porscheCaymanGT4);
cars.add(bmw3);
cars.add(bmw4);
return cars;
}
}
| [
"schwarz-ingo@web.de"
] | schwarz-ingo@web.de |
238c2e6c8b729781d88139dc8d1d29a6b0d0ef7c | 5725dfc0c0c7d16b0926a48ee2f833353699f01c | /src/main/java/com/harkue/oss/gharchive/entity/GHUser.java | 8f5fa5fc873e33cb9be8d40bd21fca2e5e8153dd | [
"MIT"
] | permissive | harkue/oss-insight | 332d51194b70a68c78ac3f60076531ddba7a3268 | df8f9347f8d93f3557cf41c9375aedd0d943f971 | refs/heads/master | 2023-07-27T01:42:09.772714 | 2020-09-10T13:17:24 | 2020-09-10T13:17:24 | 275,311,108 | 1 | 0 | MIT | 2021-09-08T08:00:34 | 2020-06-27T06:09:21 | Java | UTF-8 | Java | false | false | 1,247 | java | package com.harkue.oss.gharchive.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class GHUser {
private Integer id;
private String login;
@JsonProperty("node_id")
private String nodeId;
@JsonProperty("display_login")
private String displayLogin;
@JsonProperty("gravatar_id")
private String gravatarId;
private String url;
@JsonProperty("avatar_url")
private String avatarUrl;
@JsonProperty("html_url")
private String htmlUrl;
@JsonProperty("followers_url")
private String followersUrl;
@JsonProperty("following_url")
private String followingUrl;
@JsonProperty("gists_url")
private String gistsUrl;
@JsonProperty("starred_url")
private String starredUrl;
@JsonProperty("subscriptions_url")
private String subscriptionsUrl;
@JsonProperty("organizations_url")
private String organizationsUrl;
@JsonProperty("repos_url")
private String reposUrl;
@JsonProperty("events_url")
private String eventsUrl;
@JsonProperty("received_events_url")
private String receivedEventsUrl;
private String type;
@JsonProperty("site_admin")
private String siteAdmin;
}
| [
"harkue@hotmail.com"
] | harkue@hotmail.com |
ac7b53e428cd029214f77bae57839ca0ca3be8db | 2e5ce97698373b43df7fefa2fd7bcc762530a972 | /SLOTGAMES_WEB/src/test/java/stepDefinition_SkinfiriLotto/SkinfiriLotto_Web_Balance_Deduction_AccordingToBetType1_4.java | 5373c7c862e38f0bf1c8bcf7107dc34173ae402b | [] | no_license | pavanysecit/SLOTGAMES_WEB | c44795d43b2b844f988dbf4c9c665985fc59a9e4 | ad2f40ca04441651b159da8f812b069c92d52d00 | refs/heads/master | 2021-02-17T20:50:31.356696 | 2020-08-18T06:00:49 | 2020-08-18T06:00:49 | 245,126,975 | 0 | 0 | null | 2020-10-13T20:05:13 | 2020-03-05T09:59:12 | Java | UTF-8 | Java | false | false | 4,617 | java | package stepDefinition_SkinfiriLotto;
import java.io.File;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.sikuli.script.Finder;
import org.sikuli.script.Match;
import org.sikuli.script.Pattern;
import org.sikuli.script.Screen;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class SkinfiriLotto_Web_Balance_Deduction_AccordingToBetType1_4 {
WebDriver driver;
@Given("^Chrome browser, valid URL, valid login details, Skinfiri Lotto slot game, bet type as (\\d+)\\.(\\d+), bet value as TWO, balance and spin button$")
public void chrome_browser_valid_URL_valid_login_details_Skinfiri_Lotto_slot_game_bet_type_as_bet_value_as_TWO_balance_and_spin_button(int arg1, int arg2) throws Throwable {
this.driver = SkinfiriLotto_URL_Login.getDriver();
}
@When("^Open the Skinfiri Lotto slot game by entering the valid URL in browser, enter the valid login details, select the bet type as (\\d+)\\.(\\d+), select the bet value as TWO, click on spin button and check the balance$")
public void open_the_Skinfiri_Lotto_slot_game_by_entering_the_valid_URL_in_browser_enter_the_valid_login_details_select_the_bet_type_as_select_the_bet_value_as_TWO_click_on_spin_button_and_check_the_balance(int arg1, int arg2) throws Throwable {
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("transferInput")));
WebElement balT = driver.findElement(By.id("transferInput"));
balT.clear();
Thread.sleep(1000);
balT.sendKeys("300");
Thread.sleep(2000);
driver.findElement(By.className("Transfer_Ok_but")).click();
Screen screen=new Screen();
Pattern spin1=new Pattern("E:/Sikuli Images/SkinfiriLotto/spin.png");
screen.wait(spin1, 60);
TakesScreenshot tsc=(TakesScreenshot)driver;
File sct = driver.findElement(By.xpath("//*[@id='iframeSlotGame']")).getScreenshotAs(OutputType.FILE);
String path = System.getProperty("user.dir")+"E:\\Sikuli Images\\firstBetvalue.PNG";
Pattern pat1=new Pattern("E:/Sikuli Images/SkinfiriLotto/betvalue_1_4.png");
Pattern spin=new Pattern("E:/Sikuli Images/SkinfiriLotto/spin.png");
//clicking on Bet VALUE
screen.click(pat1);
Thread.sleep(2000);
screen.click(spin);
Thread.sleep(6000);
//comparing the credit value should be 0.01
Pattern credit1=new Pattern("E:/Sikuli Images/SkinfiriLotto/creditvalue_1.png");
Finder finder =new Finder(screen.capture().getImage());
String ht = finder.find(credit1);
double score=20;
System.out.println("the value of ht"+" "+ht);
if(finder.hasNext())
{
Match m=finder.next();
System.out.println("Match Found with: "+(m.getScore())*100+"%");
score=(m.getScore())*100;
System.out.println("Credit value comparision happened successfully. Test case passed");
finder.destroy();
}
else
{
System.out.println("Comparision failed. Test case failed");
}
System.out.println("Credit comparision value equals to: "+" "+score +"%");
Assert.assertTrue(score > 97);
//comparing the balance after spinning should be deducted by 2 value
Pattern pat=new Pattern("E:/Sikuli Images/SkinfiriLotto/balance1_4.png");
Finder finder1 =new Finder(screen.capture().getImage());
String ht1 = finder1.find(pat);
double score1=20;
System.out.println("the value of ht"+" "+ht1);
if(finder1.hasNext())
{
Match m1=finder1.next();
System.out.println("Match Found with: "+(m1.getScore())*100+"%");
score1=(m1.getScore())*100;
System.out.println("Comparision happened successfully. Test case passed");
finder1.destroy();
}
else
{
System.out.println("Comparision failed. Test case failed");
}
System.out.println("Comparision value equals to: "+" "+score1 +"%");
Assert.assertTrue(score1 > 97);
}
@Then("^Current Balance should get deducted by TWO as bet type is selected as (\\d+)\\.(\\d+) and bet value as (\\d+) in Skinfiri Lotto game$")
public void current_Balance_should_get_deducted_by_TWO_as_bet_type_is_selected_as_and_bet_value_as_in_Skinfiri_Lotto_game(int arg1, int arg2, int arg3) throws Throwable {
Thread.sleep(3000);
driver.quit();
}
} | [
"pavan.kumar@ysecit.com"
] | pavan.kumar@ysecit.com |
2cd9505b467a7797c0eea697f0b8ef7e9d6eb286 | 64afa4237ca41b28438f3b32bd715d54cf187f81 | /src/main/java/io/github/jmcleodfoss/voluminouspaginationskin/VoluminousPaginationSkin.java | 8ccfd747153b3009599fd8390f71d0ba0e89d3d3 | [
"MIT"
] | permissive | Jmcleodfoss/VoluminousPaginationSkin | 76d8b32a15934a4b1481abcd83441b92505d74b2 | 95a758ea3be6e007c2cf3d417118c687af85090f | refs/heads/master | 2023-02-28T08:32:01.432178 | 2021-01-30T11:14:26 | 2021-01-30T11:14:26 | 248,247,637 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,476 | java | package io.github.jmcleodfoss.voluminouspaginationskin;
import java.util.Locale;
import java.util.ResourceBundle;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.ListChangeListener;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.Pagination;
import javafx.scene.control.skin.PaginationSkin;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.Region;
/**
* A pagination skin with additional controls for use with Pagination objects which
* must display a large number of pages. It adds the following controls to
* the navigation section:
* <ul>
* <li>\u23ee, Jump to first page</li>
* <li>\u23ea, Jump backward by 10%</li>
* <li>\u23e9, Jump forward by 10%</li>
* <li>\u23ed, Jump to last page</li>
* </ul>
*
* This is for JavaFX 8. Later versions should extend
* javafx.scene.control.skin.PaginationSkin
*
* This was inspired by @see <a href="https://stackoverflow.com/questions/31540001">Stack Overflow Question 31540001</a>
* with code copied from @see <a href="github.com/openjdk/jfx/blob/master/modules/javafx.controls/src/main/java/javafx/scene/control/skin/PaginationSkin.java">OpenJDK implementation of PaginationSkin</a>
*
* CSS (including arrow shape definitions) are in @link{resources/css/VoluminousPaginationSkin.css}
*/
public class VoluminousPaginationSkin extends PaginationSkin
{
/** The name of the properties file containing the accessible strings. */
private final String RESOURCE_SOURCE = "io.github.jmcleodfoss.voluminouspaginationskin.accessibility";
/** THe default relative distance by which to jump for jumpBackward and jumpForward */
private static final double DEFAULT_JUMP_FRACTION = 0.10;
/** The relative distance by which to jump for jumpBackward and jumpForward */
private DoubleProperty jumpFraction;
/** The container for all the navigation controls, constructed by the
* PaginationSkin constructor.
*/
private final HBox controlBox;
/** The "next" arrow in the set of navigation controls. This is the last
* button created in this section by the parent class constructor, and
* is used to trigger addition of the new buttons when needed.
*/
private final Button nextArrowButton;
/** The button to jump to the first page */
private Button firstArrowButton;
/** The button to jump backward by (Number of pages) * jumpFraction */
private Button jumpBackwardButton;
/** The button to jump forward by (Number of pages) * jumpFraction */
private Button jumpForwardButton;
/** The button to jump to the last page */
private Button lastArrowButton;
/** The resource bundle with the accessibility resources */
private ResourceBundle accessibility;
/** Create a skin for the given pagination.
* @param pagination The Pagination object to skin
*/
public VoluminousPaginationSkin(final Pagination pagination)
{
this(pagination, DEFAULT_JUMP_FRACTION);
}
/** Create a skin for the given pagination.
* @param pagination The Pagination object to skin
* @param jumpFraction The relative amount to jump by for jumpForward and jumpBackward
*/
public VoluminousPaginationSkin(final Pagination pagination, double jumpFraction)
{
super(pagination);
this.jumpFraction = new SimpleDoubleProperty(jumpFraction);
if (accessibility == null)
accessibility = ResourceBundle.getBundle(RESOURCE_SOURCE, Locale.getDefault(), this.getClass().getClassLoader());
Node control = pagination.lookup(".control-box");
assert control instanceof HBox;
controlBox = (HBox)control;
nextArrowButton = (Button)controlBox.getChildren().get(controlBox.getChildren().size()-1);
double minButtonSize = nextArrowButton.getMinWidth();
firstArrowButton = createNavigationButton("first-arrow", "first-arrow-button", "Accessibility.title.Pagination.FirstButton", minButtonSize);
firstArrowButton.setOnAction(new EventHandler<ActionEvent>(){
@Override
public void handle(ActionEvent t)
{
getNode().requestFocus();
pagination.setCurrentPageIndex(0);
}
});
firstArrowButton.disableProperty().bind(pagination.currentPageIndexProperty().isEqualTo(0));
jumpBackwardButton = createNavigationButton("jump-backward-arrow", "jump-backward-arrow-button", "Accessibility.title.Pagination.JumpForwardButton", minButtonSize);
jumpBackwardButton.setOnAction(new EventHandler<ActionEvent>(){
@Override
public void handle(ActionEvent t)
{
int currentPage = pagination.getCurrentPageIndex();
int target = Math.max(0, currentPage - jumpDistance());
getNode().requestFocus();
pagination.setCurrentPageIndex(target);
}
});
jumpBackwardButton.disableProperty().bind(pagination.currentPageIndexProperty().lessThan(pagination.pageCountProperty().multiply(this.jumpFraction)));
jumpForwardButton = createNavigationButton("jump-forward-arrow", "jump-forward-arrow-button", "Accessibility.title.Pagination.JumpBackwardButton", minButtonSize);
jumpForwardButton.setOnAction(new EventHandler<ActionEvent>(){
@Override
public void handle(ActionEvent t)
{
int currentPage = pagination.getCurrentPageIndex();
int maxPage = pagination.getPageCount();
int target = Math.min(maxPage, currentPage + jumpDistance());
getNode().requestFocus();
pagination.setCurrentPageIndex(target);
}
});
jumpForwardButton.disableProperty().bind(pagination.currentPageIndexProperty().greaterThan(pagination.pageCountProperty().multiply(1.0 - this.jumpFraction.get())));
lastArrowButton = createNavigationButton("last-arrow", "last-arrow-button", "Accessibility.title.Pagination.LastButton", minButtonSize);
lastArrowButton.setOnAction(new EventHandler<ActionEvent>(){
@Override
public void handle(ActionEvent t)
{
getNode().requestFocus();
pagination.setCurrentPageIndex(pagination.getPageCount());
}
});
lastArrowButton.disableProperty().bind(pagination.currentPageIndexProperty().isEqualTo(pagination.pageCountProperty().subtract(1)));
controlBox.getChildren().addListener(new ListChangeListener<Node>(){
@Override
public void onChanged(ListChangeListener.Change c)
{
while (c.next()){
if ( c.wasAdded()
&& !c.wasRemoved()
&& c.getAddedSize() == 1
&& c.getAddedSubList().get(0) == nextArrowButton
&& !controlBox.getChildren().contains(jumpBackwardButton)){
updateNavigation();
}
}
}
});
// Load the style sheet once the scene becomes available
firstArrowButton.parentProperty().addListener(new ChangeListener<Parent>(){
@Override
public void changed(ObservableValue parent, Parent oldValue, Parent newValue)
{
if (firstArrowButton.getScene() != null)
firstArrowButton.getScene().getStylesheets().add(getClass().getResource("/css/VoluminousPaginationSkin.css").toExternalForm());
}
});
updateNavigation();
}
/** Create a navigation button.
* @param graphicCSSClass The CSS class to use for the graphic
* displayed in the button
* @param buttonCSSClass The CSS class used for the button
* @param accessibilityProperty The key to look up for the accessible text.
* @param minButtonSize The minimum button size used by all
* buttons in the navigation container
* @return A button with the given styles associated with it.
*/
private Button createNavigationButton(String graphicCSSClass, String buttonCSSClass, String accessibilityProperty, double minButtonSize)
{
StackPane pane = new StackPane();
pane.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE);
pane.getStyleClass().add(graphicCSSClass);
Button button = new Button("");
button.setMinSize(minButtonSize, minButtonSize);
button.prefWidthProperty().bind(button.minWidthProperty());
button.prefHeightProperty().bind(button.minWidthProperty());
button.getStyleClass().add(buttonCSSClass);
button.setFocusTraversable(false);
button.setGraphic(pane);
if (accessibility.keySet().contains(accessibilityProperty))
button.setAccessibleText(accessibility.getString(accessibilityProperty));
return button;
}
/** Get the jump fraction value
* @return The jumpFraction
*/
public double getJumpFraction()
{
return jumpFraction.get();
}
/** Get the jump fraction property
* @return The jumpFraction property
*/
public DoubleProperty getJumpFractionProperty()
{
return jumpFraction;
}
/** Calculate the distance to jump by based on the number of pages.
* @return The distance to jump.
* @see jumpFraction
*/
private int jumpDistance()
{
Pagination pagination = getSkinnable();
int maxPage = pagination.getPageCount();
return (int)(maxPage * jumpFraction.get());
}
/** Set the jump fraction to a new value.
* @param newJumpFraction The new jump fraction value
*/
public void setJumpFraction(double newJumpFraction)
{
jumpFraction.set(newJumpFraction);
}
/** Add the new navigation buttons to the navigation container */
private void updateNavigation()
{
controlBox.getChildren().add(0, jumpBackwardButton);
controlBox.getChildren().add(0, firstArrowButton);
controlBox.getChildren().add(jumpForwardButton);
controlBox.getChildren().add(lastArrowButton);
controlBox.applyCss();
}
}
| [
"jmcleodfoss@gmail.com"
] | jmcleodfoss@gmail.com |
f64f4956927202b0ad7f60f4466c56639b9ae831 | 7ae479ad2b100381d1b09cec5d1fec5ceff21126 | /src/com/volkodav4ik/paint/DisplayDriver.java | 94a6c51f20a917d48cea1b5c0c0afa2397437915 | [] | no_license | volkodav4ik/Java_Elementary_Moving_Shapes | a831f5d65024b3b4d3ed9d91905f02899e554790 | f8b184f4bd763c54870d4e46ed685b928c3a05b6 | refs/heads/master | 2021-03-11T16:29:58.027966 | 2020-03-25T08:47:11 | 2020-03-25T08:47:11 | 246,542,676 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 497 | java | package com.volkodav4ik.paint;
public interface DisplayDriver {
void setColor(String hex);
void colorOfSelection(String hex);
void drawOval(double x, double y, double diameter);
void drawTriangle(double x, double y, double side);
void drawSquare(double x, double y, double side);
void drawSelectedOval(double x, double y, double size);
void drawSelectedTriangle(double x, double y, double size);
void drawSelectedSquare(double x, double y, double size);
}
| [
"volkodav4ik1990@gmail.com"
] | volkodav4ik1990@gmail.com |
cdc389f91e7bd8d303443d596552a8ddfaa9bbd5 | c1b0bcf11f432291ea5ccb167fc407e86603ae1f | /app/src/main/java/com/codepath/apps/simpletwitterclient/fragments/MentionsTimelineFragment.java | 892f57d31ce14d778ec3d2d99b844516c5312a0a | [] | no_license | rtteal/simple-twitter-client | cc6f36825d4b63efc17e4aeb169b65d3ac6f1660 | b42fff78eff5aac6dc97877ef2c8ee9e96ede591 | refs/heads/master | 2021-01-13T01:40:39.004363 | 2015-03-02T05:03:25 | 2015-03-02T05:03:25 | 30,954,787 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | package com.codepath.apps.simpletwitterclient.fragments;
import com.codepath.apps.simpletwitterclient.TwitterClient;
public class MentionsTimelineFragment extends TweetsListFragment {
public MentionsTimelineFragment(){
setUrl(TwitterClient.MENTIONS);
}
}
| [
"rtteal@gmail.com"
] | rtteal@gmail.com |
e8665feaca1660d567693c232217ee83070ef885 | 19e6d10be82898207bdfc0f9e681909a2b3f86e1 | /src/java/entities/Herramientasxempcomite.java | 7ebb2b2cde127b35713169c26de1b9555b20e889 | [] | no_license | valen92/comitemantenimiento | 78918bf41b920a97cf2be26040955c40eb5627e1 | d33fd93dc6270bc480f5b0f860ba4d0e5b3b82ba | refs/heads/master | 2020-05-22T12:20:21.993330 | 2015-09-09T05:19:15 | 2015-09-09T05:19:15 | 38,721,296 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,804 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Alexandra
*/
@Entity
@Table(name = "herramientasxempcomite")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Herramientasxempcomite.findAll", query = "SELECT h FROM Herramientasxempcomite h"),
@NamedQuery(name = "Herramientasxempcomite.findByIdHerramientasxEmpComite", query = "SELECT h FROM Herramientasxempcomite h WHERE h.idHerramientasxEmpComite = :idHerramientasxEmpComite"),
@NamedQuery(name = "Herramientasxempcomite.findByDescripcionHerramempcomite", query = "SELECT h FROM Herramientasxempcomite h WHERE h.descripcionHerramempcomite = :descripcionHerramempcomite"),
@NamedQuery(name = "Herramientasxempcomite.findByDisponibilidadHerramempcomite", query = "SELECT h FROM Herramientasxempcomite h WHERE h.disponibilidadHerramempcomite = :disponibilidadHerramempcomite"),
@NamedQuery(name = "Herramientasxempcomite.findByCodigoHerramempcomite", query = "SELECT h FROM Herramientasxempcomite h WHERE h.codigoHerramempcomite = :codigoHerramempcomite"),
@NamedQuery(name = "Herramientasxempcomite.findByEstadoHerramempcomite", query = "SELECT h FROM Herramientasxempcomite h WHERE h.estadoHerramempcomite = :estadoHerramempcomite"),
@NamedQuery(name = "Herramientasxempcomite.findByCantidadHerramempcomite", query = "SELECT h FROM Herramientasxempcomite h WHERE h.cantidadHerramempcomite = :cantidadHerramempcomite"),
@NamedQuery(name = "Herramientasxempcomite.findByPrecioHerramempcomite", query = "SELECT h FROM Herramientasxempcomite h WHERE h.precioHerramempcomite = :precioHerramempcomite")})
public class Herramientasxempcomite implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "idHerramientasxEmpComite")
private Integer idHerramientasxEmpComite;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "descripcion_herramempcomite")
private String descripcionHerramempcomite;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 13)
@Column(name = "disponibilidad_herramempcomite")
private String disponibilidadHerramempcomite;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 10)
@Column(name = "codigo_herramempcomite")
private String codigoHerramempcomite;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 15)
@Column(name = "estado_herramempcomite")
private String estadoHerramempcomite;
@Basic(optional = false)
@NotNull
@Column(name = "cantidad_herramempcomite")
private int cantidadHerramempcomite;
@Basic(optional = false)
@NotNull
@Column(name = "precio_Herramempcomite")
private int precioHerramempcomite;
@JoinColumn(name = "Fk_idMarcasHerramientas", referencedColumnName = "idMarcasHerramientas")
@ManyToOne(optional = false)
private Marcasherramientas fkidMarcasHerramientas;
@JoinColumn(name = "Fk_idUsuarios", referencedColumnName = "idUsuarios")
@ManyToOne(optional = false)
private Usuarios fkidUsuarios;
@JoinColumn(name = "Fk_idEmpresas", referencedColumnName = "idEmpresas")
@ManyToOne(optional = false)
private Empresas fkidEmpresas;
@JoinColumn(name = "Fk_idHerramientas", referencedColumnName = "idHerramientas")
@ManyToOne(optional = false)
private Herramientas fkidHerramientas;
public Herramientasxempcomite() {
}
public Herramientasxempcomite(Integer idHerramientasxEmpComite) {
this.idHerramientasxEmpComite = idHerramientasxEmpComite;
}
public Herramientasxempcomite(Integer idHerramientasxEmpComite, String descripcionHerramempcomite, String disponibilidadHerramempcomite, String codigoHerramempcomite, String estadoHerramempcomite, int cantidadHerramempcomite, int precioHerramempcomite) {
this.idHerramientasxEmpComite = idHerramientasxEmpComite;
this.descripcionHerramempcomite = descripcionHerramempcomite;
this.disponibilidadHerramempcomite = disponibilidadHerramempcomite;
this.codigoHerramempcomite = codigoHerramempcomite;
this.estadoHerramempcomite = estadoHerramempcomite;
this.cantidadHerramempcomite = cantidadHerramempcomite;
this.precioHerramempcomite = precioHerramempcomite;
}
public Integer getIdHerramientasxEmpComite() {
return idHerramientasxEmpComite;
}
public void setIdHerramientasxEmpComite(Integer idHerramientasxEmpComite) {
this.idHerramientasxEmpComite = idHerramientasxEmpComite;
}
public String getDescripcionHerramempcomite() {
return descripcionHerramempcomite;
}
public void setDescripcionHerramempcomite(String descripcionHerramempcomite) {
this.descripcionHerramempcomite = descripcionHerramempcomite;
}
public String getDisponibilidadHerramempcomite() {
return disponibilidadHerramempcomite;
}
public void setDisponibilidadHerramempcomite(String disponibilidadHerramempcomite) {
this.disponibilidadHerramempcomite = disponibilidadHerramempcomite;
}
public String getCodigoHerramempcomite() {
return codigoHerramempcomite;
}
public void setCodigoHerramempcomite(String codigoHerramempcomite) {
this.codigoHerramempcomite = codigoHerramempcomite;
}
public String getEstadoHerramempcomite() {
return estadoHerramempcomite;
}
public void setEstadoHerramempcomite(String estadoHerramempcomite) {
this.estadoHerramempcomite = estadoHerramempcomite;
}
public int getCantidadHerramempcomite() {
return cantidadHerramempcomite;
}
public void setCantidadHerramempcomite(int cantidadHerramempcomite) {
this.cantidadHerramempcomite = cantidadHerramempcomite;
}
public int getPrecioHerramempcomite() {
return precioHerramempcomite;
}
public void setPrecioHerramempcomite(int precioHerramempcomite) {
this.precioHerramempcomite = precioHerramempcomite;
}
public Marcasherramientas getFkidMarcasHerramientas() {
return fkidMarcasHerramientas;
}
public void setFkidMarcasHerramientas(Marcasherramientas fkidMarcasHerramientas) {
this.fkidMarcasHerramientas = fkidMarcasHerramientas;
}
public Usuarios getFkidUsuarios() {
return fkidUsuarios;
}
public void setFkidUsuarios(Usuarios fkidUsuarios) {
this.fkidUsuarios = fkidUsuarios;
}
public Empresas getFkidEmpresas() {
return fkidEmpresas;
}
public void setFkidEmpresas(Empresas fkidEmpresas) {
this.fkidEmpresas = fkidEmpresas;
}
public Herramientas getFkidHerramientas() {
return fkidHerramientas;
}
public void setFkidHerramientas(Herramientas fkidHerramientas) {
this.fkidHerramientas = fkidHerramientas;
}
@Override
public int hashCode() {
int hash = 0;
hash += (idHerramientasxEmpComite != null ? idHerramientasxEmpComite.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Herramientasxempcomite)) {
return false;
}
Herramientasxempcomite other = (Herramientasxempcomite) object;
if ((this.idHerramientasxEmpComite == null && other.idHerramientasxEmpComite != null) || (this.idHerramientasxEmpComite != null && !this.idHerramientasxEmpComite.equals(other.idHerramientasxEmpComite))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entities.Herramientasxempcomite[ idHerramientasxEmpComite=" + idHerramientasxEmpComite + " ]";
}
}
| [
"Valentina@Valen-PC"
] | Valentina@Valen-PC |
5c40f13bc584b6835b173b253860768e8264e9bc | 0fb7a2ed774983f2ac12c8403b6269808219e9bc | /yikatong-core/src/main/java/com/alipay/api/domain/AlipaySecurityProdXwbtestprodQueryModel.java | d07c4a5682e9e29c431bedb812c3edfcd14a230c | [] | no_license | zhangzh56/yikatong-parent | e605b4025c934fb4099d5c321faa3a48703f8ff7 | 47e8f627ba3471eff71f593189e82c6f08ceb1a3 | refs/heads/master | 2020-03-19T11:23:47.000077 | 2018-04-26T02:26:48 | 2018-04-26T02:26:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 859 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 徐伟波测试用
*
* @author auto create
* @since 1.0, 2018-03-08 16:41:07
*/
public class AlipaySecurityProdXwbtestprodQueryModel extends AlipayObject {
private static final long serialVersionUID = 4189595611251515955L;
/**
* 省份编码,国标码
*/
@ApiField("province_code")
private String provinceCode;
/**
* wert
*/
@ApiField("qwe_dfgfd")
private String qweDfgfd;
public String getProvinceCode() {
return this.provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
public String getQweDfgfd() {
return this.qweDfgfd;
}
public void setQweDfgfd(String qweDfgfd) {
this.qweDfgfd = qweDfgfd;
}
}
| [
"xiangyu.zhang@foxmail.com"
] | xiangyu.zhang@foxmail.com |
08a8a9a7ae4e03b7aa747b8a1fcbf390d2a46404 | 735d331cf5adbbe425365d3dfd47f6ac6fc13a7d | /app/src/androidTest/java/com/alb/fibererte/ExampleInstrumentedTest.java | 6085e385b5863784a8bbb25848d453c46a4e065b | [] | no_license | zaramagasoft/FiberErte | 969657502915a5fa18478bd0bd379172ec6bb0ef | b4389c2dd58537ecbc87182a17a43c4066c78359 | refs/heads/master | 2022-08-24T10:52:54.603856 | 2020-05-12T15:01:41 | 2020-05-12T15:01:41 | 263,210,657 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 750 | java | package com.alb.fibererte;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.alb.fibererte", appContext.getPackageName());
}
}
| [
"65206037+zaramagasoft@users.noreply.github.com"
] | 65206037+zaramagasoft@users.noreply.github.com |
cee493d0d53810a8255c20c9b38c9d3bcc9d2ae0 | acb2d3e2f5270dea048737d36ad502a2f4ab610c | /src/main/java/org/os/interpreter/token/Bookmark.java | 304b94fa650148f8ddc66faafb99573af816ce58 | [] | no_license | guilhermelabigalini/interpreter | f20ca1ea43d018da5a9ff1d1afb6ee91d541d4b4 | b7a635b3a792e8eabb96ebee4c86d5e90fc3dedb | refs/heads/master | 2021-01-09T20:35:00.077418 | 2016-06-30T23:10:31 | 2016-06-30T23:10:31 | 61,480,380 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.os.interpreter.token;
/**
*
* @author guilherme
*/
public class Bookmark {
private int position;
private int currentLine;
public Bookmark(int position, int currentLine) {
this.position = position;
this.currentLine = currentLine;
}
public int getPosition() {
return position;
}
public int getCurrentLine() {
return currentLine;
}
}
| [
"guilherme.labigalini@gmail.com"
] | guilherme.labigalini@gmail.com |
2e9f4cb92903bff4d81a1b9d3f1e28e6fcdf40c7 | eab707f23688e016f1abe5d5e572ffcee14e66c4 | /Labs & Practice/Week 3/Forecast/app/src/test/java/com/spizzyrichlife/forecast/ExampleUnitTest.java | f462b2a5625564db9a57ca3da9631ceef3383127 | [] | no_license | SpencerRS/Homework | 829976b24563ea848629b1d5e4c1108108dbcb92 | e9ba7be68614ff0ab9514401f6891a11f68a708f | refs/heads/master | 2020-04-02T19:04:50.011558 | 2016-08-24T17:10:24 | 2016-08-24T17:10:24 | 64,782,410 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 320 | java | package com.spizzyrichlife.forecast;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"SpizzyRich@Spencers-MacBook-Pro.local"
] | SpizzyRich@Spencers-MacBook-Pro.local |
31072ad208b84eed4c65415cea0f0bcf4b0974f5 | d47a62bf19e717bf99a5e8356d9ce086525efaf2 | /src/test/java/positiveTest/trigonometric/TestSin.java | 0d940e6b9e62b87d41c9e2005f73597c2d14b2ef | [] | no_license | tatsianabelazor/automationHomework | 363e786f4954066e615e5bfb581724d31b0377cd | a25b4eb88d6225076198921ce24fc2b949c71643 | refs/heads/master | 2020-03-13T05:17:59.293029 | 2018-04-25T09:24:30 | 2018-04-25T09:24:30 | 130,980,716 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 894 | java | package positiveTest.trigonometric;
import positiveTest.TestConfiguration;
import com.epam.tat.module4.Calculator;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
/**
* Created by Tatsiana_Belazor on 02-Mar-18.
*/
public class TestSin extends TestConfiguration {
Calculator calc = new Calculator();
@DataProvider
public Object[][] sinData() {
return new Object[][]{
{4.7123889803846898576939650749193, -1},
{6.283185307179586476925286766559, 0},
{1.5707963267948966192313216916398, 1}};
}
@Test(dataProvider = "sinData", groups = "Trigonometric")
public void testSin(double a, double expectedResult) {
double result = calc.sin(a);
Assert.assertEquals(result, expectedResult, "Sinus is incorrect, expected:" + expectedResult);
}
}
| [
"Tatsiana_Belazor@epam.com"
] | Tatsiana_Belazor@epam.com |
2ba213deb6dca25d565b3026c5676495a42d78f3 | be88542218574d2aad69fcdcdae5f29e28e3e784 | /src/main/java/events/Observer.java | 036a9824f6cc987b415d0e48c71035b242215c73 | [] | no_license | PricopeStefan/MAP_Grade_Manager | d15ebcec6db8cb362158dd4d1bd04d6c8824f941 | 06a17edbcab8a750c45178f5a19b3ef4b37b1d35 | refs/heads/master | 2020-04-27T21:13:24.788375 | 2019-03-09T11:56:48 | 2019-03-09T11:56:48 | 174,688,410 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 87 | java | package events;
public interface Observer<E extends Event> {
void update(E e);
}
| [
"pricopestefancristian@gmail.com"
] | pricopestefancristian@gmail.com |
312e7f7553e4c825fc6c274433ede9cc6bbd9450 | 6019077c36857811ea5ea47a5c8ffec9c3af20cf | /src/princeton/TST.java | 88badde2375948d317043dd39ef8ef8bb28ec8f3 | [] | no_license | azuhav/algos | d6982c4decacb6786daf0ddd9a6877ed75c669d8 | d85582765f2355c349c464e0ce10d25ce8d55841 | refs/heads/master | 2022-11-15T05:39:14.315898 | 2020-07-11T17:34:47 | 2020-07-11T17:34:47 | 278,907,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,955 | java | /******************************************************************************
* Compilation: javac TST.java
* Execution: java TST < words.txt
* Dependencies: StdIn.java
* Data files: https://algs4.cs.princeton.edu/52trie/shellsST.txt
*
* Symbol table with string keys, implemented using a ternary search
* trie (TST).
*
*
* % java TST < shellsST.txt
* keys(""):
* by 4
* sea 6
* sells 1
* she 0
* shells 3
* shore 7
* the 5
*
* longestPrefixOf("shellsort"):
* shells
*
* keysWithPrefix("shor"):
* shore
*
* keysThatMatch(".he.l."):
* shells
*
* % java TST
* theory the now is the time for all good men
*
* Remarks
* --------
* - can't use a key that is the empty string ""
*
******************************************************************************/
package princeton;
/**
* The {@code TST} class represents an symbol table of key-value
* pairs, with string keys and generic values.
* It supports the usual <em>put</em>, <em>get</em>, <em>contains</em>,
* <em>delete</em>, <em>size</em>, and <em>is-empty</em> methods.
* It also provides character-based methods for finding the string
* in the symbol table that is the <em>longest prefix</em> of a given prefix,
* finding all strings in the symbol table that <em>start with</em> a given prefix,
* and finding all strings in the symbol table that <em>match</em> a given pattern.
* A symbol table implements the <em>associative array</em> abstraction:
* when associating a value with a key that is already in the symbol table,
* the convention is to replace the old value with the new value.
* Unlike {@link java.util.Map}, this class uses the convention that
* values cannot be {@code null}—setting the
* value associated with a key to {@code null} is equivalent to deleting the key
* from the symbol table.
* <p>
* This implementation uses a ternary search trie.
* <p>
* For additional documentation, see <a href="https://algs4.cs.princeton.edu/52trie">Section 5.2</a> of
* <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne.
*/
public class TST<Value> {
private int n; // size
private Node<Value> root; // root of TST
private static class Node<Value> {
private char c; // character
private Node<Value> left, mid, right; // left, middle, and right subtries
private Value val; // value associated with string
}
/**
* Initializes an empty string symbol table.
*/
public TST() {
}
/**
* Returns the number of key-value pairs in this symbol table.
* @return the number of key-value pairs in this symbol table
*/
public int size() {
return n;
}
/**
* Does this symbol table contain the given key?
* @param key the key
* @return {@code true} if this symbol table contains {@code key} and
* {@code false} otherwise
* @throws IllegalArgumentException if {@code key} is {@code null}
*/
public boolean contains(String key) {
if (key == null) {
throw new IllegalArgumentException("argument to contains() is null");
}
return get(key) != null;
}
/**
* Returns the value associated with the given key.
* @param key the key
* @return the value associated with the given key if the key is in the symbol table
* and {@code null} if the key is not in the symbol table
* @throws IllegalArgumentException if {@code key} is {@code null}
*/
public Value get(String key) {
if (key == null) {
throw new IllegalArgumentException("calls get() with null argument");
}
if (key.length() == 0) throw new IllegalArgumentException("key must have length >= 1");
Node<Value> x = get(root, key, 0);
if (x == null) return null;
return x.val;
}
// return subtrie corresponding to given key
private Node<Value> get(Node<Value> x, String key, int d) {
if (x == null) return null;
if (key.length() == 0) throw new IllegalArgumentException("key must have length >= 1");
char c = key.charAt(d);
if (c < x.c) return get(x.left, key, d);
else if (c > x.c) return get(x.right, key, d);
else if (d < key.length() - 1) return get(x.mid, key, d+1);
else return x;
}
/**
* Inserts the key-value pair into the symbol table, overwriting the old value
* with the new value if the key is already in the symbol table.
* If the value is {@code null}, this effectively deletes the key from the symbol table.
* @param key the key
* @param val the value
* @throws IllegalArgumentException if {@code key} is {@code null}
*/
public void put(String key, Value val) {
if (key == null) {
throw new IllegalArgumentException("calls put() with null key");
}
if (!contains(key)) n++;
else if(val == null) n--; // delete existing key
root = put(root, key, val, 0);
}
private Node<Value> put(Node<Value> x, String key, Value val, int d) {
char c = key.charAt(d);
if (x == null) {
x = new Node<Value>();
x.c = c;
}
if (c < x.c) x.left = put(x.left, key, val, d);
else if (c > x.c) x.right = put(x.right, key, val, d);
else if (d < key.length() - 1) x.mid = put(x.mid, key, val, d+1);
else x.val = val;
return x;
}
/**
* Returns the string in the symbol table that is the longest prefix of {@code query},
* or {@code null}, if no such string.
* @param query the query string
* @return the string in the symbol table that is the longest prefix of {@code query},
* or {@code null} if no such string
* @throws IllegalArgumentException if {@code query} is {@code null}
*/
public String longestPrefixOf(String query) {
if (query == null) {
throw new IllegalArgumentException("calls longestPrefixOf() with null argument");
}
if (query.length() == 0) return null;
int length = 0;
Node<Value> x = root;
int i = 0;
while (x != null && i < query.length()) {
char c = query.charAt(i);
if (c < x.c) x = x.left;
else if (c > x.c) x = x.right;
else {
i++;
if (x.val != null) length = i;
x = x.mid;
}
}
return query.substring(0, length);
}
/**
* Returns all keys in the symbol table as an {@code Iterable}.
* To iterate over all of the keys in the symbol table named {@code st},
* use the foreach notation: {@code for (Key key : st.keys())}.
* @return all keys in the symbol table as an {@code Iterable}
*/
public Iterable<String> keys() {
Queue<String> queue = new Queue<String>();
collect(root, new StringBuilder(), queue);
return queue;
}
/**
* Returns all of the keys in the set that start with {@code prefix}.
* @param prefix the prefix
* @return all of the keys in the set that start with {@code prefix},
* as an iterable
* @throws IllegalArgumentException if {@code prefix} is {@code null}
*/
public Iterable<String> keysWithPrefix(String prefix) {
if (prefix == null) {
throw new IllegalArgumentException("calls keysWithPrefix() with null argument");
}
Queue<String> queue = new Queue<String>();
Node<Value> x = get(root, prefix, 0);
if (x == null) return queue;
if (x.val != null) queue.enqueue(prefix);
collect(x.mid, new StringBuilder(prefix), queue);
return queue;
}
// all keys in subtrie rooted at x with given prefix
private void collect(Node<Value> x, StringBuilder prefix, Queue<String> queue) {
if (x == null) return;
collect(x.left, prefix, queue);
if (x.val != null) queue.enqueue(prefix.toString() + x.c);
collect(x.mid, prefix.append(x.c), queue);
prefix.deleteCharAt(prefix.length() - 1);
collect(x.right, prefix, queue);
}
/**
* Returns all of the keys in the symbol table that match {@code pattern},
* where . symbol is treated as a wildcard character.
* @param pattern the pattern
* @return all of the keys in the symbol table that match {@code pattern},
* as an iterable, where . is treated as a wildcard character.
*/
public Iterable<String> keysThatMatch(String pattern) {
Queue<String> queue = new Queue<String>();
collect(root, new StringBuilder(), 0, pattern, queue);
return queue;
}
private void collect(Node<Value> x, StringBuilder prefix, int i, String pattern, Queue<String> queue) {
if (x == null) return;
char c = pattern.charAt(i);
if (c == '.' || c < x.c) collect(x.left, prefix, i, pattern, queue);
if (c == '.' || c == x.c) {
if (i == pattern.length() - 1 && x.val != null) queue.enqueue(prefix.toString() + x.c);
if (i < pattern.length() - 1) {
collect(x.mid, prefix.append(x.c), i+1, pattern, queue);
prefix.deleteCharAt(prefix.length() - 1);
}
}
if (c == '.' || c > x.c) collect(x.right, prefix, i, pattern, queue);
}
/**
* Unit tests the {@code TST} data type.
*
* @param args the command-line arguments
*/
public static void main(String[] args) {
// build symbol table from standard input
TST<Integer> st = new TST<Integer>();
for (int i = 0; !StdIn.isEmpty(); i++) {
String key = StdIn.readString();
st.put(key, i);
}
// print results
if (st.size() < 100) {
StdOut.println("keys(\"\"):");
for (String key : st.keys()) {
StdOut.println(key + " " + st.get(key));
}
StdOut.println();
}
StdOut.println("longestPrefixOf(\"shellsort\"):");
StdOut.println(st.longestPrefixOf("shellsort"));
StdOut.println();
StdOut.println("longestPrefixOf(\"shell\"):");
StdOut.println(st.longestPrefixOf("shell"));
StdOut.println();
StdOut.println("keysWithPrefix(\"shor\"):");
for (String s : st.keysWithPrefix("shor"))
StdOut.println(s);
StdOut.println();
StdOut.println("keysThatMatch(\".he.l.\"):");
for (String s : st.keysThatMatch(".he.l."))
StdOut.println(s);
}
}
/******************************************************************************
* Copyright 2002-2020, Robert Sedgewick and Kevin Wayne.
*
* This file is part of algs4.jar, which accompanies the textbook
*
* Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne,
* Addison-Wesley Professional, 2011, ISBN 0-321-57351-X.
* http://algs4.cs.princeton.edu
*
*
* algs4.jar 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.
*
* algs4.jar 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 algs4.jar. If not, see http://www.gnu.org/licenses.
******************************************************************************/
| [
"mail.yurykuznetsov@gmail.com"
] | mail.yurykuznetsov@gmail.com |
b23129e73f3160c8633c0ae5a036544018b5e8bc | 83d781a9c2ba33fde6df0c6adc3a434afa1a7f82 | /MarketBusinessInterface/src/main/java/com/newco/marketplace/business/iBusiness/api/beans/leadsmanagement/EligibleProviderForLead.java | f6dba4cf604736ed9fe77f304d3f03274b692763 | [] | no_license | ssriha0/sl-b2b-platform | 71ab8ef1f0ccb0a7ad58b18f28a2bf6d5737fcb6 | 5b4fcafa9edfe4d35c2dcf1659ac30ef58d607a2 | refs/heads/master | 2023-01-06T18:32:24.623256 | 2020-11-05T12:23:26 | 2020-11-05T12:23:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,157 | java | package com.newco.marketplace.business.iBusiness.api.beans.leadsmanagement;
import com.thoughtworks.xstream.annotations.XStreamAlias;
@XStreamAlias("EligibleProvider")
public class EligibleProviderForLead {
@XStreamAlias("ResourceId")
private Integer resourceId;
@XStreamAlias("ProviderDistance")
private double providerDistance;
@XStreamAlias("ResourceFirstName")
private String resFirstName;
@XStreamAlias("ResourceLastName")
private String resLastName;
public Integer getResourceId() {
return resourceId;
}
public void setResourceId(Integer resourceId) {
this.resourceId = resourceId;
}
public double getProviderDistance() {
return providerDistance;
}
public void setProviderDistance(double providerDistance) {
this.providerDistance = providerDistance;
}
public String getResFirstName() {
return resFirstName;
}
public void setResFirstName(String resFirstName) {
this.resFirstName = resFirstName;
}
public String getResLastName() {
return resLastName;
}
public void setResLastName(String resLastName) {
this.resLastName = resLastName;
}
}
| [
"Kunal.Pise@transformco.com"
] | Kunal.Pise@transformco.com |
6a3052a3458b4504db27856b8bc95af247f9abb0 | c94779d4860c09e313276b3b83c9c88b4b6aa4d5 | /src/model/Observer.java | 11f6b0ff10ad8875246ab35f15193c1a46183b81 | [] | no_license | ferhatabbas/Projet-232 | c6ed46872bd0c2224110aa17da0ad6361e2bf4df | 3b707a1dbbd6d441e5e59dc7ff6c33ca0b29943a | refs/heads/master | 2020-02-26T13:57:42.444244 | 2015-08-13T19:49:47 | 2015-08-13T19:49:47 | 38,848,655 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package model;
/**
* Created by Alexandre on 2015-07-28.
*/
public abstract class Observer {
private Subject _subject;
public abstract void update();
public Subject get_subject() {
return _subject;
}
public void set_subject(Subject _subject) {
this._subject = _subject;
}
}
| [
"landry.alexandre@live.ca"
] | landry.alexandre@live.ca |
d76553cac622312931832772d4c945f1ea45c74f | 6831a854ade3b85888b29298270b2371ba2221f1 | /api/b2b-mybatis/src/main/java/com/jdy/b2b/api/model/user/AgentUserDO.java | 87939ba6dae77e13495e23dcd48943ce772248c3 | [] | no_license | meiwulang/spring-boot-distributed | 709787c98c47059dfea36130f09b864970101246 | 428a3152e260299e09bfe7657290af3384a2f8b7 | refs/heads/master | 2020-03-18T05:40:31.678087 | 2018-05-28T08:57:30 | 2018-05-28T08:57:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 287 | java | package com.jdy.b2b.api.model.user;
/**
* Created by yangcheng on 2017/11/10.
*/
public class AgentUserDO extends User{
private String dName;
public String getdName() {
return dName;
}
public void setdName(String dName) {
this.dName = dName;
}
}
| [
"418180062@qq.com"
] | 418180062@qq.com |
2ae080b98ff718712190ab42abb1eae6715cfca6 | da35b7e2224b4dbc8f993100eace982234ab719f | /app/controllers/websocket/ChatSocket.java | ae6fac177876a119aa1f6d8daa49968f8e2c2360 | [
"Apache-2.0"
] | permissive | sivailango/play-java-websocket-chat | da7d70f7df7edeefbbb4ebf9781aabda40f047a9 | 583fe9ddbf09bd4aa12569bb0574ad0ad9e0546d | refs/heads/master | 2021-01-10T03:19:13.023692 | 2016-02-22T10:48:50 | 2016-02-22T10:48:50 | 52,266,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,664 | java | package controllers.websocket;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.fasterxml.jackson.databind.JsonNode;
import models.Conversation;
import play.libs.F.Callback;
import play.libs.F.Callback0;
import play.mvc.WebSocket;
/**
* @author valore
*
*/
public class ChatSocket {
private static List<WebSocket.Out<String>> connections = new ArrayList<WebSocket.Out<String>>();
public static void start(WebSocket.In<String> in, WebSocket.Out<String> out) {
connections.add(out);
in.onMessage(new Callback<String>() {
public void invoke(String event) {
ChatSocket.notifyAll(event);
}
});
in.onClose(new Callback0() {
public void invoke() {
ChatSocket.notifyAll("Disconnected");
}
});
}
/*
public static void start(WebSocket.In<JsonNode> in, WebSocket.Out<JsonNode> out) {
in.onMessage(new Callback<JsonNode>() {
@Override
public void invoke(JsonNode json) throws Throwable {
if(Conversation.isExist(senderId, receiverId)) {
Conversation c = Conversation.findById(key);
} else {
Conversation c = new Conversation();
c.id = UUID.randomUUID().toString();
c.senderId = senderId;
c.receiverId = receiverId;
Conversation.save(c);
}
ChatSocket.notifyAll("asdsa");
}
});
}
*/
public static void notifyAll(String message) {
for(WebSocket.Out<String> out : connections) {
out.write(message);
}
}
}
| [
"sivailangos@auruminfosol.com"
] | sivailangos@auruminfosol.com |
1d601b1f45bd5469bb04685ef79cc44ba6f5498b | 1f399ba3f8f4a0c6c85d7250c589013606e83f53 | /src/main/java/com/pjsdev/jms/JmsApplication.java | 7b484748f441eabef56f5f1097c8cef858fe2625 | [] | no_license | pjsdevcom/jms | 762570550faac118b81ef7ae506f9ebd95ce9c52 | bed386bd6014c00f794ad15b31a6798efbe87823 | refs/heads/master | 2023-07-07T13:51:17.405696 | 2021-08-13T09:13:15 | 2021-08-13T09:13:15 | 393,315,481 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 693 | java | package com.pjsdev.jms;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class JmsApplication {
public static void main(String[] args) {
// ActiveMQServer server = ActiveMQServers.newActiveMQServer(new ConfigurationImpl()
// .setPersistenceEnabled(false) //no persistence
// .setJournalDirectory("target/data/journal")
// .setSecurityEnabled(false) //anybody can log in
// .addAcceptorConfiguration("invm", "vm://0"));
//
// server.start();
SpringApplication.run(JmsApplication.class, args);
}
}
| [
"mail@pjsdev.com"
] | mail@pjsdev.com |
6aa729ef258ced8f18d634b44a0a76c07412c331 | 4602fb124037a08db37063bb34c831bf334f800b | /Library_Management/src/com/lib/pojo/Cds.java | 73ef68b7a84c05cfb150d25df8878a0cc28f8b3c | [] | no_license | suraj46526558/LibCode | 34e20755cce7557f60f20d90798d88d93f5a83a6 | bcb62e95bd390ca5237829a260d8eadf0943441e | refs/heads/master | 2020-03-17T00:22:40.853639 | 2018-05-20T16:38:19 | 2018-05-20T16:38:19 | 133,114,361 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,056 | java | package com.lib.pojo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name="cd")
@Entity
public class Cds {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private int cdId;
private int invId;
private String cdName;
private float cdCost;
private int cdCount;
public int getCdId() {
return cdId;
}
public void setCdId(int cdId) {
this.cdId = cdId;
}
public int getInvId() {
return invId;
}
public void setInvId(int invId) {
this.invId = invId;
}
public String getCdName() {
return cdName;
}
public void setCdName(String cdName) {
this.cdName = cdName;
}
public float getCdCost() {
return cdCost;
}
public void setCdCost(float cdCost) {
this.cdCost = cdCost;
}
public int getCdCount() {
return cdCount;
}
public void setCdCount(int cdCount) {
this.cdCount = cdCount;
}
}
| [
"suraj@LAPTOP-BJS858LR"
] | suraj@LAPTOP-BJS858LR |
9cb703e2d0be20cfa46f6d47a77f49ee8239b386 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/10/10_9ec7597df58dedf459ad57e96884df37c196a943/DebugSwingMqlEditor/10_9ec7597df58dedf459ad57e96884df37c196a943_DebugSwingMqlEditor_s.java | 4fce193d5e9932142df89ea3e4b766e53415e7bf | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,264 | java | package org.pentaho.commons.metadata.mqleditor;
import java.io.InputStream;
import org.pentaho.commons.metadata.mqleditor.editor.SwingMqlEditor;
import org.pentaho.metadata.repository.FileBasedMetadataDomainRepository;
import org.pentaho.metadata.repository.IMetadataDomainRepository;
import org.pentaho.metadata.util.XmiParser;
import org.pentaho.platform.api.data.IDatasourceService;
import org.pentaho.platform.api.engine.ISolutionEngine;
import org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory.Scope;
import org.pentaho.platform.api.repository.ISolutionRepository;
import org.pentaho.platform.engine.core.system.PentahoSystem;
import org.pentaho.platform.engine.core.system.StandaloneSession;
import org.pentaho.platform.engine.services.connection.datasource.dbcp.JndiDatasourceService;
import org.pentaho.platform.engine.services.solution.SolutionEngine;
import org.pentaho.platform.plugin.services.connections.sql.SQLConnection;
import org.pentaho.platform.repository.solution.filebased.FileBasedSolutionRepository;
import org.pentaho.test.platform.engine.core.MicroPlatform;
/**
* Default Swing implementation. This class requires a concreate Service
* implemetation
*/
public class DebugSwingMqlEditor {
public static void main(String[] args) {
// initialize micro platorm
MicroPlatform microPlatform = new MicroPlatform("resources/solution1/"); //$NON-NLS-1$
microPlatform.define(ISolutionEngine.class, SolutionEngine.class);
microPlatform.define(ISolutionRepository.class, FileBasedSolutionRepository.class);
microPlatform.define(IMetadataDomainRepository.class, FileBasedMetadataDomainRepository.class, Scope.GLOBAL);
microPlatform.define("connection-SQL", SQLConnection.class); //$NON-NLS-1$
microPlatform.define(IDatasourceService.class, JndiDatasourceService.class, Scope.GLOBAL);
// JNDI
System.setProperty("java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory"); //$NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.root", "resources/solution1/simple-jndi"); //$NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.delimiter", "/"); //$NON-NLS-1$ //$NON-NLS-2$
microPlatform.init();
new StandaloneSession();
FileBasedMetadataDomainRepository repo = (FileBasedMetadataDomainRepository) PentahoSystem.get(IMetadataDomainRepository.class, null);
repo.setDomainFolder("resources/solution1/system/metadata/domains"); //$NON-NLS-1$
// Parse and add legacy CWM domain for testing purposes.
XmiParser parser = new XmiParser();
try {
InputStream inStr = SwingMqlEditor.class.getResourceAsStream("/metadata_steelwheels.xmi"); //$NON-NLS-1$
if(inStr == null){
System.out.println("error with XMI input"); //$NON-NLS-1$
org.pentaho.metadata.model.Domain d = parser.parseXmi(inStr);
d.setId("Steel-Wheels"); //$NON-NLS-1$
repo.storeDomain(d, false);
repo.reloadDomains();
}
} catch (Exception e) {
System.out.println("error with XMI input"); //$NON-NLS-1$
}
SwingMqlEditor editor = new SwingMqlEditor(repo);
editor.hidePreview();
editor.show();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
1d6626dbece94de8b109591abb074fa061f16905 | 81e2fa7ba5ec69a132343dd6892e2d6f35bc1e64 | /app/src/main/java/com/htt/kon/bean/MusicList.java | 0314672c3f5d401f05707ec3523a1bf2e94af03c | [
"MIT"
] | permissive | renchangjiu/kon-android | 6bc001b2167a901b18226640551ff75c7d3614be | 8a250b7576876b3c10e5377666019def971b2375 | refs/heads/master | 2021-10-07T21:46:55.378870 | 2021-10-02T11:20:30 | 2021-10-02T11:20:30 | 237,433,463 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,473 | java | package com.htt.kon.bean;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import java.util.Date;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
/**
* @author su
* @date 2020/02/02 21:11
*/
@Entity(tableName = "MUSIC_LIST")
public class MusicList {
@PrimaryKey
private Long id;
/**
* 歌单名
*/
@ColumnInfo(name = "NAME")
private String name;
/**
* 创建日期(毫秒级时间戳)
*/
@ColumnInfo(name = "CREATE_TIME")
private Long createTime;
@Ignore
private String createTimeLabel;
/**
* 播放次数
*/
@ColumnInfo(name = "PLAY_COUNT")
private Integer playCount;
/**
* 是否删除, 1是/2否
*/
@ColumnInfo(name = "DEL_FLAG")
private Integer delFlag;
/**
* 歌单下所属的music 集合
*/
@Ignore
private List<Music> musics;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public String getCreateTimeLabel() {
return createTimeLabel;
}
public void setCreateTimeLabel(String createTimeLabel) {
this.createTimeLabel = createTimeLabel;
}
public Integer getPlayCount() {
return playCount;
}
public void setPlayCount(Integer playCount) {
this.playCount = playCount;
}
public Integer getDelFlag() {
return delFlag;
}
public void setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
}
public List<Music> getMusics() {
return musics;
}
public void setMusics(List<Music> musics) {
this.musics = musics;
}
@Override
public String toString() {
return "MusicList{" +
"id=" + id +
", name='" + name + '\'' +
", createTime=" + createTime +
", createTimeLabel='" + createTimeLabel + '\'' +
", playCount=" + playCount +
", delFlag=" + delFlag +
'}';
}
}
| [
"1359581862@qq.com"
] | 1359581862@qq.com |
135650c2a79fefb17dc691c3351d0080577c210c | c88ba65c2eac77d5d75911c06b5d8c4a50d75de9 | /src/main/java/com/bank/manager/web/EmployeeController.java | 61ab7280447a9e2200685afe331fb8cc415b8d04 | [] | no_license | driftman/Spring_MVC | 21fef3234e3e1ece8fe8e3675f6e16f37a960d0e | ac7fa7845018daeb0c363e1113026e372acaaa68 | refs/heads/master | 2021-03-12T22:42:28.287290 | 2015-09-22T23:10:00 | 2015-09-22T23:10:00 | 42,076,250 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 8,654 | java | package com.bank.manager.web;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.View;
import com.bank.manager.beans.Account;
import com.bank.manager.beans.Adresse;
import com.bank.manager.beans.Authority;
import com.bank.manager.beans.Client;
import com.bank.manager.beans.Compte;
import com.bank.manager.beans.CompteCourant;
import com.bank.manager.beans.CompteEpargne;
import com.bank.manager.beans.Coordonnee;
import com.bank.manager.beans.Credit;
import com.bank.manager.beans.Employee;
import com.bank.manager.beans.Operation;
import com.bank.manager.beans.Person;
import com.bank.manager.beans.SessionBean;
import com.bank.manager.beans.Situation;
import com.bank.manager.configs.CustomUser;
import com.bank.manager.metier.IManagerMetier;
import com.bank.manager.models.ClientModel;
import com.bank.manager.models.CompteModel;
import com.bank.manager.models.EmployeeModel;
@Controller
@RequestMapping(value="/employee")
public class EmployeeController {
@Autowired
private IManagerMetier metier;
@RequestMapping(value="/ajouter", method=RequestMethod.GET)
public String ajouterEmployeeGET(Model model, HttpServletRequest request)
{
CustomUser user = ((CustomUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal());
Person p = user.getPerson();
System.out.println(p);
EmployeeModel employeeModel = new EmployeeModel();
model.addAttribute("employeeModel", employeeModel);
request.getSession().setAttribute("test", "passed");
return "employee/add";
}
@RequestMapping(value="/ajouter", method=RequestMethod.POST)
public ModelAndView ajouterEmployeePOST(@ModelAttribute("employeeModel") @Valid EmployeeModel employeeModel, BindingResult bindingResult, Model model)
{
ModelAndView mav = new ModelAndView();
mav.setViewName("employee/add");
if(bindingResult.hasErrors())
{
mav.addObject("flashs", Arrays.asList(new String[]{"Erreur","Les entrées sont invalides ..."}));
return mav;
}
Adresse address = new Adresse(employeeModel.getVille(), employeeModel.getQuartier(),
employeeModel.getCode_postale(), employeeModel.getNumero_lieu());
Coordonnee coordonnee = new Coordonnee(employeeModel.getNom(), employeeModel.getPrenom(),
employeeModel.getAge(), employeeModel.getEmail());
Account account = new Account(employeeModel.getUsername(), employeeModel.getPassword(),
employeeModel.getSecret_pass());
Employee employee = new Employee();
try
{
metier.addEmployee(employee, account, new String[]{"ROLE_USER", "ROLE_ADMIN"}, coordonnee, address, null);
mav.addObject("flashs", Arrays.asList(new String[]{"Succes","Employee ajoute avec succes ..."}));
}
catch(Exception ex)
{
mav.addObject("flashs", Arrays.asList(new String[]{"Erreur",ex.getMessage()}));
}
return mav;
}
@RequestMapping(value="comptes", method=RequestMethod.GET)
public String getAllComptes(Model model)
{
try {
model.addAttribute("comptes",metier.getCompteByEmployee(1L));
}
catch(Exception e)
{
model.addAttribute("flashs",Arrays.asList(new String[]{"Erreur",e.getMessage(),}));
}
return "employee/comptes";
}
@RequestMapping(value="comptes/search", method=RequestMethod.POST)
public String searchCompteWithMC(@RequestParam(value="mc", defaultValue="CE2") String mc, Model model)
{
try
{
model.addAttribute("comptes", metier.getComptesWithMC(mc));
}
catch(Exception e)
{
model.addAttribute("flashs",Arrays.asList(new String[]{"Erreur",e.getMessage()}));
}
return "employee/comptes";
}
@RequestMapping(value="compte/add", method=RequestMethod.GET)
public ModelAndView addCompte()
{
ModelAndView mav = new ModelAndView();
mav.addObject("compteModel", new CompteModel());
mav.setViewName("compte/add");
return mav;
}
@RequestMapping(value="compte/add", method=RequestMethod.POST)
public ModelAndView addComptePost(
@ModelAttribute("compteModel") @Valid CompteModel compteModel,
BindingResult bindingResult)
{
ModelAndView mav = new ModelAndView();
mav.setViewName("compte/add");
if(bindingResult.hasErrors())
{
return mav;
}
if(!compteModel.getTypeCompte().equals("Compte Courant")
&&
!compteModel.getTypeCompte().equals("Compte Epargne"))
{
mav.addObject("flashs", Arrays.asList(new String[]{"ERROR","Seul les paramètres 'Compte Epargne' "
+ "et "
+ " 'Compte Courant' . "}));
}
try
{
Client client = metier.getClient(compteModel.getOwnerId());
String typeCompte = compteModel.getTypeCompte();
Compte c = (typeCompte.equals("Compte Courant")) ? new CompteCourant() : new CompteEpargne();
c.setCodeCompte((typeCompte.equals("Compte Courant")) ?
"CC"+c.getDateCreation().getTime()
: "CE"+c.getDateCreation().getTime());
Long adminId =
((CustomUser)(SecurityContextHolder.getContext().getAuthentication().getPrincipal()))
.getPerson()
.getId();
Compte returnedCompte = metier.addCompte(c, client.getId(), adminId);
Operation o = metier
.versement(new Credit(), returnedCompte.getCodeCompte(), adminId, compteModel.getAmount());
mav.addObject("operation", o);
mav.addObject("compte", metier.getCompte(c.getCodeCompte()));
mav.addObject("flashs", Arrays.asList(new String[]{"SUCCESS", "Compte ajouté avec succes "
+ "et première operation faite. "}));
return mav;
}
catch(Exception e)
{
mav.addObject("flashs", Arrays.asList(new String[]{"ERROR", e.getMessage()}));
return mav;
}
}
@RequestMapping(value="comptes/show/{code_compte}", method=RequestMethod.GET)
public String detailsCompte(@PathVariable String code_compte, Model model)
{
try
{
model.addAttribute("compte", metier.getCompte(code_compte));
}
catch(Exception e)
{
model.addAttribute("flashs",Arrays.asList(new String[]{"ERROR", e.getMessage()}));
}
return "compte/details";
}
@RequestMapping(value="client/demande", method=RequestMethod.GET)
public String ajouterDemandeGET(Model model)
{
ClientModel clientModel = new ClientModel();
model.addAttribute("clientModel", clientModel);
return "client/add";
}
@RequestMapping(value="client/demande", method=RequestMethod.POST)
public ModelAndView ajouterDemandePOST(@ModelAttribute("clientModel") @Valid ClientModel clientModel, BindingResult bindingResult, Model model)
{
ModelAndView mav = new ModelAndView();
mav.setViewName("client/add");
if(bindingResult.hasErrors())
{
mav.addObject("flashs", Arrays.asList(new String[]{"Erreur","Veuillez renseigner les bon coordonnees"}));
return mav;
}
Adresse address = new Adresse(clientModel.getVille(), clientModel.getQuartier(),
clientModel.getCode_postale(), clientModel.getNumero_lieu());
Coordonnee coordonnee = new Coordonnee(clientModel.getNom(), clientModel.getPrenom(),
clientModel.getAge(), clientModel.getEmail());
Account account = new Account(clientModel.getUsername(), clientModel.getPassword(),
clientModel.getSecret_pass());
Situation situation = new Situation(clientModel.getLettreMotivation(),
clientModel.isFonctionnaire(), clientModel.isSalaireFix(), clientModel.getSalaireMensuel(), clientModel.isBiens(),
clientModel.isMarie());
Client client = new Client();
try
{
metier.addClient(
client,
account,
situation,
coordonnee,
address,
((CustomUser)SecurityContextHolder
.getContext()
.getAuthentication()
.getPrincipal())
.getPerson()
.getId());
mav.addObject("flashs", Arrays.asList(new String[]{"Succes","Utilisateur ajouté avec succes"}));
}
catch(Exception ex)
{
mav.addObject("flashs", new String[]{"Erreur", ex.getMessage()});
}
System.out.println(clientModel);
return mav;
}
}
| [
"elbaz.soufiane92@gmail.com"
] | elbaz.soufiane92@gmail.com |
16633538b2ef11ff4aff2184f0e9ad69ce006233 | 2250d4bd63c9b8d77d6564d6ab9989947eb60590 | /src/pattern/behavioral/command/RemoteControl.java | 7e588e4e4d3f6cfc4a2841619c0aef3dee3e64a0 | [] | no_license | phannguyen020501/DesignPatternJava | dd3153ef4b9645d7f11c7a7cf6ac2bab32c0f607 | b1e168b178ec4956ed82cd6c2c1ac9f24690701b | refs/heads/master | 2023-08-16T02:38:17.519296 | 2021-10-08T08:20:51 | 2021-10-08T08:20:51 | 414,900,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 255 | java | package pattern.behavioral.command;
public class RemoteControl {
private ICommand command;
public void setCommand(ICommand command) {
this.command = command;
}
public void pressButton() {
this.command.execute();
}
}
| [
"57362109+phannguyen020501@users.noreply.github.com"
] | 57362109+phannguyen020501@users.noreply.github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.