blob_id
stringlengths 40
40
| __id__
int64 225
39,780B
| directory_id
stringlengths 40
40
| path
stringlengths 6
313
| content_id
stringlengths 40
40
| detected_licenses
list | license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| repo_url
stringlengths 25
151
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
70
| visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 7.28k
689M
⌀ | star_events_count
int64 0
131k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 23
values | gha_fork
bool 2
classes | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_updated_at
timestamp[ns] | gha_pushed_at
timestamp[ns] | gha_size
int64 0
40.4M
⌀ | gha_stargazers_count
int32 0
112k
⌀ | gha_forks_count
int32 0
39.4k
⌀ | gha_open_issues_count
int32 0
11k
⌀ | gha_language
stringlengths 1
21
⌀ | gha_archived
bool 2
classes | gha_disabled
bool 1
class | content
stringlengths 7
4.37M
| src_encoding
stringlengths 3
16
| language
stringclasses 1
value | length_bytes
int64 7
4.37M
| extension
stringclasses 24
values | filename
stringlengths 4
174
| language_id
stringclasses 1
value | entities
list | contaminating_dataset
stringclasses 0
values | malware_signatures
list | redacted_content
stringlengths 7
4.37M
| redacted_length_bytes
int64 7
4.37M
| alphanum_fraction
float32 0.25
0.94
| alpha_fraction
float32 0.25
0.94
| num_lines
int32 1
84k
| avg_line_length
float32 0.76
99.9
| std_line_length
float32 0
220
| max_line_length
int32 5
998
| is_vendor
bool 2
classes | is_generated
bool 1
class | max_hex_length
int32 0
319
| hex_fraction
float32 0
0.38
| max_unicode_length
int32 0
408
| unicode_fraction
float32 0
0.36
| max_base64_length
int32 0
506
| base64_fraction
float32 0
0.5
| avg_csv_sep_count
float32 0
4
| is_autogen_header
bool 1
class | is_empty_html
bool 1
class | shard
stringclasses 16
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
406a324295f598900626a9a2df9539042f80ab94 | 3,324,304,697,699 | 51029d0cff599a0a83d5e73110d11747eda31726 | /core/src/v5/game/sokoban/TestGame.java | c13b630817e753fd6ec057e9c2c4910e2d9a9d3f | [] | no_license | v5v5/Sokoban | https://github.com/v5v5/Sokoban | 8e3c3b38314930731dabd5b5e5af6b02d5b8d84f | 39ed70c0a3fbfa4f4e866d79541069037a971ea9 | refs/heads/master | 2021-01-10T21:58:23.800000 | 2015-07-02T04:45:45 | 2015-07-02T04:45:45 | 37,603,485 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package v5.game.sokoban;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.JFrame;
import v5.game.sokoban.controller.Controller;
import v5.game.sokoban.model.T.Direction;
import v5.game.sokoban.view.Graphics;
import v5.game.sokoban.view.View;
public class TestGame {
protected static final Color[] COLORS = { Color.gray, Color.black,
Color.magenta, Color.green, Color.blue, Color.cyan };
public static void main(String[] args) {
// create controller
final Controller controller = new Controller();
// create ui
JFrame frame = new JFrame("Sokoban") {
private static final long serialVersionUID = 1L;
@Override
public void paint(java.awt.Graphics g) {
controller.repaintView();
}
};
frame.setSize(600, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
// create input data stream
frame.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(final KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_LEFT:
controller.moveMan(Direction.LEFT);
break;
case KeyEvent.VK_RIGHT:
controller.moveMan(Direction.RIGHT);
break;
case KeyEvent.VK_DOWN:
controller.moveMan(Direction.DOWN);
break;
case KeyEvent.VK_UP:
controller.moveMan(Direction.UP);
break;
case KeyEvent.VK_1:
controller.loadField(0);
break;
case KeyEvent.VK_2:
controller.loadField(1);
break;
case KeyEvent.VK_3:
controller.loadField(2);
break;
default:
break;
}
}
});
// create output data stream
final Graphics2D graphics = (Graphics2D) frame.getGraphics();
View view = new View(controller.getEvents());
view.setGraphics(new Graphics() {
@Override
public void fillRect(int x, int y, int width, int height,
int colorIndex) {
graphics.setColor(COLORS[colorIndex]);
graphics.fillRect(x, y, width, height);
}
});
controller.setView(view);
// init controller
controller.setFieldDefault();
// controller.loadField();
}
}
| UTF-8 | Java | 2,224 | java | TestGame.java | Java | [] | null | [] | package v5.game.sokoban;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.JFrame;
import v5.game.sokoban.controller.Controller;
import v5.game.sokoban.model.T.Direction;
import v5.game.sokoban.view.Graphics;
import v5.game.sokoban.view.View;
public class TestGame {
protected static final Color[] COLORS = { Color.gray, Color.black,
Color.magenta, Color.green, Color.blue, Color.cyan };
public static void main(String[] args) {
// create controller
final Controller controller = new Controller();
// create ui
JFrame frame = new JFrame("Sokoban") {
private static final long serialVersionUID = 1L;
@Override
public void paint(java.awt.Graphics g) {
controller.repaintView();
}
};
frame.setSize(600, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
// create input data stream
frame.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(final KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_LEFT:
controller.moveMan(Direction.LEFT);
break;
case KeyEvent.VK_RIGHT:
controller.moveMan(Direction.RIGHT);
break;
case KeyEvent.VK_DOWN:
controller.moveMan(Direction.DOWN);
break;
case KeyEvent.VK_UP:
controller.moveMan(Direction.UP);
break;
case KeyEvent.VK_1:
controller.loadField(0);
break;
case KeyEvent.VK_2:
controller.loadField(1);
break;
case KeyEvent.VK_3:
controller.loadField(2);
break;
default:
break;
}
}
});
// create output data stream
final Graphics2D graphics = (Graphics2D) frame.getGraphics();
View view = new View(controller.getEvents());
view.setGraphics(new Graphics() {
@Override
public void fillRect(int x, int y, int width, int height,
int colorIndex) {
graphics.setColor(COLORS[colorIndex]);
graphics.fillRect(x, y, width, height);
}
});
controller.setView(view);
// init controller
controller.setFieldDefault();
// controller.loadField();
}
}
| 2,224 | 0.660072 | 0.65063 | 92 | 22.173914 | 17.637417 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.858696 | false | false | 3 |
4315fb909c09d079554911f7b38e091347d92657 | 17,892,833,765,836 | ed8d74b594d6d93f834e1b9f3eef14365e61dcda | /app/src/main/java/com/lab/myattendance/datalayer/model/response/LectureResponse.java | 68a78e8ab9d99285bf9d9d3c1d306b60d02fd97b | [] | no_license | aha50951/iAMinAttendanceSystem | https://github.com/aha50951/iAMinAttendanceSystem | 81f5ac37b6041c1921540f99e4aaa8a25075593b | 21fc776219dcc8e7c29f8c36a9e0044cb84c8e2d | refs/heads/master | 2020-10-02T09:02:48.326000 | 2019-12-13T02:53:32 | 2019-12-13T02:53:32 | 227,729,977 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lab.myattendance.datalayer.model.response;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* This class holds the Lecture Data returned from the API
* */
public class LectureResponse {
@SerializedName("Id")
@Expose
private Integer id;
@SerializedName("Title")
@Expose
private String title;
@SerializedName("CourseId")
@Expose
private Integer courseId;
@SerializedName("LecturerId")
@Expose
private Integer lecturerId;
@SerializedName("Date")
@Expose
private String date;
@SerializedName("StrDate")
@Expose
private String strDate;
@SerializedName("StartTime")
@Expose
private StartTime startTime;
@SerializedName("StrStartTime")
@Expose
private String strStartTime;
@SerializedName("EndTime")
@Expose
private EndTime endTime;
@SerializedName("StrEndTime")
@Expose
private String strEndTime;
@SerializedName("CourseName")
@Expose
private String courseName;
@SerializedName("CourseImage")
@Expose
private String CourseImage;
@SerializedName("LecturerName")
@Expose
private String lecturerName;
@SerializedName("IsDeleted")
@Expose
private Boolean isDeleted;
public String getCourseImage() {
return CourseImage;
}
public void setCourseImage(String courseImage) {
CourseImage = courseImage;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getCourseId() {
return courseId;
}
public void setCourseId(Integer courseId) {
this.courseId = courseId;
}
public Integer getLecturerId() {
return lecturerId;
}
public void setLecturerId(Integer lecturerId) {
this.lecturerId = lecturerId;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getStrDate() {
return strDate;
}
public void setStrDate(String strDate) {
this.strDate = strDate;
}
public StartTime getStartTime() {
return startTime;
}
public void setStartTime(StartTime startTime) {
this.startTime = startTime;
}
public String getStrStartTime() {
return strStartTime;
}
public void setStrStartTime(String strStartTime) {
this.strStartTime = strStartTime;
}
public EndTime getEndTime() {
return endTime;
}
public void setEndTime(EndTime endTime) {
this.endTime = endTime;
}
public String getStrEndTime() {
return strEndTime;
}
public void setStrEndTime(String strEndTime) {
this.strEndTime = strEndTime;
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public String getLecturerName() {
return lecturerName;
}
public void setLecturerName(String lecturerName) {
this.lecturerName = lecturerName;
}
public Boolean getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(Boolean isDeleted) {
this.isDeleted = isDeleted;
}
public class EndTime {
@SerializedName("Hours")
@Expose
private Integer hours;
@SerializedName("Minutes")
@Expose
private Integer minutes;
@SerializedName("Seconds")
@Expose
private Integer seconds;
@SerializedName("Milliseconds")
@Expose
private long milliseconds;
@SerializedName("Ticks")
@Expose
private long ticks;
@SerializedName("Days")
@Expose
private Integer days;
@SerializedName("TotalDays")
@Expose
private Double totalDays;
@SerializedName("TotalHours")
@Expose
private Double totalHours;
@SerializedName("TotalMilliseconds")
@Expose
private long totalMilliseconds;
@SerializedName("TotalMinutes")
@Expose
private Double totalMinutes;
@SerializedName("TotalSeconds")
@Expose
private Double totalSeconds;
public Integer getHours() {
return hours;
}
public void setHours(Integer hours) {
this.hours = hours;
}
public Integer getMinutes() {
return minutes;
}
public void setMinutes(Integer minutes) {
this.minutes = minutes;
}
public Integer getSeconds() {
return seconds;
}
public void setSeconds(Integer seconds) {
this.seconds = seconds;
}
public long getMilliseconds() {
return milliseconds;
}
public void setMilliseconds(long milliseconds) {
this.milliseconds = milliseconds;
}
public long getTicks() {
return ticks;
}
public void setTicks(long ticks) {
this.ticks = ticks;
}
public Integer getDays() {
return days;
}
public void setDays(Integer days) {
this.days = days;
}
public Double getTotalDays() {
return totalDays;
}
public void setTotalDays(Double totalDays) {
this.totalDays = totalDays;
}
public Double getTotalHours() {
return totalHours;
}
public void setTotalHours(Double totalHours) {
this.totalHours = totalHours;
}
public long getTotalMilliseconds() {
return totalMilliseconds;
}
public void setTotalMilliseconds(long totalMilliseconds) {
this.totalMilliseconds = totalMilliseconds;
}
public Double getTotalMinutes() {
return totalMinutes;
}
public void setTotalMinutes(Double totalMinutes) {
this.totalMinutes = totalMinutes;
}
public Double getTotalSeconds() {
return totalSeconds;
}
public void setTotalSeconds(Double totalSeconds) {
this.totalSeconds = totalSeconds;
}
}
public class StartTime {
@SerializedName("Ticks")
@Expose
private long ticks;
@SerializedName("Days")
@Expose
private Integer days;
@SerializedName("Hours")
@Expose
private Integer hours;
@SerializedName("Milliseconds")
@Expose
private long milliseconds;
@SerializedName("Minutes")
@Expose
private Integer minutes;
@SerializedName("Seconds")
@Expose
private Integer seconds;
@SerializedName("TotalDays")
@Expose
private Double totalDays;
@SerializedName("TotalHours")
@Expose
private Double totalHours;
@SerializedName("TotalMilliseconds")
@Expose
private long totalMilliseconds;
@SerializedName("TotalMinutes")
@Expose
private Double totalMinutes;
@SerializedName("TotalSeconds")
@Expose
private Double totalSeconds;
public long getTicks() {
return ticks;
}
public void setTicks(long ticks) {
this.ticks = ticks;
}
public Integer getDays() {
return days;
}
public void setDays(Integer days) {
this.days = days;
}
public Integer getHours() {
return hours;
}
public void setHours(Integer hours) {
this.hours = hours;
}
public long getMilliseconds() {
return milliseconds;
}
public void setMilliseconds(long milliseconds) {
this.milliseconds = milliseconds;
}
public Integer getMinutes() {
return minutes;
}
public void setMinutes(Integer minutes) {
this.minutes = minutes;
}
public Integer getSeconds() {
return seconds;
}
public void setSeconds(Integer seconds) {
this.seconds = seconds;
}
public Double getTotalDays() {
return totalDays;
}
public void setTotalDays(Double totalDays) {
this.totalDays = totalDays;
}
public Double getTotalHours() {
return totalHours;
}
public void setTotalHours(Double totalHours) {
this.totalHours = totalHours;
}
public long getTotalMilliseconds() {
return totalMilliseconds;
}
public void setTotalMilliseconds(long totalMilliseconds) {
this.totalMilliseconds = totalMilliseconds;
}
public Double getTotalMinutes() {
return totalMinutes;
}
public void setTotalMinutes(Double totalMinutes) {
this.totalMinutes = totalMinutes;
}
public Double getTotalSeconds() {
return totalSeconds;
}
public void setTotalSeconds(Double totalSeconds) {
this.totalSeconds = totalSeconds;
}
}
}
| UTF-8 | Java | 9,527 | java | LectureResponse.java | Java | [] | null | [] | package com.lab.myattendance.datalayer.model.response;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* This class holds the Lecture Data returned from the API
* */
public class LectureResponse {
@SerializedName("Id")
@Expose
private Integer id;
@SerializedName("Title")
@Expose
private String title;
@SerializedName("CourseId")
@Expose
private Integer courseId;
@SerializedName("LecturerId")
@Expose
private Integer lecturerId;
@SerializedName("Date")
@Expose
private String date;
@SerializedName("StrDate")
@Expose
private String strDate;
@SerializedName("StartTime")
@Expose
private StartTime startTime;
@SerializedName("StrStartTime")
@Expose
private String strStartTime;
@SerializedName("EndTime")
@Expose
private EndTime endTime;
@SerializedName("StrEndTime")
@Expose
private String strEndTime;
@SerializedName("CourseName")
@Expose
private String courseName;
@SerializedName("CourseImage")
@Expose
private String CourseImage;
@SerializedName("LecturerName")
@Expose
private String lecturerName;
@SerializedName("IsDeleted")
@Expose
private Boolean isDeleted;
public String getCourseImage() {
return CourseImage;
}
public void setCourseImage(String courseImage) {
CourseImage = courseImage;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getCourseId() {
return courseId;
}
public void setCourseId(Integer courseId) {
this.courseId = courseId;
}
public Integer getLecturerId() {
return lecturerId;
}
public void setLecturerId(Integer lecturerId) {
this.lecturerId = lecturerId;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getStrDate() {
return strDate;
}
public void setStrDate(String strDate) {
this.strDate = strDate;
}
public StartTime getStartTime() {
return startTime;
}
public void setStartTime(StartTime startTime) {
this.startTime = startTime;
}
public String getStrStartTime() {
return strStartTime;
}
public void setStrStartTime(String strStartTime) {
this.strStartTime = strStartTime;
}
public EndTime getEndTime() {
return endTime;
}
public void setEndTime(EndTime endTime) {
this.endTime = endTime;
}
public String getStrEndTime() {
return strEndTime;
}
public void setStrEndTime(String strEndTime) {
this.strEndTime = strEndTime;
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public String getLecturerName() {
return lecturerName;
}
public void setLecturerName(String lecturerName) {
this.lecturerName = lecturerName;
}
public Boolean getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(Boolean isDeleted) {
this.isDeleted = isDeleted;
}
public class EndTime {
@SerializedName("Hours")
@Expose
private Integer hours;
@SerializedName("Minutes")
@Expose
private Integer minutes;
@SerializedName("Seconds")
@Expose
private Integer seconds;
@SerializedName("Milliseconds")
@Expose
private long milliseconds;
@SerializedName("Ticks")
@Expose
private long ticks;
@SerializedName("Days")
@Expose
private Integer days;
@SerializedName("TotalDays")
@Expose
private Double totalDays;
@SerializedName("TotalHours")
@Expose
private Double totalHours;
@SerializedName("TotalMilliseconds")
@Expose
private long totalMilliseconds;
@SerializedName("TotalMinutes")
@Expose
private Double totalMinutes;
@SerializedName("TotalSeconds")
@Expose
private Double totalSeconds;
public Integer getHours() {
return hours;
}
public void setHours(Integer hours) {
this.hours = hours;
}
public Integer getMinutes() {
return minutes;
}
public void setMinutes(Integer minutes) {
this.minutes = minutes;
}
public Integer getSeconds() {
return seconds;
}
public void setSeconds(Integer seconds) {
this.seconds = seconds;
}
public long getMilliseconds() {
return milliseconds;
}
public void setMilliseconds(long milliseconds) {
this.milliseconds = milliseconds;
}
public long getTicks() {
return ticks;
}
public void setTicks(long ticks) {
this.ticks = ticks;
}
public Integer getDays() {
return days;
}
public void setDays(Integer days) {
this.days = days;
}
public Double getTotalDays() {
return totalDays;
}
public void setTotalDays(Double totalDays) {
this.totalDays = totalDays;
}
public Double getTotalHours() {
return totalHours;
}
public void setTotalHours(Double totalHours) {
this.totalHours = totalHours;
}
public long getTotalMilliseconds() {
return totalMilliseconds;
}
public void setTotalMilliseconds(long totalMilliseconds) {
this.totalMilliseconds = totalMilliseconds;
}
public Double getTotalMinutes() {
return totalMinutes;
}
public void setTotalMinutes(Double totalMinutes) {
this.totalMinutes = totalMinutes;
}
public Double getTotalSeconds() {
return totalSeconds;
}
public void setTotalSeconds(Double totalSeconds) {
this.totalSeconds = totalSeconds;
}
}
public class StartTime {
@SerializedName("Ticks")
@Expose
private long ticks;
@SerializedName("Days")
@Expose
private Integer days;
@SerializedName("Hours")
@Expose
private Integer hours;
@SerializedName("Milliseconds")
@Expose
private long milliseconds;
@SerializedName("Minutes")
@Expose
private Integer minutes;
@SerializedName("Seconds")
@Expose
private Integer seconds;
@SerializedName("TotalDays")
@Expose
private Double totalDays;
@SerializedName("TotalHours")
@Expose
private Double totalHours;
@SerializedName("TotalMilliseconds")
@Expose
private long totalMilliseconds;
@SerializedName("TotalMinutes")
@Expose
private Double totalMinutes;
@SerializedName("TotalSeconds")
@Expose
private Double totalSeconds;
public long getTicks() {
return ticks;
}
public void setTicks(long ticks) {
this.ticks = ticks;
}
public Integer getDays() {
return days;
}
public void setDays(Integer days) {
this.days = days;
}
public Integer getHours() {
return hours;
}
public void setHours(Integer hours) {
this.hours = hours;
}
public long getMilliseconds() {
return milliseconds;
}
public void setMilliseconds(long milliseconds) {
this.milliseconds = milliseconds;
}
public Integer getMinutes() {
return minutes;
}
public void setMinutes(Integer minutes) {
this.minutes = minutes;
}
public Integer getSeconds() {
return seconds;
}
public void setSeconds(Integer seconds) {
this.seconds = seconds;
}
public Double getTotalDays() {
return totalDays;
}
public void setTotalDays(Double totalDays) {
this.totalDays = totalDays;
}
public Double getTotalHours() {
return totalHours;
}
public void setTotalHours(Double totalHours) {
this.totalHours = totalHours;
}
public long getTotalMilliseconds() {
return totalMilliseconds;
}
public void setTotalMilliseconds(long totalMilliseconds) {
this.totalMilliseconds = totalMilliseconds;
}
public Double getTotalMinutes() {
return totalMinutes;
}
public void setTotalMinutes(Double totalMinutes) {
this.totalMinutes = totalMinutes;
}
public Double getTotalSeconds() {
return totalSeconds;
}
public void setTotalSeconds(Double totalSeconds) {
this.totalSeconds = totalSeconds;
}
}
}
| 9,527 | 0.58203 | 0.58203 | 421 | 21.629454 | 17.158489 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.263658 | false | false | 3 |
e1250ec5dd28da35af9767b6067a32760d7a5171 | 2,619,930,064,177 | a035683e157465f27bb783a13582ad56f2613ebd | /ipnaasp-server/src/main/java/com/qm/ipnaasp/config/audit/package-info.java | af279f6535087cffc101f6e54e54bf3f0080ddcb | [] | no_license | 80000v/ipnaasp-ng2-jhipster | https://github.com/80000v/ipnaasp-ng2-jhipster | fa5c05732b777e75fbd0ea25585752485e50720a | a26074ce14f97843ac471c5030c4a0ef2d4f42d9 | refs/heads/master | 2021-04-20T09:44:34.862000 | 2016-11-20T13:19:24 | 2016-11-20T13:19:24 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* Audit specific code.
*/
package com.qm.ipnaasp.config.audit;
| UTF-8 | Java | 69 | java | package-info.java | Java | [] | null | [] | /**
* Audit specific code.
*/
package com.qm.ipnaasp.config.audit;
| 69 | 0.681159 | 0.681159 | 4 | 16.25 | 14.024532 | 36 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 3 |
090ede2f6e40a820e6795e73516b37362e918c34 | 9,912,784,533,533 | af846ab7ffc148cd3207f3e65cfb2dde6d92c767 | /sparrow-search/sparrow-search-crawl/src/main/java/com/sparrow/collect/utils/PathResolver.java | 7c33ee79f5f507b71287d40cd27adcfddae6aa69 | [
"Apache-2.0"
] | permissive | aniu2002/myself-toolkit | https://github.com/aniu2002/myself-toolkit | aaf5f71948bb45d331b206d806de85c84bafadcc | aea640b4339ea24d7bfd32311f093560573635d3 | refs/heads/master | 2022-12-24T20:25:43.702000 | 2019-03-11T14:42:14 | 2019-03-11T14:42:14 | 99,811,298 | 1 | 0 | Apache-2.0 | false | 2022-12-12T21:42:45 | 2017-08-09T13:26:46 | 2020-09-20T11:34:23 | 2022-12-12T21:42:42 | 24,397 | 1 | 0 | 26 | Java | false | false | package com.sparrow.collect.utils;
import org.apache.commons.lang3.StringUtils;
public class PathResolver {
static final String EMPTY_STRING = "";
public static String getFileName(String file) {
int x = file.lastIndexOf("/");
// unix
if (x >= 0) {
file = file.substring(x + 1);
return file;
}
// windows
x = file.lastIndexOf("\\");
if (x >= 0) {
return file.substring(x + 1);
}
return file;
}
public static String removeQuery(String str) {
int idx = str.indexOf('?');
if (idx != -1)
return str.substring(0, idx);
return str;
}
public static String getExtension(String file) {
int x = file.lastIndexOf('.');
if (x >= 0)
return file.substring(x + 1);
else
return EMPTY_STRING;
}
public static boolean hasFileExtension(String file) {
int idx = file.lastIndexOf('/');
if (idx > 7)
return file.lastIndexOf('.') > idx;
else
return false;
}
public static String getFilePath(String file) {
if (StringUtils.isEmpty(file))
return "";
int x = file.lastIndexOf("/");
// unix
if (x >= 0) {
file = file.substring(0, x);
return file;
}
// windows
x = file.lastIndexOf("\\");
if (x >= 0) {
file = file.substring(0, x);
return file;
} else
return "";
}
public static String trimExtension(String fileName) {
int x = fileName.lastIndexOf('.');
if (x >= 0)
fileName = fileName.substring(0, x);
return fileName;
}
/*
* Returns true if the string represents a relative filename, false
* otherwise
*/
public static boolean isRelative(String file) {
// unix
if (file.startsWith("/")) {
return false;
}
// windows
if ((file.length() > 2) && (file.charAt(1) == ':')) {
return false;
}
return true;
}
public static String getHttpHost(String str) {
if (str.startsWith("http://"))
str = str.substring(7);
else if (str.startsWith("https://"))
str = str.substring(8);
int idx = str.indexOf('/');
if (idx != -1)
return str.substring(0, idx);
return str;
}
/**
* Returns a string representing a relative directory path. Examples:
* "/tmp/dir/" -> "dir/" and "/tmp/dir" -> "dir"
*/
public static String getPath(String file) {
int x = file.lastIndexOf("/");
// unix
if (x >= 0) {
file = file.substring(0, x);
return file;
}
// windows
x = file.lastIndexOf("\\");
if (x >= 0) {
file = file.substring(0, x);
return file;
} else
return "";
}
}
| UTF-8 | Java | 3,032 | java | PathResolver.java | Java | [] | null | [] | package com.sparrow.collect.utils;
import org.apache.commons.lang3.StringUtils;
public class PathResolver {
static final String EMPTY_STRING = "";
public static String getFileName(String file) {
int x = file.lastIndexOf("/");
// unix
if (x >= 0) {
file = file.substring(x + 1);
return file;
}
// windows
x = file.lastIndexOf("\\");
if (x >= 0) {
return file.substring(x + 1);
}
return file;
}
public static String removeQuery(String str) {
int idx = str.indexOf('?');
if (idx != -1)
return str.substring(0, idx);
return str;
}
public static String getExtension(String file) {
int x = file.lastIndexOf('.');
if (x >= 0)
return file.substring(x + 1);
else
return EMPTY_STRING;
}
public static boolean hasFileExtension(String file) {
int idx = file.lastIndexOf('/');
if (idx > 7)
return file.lastIndexOf('.') > idx;
else
return false;
}
public static String getFilePath(String file) {
if (StringUtils.isEmpty(file))
return "";
int x = file.lastIndexOf("/");
// unix
if (x >= 0) {
file = file.substring(0, x);
return file;
}
// windows
x = file.lastIndexOf("\\");
if (x >= 0) {
file = file.substring(0, x);
return file;
} else
return "";
}
public static String trimExtension(String fileName) {
int x = fileName.lastIndexOf('.');
if (x >= 0)
fileName = fileName.substring(0, x);
return fileName;
}
/*
* Returns true if the string represents a relative filename, false
* otherwise
*/
public static boolean isRelative(String file) {
// unix
if (file.startsWith("/")) {
return false;
}
// windows
if ((file.length() > 2) && (file.charAt(1) == ':')) {
return false;
}
return true;
}
public static String getHttpHost(String str) {
if (str.startsWith("http://"))
str = str.substring(7);
else if (str.startsWith("https://"))
str = str.substring(8);
int idx = str.indexOf('/');
if (idx != -1)
return str.substring(0, idx);
return str;
}
/**
* Returns a string representing a relative directory path. Examples:
* "/tmp/dir/" -> "dir/" and "/tmp/dir" -> "dir"
*/
public static String getPath(String file) {
int x = file.lastIndexOf("/");
// unix
if (x >= 0) {
file = file.substring(0, x);
return file;
}
// windows
x = file.lastIndexOf("\\");
if (x >= 0) {
file = file.substring(0, x);
return file;
} else
return "";
}
}
| 3,032 | 0.483839 | 0.475264 | 118 | 24.694916 | 17.419796 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.440678 | false | false | 3 |
0a5e6cad1d57a375ae463061f954ff671f0628ee | 2,783,138,822,257 | f5b021ccf3b725b89cd54addf56160a284b45b04 | /src/datastructures/BinaryTree.java | 05973055d721ca4987d9c3a69ef5d2aad4556081 | [] | no_license | Zero-bot/Algorithms | https://github.com/Zero-bot/Algorithms | 684bee645150f17c7c0ed1c779d48af18cbd86a6 | e93bc6a2d2c7b115485bf69342f8b997aa10d1f6 | refs/heads/master | 2016-08-12T08:52:22.200000 | 2016-02-02T07:27:30 | 2016-02-02T07:27:30 | 48,619,384 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
*
*/
package datastructures;
import java.util.Iterator;
import java.util.NoSuchElementException;
/** Comp
* @author Marimuthu
*7:55:37 PM Jan 10, 2016
*/
public class BinaryTree<Key extends Comparable<Key>,Item> {
private Node root;
private class Node{
Key key;
Item item;
Node right;
Node left;
int N;
Node(Key key,Item item,int N){
this.key=key;
this.item=item;
this.right=null;
this.left=null;
this.N=N;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "[key=" + key + ", item=" + item + "]";
}
}
public void put(Key key,Item item){
root=put(root,key,item);
}
public int size(){
return size(root);
}
private int size(Node node){
if(node==null) return 0;
return node.N;
}
public boolean isEmpty(){
return size()==1;
}
private Node put(Node node,Key key,Item item){
if(node==null)
return new Node(key,item,1);
int cmp=key.compareTo((Key) node.key);
if(cmp<0) node.left=put(node.left, key, item);
else if(cmp>0) node.right=put(node.right,key, item);
else node.item=item;
node.N=1+size(node.left)+size(node.right);
return node;
}
public Item get(Key key){
Node node= get(root,key);
if(node==null) return null;
else return (Item) node.item;
}
private Node get(Node node,Key key){
if(node==null) return null;
int cmp=node.key.compareTo(key);
if(cmp==0) return node;
else if(cmp<0) return get(node.left,key);
else return get(node.right,key);
}
public void inorder(){
inorder(root);
System.out.println();
}
private void inorder(Node node){
if(node==null) return;
inorder(node.left);
System.out.print(node+" ");
inorder(node.right);
}
public void preorder(){
preorder(root);
System.out.println();
}
private void preorder(Node node){
if(node==null) return;
System.out.print(node+" ");
preorder(node.left);
preorder(node.right);
}
public void postorder(){
postorder(root);
System.out.println();
}
private void postorder(Node node){
if(node==null) return;
postorder(node.left);
postorder(node.right);
System.out.print(node+" ");
}
private void levelOrder(Node node){
Queue<Node> queue=new Queue<>();
queue.enqueue(node);
while(!queue.isEmpty()){
Node current=queue.dequeue();
if(current!=null)
System.out.print(current);
if(current.left!=null)
queue.enqueue(current.left);
if(current.right!=null)
queue.enqueue(current.right);
}
}
public void levelOrder(){
levelOrder(root);
System.out.println();
}
public void zizzag(){
zigzag(root);
System.out.println();
}
private void zigzag(Node node){
Stack<Node> stack_1=new Stack<>();
Stack<Node> stack_2=new Stack<>();
stack_1.push(node);
while(!stack_1.isEmpty()||!stack_2.isEmpty()){
Node temp;
while(!stack_1.isEmpty()){
temp=stack_1.pop();
System.out.print(temp+" ");
if(temp.right!=null)
stack_2.push(temp.right);
if(temp.left!=null)
stack_2.push(temp.left);
}
while(!stack_2.isEmpty()){
temp=stack_2.pop();
System.out.print(temp+" ");
if(temp.left!=null)
stack_1.push(temp.left);
if(temp.right!=null)
stack_1.push(temp.right);
}
}
}
public int height(){
return height(root);
}
private int height(Node node){
if(node==null) return 0;
int leftHeight=height(node.left);
int rightHeight=height(node.right);
return Math.max(leftHeight, rightHeight)+1;
}
private int diameter(Node node){
if(node==null) return 0;
int leftHeight=height(node.left);
int rightHeight=height(node.right);
int leftDiameter=diameter(node.left);
int rightDiameter=diameter(node.right);
return Math.max(leftHeight+rightHeight+1,Math.max(leftDiameter, rightDiameter));
}
public int diameter(){
return diameter(root);
}
public void deleteMin(){
if(isEmpty()) throw new NoSuchElementException("Tree is empty");
root=deleteMin(root);
}
private Node deleteMin(Node node){
if(node.left==null) return node.right;
node.left=deleteMin(node.left);
node.N=size(node.left)+size(node.right)+1;
return node;
}
private Node deleteMax(Node node){
if(node.right==null) return node.left;
node.right=deleteMax(node.right);
node.N=size(node.left)+size(node.right)+1;
return node;
}
public void deleteMax(){
if(isEmpty()) throw new NoSuchElementException("Tree is empty");
root=deleteMax(root);
}
public void delete(Key key){
if(isEmpty()) throw new NoSuchElementException();
root = delete(root,key);
}
private Node delete(Node node,Key key){
if(node==null) return null;
int cmp=node.key.compareTo(key);
if(cmp>0) node.left=delete(node.left,key);
else if (cmp<0)node.right=delete(node.right, key);
else{
if(node.right==null) return node.left;
if(node.left==null) return node.right;
Node temp=node;
node=min(temp.right);
node.right=deleteMin(temp.right);
node.left=temp.left;
node.N=1+size(node.left)+size(node.right);
return node;
}
return node;
}
public Node floor(Node node,Key key){
if (node==null) return null;
int cmp=node.key.compareTo(key);
if(cmp>0) return floor(node.left, key);
else{
Node temp=floor(node.right,key);
if(temp!=null)
return temp;
else return node;
}
}
public Node floor(Key key){
return floor(root, key);
}
private Node celling(Node node,Key key){
if(node==null) return null;
int cmp=node.key.compareTo(key);
if(cmp==0) return node;
if(cmp<0) return celling(node.right, key);
else{
Node temp=celling(node.left, key);
if(temp!=null) return temp;
return node;
}
}
public Node celling(Key key){
return celling(root,key);
}
private void keys(Node node,Queue<Node> q,Key low, Key high){
if(node==null) return;
int cmpLow=node.key.compareTo(low);
int cmpHigh=node.key.compareTo(high);
if(cmpLow>0) keys(node.left, q, low, high);
if(cmpLow>=0&&cmpHigh<=0) q.enqueue(node);
if(cmpHigh<0) keys(node.right, q, low, high);
}
public Queue<Node> keys(Key low, Key high){
Queue<Node> q=new Queue<>();
keys(root,q,low, high);
return q;
}
private Node min(Node node){
if(node.left==null) return node;
return min(node.left);
}
public Node min(){
return min(root);
}
private boolean isBst(Node node,Key min,Key max){
if(node==null) return true;
if(min!=null && node.key.compareTo(min)<0) return false;
if(max!=null && node.key.compareTo(max)>0) return false;
return isBst(node.left, min, node.key) && isBst(node.right, node.key, max);
}
public boolean isBst(){
return isBst(root,null,null);
}
public static void main(String args[]){
BinaryTree<Integer, String> bst=new BinaryTree<>();
bst.put(11,"Marimuthu");
bst.put(10,"everybody");
bst.put(12,"nobody");
bst.put(0, "Sombody");
bst.put(6,"six");
bst.put(122, "max");
bst.put(20, "ksd");
bst.put(21, "tenty1");
bst.put(29, "tenty1");
bst.preorder();
bst.inorder();
bst.postorder();
Iterator itr=bst.keys(2, 13).iterator();
while(itr.hasNext())
System.out.print(itr.next()+" ");
System.out.println();
System.out.println(bst.isBst());
}
}
| UTF-8 | Java | 7,110 | java | BinaryTree.java | Java | [
{
"context": ".util.NoSuchElementException;\n\n/** Comp\n * @author Marimuthu\n *7:55:37 PM Jan 10, 2016\n */\npublic class Binary",
"end": 135,
"score": 0.9997404217720032,
"start": 126,
"tag": "NAME",
"value": "Marimuthu"
},
{
"context": "er, String> bst=new BinaryTree<>();\n\t\tbst.put(11,\"Marimuthu\");\n\t\tbst.put(10,\"everybody\");\n\t\tbst.put(12,\"nobod",
"end": 6691,
"score": 0.9998152256011963,
"start": 6682,
"tag": "NAME",
"value": "Marimuthu"
}
] | null | [] | /**
*
*/
package datastructures;
import java.util.Iterator;
import java.util.NoSuchElementException;
/** Comp
* @author Marimuthu
*7:55:37 PM Jan 10, 2016
*/
public class BinaryTree<Key extends Comparable<Key>,Item> {
private Node root;
private class Node{
Key key;
Item item;
Node right;
Node left;
int N;
Node(Key key,Item item,int N){
this.key=key;
this.item=item;
this.right=null;
this.left=null;
this.N=N;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "[key=" + key + ", item=" + item + "]";
}
}
public void put(Key key,Item item){
root=put(root,key,item);
}
public int size(){
return size(root);
}
private int size(Node node){
if(node==null) return 0;
return node.N;
}
public boolean isEmpty(){
return size()==1;
}
private Node put(Node node,Key key,Item item){
if(node==null)
return new Node(key,item,1);
int cmp=key.compareTo((Key) node.key);
if(cmp<0) node.left=put(node.left, key, item);
else if(cmp>0) node.right=put(node.right,key, item);
else node.item=item;
node.N=1+size(node.left)+size(node.right);
return node;
}
public Item get(Key key){
Node node= get(root,key);
if(node==null) return null;
else return (Item) node.item;
}
private Node get(Node node,Key key){
if(node==null) return null;
int cmp=node.key.compareTo(key);
if(cmp==0) return node;
else if(cmp<0) return get(node.left,key);
else return get(node.right,key);
}
public void inorder(){
inorder(root);
System.out.println();
}
private void inorder(Node node){
if(node==null) return;
inorder(node.left);
System.out.print(node+" ");
inorder(node.right);
}
public void preorder(){
preorder(root);
System.out.println();
}
private void preorder(Node node){
if(node==null) return;
System.out.print(node+" ");
preorder(node.left);
preorder(node.right);
}
public void postorder(){
postorder(root);
System.out.println();
}
private void postorder(Node node){
if(node==null) return;
postorder(node.left);
postorder(node.right);
System.out.print(node+" ");
}
private void levelOrder(Node node){
Queue<Node> queue=new Queue<>();
queue.enqueue(node);
while(!queue.isEmpty()){
Node current=queue.dequeue();
if(current!=null)
System.out.print(current);
if(current.left!=null)
queue.enqueue(current.left);
if(current.right!=null)
queue.enqueue(current.right);
}
}
public void levelOrder(){
levelOrder(root);
System.out.println();
}
public void zizzag(){
zigzag(root);
System.out.println();
}
private void zigzag(Node node){
Stack<Node> stack_1=new Stack<>();
Stack<Node> stack_2=new Stack<>();
stack_1.push(node);
while(!stack_1.isEmpty()||!stack_2.isEmpty()){
Node temp;
while(!stack_1.isEmpty()){
temp=stack_1.pop();
System.out.print(temp+" ");
if(temp.right!=null)
stack_2.push(temp.right);
if(temp.left!=null)
stack_2.push(temp.left);
}
while(!stack_2.isEmpty()){
temp=stack_2.pop();
System.out.print(temp+" ");
if(temp.left!=null)
stack_1.push(temp.left);
if(temp.right!=null)
stack_1.push(temp.right);
}
}
}
public int height(){
return height(root);
}
private int height(Node node){
if(node==null) return 0;
int leftHeight=height(node.left);
int rightHeight=height(node.right);
return Math.max(leftHeight, rightHeight)+1;
}
private int diameter(Node node){
if(node==null) return 0;
int leftHeight=height(node.left);
int rightHeight=height(node.right);
int leftDiameter=diameter(node.left);
int rightDiameter=diameter(node.right);
return Math.max(leftHeight+rightHeight+1,Math.max(leftDiameter, rightDiameter));
}
public int diameter(){
return diameter(root);
}
public void deleteMin(){
if(isEmpty()) throw new NoSuchElementException("Tree is empty");
root=deleteMin(root);
}
private Node deleteMin(Node node){
if(node.left==null) return node.right;
node.left=deleteMin(node.left);
node.N=size(node.left)+size(node.right)+1;
return node;
}
private Node deleteMax(Node node){
if(node.right==null) return node.left;
node.right=deleteMax(node.right);
node.N=size(node.left)+size(node.right)+1;
return node;
}
public void deleteMax(){
if(isEmpty()) throw new NoSuchElementException("Tree is empty");
root=deleteMax(root);
}
public void delete(Key key){
if(isEmpty()) throw new NoSuchElementException();
root = delete(root,key);
}
private Node delete(Node node,Key key){
if(node==null) return null;
int cmp=node.key.compareTo(key);
if(cmp>0) node.left=delete(node.left,key);
else if (cmp<0)node.right=delete(node.right, key);
else{
if(node.right==null) return node.left;
if(node.left==null) return node.right;
Node temp=node;
node=min(temp.right);
node.right=deleteMin(temp.right);
node.left=temp.left;
node.N=1+size(node.left)+size(node.right);
return node;
}
return node;
}
public Node floor(Node node,Key key){
if (node==null) return null;
int cmp=node.key.compareTo(key);
if(cmp>0) return floor(node.left, key);
else{
Node temp=floor(node.right,key);
if(temp!=null)
return temp;
else return node;
}
}
public Node floor(Key key){
return floor(root, key);
}
private Node celling(Node node,Key key){
if(node==null) return null;
int cmp=node.key.compareTo(key);
if(cmp==0) return node;
if(cmp<0) return celling(node.right, key);
else{
Node temp=celling(node.left, key);
if(temp!=null) return temp;
return node;
}
}
public Node celling(Key key){
return celling(root,key);
}
private void keys(Node node,Queue<Node> q,Key low, Key high){
if(node==null) return;
int cmpLow=node.key.compareTo(low);
int cmpHigh=node.key.compareTo(high);
if(cmpLow>0) keys(node.left, q, low, high);
if(cmpLow>=0&&cmpHigh<=0) q.enqueue(node);
if(cmpHigh<0) keys(node.right, q, low, high);
}
public Queue<Node> keys(Key low, Key high){
Queue<Node> q=new Queue<>();
keys(root,q,low, high);
return q;
}
private Node min(Node node){
if(node.left==null) return node;
return min(node.left);
}
public Node min(){
return min(root);
}
private boolean isBst(Node node,Key min,Key max){
if(node==null) return true;
if(min!=null && node.key.compareTo(min)<0) return false;
if(max!=null && node.key.compareTo(max)>0) return false;
return isBst(node.left, min, node.key) && isBst(node.right, node.key, max);
}
public boolean isBst(){
return isBst(root,null,null);
}
public static void main(String args[]){
BinaryTree<Integer, String> bst=new BinaryTree<>();
bst.put(11,"Marimuthu");
bst.put(10,"everybody");
bst.put(12,"nobody");
bst.put(0, "Sombody");
bst.put(6,"six");
bst.put(122, "max");
bst.put(20, "ksd");
bst.put(21, "tenty1");
bst.put(29, "tenty1");
bst.preorder();
bst.inorder();
bst.postorder();
Iterator itr=bst.keys(2, 13).iterator();
while(itr.hasNext())
System.out.print(itr.next()+" ");
System.out.println();
System.out.println(bst.isBst());
}
}
| 7,110 | 0.659916 | 0.649789 | 298 | 22.85906 | 15.693379 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.607383 | false | false | 3 |
16605528a00b5b945f0bd399ed1ef5605cffbb64 | 25,933,012,547,728 | bc88aba3b18237466b6564af2cdbcc7600bc22c3 | /src/main/java/com/sobart/partstock/service/TelegramBotService.java | dddf716c48a496b31aadeaa0b1275ca1f5826282 | [] | no_license | ArtemSobolenko/partstok | https://github.com/ArtemSobolenko/partstok | 56810a2dac9a21014fb7bfd6d6d86537bd56a653 | bf45f932abfd7db5b59085214c1efe3b4d73ab65 | refs/heads/master | 2021-07-03T11:44:26.867000 | 2019-05-29T09:50:48 | 2019-05-29T09:50:48 | 187,207,087 | 0 | 0 | null | false | 2020-10-13T13:18:00 | 2019-05-17T11:46:52 | 2019-05-29T09:50:59 | 2020-10-13T13:17:58 | 82 | 0 | 0 | 1 | Java | false | false | package com.sobart.partstock.service;
import com.sobart.partstock.bots.TelegramBot;
import org.springframework.stereotype.Service;
import org.telegram.telegrambots.ApiContextInitializer;
import org.telegram.telegrambots.meta.TelegramBotsApi;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
@Service
public class TelegramBotService {
private TelegramBot telegramBot;
public TelegramBot getTelegramBot() {
return telegramBot;
}
public void botInit() {
// Initialize Api Context
ApiContextInitializer.init();
// Instantiate Telegram Bots API
TelegramBotsApi botsApi = new TelegramBotsApi();
//Registration bot
try {
this.telegramBot = new TelegramBot();
botsApi.registerBot(this.telegramBot);
} catch (TelegramApiException e) {
e.printStackTrace();
}
}
}
| UTF-8 | Java | 912 | java | TelegramBotService.java | Java | [] | null | [] | package com.sobart.partstock.service;
import com.sobart.partstock.bots.TelegramBot;
import org.springframework.stereotype.Service;
import org.telegram.telegrambots.ApiContextInitializer;
import org.telegram.telegrambots.meta.TelegramBotsApi;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
@Service
public class TelegramBotService {
private TelegramBot telegramBot;
public TelegramBot getTelegramBot() {
return telegramBot;
}
public void botInit() {
// Initialize Api Context
ApiContextInitializer.init();
// Instantiate Telegram Bots API
TelegramBotsApi botsApi = new TelegramBotsApi();
//Registration bot
try {
this.telegramBot = new TelegramBot();
botsApi.registerBot(this.telegramBot);
} catch (TelegramApiException e) {
e.printStackTrace();
}
}
}
| 912 | 0.697368 | 0.697368 | 35 | 25.057142 | 21.262903 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.371429 | false | false | 3 |
16166fc22b453fb88a747b7a4543519fb42b0b50 | 18,270,790,891,940 | c32a8b0d594b882dda838950929c9e02c719b2d7 | /src/main/java/pattern/factory/factorymerg/MergFactoryTest.java | e0a30e06f367c22387b9f4fcaa448847e96c56a6 | [] | no_license | yulianggui/pattern | https://github.com/yulianggui/pattern | e74cce1d0ebdf612bbacf601457c49d49c221bbd | 7de21e3cd27b99d0a1b3106c8512ba44a2df6063 | refs/heads/master | 2020-03-29T15:20:48.468000 | 2018-10-05T17:53:39 | 2018-10-05T17:53:39 | 150,058,214 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package pattern.factory.factorymerg;
import pattern.factory.IPay;
/**
* create by zhegui on 2018/9/24
*/
public class MergFactoryTest {
public static void main(String[] args) {
AbstartFactoryDemo factory = new MergFactory();
//刷卡
IPay cardPay = factory.getCardPay();
cardPay.doPay();
//支付宝支付
IPay aliPay = factory.getAliPay();
aliPay.doPay();
}
}
| UTF-8 | Java | 432 | java | MergFactoryTest.java | Java | [
{
"context": "g;\n\nimport pattern.factory.IPay;\n\n/**\n * create by zhegui on 2018/9/24\n */\npublic class MergFactoryTest {\n\n",
"end": 91,
"score": 0.9996213316917419,
"start": 85,
"tag": "USERNAME",
"value": "zhegui"
}
] | null | [] | package pattern.factory.factorymerg;
import pattern.factory.IPay;
/**
* create by zhegui on 2018/9/24
*/
public class MergFactoryTest {
public static void main(String[] args) {
AbstartFactoryDemo factory = new MergFactory();
//刷卡
IPay cardPay = factory.getCardPay();
cardPay.doPay();
//支付宝支付
IPay aliPay = factory.getAliPay();
aliPay.doPay();
}
}
| 432 | 0.617225 | 0.600478 | 21 | 18.904762 | 17.8323 | 55 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 3 |
5724e5296f90d5d532e82b37f38a4ecfe46b7795 | 27,127,013,457,375 | b38fa8ec08b8bd0550a27a1b55a321d2cd916173 | /NetBeans/Transformer/src/java/pt/spp/entities/Tempmail.java | 6275b275170ac7ace02c314cfdeb80a9ee0e0b5f | [] | no_license | carlneto/spp-psp | https://github.com/carlneto/spp-psp | 38705fc5417ab85db320321c9aa73195d18b8d0a | d7949034f698426aa15038a11a99fc4ad4d4d573 | refs/heads/master | 2016-08-11T18:34:02.133000 | 2015-12-28T18:55:34 | 2015-12-28T18:55:34 | 46,305,936 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pt.spp.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.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
*
* @author carlneto
*/
@Entity
@Table(name = "Tempmail")
@NamedQueries({
@NamedQuery(name = "Tempmail.findAll", query = "SELECT t FROM Tempmail t")})
public class Tempmail implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "ID")
private Long id;
// @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "Email")
private String email;
@Column(name = "Numero")
private Integer numero;
@Size(max = 45)
@Column(name = "Nome")
private String nome;
@Column(name = "Check")
private Integer valido;
public Tempmail() {
}
public Tempmail(Long id) {
this.id = id;
}
public Tempmail(Long id, String email) {
this.id = id;
this.email = email;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getNumero() {
return numero;
}
public void setNumero(Integer numero) {
this.numero = numero;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public Integer getValido() {
return valido;
}
public void setValido(Integer valido) {
this.valido = valido;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.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 Tempmail)) {
return false;
}
Tempmail other = (Tempmail) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "pt.spp.entities.Tempmail[ id=" + id + " ]";
}
}
| UTF-8 | Java | 3,087 | java | Tempmail.java | Java | [
{
"context": "ax.validation.constraints.Size;\n\n/**\n *\n * @author carlneto\n */\n@Entity\n@Table(name = \"Tempmail\")\n@NamedQueri",
"end": 671,
"score": 0.9915937185287476,
"start": 663,
"tag": "USERNAME",
"value": "carlneto"
}
] | null | [] | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pt.spp.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.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
*
* @author carlneto
*/
@Entity
@Table(name = "Tempmail")
@NamedQueries({
@NamedQuery(name = "Tempmail.findAll", query = "SELECT t FROM Tempmail t")})
public class Tempmail implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "ID")
private Long id;
// @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "Email")
private String email;
@Column(name = "Numero")
private Integer numero;
@Size(max = 45)
@Column(name = "Nome")
private String nome;
@Column(name = "Check")
private Integer valido;
public Tempmail() {
}
public Tempmail(Long id) {
this.id = id;
}
public Tempmail(Long id, String email) {
this.id = id;
this.email = email;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getNumero() {
return numero;
}
public void setNumero(Integer numero) {
this.numero = numero;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public Integer getValido() {
return valido;
}
public void setValido(Integer valido) {
this.valido = valido;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.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 Tempmail)) {
return false;
}
Tempmail other = (Tempmail) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "pt.spp.entities.Tempmail[ id=" + id + " ]";
}
}
| 3,087 | 0.627794 | 0.620019 | 128 | 23.117188 | 29.849785 | 281 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.398438 | false | false | 3 |
5fc5167f7714bdafbb16491d67f1a8ae843fc69b | 6,313,601,959,190 | 93bd3ec0e20a68c3e28e60034b7f6bf99dc616b0 | /Ingressos/Normal.java | f4548c5252a7ffff13903004eaf9dced64b6fb75 | [] | no_license | EduCatunda/Java-Files | https://github.com/EduCatunda/Java-Files | 8da66b902e2ef93de33646730541870dfe9db413 | bf69180df3b5eef4d11d89490377028151c7333e | refs/heads/master | 2020-06-05T20:06:12.116000 | 2019-09-06T20:35:26 | 2019-09-06T20:35:26 | 192,534,360 | 0 | 0 | null | false | 2019-06-18T12:39:20 | 2019-06-18T12:20:20 | 2019-06-18T12:35:51 | 2019-06-18T12:38:24 | 0 | 0 | 0 | 1 | Java | false | false | package Ingressos;
public class Normal extends Ingresso {
public void imprimeValorN(double valor){
System.out.println("Valor do Ingresso: R$" + valor);
}
}
| UTF-8 | Java | 189 | java | Normal.java | Java | [] | null | [] | package Ingressos;
public class Normal extends Ingresso {
public void imprimeValorN(double valor){
System.out.println("Valor do Ingresso: R$" + valor);
}
}
| 189 | 0.62963 | 0.62963 | 8 | 21.375 | 21.702175 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 3 |
75faa537632a295e01d30ecdd1d08199891d8571 | 14,697,378,145,252 | 1f6d10cb3c04f948593683ca733ad0cf7a3b1a2a | /server/src/main/java/kr/or/hanium/lego/vm/SendEmailResultVM.java | daea8491f4084cea9baf8b6f8fb81412f58e49a8 | [] | no_license | qws7/BlockID | https://github.com/qws7/BlockID | cab96da05bfcdcbf6a4412d1e2fb67ef412fabd0 | 9da5b7bd2788a727df7f701f40d4098de1072123 | refs/heads/main | 2023-03-15T18:05:41.606000 | 2020-11-21T16:16:49 | 2020-11-21T16:16:49 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package kr.or.hanium.lego.vm;
import lombok.Data;
@Data
public class SendEmailResultVM {
private String authCode;
}
| UTF-8 | Java | 122 | java | SendEmailResultVM.java | Java | [] | null | [] | package kr.or.hanium.lego.vm;
import lombok.Data;
@Data
public class SendEmailResultVM {
private String authCode;
}
| 122 | 0.754098 | 0.754098 | 8 | 14.25 | 13.282978 | 32 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.375 | false | false | 3 |
47248e932494b232bd4c8130fa1e6fda075dd169 | 1,159,641,214,450 | 08b322d183e63e5c5598960895ae2f61f48bc2b6 | /app/src/main/java/com/hc/wallcontrl/bean/ScreenInputBean.java | 34d494f75b6f1ff73db82666f454f384fca517a5 | [] | no_license | AlexQcs/BitcOk | https://github.com/AlexQcs/BitcOk | 9e6b0dc3b404305495e0a8df3f4bd2577c3b3dd4 | f3acc5672b667e498cedb58a5ba2049d09dde56c | refs/heads/master | 2021-01-20T01:38:52.338000 | 2017-05-22T03:18:42 | 2017-05-22T03:18:42 | 89,307,491 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.hc.wallcontrl.bean;
import java.io.Serializable;
/**
* Created by alex on 2017/5/8.
*/
public class ScreenInputBean implements Serializable {
private int column;//列
private int row;//排
private String signalSource;//信号源
private String inputName;//矩阵输入
private String switchCate;//切换类型
private boolean isUseMatrix;//是否使用矩阵
public int getColumn() {
return column;
}
public void setColumn(int column) {
this.column = column;
}
public int getRow() {
return row;
}
public void setRow(int row) {
this.row = row;
}
public String getSignalSource() {
return signalSource;
}
public void setSignalSource(String signalSource) {
this.signalSource = signalSource;
}
public String getInputName() {
return inputName;
}
public void setInputName(String inputName) {
this.inputName = inputName;
}
public String getSwitchCate() {
return switchCate;
}
public void setSwitchCate(String switchCate) {
this.switchCate = switchCate;
}
public boolean isUseMatrix() {
return isUseMatrix;
}
public void setUseMatrix(boolean useMatrix) {
isUseMatrix = useMatrix;
}
@Override
public String toString() {
return "ScreenInputBean{" +
"column=" + column +
", row=" + row +
", inputSource='" + signalSource + '\'' +
", inputName='" + inputName + '\'' +
", switchCate='" + switchCate + '\'' +
", isUseMatrix=" + isUseMatrix +
'}';
}
}
| UTF-8 | Java | 1,716 | java | ScreenInputBean.java | Java | [
{
"context": ";\n\nimport java.io.Serializable;\n\n/**\n * Created by alex on 2017/5/8.\n */\n\npublic class ScreenInputBean im",
"end": 85,
"score": 0.9987658262252808,
"start": 81,
"tag": "USERNAME",
"value": "alex"
}
] | null | [] | package com.hc.wallcontrl.bean;
import java.io.Serializable;
/**
* Created by alex on 2017/5/8.
*/
public class ScreenInputBean implements Serializable {
private int column;//列
private int row;//排
private String signalSource;//信号源
private String inputName;//矩阵输入
private String switchCate;//切换类型
private boolean isUseMatrix;//是否使用矩阵
public int getColumn() {
return column;
}
public void setColumn(int column) {
this.column = column;
}
public int getRow() {
return row;
}
public void setRow(int row) {
this.row = row;
}
public String getSignalSource() {
return signalSource;
}
public void setSignalSource(String signalSource) {
this.signalSource = signalSource;
}
public String getInputName() {
return inputName;
}
public void setInputName(String inputName) {
this.inputName = inputName;
}
public String getSwitchCate() {
return switchCate;
}
public void setSwitchCate(String switchCate) {
this.switchCate = switchCate;
}
public boolean isUseMatrix() {
return isUseMatrix;
}
public void setUseMatrix(boolean useMatrix) {
isUseMatrix = useMatrix;
}
@Override
public String toString() {
return "ScreenInputBean{" +
"column=" + column +
", row=" + row +
", inputSource='" + signalSource + '\'' +
", inputName='" + inputName + '\'' +
", switchCate='" + switchCate + '\'' +
", isUseMatrix=" + isUseMatrix +
'}';
}
}
| 1,716 | 0.571514 | 0.567938 | 78 | 20.512821 | 18.046055 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 3 |
659bce042e41878270e83fb2f690b547e7714d35 | 3,865,470,568,165 | 38bcb87ba0258dbdafd3dcd277b033874de6e3da | /product-store-v2/src/test/java/com/wipro/thiago/models/ImageTest.java | 83e0ebcbaf1d3d02ae355cf001a154645ca48376 | [] | no_license | ThiagoAnd/java-store-project-v2 | https://github.com/ThiagoAnd/java-store-project-v2 | c97a228b9e4737f72add1e7aa37eaa5bad4b5689 | 78c312b710c06cf93f43ba6c62a8a45349e4c4a3 | refs/heads/main | 2023-03-29T04:50:59.635000 | 2021-03-31T19:37:31 | 2021-03-31T19:37:31 | 351,765,463 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.wipro.thiago.models;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class ImageTest {
@Test
void should_ReturnNotNull_When_InstantiateImage(){
//given
Image image;
//when
image = new Image("Front", 44, "http://www.google.com/front.png", "png");
//then
assertNotNull(image);
}
}
| UTF-8 | Java | 375 | java | ImageTest.java | Java | [] | null | [] | package com.wipro.thiago.models;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class ImageTest {
@Test
void should_ReturnNotNull_When_InstantiateImage(){
//given
Image image;
//when
image = new Image("Front", 44, "http://www.google.com/front.png", "png");
//then
assertNotNull(image);
}
}
| 375 | 0.650667 | 0.645333 | 28 | 12.392858 | 18.724199 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.464286 | false | false | 3 |
89d9b5865f01c14d1887389a53a17c7d70292335 | 10,926,396,813,036 | 3cc6b773e4474ba958285af8d30455b07b8b5020 | /CollectionsProject/src/ArrayListMethods.java | cc202e4697340948879efce0317cd3003aa31132 | [] | no_license | himanshu2302/eclipse-workspace2021 | https://github.com/himanshu2302/eclipse-workspace2021 | 2bba4cd4e45115e92eacb4801082a86eb898418e | b210f40db39d8330efa8ce150eb1292b407de305 | refs/heads/master | 2023-03-05T06:33:05.816000 | 2021-02-20T07:00:48 | 2021-02-20T07:00:48 | 340,586,307 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.ArrayList;
public class ArrayListMethods {
public static void main(String[] args) {
ArrayList<String> ar1 = new ArrayList<String>();
ar1.add("My");
ar1.add("Name");
ar1.add("is");
System.out.println(ar1);
// System.out.println("--------------------------------");
//
// ArrayList<String> ar2 = new ArrayList<String>();
// ar2.add("Himanshu");
// ar2.add("Dubey");
// System.out.println(ar2);
//
// //ar1.addAll(ar2);
// System.out.println(ar1);
// System.out.println("--------------------------------");
//
// ar1.add(3, "Shubhanshu");
// System.out.println(ar1);
// System.out.println("--------------------------------");
// ar1.addAll(2, ar2);
// System.out.println(ar1);
// System.out.println("--------------------------------");
Object clone = ar1.clone();
System.out.println("Cloned list is : "+clone);
boolean contains = ar1.contains("Name");
System.out.println(contains);
}
}
| UTF-8 | Java | 979 | java | ArrayListMethods.java | Java | [
{
"context": ");\n\t\tar1.add(\"My\");\n\t\tar1.add(\"Name\");\n\t\tar1.add(\"is\");\n\t\tSystem.out.println(ar1);\n\n\t\t//\t\tSystem.out.p",
"end": 204,
"score": 0.8721328973770142,
"start": 202,
"tag": "NAME",
"value": "is"
},
{
"context": "ng> ar2 = new ArrayList<String>();\n\t\t//\t\tar2.add(\"Himanshu\");\n\t\t//\t\tar2.add(\"Dubey\");\n\t\t//\t\tSystem.out.print",
"end": 381,
"score": 0.9996623396873474,
"start": 373,
"tag": "NAME",
"value": "Himanshu"
},
{
"context": "ing>();\n\t\t//\t\tar2.add(\"Himanshu\");\n\t\t//\t\tar2.add(\"Dubey\");\n\t\t//\t\tSystem.out.println(ar2);\n\t\t//\n\t\t//\t\t//ar",
"end": 405,
"score": 0.9996681809425354,
"start": 400,
"tag": "NAME",
"value": "Dubey"
},
{
"context": "-----------------------\");\n\t\t//\n\t\t//\t\tar1.add(3, \"Shubhanshu\");\n\t\t//\t\tSystem.out.println(ar1);\n\t\t//\t\tSystem.ou",
"end": 596,
"score": 0.999592661857605,
"start": 586,
"tag": "NAME",
"value": "Shubhanshu"
}
] | null | [] | import java.util.ArrayList;
public class ArrayListMethods {
public static void main(String[] args) {
ArrayList<String> ar1 = new ArrayList<String>();
ar1.add("My");
ar1.add("Name");
ar1.add("is");
System.out.println(ar1);
// System.out.println("--------------------------------");
//
// ArrayList<String> ar2 = new ArrayList<String>();
// ar2.add("Himanshu");
// ar2.add("Dubey");
// System.out.println(ar2);
//
// //ar1.addAll(ar2);
// System.out.println(ar1);
// System.out.println("--------------------------------");
//
// ar1.add(3, "Shubhanshu");
// System.out.println(ar1);
// System.out.println("--------------------------------");
// ar1.addAll(2, ar2);
// System.out.println(ar1);
// System.out.println("--------------------------------");
Object clone = ar1.clone();
System.out.println("Cloned list is : "+clone);
boolean contains = ar1.contains("Name");
System.out.println(contains);
}
}
| 979 | 0.52094 | 0.499489 | 40 | 23.475 | 20.021223 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.75 | false | false | 3 |
10df0aa13c97cc8e2a7fa8674508b60b8d375cb2 | 20,203,526,164,749 | a00b4ff4b219525a616048e46c4b0ec26d11cf63 | /Codeplus/src/B1495.java | 04f45dbd933ffc289b3f693784f5f73b48c93758 | [] | no_license | chanhl22/Algorithm | https://github.com/chanhl22/Algorithm | ba5f9589f198b7cf7e1643c6010c3b0ebb350b8f | 16611ef656964f7675e0fb151cfaf1ae16be8da0 | refs/heads/master | 2023-08-14T13:59:30.774000 | 2021-09-13T02:02:16 | 2021-09-13T02:02:16 | 355,183,121 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.Scanner;
public class B1495 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(); //count
int s = sc.nextInt(); //first volume
int m = sc.nextInt(); //volume range
int[] v = new int[n+1];
for (int i = 1; i <= n; i++) {
v[i] = sc.nextInt();
}
boolean[][] d = new boolean[n+1][m+1];
d[0][s] = true;
for (int i = 0; i <= n-1; i++) {
for (int j = 0; j <= m; j++) {
if (d[i][j] == false) {
continue;
}
if (j - v[i+1] >= 0) {
d[i+1][j-v[i+1]] = true;
}
if (j + v[i+1] <= m) {
d[i+1][j+v[i+1]] = true;
}
}
}
int ans = -1;
for (int i = 0; i <= m; i++) {
if (d[n][i]) ans = i;
}
System.out.println(ans);
}
}
//Another solution
//import java.util.*;
//public class Main {
// public static void main(String args[]) {
// Scanner sc = new Scanner(System.in);
// int n = sc.nextInt();
// int k = sc.nextInt();
// int[] w = new int[n+1];
// int[] v = new int[n+1];
// for (int i=1; i<=n; i++) {
// w[i] = sc.nextInt();
// v[i] = sc.nextInt();
// }
// int[] d = new int[k+1];
// for (int i=1; i<=n; i++) {
// for (int j=k; j>=1; j--) {
// if (j-w[i] >= 0) {
// d[j] = Math.max(d[j], d[j-w[i]]+v[i]);
// }
// }
// }
// System.out.println(d[k]);
// }
//}
| UTF-8 | Java | 1,712 | java | B1495.java | Java | [] | null | [] | import java.util.Scanner;
public class B1495 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(); //count
int s = sc.nextInt(); //first volume
int m = sc.nextInt(); //volume range
int[] v = new int[n+1];
for (int i = 1; i <= n; i++) {
v[i] = sc.nextInt();
}
boolean[][] d = new boolean[n+1][m+1];
d[0][s] = true;
for (int i = 0; i <= n-1; i++) {
for (int j = 0; j <= m; j++) {
if (d[i][j] == false) {
continue;
}
if (j - v[i+1] >= 0) {
d[i+1][j-v[i+1]] = true;
}
if (j + v[i+1] <= m) {
d[i+1][j+v[i+1]] = true;
}
}
}
int ans = -1;
for (int i = 0; i <= m; i++) {
if (d[n][i]) ans = i;
}
System.out.println(ans);
}
}
//Another solution
//import java.util.*;
//public class Main {
// public static void main(String args[]) {
// Scanner sc = new Scanner(System.in);
// int n = sc.nextInt();
// int k = sc.nextInt();
// int[] w = new int[n+1];
// int[] v = new int[n+1];
// for (int i=1; i<=n; i++) {
// w[i] = sc.nextInt();
// v[i] = sc.nextInt();
// }
// int[] d = new int[k+1];
// for (int i=1; i<=n; i++) {
// for (int j=k; j>=1; j--) {
// if (j-w[i] >= 0) {
// d[j] = Math.max(d[j], d[j-w[i]]+v[i]);
// }
// }
// }
// System.out.println(d[k]);
// }
//}
| 1,712 | 0.353388 | 0.337033 | 59 | 28.016949 | 14.158296 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.694915 | false | false | 3 |
1fd0095eeade4676a287c7f14d0692d8a3d2ad0d | 21,869,973,480,565 | e920a4595d7eed14e9487e60833e89720c80626b | /jackcloudserver/emsWebSite/src/main/java/com/itu/jetty/Controller.java | a45d958c5ad650b9ef57bb08c451e4ab0e232634 | [] | no_license | wentixiaogege/WebTest | https://github.com/wentixiaogege/WebTest | cb2869484b52d713f51aa87845763caae4c54e07 | 2c135b33ca6968e1929dd96cb418c91aecdd2a21 | refs/heads/master | 2021-01-23T06:40:10.113000 | 2015-04-16T18:20:47 | 2015-04-16T18:20:47 | 33,961,310 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.itu.jetty;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
* the class must be public class
*
* @author gqq
*
*/
@Path("/controller")
public class Controller {
public Controller() {
registAction(TestJettyMain.tc);
}
public interface IAciton {
void doAction(String param);
}
IAciton action;
public void registAction(IAciton action) {
this.action = action;
}
public void doControl(String param) {
if (action != null) {
action.doAction(param);
}
}
// private int num;
//
// public TestJettyAction3() {
// this.num = 1;
// }
@GET
@Path("add/{param}")
@Produces(MediaType.TEXT_PLAIN)
public String test(@PathParam("param") String param) {
// Controller c = new Controller();
// TestJettyAction.c.registAction(TestJettyAction.tc);
// TestJettyAction.c.doControl();
doControl(param);
return "" + "ok";
}
}
| UTF-8 | Java | 1,021 | java | Controller.java | Java | [
{
"context": " * the class must be public class\r\n * \r\n * @author gqq\r\n *\r\n */\r\n@Path(\"/controller\")\r\npublic class Cont",
"end": 235,
"score": 0.9995201230049133,
"start": 232,
"tag": "USERNAME",
"value": "gqq"
}
] | null | [] | package com.itu.jetty;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
* the class must be public class
*
* @author gqq
*
*/
@Path("/controller")
public class Controller {
public Controller() {
registAction(TestJettyMain.tc);
}
public interface IAciton {
void doAction(String param);
}
IAciton action;
public void registAction(IAciton action) {
this.action = action;
}
public void doControl(String param) {
if (action != null) {
action.doAction(param);
}
}
// private int num;
//
// public TestJettyAction3() {
// this.num = 1;
// }
@GET
@Path("add/{param}")
@Produces(MediaType.TEXT_PLAIN)
public String test(@PathParam("param") String param) {
// Controller c = new Controller();
// TestJettyAction.c.registAction(TestJettyAction.tc);
// TestJettyAction.c.doControl();
doControl(param);
return "" + "ok";
}
}
| 1,021 | 0.639569 | 0.63761 | 53 | 17.226416 | 15.140402 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.132075 | false | false | 3 |
4beae4126ed2fa8e9f3d6125447befd92b2c095c | 2,345,052,183,935 | 4f100c15ddbd9f71a85d754c51fa34b398dcd3ce | /ftdm-common/src/main/java/com/sunyard/sunfintech/core/base/BaseErrorData.java | c9f43f49f39b30b08150375918950b2d4cbd77ca | [
"Unlicense"
] | permissive | yiyanchuang/FTDM_CCB | https://github.com/yiyanchuang/FTDM_CCB | 60bb5f89c585304c6b52663ef3ef917e63dd86cd | 5fd6c5276722b9021f8b9806edf074bf59c89031 | refs/heads/master | 2023-03-20T14:03:11.302000 | 2019-03-28T06:16:14 | 2019-03-28T06:16:14 | 529,637,902 | 0 | 1 | Unlicense | true | 2023-04-17T03:31:58 | 2022-08-27T16:26:09 | 2019-04-22T10:11:31 | 2023-04-17T03:20:36 | 0 | 0 | 0 | 0 | null | false | false | package com.sunyard.sunfintech.core.base;
import java.io.Serializable;
/**
* 批量处理的错误返回
* Created by terry on 2017/5/3.
*/
public class BaseErrorData extends BaseSerialNoRequest {
/**
* 明细编号
*/
private String detail_no;
/**
* 错误码
*/
private String error_no;
/**
* 错误信息
*/
private String error_info;
public String getDetail_no() {
return detail_no;
}
public void setDetail_no(String detail_no) {
super.setBase_serial_order_no(detail_no);
this.detail_no = detail_no;
}
public String getError_no() {
return error_no;
}
public void setError_no(String error_no) {
this.error_no = error_no;
}
public String getError_info() {
return error_info;
}
public void setError_info(String error_info) {
this.error_info = error_info;
}
@Override
public String toString() {
return "BaseErrorData{" +
"detail_no='" + detail_no + '\'' +
", error_no='" + error_no + '\'' +
", error_info='" + error_info + '\'' +
'}';
}
}
| UTF-8 | Java | 1,197 | java | BaseErrorData.java | Java | [
{
"context": "a.io.Serializable;\n\n/**\n * 批量处理的错误返回\n * Created by terry on 2017/5/3.\n */\npublic class BaseErrorData exte",
"end": 109,
"score": 0.9738104343414307,
"start": 104,
"tag": "USERNAME",
"value": "terry"
}
] | null | [] | package com.sunyard.sunfintech.core.base;
import java.io.Serializable;
/**
* 批量处理的错误返回
* Created by terry on 2017/5/3.
*/
public class BaseErrorData extends BaseSerialNoRequest {
/**
* 明细编号
*/
private String detail_no;
/**
* 错误码
*/
private String error_no;
/**
* 错误信息
*/
private String error_info;
public String getDetail_no() {
return detail_no;
}
public void setDetail_no(String detail_no) {
super.setBase_serial_order_no(detail_no);
this.detail_no = detail_no;
}
public String getError_no() {
return error_no;
}
public void setError_no(String error_no) {
this.error_no = error_no;
}
public String getError_info() {
return error_info;
}
public void setError_info(String error_info) {
this.error_info = error_info;
}
@Override
public String toString() {
return "BaseErrorData{" +
"detail_no='" + detail_no + '\'' +
", error_no='" + error_no + '\'' +
", error_info='" + error_info + '\'' +
'}';
}
}
| 1,197 | 0.53414 | 0.528954 | 59 | 18.61017 | 17.768776 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.254237 | false | false | 3 |
09a6ee3fc43467f3a03a2eec246524671264490f | 21,586,505,639,144 | 69c478009cdd2b5b9f85bdd4f915466a57502e51 | /src/main/java/com/ir/queryexpansion/model/Document.java | 76dd815e3ef256d7d53acbbdf24d8ea506a9d95f | [] | no_license | jayakarthigayan/QueryExpansion | https://github.com/jayakarthigayan/QueryExpansion | 87c45593a5e8c07a0a7acbb0322a611215e11f49 | b2bcd2418da0b8a0d3a636784ecd5e088faffa9e | refs/heads/master | 2020-12-30T22:46:08.363000 | 2015-12-09T06:52:04 | 2015-12-09T06:52:04 | 47,560,509 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ir.queryexpansion.model;
public class Document implements Comparable<Document>{
private Integer docId;
private Integer docSize;
public Document() {
super();
this.docId = 0;
this.docSize = 0;
}
public Document(Integer docId, Integer docSize) {
super();
this.docId = docId;
this.docSize = docSize;
}
public Integer getDocId() {
return docId;
}
public void setDocId(Integer docId) {
this.docId = docId;
}
public Integer getDocSize() {
return docSize;
}
public void setDocSize(Integer docSize) {
this.docSize = docSize;
}
@Override
public String toString() {
return "Document [docId=" + docId + ", docSize=" + docSize + "]";
}
@Override
public int compareTo(Document o) {
return Integer.compare(this.getDocId(), o.getDocId());
}
}
| UTF-8 | Java | 789 | java | Document.java | Java | [] | null | [] | package com.ir.queryexpansion.model;
public class Document implements Comparable<Document>{
private Integer docId;
private Integer docSize;
public Document() {
super();
this.docId = 0;
this.docSize = 0;
}
public Document(Integer docId, Integer docSize) {
super();
this.docId = docId;
this.docSize = docSize;
}
public Integer getDocId() {
return docId;
}
public void setDocId(Integer docId) {
this.docId = docId;
}
public Integer getDocSize() {
return docSize;
}
public void setDocSize(Integer docSize) {
this.docSize = docSize;
}
@Override
public String toString() {
return "Document [docId=" + docId + ", docSize=" + docSize + "]";
}
@Override
public int compareTo(Document o) {
return Integer.compare(this.getDocId(), o.getDocId());
}
}
| 789 | 0.686945 | 0.684411 | 37 | 20.324324 | 17.466654 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.783784 | false | false | 3 |
3bb22885df24b6972c9ae92a6011993fa94a5856 | 19,396,072,320,474 | c687ef7c7a89928709e8475301680d68a902cb7f | /src/com/ietsmis/BeurtAddOns.java | 46102129db1f6c35a11161114d6b754162373dd1 | [] | no_license | woutervv/ietsmis | https://github.com/woutervv/ietsmis | cf1cc92b0e6c8cc65ae6c0cfcd73450964d008eb | ba776f44769e3850a344374c40a6ef072f8ab16c | refs/heads/master | 2020-07-24T00:17:51.351000 | 2019-09-11T06:40:30 | 2019-09-11T06:40:30 | 207,747,292 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ietsmis;
/**
* @author <a href="mailto:wouter.van.vliet@itris.nl">Wouter van Vliet</a>
* Created on 10-9-19.
*/
public enum BeurtAddOns {
SCHOONMAAK, BANDENWISSEL, KAARTUPDATE
}
| UTF-8 | Java | 195 | java | BeurtAddOns.java | Java | [
{
"context": "kage com.ietsmis;\n\n/**\n * @author <a href=\"mailto:wouter.van.vliet@itris.nl\">Wouter van Vliet</a>\n * Created on 10-9-19.\n */\n",
"end": 78,
"score": 0.9998613595962524,
"start": 53,
"tag": "EMAIL",
"value": "wouter.van.vliet@itris.nl"
},
{
"context": "author <a href=\"mailto:wouter.van.vliet@itris.nl\">Wouter van Vliet</a>\n * Created on 10-9-19.\n */\npublic enum BeurtA",
"end": 96,
"score": 0.9998703598976135,
"start": 80,
"tag": "NAME",
"value": "Wouter van Vliet"
}
] | null | [] | package com.ietsmis;
/**
* @author <a href="mailto:<EMAIL>"><NAME></a>
* Created on 10-9-19.
*/
public enum BeurtAddOns {
SCHOONMAAK, BANDENWISSEL, KAARTUPDATE
}
| 167 | 0.707692 | 0.682051 | 9 | 20.666666 | 22.617594 | 74 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false | 3 |
43cce19a7ee3e311fbebb4a4339d0f60c866d115 | 30,425,548,350,395 | b9b3e9cb821ca5e250ecb0b29ec07ee2be9ab932 | /src/it/polito/tdp/artsmia/model/Model.java | a6db39924b5e165b1752e157949d468ee64a82df | [] | no_license | LeoMaggio/2017-07-10 | https://github.com/LeoMaggio/2017-07-10 | b7d8f3e00f69983ab4bc0812e590ef2b7582070a | 789db040a8ccaa8f0430476bac9d2f57d98621ea | refs/heads/master | 2020-06-04T23:33:10.043000 | 2019-06-16T22:37:22 | 2019-06-16T22:37:22 | 192,233,697 | 0 | 0 | null | true | 2019-06-16T20:25:36 | 2019-06-16T20:25:35 | 2017-09-27T13:52:44 | 2018-06-22T10:43:17 | 6,171 | 0 | 0 | 0 | null | false | false | package it.polito.tdp.artsmia.model;
import java.util.*;
import org.jgrapht.Graphs;
import org.jgrapht.graph.DefaultWeightedEdge;
import org.jgrapht.graph.SimpleWeightedGraph;
import org.jgrapht.traverse.DepthFirstIterator;
import it.polito.tdp.artsmia.db.ArtsmiaDAO;
public class Model {
private ArtsmiaDAO dao;
private List<ArtObject> objectList;
private Map<Integer, ArtObject> objectMap;
private SimpleWeightedGraph<ArtObject, DefaultWeightedEdge> grafo;
private List<ArtObject> best;
public Model() {
this.dao = new ArtsmiaDAO();
this.objectMap = new HashMap<Integer, ArtObject>();
}
public List<ArtObject> getAllArtObjects(){
this.objectList = dao.listObjects();
for(ArtObject ao : this.objectList)
this.objectMap.put(ao.getId(), ao);
return this.objectList;
}
public void creaGrafo() {
this.grafo = new SimpleWeightedGraph<ArtObject, DefaultWeightedEdge>(DefaultWeightedEdge.class);
Graphs.addAllVertices(grafo, getAllArtObjects());
for(ArtObjectExhibition aoe : dao.getAllArtObjectExhibition(objectMap))
Graphs.addEdgeWithVertices(grafo, aoe.getA1(), aoe.getA2(), aoe.getCounter());
System.out.format("Grafo creato: %d archi, %d nodi\n", grafo.edgeSet().size(), grafo.vertexSet().size());
}
public boolean esisteOggetto(int id) {
if(objectMap.containsKey(id))
return true;
return false;
}
public int componenteConnessa(int id) {
Set<ArtObject> visitati = new HashSet<ArtObject>();
DepthFirstIterator<ArtObject, DefaultWeightedEdge> dfi = new DepthFirstIterator<>(grafo, objectMap.get(id));
while(dfi.hasNext())
visitati.add(dfi.next());
return visitati.size();
}
public int getPesoTotale() {
return peso(best);
}
public List<ArtObject> getCamminoDiPesoMassimo(Integer lun, int id) {
ArtObject start = objectMap.get(id);
List<ArtObject> parziale = new ArrayList<>();
parziale.add(start);
this.best = new ArrayList<>();
this.best.add(start);
cerca(parziale, 1, lun);
return best;
}
private void cerca(List<ArtObject> parziale, int livello, Integer lun) {
// caso terminale
if(livello == lun) {
if(peso(parziale) > peso(best))
best = new ArrayList<>(parziale);
}
ArtObject ultimo = parziale.get(parziale.size() - 1);
List<ArtObject> adiacenti = Graphs.neighborListOf(this.grafo, ultimo);
for (ArtObject prova : adiacenti) {
if (!parziale.contains(prova) && prova.getClassification() != null
&& prova.getClassification().equals(parziale.get(0).getClassification())) {
parziale.add(prova);
cerca(parziale, livello + 1, lun);
parziale.remove(parziale.size() - 1);
}
}
}
private int peso(List<ArtObject> list) {
int peso = 0;
for (int i = 0; i < list.size() - 1; i++) {
DefaultWeightedEdge e = grafo.getEdge(list.get(i), list.get(i + 1));
int pesoarco = (int) grafo.getEdgeWeight(e);
peso += pesoarco;
}
return peso;
}
}
| UTF-8 | Java | 2,989 | java | Model.java | Java | [] | null | [] | package it.polito.tdp.artsmia.model;
import java.util.*;
import org.jgrapht.Graphs;
import org.jgrapht.graph.DefaultWeightedEdge;
import org.jgrapht.graph.SimpleWeightedGraph;
import org.jgrapht.traverse.DepthFirstIterator;
import it.polito.tdp.artsmia.db.ArtsmiaDAO;
public class Model {
private ArtsmiaDAO dao;
private List<ArtObject> objectList;
private Map<Integer, ArtObject> objectMap;
private SimpleWeightedGraph<ArtObject, DefaultWeightedEdge> grafo;
private List<ArtObject> best;
public Model() {
this.dao = new ArtsmiaDAO();
this.objectMap = new HashMap<Integer, ArtObject>();
}
public List<ArtObject> getAllArtObjects(){
this.objectList = dao.listObjects();
for(ArtObject ao : this.objectList)
this.objectMap.put(ao.getId(), ao);
return this.objectList;
}
public void creaGrafo() {
this.grafo = new SimpleWeightedGraph<ArtObject, DefaultWeightedEdge>(DefaultWeightedEdge.class);
Graphs.addAllVertices(grafo, getAllArtObjects());
for(ArtObjectExhibition aoe : dao.getAllArtObjectExhibition(objectMap))
Graphs.addEdgeWithVertices(grafo, aoe.getA1(), aoe.getA2(), aoe.getCounter());
System.out.format("Grafo creato: %d archi, %d nodi\n", grafo.edgeSet().size(), grafo.vertexSet().size());
}
public boolean esisteOggetto(int id) {
if(objectMap.containsKey(id))
return true;
return false;
}
public int componenteConnessa(int id) {
Set<ArtObject> visitati = new HashSet<ArtObject>();
DepthFirstIterator<ArtObject, DefaultWeightedEdge> dfi = new DepthFirstIterator<>(grafo, objectMap.get(id));
while(dfi.hasNext())
visitati.add(dfi.next());
return visitati.size();
}
public int getPesoTotale() {
return peso(best);
}
public List<ArtObject> getCamminoDiPesoMassimo(Integer lun, int id) {
ArtObject start = objectMap.get(id);
List<ArtObject> parziale = new ArrayList<>();
parziale.add(start);
this.best = new ArrayList<>();
this.best.add(start);
cerca(parziale, 1, lun);
return best;
}
private void cerca(List<ArtObject> parziale, int livello, Integer lun) {
// caso terminale
if(livello == lun) {
if(peso(parziale) > peso(best))
best = new ArrayList<>(parziale);
}
ArtObject ultimo = parziale.get(parziale.size() - 1);
List<ArtObject> adiacenti = Graphs.neighborListOf(this.grafo, ultimo);
for (ArtObject prova : adiacenti) {
if (!parziale.contains(prova) && prova.getClassification() != null
&& prova.getClassification().equals(parziale.get(0).getClassification())) {
parziale.add(prova);
cerca(parziale, livello + 1, lun);
parziale.remove(parziale.size() - 1);
}
}
}
private int peso(List<ArtObject> list) {
int peso = 0;
for (int i = 0; i < list.size() - 1; i++) {
DefaultWeightedEdge e = grafo.getEdge(list.get(i), list.get(i + 1));
int pesoarco = (int) grafo.getEdgeWeight(e);
peso += pesoarco;
}
return peso;
}
}
| 2,989 | 0.687521 | 0.683841 | 99 | 28.191919 | 26.065449 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.232323 | false | false | 3 |
d90bdf3bcee39821029e5debe8ef39de390d65d7 | 1,185,411,029,015 | 2cb1324a7574925bb1668caeb545d8cfb4cce5c2 | /Elmenu/src/main/java/com/anacodist/elmenu/AboutRestUI.java | ed5399f8d5194b7a34795059a2325014c8001b13 | [] | no_license | a7madev/Elmenu | https://github.com/a7madev/Elmenu | 53224e994d9ab303ebd7a06de182cbbede680a13 | ab2bd9c0b05695218d4fb370b19015cf33e45c64 | refs/heads/master | 2016-09-25T05:46:09.325000 | 2013-07-12T20:57:56 | 2013-07-12T20:57:56 | 113,033,974 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.anacodist.elmenu;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
public class AboutRestUI extends Activity implements View.OnClickListener {
private static final String TAG = AboutRestUI.class.getSimpleName();
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// set layout
setContentView(R.layout.aboutrest_ui);
// create font type face
Typeface typeFaceFont = Typeface.createFromAsset(getAssets(), "fonts/Roboto-Light.ttf");
// set font
TextView restDescriptionTextView = (TextView) findViewById(R.id.aboutrestui_textview_restdescr);
restDescriptionTextView.setTypeface(typeFaceFont);
// initialize icons click listeners
findViewById(R.id.aboutrestui_imageview_website).setOnClickListener(this);
findViewById(R.id.aboutrestui_imageview_email).setOnClickListener(this);
findViewById(R.id.aboutrestui_imageview_facebook).setOnClickListener(this);
findViewById(R.id.aboutrestui_imageview_twitter).setOnClickListener(this);
findViewById(R.id.aboutrestui_imageview_youtube).setOnClickListener(this);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.aboutrestui_imageview_website:
openIntent("website");
break;
case R.id.aboutrestui_imageview_email:
openIntent("email");
break;
case R.id.aboutrestui_imageview_facebook:
openIntent("facebook");
break;
case R.id.aboutrestui_imageview_twitter:
openIntent("twitter");
break;
case R.id.aboutrestui_imageview_youtube:
openIntent("youtube");
break;
}
}
private void openIntent(String intentType) {
if(intentType.equalsIgnoreCase("website")){
try {
Intent websiteIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://anacodist.com")); //TODO change website URL
startActivity(websiteIntent);
} catch (Exception e) {
showToast("I'm not able to launch the browser!");
}
}else if(intentType.equalsIgnoreCase("email")){
Intent emailIntent = new Intent(this, AboutUI.class); //TODO change to Feedback UI
emailIntent.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
startActivity(emailIntent);
}else if(intentType.equalsIgnoreCase("facebook")){
Intent facebookIntent;
try{
facebookIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/AnaCodist")); //TODO change FB URL
startActivity(facebookIntent);
}catch(Exception e){
facebookIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com/AnaCodist")); //TODO change FB URL
startActivity(facebookIntent);
}
}else if(intentType.equalsIgnoreCase("twitter")){
Intent twitterIntent;
try {
twitterIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?screen_name=AnaCodist")); //TODO change Twitter URL
startActivity(twitterIntent);
}catch (Exception e) {
twitterIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/#!/AnaCodist")); //TODO change Twitter URL
startActivity(twitterIntent);
}
}else if(intentType.equalsIgnoreCase("youtube")){
try{
Intent youtubeIntent = new Intent(Intent.ACTION_VIEW);
youtubeIntent.setData(Uri.parse("http://www.youtube.com/user/AnaCodist"));
startActivity(youtubeIntent);
}catch(Exception e){
showToast("I'm not able to launch YouTube!");
}
}
}
private void showToast(String msg) {
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
} | UTF-8 | Java | 4,269 | java | AboutRestUI.java | Java | [
{
"context": "ntent(Intent.ACTION_VIEW, Uri.parse(\"fb://profile/AnaCodist\")); //TODO change FB URL\n startAct",
"end": 2920,
"score": 0.9916293025016785,
"start": 2911,
"tag": "USERNAME",
"value": "AnaCodist"
},
{
"context": "t.ACTION_VIEW, Uri.parse(\"http://www.facebook.com/AnaCodist\")); //TODO change FB URL\n startAct",
"end": 3134,
"score": 0.9995104670524597,
"start": 3125,
"tag": "USERNAME",
"value": "AnaCodist"
},
{
"context": "CTION_VIEW, Uri.parse(\"twitter://user?screen_name=AnaCodist\")); //TODO change Twitter URL\n sta",
"end": 3441,
"score": 0.9995768070220947,
"start": 3432,
"tag": "USERNAME",
"value": "AnaCodist"
},
{
"context": "nt.ACTION_VIEW, Uri.parse(\"https://twitter.com/#!/AnaCodist\")); //TODO change Twitter URL\n sta",
"end": 3659,
"score": 0.9994944334030151,
"start": 3650,
"tag": "USERNAME",
"value": "AnaCodist"
},
{
"context": "nt.setData(Uri.parse(\"http://www.youtube.com/user/AnaCodist\"));\n startActivity(youtubeIntent);",
"end": 3982,
"score": 0.9995968341827393,
"start": 3973,
"tag": "USERNAME",
"value": "AnaCodist"
}
] | null | [] | package com.anacodist.elmenu;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
public class AboutRestUI extends Activity implements View.OnClickListener {
private static final String TAG = AboutRestUI.class.getSimpleName();
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// set layout
setContentView(R.layout.aboutrest_ui);
// create font type face
Typeface typeFaceFont = Typeface.createFromAsset(getAssets(), "fonts/Roboto-Light.ttf");
// set font
TextView restDescriptionTextView = (TextView) findViewById(R.id.aboutrestui_textview_restdescr);
restDescriptionTextView.setTypeface(typeFaceFont);
// initialize icons click listeners
findViewById(R.id.aboutrestui_imageview_website).setOnClickListener(this);
findViewById(R.id.aboutrestui_imageview_email).setOnClickListener(this);
findViewById(R.id.aboutrestui_imageview_facebook).setOnClickListener(this);
findViewById(R.id.aboutrestui_imageview_twitter).setOnClickListener(this);
findViewById(R.id.aboutrestui_imageview_youtube).setOnClickListener(this);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.aboutrestui_imageview_website:
openIntent("website");
break;
case R.id.aboutrestui_imageview_email:
openIntent("email");
break;
case R.id.aboutrestui_imageview_facebook:
openIntent("facebook");
break;
case R.id.aboutrestui_imageview_twitter:
openIntent("twitter");
break;
case R.id.aboutrestui_imageview_youtube:
openIntent("youtube");
break;
}
}
private void openIntent(String intentType) {
if(intentType.equalsIgnoreCase("website")){
try {
Intent websiteIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://anacodist.com")); //TODO change website URL
startActivity(websiteIntent);
} catch (Exception e) {
showToast("I'm not able to launch the browser!");
}
}else if(intentType.equalsIgnoreCase("email")){
Intent emailIntent = new Intent(this, AboutUI.class); //TODO change to Feedback UI
emailIntent.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
startActivity(emailIntent);
}else if(intentType.equalsIgnoreCase("facebook")){
Intent facebookIntent;
try{
facebookIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/AnaCodist")); //TODO change FB URL
startActivity(facebookIntent);
}catch(Exception e){
facebookIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com/AnaCodist")); //TODO change FB URL
startActivity(facebookIntent);
}
}else if(intentType.equalsIgnoreCase("twitter")){
Intent twitterIntent;
try {
twitterIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?screen_name=AnaCodist")); //TODO change Twitter URL
startActivity(twitterIntent);
}catch (Exception e) {
twitterIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/#!/AnaCodist")); //TODO change Twitter URL
startActivity(twitterIntent);
}
}else if(intentType.equalsIgnoreCase("youtube")){
try{
Intent youtubeIntent = new Intent(Intent.ACTION_VIEW);
youtubeIntent.setData(Uri.parse("http://www.youtube.com/user/AnaCodist"));
startActivity(youtubeIntent);
}catch(Exception e){
showToast("I'm not able to launch YouTube!");
}
}
}
private void showToast(String msg) {
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
} | 4,269 | 0.624502 | 0.624502 | 103 | 40.45631 | 32.698914 | 140 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.582524 | false | false | 3 |
b5a09363cd841af3e85ee07d7ff93412d67801f8 | 29,274,497,112,009 | 957428c8dc339c9e10e71a984eefa363b5b6e99a | /app/src/main/java/com/example/chevron_stationfinder/fragments/StationListFragment.java | 78994cd01de362eb16769ebd50dd97b8babd169f | [] | no_license | a-kapahi/chevronStationFinder | https://github.com/a-kapahi/chevronStationFinder | 336834c3b4d3df2a441001481df3fb8479876322 | 83102c358bfb6cac1925d8a7cd9a5ecd3f6f18af | refs/heads/master | 2020-04-08T20:48:26.907000 | 2019-01-23T01:43:26 | 2019-01-23T01:43:26 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.chevron_stationfinder.fragments;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.LinearSmoothScroller;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.example.chevron_stationfinder.R;
import com.example.chevron_stationfinder.adapters.MystationRecyclerViewAdapter;
import com.example.chevron_stationfinder.interfaces.OnFragmentInteractionListener;
import com.example.chevron_stationfinder.interfaces.OnStationListReady;
import com.example.chevron_stationfinder.models.Station;
import java.util.ArrayList;
/**
* A fragment representing a list of Items.
* <p/>
* Activities containing this fragment MUST implement the {@link OnListFragmentInteractionListener}
* interface.
*/
public class StationListFragment extends Fragment implements View.OnClickListener, OnStationListReady {
private ArrayList<Station> stations;
private OnListFragmentInteractionListener mListListener;
private OnFragmentInteractionListener mListener;
private String address;
private MystationRecyclerViewAdapter recyclerViewAdapter;
private TextView stationCount;
private RecyclerView recyclerView;
private ProgressBar simpleProgressBar;
private boolean isLoading = true;
private TextView addressText;
private TextView emptyText;
private Context mContext;
/**
* Mandatory empty constructor for the fragment manager to instantiate the
* fragment (e.g. upon screen orientation changes).
*/
public StationListFragment() {
}
public static StationListFragment newInstance(ArrayList<Station> stations, String address) {
StationListFragment fragment = new StationListFragment();
Bundle args = new Bundle();
args.putParcelableArrayList("stations", stations);
args.putString("Address", address);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
this.stations = getArguments().getParcelableArrayList("stations");
address = getArguments().getString("Address");
}
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_station_list, container, false);
Context context = view.getContext();
addressText = view.findViewById(R.id.address);
recyclerView = view.findViewById(R.id.list);
simpleProgressBar = view.findViewById(R.id.progressBar);
emptyText = view.findViewById(R.id.emptyText);
if(isLoading) {
recyclerView.setVisibility(View.INVISIBLE);
emptyText.setVisibility(View.GONE);
simpleProgressBar.setVisibility(View.VISIBLE);
} else {
simpleProgressBar.setVisibility(View.GONE);
checkEmptyList();
}
if(address==null){
recyclerView.setVisibility(View.INVISIBLE);
emptyText.setVisibility(View.VISIBLE);
emptyText.setText("Location services aren't enabled on this device");
simpleProgressBar.setVisibility(View.GONE);
} else addressText.setText(this.address);
final LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(layoutManager);
recyclerViewAdapter = new MystationRecyclerViewAdapter(stations, mListListener);
recyclerView.setAdapter(recyclerViewAdapter);
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if(newState==RecyclerView.SCROLL_STATE_IDLE) {
mListListener.onListFragmentInteraction(stations.get(layoutManager.findFirstVisibleItemPosition()),3);
}
}
});
stationCount = view.findViewById(R.id.stationCount);
Button optionsButton = view.findViewById(R.id.optionsBtn);
optionsButton.setOnClickListener(this);
stationCount.setText(String.valueOf(stations.size()));
return view;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnListFragmentInteractionListener) {
mListListener = (OnListFragmentInteractionListener) context;
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnListFragmentInteractionListener");
}
mContext = context;
}
@Override
public void onDetach() {
super.onDetach();
mListListener = null;
mListener = null;
}
@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.optionsBtn:{
mListener.onFragmentInteraction("ListFragment", view);
}
}
}
@Override
public void onListReady(ArrayList<Station> filteredStations) {
stations.clear();
stations.addAll(filteredStations);
recyclerViewAdapter.notifyDataSetChanged();
stationCount.setText(String.valueOf(stations.size()));
simpleProgressBar.setVisibility(View.GONE);
checkEmptyList();
isLoading = false;
}
@Override
public void changeAddressText(String address) {
this.address = address;
addressText.setText(this.address);
}
@Override
public void scrollToStation(Station station) {
RecyclerView.SmoothScroller smoothScroller = new
LinearSmoothScroller(mContext) {
@Override
protected int getVerticalSnapPreference() {
return LinearSmoothScroller.SNAP_TO_START;
}
};
smoothScroller.setTargetPosition(stations.indexOf(station));
recyclerView.getLayoutManager().startSmoothScroll(smoothScroller);
}
private void checkEmptyList() {
if (stations.isEmpty()) {
recyclerView.setVisibility(View.INVISIBLE);
emptyText.setText(R.string.empty_list_text);
emptyText.setVisibility(View.VISIBLE);
} else {
recyclerView.setVisibility(View.VISIBLE);
emptyText.setVisibility(View.INVISIBLE);
}
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p/>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnListFragmentInteractionListener {
void onListFragmentInteraction(Station station, int flag);
}
}
| UTF-8 | Java | 7,663 | java | StationListFragment.java | Java | [] | null | [] | package com.example.chevron_stationfinder.fragments;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.LinearSmoothScroller;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.example.chevron_stationfinder.R;
import com.example.chevron_stationfinder.adapters.MystationRecyclerViewAdapter;
import com.example.chevron_stationfinder.interfaces.OnFragmentInteractionListener;
import com.example.chevron_stationfinder.interfaces.OnStationListReady;
import com.example.chevron_stationfinder.models.Station;
import java.util.ArrayList;
/**
* A fragment representing a list of Items.
* <p/>
* Activities containing this fragment MUST implement the {@link OnListFragmentInteractionListener}
* interface.
*/
public class StationListFragment extends Fragment implements View.OnClickListener, OnStationListReady {
private ArrayList<Station> stations;
private OnListFragmentInteractionListener mListListener;
private OnFragmentInteractionListener mListener;
private String address;
private MystationRecyclerViewAdapter recyclerViewAdapter;
private TextView stationCount;
private RecyclerView recyclerView;
private ProgressBar simpleProgressBar;
private boolean isLoading = true;
private TextView addressText;
private TextView emptyText;
private Context mContext;
/**
* Mandatory empty constructor for the fragment manager to instantiate the
* fragment (e.g. upon screen orientation changes).
*/
public StationListFragment() {
}
public static StationListFragment newInstance(ArrayList<Station> stations, String address) {
StationListFragment fragment = new StationListFragment();
Bundle args = new Bundle();
args.putParcelableArrayList("stations", stations);
args.putString("Address", address);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
this.stations = getArguments().getParcelableArrayList("stations");
address = getArguments().getString("Address");
}
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_station_list, container, false);
Context context = view.getContext();
addressText = view.findViewById(R.id.address);
recyclerView = view.findViewById(R.id.list);
simpleProgressBar = view.findViewById(R.id.progressBar);
emptyText = view.findViewById(R.id.emptyText);
if(isLoading) {
recyclerView.setVisibility(View.INVISIBLE);
emptyText.setVisibility(View.GONE);
simpleProgressBar.setVisibility(View.VISIBLE);
} else {
simpleProgressBar.setVisibility(View.GONE);
checkEmptyList();
}
if(address==null){
recyclerView.setVisibility(View.INVISIBLE);
emptyText.setVisibility(View.VISIBLE);
emptyText.setText("Location services aren't enabled on this device");
simpleProgressBar.setVisibility(View.GONE);
} else addressText.setText(this.address);
final LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(layoutManager);
recyclerViewAdapter = new MystationRecyclerViewAdapter(stations, mListListener);
recyclerView.setAdapter(recyclerViewAdapter);
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if(newState==RecyclerView.SCROLL_STATE_IDLE) {
mListListener.onListFragmentInteraction(stations.get(layoutManager.findFirstVisibleItemPosition()),3);
}
}
});
stationCount = view.findViewById(R.id.stationCount);
Button optionsButton = view.findViewById(R.id.optionsBtn);
optionsButton.setOnClickListener(this);
stationCount.setText(String.valueOf(stations.size()));
return view;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnListFragmentInteractionListener) {
mListListener = (OnListFragmentInteractionListener) context;
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnListFragmentInteractionListener");
}
mContext = context;
}
@Override
public void onDetach() {
super.onDetach();
mListListener = null;
mListener = null;
}
@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.optionsBtn:{
mListener.onFragmentInteraction("ListFragment", view);
}
}
}
@Override
public void onListReady(ArrayList<Station> filteredStations) {
stations.clear();
stations.addAll(filteredStations);
recyclerViewAdapter.notifyDataSetChanged();
stationCount.setText(String.valueOf(stations.size()));
simpleProgressBar.setVisibility(View.GONE);
checkEmptyList();
isLoading = false;
}
@Override
public void changeAddressText(String address) {
this.address = address;
addressText.setText(this.address);
}
@Override
public void scrollToStation(Station station) {
RecyclerView.SmoothScroller smoothScroller = new
LinearSmoothScroller(mContext) {
@Override
protected int getVerticalSnapPreference() {
return LinearSmoothScroller.SNAP_TO_START;
}
};
smoothScroller.setTargetPosition(stations.indexOf(station));
recyclerView.getLayoutManager().startSmoothScroll(smoothScroller);
}
private void checkEmptyList() {
if (stations.isEmpty()) {
recyclerView.setVisibility(View.INVISIBLE);
emptyText.setText(R.string.empty_list_text);
emptyText.setVisibility(View.VISIBLE);
} else {
recyclerView.setVisibility(View.VISIBLE);
emptyText.setVisibility(View.INVISIBLE);
}
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p/>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnListFragmentInteractionListener {
void onListFragmentInteraction(Station station, int flag);
}
}
| 7,663 | 0.684197 | 0.683544 | 199 | 37.507538 | 27.248322 | 123 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.567839 | false | false | 3 |
f5faf4b73cb250b7bc895e19889c3a9529f712ea | 12,695,923,353,427 | 0c8878c8fc0cdc0c6e7273cd5c51a4fceb6f52b4 | /src/de/ungejumptlp/furnacegame/listener/PlayerJoinEvent_Listener.java | 5b0f95db174def03f02a90ca4762586ca95c1f45 | [] | no_license | nicogramm/TheFurnaceGame | https://github.com/nicogramm/TheFurnaceGame | 2254a0eae070d2d59680ae1a11688cc9a4ea1fc6 | a20a76e03998d8bc9b864af1c44fd5317a000741 | refs/heads/master | 2016-04-22T01:17:45.229000 | 2015-06-08T18:02:40 | 2015-06-08T18:02:40 | 36,979,895 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package de.ungejumptlp.furnacegame.listener;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import de.ungejumptlp.furnacegame.enums.GameState;
import de.ungejumptlp.furnacegame.system.Main;
public class PlayerJoinEvent_Listener implements Listener {
private int task1 = 0;
@EventHandler
public void preparePlayersAndTeleportToLobby(PlayerJoinEvent e) {
Player p = e.getPlayer();
Main.getInstance().getUtils().getUtilsScoreboard().setScoreboardToPlayer(p);
p.setCustomName(p.getName());
Main.getInstance().getUtils().getUtilsTitle().sendWelcomeAndTabTitle(p);
if(Main.getInstance().getUtils().getUtilsGamestate().getCurrentState() == GameState.LOBBY) {
if(Main.getInstance().getUtils().getUtilsLocation().getLobbyLocation() == null) {
p.sendMessage(Main.getInstance().getUtils().getPrefix() + "§4Es ist kein Lobby-Spawnpunkt gesetzt!");
return;
}
if(Main.getInstance().getUtils().getUtilsLocation().getArenaWorldName() == null) {
p.sendMessage(Main.getInstance().getUtils().getPrefix() + "§4Die Arena-Spawnpunkte sind nicht gesetzt!");
return;
}
if(Bukkit.getServer().getOnlinePlayers().size() == 1) {
startSchedulersAndCountdown();
}
Main.getInstance().getUtils().getUtilsPlayer().preparePlayerLobby(p);
p.teleport(Main.getInstance().getUtils().getUtilsLocation().getLobbyLocation());
}
if(Main.getInstance().getUtils().getUtilsGamestate().getCurrentState() == GameState.INGAME) {
if(Main.getInstance().getUtils().getUtilsLocation().getSpactatorSpawn() == null) {
p.sendMessage(Main.getInstance().getUtils().getPrefix() + "§4Der Spectator-Spawn ist noch nicht gesetzt!");
} else {
Main.getInstance().getUtils().getUtilsPlayer().prepareSpactator(p);
p.teleport(Main.getInstance().getUtils().getUtilsLocation().getSpactatorSpawn());
}
}
}
private void startSchedulersAndCountdown() {
task1 = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getInstance(), new Runnable() {
@Override
public void run() {
if(Bukkit.getServer().getOnlinePlayers().size() >= 2) {
Bukkit.getScheduler().cancelTask(task1);
Main.getInstance().getUtils().getUtilsCountdown().startCountdown();
} else {
for(Player player : Bukkit.getOnlinePlayers()) {
player.sendMessage(Main.getInstance().getUtils().getPrefix() + "§bEs wird noch auf weitere Spieler gewartet...");
}
}
}
}, 0, 20*25);
}
}
| UTF-8 | Java | 2,555 | java | PlayerJoinEvent_Listener.java | Java | [] | null | [] | package de.ungejumptlp.furnacegame.listener;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import de.ungejumptlp.furnacegame.enums.GameState;
import de.ungejumptlp.furnacegame.system.Main;
public class PlayerJoinEvent_Listener implements Listener {
private int task1 = 0;
@EventHandler
public void preparePlayersAndTeleportToLobby(PlayerJoinEvent e) {
Player p = e.getPlayer();
Main.getInstance().getUtils().getUtilsScoreboard().setScoreboardToPlayer(p);
p.setCustomName(p.getName());
Main.getInstance().getUtils().getUtilsTitle().sendWelcomeAndTabTitle(p);
if(Main.getInstance().getUtils().getUtilsGamestate().getCurrentState() == GameState.LOBBY) {
if(Main.getInstance().getUtils().getUtilsLocation().getLobbyLocation() == null) {
p.sendMessage(Main.getInstance().getUtils().getPrefix() + "§4Es ist kein Lobby-Spawnpunkt gesetzt!");
return;
}
if(Main.getInstance().getUtils().getUtilsLocation().getArenaWorldName() == null) {
p.sendMessage(Main.getInstance().getUtils().getPrefix() + "§4Die Arena-Spawnpunkte sind nicht gesetzt!");
return;
}
if(Bukkit.getServer().getOnlinePlayers().size() == 1) {
startSchedulersAndCountdown();
}
Main.getInstance().getUtils().getUtilsPlayer().preparePlayerLobby(p);
p.teleport(Main.getInstance().getUtils().getUtilsLocation().getLobbyLocation());
}
if(Main.getInstance().getUtils().getUtilsGamestate().getCurrentState() == GameState.INGAME) {
if(Main.getInstance().getUtils().getUtilsLocation().getSpactatorSpawn() == null) {
p.sendMessage(Main.getInstance().getUtils().getPrefix() + "§4Der Spectator-Spawn ist noch nicht gesetzt!");
} else {
Main.getInstance().getUtils().getUtilsPlayer().prepareSpactator(p);
p.teleport(Main.getInstance().getUtils().getUtilsLocation().getSpactatorSpawn());
}
}
}
private void startSchedulersAndCountdown() {
task1 = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getInstance(), new Runnable() {
@Override
public void run() {
if(Bukkit.getServer().getOnlinePlayers().size() >= 2) {
Bukkit.getScheduler().cancelTask(task1);
Main.getInstance().getUtils().getUtilsCountdown().startCountdown();
} else {
for(Player player : Bukkit.getOnlinePlayers()) {
player.sendMessage(Main.getInstance().getUtils().getPrefix() + "§bEs wird noch auf weitere Spieler gewartet...");
}
}
}
}, 0, 20*25);
}
}
| 2,555 | 0.723246 | 0.717758 | 67 | 37.074627 | 35.857227 | 119 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.567164 | false | false | 3 |
a04be58e90a08d33e952549f58768391b4f3d3dc | 1,881,195,701,928 | cf3fd1e9195186351153c22637c38398353f5587 | /JavaSource/com/e104/dc/model/center/FeedBack.java | cf8fe1294b825bdc7a7ada0a0331676310960b3f | [] | no_license | titusjin/hello | https://github.com/titusjin/hello | 8bef2e3bec126850311109dfc8d17d0069ff1934 | 0d745c676ba24bbb9320c1ed4d9c3648fb11ee60 | refs/heads/master | 2016-05-29T04:16:55.151000 | 2015-07-31T09:54:15 | 2015-07-31T09:54:15 | 39,998,829 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.e104.dc.model.center;
import java.util.Date;
import com.e104.dc.commons.utils.CryptUtil;
public class FeedBack {
private long deliveryId;
private String name;
private String email;
private String tel;
private String address;
private String memberId;
private String sponsorDesc;
private String rewardDesc;
private Date createDate;
private Date shipDate;
private String jobCategoryId;
private String alias;
private String jobName;
private String i18nKey;
private String cellphone;
private long sponsorRewardId;
private long helperContractId;
private float sponsorLevel;
private String postcode;
public void decode() throws Exception {
this.name = CryptUtil.decrypt(this.name);
this.tel = CryptUtil.decrypt(this.tel);
this.cellphone = CryptUtil.decrypt(this.cellphone);
this.email = CryptUtil.decrypt(this.email);
this.address = CryptUtil.decrypt(this.address);
}
public long getDeliveryId() {
return deliveryId;
}
public void setDeliveryId(long deliveryId) {
this.deliveryId = deliveryId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getSponsorDesc() {
return sponsorDesc;
}
public void setSponsorDesc(String sponsorDesc) {
this.sponsorDesc = sponsorDesc;
}
public String getRewardDesc() {
return rewardDesc;
}
public void setRewardDesc(String rewardDesc) {
this.rewardDesc = rewardDesc;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getShipDate() {
return shipDate;
}
public void setShipDate(Date shipDate) {
this.shipDate = shipDate;
}
public String getJobCategoryId() {
return jobCategoryId;
}
public void setJobCategoryId(String jobCategoryId) {
this.jobCategoryId = jobCategoryId;
}
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public String getJobName() {
return jobName;
}
public void setJobName(String jobName) {
this.jobName = jobName;
}
public String getCellphone() {
return cellphone;
}
public void setCellphone(String cellphone) {
this.cellphone = cellphone;
}
public long getSponsorRewardId() {
return sponsorRewardId;
}
public void setSponsorRewardId(long sponsorRewardId) {
this.sponsorRewardId = sponsorRewardId;
}
public String getI18nKey() {
return i18nKey;
}
public void setI18nKey(String i18nKey) {
this.i18nKey = i18nKey;
}
public float getSponsorLevel() {
return sponsorLevel;
}
public void setSponsorLevel(float sponsorLevel) {
this.sponsorLevel = sponsorLevel;
}
public String getPostcode() {
return postcode;
}
public void setPostcode(String postcode) {
this.postcode = postcode;
}
public long getHelperContractId() {
return helperContractId;
}
public void setHelperContractId(long helperContractId) {
this.helperContractId = helperContractId;
}
}
| UTF-8 | Java | 3,425 | java | FeedBack.java | Java | [] | null | [] | package com.e104.dc.model.center;
import java.util.Date;
import com.e104.dc.commons.utils.CryptUtil;
public class FeedBack {
private long deliveryId;
private String name;
private String email;
private String tel;
private String address;
private String memberId;
private String sponsorDesc;
private String rewardDesc;
private Date createDate;
private Date shipDate;
private String jobCategoryId;
private String alias;
private String jobName;
private String i18nKey;
private String cellphone;
private long sponsorRewardId;
private long helperContractId;
private float sponsorLevel;
private String postcode;
public void decode() throws Exception {
this.name = CryptUtil.decrypt(this.name);
this.tel = CryptUtil.decrypt(this.tel);
this.cellphone = CryptUtil.decrypt(this.cellphone);
this.email = CryptUtil.decrypt(this.email);
this.address = CryptUtil.decrypt(this.address);
}
public long getDeliveryId() {
return deliveryId;
}
public void setDeliveryId(long deliveryId) {
this.deliveryId = deliveryId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getSponsorDesc() {
return sponsorDesc;
}
public void setSponsorDesc(String sponsorDesc) {
this.sponsorDesc = sponsorDesc;
}
public String getRewardDesc() {
return rewardDesc;
}
public void setRewardDesc(String rewardDesc) {
this.rewardDesc = rewardDesc;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getShipDate() {
return shipDate;
}
public void setShipDate(Date shipDate) {
this.shipDate = shipDate;
}
public String getJobCategoryId() {
return jobCategoryId;
}
public void setJobCategoryId(String jobCategoryId) {
this.jobCategoryId = jobCategoryId;
}
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public String getJobName() {
return jobName;
}
public void setJobName(String jobName) {
this.jobName = jobName;
}
public String getCellphone() {
return cellphone;
}
public void setCellphone(String cellphone) {
this.cellphone = cellphone;
}
public long getSponsorRewardId() {
return sponsorRewardId;
}
public void setSponsorRewardId(long sponsorRewardId) {
this.sponsorRewardId = sponsorRewardId;
}
public String getI18nKey() {
return i18nKey;
}
public void setI18nKey(String i18nKey) {
this.i18nKey = i18nKey;
}
public float getSponsorLevel() {
return sponsorLevel;
}
public void setSponsorLevel(float sponsorLevel) {
this.sponsorLevel = sponsorLevel;
}
public String getPostcode() {
return postcode;
}
public void setPostcode(String postcode) {
this.postcode = postcode;
}
public long getHelperContractId() {
return helperContractId;
}
public void setHelperContractId(long helperContractId) {
this.helperContractId = helperContractId;
}
}
| 3,425 | 0.739562 | 0.733723 | 154 | 21.240259 | 15.732775 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.636364 | false | false | 3 |
4a62f867712f387af44fc37e7120799ada2acc3e | 20,633,022,938,820 | 3f94d8cf0c8768aaa9c7b3b4752eb0939167ee69 | /patientApplication/DesktopUserApplication/src/EnterSymptomsPanel.java | 3b7398c317de22e594beda433914e91df9b2d460 | [] | no_license | nghillaz/palliative-care-system | https://github.com/nghillaz/palliative-care-system | 0eed2fb138315fe47b7111d0fbeb4f7db156c898 | adfd88d6e054f4b4bc06c41e7123c28ec76b1973 | refs/heads/master | 2021-01-19T14:10:34.551000 | 2015-09-14T11:04:58 | 2015-09-14T11:04:58 | 42,443,226 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
public class EnterSymptomsPanel extends JPanel{
//components for panel
//JLabels for symptoms
JLabel painLabel;
JLabel tirednessLabel;
JLabel nauseaLabel;
JLabel depressionLabel;
JLabel anxietyLabel;
JLabel drowsinessLabel;
JLabel appetiteLabel;
JLabel wellbeingLabel;
JLabel sobLabel;
JLabel otherLabel;
//JSliders for symptoms
JSlider painSlider;
JSlider tirednessSlider;
JSlider nauseaSlider;
JSlider depressionSlider;
JSlider anxietySlider;
JSlider drowsinessSlider;
JSlider appetiteSlider;
JSlider wellbeingSlider;
JSlider sobSlider;
JSlider oSlider;
JButton submitButton;
JButton backButton;
public EnterSymptomsPanel(Container contentPane){
//setting to grid layout
setLayout(new GridLayout(6,5));
//setting up the components
//labels
painLabel = new JLabel("Pain");
tirednessLabel = new JLabel("Tiredness");
nauseaLabel = new JLabel("Nausea");
depressionLabel = new JLabel("Depression");
anxietyLabel = new JLabel("Anxiety");
drowsinessLabel = new JLabel("Drowsiness");
appetiteLabel = new JLabel("Appetite");
wellbeingLabel = new JLabel("Wellbeing");
sobLabel = new JLabel("Shortness of Breath");
otherLabel = new JLabel("Other");
submitButton = new JButton("Submit");
backButton = new JButton("Back");
//sliders
painSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
tirednessSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
nauseaSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
depressionSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
anxietySlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
drowsinessSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
appetiteSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
wellbeingSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
sobSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
oSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
//setting paint ticks and labels
painSlider.setMajorTickSpacing(1);
painSlider.setMinorTickSpacing(1);
painSlider.setPaintTicks(true);
painSlider.setPaintLabels(true);
painSlider.setSnapToTicks(true);
tirednessSlider.setMajorTickSpacing(1);
tirednessSlider.setMinorTickSpacing(1);
tirednessSlider.setPaintTicks(true);
tirednessSlider.setPaintLabels(true);
painSlider.setSnapToTicks(true);
nauseaSlider.setMajorTickSpacing(1);
nauseaSlider.setMinorTickSpacing(1);
nauseaSlider.setPaintTicks(true);
nauseaSlider.setPaintLabels(true);
nauseaSlider.setSnapToTicks(true);
depressionSlider.setMajorTickSpacing(1);
depressionSlider.setMinorTickSpacing(1);
depressionSlider.setPaintTicks(true);
depressionSlider.setPaintLabels(true);
depressionSlider.setSnapToTicks(true);
anxietySlider.setMajorTickSpacing(1);
anxietySlider.setMinorTickSpacing(1);
anxietySlider.setPaintTicks(true);
anxietySlider.setPaintLabels(true);
anxietySlider.setSnapToTicks(true);
drowsinessSlider.setMajorTickSpacing(1);
drowsinessSlider.setMinorTickSpacing(1);
drowsinessSlider.setPaintTicks(true);
drowsinessSlider.setPaintLabels(true);
drowsinessSlider.setSnapToTicks(true);
appetiteSlider.setMajorTickSpacing(1);
appetiteSlider.setMinorTickSpacing(1);
appetiteSlider.setPaintTicks(true);
appetiteSlider.setPaintLabels(true);
appetiteSlider.setSnapToTicks(true);
wellbeingSlider.setMajorTickSpacing(1);
wellbeingSlider.setMinorTickSpacing(1);
wellbeingSlider.setPaintTicks(true);
wellbeingSlider.setPaintLabels(true);
appetiteSlider.setSnapToTicks(true);
sobSlider.setMajorTickSpacing(1);
sobSlider.setMinorTickSpacing(1);
sobSlider.setPaintTicks(true);
sobSlider.setPaintLabels(true);
sobSlider.setSnapToTicks(true);
oSlider.setMajorTickSpacing(1);
oSlider.setMinorTickSpacing(1);
oSlider.setPaintTicks(true);
oSlider.setPaintLabels(true);
oSlider.setSnapToTicks(true);
//button listeners
submitButton.addActionListener(new SubmitListener(contentPane));
backButton.addActionListener(new BackListener(contentPane));
//setting alignment
painLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
painSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
tirednessLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
tirednessSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
nauseaLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
nauseaSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
depressionLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
depressionSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
anxietyLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
anxietySlider.setAlignmentX(Component.CENTER_ALIGNMENT);
drowsinessLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
drowsinessSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
appetiteLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
appetiteSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
wellbeingLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
wellbeingSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
sobLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
sobSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
otherLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
oSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
//setting slider size
painSlider.setMaximumSize(new Dimension(200, 30));
tirednessSlider.setMaximumSize(new Dimension(200, 30));
nauseaSlider.setMaximumSize(new Dimension(200, 30));
depressionSlider.setMaximumSize(new Dimension(200, 30));
anxietySlider.setMaximumSize(new Dimension(200, 30));
drowsinessSlider.setMaximumSize(new Dimension(200, 30));
appetiteSlider.setMaximumSize(new Dimension(200, 30));
wellbeingSlider.setMaximumSize(new Dimension(200,30));
sobSlider.setMaximumSize(new Dimension(200, 30));
oSlider.setMaximumSize(new Dimension(200, 30));
//adding components
add(painLabel);
add(painSlider);
add(tirednessLabel);
add(tirednessSlider);
add(nauseaLabel);
add(nauseaSlider);
add(depressionLabel);
add(depressionSlider);
add(anxietyLabel);
add(anxietySlider);
add(drowsinessLabel);
add(drowsinessSlider);
add(appetiteLabel);
add(appetiteSlider);
add(wellbeingLabel);
add(wellbeingSlider);
add(sobLabel);
add(sobSlider);
add(otherLabel);
add(oSlider);
add(submitButton);
add(backButton);
}
public class SubmitListener implements ActionListener{
Container contentPane;
public SubmitListener(Container contentPane){
this.contentPane = contentPane;
}
public void actionPerformed(ActionEvent arg0){
System.out.println(painSlider.toString());
Integer painValue = painSlider.getValue();
Integer tirednessValue = tirednessSlider.getValue();
Integer nauseaValue = nauseaSlider.getValue();
Integer depressionValue = depressionSlider.getValue();
Integer anxietyValue = anxietySlider.getValue();
Integer drowsinessValue = drowsinessSlider.getValue();
Integer appetiteValue = appetiteSlider.getValue();
Integer wellbeingValue = wellbeingSlider.getValue();
Integer sobValue = sobSlider.getValue();
Integer oValue = oSlider.getValue();
Calendar calendar = new GregorianCalendar();
int day = calendar.get(Calendar.DAY_OF_MONTH);
int month = calendar.get(Calendar.MONTH);
int year = calendar.get(Calendar.YEAR);
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int min = calendar.get(Calendar.MINUTE);
String date = "" + day+ "/" + (month += 1) + "/" + year + " " + hour + ":" + min;
String pEmail = LoginPanel.getEmail();
PrintStream console = System.out;
File f = Database.download(pEmail + ".csv", console);
if(f.exists() && !f.isDirectory())
{
try {
String buffer = "";
Scanner scanner = new Scanner(f);
scanner.useDelimiter("\n");
//add the header line to the buffer
buffer += scanner.nextLine();
//add the new line after the header
buffer += "\n" + painValue.toString() + "," + tirednessValue.toString() + "," + nauseaValue.toString() + "," + depressionValue.toString() + ","
+ anxietyValue.toString() + "," + drowsinessValue.toString() + "," + appetiteValue.toString() + "," + wellbeingValue.toString() + ","
+ sobValue.toString() + "," + oValue.toString() + "," + date + "," + "FALSE" + "\n";
//add the rest of the lines
while(scanner.hasNext()){
buffer += scanner.nextLine() + "\n";
}
scanner.close();
FileWriter fw = new FileWriter(pEmail + ".csv", false);
fw.append(buffer);
fw.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
else // pEmail.csv does not exist
{
FileWriter fw;
try {
fw = new FileWriter(pEmail + ".csv");
fw.append("pain");
fw.append(",");
fw.append("tiredness");
fw.append(",");
fw.append("nausea");
fw.append(",");
fw.append("depression");
fw.append(",");
fw.append("anxiety");
fw.append(",");
fw.append("drowsiness");
fw.append(",");
fw.append("appetite");
fw.append(",");
fw.append("wellbeing");
fw.append(",");
fw.append("shortnessOfBreath");
fw.append(",");
fw.append("other");
fw.append(",");
fw.append("date");
fw.append(",");
fw.append("read");
fw.append("\n");
fw.append(painValue.toString());
fw.append(",");
fw.append(tirednessValue.toString());
fw.append(",");
fw.append(nauseaValue.toString());
fw.append(",");
fw.append(depressionValue.toString());
fw.append(",");
fw.append(anxietyValue.toString());
fw.append(",");
fw.append(drowsinessValue.toString());
fw.append(",");
fw.append(appetiteValue.toString());
fw.append(",");
fw.append(wellbeingValue.toString());
fw.append(",");
fw.append(sobValue.toString());
fw.append(",");
fw.append(oValue.toString());
fw.append(",");
fw.append(date);
fw.append(",");
fw.append("FALSE");
fw.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
Database.upload(pEmail + ".csv", new File(pEmail + ".csv"));
contentPane.removeAll();
contentPane.add(new MainMenuPanel(contentPane));
contentPane.invalidate();
contentPane.validate();
}
}
public class BackListener implements ActionListener{
Container contentPane;
public BackListener(Container contentPane){
this.contentPane = contentPane;
}
public void actionPerformed(ActionEvent arg0) {
contentPane.removeAll();
contentPane.add(new MainMenuPanel(contentPane));
contentPane.invalidate();
contentPane.validate();
}
}
} | UTF-8 | Java | 10,978 | java | EnterSymptomsPanel.java | Java | [] | null | [] | import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
public class EnterSymptomsPanel extends JPanel{
//components for panel
//JLabels for symptoms
JLabel painLabel;
JLabel tirednessLabel;
JLabel nauseaLabel;
JLabel depressionLabel;
JLabel anxietyLabel;
JLabel drowsinessLabel;
JLabel appetiteLabel;
JLabel wellbeingLabel;
JLabel sobLabel;
JLabel otherLabel;
//JSliders for symptoms
JSlider painSlider;
JSlider tirednessSlider;
JSlider nauseaSlider;
JSlider depressionSlider;
JSlider anxietySlider;
JSlider drowsinessSlider;
JSlider appetiteSlider;
JSlider wellbeingSlider;
JSlider sobSlider;
JSlider oSlider;
JButton submitButton;
JButton backButton;
public EnterSymptomsPanel(Container contentPane){
//setting to grid layout
setLayout(new GridLayout(6,5));
//setting up the components
//labels
painLabel = new JLabel("Pain");
tirednessLabel = new JLabel("Tiredness");
nauseaLabel = new JLabel("Nausea");
depressionLabel = new JLabel("Depression");
anxietyLabel = new JLabel("Anxiety");
drowsinessLabel = new JLabel("Drowsiness");
appetiteLabel = new JLabel("Appetite");
wellbeingLabel = new JLabel("Wellbeing");
sobLabel = new JLabel("Shortness of Breath");
otherLabel = new JLabel("Other");
submitButton = new JButton("Submit");
backButton = new JButton("Back");
//sliders
painSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
tirednessSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
nauseaSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
depressionSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
anxietySlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
drowsinessSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
appetiteSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
wellbeingSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
sobSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
oSlider = new JSlider(JSlider.HORIZONTAL,
0, 10, 0);
//setting paint ticks and labels
painSlider.setMajorTickSpacing(1);
painSlider.setMinorTickSpacing(1);
painSlider.setPaintTicks(true);
painSlider.setPaintLabels(true);
painSlider.setSnapToTicks(true);
tirednessSlider.setMajorTickSpacing(1);
tirednessSlider.setMinorTickSpacing(1);
tirednessSlider.setPaintTicks(true);
tirednessSlider.setPaintLabels(true);
painSlider.setSnapToTicks(true);
nauseaSlider.setMajorTickSpacing(1);
nauseaSlider.setMinorTickSpacing(1);
nauseaSlider.setPaintTicks(true);
nauseaSlider.setPaintLabels(true);
nauseaSlider.setSnapToTicks(true);
depressionSlider.setMajorTickSpacing(1);
depressionSlider.setMinorTickSpacing(1);
depressionSlider.setPaintTicks(true);
depressionSlider.setPaintLabels(true);
depressionSlider.setSnapToTicks(true);
anxietySlider.setMajorTickSpacing(1);
anxietySlider.setMinorTickSpacing(1);
anxietySlider.setPaintTicks(true);
anxietySlider.setPaintLabels(true);
anxietySlider.setSnapToTicks(true);
drowsinessSlider.setMajorTickSpacing(1);
drowsinessSlider.setMinorTickSpacing(1);
drowsinessSlider.setPaintTicks(true);
drowsinessSlider.setPaintLabels(true);
drowsinessSlider.setSnapToTicks(true);
appetiteSlider.setMajorTickSpacing(1);
appetiteSlider.setMinorTickSpacing(1);
appetiteSlider.setPaintTicks(true);
appetiteSlider.setPaintLabels(true);
appetiteSlider.setSnapToTicks(true);
wellbeingSlider.setMajorTickSpacing(1);
wellbeingSlider.setMinorTickSpacing(1);
wellbeingSlider.setPaintTicks(true);
wellbeingSlider.setPaintLabels(true);
appetiteSlider.setSnapToTicks(true);
sobSlider.setMajorTickSpacing(1);
sobSlider.setMinorTickSpacing(1);
sobSlider.setPaintTicks(true);
sobSlider.setPaintLabels(true);
sobSlider.setSnapToTicks(true);
oSlider.setMajorTickSpacing(1);
oSlider.setMinorTickSpacing(1);
oSlider.setPaintTicks(true);
oSlider.setPaintLabels(true);
oSlider.setSnapToTicks(true);
//button listeners
submitButton.addActionListener(new SubmitListener(contentPane));
backButton.addActionListener(new BackListener(contentPane));
//setting alignment
painLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
painSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
tirednessLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
tirednessSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
nauseaLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
nauseaSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
depressionLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
depressionSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
anxietyLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
anxietySlider.setAlignmentX(Component.CENTER_ALIGNMENT);
drowsinessLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
drowsinessSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
appetiteLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
appetiteSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
wellbeingLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
wellbeingSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
sobLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
sobSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
otherLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
oSlider.setAlignmentX(Component.CENTER_ALIGNMENT);
//setting slider size
painSlider.setMaximumSize(new Dimension(200, 30));
tirednessSlider.setMaximumSize(new Dimension(200, 30));
nauseaSlider.setMaximumSize(new Dimension(200, 30));
depressionSlider.setMaximumSize(new Dimension(200, 30));
anxietySlider.setMaximumSize(new Dimension(200, 30));
drowsinessSlider.setMaximumSize(new Dimension(200, 30));
appetiteSlider.setMaximumSize(new Dimension(200, 30));
wellbeingSlider.setMaximumSize(new Dimension(200,30));
sobSlider.setMaximumSize(new Dimension(200, 30));
oSlider.setMaximumSize(new Dimension(200, 30));
//adding components
add(painLabel);
add(painSlider);
add(tirednessLabel);
add(tirednessSlider);
add(nauseaLabel);
add(nauseaSlider);
add(depressionLabel);
add(depressionSlider);
add(anxietyLabel);
add(anxietySlider);
add(drowsinessLabel);
add(drowsinessSlider);
add(appetiteLabel);
add(appetiteSlider);
add(wellbeingLabel);
add(wellbeingSlider);
add(sobLabel);
add(sobSlider);
add(otherLabel);
add(oSlider);
add(submitButton);
add(backButton);
}
public class SubmitListener implements ActionListener{
Container contentPane;
public SubmitListener(Container contentPane){
this.contentPane = contentPane;
}
public void actionPerformed(ActionEvent arg0){
System.out.println(painSlider.toString());
Integer painValue = painSlider.getValue();
Integer tirednessValue = tirednessSlider.getValue();
Integer nauseaValue = nauseaSlider.getValue();
Integer depressionValue = depressionSlider.getValue();
Integer anxietyValue = anxietySlider.getValue();
Integer drowsinessValue = drowsinessSlider.getValue();
Integer appetiteValue = appetiteSlider.getValue();
Integer wellbeingValue = wellbeingSlider.getValue();
Integer sobValue = sobSlider.getValue();
Integer oValue = oSlider.getValue();
Calendar calendar = new GregorianCalendar();
int day = calendar.get(Calendar.DAY_OF_MONTH);
int month = calendar.get(Calendar.MONTH);
int year = calendar.get(Calendar.YEAR);
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int min = calendar.get(Calendar.MINUTE);
String date = "" + day+ "/" + (month += 1) + "/" + year + " " + hour + ":" + min;
String pEmail = LoginPanel.getEmail();
PrintStream console = System.out;
File f = Database.download(pEmail + ".csv", console);
if(f.exists() && !f.isDirectory())
{
try {
String buffer = "";
Scanner scanner = new Scanner(f);
scanner.useDelimiter("\n");
//add the header line to the buffer
buffer += scanner.nextLine();
//add the new line after the header
buffer += "\n" + painValue.toString() + "," + tirednessValue.toString() + "," + nauseaValue.toString() + "," + depressionValue.toString() + ","
+ anxietyValue.toString() + "," + drowsinessValue.toString() + "," + appetiteValue.toString() + "," + wellbeingValue.toString() + ","
+ sobValue.toString() + "," + oValue.toString() + "," + date + "," + "FALSE" + "\n";
//add the rest of the lines
while(scanner.hasNext()){
buffer += scanner.nextLine() + "\n";
}
scanner.close();
FileWriter fw = new FileWriter(pEmail + ".csv", false);
fw.append(buffer);
fw.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
else // pEmail.csv does not exist
{
FileWriter fw;
try {
fw = new FileWriter(pEmail + ".csv");
fw.append("pain");
fw.append(",");
fw.append("tiredness");
fw.append(",");
fw.append("nausea");
fw.append(",");
fw.append("depression");
fw.append(",");
fw.append("anxiety");
fw.append(",");
fw.append("drowsiness");
fw.append(",");
fw.append("appetite");
fw.append(",");
fw.append("wellbeing");
fw.append(",");
fw.append("shortnessOfBreath");
fw.append(",");
fw.append("other");
fw.append(",");
fw.append("date");
fw.append(",");
fw.append("read");
fw.append("\n");
fw.append(painValue.toString());
fw.append(",");
fw.append(tirednessValue.toString());
fw.append(",");
fw.append(nauseaValue.toString());
fw.append(",");
fw.append(depressionValue.toString());
fw.append(",");
fw.append(anxietyValue.toString());
fw.append(",");
fw.append(drowsinessValue.toString());
fw.append(",");
fw.append(appetiteValue.toString());
fw.append(",");
fw.append(wellbeingValue.toString());
fw.append(",");
fw.append(sobValue.toString());
fw.append(",");
fw.append(oValue.toString());
fw.append(",");
fw.append(date);
fw.append(",");
fw.append("FALSE");
fw.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
Database.upload(pEmail + ".csv", new File(pEmail + ".csv"));
contentPane.removeAll();
contentPane.add(new MainMenuPanel(contentPane));
contentPane.invalidate();
contentPane.validate();
}
}
public class BackListener implements ActionListener{
Container contentPane;
public BackListener(Container contentPane){
this.contentPane = contentPane;
}
public void actionPerformed(ActionEvent arg0) {
contentPane.removeAll();
contentPane.add(new MainMenuPanel(contentPane));
contentPane.invalidate();
contentPane.validate();
}
}
} | 10,978 | 0.698579 | 0.687739 | 373 | 28.434317 | 20.124121 | 148 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.399464 | false | false | 3 |
cff62982769478cfa2b1a35b40dbefe900b92518 | 1,735,166,853,145 | a084e5a116fbe9fdb4bbcf899ebe1bbef2de6a8a | /JavaApp/src/com/kosta/_0809/SimpleNotePad.java | d0a2944295ae0644f72b2d19aa2d0647c0a33ace | [] | no_license | ball4716/kosta130 | https://github.com/ball4716/kosta130 | cb082cbe6e8a22735789efa8c0f25235661d8b1b | 35253a183b529d76c7e404af7a451baf62ed6fdf | refs/heads/master | 2020-02-26T17:27:12.538000 | 2016-11-08T06:47:07 | 2016-11-08T06:47:07 | 71,738,465 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.kosta._0809;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.filechooser.FileNameExtensionFilter;
public class SimpleNotePad extends JFrame implements ActionListener{
JTextArea ta;
JScrollPane scroll_pane;//사이즈를 벗어나는 데이터를 표현하기 위해 사용
//JTextArea. JList, JTable
JMenuBar menu_bar;
JMenu file_menu, help_menu;
JMenuItem menu_item_open,menu_item_save,menu_item_exit;
JFileChooser file_chooser = new JFileChooser("./");
FileNameExtensionFilter filter = new FileNameExtensionFilter(
"텍스트파일", "txt");
FileInputStream fis;
FileOutputStream fos;
BufferedReader br;
/*
InputStream OutputStream
File ------------> File
a.txt b.txt
<기능구현>
1. 파일(a.txt)을 읽어서 JTextArea에 출력
파일 --------------> ta
2. JTextArea의 text를 특정파일이름으로 저장
ta --------------> 파일
JFileChooser클래스
- openDialog
- saveDialog
참고) JMenuItem(이벤트소스) ----------->
이벤트처리
*/
public SimpleNotePad() {
setTitle("자바메모장");
//메뉴아이템 구성
menu_item_open = new JMenuItem("열기");
menu_item_save = new JMenuItem("저장");
menu_item_exit = new JMenuItem("종료");
//메뉴구성
file_menu = new JMenu("File");
file_menu.add(menu_item_open);
file_menu.add(menu_item_save);
file_menu.add(menu_item_exit);
help_menu = new JMenu("Help");
//메뉴바구성
menu_bar = new JMenuBar();
menu_bar.add(file_menu);
menu_bar.add(help_menu);
setJMenuBar(menu_bar);
ta = new JTextArea();
scroll_pane = new JScrollPane(ta);
add(scroll_pane);
setBounds(300,50,600,650);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
//파일 선택지 확장자 셋팅
file_chooser.setFileFilter(filter);
//연결자(감시자) 등록
menu_item_open.addActionListener(this);
menu_item_save.addActionListener(this);
menu_item_exit.addActionListener(this);
help_menu.addActionListener(this);
}
@Override
public void actionPerformed(ActionEvent e) {
Object obj = e.getSource();
byte b[]=new byte[10];
int i;
int returnVal;
if(obj == menu_item_open){
ta.setText("");
returnVal = file_chooser.showOpenDialog(this);
if(returnVal == JFileChooser.APPROVE_OPTION) {
try {
fis = new FileInputStream(file_chooser.getSelectedFile().getName());
while((i=fis.read(b))!=-1){
ta.append(new String(b));
}
fis.close();
} catch (Exception exception) {
exception.printStackTrace();
}
}else if(returnVal==JFileChooser.CANCEL_OPTION){
return;
}else{//returnVal==JFileChooser.ERROR_OPTION
JOptionPane.showMessageDialog(this, "치명적인 오류가 발생하였습니다. 프로그램을 종료합니다.");
System.exit(0);
}
}else if(obj == menu_item_save){
returnVal = file_chooser.showSaveDialog(this);
if(returnVal == JFileChooser.APPROVE_OPTION) {
try {
String str = ta.getText().replace("\n", "\r\n");
//데이터 얻고, 앞으로 당기기: CR(13) + 줄바꿈: LF(10)
// \r \n
fos = new FileOutputStream(file_chooser.getSelectedFile().getName());
fos.write(str.getBytes());
fos.close();
} catch (Exception exception) {
exception.printStackTrace();
}
}else if(returnVal==JFileChooser.CANCEL_OPTION){
return;
}else{//returnVal==JFileChooser.ERROR_OPTION
JOptionPane.showMessageDialog(this, "치명적인 오류가 발생하였습니다. 프로그램을 종료합니다.");
System.exit(0);
}
}else if(obj == menu_item_exit){
System.exit(0);
}
}
public static void main(String[] args) {
new SimpleNotePad();
}
}
| UHC | Java | 4,582 | java | SimpleNotePad.java | Java | [] | null | [] | package com.kosta._0809;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.filechooser.FileNameExtensionFilter;
public class SimpleNotePad extends JFrame implements ActionListener{
JTextArea ta;
JScrollPane scroll_pane;//사이즈를 벗어나는 데이터를 표현하기 위해 사용
//JTextArea. JList, JTable
JMenuBar menu_bar;
JMenu file_menu, help_menu;
JMenuItem menu_item_open,menu_item_save,menu_item_exit;
JFileChooser file_chooser = new JFileChooser("./");
FileNameExtensionFilter filter = new FileNameExtensionFilter(
"텍스트파일", "txt");
FileInputStream fis;
FileOutputStream fos;
BufferedReader br;
/*
InputStream OutputStream
File ------------> File
a.txt b.txt
<기능구현>
1. 파일(a.txt)을 읽어서 JTextArea에 출력
파일 --------------> ta
2. JTextArea의 text를 특정파일이름으로 저장
ta --------------> 파일
JFileChooser클래스
- openDialog
- saveDialog
참고) JMenuItem(이벤트소스) ----------->
이벤트처리
*/
public SimpleNotePad() {
setTitle("자바메모장");
//메뉴아이템 구성
menu_item_open = new JMenuItem("열기");
menu_item_save = new JMenuItem("저장");
menu_item_exit = new JMenuItem("종료");
//메뉴구성
file_menu = new JMenu("File");
file_menu.add(menu_item_open);
file_menu.add(menu_item_save);
file_menu.add(menu_item_exit);
help_menu = new JMenu("Help");
//메뉴바구성
menu_bar = new JMenuBar();
menu_bar.add(file_menu);
menu_bar.add(help_menu);
setJMenuBar(menu_bar);
ta = new JTextArea();
scroll_pane = new JScrollPane(ta);
add(scroll_pane);
setBounds(300,50,600,650);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
//파일 선택지 확장자 셋팅
file_chooser.setFileFilter(filter);
//연결자(감시자) 등록
menu_item_open.addActionListener(this);
menu_item_save.addActionListener(this);
menu_item_exit.addActionListener(this);
help_menu.addActionListener(this);
}
@Override
public void actionPerformed(ActionEvent e) {
Object obj = e.getSource();
byte b[]=new byte[10];
int i;
int returnVal;
if(obj == menu_item_open){
ta.setText("");
returnVal = file_chooser.showOpenDialog(this);
if(returnVal == JFileChooser.APPROVE_OPTION) {
try {
fis = new FileInputStream(file_chooser.getSelectedFile().getName());
while((i=fis.read(b))!=-1){
ta.append(new String(b));
}
fis.close();
} catch (Exception exception) {
exception.printStackTrace();
}
}else if(returnVal==JFileChooser.CANCEL_OPTION){
return;
}else{//returnVal==JFileChooser.ERROR_OPTION
JOptionPane.showMessageDialog(this, "치명적인 오류가 발생하였습니다. 프로그램을 종료합니다.");
System.exit(0);
}
}else if(obj == menu_item_save){
returnVal = file_chooser.showSaveDialog(this);
if(returnVal == JFileChooser.APPROVE_OPTION) {
try {
String str = ta.getText().replace("\n", "\r\n");
//데이터 얻고, 앞으로 당기기: CR(13) + 줄바꿈: LF(10)
// \r \n
fos = new FileOutputStream(file_chooser.getSelectedFile().getName());
fos.write(str.getBytes());
fos.close();
} catch (Exception exception) {
exception.printStackTrace();
}
}else if(returnVal==JFileChooser.CANCEL_OPTION){
return;
}else{//returnVal==JFileChooser.ERROR_OPTION
JOptionPane.showMessageDialog(this, "치명적인 오류가 발생하였습니다. 프로그램을 종료합니다.");
System.exit(0);
}
}else if(obj == menu_item_exit){
System.exit(0);
}
}
public static void main(String[] args) {
new SimpleNotePad();
}
}
| 4,582 | 0.629787 | 0.623404 | 159 | 24.603773 | 18.18667 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.45912 | false | false | 3 |
60c0de796dd7e66b56e3c890bac13f1d71eb3492 | 33,148,557,629,398 | 28f1dedfa55de3381f0e2124c7c819f582767e2a | /core/components/slp/src/org/smartfrog/services/comm/slp/agents/SLPMessageCallbacks.java | 66ef0e100c1a75886c056697d890dd5734fcdf6a | [] | no_license | rhusar/smartfrog | https://github.com/rhusar/smartfrog | 3bd0032888c03a8a04036945c2d857f72a89dba6 | 0b4db766fb1ec1e1c2e48cbf5f7bf6bfd2df4e89 | refs/heads/master | 2021-01-10T05:07:39.218000 | 2014-11-28T08:52:32 | 2014-11-28T08:52:32 | 47,347,494 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
Service Location Protocol - SmartFrog components.
Copyright (C) 2004 Glenn Hisdal <ghisdal(a)c2i.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
This library was originally developed by Glenn Hisdal at the
European Organisation for Nuclear Research (CERN) in Spring 2004.
The work was part of a master thesis project for the Norwegian
University of Science and Technology (NTNU).
For more information: http://home.c2i.net/ghisdal/slp.html
*/
package org.smartfrog.services.comm.slp.agents;
import org.smartfrog.services.comm.slp.ServiceLocationEnumeration;
import org.smartfrog.services.comm.slp.ServiceLocationException;
import org.smartfrog.services.comm.slp.messages.SLPMessageHeader;
import org.smartfrog.services.comm.slp.util.SLPInputStream;
/** Defines the methods used to handle incoming requests. All agents implement these. */
public interface SLPMessageCallbacks {
/**
* Called whenever request that is not a reply is received. These are: SrvReq, SrvTypeReq, SrvReg, SrvDeReg.
*
* @param function The type of message received.
* @param sis The SLPInputStream to read the message from.
* @param isUDP Set to 'true' if message was received on the UDP listener.
* @return A reply to the message, or null if no reply is to be sent.
*/
abstract SLPMessageHeader handleNonReplyMessage(int function, SLPInputStream sis, boolean isUDP)
throws ServiceLocationException;
/**
* Called whenever a reply to a request is received. Replies can be: SrvRply, SrvTypeRply, SrvAck.
*
* @param function The type of message received.
* @param sis The SLPInputStream to read the message from.
* @param results Any results returned by the reply is put into this.
* @return true if message was complete. fals if message was truncated.
*/
abstract boolean handleReplyMessage(int function, SLPInputStream sis,
ServiceLocationEnumeration results)
throws ServiceLocationException;
}
| UTF-8 | Java | 2,726 | java | SLPMessageCallbacks.java | Java | [
{
"context": "otocol - SmartFrog components.\n Copyright (C) 2004 Glenn Hisdal <ghisdal(a)c2i.net>\n \n This library is free softw",
"end": 86,
"score": 0.999862015247345,
"start": 74,
"tag": "NAME",
"value": "Glenn Hisdal"
},
{
"context": "7 USA\n \n This library was originally developed by Glenn Hisdal at the \n European Organisation for Nuclear Resear",
"end": 877,
"score": 0.9998777508735657,
"start": 865,
"tag": "NAME",
"value": "Glenn Hisdal"
}
] | null | [] | /*
Service Location Protocol - SmartFrog components.
Copyright (C) 2004 <NAME> <ghisdal(a)c2i.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
This library was originally developed by <NAME> at the
European Organisation for Nuclear Research (CERN) in Spring 2004.
The work was part of a master thesis project for the Norwegian
University of Science and Technology (NTNU).
For more information: http://home.c2i.net/ghisdal/slp.html
*/
package org.smartfrog.services.comm.slp.agents;
import org.smartfrog.services.comm.slp.ServiceLocationEnumeration;
import org.smartfrog.services.comm.slp.ServiceLocationException;
import org.smartfrog.services.comm.slp.messages.SLPMessageHeader;
import org.smartfrog.services.comm.slp.util.SLPInputStream;
/** Defines the methods used to handle incoming requests. All agents implement these. */
public interface SLPMessageCallbacks {
/**
* Called whenever request that is not a reply is received. These are: SrvReq, SrvTypeReq, SrvReg, SrvDeReg.
*
* @param function The type of message received.
* @param sis The SLPInputStream to read the message from.
* @param isUDP Set to 'true' if message was received on the UDP listener.
* @return A reply to the message, or null if no reply is to be sent.
*/
abstract SLPMessageHeader handleNonReplyMessage(int function, SLPInputStream sis, boolean isUDP)
throws ServiceLocationException;
/**
* Called whenever a reply to a request is received. Replies can be: SrvRply, SrvTypeRply, SrvAck.
*
* @param function The type of message received.
* @param sis The SLPInputStream to read the message from.
* @param results Any results returned by the reply is put into this.
* @return true if message was complete. fals if message was truncated.
*/
abstract boolean handleReplyMessage(int function, SLPInputStream sis,
ServiceLocationEnumeration results)
throws ServiceLocationException;
}
| 2,714 | 0.739912 | 0.730374 | 59 | 45.18644 | 31.987537 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.491525 | false | false | 3 |
f49ba53fac8f90269930562c57a6e109c8cab6b6 | 446,676,645,353 | 3b6a37e4ce71f79ae44d4b141764138604a0f2b9 | /phloc-schematron/jing/src/main/java/com/thaiopensource/relaxng/pattern/NotAllowedPattern.java | 5467d8e5a1e9613ec2ad81911bbd877a5315ef75 | [
"Apache-2.0"
] | permissive | lsimons/phloc-schematron-standalone | https://github.com/lsimons/phloc-schematron-standalone | b787367085c32e40d9a4bc314ac9d7927a5b83f1 | c52cb04109bdeba5f1e10913aede7a855c2e9453 | refs/heads/master | 2021-01-10T21:26:13.317000 | 2013-09-13T12:18:02 | 2013-09-13T12:18:02 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.thaiopensource.relaxng.pattern;
class NotAllowedPattern extends Pattern
{
NotAllowedPattern ()
{
super (false, EMPTY_CONTENT_TYPE, NOT_ALLOWED_HASH_CODE);
}
@Override
boolean isNotAllowed ()
{
return true;
}
@Override
boolean samePattern (final Pattern other)
{
// needs to work for UnexpandedNotAllowedPattern
return other.getClass () == this.getClass ();
}
@Override
<T> T apply (final PatternFunction <T> f)
{
return f.caseNotAllowed (this);
}
}
| UTF-8 | Java | 515 | java | NotAllowedPattern.java | Java | [] | null | [] | package com.thaiopensource.relaxng.pattern;
class NotAllowedPattern extends Pattern
{
NotAllowedPattern ()
{
super (false, EMPTY_CONTENT_TYPE, NOT_ALLOWED_HASH_CODE);
}
@Override
boolean isNotAllowed ()
{
return true;
}
@Override
boolean samePattern (final Pattern other)
{
// needs to work for UnexpandedNotAllowedPattern
return other.getClass () == this.getClass ();
}
@Override
<T> T apply (final PatternFunction <T> f)
{
return f.caseNotAllowed (this);
}
}
| 515 | 0.67767 | 0.67767 | 28 | 17.392857 | 19.319382 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 3 |
68fd6a01ca5b34d404b459025e44f00ad91edc11 | 28,561,532,569,023 | 95e380c49b143fb7271254ec2cf7b0f2ba47e616 | /ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/Constants.java | 6918b9032f453a715b61722c4834d0f344817838 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | Nashatyrev/artemis | https://github.com/Nashatyrev/artemis | a34515760b8e64c28ca07b7a87b0c3729299e0fc | de2b2801c89ef5abf983d6bf37867c37fc47121f | refs/heads/master | 2022-09-17T01:28:08.612000 | 2022-06-06T14:19:07 | 2022-06-06T14:19:07 | 232,340,075 | 1 | 0 | Apache-2.0 | true | 2021-04-15T15:49:45 | 2020-01-07T14:18:44 | 2020-10-22T22:50:26 | 2021-04-15T15:49:44 | 123,612 | 1 | 0 | 0 | Java | false | false | /*
* Copyright 2019 ConsenSys AG.
*
* 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 tech.pegasys.teku.spec.config;
import java.time.Duration;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
public class Constants {
// Networking
public static final int GOSSIP_MAX_SIZE = 1048576; // bytes
public static final int GOSSIP_MAX_SIZE_BELLATRIX = 10485760; // bytes
public static final int MAX_REQUEST_BLOCKS = 1024;
public static final int MAX_CHUNK_SIZE = 1048576; // bytes
public static final int MAX_CHUNK_SIZE_BELLATRIX = 10485760; // bytes
public static final int ATTESTATION_SUBNET_COUNT = 64;
public static final UInt64 ATTESTATION_PROPAGATION_SLOT_RANGE = UInt64.valueOf(32);
public static final int MAXIMUM_GOSSIP_CLOCK_DISPARITY = 500; // in ms
// Teku Networking Specific
public static final int VALID_BLOCK_SET_SIZE = 1000;
// Target holding two slots worth of aggregators (16 aggregators, 64 committees and 2 slots)
public static final int VALID_AGGREGATE_SET_SIZE = 16 * 64 * 2;
// Target 2 different attestation data (aggregators normally agree) for two slots
public static final int VALID_ATTESTATION_DATA_SET_SIZE = 2 * 64 * 2;
public static final int VALID_VALIDATOR_SET_SIZE = 10000;
// Only need to maintain a cache for the current slot, so just needs to be as large as the
// sync committee size.
public static final int VALID_CONTRIBUTION_AND_PROOF_SET_SIZE = 512;
public static final int VALID_SYNC_COMMITTEE_MESSAGE_SET_SIZE = 512;
public static final Duration ETH1_INDIVIDUAL_BLOCK_RETRY_TIMEOUT = Duration.ofMillis(500);
public static final Duration ETH1_DEPOSIT_REQUEST_RETRY_TIMEOUT = Duration.ofSeconds(2);
public static final Duration EL_ENGINE_BLOCK_EXECUTION_TIMEOUT = Duration.ofSeconds(8);
public static final Duration EL_ENGINE_NON_BLOCK_EXECUTION_TIMEOUT = Duration.ofSeconds(1);
// Maximum duration before timeout for each builder call
public static final Duration EL_BUILDER_CALL_TIMEOUT = Duration.ofSeconds(8);
// Individual durations (per method) before timeout for each builder call. They must be less than
// or equal to EL_BUILDER_CALL_TIMEOUT
public static final Duration EL_BUILDER_STATUS_TIMEOUT = Duration.ofSeconds(1);
public static final Duration EL_BUILDER_REGISTER_VALIDATOR_TIMEOUT = Duration.ofSeconds(8);
public static final Duration EL_BUILDER_GET_HEADER_TIMEOUT = Duration.ofSeconds(1);
public static final Duration EL_BUILDER_GET_PAYLOAD_TIMEOUT = Duration.ofSeconds(8);
public static final Duration ETH1_ENDPOINT_MONITOR_SERVICE_POLL_INTERVAL = Duration.ofSeconds(10);
public static final Duration ETH1_VALID_ENDPOINT_CHECK_INTERVAL =
Duration.ofSeconds(60); // usable
public static final Duration ETH1_FAILED_ENDPOINT_CHECK_INTERVAL =
Duration.ofSeconds(30); // network or API call failure
public static final Duration ETH1_INVALID_ENDPOINT_CHECK_INTERVAL =
Duration.ofSeconds(60); // syncing or wrong chainid
public static final int MAXIMUM_CONCURRENT_ETH1_REQUESTS = 5;
public static final int MAXIMUM_CONCURRENT_EE_REQUESTS = 5;
public static final int MAXIMUM_CONCURRENT_EB_REQUESTS = 5;
public static final int REPUTATION_MANAGER_CAPACITY = 1024;
public static final Duration STORAGE_REQUEST_TIMEOUT = Duration.ofSeconds(60);
public static final int STORAGE_QUERY_CHANNEL_PARALLELISM = 10; // # threads
public static final int PROTOARRAY_FORKCHOICE_PRUNE_THRESHOLD = 256;
// Teku Sync
public static final UInt64 MAX_BLOCK_BY_RANGE_REQUEST_SIZE = UInt64.valueOf(200);
public static final UInt64 SYNC_BATCH_SIZE = UInt64.valueOf(50);
public static final int MAX_BLOCKS_PER_MINUTE = 500;
// Teku Validator Client Specific
public static final Duration GENESIS_DATA_RETRY_DELAY = Duration.ofSeconds(10);
}
| UTF-8 | Java | 4,302 | java | Constants.java | Java | [] | null | [] | /*
* Copyright 2019 ConsenSys AG.
*
* 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 tech.pegasys.teku.spec.config;
import java.time.Duration;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
public class Constants {
// Networking
public static final int GOSSIP_MAX_SIZE = 1048576; // bytes
public static final int GOSSIP_MAX_SIZE_BELLATRIX = 10485760; // bytes
public static final int MAX_REQUEST_BLOCKS = 1024;
public static final int MAX_CHUNK_SIZE = 1048576; // bytes
public static final int MAX_CHUNK_SIZE_BELLATRIX = 10485760; // bytes
public static final int ATTESTATION_SUBNET_COUNT = 64;
public static final UInt64 ATTESTATION_PROPAGATION_SLOT_RANGE = UInt64.valueOf(32);
public static final int MAXIMUM_GOSSIP_CLOCK_DISPARITY = 500; // in ms
// Teku Networking Specific
public static final int VALID_BLOCK_SET_SIZE = 1000;
// Target holding two slots worth of aggregators (16 aggregators, 64 committees and 2 slots)
public static final int VALID_AGGREGATE_SET_SIZE = 16 * 64 * 2;
// Target 2 different attestation data (aggregators normally agree) for two slots
public static final int VALID_ATTESTATION_DATA_SET_SIZE = 2 * 64 * 2;
public static final int VALID_VALIDATOR_SET_SIZE = 10000;
// Only need to maintain a cache for the current slot, so just needs to be as large as the
// sync committee size.
public static final int VALID_CONTRIBUTION_AND_PROOF_SET_SIZE = 512;
public static final int VALID_SYNC_COMMITTEE_MESSAGE_SET_SIZE = 512;
public static final Duration ETH1_INDIVIDUAL_BLOCK_RETRY_TIMEOUT = Duration.ofMillis(500);
public static final Duration ETH1_DEPOSIT_REQUEST_RETRY_TIMEOUT = Duration.ofSeconds(2);
public static final Duration EL_ENGINE_BLOCK_EXECUTION_TIMEOUT = Duration.ofSeconds(8);
public static final Duration EL_ENGINE_NON_BLOCK_EXECUTION_TIMEOUT = Duration.ofSeconds(1);
// Maximum duration before timeout for each builder call
public static final Duration EL_BUILDER_CALL_TIMEOUT = Duration.ofSeconds(8);
// Individual durations (per method) before timeout for each builder call. They must be less than
// or equal to EL_BUILDER_CALL_TIMEOUT
public static final Duration EL_BUILDER_STATUS_TIMEOUT = Duration.ofSeconds(1);
public static final Duration EL_BUILDER_REGISTER_VALIDATOR_TIMEOUT = Duration.ofSeconds(8);
public static final Duration EL_BUILDER_GET_HEADER_TIMEOUT = Duration.ofSeconds(1);
public static final Duration EL_BUILDER_GET_PAYLOAD_TIMEOUT = Duration.ofSeconds(8);
public static final Duration ETH1_ENDPOINT_MONITOR_SERVICE_POLL_INTERVAL = Duration.ofSeconds(10);
public static final Duration ETH1_VALID_ENDPOINT_CHECK_INTERVAL =
Duration.ofSeconds(60); // usable
public static final Duration ETH1_FAILED_ENDPOINT_CHECK_INTERVAL =
Duration.ofSeconds(30); // network or API call failure
public static final Duration ETH1_INVALID_ENDPOINT_CHECK_INTERVAL =
Duration.ofSeconds(60); // syncing or wrong chainid
public static final int MAXIMUM_CONCURRENT_ETH1_REQUESTS = 5;
public static final int MAXIMUM_CONCURRENT_EE_REQUESTS = 5;
public static final int MAXIMUM_CONCURRENT_EB_REQUESTS = 5;
public static final int REPUTATION_MANAGER_CAPACITY = 1024;
public static final Duration STORAGE_REQUEST_TIMEOUT = Duration.ofSeconds(60);
public static final int STORAGE_QUERY_CHANNEL_PARALLELISM = 10; // # threads
public static final int PROTOARRAY_FORKCHOICE_PRUNE_THRESHOLD = 256;
// Teku Sync
public static final UInt64 MAX_BLOCK_BY_RANGE_REQUEST_SIZE = UInt64.valueOf(200);
public static final UInt64 SYNC_BATCH_SIZE = UInt64.valueOf(50);
public static final int MAX_BLOCKS_PER_MINUTE = 500;
// Teku Validator Client Specific
public static final Duration GENESIS_DATA_RETRY_DELAY = Duration.ofSeconds(10);
}
| 4,302 | 0.766155 | 0.732915 | 77 | 54.870129 | 33.326542 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.623377 | false | false | 3 |
d4cdc0bd6180892d94d15760ad030e972c3c7541 | 30,880,814,905,447 | ef27ac16be06e8b3b2027aebee53fe01ca02890d | /src/main/java/team6/uid/clujsolver/controller/RegisterController.java | 57f9a0d9818e43ae455d7675e53c990ddb0f2bda | [] | no_license | todericidan/UID_ProblemsCrowdSourcingProject | https://github.com/todericidan/UID_ProblemsCrowdSourcingProject | c74eec3529945d1258ae7ec543c0325b091fdf94 | 8c58919ea723c2c90ab0be3dace12d0ce155ba5c | refs/heads/master | 2021-09-04T06:52:27.484000 | 2018-01-16T22:01:52 | 2018-01-16T22:01:52 | 115,549,004 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package team6.uid.clujsolver.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
/**
* Created by dell on 12/28/2017.
*/
@Controller
public class RegisterController {
@RequestMapping(value = "/register",method = RequestMethod.GET)
public String showLoginPage(){
return "register";
}
@RequestMapping(value = "/register",method = RequestMethod.POST)
public String authenticate(@RequestParam("email") String email, @RequestParam("password") String password, Model model){
model.addAttribute("email",email);
return "afterRegisterView";
}
}
| UTF-8 | Java | 825 | java | RegisterController.java | Java | [
{
"context": "b.bind.annotation.RequestParam;\n\n/**\n * Created by dell on 12/28/2017.\n */\n@Controller\npublic class Regis",
"end": 338,
"score": 0.9975999593734741,
"start": 334,
"tag": "USERNAME",
"value": "dell"
}
] | null | [] | package team6.uid.clujsolver.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
/**
* Created by dell on 12/28/2017.
*/
@Controller
public class RegisterController {
@RequestMapping(value = "/register",method = RequestMethod.GET)
public String showLoginPage(){
return "register";
}
@RequestMapping(value = "/register",method = RequestMethod.POST)
public String authenticate(@RequestParam("email") String email, @RequestParam("password") String password, Model model){
model.addAttribute("email",email);
return "afterRegisterView";
}
}
| 825 | 0.749091 | 0.738182 | 27 | 29.555555 | 30.156792 | 124 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.518519 | false | false | 3 |
5791ca4c76903209be90a6ca2a98ebb6ff218679 | 11,098,195,495,696 | 37f3c20564c3c4c1ddfec16aa0e5a2223edff154 | /src/com/rizkyhafitsyah/bangundatar/Form_Trapesium_SamaKaki_MC_HSBKr.java | c59b49acd6f26a8cf8422ec83aa850ac7dd4039c | [] | no_license | RizkyKhapidsyah/Bangun_Datar-For_Android-v1.0_ | https://github.com/RizkyKhapidsyah/Bangun_Datar-For_Android-v1.0_ | 22b7a8543de3a8094501f746e76a578c59791170 | 4833768ae7bc8cbaffbb6b34b72938a19d37530b | refs/heads/master | 2020-04-18T23:54:00.815000 | 2019-05-15T17:43:14 | 2019-05-15T17:43:14 | 167,833,143 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.rizkyhafitsyah.bangundatar;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.content.Intent;
import android.graphics.Typeface;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import android.widget.TextView;
public class Form_Trapesium_SamaKaki_MC_HSBKr extends Activity {
TextView TV_Judul_T_SamaKaki_MC_HSBKr;
TextView TV_SubJudul_T_SamaKaki_MC_HSBKr;
ImageView IV_Gambar_T_SamaKaki_MC_HSBKr;
TextView TV_Input_T_SamaKaki_Tinggi_MC_HSBKr;
TextView TV_Input_T_SamaKaki_SM_MC_HSBKr;
TextView TV_Output_T_SamaKaki_SBKr_MC_HSBKr;
TextView TV_SatuanNilai_T_SamaKaki_Tinggi_MC_HSBKr;
TextView TV_SatuanNilai_T_SamaKaki_SM_MC_HSBKr;
TextView TV_SatuanNilai_T_SamaKaki_SBKr_MC_HSBKr;
EditText ET_Input_T_SamaKaki_Tinggi_MC_HSBKr;
EditText ET_Input_T_SamaKaki_SM_MC_HSBKr;
EditText ET_Output_T_SamaKaki_SBKr_MC_HSBKr;
Button Button_Hitung_T_SamaKaki_MC_HSBKr;
Button Button_Reset_T_SamaKaki_MC_HSBKr;
Button Button_Kembali_T_SamaKaki_MC_HSBKr;
Button Button_Detail_T_SamaKaki_MC_HSBKr;
Button Button_Rumus_TSK_MC_HBKR;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.form_trapesium_samakaki_mc_hsbkr);
String CustomHuruf_T_SamaKaki_MC_HSBKr = "AGENCYR.TTF";
Typeface TipeHuruf_T_SamaKaki_MC_HSBKr = Typeface.createFromAsset(getAssets(), CustomHuruf_T_SamaKaki_MC_HSBKr);
TV_Judul_T_SamaKaki_MC_HSBKr = (TextView)findViewById(R.id.TV_Judul_T_SamaKaki_MC_HSBKr);
TV_SubJudul_T_SamaKaki_MC_HSBKr = (TextView)findViewById(R.id.TV_SubJudul_T_SamaKaki_MC_HSBKr);
IV_Gambar_T_SamaKaki_MC_HSBKr = (ImageView)findViewById(R.id.IV_Gambar_T_SamaKaki_MC_HSBKr);
TV_Input_T_SamaKaki_Tinggi_MC_HSBKr = (TextView)findViewById(R.id.TV_Input_T_SamaKaki_Tinggi_MC_HSBKr);
TV_Input_T_SamaKaki_SM_MC_HSBKr = (TextView)findViewById(R.id.TV_Input_T_SamaKaki_SM_MC_HSBKr);
TV_Output_T_SamaKaki_SBKr_MC_HSBKr = (TextView)findViewById(R.id.TV_Output_T_SamaKaki_SBKr_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_Tinggi_MC_HSBKr = (TextView)findViewById(R.id.TV_SatuanNilai_T_SamaKaki_Tinggi_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_SM_MC_HSBKr = (TextView)findViewById(R.id.TV_SatuanNilai_T_SamaKaki_SM_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_SBKr_MC_HSBKr = (TextView)findViewById(R.id.TV_SatuanNilai_T_SamaKaki_SBKr_MC_HSBKr);
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr = (EditText)findViewById(R.id.ET_Input_T_SamaKaki_Tinggi_MC_HSBKr);
ET_Input_T_SamaKaki_SM_MC_HSBKr = (EditText)findViewById(R.id.ET_Input_T_SamaKaki_SM_MC_HSBKr);
ET_Output_T_SamaKaki_SBKr_MC_HSBKr = (EditText)findViewById(R.id.ET_Output_T_SamaKaki_SBKr_MC_HSBKr);
Button_Hitung_T_SamaKaki_MC_HSBKr = (Button)findViewById(R.id.Button_Hitung_T_SamaKaki_MC_HSBKr);
Button_Reset_T_SamaKaki_MC_HSBKr = (Button)findViewById(R.id.Button_Reset_T_SamaKaki_MC_HSBKr);
Button_Kembali_T_SamaKaki_MC_HSBKr = (Button)findViewById(R.id.Button_Kembali_T_SamaKaki_MC_HSBKr);
Button_Detail_T_SamaKaki_MC_HSBKr = (Button)findViewById(R.id.Button_Detail_T_SamaKaki_MC_HSBKr);
Button_Rumus_TSK_MC_HBKR = (Button)findViewById(R.id.Button_Rumus_TSK_MC_HBKR);
TV_Judul_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_SubJudul_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_Input_T_SamaKaki_Tinggi_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_Input_T_SamaKaki_SM_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_Output_T_SamaKaki_SBKr_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_Tinggi_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_SM_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_SBKr_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
ET_Input_T_SamaKaki_SM_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
ET_Output_T_SamaKaki_SBKr_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
Button_Hitung_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
Button_Reset_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
Button_Kembali_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
Button_Detail_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
Button_Rumus_TSK_MC_HBKR.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
//menambahkan event klik untuk perintah di tombol hitung
Button_Hitung_T_SamaKaki_MC_HSBKr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
if(ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.length()==0){
Toast.makeText(getApplication(), "Silahkan Isi Nilai dari Tinggi [t]. Lihat Gambar!", Toast.LENGTH_LONG).show();
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.requestFocus();
}
else if(ET_Input_T_SamaKaki_SM_MC_HSBKr.getText().toString().length()==0){
Toast.makeText(getApplication(), "Silahkan Isi Nilai dari Sisi Miring [sm]. Lihat Gambar!", Toast.LENGTH_LONG).show();
ET_Input_T_SamaKaki_SM_MC_HSBKr.requestFocus();
}
else{
double I_Tinggi_T_SamaKaki_MC_HSBKr = Double.parseDouble(ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.getText().toString());
double I_SM_T_SamaKaki_MC_HSBKr = Double.parseDouble(ET_Input_T_SamaKaki_SM_MC_HSBKr.getText().toString());
double O_SBKr_T_SamaKaki_MC_HSBKr = Math.sqrt(Math.pow(I_SM_T_SamaKaki_MC_HSBKr, 2) - Math.pow(I_Tinggi_T_SamaKaki_MC_HSBKr, 2));
ET_Output_T_SamaKaki_SBKr_MC_HSBKr.setText(String.valueOf(O_SBKr_T_SamaKaki_MC_HSBKr));
}
} catch (Exception e){
e.printStackTrace();
}
}
});
//menambahkan event klik untuk perintah di tombol reset
Button_Reset_T_SamaKaki_MC_HSBKr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.setText("");
ET_Input_T_SamaKaki_SM_MC_HSBKr.setText("");
ET_Output_T_SamaKaki_SBKr_MC_HSBKr.setText("");
Toast.makeText(getApplication(), "Input dan Output Dikosongkan", Toast.LENGTH_LONG).show();
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.requestFocus();
}
});
Button_Rumus_TSK_MC_HBKR.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.setText(" Tinggi [t]");
ET_Input_T_SamaKaki_SM_MC_HSBKr.setText(" Sisi MIring [sm]");
ET_Output_T_SamaKaki_SBKr_MC_HSBKr.setText(" √(sm^2 - t^2) (Theorema Phytagoras)");
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.requestFocus();
}
});
//menambahkan event klik untuk perintah di tombol kembali
Button_Kembali_T_SamaKaki_MC_HSBKr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
//menambahkan event klik untuk perintah di tombol lihat gambar
Button_Detail_T_SamaKaki_MC_HSBKr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent PanggilFormLihatGambarBD = new Intent(Form_Trapesium_SamaKaki_MC_HSBKr.this, FormLihatGambarTrapesium.class);
startActivity(PanggilFormLihatGambarBD);
}
});
IV_Gambar_T_SamaKaki_MC_HSBKr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent PanggilFormLihatGambarBD = new Intent(Form_Trapesium_SamaKaki_MC_HSBKr.this, FormLihatGambarTrapesium.class);
startActivity(PanggilFormLihatGambarBD);
}
});
}
}
| UTF-8 | Java | 8,021 | java | Form_Trapesium_SamaKaki_MC_HSBKr.java | Java | [
{
"context": "package com.rizkyhafitsyah.bangundatar;\r\n\r\nimport android.os.Bundle",
"end": 17,
"score": 0.528569757938385,
"start": 15,
"tag": "USERNAME",
"value": "ky"
},
{
"context": "package com.rizkyhafitsyah.bangundatar;\r\n\r\nimport android.os.Bundle;\r\nimp",
"end": 23,
"score": 0.5707937479019165,
"start": 18,
"tag": "USERNAME",
"value": "afits"
}
] | null | [] | package com.rizkyhafitsyah.bangundatar;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.content.Intent;
import android.graphics.Typeface;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import android.widget.TextView;
public class Form_Trapesium_SamaKaki_MC_HSBKr extends Activity {
TextView TV_Judul_T_SamaKaki_MC_HSBKr;
TextView TV_SubJudul_T_SamaKaki_MC_HSBKr;
ImageView IV_Gambar_T_SamaKaki_MC_HSBKr;
TextView TV_Input_T_SamaKaki_Tinggi_MC_HSBKr;
TextView TV_Input_T_SamaKaki_SM_MC_HSBKr;
TextView TV_Output_T_SamaKaki_SBKr_MC_HSBKr;
TextView TV_SatuanNilai_T_SamaKaki_Tinggi_MC_HSBKr;
TextView TV_SatuanNilai_T_SamaKaki_SM_MC_HSBKr;
TextView TV_SatuanNilai_T_SamaKaki_SBKr_MC_HSBKr;
EditText ET_Input_T_SamaKaki_Tinggi_MC_HSBKr;
EditText ET_Input_T_SamaKaki_SM_MC_HSBKr;
EditText ET_Output_T_SamaKaki_SBKr_MC_HSBKr;
Button Button_Hitung_T_SamaKaki_MC_HSBKr;
Button Button_Reset_T_SamaKaki_MC_HSBKr;
Button Button_Kembali_T_SamaKaki_MC_HSBKr;
Button Button_Detail_T_SamaKaki_MC_HSBKr;
Button Button_Rumus_TSK_MC_HBKR;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.form_trapesium_samakaki_mc_hsbkr);
String CustomHuruf_T_SamaKaki_MC_HSBKr = "AGENCYR.TTF";
Typeface TipeHuruf_T_SamaKaki_MC_HSBKr = Typeface.createFromAsset(getAssets(), CustomHuruf_T_SamaKaki_MC_HSBKr);
TV_Judul_T_SamaKaki_MC_HSBKr = (TextView)findViewById(R.id.TV_Judul_T_SamaKaki_MC_HSBKr);
TV_SubJudul_T_SamaKaki_MC_HSBKr = (TextView)findViewById(R.id.TV_SubJudul_T_SamaKaki_MC_HSBKr);
IV_Gambar_T_SamaKaki_MC_HSBKr = (ImageView)findViewById(R.id.IV_Gambar_T_SamaKaki_MC_HSBKr);
TV_Input_T_SamaKaki_Tinggi_MC_HSBKr = (TextView)findViewById(R.id.TV_Input_T_SamaKaki_Tinggi_MC_HSBKr);
TV_Input_T_SamaKaki_SM_MC_HSBKr = (TextView)findViewById(R.id.TV_Input_T_SamaKaki_SM_MC_HSBKr);
TV_Output_T_SamaKaki_SBKr_MC_HSBKr = (TextView)findViewById(R.id.TV_Output_T_SamaKaki_SBKr_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_Tinggi_MC_HSBKr = (TextView)findViewById(R.id.TV_SatuanNilai_T_SamaKaki_Tinggi_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_SM_MC_HSBKr = (TextView)findViewById(R.id.TV_SatuanNilai_T_SamaKaki_SM_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_SBKr_MC_HSBKr = (TextView)findViewById(R.id.TV_SatuanNilai_T_SamaKaki_SBKr_MC_HSBKr);
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr = (EditText)findViewById(R.id.ET_Input_T_SamaKaki_Tinggi_MC_HSBKr);
ET_Input_T_SamaKaki_SM_MC_HSBKr = (EditText)findViewById(R.id.ET_Input_T_SamaKaki_SM_MC_HSBKr);
ET_Output_T_SamaKaki_SBKr_MC_HSBKr = (EditText)findViewById(R.id.ET_Output_T_SamaKaki_SBKr_MC_HSBKr);
Button_Hitung_T_SamaKaki_MC_HSBKr = (Button)findViewById(R.id.Button_Hitung_T_SamaKaki_MC_HSBKr);
Button_Reset_T_SamaKaki_MC_HSBKr = (Button)findViewById(R.id.Button_Reset_T_SamaKaki_MC_HSBKr);
Button_Kembali_T_SamaKaki_MC_HSBKr = (Button)findViewById(R.id.Button_Kembali_T_SamaKaki_MC_HSBKr);
Button_Detail_T_SamaKaki_MC_HSBKr = (Button)findViewById(R.id.Button_Detail_T_SamaKaki_MC_HSBKr);
Button_Rumus_TSK_MC_HBKR = (Button)findViewById(R.id.Button_Rumus_TSK_MC_HBKR);
TV_Judul_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_SubJudul_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_Input_T_SamaKaki_Tinggi_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_Input_T_SamaKaki_SM_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_Output_T_SamaKaki_SBKr_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_Tinggi_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_SM_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
TV_SatuanNilai_T_SamaKaki_SBKr_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
ET_Input_T_SamaKaki_SM_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
ET_Output_T_SamaKaki_SBKr_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
Button_Hitung_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
Button_Reset_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
Button_Kembali_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
Button_Detail_T_SamaKaki_MC_HSBKr.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
Button_Rumus_TSK_MC_HBKR.setTypeface(TipeHuruf_T_SamaKaki_MC_HSBKr);
//menambahkan event klik untuk perintah di tombol hitung
Button_Hitung_T_SamaKaki_MC_HSBKr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
if(ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.length()==0){
Toast.makeText(getApplication(), "Silahkan Isi Nilai dari Tinggi [t]. Lihat Gambar!", Toast.LENGTH_LONG).show();
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.requestFocus();
}
else if(ET_Input_T_SamaKaki_SM_MC_HSBKr.getText().toString().length()==0){
Toast.makeText(getApplication(), "Silahkan Isi Nilai dari Sisi Miring [sm]. Lihat Gambar!", Toast.LENGTH_LONG).show();
ET_Input_T_SamaKaki_SM_MC_HSBKr.requestFocus();
}
else{
double I_Tinggi_T_SamaKaki_MC_HSBKr = Double.parseDouble(ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.getText().toString());
double I_SM_T_SamaKaki_MC_HSBKr = Double.parseDouble(ET_Input_T_SamaKaki_SM_MC_HSBKr.getText().toString());
double O_SBKr_T_SamaKaki_MC_HSBKr = Math.sqrt(Math.pow(I_SM_T_SamaKaki_MC_HSBKr, 2) - Math.pow(I_Tinggi_T_SamaKaki_MC_HSBKr, 2));
ET_Output_T_SamaKaki_SBKr_MC_HSBKr.setText(String.valueOf(O_SBKr_T_SamaKaki_MC_HSBKr));
}
} catch (Exception e){
e.printStackTrace();
}
}
});
//menambahkan event klik untuk perintah di tombol reset
Button_Reset_T_SamaKaki_MC_HSBKr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.setText("");
ET_Input_T_SamaKaki_SM_MC_HSBKr.setText("");
ET_Output_T_SamaKaki_SBKr_MC_HSBKr.setText("");
Toast.makeText(getApplication(), "Input dan Output Dikosongkan", Toast.LENGTH_LONG).show();
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.requestFocus();
}
});
Button_Rumus_TSK_MC_HBKR.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.setText(" Tinggi [t]");
ET_Input_T_SamaKaki_SM_MC_HSBKr.setText(" Sisi MIring [sm]");
ET_Output_T_SamaKaki_SBKr_MC_HSBKr.setText(" √(sm^2 - t^2) (Theorema Phytagoras)");
ET_Input_T_SamaKaki_Tinggi_MC_HSBKr.requestFocus();
}
});
//menambahkan event klik untuk perintah di tombol kembali
Button_Kembali_T_SamaKaki_MC_HSBKr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
//menambahkan event klik untuk perintah di tombol lihat gambar
Button_Detail_T_SamaKaki_MC_HSBKr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent PanggilFormLihatGambarBD = new Intent(Form_Trapesium_SamaKaki_MC_HSBKr.this, FormLihatGambarTrapesium.class);
startActivity(PanggilFormLihatGambarBD);
}
});
IV_Gambar_T_SamaKaki_MC_HSBKr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent PanggilFormLihatGambarBD = new Intent(Form_Trapesium_SamaKaki_MC_HSBKr.this, FormLihatGambarTrapesium.class);
startActivity(PanggilFormLihatGambarBD);
}
});
}
}
| 8,021 | 0.71156 | 0.710812 | 150 | 51.459999 | 38.862774 | 135 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.48 | false | false | 3 |
4bb48b2174a5e40718fd49022493b2a93878aeae | 33,535,104,696,426 | e561dd59397aa7dbe6bfd52b4813b46f3746d6c8 | /src/AFanTi/Similarity/CosineSimilarityComputer2.java | 553d27ddaf51162c07b6182130e440d387283c4a | [] | no_license | johnnyhg/AFanTi | https://github.com/johnnyhg/AFanTi | cddfea083e3874f1c13a2247b1849dcb1c9227fa | c6947869e161c8c24d0c9b675f7fe79a539afe95 | refs/heads/master | 2021-01-19T05:44:52.301000 | 2012-05-09T09:29:30 | 2012-05-09T09:29:30 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package AFanTi.Similarity;
import org.ylj.common.UTimeInterval;
import org.ylj.math.Vector;
public class CosineSimilarityComputer2 implements SimilarityComputer {
public double computeSimilarity(Vector v_X, Vector v_Y) {
// TODO Auto-generated method stub
if (v_X == null || v_Y == null)
return 0;
final long V_X_LENGTH = v_X.getLength();
final long V_Y_LENGTH = v_Y.getLength();
if (V_X_LENGTH < 1 || V_Y_LENGTH < 1)
return 0;
//v_X.sortByDimension();
//v_Y.sortByDimension();
int XIndex = 0;
int YIndex = 0;
double sumX2 = 0.0;
double sumY2 = 0.0;
double sumXY = 0.0;
while (true) {
long xDemsion = v_X.getDimensionOfIndex(XIndex);
long yDemsion = v_Y.getDimensionOfIndex(YIndex);
if (xDemsion == yDemsion) {
double x = v_X.getValueOfIndex(XIndex);
double y = v_Y.getValueOfIndex(YIndex);
double x2 = x * x;
double y2 = y * y;
double xy = x * y;
sumX2 += x2;
sumXY += xy;
sumY2 += y2;
}
if (xDemsion >= yDemsion) {
if (++YIndex == V_Y_LENGTH)
break;
}
if (xDemsion <= yDemsion) {
if (++XIndex == V_X_LENGTH)
break;
}
}
// System.out.println("sumX2="+sumX2);
// System.out.println("sumY2="+sumY2);
// System.out.println("sumXY="+sumXY);
// System.out.println(" Math.sqrt(sumX2)="+ Math.sqrt(sumX2));
// System.out.println("sumY2="+sumY2);
double result = sumXY / (Math.sqrt(sumX2) * Math.sqrt(sumY2));
//System.out.println(">>cos2computeSimilarity() cost: "+UTimeInterval.endInterval()+"'us");
// double result = sumXY / (Math.sqrt(sumX2_XY) * Math.sqrt(sumY2_XY));
// System.out.println("result="+result);
return result;
}
}
| UTF-8 | Java | 1,797 | java | CosineSimilarityComputer2.java | Java | [] | null | [] | package AFanTi.Similarity;
import org.ylj.common.UTimeInterval;
import org.ylj.math.Vector;
public class CosineSimilarityComputer2 implements SimilarityComputer {
public double computeSimilarity(Vector v_X, Vector v_Y) {
// TODO Auto-generated method stub
if (v_X == null || v_Y == null)
return 0;
final long V_X_LENGTH = v_X.getLength();
final long V_Y_LENGTH = v_Y.getLength();
if (V_X_LENGTH < 1 || V_Y_LENGTH < 1)
return 0;
//v_X.sortByDimension();
//v_Y.sortByDimension();
int XIndex = 0;
int YIndex = 0;
double sumX2 = 0.0;
double sumY2 = 0.0;
double sumXY = 0.0;
while (true) {
long xDemsion = v_X.getDimensionOfIndex(XIndex);
long yDemsion = v_Y.getDimensionOfIndex(YIndex);
if (xDemsion == yDemsion) {
double x = v_X.getValueOfIndex(XIndex);
double y = v_Y.getValueOfIndex(YIndex);
double x2 = x * x;
double y2 = y * y;
double xy = x * y;
sumX2 += x2;
sumXY += xy;
sumY2 += y2;
}
if (xDemsion >= yDemsion) {
if (++YIndex == V_Y_LENGTH)
break;
}
if (xDemsion <= yDemsion) {
if (++XIndex == V_X_LENGTH)
break;
}
}
// System.out.println("sumX2="+sumX2);
// System.out.println("sumY2="+sumY2);
// System.out.println("sumXY="+sumXY);
// System.out.println(" Math.sqrt(sumX2)="+ Math.sqrt(sumX2));
// System.out.println("sumY2="+sumY2);
double result = sumXY / (Math.sqrt(sumX2) * Math.sqrt(sumY2));
//System.out.println(">>cos2computeSimilarity() cost: "+UTimeInterval.endInterval()+"'us");
// double result = sumXY / (Math.sqrt(sumX2_XY) * Math.sqrt(sumY2_XY));
// System.out.println("result="+result);
return result;
}
}
| 1,797 | 0.582081 | 0.563161 | 88 | 18.420454 | 21.053352 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.136364 | false | false | 3 |
e15f10fd1d38999904771e25f122dabac7f5833f | 29,927,332,118,770 | ff6ffc48d0f6f1dad43455afcd69fdb664a64840 | /Again/src/Browser/HeadlessBrowser.java | 74deb59a84f42c90c22662692de6a4aa4f2ceeb9 | [] | no_license | KaibalyaBiswal/Selenium_Local | https://github.com/KaibalyaBiswal/Selenium_Local | dd192ad1575d756efa20ef23d793cc90babf1223 | 4ff5f942bb6bda61bb7d1b5e82aacf159b64997d | refs/heads/master | 2022-11-05T22:14:59.448000 | 2020-06-24T09:54:08 | 2020-06-24T09:54:08 | 264,669,698 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Browser;
public class HeadlessBrowser
{
}
| UTF-8 | Java | 59 | java | HeadlessBrowser.java | Java | [] | null | [] | package Browser;
public class HeadlessBrowser
{
}
| 59 | 0.677966 | 0.677966 | 6 | 7.833333 | 11.036555 | 29 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | false | false | 3 |
5a3df05cb326a7df8713bfb7c1b851cdd2e1dd38 | 11,304,353,965,093 | 939bfb9a6700935cfe7176ba7d29c24721553840 | /src/main/java/fr/univnantes/termsuite/engines/prepare/SWTSizeSetter.java | 4cee2d9e1a5ba6ec96c3d7c1f56fe28516801ce3 | [
"Apache-2.0"
] | permissive | VisaTM/termsuite-core-omtd | https://github.com/VisaTM/termsuite-core-omtd | db1f8f576e9a712fbbab4e95b561a4aae29b2922 | 44a5dde6d92be9758aa9c08fdc2fa888f6ede3d9 | refs/heads/master | 2020-03-17T05:42:42.944000 | 2018-05-17T09:54:02 | 2018-05-17T09:54:02 | 130,179,757 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package fr.univnantes.termsuite.engines.prepare;
import java.util.Set;
import java.util.stream.Collectors;
import fr.univnantes.termsuite.engines.SimpleEngine;
import fr.univnantes.termsuite.framework.service.TermService;
import fr.univnantes.termsuite.model.TermProperty;
import fr.univnantes.termsuite.utils.TermUtils;
/**
*
* An engine that sets for each term the its number of included SWTs
*
* @author Damien Cram
*
*/
public class SWTSizeSetter extends SimpleEngine {
@Override
public void execute() {
Set<String> swts = terminology.terms()
.filter(TermService::isSingleWord)
.map(TermService::getGroupingKey)
.collect(Collectors.toSet());
for(TermService t:terminology.getTerms()) {
long cnt = t.getWords()
.stream()
.filter( tw -> swts.contains(TermUtils.toGroupingKey(tw)))
.count();
t.setProperty(TermProperty.SWT_SIZE, (int)cnt);
if(cnt == 1)
t.setProperty(TermProperty.IS_SINGLE_WORD, true);
}
}
}
| UTF-8 | Java | 973 | java | SWTSizeSetter.java | Java | [
{
"context": "erm the its number of included SWTs\n * \n * @author Damien Cram\n *\n */\npublic class SWTSizeSetter extends SimpleE",
"end": 427,
"score": 0.9998483657836914,
"start": 416,
"tag": "NAME",
"value": "Damien Cram"
}
] | null | [] | package fr.univnantes.termsuite.engines.prepare;
import java.util.Set;
import java.util.stream.Collectors;
import fr.univnantes.termsuite.engines.SimpleEngine;
import fr.univnantes.termsuite.framework.service.TermService;
import fr.univnantes.termsuite.model.TermProperty;
import fr.univnantes.termsuite.utils.TermUtils;
/**
*
* An engine that sets for each term the its number of included SWTs
*
* @author <NAME>
*
*/
public class SWTSizeSetter extends SimpleEngine {
@Override
public void execute() {
Set<String> swts = terminology.terms()
.filter(TermService::isSingleWord)
.map(TermService::getGroupingKey)
.collect(Collectors.toSet());
for(TermService t:terminology.getTerms()) {
long cnt = t.getWords()
.stream()
.filter( tw -> swts.contains(TermUtils.toGroupingKey(tw)))
.count();
t.setProperty(TermProperty.SWT_SIZE, (int)cnt);
if(cnt == 1)
t.setProperty(TermProperty.IS_SINGLE_WORD, true);
}
}
}
| 968 | 0.726619 | 0.725591 | 38 | 24.605263 | 21.921558 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.631579 | false | false | 3 |
9e920e1d648b649f55fdb044a4f7d8600ce0585c | 7,335,804,166,858 | 27511a2f9b0abe76e3fcef6d70e66647dd15da96 | /src/com/facebook/l.java | ee563a848aafdc66ea39a4a7eb4202b5462fec20 | [] | no_license | biaolv/com.instagram.android | https://github.com/biaolv/com.instagram.android | 7edde43d5a909ae2563cf104acfc6891f2a39ebe | 3fcd3db2c3823a6d29a31ec0f6abcf5ceca995de | refs/heads/master | 2022-05-09T15:05:05.412000 | 2016-07-21T03:48:36 | 2016-07-21T03:48:36 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.facebook;
public final class l
{
public final int a;
public String b;
public int c;
public String d;
public l(int paramInt)
{
a = paramInt;
}
public static l a(String paramString1, int paramInt, String paramString2)
{
l locall = new l(k.c);
b = paramString1;
c = paramInt;
d = paramString2;
return locall;
}
}
/* Location:
* Qualified Name: com.facebook.l
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | UTF-8 | Java | 489 | java | l.java | Java | [] | null | [] | package com.facebook;
public final class l
{
public final int a;
public String b;
public int c;
public String d;
public l(int paramInt)
{
a = paramInt;
}
public static l a(String paramString1, int paramInt, String paramString2)
{
l locall = new l(k.c);
b = paramString1;
c = paramInt;
d = paramString2;
return locall;
}
}
/* Location:
* Qualified Name: com.facebook.l
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | 489 | 0.619632 | 0.597137 | 29 | 15.896552 | 15.313606 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.448276 | false | false | 3 |
fc0d691230738b7f244d87f5ec0d53ef4c3e94d2 | 7,962,869,410,930 | 56bd40bfe8e71a366a0389bbe4511be05a5ab299 | /src/main/java/com/cloisters/market/amazon/MarketAmazonInventoryController.java | c89416170703494214927da288b5e53046a4ab91 | [] | no_license | besthomefashion/cloisters | https://github.com/besthomefashion/cloisters | c09f5abc4af51ad22cb46daafdae47e5cda422ac | 4ac7d9411e975b1d4990c96a38393c594d70aa55 | refs/heads/master | 2018-02-09T19:19:16.396000 | 2017-10-01T14:23:08 | 2017-10-01T14:23:08 | 96,553,002 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cloisters.market.amazon;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import lombok.extern.slf4j.Slf4j;
@RestController
@Slf4j
public class MarketAmazonInventoryController {
@Autowired
private MarketAmazonInventoryService marketAmazonInventoryService;
@RequestMapping(value = "/AMAZON/inventory/{marketCd}/{issueDate}", method = GET)
@ResponseStatus(HttpStatus.OK)
public ResponseEntity getInventories(@PathVariable String marketCd, @PathVariable String issueDate, @RequestParam("inventoryFileName") String exclusionFileName) {
log.debug("getInventories {} {} {} {}", "start", marketCd, issueDate, exclusionFileName);
List<MarketAmazonInventoryDto.Inventory> inventories = marketAmazonInventoryService.getInventories(marketCd, exclusionFileName);
return new ResponseEntity<>(inventories, HttpStatus.OK);
}
}
| UTF-8 | Java | 1,392 | java | MarketAmazonInventoryController.java | Java | [] | null | [] | package com.cloisters.market.amazon;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import lombok.extern.slf4j.Slf4j;
@RestController
@Slf4j
public class MarketAmazonInventoryController {
@Autowired
private MarketAmazonInventoryService marketAmazonInventoryService;
@RequestMapping(value = "/AMAZON/inventory/{marketCd}/{issueDate}", method = GET)
@ResponseStatus(HttpStatus.OK)
public ResponseEntity getInventories(@PathVariable String marketCd, @PathVariable String issueDate, @RequestParam("inventoryFileName") String exclusionFileName) {
log.debug("getInventories {} {} {} {}", "start", marketCd, issueDate, exclusionFileName);
List<MarketAmazonInventoryDto.Inventory> inventories = marketAmazonInventoryService.getInventories(marketCd, exclusionFileName);
return new ResponseEntity<>(inventories, HttpStatus.OK);
}
}
| 1,392 | 0.808908 | 0.806753 | 34 | 38.941177 | 39.452087 | 163 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.088235 | false | false | 3 |
dbca7adea696d3936396bb74d97563ad973bc31f | 5,884,105,231,270 | 949e8e27422c214ff047acd5c77b81e0bd4e1184 | /CODEKATA/Player level/ascending till Kth and descending after Kth index(bitonic).java | 2dd3e1bd33ee15f7f4fda2a8717b031318903b7e | [] | no_license | purushothaman1998/C-Programming | https://github.com/purushothaman1998/C-Programming | 2a55cdca5544bfc9322673e4a1f151b5a0b9da4e | cd361f282694066d9ff4e48e480e5f2153d59124 | refs/heads/master | 2020-04-26T04:34:13.218000 | 2018-07-13T16:34:55 | 2018-07-13T16:34:55 | 173,306,391 | 0 | 0 | null | true | 2019-03-01T13:27:19 | 2019-03-01T13:27:19 | 2018-07-13T16:34:58 | 2018-07-13T16:34:56 | 461 | 0 | 0 | 0 | null | false | null | import java.util.Scanner;
public class Bitonicarray {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int a[]=new int[n];
int temp=0;
int p=sc.nextInt();
for(int i=0;i<n;i++)
{
a[i]=sc.nextInt();
}
for(int j=0;j<p;j++)
{
for(int k=j+1;k<p;k++)
{
if(a[j]>a[k])
{
temp=a[j];
a[j]=a[k];
a[k]=temp;
}
}System.out.print(a[j]+" ");
}
for(int j=p;j<n;j++)
{
for(int k=j+1;k<n;k++)
{
if(a[j]<a[k])
{
temp=a[j];
a[j]=a[k];
a[k]=temp;
}
}System.out.print(a[j]+" ");
}
sc.close();
}
}
| UTF-8 | Java | 637 | java | ascending till Kth and descending after Kth index(bitonic).java | Java | [] | null | [] | import java.util.Scanner;
public class Bitonicarray {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int a[]=new int[n];
int temp=0;
int p=sc.nextInt();
for(int i=0;i<n;i++)
{
a[i]=sc.nextInt();
}
for(int j=0;j<p;j++)
{
for(int k=j+1;k<p;k++)
{
if(a[j]>a[k])
{
temp=a[j];
a[j]=a[k];
a[k]=temp;
}
}System.out.print(a[j]+" ");
}
for(int j=p;j<n;j++)
{
for(int k=j+1;k<n;k++)
{
if(a[j]<a[k])
{
temp=a[j];
a[j]=a[k];
a[k]=temp;
}
}System.out.print(a[j]+" ");
}
sc.close();
}
}
| 637 | 0.466248 | 0.458399 | 42 | 14.166667 | 10.783401 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.285714 | false | false | 3 |
1294bdb7c4776f8ed7ee74192a6ab568e857db71 | 23,682,449,716,860 | 149b7bc525cb70515342e855e89822b62876372e | /FileManager/src/ar/unlam/edu/filemanager/FileManager.java | 0dfa203ee9ef9297a897f2b4d64e22d9ecd0d60c | [] | no_license | mcortex/prog-avanzada | https://github.com/mcortex/prog-avanzada | 1857922312d822fe97e63027f6473232a663e6d6 | b547d5e22cafe41fa219717f20b581cb109bbac0 | refs/heads/master | 2021-01-19T00:03:42.472000 | 2017-07-15T17:24:44 | 2017-07-15T17:24:44 | 87,141,151 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ar.unlam.edu.filemanager;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.Scanner;
public class FileManager {
public static void main(String[] args) {
//SCANNER: Lectura de archivos
String path = "C:\\Users\\Martin\\Documents\\UNLAM\\PrograAvanzada\\Lotes\\PruebaArchivos\\";
File archivo = new File(path+"archivo.in");
// int valor=0;
try {
Scanner scan = new Scanner(archivo);
scan.useLocale(Locale.ENGLISH);
int [] vector = new int[scan.nextInt()];
// while(scan.hasNextInt()){
// valor=scan.nextInt();
// System.out.println("Numero: "+valor);
// cantIn++;
// }
for (int i=0;i<vector.length;i++){
vector[i]=scan.nextInt();
System.out.println("Valor "+i+": "+vector[i]);
}
scan.close();
//PRINT WRITER: Escritura de archivo
try {
FileWriter writer = new FileWriter(path+"archivo.out");
PrintWriter printer = new PrintWriter(writer);
printer.println("Cantidad de valores en el archivo de entrada: "+vector.length);
for (int i=0;i<vector.length;i++){
printer.println(vector[i]);
}
printer.close();
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
| UTF-8 | Java | 1,409 | java | FileManager.java | Java | [
{
"context": ": Lectura de archivos\n\t\tString path = \"C:\\\\Users\\\\Martin\\\\Documents\\\\UNLAM\\\\PrograAvanzada\\\\Lotes\\\\PruebaA",
"end": 366,
"score": 0.9995059967041016,
"start": 360,
"tag": "NAME",
"value": "Martin"
}
] | null | [] | package ar.unlam.edu.filemanager;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.Scanner;
public class FileManager {
public static void main(String[] args) {
//SCANNER: Lectura de archivos
String path = "C:\\Users\\Martin\\Documents\\UNLAM\\PrograAvanzada\\Lotes\\PruebaArchivos\\";
File archivo = new File(path+"archivo.in");
// int valor=0;
try {
Scanner scan = new Scanner(archivo);
scan.useLocale(Locale.ENGLISH);
int [] vector = new int[scan.nextInt()];
// while(scan.hasNextInt()){
// valor=scan.nextInt();
// System.out.println("Numero: "+valor);
// cantIn++;
// }
for (int i=0;i<vector.length;i++){
vector[i]=scan.nextInt();
System.out.println("Valor "+i+": "+vector[i]);
}
scan.close();
//PRINT WRITER: Escritura de archivo
try {
FileWriter writer = new FileWriter(path+"archivo.out");
PrintWriter printer = new PrintWriter(writer);
printer.println("Cantidad de valores en el archivo de entrada: "+vector.length);
for (int i=0;i<vector.length;i++){
printer.println(vector[i]);
}
printer.close();
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
| 1,409 | 0.643719 | 0.64159 | 61 | 22.09836 | 20.386194 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.885246 | false | false | 3 |
3716ce3fddeca6156cf4324bd2537a54d5b872c4 | 32,341,103,800,534 | b685a1798ec9a83ee3abb14ca47f050443a7f51c | /Main Task/RandomNumbers/src/reptilion/empire/com/RandomNumbers.java | f5a2e7afba33c40bb6a7b61fddda5dbf521ae9bc | [] | no_license | AliaksandrHospad/Java.-Fundamentals | https://github.com/AliaksandrHospad/Java.-Fundamentals | 31be467ce0731fc94015ffe7ddf5cdd209520a60 | 9607de9b4a22924642517687187560a1e54ca2a4 | refs/heads/main | 2023-05-05T13:35:20.848000 | 2021-05-31T07:48:17 | 2021-05-31T07:48:17 | 372,418,299 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package reptilion.empire.com;
import java.util.Scanner;
public class RandomNumbers {
public static void main(String[] args) {
Scanner enterNumberOfRandomNumbers = new Scanner(System.in);
System.out.println("Enter the number of random numbers");
int numberOfRandomNumbers = enterNumberOfRandomNumbers.nextInt();
int i = 0;
while (i < numberOfRandomNumbers){
i++;
System.out.print(" " + (int) (Math.random()*10));
}
}
}
| UTF-8 | Java | 499 | java | RandomNumbers.java | Java | [] | null | [] | package reptilion.empire.com;
import java.util.Scanner;
public class RandomNumbers {
public static void main(String[] args) {
Scanner enterNumberOfRandomNumbers = new Scanner(System.in);
System.out.println("Enter the number of random numbers");
int numberOfRandomNumbers = enterNumberOfRandomNumbers.nextInt();
int i = 0;
while (i < numberOfRandomNumbers){
i++;
System.out.print(" " + (int) (Math.random()*10));
}
}
}
| 499 | 0.631263 | 0.625251 | 15 | 32.266666 | 24.384331 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.533333 | false | false | 3 |
b65baf1d3bf78d996a8259884776b225386aa656 | 9,122,510,575,240 | 0e7eaa12d648fb34213cc7e5e2f41d6e1be63f29 | /yydb/src/util/PictureUpload.java | 0457dc7b88b84f59b7661c16680f1eeba090c516 | [] | no_license | shuangyutanxianjia/bysj | https://github.com/shuangyutanxianjia/bysj | 2eb2e11462eb0361fd0a706c1c8a6240ab896266 | 15ddf3d99b578c0cae53d0c48652c02819f62a3e | refs/heads/master | 2021-01-13T07:19:19.745000 | 2017-03-30T09:29:49 | 2017-03-30T09:29:49 | 71,552,474 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.struts2.ServletActionContext;
public class PictureUpload {
public static File uploadpic(String Url,File file) throws IOException{
InputStream is = new FileInputStream(file);
String uploadPath = ServletActionContext.getServletContext()
.getRealPath("/upload/"+Url);
File f = new File(uploadPath);
// 如果路径不存在,则创建
if (!f.getParentFile().exists()) {
f.getParentFile().mkdirs();
}
try {
f.createNewFile();
OutputStream os = new FileOutputStream(f);
byte[] buffer = new byte[1024];
int length = 0;
while ((length = is.read(buffer)) > 0) {
os.write(buffer, 0, length);
}
is.close();
os.close();
} catch (Exception e) {
System.out.println(e);
}
return f;
}
}
| UTF-8 | Java | 1,246 | java | PictureUpload.java | Java | [] | null | [] | package util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.struts2.ServletActionContext;
public class PictureUpload {
public static File uploadpic(String Url,File file) throws IOException{
InputStream is = new FileInputStream(file);
String uploadPath = ServletActionContext.getServletContext()
.getRealPath("/upload/"+Url);
File f = new File(uploadPath);
// 如果路径不存在,则创建
if (!f.getParentFile().exists()) {
f.getParentFile().mkdirs();
}
try {
f.createNewFile();
OutputStream os = new FileOutputStream(f);
byte[] buffer = new byte[1024];
int length = 0;
while ((length = is.read(buffer)) > 0) {
os.write(buffer, 0, length);
}
is.close();
os.close();
} catch (Exception e) {
System.out.println(e);
}
return f;
}
}
| 1,246 | 0.547308 | 0.540783 | 49 | 24.020409 | 18.361994 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.081633 | false | false | 3 |
289d97aefcaea78f58a84b69d01a221ae1498cb6 | 12,902,081,768,498 | d60bd07bd1cf607b14f6abee0e279546145c5215 | /src/main/java/com/weaveown/design/structural/proxy/custom/Meipo.java | 8812632215f02828e279250f151cd83ccd5199fc | [] | no_license | WeaveOwn/gojava | https://github.com/WeaveOwn/gojava | 57a298cfeff6721ea98ce10049c43caa23d7e28e | 31af3646721933f55c564c6bebb8180143a1cd01 | refs/heads/master | 2022-07-04T17:09:51.360000 | 2021-10-21T01:12:14 | 2021-10-21T01:12:14 | 253,663,759 | 1 | 0 | null | false | 2021-03-31T22:01:40 | 2020-04-07T02:11:21 | 2021-03-31T05:56:15 | 2021-03-31T22:01:40 | 131 | 0 | 0 | 3 | Java | false | false | package com.weaveown.design.structural.proxy.custom;
import java.lang.reflect.Method;
/**
* @author wangwei
* @date 2021/2/22
*/
public class Meipo implements WInvocationHandler {
private Person person;
public Object getObject(Person person) {
this.person = person;
Class<?> clazz = this.person.getClass();
return WProxy.newProxyInstance(new WClassLoader(), clazz.getInterfaces(), this);
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
System.out.println("mei po start");
return method.invoke(this.person, null);
}
}
| UTF-8 | Java | 638 | java | Meipo.java | Java | [
{
"context": "\n\nimport java.lang.reflect.Method;\n\n/**\n * @author wangwei\n * @date 2021/2/22\n */\npublic class Meipo impleme",
"end": 110,
"score": 0.9993540644645691,
"start": 103,
"tag": "USERNAME",
"value": "wangwei"
}
] | null | [] | package com.weaveown.design.structural.proxy.custom;
import java.lang.reflect.Method;
/**
* @author wangwei
* @date 2021/2/22
*/
public class Meipo implements WInvocationHandler {
private Person person;
public Object getObject(Person person) {
this.person = person;
Class<?> clazz = this.person.getClass();
return WProxy.newProxyInstance(new WClassLoader(), clazz.getInterfaces(), this);
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
System.out.println("mei po start");
return method.invoke(this.person, null);
}
}
| 638 | 0.678683 | 0.667712 | 25 | 24.52 | 26.310637 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.52 | false | false | 3 |
116c14459061c7dbb7cdbfc65d12b2a640fe6354 | 14,216,341,768,897 | 266fdd233c45a09c1ac103a6c22bc65d8fa08093 | /src/org/euler/main/Problem68.java | b713aefb2e71ce06a0c9c80850f5744c06e417e1 | [] | no_license | LewFew/ProjectC | https://github.com/LewFew/ProjectC | 7278fdda74720e99e47bd253ea120db3aad62fdd | 423ac6b42f0ad51f8271b6c12ef7581e6ef134b7 | refs/heads/master | 2021-07-08T11:07:38.962000 | 2020-08-30T17:37:42 | 2020-08-30T17:37:42 | 172,819,327 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.euler.main;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import org.euler.common.Common;
public class Problem68 {
//Note: The problem forbids 17-digit representations.
//So the 10 must belong to the "orbit".
public static BigInteger magic_ngon(int n) {
ArrayList<Integer> pool = new ArrayList<Integer>();
for (int i = 1; i <= 2*n; i++) {
pool.add(i);
}
BigInteger[] max = {BigInteger.ZERO};
int[] base_ring = new int[n];
magic_ngonhelper(n, pool, base_ring, max);
return max[0];
}
public static HashSet<int[]> form_orbits(int n, ArrayList<Integer> pool, int[] ring) {
HashSet<int[]> ret = new HashSet<int[]>();
HashSet<Integer> pool_set = Common.to_set(pool);
int[] difference = new int[n];
int[] sorted_difference;
for (int i = 0; i < n; i++) {
difference[i] = (ring[0] + ring[1]) - (ring[i] + ring[(i+1)%n]);
}
sorted_difference = Arrays.copyOf(difference, n);
Arrays.sort(sorted_difference);
for (int i = 0; i < n-1; i++) {
if (sorted_difference[i] == sorted_difference[i+1]) {
return ret;
}
}
for (int i : pool_set) {
int[] candidate_orbit = new int[n];
boolean add = true;
for (int j = 0; j < difference.length; j++) {
if (pool_set.contains(difference[j] + i)) {
candidate_orbit[j] = difference[j] + i;
} else {
add = false;
}
}
if (add) {
ret.add(candidate_orbit);
}
}
return ret;
}
public static void magic_ngonhelper(int n, ArrayList<Integer> pool, int[] ring, BigInteger[] max) {
if (pool.size() == n) {
HashSet<int[]> orbit_set = form_orbits(n, pool, ring);
for (int[] orbit : orbit_set) {
int orbit_min_index = Common.min_array_index(orbit);
int[] orbit_shift = Arrays.copyOf(orbit, n);
int[] ring_shift = Arrays.copyOf(ring, n);
String representation = "";
for (int i = 0; i < n; i++) {
orbit_shift[i] = orbit[(i+orbit_min_index) % n];
ring_shift[i] = ring[(i+orbit_min_index) % n];
}
for (int i = 0; i < n; i++) {
representation += String.valueOf(orbit_shift[i]) + String.valueOf(ring_shift[i]) + String.valueOf(ring_shift[(i+1)%n]);
}
BigInteger candidate = new BigInteger(representation);
max[0] = (candidate.compareTo(max[0]) == 1) ? candidate : max[0];
}
} else {
for (int i = 0; i < pool.size(); i++) {
if (pool.get(i) == 2 * n) { continue; }
ArrayList<Integer> new_pool = new ArrayList<Integer>();
int[] new_ring = Arrays.copyOf(ring, n);
new_ring[2*n - pool.size()] = pool.get(i);
for (int j = 0; j < pool.size(); j++) {
if (i != j) {
new_pool.add(pool.get(j));
}
}
magic_ngonhelper(n, new_pool, new_ring, max);
}
}
}
public static void main(String[] args) {
long last_time = System.nanoTime();
//----------------
System.out.println(magic_ngon(5));
//----------------
long now = System.nanoTime();
System.out.println("Computed in " + (double) (now - last_time) / 1000000 + " milleseconds.");
}
}
| UTF-8 | Java | 3,045 | java | Problem68.java | Java | [] | null | [] | package org.euler.main;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import org.euler.common.Common;
public class Problem68 {
//Note: The problem forbids 17-digit representations.
//So the 10 must belong to the "orbit".
public static BigInteger magic_ngon(int n) {
ArrayList<Integer> pool = new ArrayList<Integer>();
for (int i = 1; i <= 2*n; i++) {
pool.add(i);
}
BigInteger[] max = {BigInteger.ZERO};
int[] base_ring = new int[n];
magic_ngonhelper(n, pool, base_ring, max);
return max[0];
}
public static HashSet<int[]> form_orbits(int n, ArrayList<Integer> pool, int[] ring) {
HashSet<int[]> ret = new HashSet<int[]>();
HashSet<Integer> pool_set = Common.to_set(pool);
int[] difference = new int[n];
int[] sorted_difference;
for (int i = 0; i < n; i++) {
difference[i] = (ring[0] + ring[1]) - (ring[i] + ring[(i+1)%n]);
}
sorted_difference = Arrays.copyOf(difference, n);
Arrays.sort(sorted_difference);
for (int i = 0; i < n-1; i++) {
if (sorted_difference[i] == sorted_difference[i+1]) {
return ret;
}
}
for (int i : pool_set) {
int[] candidate_orbit = new int[n];
boolean add = true;
for (int j = 0; j < difference.length; j++) {
if (pool_set.contains(difference[j] + i)) {
candidate_orbit[j] = difference[j] + i;
} else {
add = false;
}
}
if (add) {
ret.add(candidate_orbit);
}
}
return ret;
}
public static void magic_ngonhelper(int n, ArrayList<Integer> pool, int[] ring, BigInteger[] max) {
if (pool.size() == n) {
HashSet<int[]> orbit_set = form_orbits(n, pool, ring);
for (int[] orbit : orbit_set) {
int orbit_min_index = Common.min_array_index(orbit);
int[] orbit_shift = Arrays.copyOf(orbit, n);
int[] ring_shift = Arrays.copyOf(ring, n);
String representation = "";
for (int i = 0; i < n; i++) {
orbit_shift[i] = orbit[(i+orbit_min_index) % n];
ring_shift[i] = ring[(i+orbit_min_index) % n];
}
for (int i = 0; i < n; i++) {
representation += String.valueOf(orbit_shift[i]) + String.valueOf(ring_shift[i]) + String.valueOf(ring_shift[(i+1)%n]);
}
BigInteger candidate = new BigInteger(representation);
max[0] = (candidate.compareTo(max[0]) == 1) ? candidate : max[0];
}
} else {
for (int i = 0; i < pool.size(); i++) {
if (pool.get(i) == 2 * n) { continue; }
ArrayList<Integer> new_pool = new ArrayList<Integer>();
int[] new_ring = Arrays.copyOf(ring, n);
new_ring[2*n - pool.size()] = pool.get(i);
for (int j = 0; j < pool.size(); j++) {
if (i != j) {
new_pool.add(pool.get(j));
}
}
magic_ngonhelper(n, new_pool, new_ring, max);
}
}
}
public static void main(String[] args) {
long last_time = System.nanoTime();
//----------------
System.out.println(magic_ngon(5));
//----------------
long now = System.nanoTime();
System.out.println("Computed in " + (double) (now - last_time) / 1000000 + " milleseconds.");
}
}
| 3,045 | 0.592447 | 0.580624 | 101 | 29.148516 | 24.215364 | 124 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.207921 | false | false | 3 |
30a756fa309c5877d1d6f4ba3079a85b489eaf12 | 1,494,648,638,657 | 4cc44e24d9ae1060f0a85fe68e23eb775ddb6ce0 | /colab-api/src/main/java/ch/colabproject/colab/api/service/smtp/Sendmail.java | 6090e4b757076d10a44df9c849e8f15d1e865cbf | [
"MIT"
] | permissive | IamFonky/colab | https://github.com/IamFonky/colab | 541f691c940657e09d9c10df33d03c66218654a2 | 02d775d263e4ee8a49b21ac586bc4b0a824167fc | refs/heads/main | 2023-03-28T03:39:56.338000 | 2021-03-24T16:37:25 | 2021-03-24T16:37:25 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* The coLAB project
* Copyright (C) 2021 AlbaSim, MEI, HEIG-VD, HES-SO
*
* Licensed under the MIT License
*/
package ch.colabproject.colab.api.service.smtp;
import ch.colabproject.colab.api.setup.ColabConfiguration;
import ch.colabproject.colab.generator.model.exceptions.HttpErrorMessage;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import javax.mail.Address;
import javax.mail.Authenticator;
import javax.mail.Message.RecipientType;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
/**
* Helper to send e-mails.
*
* @author maxence
*/
public class Sendmail {
/**
* never-called private constructor
*/
private Sendmail() {
throw new UnsupportedOperationException(
"This is a utility class and cannot be instantiated");
}
/**
* Send mail
*
* @param message the message to sent
*
* @throws HttpErrorMessage malformedMessage if supplied values are erroneous
* @throws javax.mail.MessagingException when something went wrong
*/
public static void send(Message message) throws MessagingException {
Properties props = new Properties();
final String username = ColabConfiguration.getSmtpUsername();
final String password = ColabConfiguration.getSmtpPassword();
final String host = ColabConfiguration.getSmtpHost();
final String port = ColabConfiguration.getSmtpPort();
props.put("mail.smtp.host", host);
props.setProperty("mail.smtp.auth", ColabConfiguration.getSmtpAuth());
props.put("mail.smtp.port", port);
if (ColabConfiguration.getSmtpStartTls().equals("true")) {
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.ssl.trust", host);
} else {
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.port", port);
props.put("mail.smtp.ssl.trust", host);
}
Session session = Session.getInstance(props, new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
MimeMessage msg = new MimeMessage(session);
try {
msg.setFrom(new InternetAddress(message.getFrom()));
Address[] to = convert(message.getTo());
Address[] cc = convert(message.getCc());
Address[] bcc = convert(message.getBcc());
msg.setRecipients(RecipientType.TO, to);
msg.setRecipients(RecipientType.CC, cc);
msg.setRecipients(RecipientType.BCC, bcc);
if (message.getReplyTo() != null) {
msg.setReplyTo(InternetAddress.parse(message.getReplyTo()));
}
String subject = message.getSubject().replaceAll("[\n\r]", " ");
msg.setSubject(subject);
msg.setContent(message.getBody(), message.getMimeType());
msg.setSentDate(new Date());
} catch (AddressException ex) {
throw HttpErrorMessage.emailMessageError();
}
Transport.send(msg);
}
private static Address[] convert(List<String> addresses) throws AddressException {
List<Address> list = new ArrayList<>();
for (String address : addresses) {
InternetAddress[] parsed = InternetAddress.parse(address);
list.addAll(Arrays.asList(parsed));
}
return list.toArray(new Address[list.size()]);
}
}
| UTF-8 | Java | 3,901 | java | Sendmail.java | Java | [
{
"context": "/*\n * The coLAB project\n * Copyright (C) 2021 AlbaSim, MEI, HEIG-VD, HES-SO\n *\n * Licensed under the MI",
"end": 53,
"score": 0.9948626160621643,
"start": 46,
"tag": "NAME",
"value": "AlbaSim"
},
{
"context": "age;\n\n/**\n * Helper to send e-mails.\n *\n * @author maxence\n */\npublic class Sendmail {\n\n /**\n * never",
"end": 846,
"score": 0.8685584664344788,
"start": 839,
"tag": "USERNAME",
"value": "maxence"
}
] | null | [] | /*
* The coLAB project
* Copyright (C) 2021 AlbaSim, MEI, HEIG-VD, HES-SO
*
* Licensed under the MIT License
*/
package ch.colabproject.colab.api.service.smtp;
import ch.colabproject.colab.api.setup.ColabConfiguration;
import ch.colabproject.colab.generator.model.exceptions.HttpErrorMessage;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import javax.mail.Address;
import javax.mail.Authenticator;
import javax.mail.Message.RecipientType;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
/**
* Helper to send e-mails.
*
* @author maxence
*/
public class Sendmail {
/**
* never-called private constructor
*/
private Sendmail() {
throw new UnsupportedOperationException(
"This is a utility class and cannot be instantiated");
}
/**
* Send mail
*
* @param message the message to sent
*
* @throws HttpErrorMessage malformedMessage if supplied values are erroneous
* @throws javax.mail.MessagingException when something went wrong
*/
public static void send(Message message) throws MessagingException {
Properties props = new Properties();
final String username = ColabConfiguration.getSmtpUsername();
final String password = ColabConfiguration.getSmtpPassword();
final String host = ColabConfiguration.getSmtpHost();
final String port = ColabConfiguration.getSmtpPort();
props.put("mail.smtp.host", host);
props.setProperty("mail.smtp.auth", ColabConfiguration.getSmtpAuth());
props.put("mail.smtp.port", port);
if (ColabConfiguration.getSmtpStartTls().equals("true")) {
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.ssl.trust", host);
} else {
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.port", port);
props.put("mail.smtp.ssl.trust", host);
}
Session session = Session.getInstance(props, new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
MimeMessage msg = new MimeMessage(session);
try {
msg.setFrom(new InternetAddress(message.getFrom()));
Address[] to = convert(message.getTo());
Address[] cc = convert(message.getCc());
Address[] bcc = convert(message.getBcc());
msg.setRecipients(RecipientType.TO, to);
msg.setRecipients(RecipientType.CC, cc);
msg.setRecipients(RecipientType.BCC, bcc);
if (message.getReplyTo() != null) {
msg.setReplyTo(InternetAddress.parse(message.getReplyTo()));
}
String subject = message.getSubject().replaceAll("[\n\r]", " ");
msg.setSubject(subject);
msg.setContent(message.getBody(), message.getMimeType());
msg.setSentDate(new Date());
} catch (AddressException ex) {
throw HttpErrorMessage.emailMessageError();
}
Transport.send(msg);
}
private static Address[] convert(List<String> addresses) throws AddressException {
List<Address> list = new ArrayList<>();
for (String address : addresses) {
InternetAddress[] parsed = InternetAddress.parse(address);
list.addAll(Arrays.asList(parsed));
}
return list.toArray(new Address[list.size()]);
}
}
| 3,901 | 0.650346 | 0.649321 | 116 | 32.629311 | 26.42182 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.612069 | false | false | 3 |
a46e7c083e6520d3472517614c3be15f0636c5e3 | 3,607,772,591,608 | a14b940ec3e19ea071d3a9c406bb9e273a278588 | /src/main/java/evo/fruitcraft/foods/FCFCuttedOrange.java | 375307450bc95e0b30ebd28cdb4a457d6305dfab | [] | no_license | Hisui-Ryuto/FruitCraft | https://github.com/Hisui-Ryuto/FruitCraft | 5f2c69b591811d4d53a4223cae476ee31f5d51e8 | 673882c55c33a946ee869580791a6ed870c0157e | refs/heads/master | 2021-01-10T17:49:04.413000 | 2015-11-05T11:57:08 | 2015-11-05T11:57:08 | 45,606,910 | 0 | 0 | null | false | 2015-11-05T11:57:09 | 2015-11-05T11:23:58 | 2015-11-05T11:23:58 | 2015-11-05T11:57:08 | 0 | 0 | 0 | 0 | null | null | null | package evo.fruitcraft.foods;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import evo.fruitcraft.FruitCraftCore;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
public class FCFCuttedOrange{
public FCFCuttedOrange(){}
public static Item FCFCuttedOrange;
@EventHandler
public void perInit(FMLPreInitializationEvent event) {
FCFCuttedOrange = new ItemFood(1, 0.6F, false)
.setCreativeTab(FruitCraftCore.FCTTabFruitCraft)
.setUnlocalizedName("FCFCuttedOrange")
.setTextureName("fruitcraft:cutted_orange");
GameRegistry.registerItem(FCFCuttedOrange, "FCFCuttedOrange");
}
} | UTF-8 | Java | 722 | java | FCFCuttedOrange.java | Java | [] | null | [] | package evo.fruitcraft.foods;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import evo.fruitcraft.FruitCraftCore;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
public class FCFCuttedOrange{
public FCFCuttedOrange(){}
public static Item FCFCuttedOrange;
@EventHandler
public void perInit(FMLPreInitializationEvent event) {
FCFCuttedOrange = new ItemFood(1, 0.6F, false)
.setCreativeTab(FruitCraftCore.FCTTabFruitCraft)
.setUnlocalizedName("FCFCuttedOrange")
.setTextureName("fruitcraft:cutted_orange");
GameRegistry.registerItem(FCFCuttedOrange, "FCFCuttedOrange");
}
} | 722 | 0.808864 | 0.804709 | 21 | 33.42857 | 19.379841 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.619048 | false | false | 3 |
a068393bf0069e234ba615a81e8c7c72246b45ec | 25,151,328,496,907 | ed51459588a3b8fbb053345ed7b3ab7b2257788f | /src/main/java/com/spirit/porker/vo/request/RegistRequest.java | a83a4ccc40fc9a90c46ebecda99dfa8b5a88b62b | [] | no_license | ziyang783282949/transferzy | https://github.com/ziyang783282949/transferzy | e320e4a19b23823e7fbce4b664af58845a8d8d6b | 0e84a762b144e375921d58e13235e85e00113ffc | refs/heads/master | 2021-01-18T17:37:59.606000 | 2017-08-22T15:54:00 | 2017-08-22T15:54:00 | 100,492,957 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.spirit.porker.vo.request;
public class RegistRequest {
}
| UTF-8 | Java | 76 | java | RegistRequest.java | Java | [] | null | [] | package com.spirit.porker.vo.request;
public class RegistRequest {
}
| 76 | 0.723684 | 0.723684 | 5 | 13.2 | 16.01749 | 37 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false | 3 |
1604d849d8db3730e489af680edd9a5cdd97962c | 5,394,478,976,287 | b2b107075419fed69d225221a0c372573fe5bc2c | /Airline Project/Airline/src/org/airline/c/RouteMapper.java | 74081ceb702783def70f4f766ea7d17f2cad079b | [] | no_license | bthapa4791/BigDataProject | https://github.com/bthapa4791/BigDataProject | 55214a2e083885037051fd6144a656e9d0d25473 | 978296cfea7455d8139350b49141b4cdeed79f54 | refs/heads/master | 2021-05-07T00:58:04.282000 | 2017-11-11T01:54:18 | 2017-11-11T01:54:18 | 110,308,020 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.airline.c;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.airline.utility.RouteConstant;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Mapper.Context;
import org.apache.hadoop.mapreduce.filecache.DistributedCache;
public class RouteMapper extends Mapper<LongWritable, Text, Text, Text>{
Path[] catchfiles = new Path[0];
List<String> airlineMap = new ArrayList();
public void setup(Context context) throws IOException, InterruptedException {
Configuration conf = context.getConfiguration();
try {
catchfiles = DistributedCache.getLocalCacheFiles(conf);
BufferedReader reader = new BufferedReader(new FileReader(catchfiles[0].toString()));
String strRead;
while ((strRead = reader.readLine())!= null)
{
airlineMap.add(strRead);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch(IOException e) {
e.printStackTrace();
}
}
protected void map(LongWritable key, Text value, org.apache.hadoop.mapreduce.Mapper<LongWritable,Text,Text,Text>.Context context) throws IOException ,InterruptedException {
String[] parts = value.toString().split(",");
String codeShare = parts[RouteConstant.r_codeShare];
if (codeShare.equalsIgnoreCase("Y")) {
for (String a : airlineMap) {
String airline[] = a.toString().split(",");
String routeAId = parts[RouteConstant.r_airlineId];
if (routeAId.equals(airline[0])) {
context.write(new Text(airline[1]), new Text(""));
}
}
}
};
}
| UTF-8 | Java | 1,841 | java | RouteMapper.java | Java | [] | null | [] | package org.airline.c;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.airline.utility.RouteConstant;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Mapper.Context;
import org.apache.hadoop.mapreduce.filecache.DistributedCache;
public class RouteMapper extends Mapper<LongWritable, Text, Text, Text>{
Path[] catchfiles = new Path[0];
List<String> airlineMap = new ArrayList();
public void setup(Context context) throws IOException, InterruptedException {
Configuration conf = context.getConfiguration();
try {
catchfiles = DistributedCache.getLocalCacheFiles(conf);
BufferedReader reader = new BufferedReader(new FileReader(catchfiles[0].toString()));
String strRead;
while ((strRead = reader.readLine())!= null)
{
airlineMap.add(strRead);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch(IOException e) {
e.printStackTrace();
}
}
protected void map(LongWritable key, Text value, org.apache.hadoop.mapreduce.Mapper<LongWritable,Text,Text,Text>.Context context) throws IOException ,InterruptedException {
String[] parts = value.toString().split(",");
String codeShare = parts[RouteConstant.r_codeShare];
if (codeShare.equalsIgnoreCase("Y")) {
for (String a : airlineMap) {
String airline[] = a.toString().split(",");
String routeAId = parts[RouteConstant.r_airlineId];
if (routeAId.equals(airline[0])) {
context.write(new Text(airline[1]), new Text(""));
}
}
}
};
}
| 1,841 | 0.722433 | 0.720261 | 53 | 33.735847 | 29.105631 | 174 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.433962 | false | false | 3 |
ddf48fe8958cc1229a21150bab5d3a125021f949 | 25,580,825,280,115 | 96bc44508b223c0916b840bff36eae68fd220c53 | /gulimall-order/src/main/java/com/xiaoming/gulimall/order/service/OrderReturnApplyService.java | 72f7cf999557c2a39f5b25eab598929c9f6d748a | [
"Apache-2.0"
] | permissive | shixiaomingya/gulimall | https://github.com/shixiaomingya/gulimall | 249a12ffbc0c063cb8644f0e86f4911f8541939a | 476cd2130505f2422651eb38628ac830456e793a | refs/heads/master | 2022-08-09T07:20:39.101000 | 2020-04-04T05:51:43 | 2020-04-04T05:51:43 | 251,619,754 | 0 | 0 | Apache-2.0 | false | 2020-04-01T09:20:59 | 2020-03-31T14:00:57 | 2020-04-01T09:20:10 | 2020-04-01T09:20:57 | 10 | 0 | 0 | 3 | JavaScript | false | false | package com.xiaoming.gulimall.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaoming.common.utils.PageUtils;
import com.xiaoming.gulimall.order.entity.OrderReturnApplyEntity;
import java.util.Map;
/**
* 订单退货申请
*
* @author xiaoming
* @email shixiaomingye@gmail.com
* @date 2020-04-02 14:46:01
*/
public interface OrderReturnApplyService extends IService<OrderReturnApplyEntity> {
PageUtils queryPage(Map<String, Object> params);
}
| UTF-8 | Java | 497 | java | OrderReturnApplyService.java | Java | [
{
"context": "import java.util.Map;\n\n/**\n * 订单退货申请\n *\n * @author xiaoming\n * @email shixiaomingye@gmail.com\n * @date 2020-0",
"end": 276,
"score": 0.9955241680145264,
"start": 268,
"tag": "USERNAME",
"value": "xiaoming"
},
{
"context": "p;\n\n/**\n * 订单退货申请\n *\n * @author xiaoming\n * @email shixiaomingye@gmail.com\n * @date 2020-04-02 14:46:01\n */\npublic interface",
"end": 310,
"score": 0.9999288320541382,
"start": 287,
"tag": "EMAIL",
"value": "shixiaomingye@gmail.com"
}
] | null | [] | package com.xiaoming.gulimall.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaoming.common.utils.PageUtils;
import com.xiaoming.gulimall.order.entity.OrderReturnApplyEntity;
import java.util.Map;
/**
* 订单退货申请
*
* @author xiaoming
* @email <EMAIL>
* @date 2020-04-02 14:46:01
*/
public interface OrderReturnApplyService extends IService<OrderReturnApplyEntity> {
PageUtils queryPage(Map<String, Object> params);
}
| 481 | 0.783505 | 0.754639 | 19 | 24.473684 | 25.631741 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.368421 | false | false | 3 |
048d404834029b67f2d08066b8b902deda491941 | 18,193,481,524,457 | be2820def68033658919f57be046292f5f469dbf | /app/app/src/main/java/iedc_beast/yolo_reciever/HistoryActivity.java | 53d19a169bf5d3614c0d1696b1e9f7418539619e | [
"MIT"
] | permissive | sayansil/insight | https://github.com/sayansil/insight | 0cdcab9c516e7c747ab34a93902fbbb6ee7e08b2 | 90b27aaf7e8d5a9920a97b31c0d04858f62375ca | refs/heads/master | 2022-02-18T06:32:16.034000 | 2019-09-09T20:19:56 | 2019-09-09T20:19:56 | 154,862,830 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package iedc_beast.yolo_reciever;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.QueryDocumentSnapshot;
import com.google.firebase.firestore.QuerySnapshot;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
public class HistoryActivity extends AppCompatActivity {
private static final String TAG = "History";
private static String[] xItems = {"gun", "knife", "girl"};
private ListView listView;
private FirebaseAuth mAuth;
private FirebaseFirestore db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_history);
listView = findViewById(R.id.items_history);
ArrayList<Item> mlist = new ArrayList<>();
mAuth = FirebaseAuth.getInstance();
FirebaseUser currentUser = mAuth.getCurrentUser();
if (currentUser == null) {
goBackToLogin();
}
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat timeFormat = new SimpleDateFormat("hh:mm:ss");
String historyURL = "users/" + currentUser.getUid() + "/history";
db = FirebaseFirestore.getInstance();
db.collection(historyURL)
.get()
.addOnCompleteListener((@NonNull Task<QuerySnapshot> task) -> {
if (task.isSuccessful()) {
for (QueryDocumentSnapshot document : task.getResult()) {
ArrayList<Long> quantity = (ArrayList<Long>) document.get("quantity");
ArrayList<String> objects = (ArrayList<String>) document.get("objects");
Date timestamp = document.getTimestamp("timestamp").toDate();
String date = dateFormat.format(timestamp);
String time = timeFormat.format(timestamp);
for (int i=0; i<objects.size(); i++) {
String object = objects.get(i).trim().toLowerCase();
String qty = "Quantity: " + String.valueOf(quantity.get(i)).trim();
int tempImg = R.drawable.ok;
if (object.length() > 0)
for (String xItem: xItems) {
if (xItem.equalsIgnoreCase(object)) {
tempImg = R.drawable.cross;
}
}
mlist.add(new Item(
tempImg,
object,
qty,
date,
time
));
}
}
ItemAdapter mAdapter = new ItemAdapter(getApplicationContext(), mlist);
listView.setAdapter(mAdapter);
} else {
Log.w(TAG, "Error getting documents.", task.getException());
}
});
}
private void goBackToLogin() {
Intent intent = new Intent(HistoryActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
}
| UTF-8 | Java | 3,846 | java | HistoryActivity.java | Java | [] | null | [] | package iedc_beast.yolo_reciever;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.QueryDocumentSnapshot;
import com.google.firebase.firestore.QuerySnapshot;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
public class HistoryActivity extends AppCompatActivity {
private static final String TAG = "History";
private static String[] xItems = {"gun", "knife", "girl"};
private ListView listView;
private FirebaseAuth mAuth;
private FirebaseFirestore db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_history);
listView = findViewById(R.id.items_history);
ArrayList<Item> mlist = new ArrayList<>();
mAuth = FirebaseAuth.getInstance();
FirebaseUser currentUser = mAuth.getCurrentUser();
if (currentUser == null) {
goBackToLogin();
}
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat timeFormat = new SimpleDateFormat("hh:mm:ss");
String historyURL = "users/" + currentUser.getUid() + "/history";
db = FirebaseFirestore.getInstance();
db.collection(historyURL)
.get()
.addOnCompleteListener((@NonNull Task<QuerySnapshot> task) -> {
if (task.isSuccessful()) {
for (QueryDocumentSnapshot document : task.getResult()) {
ArrayList<Long> quantity = (ArrayList<Long>) document.get("quantity");
ArrayList<String> objects = (ArrayList<String>) document.get("objects");
Date timestamp = document.getTimestamp("timestamp").toDate();
String date = dateFormat.format(timestamp);
String time = timeFormat.format(timestamp);
for (int i=0; i<objects.size(); i++) {
String object = objects.get(i).trim().toLowerCase();
String qty = "Quantity: " + String.valueOf(quantity.get(i)).trim();
int tempImg = R.drawable.ok;
if (object.length() > 0)
for (String xItem: xItems) {
if (xItem.equalsIgnoreCase(object)) {
tempImg = R.drawable.cross;
}
}
mlist.add(new Item(
tempImg,
object,
qty,
date,
time
));
}
}
ItemAdapter mAdapter = new ItemAdapter(getApplicationContext(), mlist);
listView.setAdapter(mAdapter);
} else {
Log.w(TAG, "Error getting documents.", task.getException());
}
});
}
private void goBackToLogin() {
Intent intent = new Intent(HistoryActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
}
| 3,846 | 0.529641 | 0.529121 | 99 | 37.848484 | 28.077585 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.616162 | false | false | 3 |
8bfcc48e840313639050a61c0b82bd5c5c9a73f7 | 16,681,652,998,818 | 0e5d447f990bcd31d9701683f87852584f65539f | /laps-sprint1-final/src/main/java/com/tyss/javacloud/loanproject/validation/ValidationClass.java | af56b85ea88cc76bd0075b2926c485234deccd7e | [] | no_license | mayanksi191op/TY_CAPGEMINI_JAVACloud_10thFEB_MAYANK-SINGH | https://github.com/mayanksi191op/TY_CAPGEMINI_JAVACloud_10thFEB_MAYANK-SINGH | 1e276e56a973ea19cc52a8761b0a67482421e068 | 2511a328648b8f017fdcbfe46565a40ba6fe8f8e | refs/heads/master | 2021-01-30T04:50:17.607000 | 2020-06-25T14:26:50 | 2020-06-25T14:26:50 | 243,492,358 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.tyss.javacloud.loanproject.validation;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ValidationClass {
public boolean passValid(String pass) {
Pattern pattern = Pattern.compile("((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[$%_@]).{6,20})");
Matcher matcher = pattern.matcher(pass);
return matcher.matches();
}
public boolean dateValid(String date) {
return Pattern.matches("^[0-3]?[0-9]/[0-3]?[0-9]/(?:[0-9]{2})?[0-9]{2}$", date);
}
public boolean mailValid(String email) {
Pattern pattern = Pattern.compile("[a-zA-Z0-9]+(?:\\."+ "[a-zA-Z0-9_+&*-]+)*@" + "(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$");
Matcher matcher = pattern.matcher(email);
Boolean boolean2 = matcher.matches();
return boolean2;
}
public boolean usernameValid(String username) {
Pattern pattern = Pattern.compile("[a-zA-Z0-9]{5,15}");
Matcher matcher = pattern.matcher(username);
Boolean boolean1 = matcher.matches();
return boolean1;
}
public boolean alphaNumValid(String id) {
return Pattern.matches("[0-9a-zA-Z]*", id);
}
public boolean nameValid(String name) {
return Pattern.matches("[a-zA-Z]{3,10}", name);
}
public boolean fullNameValid(String name) {
return Pattern.matches("[a-z A-Z]{3,20}", name);
}
public boolean numMismatch(String num) {
return Pattern.matches("[0-9]*", num);
}
public boolean numMismatch1(String num) {
return Pattern.matches("^[0-9]{0,7}$", num);
}
public boolean timePeriodValid(String timeperiod) {
return Pattern.matches("^0*([1-9]|[1-3][0-9]|40)$", timeperiod);
}
public boolean doubleValid(String interest) {
return Pattern.matches("[0-9]*[.]?[0-9]*", interest);
}
public boolean phoneValid(String phone) {
return Pattern.matches("[6-9][0-9]{9,9}", phone);
}
}
| UTF-8 | Java | 1,786 | java | ValidationClass.java | Java | [] | null | [] | package com.tyss.javacloud.loanproject.validation;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ValidationClass {
public boolean passValid(String pass) {
Pattern pattern = Pattern.compile("((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[$%_@]).{6,20})");
Matcher matcher = pattern.matcher(pass);
return matcher.matches();
}
public boolean dateValid(String date) {
return Pattern.matches("^[0-3]?[0-9]/[0-3]?[0-9]/(?:[0-9]{2})?[0-9]{2}$", date);
}
public boolean mailValid(String email) {
Pattern pattern = Pattern.compile("[a-zA-Z0-9]+(?:\\."+ "[a-zA-Z0-9_+&*-]+)*@" + "(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$");
Matcher matcher = pattern.matcher(email);
Boolean boolean2 = matcher.matches();
return boolean2;
}
public boolean usernameValid(String username) {
Pattern pattern = Pattern.compile("[a-zA-Z0-9]{5,15}");
Matcher matcher = pattern.matcher(username);
Boolean boolean1 = matcher.matches();
return boolean1;
}
public boolean alphaNumValid(String id) {
return Pattern.matches("[0-9a-zA-Z]*", id);
}
public boolean nameValid(String name) {
return Pattern.matches("[a-zA-Z]{3,10}", name);
}
public boolean fullNameValid(String name) {
return Pattern.matches("[a-z A-Z]{3,20}", name);
}
public boolean numMismatch(String num) {
return Pattern.matches("[0-9]*", num);
}
public boolean numMismatch1(String num) {
return Pattern.matches("^[0-9]{0,7}$", num);
}
public boolean timePeriodValid(String timeperiod) {
return Pattern.matches("^0*([1-9]|[1-3][0-9]|40)$", timeperiod);
}
public boolean doubleValid(String interest) {
return Pattern.matches("[0-9]*[.]?[0-9]*", interest);
}
public boolean phoneValid(String phone) {
return Pattern.matches("[6-9][0-9]{9,9}", phone);
}
}
| 1,786 | 0.648376 | 0.610302 | 62 | 27.806452 | 26.656015 | 122 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.887097 | false | false | 3 |
fcec11050eab5aa98cb53c4803151030e7811205 | 11,725,260,782,411 | 2e474e4aa38772de4a55f04973eec573f6eb1984 | /app/src/main/java/com/example/madproject/shareactivity.java | 2162bc52aed467214691761e4c075893ec145181 | [] | no_license | KasunHewagama/madProject | https://github.com/KasunHewagama/madProject | f01be7668637fdb16afc7dce71a3132862b5c476 | cc3ce38a85ac56aa3a7b3ef1567067756e07ee51 | refs/heads/master | 2021-07-09T17:28:19.679000 | 2020-10-01T07:30:19 | 2020-10-01T07:30:19 | 200,346,065 | 3 | 0 | null | true | 2020-10-01T07:30:21 | 2019-08-03T07:27:16 | 2020-09-09T04:29:52 | 2020-10-01T07:30:20 | 123 | 2 | 0 | 0 | Java | false | false | package com.example.madproject;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import java.sql.DatabaseMetaData;
public class shareactivity extends AppCompatActivity {
EditText desc,title;
Button btnadd,btnclear;
DatabaseReference dbRef;
ComPost cmp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shareactivity);
title = findViewById(R.id.editText9);
desc = findViewById(R.id.editText16);
btnadd=findViewById(R.id.button13);
btnclear=findViewById(R.id.button);
cmp =new ComPost();
dbRef= FirebaseDatabase.getInstance().getReference().child("Post");
btnadd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
if (TextUtils.isEmpty(title.getText().toString()))
Toast.makeText(getApplicationContext(), "Please a title", Toast.LENGTH_SHORT).show();
else if (TextUtils.isEmpty(desc.getText().toString()))
Toast.makeText(getApplicationContext(),"Please enter a description",Toast.LENGTH_SHORT).show();
else {
cmp.setTitle(title.getText().toString().trim());
cmp.setDescription(desc.getText().toString().trim());
//dbRef.push().setValue(cmp);
dbRef.child(title.getText().toString()).setValue(cmp);
Toast.makeText(getApplicationContext(),"Data Saved Successfully",Toast.LENGTH_SHORT).show();
clearControls();
}
}
catch (NumberFormatException e){
Toast.makeText(getApplicationContext(),"Invalid Data Inserted",Toast.LENGTH_SHORT).show();
}
}
});
}
private void clearControls() {
title.setText("");
desc.setText("");
}
}
| UTF-8 | Java | 2,367 | java | shareactivity.java | Java | [] | null | [] | package com.example.madproject;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import java.sql.DatabaseMetaData;
public class shareactivity extends AppCompatActivity {
EditText desc,title;
Button btnadd,btnclear;
DatabaseReference dbRef;
ComPost cmp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shareactivity);
title = findViewById(R.id.editText9);
desc = findViewById(R.id.editText16);
btnadd=findViewById(R.id.button13);
btnclear=findViewById(R.id.button);
cmp =new ComPost();
dbRef= FirebaseDatabase.getInstance().getReference().child("Post");
btnadd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
if (TextUtils.isEmpty(title.getText().toString()))
Toast.makeText(getApplicationContext(), "Please a title", Toast.LENGTH_SHORT).show();
else if (TextUtils.isEmpty(desc.getText().toString()))
Toast.makeText(getApplicationContext(),"Please enter a description",Toast.LENGTH_SHORT).show();
else {
cmp.setTitle(title.getText().toString().trim());
cmp.setDescription(desc.getText().toString().trim());
//dbRef.push().setValue(cmp);
dbRef.child(title.getText().toString()).setValue(cmp);
Toast.makeText(getApplicationContext(),"Data Saved Successfully",Toast.LENGTH_SHORT).show();
clearControls();
}
}
catch (NumberFormatException e){
Toast.makeText(getApplicationContext(),"Invalid Data Inserted",Toast.LENGTH_SHORT).show();
}
}
});
}
private void clearControls() {
title.setText("");
desc.setText("");
}
}
| 2,367 | 0.607943 | 0.60583 | 73 | 31.424658 | 30.332369 | 119 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.616438 | false | false | 3 |
2639c8981f595a700bee680d459ff244bf06e94f | 20,830,591,447,776 | b55444c6626525bb30e905e9226152672476e1ac | /MyGraphicsLib/src/hr/fer/zemris/linearna/Vector.java | d035bd1fab1521ccb1a755609a328605cac75c9d | [] | no_license | vribic/irg | https://github.com/vribic/irg | ea0b938865f149f2a41eac7dbcc36eb42d8d0b5d | 99a42b138b39a01d90728cb4bb824e985607bb26 | refs/heads/master | 2020-03-16T19:57:36.330000 | 2018-11-07T09:02:26 | 2018-11-07T09:02:26 | 132,940,008 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package hr.fer.zemris.linearna;
/**
* N-dimensional vector model.
* @author Viran
*
*/
public class Vector extends AbstractVector {
protected double[] elements;
protected int dimension;
protected boolean readOnly;
/**
* Vector constructor from an array of elements.
* Default readOnly property is set to false.
* Given arraz is treated as object private.
* @param elements List of elements describing this vector.
*/
public Vector(double... elements) {
this.elements=elements;
dimension=elements.length;
readOnly=false;
}
/**
* Vector constructor.
* @param readOnly Flag for setting the readOnly property to this vector.
* @param useGivenArray Flag for setting the given array as the value source.
* @param elements Array of elements describing the vector.
*/
public Vector(boolean readOnly, boolean useGivenArray,double... elements) {
this.readOnly=readOnly;
if(useGivenArray)
this.elements=elements;
else
this.elements=elements.clone();
this.dimension=elements.length;
}
@Override
public double get(int dim) {
return elements[dim];
}
@Override
public IVector set(int dim, double val) {
if(!readOnly)
elements[dim]=val; //maybe add stderr message
return this;
}
@Override
public int getDimension() {
return dimension;
}
@Override
public IVector copy() {
if(readOnly)
return this.newInstance(dimension); //maybe add stderr message
Vector copy=new Vector(elements.clone());
copy.dimension=this.dimension;
copy.readOnly=false;
return copy;
}
@Override
public IVector newInstance(int i) {
if(i<0)
throw new IllegalArgumentException();
double[] array=new double[i];
return new Vector(array);
}
/**
* For the given input string return its vector representation.
* @param input Vector values.
*/
public static Vector parseSimple(String input) throws NumberFormatException{
String[] sValues=input.trim().split("\\s+");
double[] elements=new double[sValues.length];
for(int i=0;i<elements.length;i++)
elements[i]=Double.parseDouble(sValues[i]);
Vector vector=new Vector(elements);
return vector;
}
}
| UTF-8 | Java | 2,228 | java | Vector.java | Java | [
{
"context": "\n\r\n/**\r\n * N-dimensional vector model.\r\n * @author Viran\r\n *\r\n */\r\npublic class Vector extends AbstractVec",
"end": 88,
"score": 0.9994162321090698,
"start": 83,
"tag": "NAME",
"value": "Viran"
}
] | null | [] | package hr.fer.zemris.linearna;
/**
* N-dimensional vector model.
* @author Viran
*
*/
public class Vector extends AbstractVector {
protected double[] elements;
protected int dimension;
protected boolean readOnly;
/**
* Vector constructor from an array of elements.
* Default readOnly property is set to false.
* Given arraz is treated as object private.
* @param elements List of elements describing this vector.
*/
public Vector(double... elements) {
this.elements=elements;
dimension=elements.length;
readOnly=false;
}
/**
* Vector constructor.
* @param readOnly Flag for setting the readOnly property to this vector.
* @param useGivenArray Flag for setting the given array as the value source.
* @param elements Array of elements describing the vector.
*/
public Vector(boolean readOnly, boolean useGivenArray,double... elements) {
this.readOnly=readOnly;
if(useGivenArray)
this.elements=elements;
else
this.elements=elements.clone();
this.dimension=elements.length;
}
@Override
public double get(int dim) {
return elements[dim];
}
@Override
public IVector set(int dim, double val) {
if(!readOnly)
elements[dim]=val; //maybe add stderr message
return this;
}
@Override
public int getDimension() {
return dimension;
}
@Override
public IVector copy() {
if(readOnly)
return this.newInstance(dimension); //maybe add stderr message
Vector copy=new Vector(elements.clone());
copy.dimension=this.dimension;
copy.readOnly=false;
return copy;
}
@Override
public IVector newInstance(int i) {
if(i<0)
throw new IllegalArgumentException();
double[] array=new double[i];
return new Vector(array);
}
/**
* For the given input string return its vector representation.
* @param input Vector values.
*/
public static Vector parseSimple(String input) throws NumberFormatException{
String[] sValues=input.trim().split("\\s+");
double[] elements=new double[sValues.length];
for(int i=0;i<elements.length;i++)
elements[i]=Double.parseDouble(sValues[i]);
Vector vector=new Vector(elements);
return vector;
}
}
| 2,228 | 0.685817 | 0.684919 | 91 | 22.483517 | 20.986841 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.637363 | false | false | 3 |
fe387fc0693a3993a77c19c351d3c80d55c6dc9d | 36,618,891,174,928 | 9c80dda6277a881cfc71bd1a81e194360728092f | /ecps-core/src/main/java/com/wjw/ecps/dao/EbShipAddrMapper.java | ca2de1249ab4eeeff4843149dc9980ffe28ffded | [] | no_license | CYWJW/ECPS | https://github.com/CYWJW/ECPS | 29243419ec1d57bbba26e4da2ae11c09034ee4b7 | f43495520849c0a2612ae8a43e2ddd95a8672033 | refs/heads/master | 2020-05-04T16:00:25.640000 | 2019-04-03T13:02:09 | 2019-04-03T13:02:09 | 179,264,108 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.wjw.ecps.dao;
import com.wjw.ecps.model.EbShipAddr;
import com.wjw.ecps.model.EbShipAddrExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface EbShipAddrMapper {
int countByExample(EbShipAddrExample example);
int deleteByExample(EbShipAddrExample example);
int deleteByPrimaryKey(Long shipAddrId);
int insert(EbShipAddr record);
int insertSelective(EbShipAddr record);
List<EbShipAddr> selectByExample(EbShipAddrExample example);
EbShipAddr selectByPrimaryKey(Long shipAddrId);
int updateByExampleSelective(@Param("record") EbShipAddr record, @Param("example") EbShipAddrExample example);
int updateByExample(@Param("record") EbShipAddr record, @Param("example") EbShipAddrExample example);
int updateByPrimaryKeySelective(EbShipAddr record);
int updateByPrimaryKey(EbShipAddr record);
List<EbShipAddr> selectAddrByUserId(Long userID);
void updateBydefAddr(Long userID);
} | UTF-8 | Java | 996 | java | EbShipAddrMapper.java | Java | [] | null | [] | package com.wjw.ecps.dao;
import com.wjw.ecps.model.EbShipAddr;
import com.wjw.ecps.model.EbShipAddrExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface EbShipAddrMapper {
int countByExample(EbShipAddrExample example);
int deleteByExample(EbShipAddrExample example);
int deleteByPrimaryKey(Long shipAddrId);
int insert(EbShipAddr record);
int insertSelective(EbShipAddr record);
List<EbShipAddr> selectByExample(EbShipAddrExample example);
EbShipAddr selectByPrimaryKey(Long shipAddrId);
int updateByExampleSelective(@Param("record") EbShipAddr record, @Param("example") EbShipAddrExample example);
int updateByExample(@Param("record") EbShipAddr record, @Param("example") EbShipAddrExample example);
int updateByPrimaryKeySelective(EbShipAddr record);
int updateByPrimaryKey(EbShipAddr record);
List<EbShipAddr> selectAddrByUserId(Long userID);
void updateBydefAddr(Long userID);
} | 996 | 0.7751 | 0.7751 | 34 | 28.32353 | 29.901525 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.588235 | false | false | 3 |
bee3be5b10f25868db3a898ba04526b8406135c8 | 23,828,478,589,225 | 9c13a9f8ccc99caea2310faf505bfff1edda4ef2 | /src/main/java/frank/incubator/testgrid/ciplugin/results/pojo/TestSet.java | 1f05aa06fa7132a082704e29afddcee428cc0e83 | [] | no_license | slimsymphony/testgrid-jenkinsplugin | https://github.com/slimsymphony/testgrid-jenkinsplugin | 67e48dee474907f90c606f2890a18d65a59ebb63 | d07eee94957df8f63adc8492a2aea84799646137 | refs/heads/master | 2020-12-24T14:26:24.952000 | 2014-07-24T07:07:46 | 2014-07-24T07:07:46 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package frank.incubator.testgrid.ciplugin.results.pojo;
import java.util.ArrayList;
import java.util.List;
public class TestSet {
private List<String> testcaseIdentifies = new ArrayList<String>();
private List<TestCase> missRunTestcases = new ArrayList<TestCase>();
private List<TestCase> testcases = new ArrayList<TestCase>();
public List<TestCase> getTestcases() {
return testcases;
}
public void setTestcases(List<TestCase> testcases) {
this.testcases = testcases;
}
public List<String> getTestcaseIdentifies() {
return testcaseIdentifies;
}
public List<TestCase> getMissRunTestcases() {
return missRunTestcases;
}
public void setMissRunTestcases(List<TestCase> missRunTestcases) {
this.missRunTestcases = missRunTestcases;
}
public void setTestcaseIdentifies(List<String> testcaseIdentifies) {
this.testcaseIdentifies = testcaseIdentifies;
}
private String timeCost;
public String getTimeCost() {
return timeCost;
}
public void setTimeCost(String timeCost) {
this.timeCost = timeCost;
}
}
| UTF-8 | Java | 1,044 | java | TestSet.java | Java | [] | null | [] | package frank.incubator.testgrid.ciplugin.results.pojo;
import java.util.ArrayList;
import java.util.List;
public class TestSet {
private List<String> testcaseIdentifies = new ArrayList<String>();
private List<TestCase> missRunTestcases = new ArrayList<TestCase>();
private List<TestCase> testcases = new ArrayList<TestCase>();
public List<TestCase> getTestcases() {
return testcases;
}
public void setTestcases(List<TestCase> testcases) {
this.testcases = testcases;
}
public List<String> getTestcaseIdentifies() {
return testcaseIdentifies;
}
public List<TestCase> getMissRunTestcases() {
return missRunTestcases;
}
public void setMissRunTestcases(List<TestCase> missRunTestcases) {
this.missRunTestcases = missRunTestcases;
}
public void setTestcaseIdentifies(List<String> testcaseIdentifies) {
this.testcaseIdentifies = testcaseIdentifies;
}
private String timeCost;
public String getTimeCost() {
return timeCost;
}
public void setTimeCost(String timeCost) {
this.timeCost = timeCost;
}
}
| 1,044 | 0.764368 | 0.764368 | 47 | 21.212767 | 23.365675 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.106383 | false | false | 3 |
a91a1bf360f624b5cb60211ddbb49d5ee8de2404 | 22,127,671,559,160 | 379392993a89ede4a49b38a1f0e57dacbe17ec7d | /com/google/firebase/messaging/zzb.java | f3cb97fbcfbddd2919fdf6167da1254c829bfe60 | [] | no_license | mdali602/DTC | https://github.com/mdali602/DTC | d5c6463d4cf67877dbba43e7d50a112410dccda3 | 5a91a20a0fe92d010d5ee7084470fdf8af5dafb5 | refs/heads/master | 2021-05-12T02:06:40.493000 | 2018-01-15T18:06:00 | 2018-01-15T18:06:00 | 117,578,063 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.google.firebase.messaging;
public class zzb {
private String zzbWW = "_exp_set";
private String zzbWX = "_exp_activate";
private String zzbWY = "_exp_timeout";
private String zzbWZ = "_exp_expire";
private String zzbXa = "_exp_clear";
public String zzUY() {
return this.zzbWW;
}
public String zzUZ() {
return this.zzbWX;
}
public String zzVa() {
return this.zzbWY;
}
public String zzVb() {
return this.zzbWZ;
}
public String zzVc() {
return this.zzbXa;
}
}
| UTF-8 | Java | 575 | java | zzb.java | Java | [] | null | [] | package com.google.firebase.messaging;
public class zzb {
private String zzbWW = "_exp_set";
private String zzbWX = "_exp_activate";
private String zzbWY = "_exp_timeout";
private String zzbWZ = "_exp_expire";
private String zzbXa = "_exp_clear";
public String zzUY() {
return this.zzbWW;
}
public String zzUZ() {
return this.zzbWX;
}
public String zzVa() {
return this.zzbWY;
}
public String zzVb() {
return this.zzbWZ;
}
public String zzVc() {
return this.zzbXa;
}
}
| 575 | 0.584348 | 0.584348 | 29 | 18.827587 | 15.21358 | 43 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.37931 | false | false | 3 |
98d2506e3dfa01587f01ca0826e3ca3f6d7b1aab | 5,222,680,271,648 | e56dcf22daa243cf7687b18b7cc9df093d2da6f8 | /inncretech-comment/src/test/java/com/inncretech/comment/service/DefaultCommentServiceImplTest.java | 5fba3827f01699753cf29ae0fe51c7b9b0b36620 | [] | no_license | inncretech/modules | https://github.com/inncretech/modules | d1da5d21e0f29307bb9bf3a499482a5cd5818ff2 | 98e74881e74c8961ce892cd4e5608f41ada320f0 | refs/heads/master | 2020-04-09T13:35:15.840000 | 2015-03-15T01:49:46 | 2015-03-15T01:49:46 | 9,982,429 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.inncretech.comment.service;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import com.inncretech.comment.model.Comment;
import com.inncretech.core.sharding.IdGenerator;
import com.inncretech.core.test.TestUtil;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/applicationcontext-comment.xml" })
public class DefaultCommentServiceImplTest {
List<Comment> commList = new ArrayList<Comment>();
@Autowired
public CommentService commentService;
@Autowired
private IdGenerator idGenerator;
@Autowired
private TestUtil dbUtility;
@Before
public void setUp() {
dbUtility.cleanUpdb(new String[] { "comment" });
}
@Test
public void checkService() {
Long userId = idGenerator.getNewUserId();
Long sourceId = idGenerator.getNewSourceId();
Comment parentComment = commentService.create(sourceId, "Comment1", userId, null);
Assert.state(parentComment.getId() > 0);
List<Comment> comments = commentService.getAllComments(sourceId);
Assert.state(comments != null);
Assert.state(comments.size() == 1);
Assert.state(comments.get(0).getSourceId().equals(sourceId));
Comment childComment = commentService.create(sourceId, "Comment1", userId, parentComment.getId());
Assert.state(childComment.getId() > 0);
comments = commentService.getAllComments(sourceId);
Assert.state(comments != null);
Assert.state(comments.size() == 1);
Assert.state(comments.get(0).getSourceId().equals(sourceId));
Assert.state(comments.get(0).getChildComments() != null);
Assert.state(comments.get(0).getChildComments().size() == 1);
Assert.state(comments.get(0).getChildComments().get(0).getId().equals(childComment.getId()));
}
} | UTF-8 | Java | 2,060 | java | DefaultCommentServiceImplTest.java | Java | [] | null | [] | package com.inncretech.comment.service;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import com.inncretech.comment.model.Comment;
import com.inncretech.core.sharding.IdGenerator;
import com.inncretech.core.test.TestUtil;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/applicationcontext-comment.xml" })
public class DefaultCommentServiceImplTest {
List<Comment> commList = new ArrayList<Comment>();
@Autowired
public CommentService commentService;
@Autowired
private IdGenerator idGenerator;
@Autowired
private TestUtil dbUtility;
@Before
public void setUp() {
dbUtility.cleanUpdb(new String[] { "comment" });
}
@Test
public void checkService() {
Long userId = idGenerator.getNewUserId();
Long sourceId = idGenerator.getNewSourceId();
Comment parentComment = commentService.create(sourceId, "Comment1", userId, null);
Assert.state(parentComment.getId() > 0);
List<Comment> comments = commentService.getAllComments(sourceId);
Assert.state(comments != null);
Assert.state(comments.size() == 1);
Assert.state(comments.get(0).getSourceId().equals(sourceId));
Comment childComment = commentService.create(sourceId, "Comment1", userId, parentComment.getId());
Assert.state(childComment.getId() > 0);
comments = commentService.getAllComments(sourceId);
Assert.state(comments != null);
Assert.state(comments.size() == 1);
Assert.state(comments.get(0).getSourceId().equals(sourceId));
Assert.state(comments.get(0).getChildComments() != null);
Assert.state(comments.get(0).getChildComments().size() == 1);
Assert.state(comments.get(0).getChildComments().get(0).getId().equals(childComment.getId()));
}
} | 2,060 | 0.751942 | 0.744175 | 62 | 32.241936 | 26.966339 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.66129 | false | false | 3 |
75f2407f6dc343f5bec9c831eeef92cb70bdf9d2 | 6,622,839,636,260 | cbb237c5cf85f26e028af63331a8ba5d5a8cdd7f | /src/main/cn/yunpxu/leetcode/_492ConstructRectangle.java | 34382e43cfb4f5f172944a41a94c20e5cc81a56e | [] | no_license | yunpxu/leetcode | https://github.com/yunpxu/leetcode | 47f81355b53232675ae22d8838f6a88b95d2036e | ec23aadb6288bc9a7612c724c7e1229065353bd2 | refs/heads/master | 2021-01-18T16:53:14.311000 | 2019-05-20T07:02:55 | 2019-05-20T07:02:55 | 86,778,736 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.yunpxu.leetcode;
/**
* Created by Peter Xu on 04/06/2017.
*/
public class _492ConstructRectangle {
public static void main(String[] args) {
constructRectangle(10);
constructRectangle(9);
}
public static int[] constructRectangle(int area) {
int sqrt = ((Double) Math.sqrt(area)).intValue();
int left = sqrt;
int right = sqrt;
int product = left * right;
while (product != area) {
if (product > area) {
left--;
}
if (product < area) {
right++;
}
product = left * right;
}
System.out.println(String.format("%d * %d ", left, right));
return new int[]{left, right};
}
}
| UTF-8 | Java | 769 | java | _492ConstructRectangle.java | Java | [
{
"context": "package cn.yunpxu.leetcode;\n\n/**\n * Created by Peter Xu on 04/06/2017.\n */\npublic class _492ConstructRect",
"end": 55,
"score": 0.9997798800468445,
"start": 47,
"tag": "NAME",
"value": "Peter Xu"
}
] | null | [] | package cn.yunpxu.leetcode;
/**
* Created by <NAME> on 04/06/2017.
*/
public class _492ConstructRectangle {
public static void main(String[] args) {
constructRectangle(10);
constructRectangle(9);
}
public static int[] constructRectangle(int area) {
int sqrt = ((Double) Math.sqrt(area)).intValue();
int left = sqrt;
int right = sqrt;
int product = left * right;
while (product != area) {
if (product > area) {
left--;
}
if (product < area) {
right++;
}
product = left * right;
}
System.out.println(String.format("%d * %d ", left, right));
return new int[]{left, right};
}
}
| 767 | 0.509753 | 0.491547 | 30 | 24.633333 | 17.952684 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 3 |
b6565b2bf6d74b9550380ec5050c91f9a7d99a3d | 8,022,998,945,594 | 24599da9eab347097cf9f579f97152e59ec24ad0 | /Shuf.java | 3d29df82021a6d8cdd6f82f5d67d4bf810bfb3f5 | [] | no_license | Bhavesh-Pawar/Pachu-Java-DataStructure | https://github.com/Bhavesh-Pawar/Pachu-Java-DataStructure | 50ae1bf77cf644497684a18da49bea0a3378f866 | 10f4b734739b193ce22790ee01006bbfe586d864 | refs/heads/main | 2023-03-19T13:53:50.191000 | 2021-03-03T15:23:03 | 2021-03-03T15:23:03 | 344,170,166 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.Random;
public class Shuf
{
public static void shuffle(int a[])
{
Random rand =new Random();
int n=a.length;
for(int i=0;i<n;i++)
{
int r=rand.nextInt(i+1);
int swap=a[i];
a[i]=a[r];
a[r]=swap;
}
for(int i=0;i<n;i++)
{
System.out.print(a[i]+" ");
}
}
public static void main(String[] args)
{
int a[]=new int[100];
for(int i=0;i<=99;i++)
{
a[i]=i;
}
shuffle(a);
}
} | UTF-8 | Java | 461 | java | Shuf.java | Java | [] | null | [] | import java.util.Random;
public class Shuf
{
public static void shuffle(int a[])
{
Random rand =new Random();
int n=a.length;
for(int i=0;i<n;i++)
{
int r=rand.nextInt(i+1);
int swap=a[i];
a[i]=a[r];
a[r]=swap;
}
for(int i=0;i<n;i++)
{
System.out.print(a[i]+" ");
}
}
public static void main(String[] args)
{
int a[]=new int[100];
for(int i=0;i<=99;i++)
{
a[i]=i;
}
shuffle(a);
}
} | 461 | 0.503254 | 0.483731 | 29 | 13.965517 | 11.529521 | 40 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.344828 | false | false | 3 |
c3a5fa719bdf985f58c11790cbdaf694c25d98bd | 9,320,079,036,702 | b401c8c44951cad6a681196b332772fc0a68c2f0 | /repqis/src/indra/bbva/qis/repository/VistaFinanciaRecibidaRepository.java | 6a25b5cbe89a23254efed0ee4fb933bed0179eca | [] | no_license | jquedena/interfaz-contable | https://github.com/jquedena/interfaz-contable | 9f00ea5676a7dd34e449057579d5115b32804cbf | 87efb46dde3b0eb460925f739202e04aa0b5acfa | refs/heads/master | 2018-01-09T17:43:12.467000 | 2014-01-05T16:48:41 | 2014-01-05T16:48:41 | 52,005,415 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package indra.bbva.qis.repository;
import indra.bbva.qis.domain.extended.dform.VistaFinanciaRecibida;
import indra.bbva.qis.persistence.DFormPersistence;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class VistaFinanciaRecibidaRepository extends BaseRepository<VistaFinanciaRecibida> {
@Autowired
private DFormPersistence dFormPersistence;
@Override
public List<VistaFinanciaRecibida> listarPorPeriodoMonedas(long idPeriodo) {
return dFormPersistence.listarVistaFinanciaRecibida(idPeriodo);
}
}
| UTF-8 | Java | 639 | java | VistaFinanciaRecibidaRepository.java | Java | [] | null | [] | package indra.bbva.qis.repository;
import indra.bbva.qis.domain.extended.dform.VistaFinanciaRecibida;
import indra.bbva.qis.persistence.DFormPersistence;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class VistaFinanciaRecibidaRepository extends BaseRepository<VistaFinanciaRecibida> {
@Autowired
private DFormPersistence dFormPersistence;
@Override
public List<VistaFinanciaRecibida> listarPorPeriodoMonedas(long idPeriodo) {
return dFormPersistence.listarVistaFinanciaRecibida(idPeriodo);
}
}
| 639 | 0.820031 | 0.820031 | 21 | 28.428572 | 29.828991 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.761905 | false | false | 3 |
35a490a23102d9a1b942b6cc0edff7b34ca6e44a | 13,958,643,714,179 | 1bbf56ce0451041ba9a21d840e46d2e57ae29f81 | /app/src/main/java/com/example/android/tictactoe/playOptions.java | f24b0f72a832a77f7bc2404f404ef1592f2f5b37 | [] | no_license | Chrisnake/TicTacToe | https://github.com/Chrisnake/TicTacToe | f998a4bdf0cc3aa82db7a45be5d3fb1811ecb4bc | be88c004f2ffb0b94f6202423683ccd3e85d5122 | refs/heads/master | 2020-03-20T10:24:47.774000 | 2019-07-12T23:21:50 | 2019-07-12T23:21:50 | 137,368,376 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.android.tictactoe;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class playOptions extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_play_options);
Button Human = findViewById(R.id.VSHuman);
Human.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view)
{
Intent playIntent = new Intent(playOptions.this, Human.class);
startActivity(playIntent);
}
});
Button CPU = findViewById(R.id.VSCPU);
CPU.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view)
{
Intent playIntent = new Intent(playOptions.this, CPU.class);
startActivity(playIntent);
}
});
}
}
| UTF-8 | Java | 1,086 | java | playOptions.java | Java | [] | null | [] | package com.example.android.tictactoe;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class playOptions extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_play_options);
Button Human = findViewById(R.id.VSHuman);
Human.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view)
{
Intent playIntent = new Intent(playOptions.this, Human.class);
startActivity(playIntent);
}
});
Button CPU = findViewById(R.id.VSCPU);
CPU.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view)
{
Intent playIntent = new Intent(playOptions.this, CPU.class);
startActivity(playIntent);
}
});
}
}
| 1,086 | 0.627993 | 0.627072 | 37 | 28.351351 | 22.693274 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.486486 | false | false | 3 |
58488300506103fc0ed21c9aaa333c7ace984954 | 29,807,073,035,778 | e859365a137f2fc7f69173aa7705a0c039edec0f | /src/main/java/com/zmst/Domain/ClassDictionary.java | 9af854e88bbe1e7fb4b28a6da4ae897a6d8fc7be | [] | no_license | saozhou/Statistical | https://github.com/saozhou/Statistical | 3a2fcdf4dee598279ae1f636d5f7b0d404166c22 | 97d19f4f6db2b124de1a8a9ca4e76e8676e560f9 | refs/heads/master | 2021-05-15T12:11:20.223000 | 2017-11-07T08:20:26 | 2017-11-07T08:20:26 | 108,406,996 | 0 | 0 | null | true | 2017-11-04T10:50:39 | 2017-10-26T12:14:05 | 2017-10-26T12:14:07 | 2017-11-04T10:50:39 | 12,621 | 0 | 0 | 0 | Java | false | null | package com.zmst.Domain;
public class ClassDictionary {
private Integer clid;
private String clname;
private String clcode;
public Integer getClid() {
return clid;
}
public void setClid(Integer clid) {
this.clid = clid;
}
public String getClname() {
return clname;
}
public void setClname(String clname) {
this.clname = clname == null ? null : clname.trim();
}
public String getClcode() {
return clcode;
}
public void setClcode(String clcode) {
this.clcode = clcode == null ? null : clcode.trim();
}
} | UTF-8 | Java | 618 | java | ClassDictionary.java | Java | [] | null | [] | package com.zmst.Domain;
public class ClassDictionary {
private Integer clid;
private String clname;
private String clcode;
public Integer getClid() {
return clid;
}
public void setClid(Integer clid) {
this.clid = clid;
}
public String getClname() {
return clname;
}
public void setClname(String clname) {
this.clname = clname == null ? null : clname.trim();
}
public String getClcode() {
return clcode;
}
public void setClcode(String clcode) {
this.clcode = clcode == null ? null : clcode.trim();
}
} | 618 | 0.595469 | 0.595469 | 33 | 17.757576 | 17.634384 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.30303 | false | false | 3 |
3799e1e30d5771580de1c6fa04fee3e0c16b0bd1 | 7,086,696,052,162 | d0480a19cb1af62f3a550eb21028770e53e61e4a | /src/com/codari/arenacore/players/menu/icons/iconstore/kits/kit/options/spawnablegroup/create/repeatset/ResetRandomRepeatIcon.java | a8455772265f827539e7f86b455bfb45eccd1d40 | [] | no_license | diage/CodariCore | https://github.com/diage/CodariCore | 3533627dc07c9f0d71a2e8ac3d07229de7cf1725 | 5cc9379d14682ba7b44cd5bf471a2d67b8f55604 | refs/heads/master | 2016-08-04T07:54:54.410000 | 2015-01-28T02:55:42 | 2015-01-28T02:55:42 | 14,248,121 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.codari.arenacore.players.menu.icons.iconstore.kits.kit.options.spawnablegroup.create.repeatset;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.meta.ItemMeta;
import com.codari.arena5.players.combatants.Combatant;
import com.codari.arenacore.players.builders.kit.KitListener;
import com.codari.arenacore.players.menu.icons.ExecutableIcon;
import com.codari.arenacore.players.menu.menus.menustore.kits.SpawnableGroupRepeatSet;
public class ResetRandomRepeatIcon extends ExecutableIcon {
private SpawnableGroupRepeatSet spawnableGroupRepeatSet;
public ResetRandomRepeatIcon(Combatant combatant, SpawnableGroupRepeatSet spawnableGroupRepeatSet) {
super(Material.SUGAR_CANE_BLOCK, combatant, "Reset Random Repeat Time");
this.spawnableGroupRepeatSet = spawnableGroupRepeatSet;
this.updateLore();
}
@Override
public void click() {
Player player = this.getCombatant().getPlayer();
KitListener.getKit(this.getCombatant()).resetRandomRepeatTime();
this.spawnableGroupRepeatSet.clearLore();
player.sendMessage(ChatColor.BLUE + "You have reset the Random Repeat Time.");
}
private void updateLore() {
ItemMeta itemMeta = super.getItemMeta();
List<String> lore = new ArrayList<>();
lore.add(ChatColor.BLUE + "Set Repeat Time to null.");
itemMeta.setLore(lore);
super.setItemMeta(itemMeta);
}
}
| UTF-8 | Java | 1,497 | java | ResetRandomRepeatIcon.java | Java | [] | null | [] | package com.codari.arenacore.players.menu.icons.iconstore.kits.kit.options.spawnablegroup.create.repeatset;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.meta.ItemMeta;
import com.codari.arena5.players.combatants.Combatant;
import com.codari.arenacore.players.builders.kit.KitListener;
import com.codari.arenacore.players.menu.icons.ExecutableIcon;
import com.codari.arenacore.players.menu.menus.menustore.kits.SpawnableGroupRepeatSet;
public class ResetRandomRepeatIcon extends ExecutableIcon {
private SpawnableGroupRepeatSet spawnableGroupRepeatSet;
public ResetRandomRepeatIcon(Combatant combatant, SpawnableGroupRepeatSet spawnableGroupRepeatSet) {
super(Material.SUGAR_CANE_BLOCK, combatant, "Reset Random Repeat Time");
this.spawnableGroupRepeatSet = spawnableGroupRepeatSet;
this.updateLore();
}
@Override
public void click() {
Player player = this.getCombatant().getPlayer();
KitListener.getKit(this.getCombatant()).resetRandomRepeatTime();
this.spawnableGroupRepeatSet.clearLore();
player.sendMessage(ChatColor.BLUE + "You have reset the Random Repeat Time.");
}
private void updateLore() {
ItemMeta itemMeta = super.getItemMeta();
List<String> lore = new ArrayList<>();
lore.add(ChatColor.BLUE + "Set Repeat Time to null.");
itemMeta.setLore(lore);
super.setItemMeta(itemMeta);
}
}
| 1,497 | 0.777555 | 0.776887 | 40 | 35.424999 | 29.669756 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.525 | false | false | 3 |
ebdd5b93ad34d1ba1ba1e63a14124f42d2684db8 | 27,865,747,829,877 | aec957d35dc9468a71e1d09dec1d469da33351c1 | /src/main/java/it/sevenbits/reverser/package-info.java | 22396d48621cccd6c8bca7f67b1afe8bb2878aa2 | [] | no_license | maxim-sakhno/array-reverser | https://github.com/maxim-sakhno/array-reverser | ca9e4f7ddd21f63fda5dcdb46f57b77b04daf8b7 | 5441899e35fd4c511247cb14728a0daa84df07b5 | refs/heads/master | 2021-01-01T03:50:52.298000 | 2016-04-16T09:08:20 | 2016-04-16T09:08:20 | 56,153,476 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* Contains interfaces and implementations for operations with arrays.
*/
package it.sevenbits.reverser; | UTF-8 | Java | 109 | java | package-info.java | Java | [] | null | [] | /**
* Contains interfaces and implementations for operations with arrays.
*/
package it.sevenbits.reverser; | 109 | 0.779817 | 0.779817 | 4 | 26.5 | 27.427176 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 3 |
02c62ab67008964b57333b3b6d04f583270b05cc | 10,892,037,128,558 | 1f361951ec1e5f8e1c1896268e15c8ea45238857 | /src/demo_OCA/Zippy.java | f3ae83a07dc31da9b057355cd8499704f2f840f9 | [] | no_license | minhtranc1991/hackerrank_java | https://github.com/minhtranc1991/hackerrank_java | fa720a5c036d7da129a0d645292d03d052776abe | 64b8975be8aefb546c083f201fcaacbdf9d99ac6 | refs/heads/main | 2023-07-01T08:37:35.592000 | 2021-07-30T14:40:37 | 2021-07-30T14:40:37 | 304,860,760 | 0 | 0 | null | false | 2021-07-30T14:40:38 | 2020-10-17T11:18:48 | 2021-03-15T02:28:23 | 2021-07-30T14:40:37 | 53 | 0 | 0 | 0 | Java | false | false | package demo_OCA;
public class Zippy {
String[] x;
int[] a[] = {{1, 2}, {1}};
Object c = new long[4];
Object[] d = x;
}
| UTF-8 | Java | 137 | java | Zippy.java | Java | [] | null | [] | package demo_OCA;
public class Zippy {
String[] x;
int[] a[] = {{1, 2}, {1}};
Object c = new long[4];
Object[] d = x;
}
| 137 | 0.489051 | 0.459854 | 8 | 16.125 | 10.154279 | 30 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.875 | false | false | 3 |
c5960d07e5064f508a9ba9560b2b1dda9324c193 | 7,378,753,854,413 | e1081a0747ca32937ab8984bd13214a967e45e89 | /src/main/java/com/proposito/model/core/evidencia/feedback/InternalRequest.java | 17241550fdaef7bfc54dbc3a31e203a4f8f708d7 | [] | no_license | Sanne/quarkus-many-to-one-error | https://github.com/Sanne/quarkus-many-to-one-error | bcb0b4c1c908a2da90bf8746f7b1bb6bc6a3aae1 | d2ea50ced2f54b74cc1df03cec2f5a68612b50c3 | refs/heads/master | 2020-12-20T11:00:49.753000 | 2019-12-09T18:02:01 | 2019-12-09T18:02:01 | 236,051,582 | 0 | 0 | null | true | 2020-01-24T17:39:16 | 2020-01-24T17:39:15 | 2019-12-09T18:02:07 | 2019-12-09T18:02:05 | 114 | 0 | 0 | 0 | null | false | false | package com.proposito.model.core.evidencia.feedback;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import com.proposito.model.usuario.Usuario;
@Entity(name = "InternalRequest")
@DiscriminatorValue(value = "INTERN")
public class InternalRequest extends Request {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "`idUsuarioSolicitacao`")
private Usuario usuarioSolicitacao;
public Usuario getUsuarioSolicitacao() {
return usuarioSolicitacao;
}
public void setUsuarioSolicitacao(Usuario usuarioSolicitacao) {
this.usuarioSolicitacao = usuarioSolicitacao;
}
}
| UTF-8 | Java | 721 | java | InternalRequest.java | Java | [] | null | [] | package com.proposito.model.core.evidencia.feedback;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import com.proposito.model.usuario.Usuario;
@Entity(name = "InternalRequest")
@DiscriminatorValue(value = "INTERN")
public class InternalRequest extends Request {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "`idUsuarioSolicitacao`")
private Usuario usuarioSolicitacao;
public Usuario getUsuarioSolicitacao() {
return usuarioSolicitacao;
}
public void setUsuarioSolicitacao(Usuario usuarioSolicitacao) {
this.usuarioSolicitacao = usuarioSolicitacao;
}
}
| 721 | 0.811373 | 0.811373 | 27 | 25.703703 | 20.475487 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.777778 | false | false | 3 |
4882bd84416a3eebb38cedb0e4aeda5d20edb0af | 31,241,592,126,337 | 1a56934f6151ccbf77471d96cf2908d53aeb7a70 | /work/AIQandA/SKCHAI/src/main/java/com/skch/test/TestLoadScript.java | cd8ccddfe73d76e991dfa4e0d86ebabfcfd4554e | [] | no_license | jerrybw/study | https://github.com/jerrybw/study | ca0e51458e66997b987e86a5cef36af08f6628d5 | 7b58282daf28810c56f24898d514c34870907b50 | refs/heads/master | 2021-01-01T18:44:24.604000 | 2017-10-20T10:15:49 | 2017-10-20T10:15:49 | 98,418,922 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.skch.test;
import com.skch.bean.ScriptsFile;
import com.skch.service.impl.AIScriptsServiceImpl;
public class TestLoadScript {
public static void main(String[] args) {
AIScriptsServiceImpl aiScriptsServiceImpl = new AIScriptsServiceImpl();
aiScriptsServiceImpl.loadScriptsFiles();
ScriptsFile scriptsFile = aiScriptsServiceImpl.getScriptsFile("预约脚本样例.xml");
System.out.println(scriptsFile.getFileName());
System.out.println(scriptsFile.getRoot().asXML());
}
}
| UTF-8 | Java | 528 | java | TestLoadScript.java | Java | [] | null | [] | package com.skch.test;
import com.skch.bean.ScriptsFile;
import com.skch.service.impl.AIScriptsServiceImpl;
public class TestLoadScript {
public static void main(String[] args) {
AIScriptsServiceImpl aiScriptsServiceImpl = new AIScriptsServiceImpl();
aiScriptsServiceImpl.loadScriptsFiles();
ScriptsFile scriptsFile = aiScriptsServiceImpl.getScriptsFile("预约脚本样例.xml");
System.out.println(scriptsFile.getFileName());
System.out.println(scriptsFile.getRoot().asXML());
}
}
| 528 | 0.748062 | 0.748062 | 19 | 25.157894 | 25.927557 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.421053 | false | false | 3 |
dc1a3a84655e34d72c919c7e6fa29898b81c31c3 | 2,619,930,120,613 | 26a6626a11bfd663c667e832381c76fcff76dcb7 | /src/main/java/com/sdyin/dsag/arithmetic/ds/linkedlist/MergeManyLinkedList.java | 89ce394eb5da57809f6d25a354b7d6655e7c86aa | [] | no_license | sdyin/DSAG | https://github.com/sdyin/DSAG | 4e352b80cb2326fea7033e4995685dfd215f439c | d655bcbc1e0a87072eaad60498ddaa985e3391b9 | refs/heads/master | 2023-08-18T08:34:56.700000 | 2023-08-11T07:18:10 | 2023-08-11T07:18:10 | 203,130,913 | 0 | 0 | null | false | 2023-06-14T22:25:22 | 2019-08-19T08:28:17 | 2022-01-10T15:29:00 | 2023-06-14T22:25:19 | 406 | 0 | 0 | 1 | Java | false | false | package com.sdyin.dsag.arithmetic.ds.linkedlist;
import java.util.Comparator;
import java.util.PriorityQueue;
/**
* @Description: 合并k个升序链表
* @Author: liuye
* @time: 2021/12/27$ 6:37 下午$
*/
public class MergeManyLinkedList {
public ListNode mergeKLists(ListNode[] lists) {
if (lists == null || lists.length == 0) {
return null;
}
PriorityQueue<ListNode> pq = new PriorityQueue<>(Comparator.comparing(node -> node.val));
//添加进优先队列
for (int i = 0; i < lists.length; i++) {
if (lists[i] != null){
pq.add(lists[i]);
}
}
ListNode dummy = new ListNode(-1);
ListNode tail = dummy;
while (!pq.isEmpty()) {
ListNode node = pq.poll();
//尾节点指向下一节点
tail.next = new ListNode(node.val);
//尾结点调整到下一节点
tail = tail.next;
//如果ListNode后还有节点,添加到优先队列
if (node.next != null) {
pq.offer(node.next);
}
}
return dummy.next;
}
public static void main(String[] args) {
PriorityQueue<Integer> pq = new PriorityQueue<>();
pq.add(66);
pq.add(55);
pq.add(88);
pq.add(77);
while (!pq.isEmpty()) {
final Integer poll = pq.poll();
System.out.println("result:" + poll);
}
}
}
| UTF-8 | Java | 1,502 | java | MergeManyLinkedList.java | Java | [
{
"context": "yQueue;\n\n/**\n * @Description: 合并k个升序链表\n * @Author: liuye\n * @time: 2021/12/27$ 6:37 下午$\n */\npublic class M",
"end": 159,
"score": 0.9995254874229431,
"start": 154,
"tag": "USERNAME",
"value": "liuye"
}
] | null | [] | package com.sdyin.dsag.arithmetic.ds.linkedlist;
import java.util.Comparator;
import java.util.PriorityQueue;
/**
* @Description: 合并k个升序链表
* @Author: liuye
* @time: 2021/12/27$ 6:37 下午$
*/
public class MergeManyLinkedList {
public ListNode mergeKLists(ListNode[] lists) {
if (lists == null || lists.length == 0) {
return null;
}
PriorityQueue<ListNode> pq = new PriorityQueue<>(Comparator.comparing(node -> node.val));
//添加进优先队列
for (int i = 0; i < lists.length; i++) {
if (lists[i] != null){
pq.add(lists[i]);
}
}
ListNode dummy = new ListNode(-1);
ListNode tail = dummy;
while (!pq.isEmpty()) {
ListNode node = pq.poll();
//尾节点指向下一节点
tail.next = new ListNode(node.val);
//尾结点调整到下一节点
tail = tail.next;
//如果ListNode后还有节点,添加到优先队列
if (node.next != null) {
pq.offer(node.next);
}
}
return dummy.next;
}
public static void main(String[] args) {
PriorityQueue<Integer> pq = new PriorityQueue<>();
pq.add(66);
pq.add(55);
pq.add(88);
pq.add(77);
while (!pq.isEmpty()) {
final Integer poll = pq.poll();
System.out.println("result:" + poll);
}
}
}
| 1,502 | 0.509986 | 0.494294 | 55 | 24.454546 | 19.305975 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.436364 | false | false | 3 |
0d167a97f67bcb58462bb062422afc205f3e72e8 | 2,619,930,116,818 | 5891ee6a1d0b8dff0dc7e3934c5fadc8fa0152be | /src/main/java/org/efaps/number2words/converters/German.java | eab02b2dfdbac9efd2890b189eba2514d6cbc2dc | [] | no_license | markh42/Number2Words | https://github.com/markh42/Number2Words | 8c4900f8eefad112524afdca2eb467a36dd82242 | dfe8594f2c093c2b3eb0083a581c8bfbdb117b11 | refs/heads/master | 2022-11-08T20:51:56.028000 | 2020-07-06T04:46:01 | 2020-07-06T04:46:01 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* Copyright 2003 - 2020 The eFaps Team
*
* 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.efaps.number2words.converters;
/**
* The class implements the conversion of numbers to German words.
*
* @author The eFaps Team
*/
public class German
extends AbstractDecimalConverter
{
/**
* String array to define the conversion of numbers for 1 till 19.
*
* @see #getNumNames()
*/
private static final String[] NUM_NAMES = {
"", "ein", "zwei", "drei", "vier",
"f\u00FCnf", "sechs", "sieben", "acht", "neun",
"zehn", "elf", "zw\u00F6lf", "dreizehn", "vierzehn",
"f\u00FCnfzehn", "sechzehn", "siebzehn", "achtzehn", "neunzehn"};
/**
* String array to define the conversion for the numbers 10, 20, 30, 40,
* 50, 60, 70, 80, 90 and 100.
*
* @see #getTensNames()
*/
private static final String[] TENS_NAMES = {
"", "zehn", "zwanzig", "drei\u00DFig", "vierzig",
"f\u00FCnfzig", "sechzig", "siebzig", "achtzig", "neunzig",
"hundert"};
/**
* String array to define the conversion of power numbers. The array
* contains the German words for
* <ul>
* <li>thousand</li>
* <li>million</li>
* <li>billion</li>
* <li>trillion</li>
* <li>quadrillion</li>
* <li>quintillion</li>
* </ul>
*
* @see #getPowerNames()
*/
private static final String[] POWER_NAMES = {
"tausend", "Millionen", "Milliarden", "Billionen", "Billiarden", "Trillionen"};
/**
* String array to define the conversion of power numbers with exact one.
* The array contains the German words for
* <ul>
* <li>one thousand</li>
* <li>one million</li>
* <li>one billion</li>
* <li>one trillion</li>
* <li>one quadrillion</li>
* <li>one quintillion</li>
* </ul>
*
* @see #convertPower(int, int)
*/
private static final String[] SINGLE_POWER_NAMES = {
"ein tausend", "eine Million", "eine Milliarde", "eine Billion", "eine Billiarde", "eine Trillion"};
/**
* <p>Converts number less than one hundred into German words. The original
* method was override because in German language the convert is done using
* first the last digit (one, two, ...) and then the 'ten' digit (twenty,
* thirty, ...) concatenated by an 'and'.</p>
* <p><b>Examples:</b><br/>
* <ul>
* <li>22: twenty-and-two (German: zwei-und-zwanzig)</li>
* <li>46: forty-and-six (German: sechs-und-vierzig)</li>
* </ul>
* </p>
*
* @param _number number less than one hundred to convert to German words
* @return converted German words for <code>_number</code>
*/
@Override
protected String convertLessThanOneHundred(final int _number)
{
final StringBuilder ret = new StringBuilder();
if (_number < 20) {
ret.append(getNumNames()[_number]);
} else {
final int modTen = _number % 10;
if (modTen > 0) {
ret.append(getNumNames()[_number % 10]).append("und");
}
ret.append(getTensNames()[_number / 10]);
}
return ret.toString();
}
/**
* The method converts the given <code>_number</code> depending on the
* <code>_power</code> to words. The real number to convert is
* "<code>_number * (10 ^ _power)</code>". The original method is
* overwritten because if <code>_number</code> is equal one, the values
* from {@link #SINGLE_POWER_NAMES} must be used.
*
* @param _number number to convert
* @param _power power of the number
* @return converted string
* @see #SINGLE_POWER_NAMES
*/
@Override
protected String convertPower(final int _number,
final int _power)
{
return _number == 1
? German.SINGLE_POWER_NAMES[_power]
: super.convertPower(_number, _power);
}
/**
* Returns the string array to define the conversion of numbers for 1 till
* 19.
*
* @return string array of numbers
* @see AbstractDecimalConverter#getNumNames()
* @see #NUM_NAMES
*/
@Override
protected String[] getNumNames()
{
return German.NUM_NAMES;
}
/**
* Returns the string array for the numbers 10, 20, 30, 40, 50, 60, 70, 80
* and 90.
*
* @return string array of tens names
* @see AbstractDecimalConverter#getTensNames()
* @see #TENS_NAMES
*/
@Override
protected String[] getTensNames()
{
return German.TENS_NAMES;
}
/**
* Returns the string array for log numbers 100, 1 000,
* 1 000 000 and 1 000 000 000.
*
* @return string array of log numbers
* @see AbstractDecimalConverter#getPowerNames()
* @see #LOG_NAMES
*/
@Override
protected String[] getPowerNames()
{
return German.POWER_NAMES;
}
/**
* Returns the related English word for the number zero ('0').
*
* @return always the text string "null"
*/
@Override
protected String getZero()
{
return "null";
}
/**
* Returns the related German word for "minus" needed for
* negative numbers.
*
* @return always the text string "minus"
*/
@Override
protected String getMinus()
{
return "minus";
}
}
| UTF-8 | Java | 6,062 | java | German.java | Java | [] | null | [] | /*
* Copyright 2003 - 2020 The eFaps Team
*
* 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.efaps.number2words.converters;
/**
* The class implements the conversion of numbers to German words.
*
* @author The eFaps Team
*/
public class German
extends AbstractDecimalConverter
{
/**
* String array to define the conversion of numbers for 1 till 19.
*
* @see #getNumNames()
*/
private static final String[] NUM_NAMES = {
"", "ein", "zwei", "drei", "vier",
"f\u00FCnf", "sechs", "sieben", "acht", "neun",
"zehn", "elf", "zw\u00F6lf", "dreizehn", "vierzehn",
"f\u00FCnfzehn", "sechzehn", "siebzehn", "achtzehn", "neunzehn"};
/**
* String array to define the conversion for the numbers 10, 20, 30, 40,
* 50, 60, 70, 80, 90 and 100.
*
* @see #getTensNames()
*/
private static final String[] TENS_NAMES = {
"", "zehn", "zwanzig", "drei\u00DFig", "vierzig",
"f\u00FCnfzig", "sechzig", "siebzig", "achtzig", "neunzig",
"hundert"};
/**
* String array to define the conversion of power numbers. The array
* contains the German words for
* <ul>
* <li>thousand</li>
* <li>million</li>
* <li>billion</li>
* <li>trillion</li>
* <li>quadrillion</li>
* <li>quintillion</li>
* </ul>
*
* @see #getPowerNames()
*/
private static final String[] POWER_NAMES = {
"tausend", "Millionen", "Milliarden", "Billionen", "Billiarden", "Trillionen"};
/**
* String array to define the conversion of power numbers with exact one.
* The array contains the German words for
* <ul>
* <li>one thousand</li>
* <li>one million</li>
* <li>one billion</li>
* <li>one trillion</li>
* <li>one quadrillion</li>
* <li>one quintillion</li>
* </ul>
*
* @see #convertPower(int, int)
*/
private static final String[] SINGLE_POWER_NAMES = {
"ein tausend", "eine Million", "eine Milliarde", "eine Billion", "eine Billiarde", "eine Trillion"};
/**
* <p>Converts number less than one hundred into German words. The original
* method was override because in German language the convert is done using
* first the last digit (one, two, ...) and then the 'ten' digit (twenty,
* thirty, ...) concatenated by an 'and'.</p>
* <p><b>Examples:</b><br/>
* <ul>
* <li>22: twenty-and-two (German: zwei-und-zwanzig)</li>
* <li>46: forty-and-six (German: sechs-und-vierzig)</li>
* </ul>
* </p>
*
* @param _number number less than one hundred to convert to German words
* @return converted German words for <code>_number</code>
*/
@Override
protected String convertLessThanOneHundred(final int _number)
{
final StringBuilder ret = new StringBuilder();
if (_number < 20) {
ret.append(getNumNames()[_number]);
} else {
final int modTen = _number % 10;
if (modTen > 0) {
ret.append(getNumNames()[_number % 10]).append("und");
}
ret.append(getTensNames()[_number / 10]);
}
return ret.toString();
}
/**
* The method converts the given <code>_number</code> depending on the
* <code>_power</code> to words. The real number to convert is
* "<code>_number * (10 ^ _power)</code>". The original method is
* overwritten because if <code>_number</code> is equal one, the values
* from {@link #SINGLE_POWER_NAMES} must be used.
*
* @param _number number to convert
* @param _power power of the number
* @return converted string
* @see #SINGLE_POWER_NAMES
*/
@Override
protected String convertPower(final int _number,
final int _power)
{
return _number == 1
? German.SINGLE_POWER_NAMES[_power]
: super.convertPower(_number, _power);
}
/**
* Returns the string array to define the conversion of numbers for 1 till
* 19.
*
* @return string array of numbers
* @see AbstractDecimalConverter#getNumNames()
* @see #NUM_NAMES
*/
@Override
protected String[] getNumNames()
{
return German.NUM_NAMES;
}
/**
* Returns the string array for the numbers 10, 20, 30, 40, 50, 60, 70, 80
* and 90.
*
* @return string array of tens names
* @see AbstractDecimalConverter#getTensNames()
* @see #TENS_NAMES
*/
@Override
protected String[] getTensNames()
{
return German.TENS_NAMES;
}
/**
* Returns the string array for log numbers 100, 1 000,
* 1 000 000 and 1 000 000 000.
*
* @return string array of log numbers
* @see AbstractDecimalConverter#getPowerNames()
* @see #LOG_NAMES
*/
@Override
protected String[] getPowerNames()
{
return German.POWER_NAMES;
}
/**
* Returns the related English word for the number zero ('0').
*
* @return always the text string "null"
*/
@Override
protected String getZero()
{
return "null";
}
/**
* Returns the related German word for "minus" needed for
* negative numbers.
*
* @return always the text string "minus"
*/
@Override
protected String getMinus()
{
return "minus";
}
}
| 6,062 | 0.586935 | 0.568789 | 200 | 29.309999 | 25.403227 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 3 |
828534c88be3c883a0c196cd5506b7cb472ecdb9 | 10,118,942,960,126 | 9ba3e3622ff4e25696941a0b70a89316ddf10e2c | /src/main/java/kr/co/mash_up/service/GameService.java | f9bc02eee7e4a391cc6424d5c9cd83b5db6863b2 | [] | no_license | mash-up-kr/personal-predilections-backend | https://github.com/mash-up-kr/personal-predilections-backend | b782fbb0e503b9b42182c3e28423ecd3795dd9f6 | eb1a049abc06e6adf95aa09c483b7fbf464fc6d3 | refs/heads/master | 2021-01-17T08:23:11.600000 | 2017-03-06T09:39:23 | 2017-03-06T09:39:23 | 83,890,725 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package kr.co.mash_up.service;
import kr.co.mash_up.domain.*;
import kr.co.mash_up.dto.GameDto;
import kr.co.mash_up.dto.GameImageDto;
import kr.co.mash_up.dto.GameResultDto;
import kr.co.mash_up.dto.UserDto;
import kr.co.mash_up.repository.GameImageTypeRepository;
import kr.co.mash_up.repository.GameRepository;
import kr.co.mash_up.repository.HistoryRepository;
import kr.co.mash_up.repository.UserRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
@Service(value = "gameService")
@Slf4j
public class GameService {
@Autowired
private GameRepository gameRepository;
@Autowired
private HistoryRepository historyRepository;
@Autowired
private UserRepository userRepository;
@Autowired
private GameImageTypeRepository gameImageTypeRepository;
@Transactional
public GameDto create(String userId) {
// user id로 게임 생성
Game game = new Game();
Game savedGame = gameRepository.save(game);
log.info(userId);
// 히스토리에 주최자로 등록
User promoter = userRepository.findByUserId(userId);
historyRepository.save(new History(promoter, savedGame, true));
// 자신을 제외한 유저들 랜덤 선택하여 히스토리에 저장
long userCount = userRepository.count();
generatorRandomUserId(userCount, 12).forEach(aLong -> {
User findUser = userRepository.findOne(aLong);
historyRepository.save(new History(findUser, savedGame, false));
});
return new GameDto.Builder()
.withId(savedGame.getId())
.build();
}
private Set<Long> generatorRandomUserId(long userCount, int size) {
final Set<Long> randomUserId = new HashSet<>();
while (randomUserId.size() < size) {
randomUserId.add(ThreadLocalRandom.current().nextLong(userCount) + 1);
}
return randomUserId;
}
@Transactional(readOnly = true)
public List<GameImageDto> getGameStageInfo(Long gameId, String gameStage) {
Game findGame = gameRepository.findOne(gameId);
List<GameImageDto> gameImageDtos = new ArrayList<>();
findGame.getHistories().forEach(history -> {
GameImageType gameImageType = gameImageTypeRepository.findByName(gameStage);
history.getUser().getGameImages().stream()
.filter(gameImage -> gameImage.getGameImageType() == gameImageType)
.forEach(gameImage -> {
gameImageDtos.add(new GameImageDto.Builder()
.withUrl(gameImage.getImageUrl())
.withType(gameStage)
.build());
});
});
return gameImageDtos;
}
/*
game_result:{
matching_ratio: "Double"
user:{
name: "String",
gender: Int,
phone_number: "String",
image:{
url: "String"
}
}
}
*/
@Transactional(readOnly = true)
public GameResultDto result(Long gameId, List<GameImage> gameImages) {
Game findGame = gameRepository.findOne(gameId);
// 히스토리에 가중치를 계산한다.
gameImages.forEach(gameImage -> {
User findUser = gameImage.getUser();
Long weight = gameImage.getGameImageType().getWeight();
History findHistory = historyRepository.findByUserAndGame(findUser, findGame);
findHistory.addWeight(weight);
});
User topMatchingRationUser = null;
Double topMatchingRatio = 0d;
for (History history : findGame.getHistories()) {
if (history.getMatchingRatio() > topMatchingRatio) {
topMatchingRatio = history.getMatchingRatio();
topMatchingRationUser = history.getUser();
}
}
GameImageType gameImageType = gameImageTypeRepository.findByName("FACE");
Optional<GameImage> findGameImage = topMatchingRationUser.getGameImages().stream()
.filter(gameImage -> gameImage.getGameImageType() == gameImageType)
.findFirst();
GameImage gameImage = findGameImage.get();
GameImageDto gameImageDto = new GameImageDto.Builder()
.withType(gameImageType.getName())
.withUrl(gameImage.getImageUrl())
.build();
UserDto userDto = new UserDto.Builder()
.withName(topMatchingRationUser.getName())
.withPhoneNumber(topMatchingRationUser.getPhoneNumber())
.withGender(topMatchingRationUser.getGender())
.withGameImageDto(gameImageDto)
.build();
return new GameResultDto.Builder()
.withMatchingRatio(topMatchingRatio * 100)
.withUserDto(userDto)
.build();
}
}
| UTF-8 | Java | 5,206 | java | GameService.java | Java | [
{
"context": "atio: \"Double\"\n user:{\n name: \"String\",\n gender: Int,\n phone_numb",
"end": 3071,
"score": 0.9536470770835876,
"start": 3065,
"tag": "NAME",
"value": "String"
}
] | null | [] | package kr.co.mash_up.service;
import kr.co.mash_up.domain.*;
import kr.co.mash_up.dto.GameDto;
import kr.co.mash_up.dto.GameImageDto;
import kr.co.mash_up.dto.GameResultDto;
import kr.co.mash_up.dto.UserDto;
import kr.co.mash_up.repository.GameImageTypeRepository;
import kr.co.mash_up.repository.GameRepository;
import kr.co.mash_up.repository.HistoryRepository;
import kr.co.mash_up.repository.UserRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
@Service(value = "gameService")
@Slf4j
public class GameService {
@Autowired
private GameRepository gameRepository;
@Autowired
private HistoryRepository historyRepository;
@Autowired
private UserRepository userRepository;
@Autowired
private GameImageTypeRepository gameImageTypeRepository;
@Transactional
public GameDto create(String userId) {
// user id로 게임 생성
Game game = new Game();
Game savedGame = gameRepository.save(game);
log.info(userId);
// 히스토리에 주최자로 등록
User promoter = userRepository.findByUserId(userId);
historyRepository.save(new History(promoter, savedGame, true));
// 자신을 제외한 유저들 랜덤 선택하여 히스토리에 저장
long userCount = userRepository.count();
generatorRandomUserId(userCount, 12).forEach(aLong -> {
User findUser = userRepository.findOne(aLong);
historyRepository.save(new History(findUser, savedGame, false));
});
return new GameDto.Builder()
.withId(savedGame.getId())
.build();
}
private Set<Long> generatorRandomUserId(long userCount, int size) {
final Set<Long> randomUserId = new HashSet<>();
while (randomUserId.size() < size) {
randomUserId.add(ThreadLocalRandom.current().nextLong(userCount) + 1);
}
return randomUserId;
}
@Transactional(readOnly = true)
public List<GameImageDto> getGameStageInfo(Long gameId, String gameStage) {
Game findGame = gameRepository.findOne(gameId);
List<GameImageDto> gameImageDtos = new ArrayList<>();
findGame.getHistories().forEach(history -> {
GameImageType gameImageType = gameImageTypeRepository.findByName(gameStage);
history.getUser().getGameImages().stream()
.filter(gameImage -> gameImage.getGameImageType() == gameImageType)
.forEach(gameImage -> {
gameImageDtos.add(new GameImageDto.Builder()
.withUrl(gameImage.getImageUrl())
.withType(gameStage)
.build());
});
});
return gameImageDtos;
}
/*
game_result:{
matching_ratio: "Double"
user:{
name: "String",
gender: Int,
phone_number: "String",
image:{
url: "String"
}
}
}
*/
@Transactional(readOnly = true)
public GameResultDto result(Long gameId, List<GameImage> gameImages) {
Game findGame = gameRepository.findOne(gameId);
// 히스토리에 가중치를 계산한다.
gameImages.forEach(gameImage -> {
User findUser = gameImage.getUser();
Long weight = gameImage.getGameImageType().getWeight();
History findHistory = historyRepository.findByUserAndGame(findUser, findGame);
findHistory.addWeight(weight);
});
User topMatchingRationUser = null;
Double topMatchingRatio = 0d;
for (History history : findGame.getHistories()) {
if (history.getMatchingRatio() > topMatchingRatio) {
topMatchingRatio = history.getMatchingRatio();
topMatchingRationUser = history.getUser();
}
}
GameImageType gameImageType = gameImageTypeRepository.findByName("FACE");
Optional<GameImage> findGameImage = topMatchingRationUser.getGameImages().stream()
.filter(gameImage -> gameImage.getGameImageType() == gameImageType)
.findFirst();
GameImage gameImage = findGameImage.get();
GameImageDto gameImageDto = new GameImageDto.Builder()
.withType(gameImageType.getName())
.withUrl(gameImage.getImageUrl())
.build();
UserDto userDto = new UserDto.Builder()
.withName(topMatchingRationUser.getName())
.withPhoneNumber(topMatchingRationUser.getPhoneNumber())
.withGender(topMatchingRationUser.getGender())
.withGameImageDto(gameImageDto)
.build();
return new GameResultDto.Builder()
.withMatchingRatio(topMatchingRatio * 100)
.withUserDto(userDto)
.build();
}
}
| 5,206 | 0.622453 | 0.620494 | 155 | 31.929031 | 25.6812 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.43871 | false | false | 3 |
fa1555f63aa66bb839549d2cf3f26ecee372053a | 10,118,942,962,311 | 505fa9d242d4d96a1843156f3443be3d41a1312a | /Dpat/src/main/java/behaveObserverPat/realEx/IStockObserverBase.java | 6f115f4905ecbb48ec59b750fe3ce285fb1ac4fc | [] | no_license | vikas-flutter/Dpat | https://github.com/vikas-flutter/Dpat | f27dcd794133d8ec95b4f8bf5af27cfe600f3663 | e1adaad9d8d79a38bd394cbddfcbb41548ff2afc | refs/heads/master | 2023-03-01T08:40:17.076000 | 2018-02-03T16:16:07 | 2018-02-03T16:16:07 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package behaveObserverPat.realEx;
public interface IStockObserverBase {
void Notify(Stock stock);
}
| UTF-8 | Java | 102 | java | IStockObserverBase.java | Java | [] | null | [] | package behaveObserverPat.realEx;
public interface IStockObserverBase {
void Notify(Stock stock);
}
| 102 | 0.813725 | 0.813725 | 5 | 19.4 | 15.831614 | 37 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false | 3 |
5b21e5fca72b811fd20c62074bbfd01e680c199e | 15,513,421,904,718 | adbea250e6236dadaa21139da24c5d48b95f2f8f | /app/src/main/java/com/conghuy/dolenglish/controller/tabFive/buyMore/vh/ReceiptItemVH.java | 7ccf78e3c306a446b26b1b3002c70199b6a67b16 | [] | no_license | conghuy1992/DolEnglish_v2 | https://github.com/conghuy1992/DolEnglish_v2 | 804e838b16838601055d92e6ad8a06aa9df8539d | 2356acccef9ab3cc06f7b3853e638350dd787da8 | refs/heads/master | 2018-11-09T03:29:47.559000 | 2018-10-09T09:10:12 | 2018-10-09T09:10:12 | 144,685,874 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.conghuy.dolenglish.controller.tabFive.buyMore.vh;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.conghuy.dolenglish.R;
import com.conghuy.dolenglish.common.Utils;
import com.conghuy.dolenglish.databinding.ReceiptItemBinding;
import com.conghuy.dolenglish.model.AccountDto;
public class ReceiptItemVH extends RecyclerView.ViewHolder {
private String TAG = "BuyMoreItemVH";
private ReceiptItemBinding binding;
private Context context;
public ReceiptItemVH(ReceiptItemBinding itemView, Context context) {
super(itemView.getRoot());
this.context = context;
this.binding = itemView;
}
public void bind(final AccountDto obj, final int position) {
binding.setViewModel(obj);
String msg = obj.receipt == null || obj.receipt.trim().length() == 0
? Utils.getMsg(context, R.string.upload_photo)
: obj.receipt;
binding.tvFilePath.setText(msg);
binding.btnSelectFile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
}
});
}
}
| UTF-8 | Java | 1,272 | java | ReceiptItemVH.java | Java | [] | null | [] | package com.conghuy.dolenglish.controller.tabFive.buyMore.vh;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.conghuy.dolenglish.R;
import com.conghuy.dolenglish.common.Utils;
import com.conghuy.dolenglish.databinding.ReceiptItemBinding;
import com.conghuy.dolenglish.model.AccountDto;
public class ReceiptItemVH extends RecyclerView.ViewHolder {
private String TAG = "BuyMoreItemVH";
private ReceiptItemBinding binding;
private Context context;
public ReceiptItemVH(ReceiptItemBinding itemView, Context context) {
super(itemView.getRoot());
this.context = context;
this.binding = itemView;
}
public void bind(final AccountDto obj, final int position) {
binding.setViewModel(obj);
String msg = obj.receipt == null || obj.receipt.trim().length() == 0
? Utils.getMsg(context, R.string.upload_photo)
: obj.receipt;
binding.tvFilePath.setText(msg);
binding.btnSelectFile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
}
});
}
}
| 1,272 | 0.700472 | 0.698899 | 39 | 31.615385 | 23.437441 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.641026 | false | false | 3 |
0d3c072337311200810ce2029de6f566f50a41c3 | 19,954,418,089,972 | 8e4d0267965dd71fd5a75bbf6fd379704391b879 | /guns-gateway/src/main/java/com/stylefeng/guns/rest/modular/film/vo/BaseFilmResponseVo.java | 50e2cde5d82c2fff80a93d1af3547a9206b06904 | [
"Apache-2.0"
] | permissive | Mr-Ren-kw/cinema | https://github.com/Mr-Ren-kw/cinema | 4295c9dd2708602ca1493f1153a2af6c90cd3bd0 | f0cac3c74f9a6f8efa6f0028043345551c6c2ec0 | refs/heads/master | 2022-11-04T00:19:12.286000 | 2019-10-15T14:14:00 | 2019-10-15T14:14:00 | 214,617,178 | 0 | 0 | NOASSERTION | false | 2022-10-12T20:32:41 | 2019-10-12T09:18:34 | 2019-10-15T14:14:14 | 2022-10-12T20:32:40 | 3,558 | 0 | 0 | 6 | Java | false | false | package com.stylefeng.guns.rest.modular.film.vo;
import lombok.Data;
@Data
public class BaseFilmResponseVo<T> {
private T data;
private String imgPre;
private Integer status;
}
| UTF-8 | Java | 193 | java | BaseFilmResponseVo.java | Java | [] | null | [] | package com.stylefeng.guns.rest.modular.film.vo;
import lombok.Data;
@Data
public class BaseFilmResponseVo<T> {
private T data;
private String imgPre;
private Integer status;
}
| 193 | 0.73057 | 0.73057 | 12 | 15.083333 | 15.871664 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.416667 | false | false | 3 |
8a723f088f18451c85dbcdd2c4398598f398e75c | 19,146,964,259,772 | 243eaf02e124f89a21c5d5afa707db40feda5144 | /src/unk/com/tencent/mm/plugin/b/c/g.java | b41ee2b4bd6d31552d4e4cfee7ddd323a19e2f79 | [] | no_license | laohanmsa/WeChatRE | https://github.com/laohanmsa/WeChatRE | e6671221ac6237c6565bd1aae02f847718e4ac9d | 4b249bce4062e1f338f3e4bbee273b2a88814bf3 | refs/heads/master | 2020-05-03T08:43:38.647000 | 2013-05-18T14:04:23 | 2013-05-18T14:04:23 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package unk.com.tencent.mm.plugin.b.c;
import com.tencent.mm.platformtools.x;
import com.tencent.mm.sdk.platformtools.bg;
import com.tencent.mm.sdk.platformtools.n;
final class g extends f
{
private long aIT;
public g(long paramLong)
{
this.aIT = paramLong;
}
protected final com.tencent.mm.plugin.b.a.g BU()
{
return e.O(false);
}
protected final void a(com.tencent.mm.plugin.b.a.g paramg)
{
e.a(paramg);
}
protected final boolean b(com.tencent.mm.plugin.b.a.f paramf)
{
if (paramf == null)
return false;
long l = bg.tD();
if (this.aIT <= 0L)
{
paramf.Bw();
paramf.jQ((int)l);
return true;
}
String str = e.ig();
if ((!bg.gj(str)) && (l - x.a(str, String.valueOf(paramf.Sy()), 0L) > this.aIT))
{
x.b(str, String.valueOf(paramf.Sy()), l);
paramf.Bw();
paramf.jQ((int)l);
return true;
}
Object[] arrayOfObject = new Object[1];
arrayOfObject[0] = Integer.valueOf(paramf.Sy());
n.d("MicroMsg.KVReportHelper", "match freq limit, logID = %d", arrayOfObject);
return false;
}
}
/* Location: /home/danghvu/0day/WeChat/WeChat_4.5_dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.b.c.g
* JD-Core Version: 0.6.2
*/ | UTF-8 | Java | 1,272 | java | g.java | Java | [] | null | [] | package unk.com.tencent.mm.plugin.b.c;
import com.tencent.mm.platformtools.x;
import com.tencent.mm.sdk.platformtools.bg;
import com.tencent.mm.sdk.platformtools.n;
final class g extends f
{
private long aIT;
public g(long paramLong)
{
this.aIT = paramLong;
}
protected final com.tencent.mm.plugin.b.a.g BU()
{
return e.O(false);
}
protected final void a(com.tencent.mm.plugin.b.a.g paramg)
{
e.a(paramg);
}
protected final boolean b(com.tencent.mm.plugin.b.a.f paramf)
{
if (paramf == null)
return false;
long l = bg.tD();
if (this.aIT <= 0L)
{
paramf.Bw();
paramf.jQ((int)l);
return true;
}
String str = e.ig();
if ((!bg.gj(str)) && (l - x.a(str, String.valueOf(paramf.Sy()), 0L) > this.aIT))
{
x.b(str, String.valueOf(paramf.Sy()), l);
paramf.Bw();
paramf.jQ((int)l);
return true;
}
Object[] arrayOfObject = new Object[1];
arrayOfObject[0] = Integer.valueOf(paramf.Sy());
n.d("MicroMsg.KVReportHelper", "match freq limit, logID = %d", arrayOfObject);
return false;
}
}
/* Location: /home/danghvu/0day/WeChat/WeChat_4.5_dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.b.c.g
* JD-Core Version: 0.6.2
*/ | 1,272 | 0.606918 | 0.59827 | 55 | 22.145454 | 22.053999 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.527273 | false | false | 3 |
bcdaaf62dc037f4b5cf2d2cc7a7c85510b2b7a33 | 17,755,394,839,760 | 565525a68a09e8d2d56032f09ad4904199594fd7 | /src/com/aria/common/shared/object/eom/builder/ListPaymentProcessorsMParameters.java | a2419e5ce64fd8bc48eba63a509972ff0acc1aac | [] | no_license | AriaSystems/java_sdk_A7 | https://github.com/AriaSystems/java_sdk_A7 | a6788a28ba12035c7f3e28d840210bff0bfc9f70 | c370e46f79ac80b4f468b911d1784a078df6042f | refs/heads/master | 2018-01-13T05:31:06.520000 | 2017-12-04T21:03:34 | 2017-12-04T21:03:34 | 58,783,239 | 0 | 0 | null | false | 2017-02-02T10:14:43 | 2016-05-14T01:24:59 | 2016-05-19T05:09:40 | 2017-02-02T10:14:43 | 8,134 | 0 | 0 | 1 | Java | null | null | package com.aria.common.shared.object.eom.builder;
import com.aria.common.rest.object.eom.RestUtilities;
public class ListPaymentProcessorsMParameters extends Parameters {
public static class ListPaymentProcessorsMParametersBuilder extends ParametersBuilder<ListPaymentProcessorsMParameters> {
private ListPaymentProcessorsMParametersBuilder(Long clientNo, String authKey) {
this.addParameter("client_no", getValue("Long", clientNo));
this.addParameter("auth_key", getValue("String", authKey));
}
public ListPaymentProcessorsMParametersBuilder withLimit(Long value) {
this.addParameter("limit", getValue("Long", value));
return this;
}
public ListPaymentProcessorsMParametersBuilder withOffset(Long value) {
this.addParameter("offset", getValue("Long", value));
return this;
}
public ListPaymentProcessorsMParametersBuilder withQueryString(String value) {
this.addParameter("query_string", getValue("String", value));
return this;
}
public ListPaymentProcessorsMParameters build() {
return new ListPaymentProcessorsMParameters(this);
}
}
/**
* Builder factory method.
* This should be parameterized with the required parameters.
* @return
*/
public static ListPaymentProcessorsMParametersBuilder createBuilder(Long clientNo, String authKey) {
return new ListPaymentProcessorsMParametersBuilder(clientNo, authKey);
}
// keep this private so only the builder can build the parameters
private ListPaymentProcessorsMParameters(ListPaymentProcessorsMParametersBuilder builder) {
super(builder.copyParameters());
}
}
| UTF-8 | Java | 1,676 | java | ListPaymentProcessorsMParameters.java | Java | [] | null | [] | package com.aria.common.shared.object.eom.builder;
import com.aria.common.rest.object.eom.RestUtilities;
public class ListPaymentProcessorsMParameters extends Parameters {
public static class ListPaymentProcessorsMParametersBuilder extends ParametersBuilder<ListPaymentProcessorsMParameters> {
private ListPaymentProcessorsMParametersBuilder(Long clientNo, String authKey) {
this.addParameter("client_no", getValue("Long", clientNo));
this.addParameter("auth_key", getValue("String", authKey));
}
public ListPaymentProcessorsMParametersBuilder withLimit(Long value) {
this.addParameter("limit", getValue("Long", value));
return this;
}
public ListPaymentProcessorsMParametersBuilder withOffset(Long value) {
this.addParameter("offset", getValue("Long", value));
return this;
}
public ListPaymentProcessorsMParametersBuilder withQueryString(String value) {
this.addParameter("query_string", getValue("String", value));
return this;
}
public ListPaymentProcessorsMParameters build() {
return new ListPaymentProcessorsMParameters(this);
}
}
/**
* Builder factory method.
* This should be parameterized with the required parameters.
* @return
*/
public static ListPaymentProcessorsMParametersBuilder createBuilder(Long clientNo, String authKey) {
return new ListPaymentProcessorsMParametersBuilder(clientNo, authKey);
}
// keep this private so only the builder can build the parameters
private ListPaymentProcessorsMParameters(ListPaymentProcessorsMParametersBuilder builder) {
super(builder.copyParameters());
}
}
| 1,676 | 0.74463 | 0.74463 | 48 | 33.916668 | 34.937344 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.541667 | false | false | 3 |
bfe494bff1f063294f78dba564df7475c965e0f2 | 17,755,394,839,819 | 95b01bba5177645c26c73834bd2be455e66277e6 | /chec_cn/src/com/glamey/chec_cn/controller/front/VerifyCodeFrontController.java | c18d16f1e75f5b7884424a7391a4a8f8c39cd93c | [] | no_license | cha63506/innerweb | https://github.com/cha63506/innerweb | 6731ad9a68dd3fb71986c8cd9aa923356ec74f9b | 35b481e5b13a306b0585e4d556c860b8e22df3f4 | refs/heads/master | 2018-01-15T17:07:27.292000 | 2015-01-14T05:46:26 | 2015-01-14T05:46:26 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.glamey.chec_cn.controller.front;
import com.glamey.chec_cn.constants.Constants;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;
/**
* 随机验证码
*
* @author zy
*/
@Controller
public class VerifyCodeFrontController {
protected static final Logger logger = Logger.getLogger(VerifyCodeFrontController.class);
@RequestMapping(value = "/verifyCode.htm", method = RequestMethod.GET)
@ResponseBody
public ModelAndView verifyCode(HttpServletRequest request,HttpServletResponse response) throws Exception {
response.setContentType("image/jpeg");
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0L);
try {
int len = 4;
int width = 60;
int height = 20;
BufferedImage image = new BufferedImage(width, height, 1);
Graphics g = image.getGraphics();
Random random = new Random();
g.setColor(getRandColor(200, 250));
g.fillRect(0, 0, width, height);
g.setFont(new Font("Times New Roman", 0, 18));
g.setColor(getRandColor(160, 200));
for (int i = 0; i < 155; i++) {
int x = random.nextInt(width);
int y = random.nextInt(height);
int xl = random.nextInt(12);
int yl = random.nextInt(12);
g.drawLine(x, y, x + xl, y + yl);
}
String sRand = "";
for (int i = 0; i < len; i++) {
String rand = String.valueOf(random.nextInt(10));
sRand = sRand + rand;
g.setColor(new Color(20 + random.nextInt(110), 20 + random
.nextInt(110), 20 + random.nextInt(110)));
g.drawString(rand, 13 * i + 6, 16);
}
HttpSession session = request.getSession();
session.setAttribute(Constants.VERIFYCODE, sRand);
g.dispose();
ServletOutputStream responseOutputStream = response
.getOutputStream();
ImageIO.write(image, "JPEG", responseOutputStream);
responseOutputStream.flush();
responseOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
Color getRandColor(int fc, int bc) {
Random random = new Random();
if (fc > 255)
fc = 255;
if (bc > 255)
bc = 255;
int r = fc + random.nextInt(bc - fc);
int g = fc + random.nextInt(bc - fc);
int b = fc + random.nextInt(bc - fc);
return new Color(r, g, b);
}
} | UTF-8 | Java | 3,404 | java | VerifyCodeFrontController.java | Java | [
{
"context": "java.util.Random;\r\n\r\n/**\r\n * 随机验证码\r\n *\r\n * @author zy\r\n */\r\n@Controller\r\npublic class VerifyCodeFrontCont",
"end": 781,
"score": 0.9788000583648682,
"start": 779,
"tag": "USERNAME",
"value": "zy"
}
] | null | [] | package com.glamey.chec_cn.controller.front;
import com.glamey.chec_cn.constants.Constants;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;
/**
* 随机验证码
*
* @author zy
*/
@Controller
public class VerifyCodeFrontController {
protected static final Logger logger = Logger.getLogger(VerifyCodeFrontController.class);
@RequestMapping(value = "/verifyCode.htm", method = RequestMethod.GET)
@ResponseBody
public ModelAndView verifyCode(HttpServletRequest request,HttpServletResponse response) throws Exception {
response.setContentType("image/jpeg");
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0L);
try {
int len = 4;
int width = 60;
int height = 20;
BufferedImage image = new BufferedImage(width, height, 1);
Graphics g = image.getGraphics();
Random random = new Random();
g.setColor(getRandColor(200, 250));
g.fillRect(0, 0, width, height);
g.setFont(new Font("Times New Roman", 0, 18));
g.setColor(getRandColor(160, 200));
for (int i = 0; i < 155; i++) {
int x = random.nextInt(width);
int y = random.nextInt(height);
int xl = random.nextInt(12);
int yl = random.nextInt(12);
g.drawLine(x, y, x + xl, y + yl);
}
String sRand = "";
for (int i = 0; i < len; i++) {
String rand = String.valueOf(random.nextInt(10));
sRand = sRand + rand;
g.setColor(new Color(20 + random.nextInt(110), 20 + random
.nextInt(110), 20 + random.nextInt(110)));
g.drawString(rand, 13 * i + 6, 16);
}
HttpSession session = request.getSession();
session.setAttribute(Constants.VERIFYCODE, sRand);
g.dispose();
ServletOutputStream responseOutputStream = response
.getOutputStream();
ImageIO.write(image, "JPEG", responseOutputStream);
responseOutputStream.flush();
responseOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
Color getRandColor(int fc, int bc) {
Random random = new Random();
if (fc > 255)
fc = 255;
if (bc > 255)
bc = 255;
int r = fc + random.nextInt(bc - fc);
int g = fc + random.nextInt(bc - fc);
int b = fc + random.nextInt(bc - fc);
return new Color(r, g, b);
}
} | 3,404 | 0.587507 | 0.567472 | 92 | 34.913044 | 22.710682 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.967391 | false | false | 3 |
8e41ebdab47fe9a55e9f44f01dcd901b63d04e0a | 1,700,807,094,013 | 261e77f0efa95e4d30ad5f8746d6a8e2a785f0b6 | /app/src/main/java/providers/fairrepair/service/fairrepairpartner/utils/DialogFactory.java | bb320579af96cad40f90c708bc6b916e73570452 | [] | no_license | Mahiraj2709/f-p-one | https://github.com/Mahiraj2709/f-p-one | 0d288fb6232b7be0038df60245d3819edd5746eb | 4e6097633914555eff8cd6bb876e2927493d3bb3 | refs/heads/master | 2021-01-11T20:02:57.208000 | 2017-01-25T13:47:56 | 2017-01-25T13:47:56 | 79,455,761 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package providers.fairrepair.service.fairrepairpartner.utils;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.annotation.StringRes;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import providers.fairrepair.service.fairrepairpartner.FairRepairApplication;
import providers.fairrepair.service.fairrepairpartner.R;
import providers.fairrepair.service.fairrepairpartner.app.LoginActivity;
import providers.fairrepair.service.fairrepairpartner.app.MainActivity;
import providers.fairrepair.service.fairrepairpartner.data.DataManager;
import providers.fairrepair.service.fairrepairpartner.data.local.PrefsHelper;
import providers.fairrepair.service.fairrepairpartner.data.model.Service;
import providers.fairrepair.service.fairrepairpartner.fragment.HomeFragment;
public class DialogFactory {
public static Dialog createSimpleOkErrorDialog(Context context, String title, String message) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
.setTitle(title)
.setMessage(message)
.setNeutralButton(R.string.dialog_action_ok, null);
return alertDialog.create();
}
public static Dialog createSimpleOkErrorDialog(Context context,
@StringRes int titleResource,
@StringRes int messageResource) {
return createSimpleOkErrorDialog(context,
context.getString(titleResource),
context.getString(messageResource));
}
public static Dialog createSimpleOkSuccessDialog(Context context, @StringRes int title, String message) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
.setTitle(context.getString(title))
.setMessage(message)
.setNeutralButton(R.string.dialog_action_ok, null);
return alertDialog.create();
}
public static Dialog createSimpleOkErrorDialog(Context context, String message) {
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
LayoutInflater inflater = ((Activity)context).getLayoutInflater();
View dialogView = inflater.inflate(R.layout.error_alert_dialog, null);
TextView tv_errorMsg = (TextView) dialogView.findViewById(R.id.tv_errorMsg);
tv_errorMsg.setText(message);
alertDialog.setView(dialogView);
final Dialog dialog = alertDialog.create();
dialogView.findViewById(R.id.btn_ok).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
public static Dialog createSimpleOkErrorDialog(Context context,
@StringRes int messageResource) {
return createSimpleOkErrorDialog(context, context.getString(messageResource));
}
public static Dialog createLogoutDialog(final Context context, String title, String message) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
.setTitle(title)
.setMessage(message)
.setNegativeButton(R.string.dialog_no, null)
.setPositiveButton(R.string.dialog_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
DataManager dataManager = new DataManager(context);
PrefsHelper prefsHelper = new PrefsHelper(context);
Map<String, String> requestParams = new HashMap<>();
requestParams.put(ApplicationMetadata.SESSION_TOKEN, (String) prefsHelper.getPref(ApplicationMetadata.SESSION_TOKEN));
requestParams.put("language", (String) prefsHelper.getPref(ApplicationMetadata.APP_LANGUAGE));
dataManager.logout(requestParams);
}
});
return alertDialog.create();
}
public static Dialog createLogoutDialog(Context context,
@StringRes int titleResource,
@StringRes int messageResource) {
return createLogoutDialog(context,
context.getString(titleResource),
context.getString(messageResource));
}
public static Dialog createMultipleChoiceDialog(final Context context, final List<Service> serviceList, String previousSelectedServices) {
// String array for alert dialog multi choice items
final ArrayList<String> services = new ArrayList<>();
// Boolean array for initial selected items
final boolean[] checkedServices = new boolean[serviceList.size()];
int pos = 0;
for (Service service : serviceList) {
Log.i("sfdf", previousSelectedServices);
services.add(service.getName());
if (previousSelectedServices.contains(service.getId() + "")) {
checkedServices[pos] = true;
}
pos++;
}
// Build an AlertDialog
AlertDialog.Builder builder = new AlertDialog.Builder(context);
// Convert the color array to list
builder.setMultiChoiceItems(services.toArray(new String[services.size()]), checkedServices, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
// Update the current focused item's checked status
checkedServices[which] = isChecked;
}
});
// Specify the dialog is not cancelable
builder.setCancelable(false);
// Set a title for alert dialog
builder.setTitle("Service Available");
// Set the positive/yes button click listener
builder.setPositiveButton(context.getString(R.string.dialog_action_ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
for (int i = 0; i < checkedServices.length; i++) {
if (!checkedServices[i]) {
try {
serviceList.get(i).setName("no_service");
} catch (IndexOutOfBoundsException ex) {
}
}
}
FairRepairApplication.getBus().post(new ArrayList<>(serviceList));
}
});
// Set the negative/no button click listener
builder.setNegativeButton(context.getString(R.string.dialog_no), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Do something when click the negative button
}
});
AlertDialog dialog = builder.create();
// Display the alert dialog on interface
return dialog;
}
public static void createExitDialog(final Context context) {
android.app.AlertDialog.Builder alertDialog = new android.app.AlertDialog.Builder(context);
// Setting Dialog Title
alertDialog.setIcon(R.mipmap.ic_launcher)
.setTitle(R.string.app_name)
.setMessage("Do you want to exit?");
alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
((MainActivity) context).finish();
}
});
alertDialog.setNegativeButton("NO", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
alertDialog.show();
}
public static void createComingSoonDialog(final Context context) {
android.app.AlertDialog.Builder alertDialog = new android.app.AlertDialog.Builder(context);
// Setting Dialog Title
alertDialog.setIcon(R.mipmap.ic_launcher)
.setTitle(R.string.app_name)
.setMessage("Coming Soon.");
alertDialog.setPositiveButton("OK", null
);
alertDialog.show();
}
public static Dialog createDialogForNotificationData(final Context context, int title, String payload) {
AlertDialog alertDialog = new AlertDialog.Builder(context)
.setTitle(title)
.setMessage(R.string.message_new_request)
.setPositiveButton(R.string.show_customer, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Fragment newFragment = HomeFragment.newInstance(0);
((MainActivity)context).addFragmentToStack(newFragment, "home_fragment");
}
}).create();
alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
return alertDialog;
}
public static Dialog createRegisterSuccessDialog(final Context mContext, int title_success, String message) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext)
.setTitle(mContext.getString(title_success))
.setMessage(message)
.setNeutralButton(R.string.dialog_action_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(mContext, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
((Activity) mContext).finish();
}
});
return alertDialog.create();
}
}
| UTF-8 | Java | 10,519 | java | DialogFactory.java | Java | [] | null | [] | package providers.fairrepair.service.fairrepairpartner.utils;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.annotation.StringRes;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import providers.fairrepair.service.fairrepairpartner.FairRepairApplication;
import providers.fairrepair.service.fairrepairpartner.R;
import providers.fairrepair.service.fairrepairpartner.app.LoginActivity;
import providers.fairrepair.service.fairrepairpartner.app.MainActivity;
import providers.fairrepair.service.fairrepairpartner.data.DataManager;
import providers.fairrepair.service.fairrepairpartner.data.local.PrefsHelper;
import providers.fairrepair.service.fairrepairpartner.data.model.Service;
import providers.fairrepair.service.fairrepairpartner.fragment.HomeFragment;
public class DialogFactory {
public static Dialog createSimpleOkErrorDialog(Context context, String title, String message) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
.setTitle(title)
.setMessage(message)
.setNeutralButton(R.string.dialog_action_ok, null);
return alertDialog.create();
}
public static Dialog createSimpleOkErrorDialog(Context context,
@StringRes int titleResource,
@StringRes int messageResource) {
return createSimpleOkErrorDialog(context,
context.getString(titleResource),
context.getString(messageResource));
}
public static Dialog createSimpleOkSuccessDialog(Context context, @StringRes int title, String message) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
.setTitle(context.getString(title))
.setMessage(message)
.setNeutralButton(R.string.dialog_action_ok, null);
return alertDialog.create();
}
public static Dialog createSimpleOkErrorDialog(Context context, String message) {
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
LayoutInflater inflater = ((Activity)context).getLayoutInflater();
View dialogView = inflater.inflate(R.layout.error_alert_dialog, null);
TextView tv_errorMsg = (TextView) dialogView.findViewById(R.id.tv_errorMsg);
tv_errorMsg.setText(message);
alertDialog.setView(dialogView);
final Dialog dialog = alertDialog.create();
dialogView.findViewById(R.id.btn_ok).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
return dialog;
}
public static Dialog createSimpleOkErrorDialog(Context context,
@StringRes int messageResource) {
return createSimpleOkErrorDialog(context, context.getString(messageResource));
}
public static Dialog createLogoutDialog(final Context context, String title, String message) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
.setTitle(title)
.setMessage(message)
.setNegativeButton(R.string.dialog_no, null)
.setPositiveButton(R.string.dialog_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
DataManager dataManager = new DataManager(context);
PrefsHelper prefsHelper = new PrefsHelper(context);
Map<String, String> requestParams = new HashMap<>();
requestParams.put(ApplicationMetadata.SESSION_TOKEN, (String) prefsHelper.getPref(ApplicationMetadata.SESSION_TOKEN));
requestParams.put("language", (String) prefsHelper.getPref(ApplicationMetadata.APP_LANGUAGE));
dataManager.logout(requestParams);
}
});
return alertDialog.create();
}
public static Dialog createLogoutDialog(Context context,
@StringRes int titleResource,
@StringRes int messageResource) {
return createLogoutDialog(context,
context.getString(titleResource),
context.getString(messageResource));
}
public static Dialog createMultipleChoiceDialog(final Context context, final List<Service> serviceList, String previousSelectedServices) {
// String array for alert dialog multi choice items
final ArrayList<String> services = new ArrayList<>();
// Boolean array for initial selected items
final boolean[] checkedServices = new boolean[serviceList.size()];
int pos = 0;
for (Service service : serviceList) {
Log.i("sfdf", previousSelectedServices);
services.add(service.getName());
if (previousSelectedServices.contains(service.getId() + "")) {
checkedServices[pos] = true;
}
pos++;
}
// Build an AlertDialog
AlertDialog.Builder builder = new AlertDialog.Builder(context);
// Convert the color array to list
builder.setMultiChoiceItems(services.toArray(new String[services.size()]), checkedServices, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
// Update the current focused item's checked status
checkedServices[which] = isChecked;
}
});
// Specify the dialog is not cancelable
builder.setCancelable(false);
// Set a title for alert dialog
builder.setTitle("Service Available");
// Set the positive/yes button click listener
builder.setPositiveButton(context.getString(R.string.dialog_action_ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
for (int i = 0; i < checkedServices.length; i++) {
if (!checkedServices[i]) {
try {
serviceList.get(i).setName("no_service");
} catch (IndexOutOfBoundsException ex) {
}
}
}
FairRepairApplication.getBus().post(new ArrayList<>(serviceList));
}
});
// Set the negative/no button click listener
builder.setNegativeButton(context.getString(R.string.dialog_no), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Do something when click the negative button
}
});
AlertDialog dialog = builder.create();
// Display the alert dialog on interface
return dialog;
}
public static void createExitDialog(final Context context) {
android.app.AlertDialog.Builder alertDialog = new android.app.AlertDialog.Builder(context);
// Setting Dialog Title
alertDialog.setIcon(R.mipmap.ic_launcher)
.setTitle(R.string.app_name)
.setMessage("Do you want to exit?");
alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
((MainActivity) context).finish();
}
});
alertDialog.setNegativeButton("NO", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
alertDialog.show();
}
public static void createComingSoonDialog(final Context context) {
android.app.AlertDialog.Builder alertDialog = new android.app.AlertDialog.Builder(context);
// Setting Dialog Title
alertDialog.setIcon(R.mipmap.ic_launcher)
.setTitle(R.string.app_name)
.setMessage("Coming Soon.");
alertDialog.setPositiveButton("OK", null
);
alertDialog.show();
}
public static Dialog createDialogForNotificationData(final Context context, int title, String payload) {
AlertDialog alertDialog = new AlertDialog.Builder(context)
.setTitle(title)
.setMessage(R.string.message_new_request)
.setPositiveButton(R.string.show_customer, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Fragment newFragment = HomeFragment.newInstance(0);
((MainActivity)context).addFragmentToStack(newFragment, "home_fragment");
}
}).create();
alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
return alertDialog;
}
public static Dialog createRegisterSuccessDialog(final Context mContext, int title_success, String message) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext)
.setTitle(mContext.getString(title_success))
.setMessage(message)
.setNeutralButton(R.string.dialog_action_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(mContext, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
((Activity) mContext).finish();
}
});
return alertDialog.create();
}
}
| 10,519 | 0.630383 | 0.629908 | 243 | 42.288067 | 33.290455 | 150 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.600823 | false | false | 3 |
8598b941ba95663bc9670a5e4bcf5cb586b9773f | 32,521,492,421,809 | 608c06b7181d46e728993b42019632a82bfef231 | /src/main/java/com/laboschqpa/filehost/api/controller/internal/FileInfoController.java | 5ebc7a24b386aa82df31534055970aac967bc98e | [] | no_license | janosgats/laboschqpa.filehost | https://github.com/janosgats/laboschqpa.filehost | aec915f8e425de5b03f41d789df0f2a917bca17c | 7bb753c933bf9fe0a826d759fb04f4a92fd8e076 | refs/heads/master | 2023-08-11T21:52:19.804000 | 2021-09-24T17:09:17 | 2021-09-24T17:09:17 | 245,843,348 | 1 | 0 | null | false | 2021-05-23T14:08:05 | 2020-03-08T15:54:41 | 2021-05-11T20:09:51 | 2021-05-23T14:08:05 | 507 | 0 | 0 | 0 | Java | false | false | package com.laboschqpa.filehost.api.controller.internal;
import com.laboschqpa.filehost.api.dto.GetIndexedFileInfoResponse;
import com.laboschqpa.filehost.api.service.FileInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/internal/fileInfo")
public class FileInfoController {
private final FileInfoService fileInfoService;
@GetMapping("/indexedFileInfo")
public List<GetIndexedFileInfoResponse> getIndexedFileInfo(@RequestBody List<Long> indexedFileIds) {
return fileInfoService.getIndexedFileInfo(indexedFileIds);
}
}
| UTF-8 | Java | 879 | java | FileInfoController.java | Java | [] | null | [] | package com.laboschqpa.filehost.api.controller.internal;
import com.laboschqpa.filehost.api.dto.GetIndexedFileInfoResponse;
import com.laboschqpa.filehost.api.service.FileInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/internal/fileInfo")
public class FileInfoController {
private final FileInfoService fileInfoService;
@GetMapping("/indexedFileInfo")
public List<GetIndexedFileInfoResponse> getIndexedFileInfo(@RequestBody List<Long> indexedFileIds) {
return fileInfoService.getIndexedFileInfo(indexedFileIds);
}
}
| 879 | 0.832765 | 0.832765 | 23 | 37.217392 | 28.029421 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.478261 | false | false | 3 |
c17f6ee8ecaa35916962f2f9a9a1eac6f091ea4f | 755,914,297,484 | 84eaf99eec51d8823d412f502862147688a3bb36 | /app/src/main/java/com/kanzen/belajarpwpb/p4/LatConstrActivity.java | 7279c0fd3576c061e016034aca9bb7aeb1227fbd | [] | no_license | fadilmuh22/belajar_pwpb_2020 | https://github.com/fadilmuh22/belajar_pwpb_2020 | 5c2f72080b3ea008a9817486becc939f9bd22f0f | 8f0ebec2498a365a988601a3a946dfccd094e2e7 | refs/heads/master | 2022-12-25T21:05:15.017000 | 2020-09-17T03:49:09 | 2020-09-17T03:49:09 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.kanzen.belajarpwpb.p4;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.kanzen.belajarpwpb.R;
public class LatConstrActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lat_constr);
}
} | UTF-8 | Java | 383 | java | LatConstrActivity.java | Java | [] | null | [] | package com.kanzen.belajarpwpb.p4;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.kanzen.belajarpwpb.R;
public class LatConstrActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lat_constr);
}
} | 383 | 0.767624 | 0.765013 | 16 | 23 | 22.357885 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.375 | false | false | 3 |
1b99f788a6c0a045f1bb86c7a4e13731b4f7f597 | 3,367,254,407,515 | d85a1f2a28af8f35d2a262f440b9214f5b094597 | /src/gov/frb/ma/msu/toC/PowerNodeToC.java | 9afc1bdce787773506ab220b17c625b40f70f5b5 | [] | no_license | es335mathwiz/modelEZ | https://github.com/es335mathwiz/modelEZ | a52df8c4dd8b6df0c20ee3ed4ab7d2194951b5e7 | 1daa168110bcedd9f7493c81683ae5de575fb46f | HEAD | 2018-12-28T21:48:50.398000 | 2014-08-06T14:27:55 | 2014-08-06T14:27:55 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package gov.frb.ma.msu.toC;
import gov.frb.ma.msu.modelEZCommon.Node;
import gov.frb.ma.msu.modelEZCommon.PowerNode;
import java.io.PrintStream;
public class PowerNodeToC extends PowerNode {
public PowerNodeToC(Node b, Node e) {
super(b, e);
// TODO Auto-generated constructor stub
}
public void PrintSubtree() {
System.out.print("pow(");
getBase().PrintSubtree();
System.out.print(",(");
getExponent().PrintSubtree();
System.out.print("))");
}
public void PrintTerm(PrintStream pout) {
pout.print("pow(");
getBase().PrintTerm(pout);
pout.print(",");
getExponent().PrintTerm(pout);
pout.print(")");
}
public Node CopySubtree() {
PowerNodeToC pn = new PowerNodeToC(getBase().CopySubtree(), getExponent().CopySubtree());
return pn;
}
}
| UTF-8 | Java | 873 | java | PowerNodeToC.java | Java | [] | null | [] | package gov.frb.ma.msu.toC;
import gov.frb.ma.msu.modelEZCommon.Node;
import gov.frb.ma.msu.modelEZCommon.PowerNode;
import java.io.PrintStream;
public class PowerNodeToC extends PowerNode {
public PowerNodeToC(Node b, Node e) {
super(b, e);
// TODO Auto-generated constructor stub
}
public void PrintSubtree() {
System.out.print("pow(");
getBase().PrintSubtree();
System.out.print(",(");
getExponent().PrintSubtree();
System.out.print("))");
}
public void PrintTerm(PrintStream pout) {
pout.print("pow(");
getBase().PrintTerm(pout);
pout.print(",");
getExponent().PrintTerm(pout);
pout.print(")");
}
public Node CopySubtree() {
PowerNodeToC pn = new PowerNodeToC(getBase().CopySubtree(), getExponent().CopySubtree());
return pn;
}
}
| 873 | 0.616266 | 0.616266 | 34 | 23.67647 | 20.039257 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.852941 | false | false | 3 |
f72f0f731df623cd3850d29ebd61a01c8fa9f341 | 19,533,511,323,177 | 5432968e0f953e87a18c98ccb6437373bbd70c0b | /src/main/java/jxufe/lwl/eshop/controller/UploadFileController.java | c3c47787c16e7969ddc4ad717505877d9c8a4295 | [] | no_license | liujy0098/eshop | https://github.com/liujy0098/eshop | 45e3fd4df93b44ffedb7266a38332cba347fbfa1 | 2d767be1b511b1e61bad86390f21f027858d4817 | refs/heads/master | 2020-03-25T12:59:06.484000 | 2018-08-18T06:57:09 | 2018-08-18T06:57:09 | 143,803,372 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package jxufe.lwl.eshop.controller;
import com.aliyun.oss.OSSClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by Administrator on 2018/8/14 0014.
*/
@Controller
public class UploadFileController {
@RequestMapping("uploadfile")
@ResponseBody
public Object uploadFile(@RequestParam("fs")MultipartFile file){
String endpoint = "http://oss-cn-shenzhen.aliyuncs.com";
String accessKeyId = "LTAI6D9vZzrSgSqr";
String accessKeySecret = "mK0XcIm6BFhowuOEvBBzmRXZmAmTDD";
OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
String buckName="newwld";
try {
InputStream inputStream=file.getInputStream();
ossClient.putObject(buckName,file.getOriginalFilename(), inputStream);
} catch (IOException e) {
e.printStackTrace();
}finally {
ossClient.shutdown();
}
return endpoint.replace("http://","http://"+buckName+".")+"/"+file.getOriginalFilename();
}
}
| UTF-8 | Java | 1,337 | java | UploadFileController.java | Java | [
{
"context": "on;\nimport java.io.InputStream;\n\n/**\n * Created by Administrator on 2018/8/14 0014.\n */\n@Controller\npublic class U",
"end": 450,
"score": 0.8831489682197571,
"start": 437,
"tag": "USERNAME",
"value": "Administrator"
},
{
"context": "zhen.aliyuncs.com\";\n String accessKeyId = \"LTAI6D9vZzrSgSqr\";\n String accessKeySecret = \"mK0XcIm6BFhow",
"end": 754,
"score": 0.9982990026473999,
"start": 738,
"tag": "KEY",
"value": "LTAI6D9vZzrSgSqr"
},
{
"context": "I6D9vZzrSgSqr\";\n String accessKeySecret = \"mK0XcIm6BFhowuOEvBBzmRXZmAmTDD\";\n OSSClient ossClient = new OSSClient(end",
"end": 821,
"score": 0.9997454881668091,
"start": 791,
"tag": "KEY",
"value": "mK0XcIm6BFhowuOEvBBzmRXZmAmTDD"
}
] | null | [] | package jxufe.lwl.eshop.controller;
import com.aliyun.oss.OSSClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by Administrator on 2018/8/14 0014.
*/
@Controller
public class UploadFileController {
@RequestMapping("uploadfile")
@ResponseBody
public Object uploadFile(@RequestParam("fs")MultipartFile file){
String endpoint = "http://oss-cn-shenzhen.aliyuncs.com";
String accessKeyId = "<KEY>";
String accessKeySecret = "<KEY>";
OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
String buckName="newwld";
try {
InputStream inputStream=file.getInputStream();
ossClient.putObject(buckName,file.getOriginalFilename(), inputStream);
} catch (IOException e) {
e.printStackTrace();
}finally {
ossClient.shutdown();
}
return endpoint.replace("http://","http://"+buckName+".")+"/"+file.getOriginalFilename();
}
}
| 1,301 | 0.712042 | 0.700823 | 38 | 34.184212 | 26.878729 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.631579 | false | false | 3 |
d7ae55ed5291a19061a1ddbc9110e72e20017051 | 7,413,113,618,285 | e290601b463b7edc3723fcf010ec38047751e3b9 | /02 - Strategy/khangnt_518H0372_lab02_ws/Test-ws/lab02.tdt/src/main/java/StrategyPattern/Student.java | 0f2dab59159fd207214b8b05defd9157cd436f9b | [] | no_license | kelvng/Design-Patterns | https://github.com/kelvng/Design-Patterns | f5ba7517a97506f47952fb537d8bad9ac0bf8002 | e509cc2732e16133e2191ec7131cb1b3f3daac90 | refs/heads/main | 2023-08-25T16:19:20.174000 | 2021-10-20T12:20:46 | 2021-10-20T12:20:46 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package StrategyPattern;
import java.util.Date;
public class Student {
private int code;
private String name;
private Date birthdate;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getBirthdate() {
return birthdate;
}
public void setBirthdate(Date birthdate) {
this.birthdate = birthdate;
}
@Override
public String toString() {
return "Student [code=" + code + ", name=" + name + ", birthdate=" + birthdate + "]";
}
}
| UTF-8 | Java | 605 | java | Student.java | Java | [] | null | [] | package StrategyPattern;
import java.util.Date;
public class Student {
private int code;
private String name;
private Date birthdate;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getBirthdate() {
return birthdate;
}
public void setBirthdate(Date birthdate) {
this.birthdate = birthdate;
}
@Override
public String toString() {
return "Student [code=" + code + ", name=" + name + ", birthdate=" + birthdate + "]";
}
}
| 605 | 0.67438 | 0.67438 | 32 | 17.90625 | 17.24159 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.46875 | false | false | 3 |
f7d74dbcb367f091921780c6e98059168fe90000 | 29,343,216,599,397 | 63b90acb0e25c844a872933db01c5e527dc044e2 | /net-worth-be/src/main/java/com/adnan/networth/objs/Resource.java | 5db3f820c8765ae1b5651c9f9cbd16102bf9b020 | [] | no_license | adnanb59/track-net-worth | https://github.com/adnanb59/track-net-worth | 465aa62b45598352098d7719cf3e87f687089c18 | bdcc586e2ed576c051a58a9e560f3927ad550966 | refs/heads/master | 2020-07-13T00:57:53.670000 | 2019-09-12T07:47:25 | 2019-09-12T07:47:25 | 204,953,294 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.adnan.networth.objs;
import javax.persistence.Embeddable;
import java.util.HashMap;
@Embeddable
public class Resource {
public final String key;
public HashMap<String, Item> items;
private double total;
public Resource(String key) {
this.key = key;
items = new HashMap<String, Item>();
total = 0;
}
public void addItem(Item item) {
items.put(item.label, item);
total += item.value;
};
public Iterable<Item> getItems() {
return items.values();
};
public double updateItem(String key, double val) {
double v = val - items.get(key).value;
total += v;
items.get(key).updateItem(val);
return v;
}
public double getTotal() {
return total;
}
public void removeItem(String key) {
total -= items.get(key).value;
items.remove(key);
}
public boolean equals(Resource r) {
return r.key == this.key;
};
}
| UTF-8 | Java | 992 | java | Resource.java | Java | [] | null | [] | package com.adnan.networth.objs;
import javax.persistence.Embeddable;
import java.util.HashMap;
@Embeddable
public class Resource {
public final String key;
public HashMap<String, Item> items;
private double total;
public Resource(String key) {
this.key = key;
items = new HashMap<String, Item>();
total = 0;
}
public void addItem(Item item) {
items.put(item.label, item);
total += item.value;
};
public Iterable<Item> getItems() {
return items.values();
};
public double updateItem(String key, double val) {
double v = val - items.get(key).value;
total += v;
items.get(key).updateItem(val);
return v;
}
public double getTotal() {
return total;
}
public void removeItem(String key) {
total -= items.get(key).value;
items.remove(key);
}
public boolean equals(Resource r) {
return r.key == this.key;
};
}
| 992 | 0.589718 | 0.58871 | 46 | 20.565218 | 15.983214 | 54 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.586957 | false | false | 3 |
fe61465429c462c77ce604740e22a06860db1038 | 584,115,600,286 | 7797ab1d781d309b7f2e64092c4859e11c8f7287 | /OperationFactory.java | 485c9b8f3c9567ffc1e34cbee582fefec4cba373 | [] | no_license | MrDreammy/Homework | https://github.com/MrDreammy/Homework | 9cf23261a6c7c6f1f96ee94592eb808f89b54b0a | 1cbddb25baee4d181827612d9f3010e889f1ce78 | refs/heads/master | 2021-06-29T04:50:16.001000 | 2017-09-25T18:52:57 | 2017-09-25T18:52:57 | 104,789,876 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public interface OperationFactory {
Operation getOpInstance( String op );
}
| UTF-8 | Java | 81 | java | OperationFactory.java | Java | [] | null | [] |
public interface OperationFactory {
Operation getOpInstance( String op );
}
| 81 | 0.753086 | 0.753086 | 3 | 25.666666 | 17.613127 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 3 |
0a3493dc967786b2759f9c7e3000dc6f79bc74ba | 18,322,330,538,496 | 25d1bf25b4964f62ee65ed2c1e016c1c22ba6526 | /app/src/main/java/com/example/u17/moudle_search/ascytask/SerachStatisticMoreAscytask.java | f94ccaea27492ec0461d5c4ec703fa249dcd691a | [] | no_license | pengyongshun/U17 | https://github.com/pengyongshun/U17 | 9908d229fd2db380611f349c89dbf88dc73c12c6 | adf9ca5e16241c3739a28b5661da32a35a2b4790 | refs/heads/master | 2020-12-04T21:32:47.011000 | 2020-06-26T02:57:52 | 2020-06-26T02:57:52 | 67,663,393 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.u17.moudle_search.ascytask;
import android.os.AsyncTask;
import com.example.u17.base_uitls.net_uitls.HttpURLUtils;
import com.example.u17.moudle_search.bean.SerachStatisticMoreBean;
import com.google.gson.Gson;
import com.squareup.picasso.Picasso;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
/**
* @Author:pengyongshun
* @Desc:
* @Time:2016/9/10
*/
public class SerachStatisticMoreAscytask extends AsyncTask<String,Void,SerachStatisticMoreBean> {
private SSMCallBack ssmCallBack;
public SerachStatisticMoreAscytask(SSMCallBack ssmCallBack) {
this.ssmCallBack = ssmCallBack;
}
@Override
protected SerachStatisticMoreBean doInBackground(String... params) {
SerachStatisticMoreBean bean=new SerachStatisticMoreBean();
byte[] bytes = HttpURLUtils.getBytesFromNetWorkGetMethod(params[0]);
String json=new String(bytes,0,bytes.length);
if (json==null){
return null;
}
try {
SerachStatisticMoreBean.ComicBean comic1 = new SerachStatisticMoreBean.ComicBean();
JSONObject object=new JSONObject(json);
String data = object.getString("data");
JSONObject object1 = new JSONObject(data);
JSONObject returnData = object1.getJSONObject("returnData");
JSONObject comic = returnData.getJSONObject("comic");
String cover = comic.getString("cover");
String comic_id = comic.getString("comic_id");
JSONObject author = comic.getJSONObject("author");
String name = author.getString("name");
String avatar = author.getString("avatar");
String short_description = comic.getString("short_description");
JSONArray theme_ids = comic.getJSONArray("theme_ids");
int i1 = theme_ids.length();
List<String> ids=new ArrayList<>();
for (int i = 0; i < i1; i++) {
String them_id = theme_ids.getString(i);
ids.add(them_id);
}
String name1 = comic.getString("name");
String description = comic.getString("description");
String last_update_week = comic.getString("last_update_week");
String cate_id = comic.getString("cate_id");
comic1.setComic_id(comic_id);
comic1.setName(name1);
comic1.setCate_id(cate_id);
comic1.setLast_update_week(last_update_week);
comic1.setShort_description(short_description);
comic1.setDescription(description);
SerachStatisticMoreBean.ComicBean.AuthorBean author1 = new SerachStatisticMoreBean.ComicBean.AuthorBean();
author1.setName(name);
author1.setAvatar(avatar);
comic1.setCover(cover);
comic1.setTheme_ids(ids);
comic1.setAuthor(author1);
bean.setComic(comic1);
//,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,chapter_list
List<SerachStatisticMoreBean.ChapterListBean> chapter_list1 = new ArrayList<>();
JSONArray chapter_list = returnData.getJSONArray("chapter_list");
int length = chapter_list.length();
for (int i = 0; i < length; i++) {
SerachStatisticMoreBean.ChapterListBean chapterListBean=new SerachStatisticMoreBean.ChapterListBean();
JSONObject jsonObject = chapter_list.getJSONObject(i);
String name2 = jsonObject.getString("name");
chapterListBean.setName(name2);
chapter_list1.add(chapterListBean);
}
bean.setChapter_list(chapter_list1);
//---------------otherwork
List<SerachStatisticMoreBean.OtherWorksBean> otherWorks1 = new ArrayList<>();
JSONArray otherWorks = returnData.getJSONArray("otherWorks");
int length1 = otherWorks.length();
for (int i = 0; i < length1; i++) {
SerachStatisticMoreBean.OtherWorksBean otherWorksBean=new SerachStatisticMoreBean.OtherWorksBean();
JSONObject jsonObject = otherWorks.getJSONObject(i);
String comicId = jsonObject.getString("comicId");
String coverUrl = jsonObject.getString("coverUrl");
String name3 = jsonObject.getString("name");
otherWorksBean.setName(name3);
otherWorksBean.setComicId(comicId);
otherWorksBean.setCoverUrl(coverUrl);
otherWorks1.add(otherWorksBean);
}
bean.setOtherWorks(otherWorks1);
return bean;
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(SerachStatisticMoreBean serachStatisticMoreBean) {
ssmCallBack.callBack(serachStatisticMoreBean);
}
public interface SSMCallBack{
void callBack(SerachStatisticMoreBean serachStatisticMoreBean);
}
}
| UTF-8 | Java | 5,105 | java | SerachStatisticMoreAscytask.java | Java | [
{
"context": "ArrayList;\nimport java.util.List;\n\n/**\n * @Author:pengyongshun\n * @Desc:\n * @Time:2016/9/10\n */\npublic class Ser",
"end": 437,
"score": 0.9996695518493652,
"start": 425,
"tag": "USERNAME",
"value": "pengyongshun"
},
{
"context": "micBean.AuthorBean();\n author1.setName(name);\n author1.setAvatar(avatar);\n ",
"end": 2821,
"score": 0.9926413297653198,
"start": 2817,
"tag": "NAME",
"value": "name"
}
] | null | [] | package com.example.u17.moudle_search.ascytask;
import android.os.AsyncTask;
import com.example.u17.base_uitls.net_uitls.HttpURLUtils;
import com.example.u17.moudle_search.bean.SerachStatisticMoreBean;
import com.google.gson.Gson;
import com.squareup.picasso.Picasso;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
/**
* @Author:pengyongshun
* @Desc:
* @Time:2016/9/10
*/
public class SerachStatisticMoreAscytask extends AsyncTask<String,Void,SerachStatisticMoreBean> {
private SSMCallBack ssmCallBack;
public SerachStatisticMoreAscytask(SSMCallBack ssmCallBack) {
this.ssmCallBack = ssmCallBack;
}
@Override
protected SerachStatisticMoreBean doInBackground(String... params) {
SerachStatisticMoreBean bean=new SerachStatisticMoreBean();
byte[] bytes = HttpURLUtils.getBytesFromNetWorkGetMethod(params[0]);
String json=new String(bytes,0,bytes.length);
if (json==null){
return null;
}
try {
SerachStatisticMoreBean.ComicBean comic1 = new SerachStatisticMoreBean.ComicBean();
JSONObject object=new JSONObject(json);
String data = object.getString("data");
JSONObject object1 = new JSONObject(data);
JSONObject returnData = object1.getJSONObject("returnData");
JSONObject comic = returnData.getJSONObject("comic");
String cover = comic.getString("cover");
String comic_id = comic.getString("comic_id");
JSONObject author = comic.getJSONObject("author");
String name = author.getString("name");
String avatar = author.getString("avatar");
String short_description = comic.getString("short_description");
JSONArray theme_ids = comic.getJSONArray("theme_ids");
int i1 = theme_ids.length();
List<String> ids=new ArrayList<>();
for (int i = 0; i < i1; i++) {
String them_id = theme_ids.getString(i);
ids.add(them_id);
}
String name1 = comic.getString("name");
String description = comic.getString("description");
String last_update_week = comic.getString("last_update_week");
String cate_id = comic.getString("cate_id");
comic1.setComic_id(comic_id);
comic1.setName(name1);
comic1.setCate_id(cate_id);
comic1.setLast_update_week(last_update_week);
comic1.setShort_description(short_description);
comic1.setDescription(description);
SerachStatisticMoreBean.ComicBean.AuthorBean author1 = new SerachStatisticMoreBean.ComicBean.AuthorBean();
author1.setName(name);
author1.setAvatar(avatar);
comic1.setCover(cover);
comic1.setTheme_ids(ids);
comic1.setAuthor(author1);
bean.setComic(comic1);
//,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,chapter_list
List<SerachStatisticMoreBean.ChapterListBean> chapter_list1 = new ArrayList<>();
JSONArray chapter_list = returnData.getJSONArray("chapter_list");
int length = chapter_list.length();
for (int i = 0; i < length; i++) {
SerachStatisticMoreBean.ChapterListBean chapterListBean=new SerachStatisticMoreBean.ChapterListBean();
JSONObject jsonObject = chapter_list.getJSONObject(i);
String name2 = jsonObject.getString("name");
chapterListBean.setName(name2);
chapter_list1.add(chapterListBean);
}
bean.setChapter_list(chapter_list1);
//---------------otherwork
List<SerachStatisticMoreBean.OtherWorksBean> otherWorks1 = new ArrayList<>();
JSONArray otherWorks = returnData.getJSONArray("otherWorks");
int length1 = otherWorks.length();
for (int i = 0; i < length1; i++) {
SerachStatisticMoreBean.OtherWorksBean otherWorksBean=new SerachStatisticMoreBean.OtherWorksBean();
JSONObject jsonObject = otherWorks.getJSONObject(i);
String comicId = jsonObject.getString("comicId");
String coverUrl = jsonObject.getString("coverUrl");
String name3 = jsonObject.getString("name");
otherWorksBean.setName(name3);
otherWorksBean.setComicId(comicId);
otherWorksBean.setCoverUrl(coverUrl);
otherWorks1.add(otherWorksBean);
}
bean.setOtherWorks(otherWorks1);
return bean;
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(SerachStatisticMoreBean serachStatisticMoreBean) {
ssmCallBack.callBack(serachStatisticMoreBean);
}
public interface SSMCallBack{
void callBack(SerachStatisticMoreBean serachStatisticMoreBean);
}
}
| 5,105 | 0.628795 | 0.618805 | 118 | 42.262711 | 27.414406 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.084746 | false | false | 3 |
69275ad92c4d953a9ea0f54e22aa58404256f53e | 18,322,330,540,206 | b839d14c856a328575ca545361d133c3aaf1c4c3 | /src/main/java/utility/Analyzers.java | 9d837987cba5a169639e58268be673455761249d | [] | no_license | ahmetaydin123/jLDADMM | https://github.com/ahmetaydin123/jLDADMM | 7a9a896e3f9c03a25a9645f6268d14fb3e72cca2 | 9d5a6991a45d5a93ed0feaef67fd7df12ee8d400 | refs/heads/master | 2023-07-14T20:17:11.526000 | 2021-08-23T21:15:13 | 2021-08-23T21:15:13 | 399,237,896 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package utility;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.core.SimpleAnalyzer;
import org.apache.lucene.analysis.custom.CustomAnalyzer;
import org.apache.lucene.analysis.miscellaneous.PerFieldAnalyzerWrapper;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static utility.Tag.KStem;
/**
* Utility to hold {@link Analyzer} implementation used in this work.
*/
public class Analyzers {
public static final String FIELD = "field";
public static final String[] scripts = new String[]{
"Jpan",
"Cyrillic",
"Greek",
"Arabic",
"Hangul",
"Thai",
"Armenian",
"Devanagari",
"Hebrew",
"Georgian"
};
/**
* Intended to use with one term queries (otq) only
*
* @param text input string to analyze
* @return analyzed input
*/
public static String getAnalyzedToken(String text, Analyzer analyzer) {
final List<String> list = getAnalyzedTokens(text, analyzer);
if (list.size() != 1)
throw new RuntimeException("Text : " + text + " contains more than one tokens : " + list.toString());
return list.get(0);
}
/**
* Modified from : http://lucene.apache.org/core/4_10_2/core/org/apache/lucene/analysis/package-summary.html
*/
public static List<String> getAnalyzedTokens(String text, Analyzer analyzer) {
final List<String> list = new ArrayList<>();
if(text == null || text.isEmpty()) return list;
try (TokenStream ts = analyzer.tokenStream(FIELD, new StringReader(text))) {
final CharTermAttribute termAtt = ts.addAttribute(CharTermAttribute.class);
ts.reset(); // Resets this stream to the beginning. (Required)
while (ts.incrementToken())
list.add(termAtt.toString());
ts.end(); // Perform end-of-stream operations, e.g. set the final offset.
} catch (IOException ioe) {
throw new RuntimeException("happened during string analysis", ioe);
}
return list;
}
public static Analyzer analyzer(Tag tag) {
try {
return anlyzr(tag);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
private static Analyzer anlyzr(Tag tag) throws IOException {
switch (tag) {
case NoStem:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("lowercase")
.build();
case KStem:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("lowercase")
.addTokenFilter("englishpossessive")
.addTokenFilter("stop")
.addTokenFilter("kstem")
.build();
case Snowball:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("lowercase")
.addTokenFilter("englishpossessive")
.addTokenFilter("snowballporter", "language", "English")
.build();
case ICU:
return CustomAnalyzer.builder()
.withTokenizer("icu")
.addTokenFilter("lowercase")
.addTokenFilter("kstem")
.build();
case SnowballTurkish:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("apostrophe")
.addTokenFilter("turkishlowercase")
.addTokenFilter("snowballporter", "language", "Turkish")
.build();
case F5:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("apostrophe")
.addTokenFilter("turkishlowercase")
.addTokenFilter("truncate", "prefixLength", "5")
.build();
case NoStemTurkish:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("apostrophe")
.addTokenFilter("turkishlowercase")
.build();
case KStemField: {
Map<String, Analyzer> analyzerPerField = new HashMap<>();
analyzerPerField.put("url", new SimpleAnalyzer());
return new PerFieldAnalyzerWrapper(
Analyzers.analyzer(KStem), analyzerPerField);
}
default:
throw new AssertionError(Analyzers.class);
}
}
}
| UTF-8 | Java | 5,256 | java | Analyzers.java | Java | [] | null | [] | package utility;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.core.SimpleAnalyzer;
import org.apache.lucene.analysis.custom.CustomAnalyzer;
import org.apache.lucene.analysis.miscellaneous.PerFieldAnalyzerWrapper;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static utility.Tag.KStem;
/**
* Utility to hold {@link Analyzer} implementation used in this work.
*/
public class Analyzers {
public static final String FIELD = "field";
public static final String[] scripts = new String[]{
"Jpan",
"Cyrillic",
"Greek",
"Arabic",
"Hangul",
"Thai",
"Armenian",
"Devanagari",
"Hebrew",
"Georgian"
};
/**
* Intended to use with one term queries (otq) only
*
* @param text input string to analyze
* @return analyzed input
*/
public static String getAnalyzedToken(String text, Analyzer analyzer) {
final List<String> list = getAnalyzedTokens(text, analyzer);
if (list.size() != 1)
throw new RuntimeException("Text : " + text + " contains more than one tokens : " + list.toString());
return list.get(0);
}
/**
* Modified from : http://lucene.apache.org/core/4_10_2/core/org/apache/lucene/analysis/package-summary.html
*/
public static List<String> getAnalyzedTokens(String text, Analyzer analyzer) {
final List<String> list = new ArrayList<>();
if(text == null || text.isEmpty()) return list;
try (TokenStream ts = analyzer.tokenStream(FIELD, new StringReader(text))) {
final CharTermAttribute termAtt = ts.addAttribute(CharTermAttribute.class);
ts.reset(); // Resets this stream to the beginning. (Required)
while (ts.incrementToken())
list.add(termAtt.toString());
ts.end(); // Perform end-of-stream operations, e.g. set the final offset.
} catch (IOException ioe) {
throw new RuntimeException("happened during string analysis", ioe);
}
return list;
}
public static Analyzer analyzer(Tag tag) {
try {
return anlyzr(tag);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
private static Analyzer anlyzr(Tag tag) throws IOException {
switch (tag) {
case NoStem:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("lowercase")
.build();
case KStem:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("lowercase")
.addTokenFilter("englishpossessive")
.addTokenFilter("stop")
.addTokenFilter("kstem")
.build();
case Snowball:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("lowercase")
.addTokenFilter("englishpossessive")
.addTokenFilter("snowballporter", "language", "English")
.build();
case ICU:
return CustomAnalyzer.builder()
.withTokenizer("icu")
.addTokenFilter("lowercase")
.addTokenFilter("kstem")
.build();
case SnowballTurkish:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("apostrophe")
.addTokenFilter("turkishlowercase")
.addTokenFilter("snowballporter", "language", "Turkish")
.build();
case F5:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("apostrophe")
.addTokenFilter("turkishlowercase")
.addTokenFilter("truncate", "prefixLength", "5")
.build();
case NoStemTurkish:
return CustomAnalyzer.builder()
.withTokenizer("standard")
.addTokenFilter("apostrophe")
.addTokenFilter("turkishlowercase")
.build();
case KStemField: {
Map<String, Analyzer> analyzerPerField = new HashMap<>();
analyzerPerField.put("url", new SimpleAnalyzer());
return new PerFieldAnalyzerWrapper(
Analyzers.analyzer(KStem), analyzerPerField);
}
default:
throw new AssertionError(Analyzers.class);
}
}
}
| 5,256 | 0.538052 | 0.53653 | 153 | 33.35294 | 26.135761 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.431373 | false | false | 3 |
7ae98aaee1156ae4ba664e08b558250e231d1c16 | 27,891,517,684,124 | fbac4d81aa503a574a82fb12d4969e443a46a2be | /SpringBootSample/src/main/java/com/example/form/ValidGroup2.java | 0b5a73ccd1d56bd8b2db2a5445bba6c4fc66b0bf | [] | no_license | Hiroki0109Saito/sample | https://github.com/Hiroki0109Saito/sample | 88c7fdebe9168fa58182056ac9e1a4989ffd5987 | 2ad5d8480e9b9699de2425bb610706280ac2c3a8 | refs/heads/master | 2023-06-25T06:39:59.531000 | 2021-07-27T02:54:27 | 2021-07-27T02:54:27 | 389,828,715 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.form;
public interface ValidGroup2 {
}
| UTF-8 | Java | 61 | java | ValidGroup2.java | Java | [] | null | [] | package com.example.form;
public interface ValidGroup2 {
}
| 61 | 0.770492 | 0.754098 | 5 | 11.2 | 13.40746 | 30 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false | 3 |
95c1457497a8553ddfdecc7c705ae87451656a69 | 28,020,366,710,065 | ea7b9484875df4b4f38d861e5aaec00415ab6a72 | /src/main/java/br/com/inf/model/Valor.java | 4b5375850ab3cc93e83fd337df523ae589ca4647 | [] | no_license | thdurante/saep-antigo | https://github.com/thdurante/saep-antigo | 334ad5b743f76983f5920946dee74094aa79b2a7 | 1043435c45769f127c1024fcd7aa00b2f050b26d | refs/heads/master | 2021-05-31T18:44:07.981000 | 2016-06-21T12:26:09 | 2016-06-21T12:26:09 | 60,131,579 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.com.inf.model;
/**
* Encapsula um valor para um dos tipos
* de um dado atributo de um relato.
*
* Um relato é descrito por uma coleção de
* valores, por exemplo, um relato correspondente
* a um "livro" pode ter atributos como "titulo"
* e "numeroPaginas", dentre outros. Um valor
* correspondente para "titulo" de um dado relato
* pode ser "Amar e ser livre", enquanto o valor
* para "numeroPaginas" pode ser 209, por exemplo.
*
* Uma instância dessa classe é empregada para
* reter qualquer um desses valores. A recuperação
* do valor depende do uso do método <b>get</b>
* correspondente ao tipo. Cabe a quem envia uma
* mensagem para uma instância de valor fazer
* uso do método correto.
*/
public class Valor {
/**
* Container para o valor numérico da instância.
*/
private double real;
/**
* Container para o valor lógico da instância.
*/
private boolean logico;
/**
* Container para a sequência de caracteres mantida pela instância.
*/
private String string;
/**
* Cria uma instância cujo valor é um número real.
* @param real Número real correspondente ao valor.
*/
public Valor(double real) {
this.real = real;
}
/**
* Cria uma instância cujo valor é um booleano.
* @param logico Boolean correspondente ao valor.
*/
public Valor(boolean logico) {
this.logico = logico;
}
/**
* Cria uma instância cujo valor é uma sequência de caracteres.
* @param string Sequência de caracteres correspondente ao valor.
*/
public Valor(String string) {
this.string = string;
}
/**
* Recupera o valor real (numérico) armazenado na instância.
* @return O valor real (numérico) correspondente à instância.
*/
public double getReal() {
return real;
}
/**
* Recupera o valor lógico armazenado na instância.
* @return O valor {@code true} ou {@code false} correspondente à instância.
*/
public boolean getLogico() {
return logico;
}
/**
* Recupera a sequência de caracteres armazenada na instância.
* @return A sequência de caracteres correspondente à instância.
*/
public String getString() {
return string;
}
}
| UTF-8 | Java | 2,340 | java | Valor.java | Java | [] | null | [] | package br.com.inf.model;
/**
* Encapsula um valor para um dos tipos
* de um dado atributo de um relato.
*
* Um relato é descrito por uma coleção de
* valores, por exemplo, um relato correspondente
* a um "livro" pode ter atributos como "titulo"
* e "numeroPaginas", dentre outros. Um valor
* correspondente para "titulo" de um dado relato
* pode ser "Amar e ser livre", enquanto o valor
* para "numeroPaginas" pode ser 209, por exemplo.
*
* Uma instância dessa classe é empregada para
* reter qualquer um desses valores. A recuperação
* do valor depende do uso do método <b>get</b>
* correspondente ao tipo. Cabe a quem envia uma
* mensagem para uma instância de valor fazer
* uso do método correto.
*/
public class Valor {
/**
* Container para o valor numérico da instância.
*/
private double real;
/**
* Container para o valor lógico da instância.
*/
private boolean logico;
/**
* Container para a sequência de caracteres mantida pela instância.
*/
private String string;
/**
* Cria uma instância cujo valor é um número real.
* @param real Número real correspondente ao valor.
*/
public Valor(double real) {
this.real = real;
}
/**
* Cria uma instância cujo valor é um booleano.
* @param logico Boolean correspondente ao valor.
*/
public Valor(boolean logico) {
this.logico = logico;
}
/**
* Cria uma instância cujo valor é uma sequência de caracteres.
* @param string Sequência de caracteres correspondente ao valor.
*/
public Valor(String string) {
this.string = string;
}
/**
* Recupera o valor real (numérico) armazenado na instância.
* @return O valor real (numérico) correspondente à instância.
*/
public double getReal() {
return real;
}
/**
* Recupera o valor lógico armazenado na instância.
* @return O valor {@code true} ou {@code false} correspondente à instância.
*/
public boolean getLogico() {
return logico;
}
/**
* Recupera a sequência de caracteres armazenada na instância.
* @return A sequência de caracteres correspondente à instância.
*/
public String getString() {
return string;
}
}
| 2,340 | 0.644348 | 0.643043 | 86 | 25.744186 | 22.816856 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.174419 | false | false | 3 |
0401d4340fca8ed59037b5b3c48186387fa09bc0 | 23,733,989,280,554 | 73c437f2e49ef488f333a9bcf6566be551c6e2b5 | /hannnoon/WEB-INF/classes/com/hannoon/search/model/SearchResultNewsDto.java | ad73ec9e27077641dc0ba7fa03b509742b1a8179 | [] | no_license | cs1992/Hannoon | https://github.com/cs1992/Hannoon | cdcdab8033f250e3b4b1ce12162364c85dbe7231 | 12d67d94ca2b4f70fee4100f5054ec31a7ca10e3 | refs/heads/master | 2020-03-29T08:00:26.777000 | 2017-07-06T08:35:16 | 2017-07-06T08:35:16 | 94,664,908 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.hannoon.search.model;
import org.json.simple.JSONObject;
import com.hannoon.util.DateFormat;
import com.hannoon.util.SearchConstance;
import com.hannoon.util.SearchConstance.Engine;
public class SearchResultNewsDto extends SearchResultDto {
private String hostLink;
private String postDate;
public SearchResultNewsDto(Engine engineType) {
super(engineType);
}
public String getHostLink() {
return hostLink;
}
public void setHostLink(String hostLink) {
this.hostLink = hostLink;
}
public String getPostDate() {
return postDate;
}
public void setPostDate(String postDate) {
this.postDate = postDate;
}
@Override
public void setField(JSONObject item) {
super.setField(item);
hostLink = (String) item.get(SearchConstance.NaverResult.ORIGINAL_LINK);
// postDate = (String) item.get(SearchConstance.NaverResult.PUB_DATE);
postDate = DateFormat.changeRSSDateFormat((String) item.get(SearchConstance.NaverResult.PUB_DATE));
}
@Override
public String toString() {
StringBuilder toString = new StringBuilder(super.toString());
toString.append("hostLink : " + hostLink + "\n");
toString.append("postDate : " + postDate + "\n");
toString.append("------------------------------------------\n");
return toString.toString();
}
}
| UTF-8 | Java | 1,357 | java | SearchResultNewsDto.java | Java | [] | null | [] | package com.hannoon.search.model;
import org.json.simple.JSONObject;
import com.hannoon.util.DateFormat;
import com.hannoon.util.SearchConstance;
import com.hannoon.util.SearchConstance.Engine;
public class SearchResultNewsDto extends SearchResultDto {
private String hostLink;
private String postDate;
public SearchResultNewsDto(Engine engineType) {
super(engineType);
}
public String getHostLink() {
return hostLink;
}
public void setHostLink(String hostLink) {
this.hostLink = hostLink;
}
public String getPostDate() {
return postDate;
}
public void setPostDate(String postDate) {
this.postDate = postDate;
}
@Override
public void setField(JSONObject item) {
super.setField(item);
hostLink = (String) item.get(SearchConstance.NaverResult.ORIGINAL_LINK);
// postDate = (String) item.get(SearchConstance.NaverResult.PUB_DATE);
postDate = DateFormat.changeRSSDateFormat((String) item.get(SearchConstance.NaverResult.PUB_DATE));
}
@Override
public String toString() {
StringBuilder toString = new StringBuilder(super.toString());
toString.append("hostLink : " + hostLink + "\n");
toString.append("postDate : " + postDate + "\n");
toString.append("------------------------------------------\n");
return toString.toString();
}
}
| 1,357 | 0.683125 | 0.683125 | 56 | 22.232143 | 24.171257 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.428571 | false | false | 3 |
3f77b1025c6fef8b008b2134e3181aebe1de5110 | 31,945,966,805,507 | c36fe1edf3500ac58a4ac80a59d6fc5dcaf4e0e6 | /src/main/java/com/tbsinfo/questionlib/controller/TestSpiderContrlller.java | 12a3a9c807da87ab419af12420bd535ee91a9a9a | [] | no_license | Jwz666/questionlib | https://github.com/Jwz666/questionlib | 35ceeb6bb6eb956aec4ecaa3fe4d6dcb194c0f7b | c59ebd62ffc50afb37a1e043cdc9bc7713f65ec3 | refs/heads/master | 2022-09-04T17:00:46.470000 | 2019-11-05T06:46:05 | 2019-11-05T06:46:05 | 219,675,121 | 1 | 0 | null | false | 2022-09-01T23:15:23 | 2019-11-05T06:39:05 | 2020-08-05T04:38:53 | 2022-09-01T23:15:20 | 25,519 | 1 | 0 | 4 | JavaScript | false | false | package com.tbsinfo.questionlib.controller;
import org.springframework.web.bind.annotation.RestController;
/**
* @author jayMamba
* @date 2019/10/15
* @time 15:19
* @desc
*/
@RestController
public class TestSpiderContrlller {
}
| UTF-8 | Java | 236 | java | TestSpiderContrlller.java | Java | [
{
"context": "eb.bind.annotation.RestController;\n\n/**\n * @author jayMamba\n * @date 2019/10/15\n * @time 15:19\n * @desc\n */\n@",
"end": 132,
"score": 0.9947870969772339,
"start": 124,
"tag": "USERNAME",
"value": "jayMamba"
}
] | null | [] | package com.tbsinfo.questionlib.controller;
import org.springframework.web.bind.annotation.RestController;
/**
* @author jayMamba
* @date 2019/10/15
* @time 15:19
* @desc
*/
@RestController
public class TestSpiderContrlller {
}
| 236 | 0.745763 | 0.694915 | 14 | 15.857142 | 18.173203 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | false | false | 3 |
c8cba1d59011c57ff68fdac7dd9d53c0f4984a84 | 13,391,708,046,570 | 5e0e08c98e2819d3591c8ad29ee418ded5f21d8f | /backend/src/main/java/com/jian/propertymanagesystem/entity/House.java | 332e8fc99954a47b65fcf61df6f556c18842b48a | [] | no_license | QTJ2019/propertymanagesystem | https://github.com/QTJ2019/propertymanagesystem | 2041676a3ea6e47439e5e305aa8c2f9268fe1fbe | a6041797aa412fb47e6af50db7201d85e82ced6f | refs/heads/main | 2023-03-25T01:35:59.014000 | 2021-03-20T03:40:49 | 2021-03-20T03:40:49 | 310,321,287 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.jian.propertymanagesystem.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.net.Proxy;
/**
* @Author: qtj
* @Date: 2021/2/1 17:53
* @Version
*/
@Data
@TableName("t_house")
public class House {
@TableId(type = IdType.AUTO)
@ExcelIgnore
private Integer id;
private Integer unit;
private Integer building;
private Integer floor;
private Integer room;
@TableField(exist = false)
@ExcelIgnore
private String owner;
}
| UTF-8 | Java | 774 | java | House.java | Java | [
{
"context": "bok.Data;\n\nimport java.net.Proxy;\n\n/**\n * @Author: qtj\n * @Date: 2021/2/1 17:53\n * @Version\n */\n@Data\n@T",
"end": 423,
"score": 0.99955153465271,
"start": 420,
"tag": "USERNAME",
"value": "qtj"
}
] | null | [] | package com.jian.propertymanagesystem.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.net.Proxy;
/**
* @Author: qtj
* @Date: 2021/2/1 17:53
* @Version
*/
@Data
@TableName("t_house")
public class House {
@TableId(type = IdType.AUTO)
@ExcelIgnore
private Integer id;
private Integer unit;
private Integer building;
private Integer floor;
private Integer room;
@TableField(exist = false)
@ExcelIgnore
private String owner;
}
| 774 | 0.75323 | 0.74031 | 32 | 23.1875 | 17.192726 | 54 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.46875 | false | false | 3 |
9061781d3e4e530fd2b39618763a45cb7648c8a7 | 28,544,352,662,926 | 2f64224794d22a899a50891ecc300789471b33aa | /src/main/java/com/dbp/trigger/TriggerController.java | fb60dabf45b9574e78c492e3ce1e629b68905f2c | [
"Apache-2.0"
] | permissive | woxiai/dbp | https://github.com/woxiai/dbp | 0d642c653ed0f8ed6b14180918da17fdc06f47ed | baefbeaeb399c72c68bf0904a90ceb2207d37000 | refs/heads/master | 2018-01-12T03:29:02.869000 | 2016-02-29T11:19:08 | 2016-02-29T11:19:08 | 50,112,703 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.dbp.trigger;
import com.dbp.trigger.models.IpRecords;
import com.dbp.trigger.services.IpCountsServices;
import com.dbp.trigger.services.IpRecordsServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* Created by Administrator on 2016/2/22.
*/
@RestController
@RequestMapping("/tri")
public class TriggerController {
@Autowired
private IpRecordsServices service;
@Autowired
private IpCountsServices countsServices;
@RequestMapping("/save")
public IpRecords save(HttpServletRequest request){
String ip = request.getRemoteHost();
String useragent = request.getHeader("User-Agent");
IpRecords record = new IpRecords();
record.setIp(ip);
record.setUserAgent(useragent);
IpRecords records = null;
try{
records = service.save(record);
if (records != null){
long id = records.getId();
countsServices.updateCount(id, 1);
}
}catch (Exception ex){
}
return records;
}
}
| UTF-8 | Java | 1,252 | java | TriggerController.java | Java | [
{
"context": "ervlet.http.HttpServletRequest;\n\n/**\n * Created by Administrator on 2016/2/22.\n */\n@RestController\n@RequestMapping",
"end": 436,
"score": 0.9522722959518433,
"start": 423,
"tag": "USERNAME",
"value": "Administrator"
}
] | null | [] | package com.dbp.trigger;
import com.dbp.trigger.models.IpRecords;
import com.dbp.trigger.services.IpCountsServices;
import com.dbp.trigger.services.IpRecordsServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* Created by Administrator on 2016/2/22.
*/
@RestController
@RequestMapping("/tri")
public class TriggerController {
@Autowired
private IpRecordsServices service;
@Autowired
private IpCountsServices countsServices;
@RequestMapping("/save")
public IpRecords save(HttpServletRequest request){
String ip = request.getRemoteHost();
String useragent = request.getHeader("User-Agent");
IpRecords record = new IpRecords();
record.setIp(ip);
record.setUserAgent(useragent);
IpRecords records = null;
try{
records = service.save(record);
if (records != null){
long id = records.getId();
countsServices.updateCount(id, 1);
}
}catch (Exception ex){
}
return records;
}
}
| 1,252 | 0.682109 | 0.675719 | 45 | 26.822222 | 20.418171 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.466667 | false | false | 3 |
a9792e9aded1f4dcb63b177e72efa496df7173b4 | 14,035,953,184,119 | e7e2759b7bd468e65a12093462f18c4db6a97bae | /CodeChallengePOM/src/test/java/com/codechallenge/pom/tests/TestForMainPage.java | 3ffb54453a013e19f7d5c612db6ed2b17a9fb023 | [] | no_license | ECast1llo/CodeChallengeWeb-API | https://github.com/ECast1llo/CodeChallengeWeb-API | 82076b558398676526900fc6a534348195817273 | a6060080ade5c8c4868875fd73e709c202914425 | refs/heads/main | 2023-05-15T00:50:41.298000 | 2021-06-10T22:46:57 | 2021-06-10T22:46:57 | 373,383,983 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.codechallenge.pom.tests;
import com.codechallenge.pom.pages.HomePage;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class TestForMainPage {
private WebDriver driver;
HomePage homePage;
@BeforeClass
public void setUp() {
homePage = new HomePage(driver);
driver = homePage.chromeDriver();
}
@AfterClass
public void tearDown() {
//driver.quit();
}
@Test
public void addItemToCart(){
//Verify that can add item to cart
Assert.assertEquals(homePage.addToCart(),"1 Product");
}
@Test
public void deleteFromCart(){
//Verify that can delete 1 item from cart
Assert.assertEquals(homePage.deleteFromCart(),"Your shopping cart is empty.");
}
@Test
public void searching(){
//Using positive search in searchbar
Assert.assertTrue(homePage.searchItem("blouse").contains("result has been found."));
//Using negative search in searchbar
Assert.assertEquals(homePage.searchItem("corbata"),"0 results have been found.");
}
@Test
public void validateInformation(){
//Validate store information in footer
//validate address
Assert.assertEquals(homePage.validateStoreInformation().get(0),"Selenium Framework, Research Triangle" +
" Park, North Carolina, USA");
//validate phone
Assert.assertEquals(homePage.validateStoreInformation().get(1),"(347) 466-7432");
//validate email
Assert.assertEquals(homePage.validateStoreInformation().get(2),"support@seleniumframework.com");
}
}
| UTF-8 | Java | 1,763 | java | TestForMainPage.java | Java | [
{
"context": "quals(homePage.validateStoreInformation().get(2),\"support@seleniumframework.com\");\n }\n}\n",
"end": 1751,
"score": 0.9999213218688965,
"start": 1722,
"tag": "EMAIL",
"value": "support@seleniumframework.com"
}
] | null | [] | package com.codechallenge.pom.tests;
import com.codechallenge.pom.pages.HomePage;
import org.openqa.selenium.WebDriver;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class TestForMainPage {
private WebDriver driver;
HomePage homePage;
@BeforeClass
public void setUp() {
homePage = new HomePage(driver);
driver = homePage.chromeDriver();
}
@AfterClass
public void tearDown() {
//driver.quit();
}
@Test
public void addItemToCart(){
//Verify that can add item to cart
Assert.assertEquals(homePage.addToCart(),"1 Product");
}
@Test
public void deleteFromCart(){
//Verify that can delete 1 item from cart
Assert.assertEquals(homePage.deleteFromCart(),"Your shopping cart is empty.");
}
@Test
public void searching(){
//Using positive search in searchbar
Assert.assertTrue(homePage.searchItem("blouse").contains("result has been found."));
//Using negative search in searchbar
Assert.assertEquals(homePage.searchItem("corbata"),"0 results have been found.");
}
@Test
public void validateInformation(){
//Validate store information in footer
//validate address
Assert.assertEquals(homePage.validateStoreInformation().get(0),"Selenium Framework, Research Triangle" +
" Park, North Carolina, USA");
//validate phone
Assert.assertEquals(homePage.validateStoreInformation().get(1),"(347) 466-7432");
//validate email
Assert.assertEquals(homePage.validateStoreInformation().get(2),"<EMAIL>");
}
}
| 1,741 | 0.677255 | 0.668179 | 56 | 30.482143 | 27.92016 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 3 |
c4bc55aba89ee003e3edb4f098c60f1c59217e49 | 34,179,349,741,633 | 949eabed3e016c871cfd2a79e39e61fae6fbc134 | /src/org/ohdsi/usagi/ui/MappingTablePanel.java | 79230b9e2fc8a51b55462ebc3d6c16c4c36410f2 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | yanyanhu/Usagi | https://github.com/yanyanhu/Usagi | ee78f7a5c2e8cf1c979d13e3c524ed903725bf12 | 7f0fb49553b906a8c725e27470df2203fa363b8e | refs/heads/master | 2022-11-04T23:07:04.941000 | 2020-06-24T16:10:10 | 2020-06-24T16:10:10 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*******************************************************************************
* Copyright 2019 Observational Health Data Sciences and Informatics
*
* 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.ohdsi.usagi.ui;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableRowSorter;
import org.ohdsi.usagi.CodeMapping;
import org.ohdsi.usagi.CodeMapping.MappingStatus;
import org.ohdsi.usagi.Concept;
import static org.ohdsi.usagi.ui.DataChangeEvent.*;
public class MappingTablePanel extends JPanel implements DataChangeListener {
private static final long serialVersionUID = -5862314086097240860L;
private UsagiTable table;
private CodeMapTableModel tableModel;
private List<CodeSelectedListener> listeners = new ArrayList<>();
private boolean ignoreSelection = false;
public MappingTablePanel() {
super();
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
tableModel = new CodeMapTableModel();
table = new UsagiTable(tableModel);
table.setRowSorter(new TableRowSorter<>(tableModel));
table.setPreferredScrollableViewportSize(new Dimension(1200, 200));
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
table.getSelectionModel().addListSelectionListener(event -> {
if (!ignoreSelection) {
int primaryViewRow = table.getSelectedRow();
if (primaryViewRow != -1) {
int primaryModelRow = table.convertRowIndexToModel(primaryViewRow);
for (CodeSelectedListener listener : listeners) {
listener.codeSelected(tableModel.getCodeMapping(primaryModelRow));
listener.clearCodeMultiSelected();
}
Global.googleSearchAction.setEnabled(true);
Global.googleSearchAction.setSourceTerm(tableModel.getCodeMapping(primaryModelRow).sourceCode.sourceName);
Global.approveAction.setEnabled(true);
Global.approveAllAction.setEnabled(true);
Global.clearAllAction.setEnabled(true);
if (tableModel.getCodeMapping(primaryModelRow).targetConcepts.size() > 0) {
Concept firstConcept = tableModel.getCodeMapping(primaryModelRow).targetConcepts.get(0);
Global.conceptInfoAction.setEnabled(true);
Global.conceptInformationDialog.setConcept(firstConcept);
Global.athenaAction.setEnabled(true);
Global.athenaAction.setConcept(firstConcept);
}
// Store all other co-selected rows
for (int viewRow : table.getSelectedRows()) {
if (viewRow != -1 && viewRow != primaryViewRow) {
int modelRow = table.convertRowIndexToModel(viewRow);
for (CodeSelectedListener listener : listeners) {
listener.addCodeMultiSelected(tableModel.getCodeMapping(modelRow));
}
}
}
} else {
Global.approveAllAction.setEnabled(false);
Global.approveAction.setEnabled(false);
Global.clearAllAction.setEnabled(false);
}
}
});
// Hide some less-informative columns:
table.hideColumn("Valid start date");
table.hideColumn("Valid end date");
table.hideColumn("Invalid reason");
JScrollPane scrollPane = new JScrollPane(table);
add(scrollPane);
Global.mapping.addListener(this);
}
class CodeMapTableModel extends AbstractTableModel {
private static final long serialVersionUID = 169286268154988911L;
private String[] defaultColumnNames = { "Status", "Source code", "Source term", "Frequency", "Match score", "Concept ID", "Concept name",
"Domain", "Concept class", "Vocabulary", "Concept code", "Valid start date", "Valid end date", "Invalid reason", "Standard concept", "Parents",
"Children", "Comment" };
private String[] columnNames = defaultColumnNames;
private int addInfoColCount = 0;
private int ADD_INFO_START_COL = 4;
public int getColumnCount() {
return columnNames.length;
}
public CodeMapping getCodeMapping(int modelRow) {
return Global.mapping.get(modelRow);
}
public void restructure() {
columnNames = defaultColumnNames;
addInfoColCount = 0;
if (Global.mapping.size() != 0) {
CodeMapping codeMapping = Global.mapping.get(0);
addInfoColCount = codeMapping.sourceCode.sourceAdditionalInfo.size();
columnNames = new String[defaultColumnNames.length + addInfoColCount];
for (int i = 0; i < ADD_INFO_START_COL; i++)
columnNames[i] = defaultColumnNames[i];
for (int i = 0; i < addInfoColCount; i++)
columnNames[i + ADD_INFO_START_COL] = codeMapping.sourceCode.sourceAdditionalInfo.get(i).getItem1();
for (int i = ADD_INFO_START_COL; i < defaultColumnNames.length; i++)
columnNames[i + addInfoColCount] = defaultColumnNames[i];
}
fireTableStructureChanged();
table.setRowSelectionInterval(0, 0);
}
public int getRowCount() {
return Global.mapping.size();
}
public String getColumnName(int col) {
return columnNames[col];
}
public Object getValueAt(int row, int col) {
CodeMapping codeMapping = Global.mapping.get(row);
if (col >= ADD_INFO_START_COL && col < ADD_INFO_START_COL + addInfoColCount) {
return codeMapping.sourceCode.sourceAdditionalInfo.get(col - ADD_INFO_START_COL).getItem2();
} else {
if (col >= ADD_INFO_START_COL) {
col = col - addInfoColCount;
}
Concept targetConcept;
if (codeMapping.targetConcepts.size() > 0)
targetConcept = codeMapping.targetConcepts.get(0);
else
targetConcept = Concept.EMPTY_CONCEPT;
switch (col) {
case 0:
return codeMapping.mappingStatus;
case 1:
return codeMapping.sourceCode.sourceCode;
case 2:
return codeMapping.sourceCode.sourceName;
case 3:
return codeMapping.sourceCode.sourceFrequency == -1 ? "" : codeMapping.sourceCode.sourceFrequency;
case 4:
return codeMapping.matchScore;
case 5:
return targetConcept.conceptId;
case 6:
return targetConcept.conceptName;
case 7:
return targetConcept.domainId;
case 8:
return targetConcept.conceptClassId;
case 9:
return targetConcept.vocabularyId;
case 10:
return targetConcept.conceptCode;
case 11:
return targetConcept.validStartDate;
case 12:
return targetConcept.validEndDate;
case 13:
return targetConcept.invalidReason;
case 14:
return targetConcept.standardConcept;
case 15:
return targetConcept.parentCount;
case 16:
return targetConcept.childCount;
case 17:
return codeMapping.comment;
default:
return "";
}
}
}
public Class<?> getColumnClass(int col) {
if (col >= ADD_INFO_START_COL && col < ADD_INFO_START_COL + addInfoColCount) {
return String.class;
} else {
if (col >= ADD_INFO_START_COL) {
col = col - addInfoColCount;
}
switch (col) {
case 0:
return MappingStatus.class;
case 3:
return Integer.class;
case 4:
return Double.class;
case 5:
return Integer.class;
case 7:
return Integer.class;
case 15:
return Integer.class;
case 16:
return Integer.class;
default:
return String.class;
}
}
}
public boolean isCellEditable(int row, int col) {
return false;
}
public void setValueAt(Object value, int row, int col) {
}
}
public void addCodeSelectedListener(CodeSelectedListener listener) {
listeners.add(listener);
}
@Override
public void dataChanged(DataChangeEvent event) {
if (event.approved) {
int row = table.getSelectedRow();
ignoreSelection = true;
tableModel.fireTableDataChanged();
ignoreSelection = false;
if (row < table.getRowCount() - 1) {
table.setRowSelectionInterval(row + 1, row + 1);
table.scrollRectToVisible(new Rectangle(table.getCellRect(row + 1, row + 1, true)));
}
} else if (event.structureChange) {
tableModel.restructure();
table.setRowSelectionInterval(0, 0);
} else if (event.multiUpdate) {
tableModel.fireTableDataChanged();
} else {
tableModel.fireTableRowsUpdated(table.getSelectedRow(), table.getSelectedRow());
}
// Multi selection is lost
for (CodeSelectedListener listener : listeners) {
listener.clearCodeMultiSelected();
}
}
public void approveAll() {
for (int viewRow : table.getSelectedRows()) {
int modelRow = table.convertRowIndexToModel(viewRow);
tableModel.getCodeMapping(modelRow).mappingStatus = MappingStatus.APPROVED;
}
Global.mapping.fireDataChanged(SIMPLE_UPDATE_EVENT);
int viewRow = table.getSelectedRow();
if (viewRow != -1) {
int modelRow = table.convertRowIndexToModel(viewRow);
for (CodeSelectedListener listener : listeners)
listener.codeSelected(tableModel.getCodeMapping(modelRow));
}
}
public void clearAll() {
for (int viewRow : table.getSelectedRows()) {
int modelRow = table.convertRowIndexToModel(viewRow);
tableModel.getCodeMapping(modelRow).targetConcepts.clear();
}
Global.mapping.fireDataChanged(SIMPLE_UPDATE_EVENT);
int viewRow = table.getSelectedRow();
if (viewRow != -1) {
int modelRow = table.convertRowIndexToModel(viewRow);
for (CodeSelectedListener listener : listeners)
listener.codeSelected(tableModel.getCodeMapping(modelRow));
}
}
}
| UTF-8 | Java | 9,970 | java | MappingTablePanel.java | Java | [] | null | [] | /*******************************************************************************
* Copyright 2019 Observational Health Data Sciences and Informatics
*
* 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.ohdsi.usagi.ui;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableRowSorter;
import org.ohdsi.usagi.CodeMapping;
import org.ohdsi.usagi.CodeMapping.MappingStatus;
import org.ohdsi.usagi.Concept;
import static org.ohdsi.usagi.ui.DataChangeEvent.*;
public class MappingTablePanel extends JPanel implements DataChangeListener {
private static final long serialVersionUID = -5862314086097240860L;
private UsagiTable table;
private CodeMapTableModel tableModel;
private List<CodeSelectedListener> listeners = new ArrayList<>();
private boolean ignoreSelection = false;
public MappingTablePanel() {
super();
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
tableModel = new CodeMapTableModel();
table = new UsagiTable(tableModel);
table.setRowSorter(new TableRowSorter<>(tableModel));
table.setPreferredScrollableViewportSize(new Dimension(1200, 200));
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
table.getSelectionModel().addListSelectionListener(event -> {
if (!ignoreSelection) {
int primaryViewRow = table.getSelectedRow();
if (primaryViewRow != -1) {
int primaryModelRow = table.convertRowIndexToModel(primaryViewRow);
for (CodeSelectedListener listener : listeners) {
listener.codeSelected(tableModel.getCodeMapping(primaryModelRow));
listener.clearCodeMultiSelected();
}
Global.googleSearchAction.setEnabled(true);
Global.googleSearchAction.setSourceTerm(tableModel.getCodeMapping(primaryModelRow).sourceCode.sourceName);
Global.approveAction.setEnabled(true);
Global.approveAllAction.setEnabled(true);
Global.clearAllAction.setEnabled(true);
if (tableModel.getCodeMapping(primaryModelRow).targetConcepts.size() > 0) {
Concept firstConcept = tableModel.getCodeMapping(primaryModelRow).targetConcepts.get(0);
Global.conceptInfoAction.setEnabled(true);
Global.conceptInformationDialog.setConcept(firstConcept);
Global.athenaAction.setEnabled(true);
Global.athenaAction.setConcept(firstConcept);
}
// Store all other co-selected rows
for (int viewRow : table.getSelectedRows()) {
if (viewRow != -1 && viewRow != primaryViewRow) {
int modelRow = table.convertRowIndexToModel(viewRow);
for (CodeSelectedListener listener : listeners) {
listener.addCodeMultiSelected(tableModel.getCodeMapping(modelRow));
}
}
}
} else {
Global.approveAllAction.setEnabled(false);
Global.approveAction.setEnabled(false);
Global.clearAllAction.setEnabled(false);
}
}
});
// Hide some less-informative columns:
table.hideColumn("Valid start date");
table.hideColumn("Valid end date");
table.hideColumn("Invalid reason");
JScrollPane scrollPane = new JScrollPane(table);
add(scrollPane);
Global.mapping.addListener(this);
}
class CodeMapTableModel extends AbstractTableModel {
private static final long serialVersionUID = 169286268154988911L;
private String[] defaultColumnNames = { "Status", "Source code", "Source term", "Frequency", "Match score", "Concept ID", "Concept name",
"Domain", "Concept class", "Vocabulary", "Concept code", "Valid start date", "Valid end date", "Invalid reason", "Standard concept", "Parents",
"Children", "Comment" };
private String[] columnNames = defaultColumnNames;
private int addInfoColCount = 0;
private int ADD_INFO_START_COL = 4;
public int getColumnCount() {
return columnNames.length;
}
public CodeMapping getCodeMapping(int modelRow) {
return Global.mapping.get(modelRow);
}
public void restructure() {
columnNames = defaultColumnNames;
addInfoColCount = 0;
if (Global.mapping.size() != 0) {
CodeMapping codeMapping = Global.mapping.get(0);
addInfoColCount = codeMapping.sourceCode.sourceAdditionalInfo.size();
columnNames = new String[defaultColumnNames.length + addInfoColCount];
for (int i = 0; i < ADD_INFO_START_COL; i++)
columnNames[i] = defaultColumnNames[i];
for (int i = 0; i < addInfoColCount; i++)
columnNames[i + ADD_INFO_START_COL] = codeMapping.sourceCode.sourceAdditionalInfo.get(i).getItem1();
for (int i = ADD_INFO_START_COL; i < defaultColumnNames.length; i++)
columnNames[i + addInfoColCount] = defaultColumnNames[i];
}
fireTableStructureChanged();
table.setRowSelectionInterval(0, 0);
}
public int getRowCount() {
return Global.mapping.size();
}
public String getColumnName(int col) {
return columnNames[col];
}
public Object getValueAt(int row, int col) {
CodeMapping codeMapping = Global.mapping.get(row);
if (col >= ADD_INFO_START_COL && col < ADD_INFO_START_COL + addInfoColCount) {
return codeMapping.sourceCode.sourceAdditionalInfo.get(col - ADD_INFO_START_COL).getItem2();
} else {
if (col >= ADD_INFO_START_COL) {
col = col - addInfoColCount;
}
Concept targetConcept;
if (codeMapping.targetConcepts.size() > 0)
targetConcept = codeMapping.targetConcepts.get(0);
else
targetConcept = Concept.EMPTY_CONCEPT;
switch (col) {
case 0:
return codeMapping.mappingStatus;
case 1:
return codeMapping.sourceCode.sourceCode;
case 2:
return codeMapping.sourceCode.sourceName;
case 3:
return codeMapping.sourceCode.sourceFrequency == -1 ? "" : codeMapping.sourceCode.sourceFrequency;
case 4:
return codeMapping.matchScore;
case 5:
return targetConcept.conceptId;
case 6:
return targetConcept.conceptName;
case 7:
return targetConcept.domainId;
case 8:
return targetConcept.conceptClassId;
case 9:
return targetConcept.vocabularyId;
case 10:
return targetConcept.conceptCode;
case 11:
return targetConcept.validStartDate;
case 12:
return targetConcept.validEndDate;
case 13:
return targetConcept.invalidReason;
case 14:
return targetConcept.standardConcept;
case 15:
return targetConcept.parentCount;
case 16:
return targetConcept.childCount;
case 17:
return codeMapping.comment;
default:
return "";
}
}
}
public Class<?> getColumnClass(int col) {
if (col >= ADD_INFO_START_COL && col < ADD_INFO_START_COL + addInfoColCount) {
return String.class;
} else {
if (col >= ADD_INFO_START_COL) {
col = col - addInfoColCount;
}
switch (col) {
case 0:
return MappingStatus.class;
case 3:
return Integer.class;
case 4:
return Double.class;
case 5:
return Integer.class;
case 7:
return Integer.class;
case 15:
return Integer.class;
case 16:
return Integer.class;
default:
return String.class;
}
}
}
public boolean isCellEditable(int row, int col) {
return false;
}
public void setValueAt(Object value, int row, int col) {
}
}
public void addCodeSelectedListener(CodeSelectedListener listener) {
listeners.add(listener);
}
@Override
public void dataChanged(DataChangeEvent event) {
if (event.approved) {
int row = table.getSelectedRow();
ignoreSelection = true;
tableModel.fireTableDataChanged();
ignoreSelection = false;
if (row < table.getRowCount() - 1) {
table.setRowSelectionInterval(row + 1, row + 1);
table.scrollRectToVisible(new Rectangle(table.getCellRect(row + 1, row + 1, true)));
}
} else if (event.structureChange) {
tableModel.restructure();
table.setRowSelectionInterval(0, 0);
} else if (event.multiUpdate) {
tableModel.fireTableDataChanged();
} else {
tableModel.fireTableRowsUpdated(table.getSelectedRow(), table.getSelectedRow());
}
// Multi selection is lost
for (CodeSelectedListener listener : listeners) {
listener.clearCodeMultiSelected();
}
}
public void approveAll() {
for (int viewRow : table.getSelectedRows()) {
int modelRow = table.convertRowIndexToModel(viewRow);
tableModel.getCodeMapping(modelRow).mappingStatus = MappingStatus.APPROVED;
}
Global.mapping.fireDataChanged(SIMPLE_UPDATE_EVENT);
int viewRow = table.getSelectedRow();
if (viewRow != -1) {
int modelRow = table.convertRowIndexToModel(viewRow);
for (CodeSelectedListener listener : listeners)
listener.codeSelected(tableModel.getCodeMapping(modelRow));
}
}
public void clearAll() {
for (int viewRow : table.getSelectedRows()) {
int modelRow = table.convertRowIndexToModel(viewRow);
tableModel.getCodeMapping(modelRow).targetConcepts.clear();
}
Global.mapping.fireDataChanged(SIMPLE_UPDATE_EVENT);
int viewRow = table.getSelectedRow();
if (viewRow != -1) {
int modelRow = table.convertRowIndexToModel(viewRow);
for (CodeSelectedListener listener : listeners)
listener.codeSelected(tableModel.getCodeMapping(modelRow));
}
}
}
| 9,970 | 0.698997 | 0.687563 | 304 | 31.796053 | 26.401464 | 147 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.608553 | false | false | 3 |
08bafc8fde37ff00de5aa46074aaa8c66f842b2b | 3,899,830,312,851 | c9bfbf9269610d4d55f70df2b6b3381db2a026c5 | /commons-lib/src/main/java/com/idream/commons/lib/dto/user/AppUserSearchParams.java | 23154c84014506336edb4cc33cb5678ae1839a18 | [] | no_license | moutainhigh/idream-community | https://github.com/moutainhigh/idream-community | 1b076671a2e7df0d70094e3a6162d550340ac2f5 | c59e84d0c260005c0a6de5e3e3a4cc4c51da5339 | refs/heads/master | 2021-09-22T07:03:59.357000 | 2018-09-06T07:37:27 | 2018-09-06T07:37:27 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.idream.commons.lib.dto.user;
import com.idream.commons.lib.dto.PagesParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
/**
* @author charles
*/
@ApiModel("用户首页搜索入参")
public class AppUserSearchParams extends PagesParam {
@NotBlank(message = "搜索条件不能为空")
@ApiModelProperty("昵称")
private String nickName;
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
}
| UTF-8 | Java | 612 | java | AppUserSearchParams.java | Java | [
{
"context": "x.validation.constraints.NotBlank;\n\n/**\n * @author charles\n */\n@ApiModel(\"用户首页搜索入参\")\npublic class AppUserSea",
"end": 246,
"score": 0.9970639944076538,
"start": 239,
"tag": "USERNAME",
"value": "charles"
}
] | null | [] | package com.idream.commons.lib.dto.user;
import com.idream.commons.lib.dto.PagesParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
/**
* @author charles
*/
@ApiModel("用户首页搜索入参")
public class AppUserSearchParams extends PagesParam {
@NotBlank(message = "搜索条件不能为空")
@ApiModelProperty("昵称")
private String nickName;
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
}
| 612 | 0.723958 | 0.723958 | 25 | 22.040001 | 18.42494 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.32 | false | false | 3 |
7839fd30e6a811cc61964cc7a44488727d737c13 | 12,927,851,616,074 | 774fbe77a635d697d240759d310706b1b73c1181 | /src/main/java/com/cnc/sdnweb/stat/web/StatDetailAction.java | bd3dfa67ef32198df54ec7a897314480d25765af | [] | no_license | chenlt-qtl/hdt | https://github.com/chenlt-qtl/hdt | 9f4cb69e7cb9e27c9abea43d224ceab8b6838cfe | 2dd803c33ec6f485a75c663e42cd0ecfb9a75c69 | refs/heads/master | 2016-06-13T00:57:01.942000 | 2016-05-24T06:47:55 | 2016-05-24T06:47:55 | 59,621,101 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
*
* @author ruishuo
* Oct 23, 2015 3:21:05 PM
* StatDetailAction.java
* TODO :
*
*/
package com.cnc.sdnweb.stat.web;
import org.apache.struts2.convention.annotation.Namespace;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.cnc.common.web.SdnWebBaseAction;
import com.cnc.sdnweb.stat.service.StatService;
/**
*
* @author ruishuo
* Oct 23, 2015 3:21:05 PM
* StatDetailAction.java
* TODO :
*
*/
@Namespace("/stat")
public class StatDetailAction extends SdnWebBaseAction {
protected final static Logger logger = LoggerFactory.getLogger(StatDetailAction.class);
@Autowired
private StatService statService;
private String appId = null;
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
}
| UTF-8 | Java | 904 | java | StatDetailAction.java | Java | [
{
"context": "/**\r\n *\r\n * @author ruishuo\r\n * Oct 23, 2015 3:21:05 PM\r\n * StatDetailAction.",
"end": 27,
"score": 0.9993788599967957,
"start": 20,
"tag": "USERNAME",
"value": "ruishuo"
},
{
"context": "b.stat.service.StatService;\r\n\r\n/**\r\n *\r\n * @author ruishuo\r\n * Oct 23, 2015 3:21:05 PM\r\n * StatDetailAction.",
"end": 448,
"score": 0.9994504451751709,
"start": 441,
"tag": "USERNAME",
"value": "ruishuo"
}
] | null | [] | /**
*
* @author ruishuo
* Oct 23, 2015 3:21:05 PM
* StatDetailAction.java
* TODO :
*
*/
package com.cnc.sdnweb.stat.web;
import org.apache.struts2.convention.annotation.Namespace;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.cnc.common.web.SdnWebBaseAction;
import com.cnc.sdnweb.stat.service.StatService;
/**
*
* @author ruishuo
* Oct 23, 2015 3:21:05 PM
* StatDetailAction.java
* TODO :
*
*/
@Namespace("/stat")
public class StatDetailAction extends SdnWebBaseAction {
protected final static Logger logger = LoggerFactory.getLogger(StatDetailAction.class);
@Autowired
private StatService statService;
private String appId = null;
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
}
| 904 | 0.701327 | 0.673673 | 45 | 18.088888 | 20.315098 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.577778 | false | false | 3 |
450ae5016a0590ef032914a63f5a729cecd146cb | 22,763,326,680,070 | 629f284f6b5d3ff9c2cd95dfaa4cb113969b303f | /src/com/rogrand/core/enums/UploadType.java | 8fb138b62b4bd1f61369283ca16536003c59a037 | [] | no_license | theFiles/zhlm-manage | https://github.com/theFiles/zhlm-manage | 3209e279266c6bb1b33350e0965fc2ca06cc4902 | ccacce61b516cca9e7da452d2eac6e7a2c073c07 | refs/heads/master | 2022-11-12T15:27:30.296000 | 2020-07-04T10:05:16 | 2020-07-04T10:05:16 | 277,084,470 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.rogrand.core.enums;
public enum UploadType
{
TEMP(0, "temp", "临时文件"),
USER_PIC(1, "userpic", "用户头像"),
IMAGE(2, "images", "图片"),
AUDIO(3, "audio", "音频");
private int code;
private String name;
private String desc;
UploadType(int code, String name, String desc) {
this.code = code;
this.name = name;
this.desc = desc;
}
public int getCode() {
return this.code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getDesc() {
return this.desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
/* Location: D:\file\project\tuozhanbao-manage\WEB-INF\classes\!\com.rogrand\core\enums\UploadType.class
* Java compiler version: 7 (51.0)
* JD-Core Version: 1.1.3
*/ | UTF-8 | Java | 936 | java | UploadType.java | Java | [] | null | [] | package com.rogrand.core.enums;
public enum UploadType
{
TEMP(0, "temp", "临时文件"),
USER_PIC(1, "userpic", "用户头像"),
IMAGE(2, "images", "图片"),
AUDIO(3, "audio", "音频");
private int code;
private String name;
private String desc;
UploadType(int code, String name, String desc) {
this.code = code;
this.name = name;
this.desc = desc;
}
public int getCode() {
return this.code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getDesc() {
return this.desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
/* Location: D:\file\project\tuozhanbao-manage\WEB-INF\classes\!\com.rogrand\core\enums\UploadType.class
* Java compiler version: 7 (51.0)
* JD-Core Version: 1.1.3
*/ | 936 | 0.611842 | 0.599781 | 55 | 15.6 | 19.364071 | 117 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.490909 | false | false | 3 |
7940d038c2103d55c56cc47862ff893575160826 | 30,142,080,530,673 | 45aa931542f68bb1c4d25b60de1ec993af531ccf | /src/org/node/action/FontAction.java | 015c0921d4f7c6635449e36d85737247eb9bef7a | [] | no_license | alvin198761/note1.0 | https://github.com/alvin198761/note1.0 | 266a4568e317086648a94353a9f479a05bf8ef4e | e7a8fc777404fc251185fbee32552c39837b5fd6 | refs/heads/master | 2021-01-19T03:56:51.612000 | 2017-03-09T12:51:11 | 2017-03-09T12:51:11 | 84,420,964 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.node.action;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import org.node.gui.FontDialog;
import org.node.gui.NoteFrame;
import org.node.system.NoteSystem;
/**
* 字体
*
* @author TANG
*
*/
public class FontAction extends SuperAction {
private static final long serialVersionUID = 1L;
public FontAction() {
super("action.font", "icon.font");
}
@Override
public void actionPerformed(ActionEvent e) {
FontDialog fontDialog = (FontDialog) NoteSystem
.getAttribute("fontdialog");
NoteFrame frame = (NoteFrame) NoteSystem.getAttribute("domain");
if (fontDialog == null) {
fontDialog = new FontDialog();
fontDialog.setLocationRelativeTo(frame);
NoteSystem.setAttribute("fontdialog", fontDialog);
}
fontDialog.getPreviewLabel().setForeground(
frame.getEditorMain().getForeground());
fontDialog.getPreviewLabel().setFont(frame.getEditorMain().getFont());
fontDialog.setVisible(true);
if (fontDialog.isApplity()) {
Color color = fontDialog.getPreviewLabel().getForeground();
Font font = fontDialog.getPreviewLabel().getFont();
frame.getEditorMain().setForeground(color);
frame.getEditorMain().setFont(font);
}
}
@Override
public boolean isEnabled() {
return true;
}
}
| UTF-8 | Java | 1,281 | java | FontAction.java | Java | [
{
"context": ".node.system.NoteSystem;\n\n/**\n * 字体\n * \n * @author TANG\n * \n */\npublic class FontAction extends SuperActi",
"end": 235,
"score": 0.761803388595581,
"start": 231,
"tag": "USERNAME",
"value": "TANG"
}
] | null | [] | package org.node.action;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import org.node.gui.FontDialog;
import org.node.gui.NoteFrame;
import org.node.system.NoteSystem;
/**
* 字体
*
* @author TANG
*
*/
public class FontAction extends SuperAction {
private static final long serialVersionUID = 1L;
public FontAction() {
super("action.font", "icon.font");
}
@Override
public void actionPerformed(ActionEvent e) {
FontDialog fontDialog = (FontDialog) NoteSystem
.getAttribute("fontdialog");
NoteFrame frame = (NoteFrame) NoteSystem.getAttribute("domain");
if (fontDialog == null) {
fontDialog = new FontDialog();
fontDialog.setLocationRelativeTo(frame);
NoteSystem.setAttribute("fontdialog", fontDialog);
}
fontDialog.getPreviewLabel().setForeground(
frame.getEditorMain().getForeground());
fontDialog.getPreviewLabel().setFont(frame.getEditorMain().getFont());
fontDialog.setVisible(true);
if (fontDialog.isApplity()) {
Color color = fontDialog.getPreviewLabel().getForeground();
Font font = fontDialog.getPreviewLabel().getFont();
frame.getEditorMain().setForeground(color);
frame.getEditorMain().setFont(font);
}
}
@Override
public boolean isEnabled() {
return true;
}
}
| 1,281 | 0.730619 | 0.729836 | 51 | 24.039215 | 20.560728 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.647059 | false | false | 3 |
b837e2fc0e26eb3748fb326df02ac612760c2c4a | 26,723,286,519,178 | 6202eaf1eeb0feda547bbf2d109d1e7dc367933d | /src/main/java/vimmone/blog/repository/CommentUserRepository.java | 3a2bb33ebfe940bfb68165578974e6efbcbf354b | [] | no_license | StuartYang/Blog-springboot | https://github.com/StuartYang/Blog-springboot | 2b9541336ebef22e214771985ea2023ed4f16f12 | 29a2fd813c35d9a1c2f88963d36cb2f31da01289 | refs/heads/master | 2020-03-28T10:47:42.829000 | 2018-09-02T06:57:14 | 2018-09-02T06:57:14 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package vimmone.blog.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import vimmone.blog.pojo.CommentUser;
/**
* \* Created with IntelliJ IDEA.
* \* User: Vimmone
* \* Date: 2018/4/14
* \* Description:
* \
*/
public interface CommentUserRepository extends JpaRepository<CommentUser,Integer>{
CommentUser findByCommentIdAndUserId(Integer commentId, Integer userId);
}
| UTF-8 | Java | 406 | java | CommentUserRepository.java | Java | [
{
"context": "\n/**\n * \\* Created with IntelliJ IDEA.\n * \\* User: Vimmone\n * \\* Date: 2018/4/14\n * \\* Description:\n * \\\n */",
"end": 192,
"score": 0.9995829463005066,
"start": 185,
"tag": "USERNAME",
"value": "Vimmone"
}
] | null | [] | package vimmone.blog.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import vimmone.blog.pojo.CommentUser;
/**
* \* Created with IntelliJ IDEA.
* \* User: Vimmone
* \* Date: 2018/4/14
* \* Description:
* \
*/
public interface CommentUserRepository extends JpaRepository<CommentUser,Integer>{
CommentUser findByCommentIdAndUserId(Integer commentId, Integer userId);
}
| 406 | 0.758621 | 0.741379 | 15 | 26 | 26.738237 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false | 3 |
7ca287423a5d321e1ee51db8adcc84295da6f967 | 14,267,881,425,914 | ca4581ef3677646b199a56670d99a744855c17b2 | /Task1New/src/main/java/model/PersonalTaxRecorder.java | 2394196dec9d3ff8b79958957554cb10a0dd5b2c | [] | no_license | nas156/TrainingTasks | https://github.com/nas156/TrainingTasks | a909a526179eb49e007c0ebdd42732f5d8291ee1 | 4eeb60d50d03c9e01c8468ef2b16a8222737b2e1 | refs/heads/master | 2022-06-22T17:15:08.561000 | 2019-12-18T14:57:58 | 2019-12-18T14:57:58 | 223,595,567 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package model;
import lombok.Getter;
import model.entity.tax.IncomeTax;
import model.entity.tax.PropertyTax;
import model.entity.tax.Tax;
import model.entity.user.TaxPayer;
import model.entity.user.UserProperty;
import java.util.Arrays;
import java.util.Comparator;
@Getter
public class PersonalTaxRecorder {
private Tax[] taxes;
private TaxPayer user;
private int counter;
private double fullTaxToPay;
public PersonalTaxRecorder(TaxPayer user) {
this.user = user;
taxes = new Tax[1 + user.getNumberOfProperties()];
}
private void addIncomeTax() {
taxes[counter++] = new IncomeTax(user.getMainIncomePerYear(), user.getNumberOfChildren(), user.getExtraIncome());
}
private void addPropertyTax() {
if (user.getNumberOfProperties() != 0) {
for (UserProperty property : user.getProperties()) {
taxes[counter++] = new PropertyTax(user.getMainIncomePerYear(), user.getNumberOfChildren(), property);
}
}
}
private void countFullTax() {
addPropertyTax();
addIncomeTax();
for (Tax tax : taxes) {
fullTaxToPay += tax.countTaxToPay();
}
}
public double getFullTaxToPay() {
if (this.fullTaxToPay == 0) countFullTax();
return this.fullTaxToPay;
}
public void sortTaxesByValue() {
Arrays.sort(taxes, Comparator.comparing(Tax::countTaxToPay));
}
}
| UTF-8 | Java | 1,454 | java | PersonalTaxRecorder.java | Java | [] | null | [] | package model;
import lombok.Getter;
import model.entity.tax.IncomeTax;
import model.entity.tax.PropertyTax;
import model.entity.tax.Tax;
import model.entity.user.TaxPayer;
import model.entity.user.UserProperty;
import java.util.Arrays;
import java.util.Comparator;
@Getter
public class PersonalTaxRecorder {
private Tax[] taxes;
private TaxPayer user;
private int counter;
private double fullTaxToPay;
public PersonalTaxRecorder(TaxPayer user) {
this.user = user;
taxes = new Tax[1 + user.getNumberOfProperties()];
}
private void addIncomeTax() {
taxes[counter++] = new IncomeTax(user.getMainIncomePerYear(), user.getNumberOfChildren(), user.getExtraIncome());
}
private void addPropertyTax() {
if (user.getNumberOfProperties() != 0) {
for (UserProperty property : user.getProperties()) {
taxes[counter++] = new PropertyTax(user.getMainIncomePerYear(), user.getNumberOfChildren(), property);
}
}
}
private void countFullTax() {
addPropertyTax();
addIncomeTax();
for (Tax tax : taxes) {
fullTaxToPay += tax.countTaxToPay();
}
}
public double getFullTaxToPay() {
if (this.fullTaxToPay == 0) countFullTax();
return this.fullTaxToPay;
}
public void sortTaxesByValue() {
Arrays.sort(taxes, Comparator.comparing(Tax::countTaxToPay));
}
}
| 1,454 | 0.65337 | 0.651307 | 53 | 26.433962 | 25.858475 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.528302 | false | false | 3 |
7ec3a6d7da433cba68386e1535cc9b9e3fc490a6 | 10,393,820,906,176 | 070aa63fd9247e59a3d1394d90d7983d55132dd1 | /src/main/java/com/biz/model/Pmodel/api/ChangeNoticeTemp.java | a72121589844fac7c711a994526514f18bb0e5dc | [] | no_license | ljtianqi1986/housekeeping-admin | https://github.com/ljtianqi1986/housekeeping-admin | 4525b1158673d15c05019cc12885e6b90ab4bd9c | d4e5f32f5576fa48d66fa32853ca357c53379cd1 | refs/heads/master | 2021-01-25T13:11:16.808000 | 2018-03-02T06:11:22 | 2018-03-02T06:11:22 | 123,536,975 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.biz.model.Pmodel.api;
/**
* Created by lzq on 2017/4/21.
*/
public class ChangeNoticeTemp {
private String id = "";
private String goodsName = "";
private String changeNumber = "";
private String count = "";
private String remark = "";
private String openId = "";
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getChangeNumber() {
return changeNumber;
}
public void setChangeNumber(String changeNumber) {
this.changeNumber = changeNumber;
}
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
}
| UTF-8 | Java | 1,262 | java | ChangeNoticeTemp.java | Java | [
{
"context": "ckage com.biz.model.Pmodel.api;\n\n/**\n * Created by lzq on 2017/4/21.\n */\npublic class ChangeNoticeTemp {",
"end": 56,
"score": 0.999569296836853,
"start": 53,
"tag": "USERNAME",
"value": "lzq"
}
] | null | [] | package com.biz.model.Pmodel.api;
/**
* Created by lzq on 2017/4/21.
*/
public class ChangeNoticeTemp {
private String id = "";
private String goodsName = "";
private String changeNumber = "";
private String count = "";
private String remark = "";
private String openId = "";
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getChangeNumber() {
return changeNumber;
}
public void setChangeNumber(String changeNumber) {
this.changeNumber = changeNumber;
}
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
}
| 1,262 | 0.552298 | 0.546751 | 62 | 19.354839 | 17.382877 | 54 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.306452 | false | false | 3 |
456cac341f2b96d00deb14250fae88ec2a229967 | 11,836,929,873,149 | 4cca3cc10ac3d0e9585d2250cd15945b7bc7718c | /Video 07.2 - Arv (Figur-eksempel)/07 - abstract/src/no/hiof/larseknu/Main.java | 9fb85fe656cdfa5efe4ee67f6a6b507f715b6d9c | [] | no_license | Webbl/programmering2_v2021 | https://github.com/Webbl/programmering2_v2021 | 8034706f2f8e5151f0583eb9e53d86a0a992f7df | 4a26b404d41d3fc4cbb432a23bd15d07aa5841d5 | refs/heads/main | 2023-03-13T07:17:23.768000 | 2021-03-04T08:03:40 | 2021-03-04T08:03:40 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package no.hiof.larseknu;
public class Main {
public static void main(String[] args) {
Rektangel etRektangel = new Rektangel(5, 6);
Sirkel enSirkel = new Sirkel(8);
Kvadrat kvadratet = new Kvadrat(5);
System.out.println("\n*************Data om figur************");
System.out.printf("Rektangelet sitt areal er %.2f\n", etRektangel.areal());
System.out.printf("Rektangelet sitt areal i meter er %.2f\n", etRektangel.arealIMeter());
System.out.println("Rektanglet har fargen: " + etRektangel.getFarge());
etRektangel.setFarge("Blå");
System.out.println("Rektanglet har nå fargen: " + etRektangel.getFarge());
}
}
| UTF-8 | Java | 700 | java | Main.java | Java | [] | null | [] | package no.hiof.larseknu;
public class Main {
public static void main(String[] args) {
Rektangel etRektangel = new Rektangel(5, 6);
Sirkel enSirkel = new Sirkel(8);
Kvadrat kvadratet = new Kvadrat(5);
System.out.println("\n*************Data om figur************");
System.out.printf("Rektangelet sitt areal er %.2f\n", etRektangel.areal());
System.out.printf("Rektangelet sitt areal i meter er %.2f\n", etRektangel.arealIMeter());
System.out.println("Rektanglet har fargen: " + etRektangel.getFarge());
etRektangel.setFarge("Blå");
System.out.println("Rektanglet har nå fargen: " + etRektangel.getFarge());
}
}
| 700 | 0.623209 | 0.614613 | 21 | 32.238094 | 33.004913 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.619048 | false | false | 3 |
96146810d7de1aa18b6cff230e6fcd8926a3cf1a | 12,455,405,197,969 | 60efcf95b4846f31187427df0401001d0b518e2c | /src/kr/valkyrie/controller/BoardList_adminController.java | ae82d45d807f4ba6187940f05ac4c533358c7862 | [] | no_license | yjs37210/valkyrieWeb | https://github.com/yjs37210/valkyrieWeb | 339762c2d0d73d2e93e6f42e0553609d0741fc5c | d025f0aa7efb0360d0ebb7d6bc888fff99b51b9c | refs/heads/master | 2023-03-18T16:26:32.160000 | 2021-03-17T07:22:36 | 2021-03-17T07:22:36 | 348,598,720 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package kr.valkyrie.controller;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import kr.valkyrie.model.BoardDAO;
import kr.valkyrie.model.BoardVO;
public class BoardList_adminController implements Controller {
@Override
public String requestHandler(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
BoardDAO dao = new BoardDAO();
ArrayList<BoardVO> list = dao.boardAllList();
request.setAttribute("list", list);
return "admin_contact.jsp";
}
}
| UTF-8 | Java | 654 | java | BoardList_adminController.java | Java | [] | null | [] | package kr.valkyrie.controller;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import kr.valkyrie.model.BoardDAO;
import kr.valkyrie.model.BoardVO;
public class BoardList_adminController implements Controller {
@Override
public String requestHandler(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
BoardDAO dao = new BoardDAO();
ArrayList<BoardVO> list = dao.boardAllList();
request.setAttribute("list", list);
return "admin_contact.jsp";
}
}
| 654 | 0.801223 | 0.801223 | 25 | 25.16 | 22.860762 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.16 | false | false | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.