blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dfaf4c93e9ecf0972126d6a84e7060de8f7b24fe | 85f2af43c2ac79dc3ee0c9476d66be4d927d5e93 | /src/com/stark/lessons/unit4/lesson32/Lesson_32_Activity_Three.java | 9bcb9a7e1117def9436f8b330643c51c21d1a645 | [] | no_license | starkjj/Ap-Comp-Sci | b1e4be7a7c0a43202a39da2d5688aaa3fcd1ce3b | f4d44f5708aa535c32b99ca20b026388acd6a5e4 | refs/heads/master | 2021-05-28T12:13:08.363284 | 2015-04-28T12:52:05 | 2015-04-28T12:52:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java | package com.stark.lessons.unit4.lesson32;
public class Lesson_32_Activity_Three {
public static void swap(int a, int b)
{
System.out.println(b + " " + a);
}
public static void main(String[] spanky)
{
}
}
| [
"razestudiosdev@gmail.com"
] | razestudiosdev@gmail.com |
92e4d14179c8669542528f617e3275789b61b131 | afb4cf30e328c78efc7adad573a4e4a1870754b6 | /College/Extra-Code/Most Useful Java Programs and Algorithems/Prob14_1999.java | 63559db920bc9581683fd08830be637d6f52da82 | [
"Apache-2.0"
] | permissive | mmcclain117/School-Code | 5c404aaa9b95df136ba382dff79cb7d44e56b4bc | aa9c501d42fc51fa9a66f53c65b875408a40ea0c | refs/heads/main | 2023-01-21T00:27:18.669866 | 2020-11-29T21:32:52 | 2020-11-29T21:32:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,654 | java |
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
/**
*
* @author Master Ward
*/
public class Prob14 {
public static void main(String[] args) throws Exception {
// Problem: Arithmetic Expression Evaluation
// Points: 11
Scanner scan = new Scanner(new File("prob14.txt"));
while (scan.hasNext()) {
String s = scan.nextLine().trim(); // Equasion
if (countPar(s)) {
s = space(s);
ArrayList<String> ar = sep(s);
solvePar(ar);
String fin = "";
for (String q : ar) {
if (!q.equals("")) { // Used to remove when there is a null in front
fin += q + "#";
}
}
/* Solve the rest */
// System.out.println(fin);
System.out.printf("%f", Double.parseDouble(Solve(fin)));
// System.out.println("ANSWER: " + Solve(fin));
System.out.println();
}
}
}
/* Counts the parenthases and if there are missing\extra */
private static boolean countPar(String s) {
String q = s.replaceAll("[^()]+", "");
int f = 0; // Forwards
int b = 0; // Backwards
char ch[] = q.toCharArray(); // Array of parenthases
for (int i = 0; i < ch.length; i++) {
if (ch[i] == '(') { // Forwards
f++;
} else if (ch[i] == ')') { // Backwards
if (f < b) { // Unexpected
System.out.println("error: unexpected )");
return false;
}
b++;
}
}
if (f == b) {
return true;
} else if (f < b) {
System.out.println("error: unexpected )");
return false;
} else if (f > b) {
System.out.println("error: unmatched (");
return false;
} else {
System.out.println("Something went wrong and i dont know what");
return false;
}
}
/* Solves parenthasise by reccursive function DOESNT WORK*/
private static boolean solvePar(ArrayList<String> a) {
while (true) {
int lasClo = -1; // Last Closed
int lasOpe = -1; // Last Open
for (int i = a.size() - 1; i > 0; i--) { // Finds the last Parenthases
if (a.get(i).trim().equals(")")) {
lasClo = i;
} else if (a.get(i).equals("(")) {
lasOpe = i;
break;
}
}
if (lasClo == -1 || lasOpe == -1) { // No more parenthases
return false;
}
String sol = ""; // Equasion to be solved
int mount = lasClo - lasOpe; // Number to remove
a.remove(lasOpe); // Removes first Parenthases
for (int i = 0; i < mount - 1; i++) {
sol += a.remove(lasOpe) + "#"; // Removes same spot
}
a.set(lasOpe, Solve(sol)); // Add back the solution
}
}
/* Add spaces to equasion that are all together */
private static String space(String s) {
s = s.replaceAll("[*]", " * ");// Multiplication
s = s.replaceAll("[/]", " / ");// Division
s = s.replaceAll("[+]", " + ");// Addition
s = s.replaceAll("[-]", " - "); // Subtraction
s = s.replaceAll("[(]", " ( "); // Open Parenthases
s = s.replaceAll("[)]", " ) "); // Closed Parenthases
return s;
}
/* Seperate the whole equasion into an inline RPN format ArrayList */
private static ArrayList<String> sep(String s) {
String split[] = s.split("[ ]+");
ArrayList<String> ar = new ArrayList();
int i; // Where start reading
String oper = "*/+-()"; // Operators
/* Adding the first one ot arrayList */
if (split[0].equals("-")) {
ar.add(split[0].trim() + split[1].trim()); // Add First Negative Number
i = 2;
} else {
ar.add(split[0].trim()); // First Number
i = 1;
}
for (; i < split.length; i++) {
boolean good = true; // Need to add
/* Next part takes care of negatives */
if (oper.contains(split[i - 1])) { // First character is a operator
if (split[i].equals("-")) { // If negative number is following
if (!oper.contains(split[i + 1])) { // Next is number
i++;
ar.add("-" + split[i].trim());
good = false;
}
}
}
if (good) { // If haven't been added
ar.add(split[i].trim());
}
}
return ar;
}
private static String Solve(String sol) {
String split[] = sol.split("[#]"); // Equasion
// System.out.println(Arrays.toString(split));
ArrayList<String> tmp = new ArrayList();
tmp.addAll(Arrays.asList(split));
int con = 0;
/* Multiplication and Division */
while (con < tmp.size()) {
if (tmp.get(con).equals("*")) { // Multiplication
double v1 = Double.parseDouble(tmp.remove(con - 1));
double v2 = Double.parseDouble(tmp.remove(con));
String v3 = (v1 * v2) + "";
tmp.set(con - 1, v3);
} else if (tmp.get(con).equals("/")) { // Division
double v1 = Double.parseDouble(tmp.remove(con - 1));
double v2 = Double.parseDouble(tmp.remove(con));
String v3 = (v1 / v2) + "";
tmp.set(con - 1, v3);
} else {
con++;
}
}
con = 0;
/* Addition and Subtraction */
while (con < tmp.size()) {
if (tmp.get(con).equals("+")) { // Addition
double v1 = Double.parseDouble(tmp.remove(con - 1));
double v2 = Double.parseDouble(tmp.remove(con));
String v3 = (v1 + v2) + "";
tmp.set(con - 1, v3);
} else if (tmp.get(con).equals("-")) { // Subtraction
double v1 = Double.parseDouble(tmp.remove(con - 1));
double v2 = Double.parseDouble(tmp.remove(con));
String v3 = (v1 - v2) + "";
tmp.set(con - 1, v3);
} else {
con++;
}
}
return tmp.get(0);
}
}
| [
"codingmace@gmail.com"
] | codingmace@gmail.com |
7959a0c95848915664fe4f34a5c6a6b34432e11a | 7fee73ad208747a24ddb5880aa29b19ae2ff0b13 | /java/2020/07/03/Java-learning/Day 10/Test4.java | a01073e44e1ddecb6e5fd19f4038e47ffc076cb3 | [
"MIT"
] | permissive | FJRFrancio/Francio | cfdf5b976a4aea76fbd1e194a175124c8e3de32e | 5803d8698dca4f6707901d810b74301888e9dee2 | refs/heads/master | 2023-05-06T23:31:36.892378 | 2021-05-28T08:16:52 | 2021-05-28T08:16:52 | 276,796,268 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,560 | java | import java.util.Comparator;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
public class Test4 {
public static void main(String[] args) {
// Set<Integer> set = new TreeSet<Integer>();
// //TreeSet自然排序
// set.add(2);
// set.add(4);
// set.add(3);
// set.add(5);
// System.out.println(set);
// //使用迭代器遍历
// Iterator<Integer> it = set.iterator();
// while (it.hasNext()){
// }
// //for each
// for (Integer i : set){
// }
Person p1 = new Person("zhangsan",23);
Person p2 = new Person("lisi",20);
Person p3 = new Person("wangwu",16);
Person p4 = new Person("lucy",29);
Set<Person> set = new TreeSet<Person>(new Person());
set.add(p1);
set.add(p2);
set.add(p3);
set.add(p4);
for (Person p : set){
System.out.println(p.name + " " + p.age);
}
}
}
class Person implements Comparator<Person>{//把Person对象存到TreeSet中并按照年龄排序
int age;
String name;
public Person(){}
public Person(String name,int age){
this.name = name;
this.age = age;
}
@Override
public int compare(Person o1, Person o2) {//自定义比较方法:按年龄正序排列
if (o1.age > o2.age){
return 1;
}else if (o1.age < o2.age){
return -1;
}else{
return 0;
}
}
}
| [
"noreply@github.com"
] | FJRFrancio.noreply@github.com |
51b94cc83705c54d8fcfad48d0beb375f50b746d | e22f4228e166805bff2c5be56ff8dd4e7cff29d6 | /src/test/java/hw1/DataProviderCalculatorMultTests.java | a23a3b5e967d2ff127d3c9e2349bcb7c52ee6552 | [] | no_license | LastValentina/ValentinaIvanova | 9453e9299619996c3fcbca41a719aacf516a232d | 0bb0d3eb1301551ad3b42490632a90b7b5e04804 | refs/heads/master | 2023-02-25T11:46:44.081866 | 2021-02-04T15:02:53 | 2021-02-04T15:02:53 | 318,995,396 | 0 | 0 | null | 2021-01-25T21:53:24 | 2020-12-06T09:24:18 | Java | UTF-8 | Java | false | false | 536 | java | package hw1;
import org.testng.annotations.DataProvider;
public class DataProviderCalculatorMultTests {
@DataProvider
public Object[][] multDataSet() {
return new Object[][]{
{-15.2, 0, 0},
{-2.25, 10, -22.5},
{-22222.2, -10.7, 237777.54}
};
}
@DataProvider
public Object[][] multDataSetL() {
return new Object[][]{
{-2, 0, 0},
{-222, -15, 3330},
{222222, -100, -22222200}
};
}
}
| [
"ivanovavv9@gmail.com"
] | ivanovavv9@gmail.com |
fbff9b5282825d2a628b337c75db901e0ef43402 | a534115fd3fa491472f10caf030185f349aab738 | /app/src/main/java/ercanduman/androidxmlparsing/XMLParser.java | dee496a778d1df4b65a408c46de962c721ac6739 | [] | no_license | ercanduman/Android_Xml_Parsing | b97ada4bb58c5b0010a9af6e14a6846919997a6f | 7b36d3976d54f1099fc9a62c6aeb1d29f2a84423 | refs/heads/master | 2020-12-04T19:10:11.798071 | 2017-05-15T12:38:38 | 2017-05-15T12:38:38 | 67,500,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,192 | java | package ercanduman.androidxmlparsing;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.StringReader;
public class XMLParser {
private static boolean inDataItemTag = false;
private static String currentTag;
private static Horoscope horoscope;
public static Horoscope parseFeed(String content) {
try {
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
XmlPullParser parser = factory.newPullParser();
parser.setInput(new StringReader(content));
int eventType = parser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
switch (eventType) {
case XmlPullParser.START_TAG:
currentTag = parser.getName();
if (currentTag.equals("item")) {
inDataItemTag = true;
horoscope = new Horoscope();
}
break;
case XmlPullParser.END_TAG:
if (parser.getName().equals("item")) {
inDataItemTag = false;
}
currentTag = "";
break;
case XmlPullParser.TEXT:
if (inDataItemTag && horoscope != null) {
switch (currentTag) {
case "title":
horoscope.setTitle(parser.getText());
break;
case "description":
horoscope.setDescription(parser.getText());
break;
default:
break;
}
}
break;
}
eventType = parser.next();
}
return horoscope;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
| [
"ercanduman30@gmail.com"
] | ercanduman30@gmail.com |
5c5b52473ce3bbc8d3f1e8c0432431e664124850 | eaa7bcaefb01880c225eab4a20e0197cd98c9179 | /src/main/java/org/marks/bean/jpa/StudentsEntity.java | 657535f8379bb8a0473bd7abc05a15992e640f90 | [] | no_license | panteraD/MarksJ | 1f79ecc634afd0d67c218a87ed62601d85d57d09 | dd97a22cf07fe3a9f0c3fb06d0ce785c7ca38646 | refs/heads/master | 2021-01-01T03:47:30.429053 | 2016-05-17T11:56:09 | 2016-05-17T11:56:09 | 59,014,804 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,183 | java | /*
* Created on 17 May 2016 ( Time 04:14:29 )
* Generated by Telosys Tools Generator ( version 2.1.1 )
*/
// This Bean has a basic Primary Key (not composite)
package org.marks.bean.jpa;
import java.io.Serializable;
//import javax.validation.constraints.* ;
//import org.hibernate.validator.constraints.* ;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
/**
* Persistent class for entity stored in table "students"
*
* @author Telosys Tools Generator
*
*/
@Entity
@Table(name="students", schema="sheet" )
// Define named queries here
@NamedQueries ( {
@NamedQuery ( name="StudentsEntity.countAll", query="SELECT COUNT(x) FROM StudentsEntity x" )
} )
public class StudentsEntity implements Serializable {
private static final long serialVersionUID = 1L;
//----------------------------------------------------------------------
// ENTITY PRIMARY KEY ( BASED ON A SINGLE FIELD )
//----------------------------------------------------------------------
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="id", nullable=false)
private Integer id ;
//----------------------------------------------------------------------
// ENTITY DATA FIELDS
//----------------------------------------------------------------------
@Column(name="full_name", length=2147483647)
private String fullName ;
@Column(name="record_book_number")
private Integer recordBookNumber ;
@Temporal(TemporalType.DATE)
@Column(name="start_year")
private Date startYear ;
@Temporal(TemporalType.DATE)
@Column(name="end_year")
private Date endYear ;
// "groupId" (column "group_id") is not defined by itself because used as FK in a link
//----------------------------------------------------------------------
// ENTITY LINKS ( RELATIONSHIP )
//----------------------------------------------------------------------
@ManyToOne
@JoinColumn(name="group_id", referencedColumnName="id")
private GroupsEntity groups ;
@OneToMany(mappedBy="students", targetEntity=StudentsDisciplineSemestrEntity.class)
private List<StudentsDisciplineSemestrEntity> listOfStudentsDisciplineSemestr;
//----------------------------------------------------------------------
// CONSTRUCTOR(S)
//----------------------------------------------------------------------
public StudentsEntity() {
super();
}
//----------------------------------------------------------------------
// GETTER & SETTER FOR THE KEY FIELD
//----------------------------------------------------------------------
public void setId( Integer id ) {
this.id = id ;
}
public Integer getId() {
return this.id;
}
//----------------------------------------------------------------------
// GETTERS & SETTERS FOR FIELDS
//----------------------------------------------------------------------
//--- DATABASE MAPPING : full_name ( text )
public void setFullName( String fullName ) {
this.fullName = fullName;
}
public String getFullName() {
return this.fullName;
}
//--- DATABASE MAPPING : record_book_number ( int4 )
public void setRecordBookNumber( Integer recordBookNumber ) {
this.recordBookNumber = recordBookNumber;
}
public Integer getRecordBookNumber() {
return this.recordBookNumber;
}
//--- DATABASE MAPPING : start_year ( date )
public void setStartYear( Date startYear ) {
this.startYear = startYear;
}
public Date getStartYear() {
return this.startYear;
}
//--- DATABASE MAPPING : end_year ( date )
public void setEndYear( Date endYear ) {
this.endYear = endYear;
}
public Date getEndYear() {
return this.endYear;
}
//----------------------------------------------------------------------
// GETTERS & SETTERS FOR LINKS
//----------------------------------------------------------------------
public void setGroups( GroupsEntity groups ) {
this.groups = groups;
}
public GroupsEntity getGroups() {
return this.groups;
}
public void setListOfStudentsDisciplineSemestr( List<StudentsDisciplineSemestrEntity> listOfStudentsDisciplineSemestr ) {
this.listOfStudentsDisciplineSemestr = listOfStudentsDisciplineSemestr;
}
public List<StudentsDisciplineSemestrEntity> getListOfStudentsDisciplineSemestr() {
return this.listOfStudentsDisciplineSemestr;
}
//----------------------------------------------------------------------
// toString METHOD
//----------------------------------------------------------------------
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("[");
sb.append(id);
sb.append("]:");
sb.append(fullName);
sb.append("|");
sb.append(recordBookNumber);
sb.append("|");
sb.append(startYear);
sb.append("|");
sb.append(endYear);
return sb.toString();
}
}
| [
"chernenkov.andrei@yandex.ru"
] | chernenkov.andrei@yandex.ru |
26c89456eae96cc46eba4e1343103f31e3709d94 | 15527811afe5021f5334675f9d30363af8df0fda | /src/com/javarush/test/level19/lesson03/task01/Solution.java | 43625eb77c0dc494d3505e6edcc94069adb9685e | [] | no_license | barrannov/JavaRushHomeWork | f65235fe4e41cc2cc2be47db9abcd13293665c35 | 704e951099c44ea81400fda6a2a31fc43d7e27d3 | refs/heads/master | 2021-01-24T17:53:42.858954 | 2016-09-08T21:37:33 | 2016-09-08T21:37:33 | 67,285,716 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,391 | java | package com.javarush.test.level19.lesson03.task01;
/* TableAdapter
Измените класс TableAdapter так, чтобы он адаптировал ATable к BTable.
Метод getHeaderText должен возвращать такую строку "[username] : tablename".
Пример, "[Amigo] : DashboardTable"
*/
public class Solution {
public static void main(String[] args) {
//это пример вывода
ATable aTable = new ATable() {
@Override
public String getCurrentUserName() {
return "Amigo";
}
@Override
public String getTableName() {
return "DashboardTable";
}
};
BTable table = new TableAdapter(aTable);
System.out.println(table.getHeaderText());
}
public static class TableAdapter implements BTable {
ATable aTable;
public TableAdapter(ATable aTable){
this.aTable = aTable;
}
@Override
public String getHeaderText() {
String b = aTable.getCurrentUserName();
String c = aTable.getTableName();
return "["+b+"]"+" : "+c;
}
}
public interface ATable {
String getCurrentUserName();
String getTableName();
}
public interface BTable {
String getHeaderText();
}
} | [
"newfilm0o@gmail.com"
] | newfilm0o@gmail.com |
18293c96cae8bdf402425f7f6539a948c09eec4a | cee2f0af1bda14a5fa59059d7805b6a225071b99 | /groupapp/src/main/java/com/zbmf/StockGroup/fragment/care/CareFansFragment.java | 2054d1a5d931832aae3f44041e490c4ea7c192bf | [] | no_license | pengqun1123/StockGroup | a30a6ea170d16300a3d2cae3e5a49933aeebbc19 | 64de8dbc188232f4b6277a56f61279d238b17776 | refs/heads/master | 2021-10-01T00:33:33.087802 | 2018-11-26T09:38:17 | 2018-11-26T09:38:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,436 | java | package com.zbmf.StockGroup.fragment.care;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.TextView;
import com.zbmf.StockGroup.R;
import com.zbmf.StockGroup.adapter.CareBoxItemAdapter;
import com.zbmf.StockGroup.api.JSONHandler;
import com.zbmf.StockGroup.api.WebBase;
import com.zbmf.StockGroup.beans.BoxBean;
import com.zbmf.StockGroup.beans.Group;
import com.zbmf.StockGroup.dialog.TextDialog;
import com.zbmf.StockGroup.fragment.BaseFragment;
import com.zbmf.StockGroup.interfaces.DialogYesClick;
import com.zbmf.StockGroup.interfaces.LoadFinish;
import com.zbmf.StockGroup.interfaces.OnFansClick;
import com.zbmf.StockGroup.utils.JSONParse;
import com.zbmf.StockGroup.utils.ShowActivity;
import com.zbmf.StockGroup.view.CustomViewpager;
import com.zbmf.StockGroup.view.ListViewForScrollView;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
/**
* Created by xuhao on 2017/8/16.
*/
public class CareFansFragment extends BaseFragment implements View.OnClickListener,OnFansClick{
private List<BoxBean> infolist;
private CareBoxItemAdapter adapter;
private String groupId;
String textStr = "抱歉,您暂未订阅铁粉";
String textTilt="升级到包月铁粉即可查看私密宝盒";
private TextDialog mDialog = null;
private ListViewForScrollView lv_tief;
private CustomViewpager careFragments;
private boolean isFirst;
public void setCustomViewPage(CustomViewpager careFragments) {
this.careFragments = careFragments;
}
public static CareFansFragment newInstance() {
CareFansFragment fragment = new CareFansFragment();
return fragment;
}
@Override
protected View setContentView(LayoutInflater inflater) {
return inflater.inflate(R.layout.fragment_care_fans_layout, null);
}
@Override
protected void initView() {
infolist = new ArrayList<>();
adapter = new CareBoxItemAdapter(getActivity(), infolist);
adapter.setOnFansClick(this);
lv_tief = getView(R.id.lv_focus);
lv_tief.setAdapter(adapter);
lv_tief.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
BoxBean boxBean = (BoxBean) parent.getItemAtPosition(position);
String box_level = boxBean.getBox_level();
groupId = boxBean.getId();
switch (box_level) {
case "20":
textTilt="抱歉,您暂未订阅年粉";
textStr = "升级到包年铁粉即可查看私密宝盒";
break;
case "10":
textTilt="抱歉,您暂未订阅铁粉";
textStr = "升级到包月铁粉即可查看私密宝盒";
break;
default:
break;
}
if (Integer.parseInt(box_level) <= Integer.parseInt(boxBean.getFans_level())) {
ShowActivity.showBoxDetailActivity(getActivity(), boxBean);
} else {
if (mDialog == null){
mDialog = showDialog();
}
mDialog.setTitle(textTilt);
mDialog.setMessage(textStr);
mDialog.show();
}
}
});
}
private TextDialog showDialog() {
return TextDialog.createDialog(getActivity())
.setLeftButton("暂不")
.setRightButton("升级")
.setRightClick(new DialogYesClick() {
@Override
public void onYseClick() {
fansInfo(groupId);
mDialog.dismiss();
}
});
}
@Override
protected void initData() {
isFirst = true;
rushList();
}
public void rushList() {
if (isFirst) {
isFirst = false;
dialogShow();
}
WebBase.box("1", new JSONHandler() {
@Override
public void onSuccess(JSONObject obj) {
BoxBean newsBox = JSONParse.box(obj);
if (newsBox != null && newsBox.getList() != null) {
infolist.clear();
infolist.addAll(newsBox.getList());
adapter.notifyDataSetChanged();
if (loadFinish != null) {
loadFinish.onFinish();
}
setViewPageHeight();
dialogDiss();
}
}
@Override
public void onFailure(String err_msg) {
if (loadFinish != null) {
loadFinish.onFinish();
}
dialogDiss();
setViewPageHeight();
}
});
}
public void setViewPageHeight() {
careFragments.setObjectForPosition(getFragmentView(), 0);
careFragments.resetHeight(0);
}
private void fansInfo(String group_id) {
WebBase.fansInfo(group_id, new JSONHandler() {
@Override
public void onSuccess(JSONObject obj) {
Group group = JSONParse.getGroup(obj.optJSONObject("group"));
ShowActivity.showFansActivity(getActivity(), group);
}
@Override
public void onFailure(String err_msg) {
}
});
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.tv_yes:
break;
case R.id.tv_no:
mDialog.dismiss();
break;
}
}
private LoadFinish loadFinish;
public void setLoadFinish(LoadFinish loadFinish) {
this.loadFinish = loadFinish;
}
@Override
public void onBox(BoxBean boxBean) {
ShowActivity.showBoxDetailActivity(getActivity(), boxBean);
}
@Override
public void onFans(String groupId) {
fansInfo(groupId);
}
@Override
public void onGroup(String user) {
ShowActivity.showGroupDetailActivity(getActivity(),user);
}
}
| [
"lulu.natan@gmail.com"
] | lulu.natan@gmail.com |
294600d4afc0fa78fa0268a6a39e8d74711b03b8 | 661c696d7954c5c4098af953984e57f629f26091 | /src/main/java/org/yiva/cqt/core/IAccountService.java | d04fb1590b71f0dcc4ea23e1be2254f64856f204 | [] | no_license | yiva/cqt | 9e15c24a0ef81310d529fb2842d152411aa231bf | f4cc4eed91e6cb0af9de6aa99898cc4146b073c1 | refs/heads/master | 2021-01-19T14:59:57.860595 | 2018-07-07T08:21:50 | 2018-07-07T08:21:50 | 100,935,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 169 | java | package org.yiva.cqt.core;
import java.util.ArrayList;
import org.yiva.cqt.model.Account;
public interface IAccountService {
ArrayList<Account> findAllAccount();
}
| [
"wyhtsh@gmail.com"
] | wyhtsh@gmail.com |
579b17f3914e433637402e596008cc52d660b91e | 68fd73c49a5e76f1ec6f04d80086cc3d710adc0b | /src/rdbms/RegexTest.java | ae134144b249172e4ccb5a3a6947bd4adf61d30c | [] | no_license | austinsims/rdbms | f6b86754f8253b850b838d31df2826cf932720cd | cf68d6f5e3fed0f6939a9fd113455ccc9bac9d01 | refs/heads/master | 2021-01-01T19:46:04.656367 | 2015-02-04T04:11:46 | 2015-02-04T04:11:46 | 17,717,167 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,215 | java | package rdbms;
public class RegexTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "INSERT INTO department VALUES('Computer, (SCIE,NCE)',50,14,'Hello world (hi there!)');";
/*
str = str.replaceAll("(?x) " +
", " + // Replace ,
"(?= " + // Followed by
" (?: " + // Start a non-capture group
" [^']* " + // 0 or more non-single quote characters
" ' " + // 1 single quote
" [^']* " + // 0 or more non-single quote characters
" ' " + // 1 single quote
" )* " + // 0 or more repetition of non-capture group (multiple of 2 quotes will be even)
" [^']* " + // Finally 0 or more non-single quotes
" $ " + // Till the end (This is necessary, else every _ will satisfy the condition)
") " , // End look-ahead
" , "); // Replace with " , "
*/
str = pad(str, ",");
str = pad(str, "\\(");
str = pad(str, "\\)");
System.out.println(str);
}
public static String pad(String s, String ch) {
return s.replaceAll("(?x) " +
String.format("%s ",ch) + // Replace ch
"(?= " + // Followed by
" (?: " + // Start a non-capture group
" [^']* " + // 0 or more non-single quote characters
" ' " + // 1 single quote
" [^']* " + // 0 or more non-single quote characters
" ' " + // 1 single quote
" )* " + // 0 or more repetition of non-capture group (multiple of 2 quotes will be even)
" [^']* " + // Finally 0 or more non-single quotes
" $ " + // Till the end (This is necessary, else every _ will satisfy the condition)
") " , // End look-ahead
String.format(" %s ",ch)); // Replace with " , "
}
}
| [
"adsims2001@gmail.com"
] | adsims2001@gmail.com |
f647ef89fc6114b98b1ee28acd3eb3a99c09a43c | d2287c5762e985e14ff6fe84c643c75de4c1787a | /src/main/java/com/oj/service/serviceImpl/system/UserServiceImpl.java | cca8ae02284790abc46883ab4e2a8ce90190bfb8 | [] | no_license | PanQihang/OJ_front | 0ac228634f970110d76fed9f6fd0cacbd950dfc6 | a3f82a00dd5648030653a448aaa1f2f1d0449f14 | refs/heads/master | 2022-12-25T01:21:43.006809 | 2019-06-18T02:44:35 | 2019-06-18T02:44:35 | 192,452,063 | 1 | 0 | null | 2022-12-16T00:02:06 | 2019-06-18T02:38:09 | JavaScript | UTF-8 | Java | false | false | 3,308 | java | package com.oj.service.serviceImpl.system;
import com.oj.entity.system.User;
import com.oj.frameUtil.OJPWD;
import com.oj.mapper.system.UserMapper;
import com.oj.service.system.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
/**
* @author lixu
* @Time 2019年3月9日 15点21分
* @Description 系统用户管理相关功能Service接口实现类
*/
//向框架中注册Service
@Service
public class UserServiceImpl implements UserService {
private Logger log = LoggerFactory.getLogger(this.getClass());
//注入UserMapper
@Autowired(required = false)
private UserMapper mapper;
/**
* 返回Map类型的List接口方法实现
* @param param
* @author lixu
* @return List<Map>
*/
@Override
public List<Map> getUserMapList(Map<String, String> param) {
return mapper.getUserMapList(param);
}
@Override
public List<Map> getRoleSelectInfo(){
return mapper.getRoleSelectInfo();
}
/**
* 保存或更新用户
* @param user
* @throws Exception
*/
@Transactional
@Override
public void saveOrUpdateUser(User user) throws Exception {
//若用户id为空,为保存
if (StringUtils.isEmpty(user.getId())){
//若当前登录名已经存在,则抛出用户已存在的异常
if(mapper.getUserByAccount(user.getAccount()).size()>0){
throw new Exception("当前登录名已存在!");
}else{
//将新增的用户密码设为123456
user.setPassword(OJPWD.OJPWDTOMD5("123456"));
mapper.save(user);
}
}else{
//不是新用户,进行用户更新
mapper.update(user);
}
}
/**
* 用户删除接口功能实现
* @param id
*/
@Transactional
@Override
public void userDelete(String id) {
//在删除用户之前应该先对其关联的课程信息进行解绑
mapper.userCourseDelete(id);
//解绑成功之后,再进行用户删除操作
mapper.userDelete(id);
}
/**
* 获取课程列表接口功能实现
* @param user_id
* @return
*/
@Override
public List<Map> getCourseList(String user_id) {
return mapper.getCourseList(user_id);
}
/**
* 保存用户绑定课程的信息功能接口实现
* @param param
*/
@Transactional
@Override
public void saveCourseList(Map<String, Object> param) {
String user_id = param.get("user_id").toString();
List<String> course_list = (List<String>)param.get("course_list");
//现解除用户的全部课程绑定
mapper.userCourseDelete(user_id);
//重新对用户的课程进行绑定
for (String course_id : course_list){
mapper.saveCourseList(user_id, course_id);
}
}
}
| [
"954347921@qq.com"
] | 954347921@qq.com |
fa011aba132b156fae4854bf6dd67a69a7c426f2 | 6676ada13472d0cde05e0eda694a2a8786f6caa4 | /wlzx-po/src/main/java/net/wano/po/course/ext/TeachplanParameter.java | 0c243064fa90fe50683f4031fe637b74d45082f3 | [] | no_license | asen109785/wlzx-parent | f732030177a30ca00be9439e78725578fe03f77e | fb17537ac9e779224dbf325ab23a5241328955d1 | refs/heads/master | 2022-12-14T11:10:06.808361 | 2020-04-02T09:25:22 | 2020-04-02T09:25:22 | 252,409,819 | 0 | 0 | null | 2022-12-10T05:47:01 | 2020-04-02T09:22:01 | Java | UTF-8 | Java | false | false | 344 | java | package net.wano.po.course.ext;
import net.wano.po.course.Teachplan;
import lombok.Data;
import lombok.ToString;
import java.util.List;
/**
* Created by admin on 2018/2/7.
*/
@Data
@ToString
public class TeachplanParameter extends Teachplan {
//二级分类ids
List<String> bIds;
//三级分类ids
List<String> cIds;
}
| [
"1097851957@qq.com"
] | 1097851957@qq.com |
933ba4dc27e7082f27c0fa986acb6e240605a053 | 676441e8f151add381d2cad075455fd0aa5de8ba | /Builds/BuildingBlocks-v5.0.9/app/src/main/java/com/akshara/mathapp/activity/PermissionActivity.java | d06139fc346c193efc5c0015fd0727712f5af241 | [] | no_license | CallystroInfotech/AksharaProject | dd7cd0019e050e4bd8cd0703d69a679a5e5c77a2 | 4e8469b6bc1357759878d1bb4a00493c34fa305b | refs/heads/master | 2021-05-03T09:33:02.013182 | 2019-09-10T09:16:49 | 2019-09-10T09:16:49 | 120,575,926 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,150 | java | package com.akshara.mathapp.activity;
import android.content.Intent;
import android.content.res.AssetManager;
import android.os.Bundle;
import com.akshara.mathapp.MathApp;
import com.akshara.mathapp.R;
import com.akshara.mathapp.Utils;
import com.akshara.mathapp.data.local.User;
import com.akshara.mathapp.interfaces.PermissionsApi;
import com.akshara.mathapp.utils.AppConstants;
import com.akshara.mathapp.utils.CustomPermissionUtils;
import com.akshara.mathapp.utils.PermissionUtils;
import com.google.firebase.analytics.FirebaseAnalytics;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
public class PermissionActivity extends BaseActivity implements PermissionsApi.PermissionCallback {
List<User> checkUserList = new ArrayList<>();
private FirebaseAnalytics mFirebaseAnalytics;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
setupPermissions();
}
@Override
protected int getLayoutResource() {
return R.layout.activity_permission;
}
private void setupPermissions() {
PermissionsApi.getInstance().setPermissionCallback(this);
}
@Override
protected String getLanguageValue() {
return null;
}
@Override
protected void onStart() {
super.onStart();
checkAllPermission();
}
protected void checkAllPermission()
{
if (!PermissionUtils.hasPermission(this, CustomPermissionUtils.getMediaPermissions(),
getString(R.string.message_rationale_storage_permission), AppConstants.REQUEST_GALLERY_PERMISSION)) {
return;
}
else if(!PermissionUtils.hasPermission(this, CustomPermissionUtils.getDeviceInfoPermission(),
getString(R.string.message_rationale_device_id_permission), AppConstants.REQUEST_DEVICE_INFO)) {
return;
}
else if(!PermissionUtils.hasPermission(this, CustomPermissionUtils.getLocationPermission(),
getString(R.string.message_rationale_location_permission), AppConstants.REQUEST_LOCATION_PERMISSION)) {
return;
}
else
{
downloadFullImages();
checkUsers();
}
}
private void checkUsers() {
new Thread(new Runnable() {
@Override
public void run() {
checkUserList = MathApp.get().getLocalDb().userDao().getAll();
checkUserExists();
}
}).start();
}
private void checkUserExists() {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (!checkUserList.isEmpty()) {
gotoImageLoginScreenScreen();
} else {
gotoPhoneLoginScreenScreen();
}
}
});
}
private void gotoImageLoginScreenScreen()
{
startActivity(new Intent(this, ImageLoginActivity.class));
//startActivity(new Intent(this, LanguageSelectionActivity.class));
}
private void gotoPhoneLoginScreenScreen()
{
startActivity(new Intent(this, PhoneLoginActivity.class));
//startActivity(new Intent(this, LanguageSelectionActivity.class));
}
@Override
public void onPermissionGranted(int requestCode) {
switch (requestCode) {
case AppConstants.REQUEST_LOCATION_PERMISSION:
case AppConstants.REQUEST_DEVICE_INFO:
case AppConstants.REQUEST_GALLERY_PERMISSION:
checkAllPermission();
break;
}
if(requestCode == 101){
Bundle param = new Bundle();
param.putString("Gallery_permission_val","");
mFirebaseAnalytics.logEvent("Gallery_permission_granted",param);
}
else if(requestCode == 103){
Bundle param1 = new Bundle();
param1.putString("Location_permission_val","");
mFirebaseAnalytics.logEvent("Location_permission_granted",param1);
}
else if(requestCode == 104){
Bundle param2 = new Bundle();
param2.putString("DeviceInfo_permsn_val","");
mFirebaseAnalytics.logEvent("DeviceInfo_permission_granted",param2);
}
}
@Override
public void onPermissionDenied(int requestCode) {
if(requestCode == 101){
Bundle param0 = new Bundle();
param0.putString("Gallery_permission_val","");
mFirebaseAnalytics.logEvent("Gallery_permission_denied",param0);
}
else if(requestCode == 103){
Bundle param11 = new Bundle();
param11.putString("Location_permission_val","");
mFirebaseAnalytics.logEvent("Location_permission_denied",param11);
}
else if(requestCode == 104){
Bundle param22 = new Bundle();
param22.putString("DeviceInfo_permsn_val","");
mFirebaseAnalytics.logEvent("DeviceInfo_permission_denied",param22);
}
}
private void downloadFullImages()
{
copyAssets("fish.jpg");
copyAssets("butterfly.jpg");
copyAssets("flower.jpg");
copyAssets("parrot.jpg");
copyAssets("sun.jpg");
copyAssets("tree.jpg");
}
private void copyAssets(String filename)
{
String dirPath = Utils.downloadDirectoryFullPath;
File dir = new File(dirPath);
if(!dir.exists())
{
dir.mkdirs();
}
AssetManager assetManager = getAssets();
InputStream in =null;
OutputStream out = null;
try{
in = assetManager.open(filename);
File outFile = new File(dirPath,filename);
out = new FileOutputStream(outFile);
copyFileToDirectory(in,out);
}catch (Exception e)
{
e.printStackTrace();
}
finally {
if(in != null)
{
try{
in.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
if(out != null)
{
try{
out.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
}
private void copyFileToDirectory(InputStream in , OutputStream out)throws IOException
{
byte[] buffer = new byte[1024];
int read;
while((read = in.read(buffer)) != -1)
{
out.write(buffer,0,read);
}
}
}
| [
"noreply@github.com"
] | CallystroInfotech.noreply@github.com |
3ed38c041421eb337c1057d3ec40e17de5e2e34e | 2e269300a47b07a6e4d2cf9395ab27b1e4ecbe7a | /EclipseWorkspace/WCARE/src/com/enercon/global/utils/CallSchedulerForMissingScadaData.java | 805c99d25f03a24a4a1231fc104d3b5706e18eb6 | [] | no_license | Mitzz/WWIL | 694f81f916d622c6e8fb76cd17a00bcdfea63c39 | e0bb3a11e558357d894e534c829b83a280f7dc28 | refs/heads/master | 2021-05-04T10:22:22.860253 | 2016-10-02T12:01:30 | 2016-10-02T12:01:30 | 44,241,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,819 | java | package com.enercon.global.utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import com.enercon.customer.dao.CustomerDao;
import com.enercon.customer.util.CustomerUtil;
import com.enercon.global.utility.DateUtility;
public class CallSchedulerForMissingScadaData {
private String todaysDate = GlobalUtils.todaysDateInGivenFormat("dd/MM/yyyy");
private String[] receiverEmailIDs = {"missing.scadadata@windworldindia.com"};/*"mithul.bhansali@windworldindia.com""Vinay.Singh@windworldindia.com"*/
private static final String senderEmailID = "WindWorldCare@windworldindia.com";
public void callTimer() throws Exception {
callScheduleForMissingScadaData(DateUtility.getYesterdayDateInGivenStringFormat("dd/MM/yyyy"));
System.out.println("Testing 1 - Send Http GET request");
}
/*Must be in the format dd/mm/yyyy*/
public void callScheduleForMissingScadaData(String date) throws Exception {
String cls = "TableRow1";
StringBuffer msg = new StringBuffer();
List missingScadaDataList = new ArrayList();
CustomerUtil custUtils = new CustomerUtil();
CustomerDao custDAO = new CustomerDao();
/*Must be in the format dd/mm/yyyy*/
String missingScadaDataDate = date;
ArrayList<String> stateIDs = custDAO.getStateID();
ArrayList<String> stateNames = custDAO.getStateNames();
/*ArrayList for Storing Column Data*/
ArrayList<String> stateName = new ArrayList<String>();
ArrayList<String> areaName = new ArrayList<String>();
ArrayList<String> siteName = new ArrayList<String>();
ArrayList<String> locationNo = new ArrayList<String>();
ArrayList<String> plantNo = new ArrayList<String>();
ArrayList<String> wecName = new ArrayList<String>();
ArrayList<String> technicalNo = new ArrayList<String>();
ArrayList<String> missingDays = new ArrayList<String>();
ArrayList<Integer> totalWECStateWise = new ArrayList<Integer>();
for(String stateID:stateIDs){
missingScadaDataList = (List) custUtils.getMissingScadaDataReport(stateID, "", "", missingScadaDataDate);
//System.out.println("------------------1--------------------------");
//GlobalUtils.displayVectorMember(missingScadaDataList);
if (missingScadaDataList.size() > 0) {
for (int i = 0; i < missingScadaDataList.size(); i++) {
Vector v = new Vector();
v = (Vector) missingScadaDataList.get(i);
/*System.out.println("---------1---------2--------------------------");
GlobalUtils.displayVectorMember(v);*/
stateName.add(v.get(0).toString());
areaName.add(v.get(1).toString());
siteName.add(v.get(2).toString());
locationNo.add(v.get(3).toString());
plantNo.add(v.get(4).toString());
wecName.add(v.get(5).toString());
missingDays.add(v.get(6).toString());
technicalNo.add(v.get(7).toString());
}
}
totalWECStateWise.add(missingScadaDataList.size());
missingScadaDataList.clear();
}
int totalWECs = 0;
for (Integer integer : totalWECStateWise) {
totalWECs += integer;
}
if(totalWECs >= 0){
msg.append("<!DOCTYPE html>\n");
msg.append("<html>\n");
msg.append("<head>\n");
msg.append("\t<title>Missing Scada Data</title>\n");
msg.append("\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
msg.append("\t<style type=\"text/css\">\n");
msg.append("\t\t.test{ \n");
msg.append("\t\t\tbackground: LightGreen;\n");
msg.append("\t\t\ttext-align: center;\n");
msg.append("\t\t\tfont-weight: bolder;\n");
msg.append("\t\t}\n");
msg.append("\t</style>\n");
msg.append("</head>\n");
msg.append("<body>\n");
msg.append("<table cellSpacing=0 cellPadding=0 width=\"90%\" border=1>\n");
msg.append("\t<tr class=TableTitleRow>\n");
msg.append("\t\t<td colspan='2' style = 'background: LightGreen;text-align: center;font-weight: bolder;' width=\"100%\">Missing SCADA Data for "+ missingScadaDataDate + ":Total WECs Statewise</td>\n");
msg.append("\t</tr>\n");
msg.append("\t<tr class=TableTitleRow>\n");
msg.append("\t\t<td class = \"test\" width=\"50%\">State Name</td>\n");
msg.append("\t\t<td class = \"test\" width=\"50%\">Total WECs</td>\n");
msg.append("\t</tr>\n");
for (int i = 0; i < stateNames.size() ; i++) {
msg.append("\t<tr class=TableTitleRow>\n");
msg.append("\t\t<td style = 'text-align: center;' width=\"50%\">"+ stateNames.get(i) +"</td>\n");
msg.append("\t\t<td style = 'text-align: center;' width=\"50%\">"+ totalWECStateWise.get(i) +"</td>\n");
msg.append("\t</tr>\n");
}
msg.append("\t<tr class=TableTitleRow>\n");
msg.append("\t\t<td class = \"test\" width=\"50%\">Grand Total</td>\n");
msg.append("\t\t<td class = \"test\" width=\"50%\">" + totalWECs + "</td>\n");
msg.append("\t</tr>\n");
msg.append("</table>\n");
if(totalWECs <= 0){
}
else{
msg.append("<br>\n");
msg.append("<table cellSpacing=0 cellPadding=0 width=\"90%\" border=1>\n");
msg.append("\t<tr class=TableTitleRow>\n");
msg.append("\t\t<td colspan='9' style = 'background: LightGreen;text-align: center;font-weight: bolder;' width=\"100%\">Missing SCADA Data for "+ missingScadaDataDate + ":All WECs Details Statewise</td>\n");
msg.append("\t</tr>\n");
msg.append("\t<tr class=TableTitleRow>\n");
msg.append("\t\t<td class = \"test\" width=\"5%\">Sr No.</td>\n");
msg.append("\t\t<td class = \"test\" width=\"15%\">State Name</td>\n");
msg.append("\t\t<td class = \"test\" width=\"15%\">Area Name</td>\n");
msg.append("\t\t<td class = \"test\" width=\"15%\">Site Name</td>\n");
msg.append("\t\t<td class = \"test\" width=\"10%\">Location No</td>\n");
msg.append("\t\t<td class = \"test\" width=\"10%\">Plant No</td>\n");
msg.append("\t\t<td class = \"test\" width=\"15%\">WEC Name</td>\n");
msg.append("\t\t<td class = \"test\" width=\"10%\">Missing Days</td>\n");
msg.append("\t\t<td class = \"test\" width=\"15%\">Technical No</td>\n");
msg.append("\t</tr>\n");
//System.out.println(stateName.size());
for (int i = 0; i < stateName.size(); i++) {
int rem = 1;
rem = i % 2;
if (rem == 0)
cls = "TableRow2";
else
cls = "TableRow1";
msg.append("\t<tr class=" + cls + ">\n");
msg.append("\t\t<td style = 'text-align:center;'>" + (i+1) + "</td>\n");
msg.append("\t\t<td>" + stateName.get(i) + "</td>\n");
msg.append("\t\t<td>" + areaName.get(i) + "</td>\n");
msg.append("\t\t<td>" + siteName.get(i) + "</td>\n");
msg.append("\t\t<td align=\"center\">" + locationNo.get(i) + "</td>\n");
msg.append("\t\t<td align=\"center\">" + plantNo.get(i) + "</td>\n");
msg.append("\t\t<td>" + wecName.get(i) + "</td>\n");
msg.append("\t\t<td align=\"center\">" + missingDays.get(i) + "</td>\n");
msg.append("\t\t<td align=\"center\">" + technicalNo.get(i) + "</td>\n");
msg.append("\t</tr>\n");
}
msg.append("</table>\n");
}
msg.append("</body>\n");
msg.append("</html>\n");
String Remarks="Message Not Sent Due To some Problem";
boolean flag=false;
SendMail sm =new SendMail();
String subject= "Missing Scada Data for " + missingScadaDataDate + ":Total WECs Statewise (Report as per data availability in SCADA database @ 10:00 hours on " + todaysDate + ")";
for (int i = 0; i < receiverEmailIDs.length; i++) {
flag=sm.sendMail(receiverEmailIDs[i],senderEmailID,subject,new String(msg));
}
Remarks="Message Sent Sucessfully";
}
}
}
| [
"91014863@172.18.25.152"
] | 91014863@172.18.25.152 |
0e590f96c20fb144862091d9b5284160aeb91776 | c3ecdf614dfe44eae3625f5a540a821f979d6de6 | /HackSCApp/gen/com/example/hackscapp/BuildConfig.java | 0956b75587628293fa6255eb3bf38e1efa872205 | [] | no_license | hacksc2014/android_v2 | 3b671995fe403cc8b1402869b546688ca1a7506b | bfc9c32d0ae30cd2e40dd3ed16e9cd55f35ca230 | refs/heads/master | 2016-09-06T00:57:46.771340 | 2014-11-09T14:25:42 | 2014-11-09T14:25:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 163 | java | /** Automatically generated file. DO NOT MODIFY */
package com.example.hackscapp;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | [
"bcen96@gmail.com"
] | bcen96@gmail.com |
907ffa38e04dcd88d988a862ae4869f62f2d4357 | 64ce6cc211e8e01ea34fcb79b9ab527cdf7c7eab | /ipproject/src/desktopapplication1/GREATDEALS.java | 5181887fae1195c5a6ba8bdec41900dabfc8ac0e | [] | no_license | ankurdua15/infikart | 541316e53f0c412dd519c9a1c53202892c4655d1 | ee669bc4d0f01aad3fc42640dd66877462a2028f | refs/heads/master | 2021-09-07T23:40:32.528832 | 2018-03-03T10:46:07 | 2018-03-03T10:46:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,773 | java | package desktopapplication1;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Lakshit
*/
public class GREATDEALS extends javax.swing.JFrame {
/**
* Creates new form GREATDEALS
*/
public GREATDEALS() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField();
jButton9 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jButton10 = new javax.swing.JButton();
jButton15 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
});
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/20150824-144054-p3.jpg"))); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, 160, 250));
jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/20151119-142712-p3-3.jpg"))); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
getContentPane().add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 50, 170, 250));
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/nxtbtn.jpg"))); // NOI18N
jButton1.setOpaque(false);
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 310, 90, 40));
jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/20151124-00009-3.2.jpg"))); // NOI18N
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
getContentPane().add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 50, 320, 250));
jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Screenshot (4).png"))); // NOI18N
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});
getContentPane().add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 50, 50));
jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jTextField1KeyTyped(evt);
}
});
getContentPane().add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 10, 180, 30));
jButton9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/482300283.jpg"))); // NOI18N
jButton9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton9ActionPerformed(evt);
}
});
getContentPane().add(jButton9, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 10, 80, 30));
jButton8.setFont(new java.awt.Font("Century Schoolbook", 1, 18));
jButton8.setForeground(new java.awt.Color(255, 255, 255));
jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Screenshot (3).png"))); // NOI18N
jButton8.setText("0");
jButton8.setIconTextGap(-50);
jButton8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton8ActionPerformed(evt);
}
});
getContentPane().add(jButton8, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 10, 140, 30));
jButton8.setText(""+var.cart[0].getItemCount());
jButton10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Screenshot (5).png"))); // NOI18N
jButton10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton10ActionPerformed(evt);
}
});
getContentPane().add(jButton10, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 10, 40, 40));
jButton15.setBackground(new java.awt.Color(255, 255, 255));
jButton15.setFont(new java.awt.Font("Comic Sans MS", 1, 18));
jButton15.setForeground(new java.awt.Color(153, 0, 0));
jButton15.setText("X");
jButton15.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton15ActionPerformed(evt);
}
});
getContentPane().add(jButton15, new org.netbeans.lib.awtextra.AbsoluteConstraints(700, 10, -1, -1));
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/white.jpg"))); // NOI18N
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 750, 370));
pack();
}// </editor-fold>//GEN-END:initComponents
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
// TODO add your handling code here:
}//GEN-LAST:event_formWindowClosed
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
this.dispose();
new buttoncategories().setVisible(true); // TODO add your handling code here:
}//GEN-LAST:event_jButton7ActionPerformed
private void jTextField1KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyTyped
// TODO add your handling code here:
}//GEN-LAST:event_jTextField1KeyTyped
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
var.srch=jTextField1.getText();
new search().setVisible(true);
this.dispose();
}//GEN-LAST:event_jButton9ActionPerformed
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
new cart().setVisible(true);
this.dispose();// TODO add your handling code here:
}//GEN-LAST:event_jButton8ActionPerformed
private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
new Accountinfo().setVisible(true);
this.dispose(); // TODO add your handling code here:
}//GEN-LAST:event_jButton10ActionPerformed
private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed
this.setVisible(false);
new exit().setVisible(true); // TODO add your handling code here:
}//GEN-LAST:event_jButton15ActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
this.dispose();
new part2greatdeals().setVisible(true);// TODO add your handling code here:
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
var.srch="tv";
this.dispose();
new search().setVisible(true);// TODO add your handling code here:
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
var.srch="laptop";
this.dispose();
new search().setVisible(true); // TODO add your handling code here:
}//GEN-LAST:event_jButton3ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
var.srch="bag";
this.dispose();
new search().setVisible(true); // TODO add your handling code here:
}//GEN-LAST:event_jButton4ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(GREATDEALS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(GREATDEALS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(GREATDEALS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(GREATDEALS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new GREATDEALS().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton10;
private javax.swing.JButton jButton15;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JButton jButton9;
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField jTextField1;
// End of variables declaration//GEN-END:variables
}
| [
"ankurdua15@gmail.com"
] | ankurdua15@gmail.com |
35630e6d81c42c29578800d8e20a5564e049d1e1 | 6c48b19fdfb36fc0e5a78bf3e49a6a62a8c4adca | /src/main/java/com/techlooper/dto/ChallengeQualificationDto.java | 28cfd30a73dafd93aada915c9aead247b5145765 | [] | no_license | khoa-nd/TechLooper | a22c4ee824b06e5282475f8bb94a7a641a76e3a8 | aa0c6270a5f50bfaeebadcb19c00e9b9649459d3 | refs/heads/master | 2021-01-18T00:12:24.768752 | 2016-02-22T07:11:54 | 2016-02-22T07:11:54 | 25,450,824 | 1 | 0 | null | 2015-12-10T07:43:27 | 2014-10-20T04:32:02 | FreeMarker | UTF-8 | Java | false | false | 852 | java | package com.techlooper.dto;
import com.techlooper.model.ChallengePhaseEnum;
import java.util.List;
/**
* Created by NguyenDangKhoa on 11/10/15.
*/
public class ChallengeQualificationDto {
private Long challengeId;
private ChallengePhaseEnum nextPhase;
private List<Long> registrantIds;
public Long getChallengeId() {
return challengeId;
}
public void setChallengeId(Long challengeId) {
this.challengeId = challengeId;
}
public List<Long> getRegistrantIds() {
return registrantIds;
}
public void setRegistrantIds(List<Long> registrantIds) {
this.registrantIds = registrantIds;
}
public ChallengePhaseEnum getNextPhase() {
return nextPhase;
}
public void setNextPhase(ChallengePhaseEnum nextPhase) {
this.nextPhase = nextPhase;
}
}
| [
"ndkhoa.is@gmail.com"
] | ndkhoa.is@gmail.com |
9d0b81688f962a75ad1cd9d6d6e3a21c9939f1ba | aa78dedff218012411785e337a1e8805dcb994f7 | /src/controler/controlerOnline/MazeGameControlerOnline.java | be79638fc8cde4a36645ec139b283107df2737b2 | [] | no_license | dmartins06/Labyrinthe | cd79d45ca44b215452c3517daba5b887665afef0 | 559c24c4bb45209590e0e02f2e52ba52e307e789 | refs/heads/master | 2021-03-19T18:41:33.164684 | 2018-01-26T10:13:36 | 2018-01-26T10:13:36 | 105,763,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 531 | java | package controler.controlerOnline;
import controler.controlerLocal.MazeGameControler;
import model.Coord;
import model.observable.MazeGame;
public abstract class MazeGameControlerOnline extends MazeGameControler {
public MazeGameControlerOnline(MazeGame mazeGame) {
super(mazeGame);
}
@Override
public boolean isPlayerOK(Coord initCoord) {
return this.mazeGame.isPlayerOk(initCoord);
}
@Override
protected void endMove(Coord initCoord, Coord finalCoord, String promotionType) { }
}
| [
"martin.bolot@cpe.fr"
] | martin.bolot@cpe.fr |
1dbe2d85a18bfc09d0ca99c8f56b053d23982f9b | 1fa550da3681ff2e1e4ba9d23b087f1ac824c214 | /src/android/src/org/pjsip/pjsua2/LogConfig.java | 8e0912f77fc138a5de7846e1392eed6132713829 | [] | no_license | No-Dream-No-Life/cordova-plugin-sip | 34ffaa1e921d354e3d6416d54c1a0e06363d11ce | aa78d8c1e4b4f5941ed2e2dfbc14162158ea8803 | refs/heads/master | 2022-03-04T19:40:23.860593 | 2019-10-28T14:17:56 | 2019-10-28T14:17:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,140 | java | /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.pjsip.pjsua2;
public class LogConfig extends PersistentObject {
private transient long swigCPtr;
protected LogConfig(long cPtr, boolean cMemoryOwn) {
super(pjsua2JNI.LogConfig_SWIGUpcast(cPtr), cMemoryOwn);
swigCPtr = cPtr;
}
public LogConfig() {
this(pjsua2JNI.new_LogConfig(), true);
}
protected static long getCPtr(LogConfig obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
pjsua2JNI.delete_LogConfig(swigCPtr);
}
swigCPtr = 0;
}
super.delete();
}
public long getMsgLogging() {
return pjsua2JNI.LogConfig_msgLogging_get(swigCPtr, this);
}
public void setMsgLogging(long value) {
pjsua2JNI.LogConfig_msgLogging_set(swigCPtr, this, value);
}
public long getLevel() {
return pjsua2JNI.LogConfig_level_get(swigCPtr, this);
}
public void setLevel(long value) {
pjsua2JNI.LogConfig_level_set(swigCPtr, this, value);
}
public long getConsoleLevel() {
return pjsua2JNI.LogConfig_consoleLevel_get(swigCPtr, this);
}
public void setConsoleLevel(long value) {
pjsua2JNI.LogConfig_consoleLevel_set(swigCPtr, this, value);
}
public long getDecor() {
return pjsua2JNI.LogConfig_decor_get(swigCPtr, this);
}
public void setDecor(long value) {
pjsua2JNI.LogConfig_decor_set(swigCPtr, this, value);
}
public String getFilename() {
return pjsua2JNI.LogConfig_filename_get(swigCPtr, this);
}
public void setFilename(String value) {
pjsua2JNI.LogConfig_filename_set(swigCPtr, this, value);
}
public long getFileFlags() {
return pjsua2JNI.LogConfig_fileFlags_get(swigCPtr, this);
}
public void setFileFlags(long value) {
pjsua2JNI.LogConfig_fileFlags_set(swigCPtr, this, value);
}
public LogWriter getWriter() {
long cPtr = pjsua2JNI.LogConfig_writer_get(swigCPtr, this);
return (cPtr == 0) ? null : new LogWriter(cPtr, false);
}
public void setWriter(LogWriter value) {
pjsua2JNI.LogConfig_writer_set(swigCPtr, this, LogWriter.getCPtr(value), value);
}
public void readObject(ContainerNode node) throws java.lang.Exception {
pjsua2JNI.LogConfig_readObject(swigCPtr, this, ContainerNode.getCPtr(node), node);
}
public void writeObject(ContainerNode node) throws java.lang.Exception {
pjsua2JNI.LogConfig_writeObject(swigCPtr, this, ContainerNode.getCPtr(node), node);
}
}
| [
"2292735470@qq.com"
] | 2292735470@qq.com |
f84769341f05aa1ec8f9ca638822306ee2d48429 | 7bcc6a4d3a3062d6645386cc68b7ab2f88f48cd5 | /E_quiz/app/src/main/java/com/example/e_quiz/Data.java | 031473e6a501ade3027ce05fadc5b6c770626489 | [] | no_license | Mohd-Anwar/E-quiz-android-app | a91dd7ddc7aeb852910fe04cc1aa119a182c9aaf | e8a656f500c11e7db329da94d70ad2a32c36bc3d | refs/heads/master | 2020-07-26T05:49:00.810227 | 2019-09-15T08:49:36 | 2019-09-15T08:49:36 | 208,554,683 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,071 | java | package com.example.e_quiz;
import android.os.CountDownTimer;
import android.widget.Toast;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.concurrent.TimeUnit;
public class Data
{
int qn;
private DatabaseReference mDatabase;
int getcount(String sub)
{
mDatabase = FirebaseDatabase.getInstance().getReference("Setting").child(sub);
// DatabaseReference data = mDatabase.child("Users").child(auth.getCurrentUser().getUid()).child("name");
mDatabase.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
qn=(int)snapshot.getChildrenCount();
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
return qn;
}
}
| [
"anwargreat3@gmail.com"
] | anwargreat3@gmail.com |
2725f23675c974ea7a7a3f7c484e72a55676c38b | 64b85cb9845cfb1b005056ee8fff8fe088b583ef | /src/main/java/me/krymz0n/xenophyre/impl/module/combat/AutoCrystal.java | ce86cc43001f9b8bb0846f3880a14fd9baa1ae82 | [] | no_license | WarriorCrystal/Xenophyre | 14cde149416b3d14aa7bc0fe235db2dfc53c78a6 | 351bcad5e2c52360190b5f02440679354af7793e | refs/heads/master | 2023-04-17T18:12:37.438729 | 2021-04-20T15:40:50 | 2021-04-20T15:40:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 622 | java | package me.krymz0n.xenophyre.impl.module.combat;
import me.krymz0n.xenophyre.impl.module.Category;
import me.krymz0n.xenophyre.impl.module.Module;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.lwjgl.input.Keyboard;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
public class AutoCrystal extends Module {
public AutoCrystal() {
super("Auto Crystal", "Destroys end crystals", Category.COMBAT);
this.setKey(Keyboard.KEY_NONE);
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
7622fe0a47f94ec1f123fe051a31cd3c412e3534 | 185a6640a15ce69b140283975e3dbb2825852616 | /OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/VideoEncodingParameters.java | 35106191706e406388d3c8e9f0c0ed4be20eb528 | [
"MIT"
] | permissive | reSipWebRTC/owt-client | 0756cf3bf85812336bdd69d2a51d029bd7944a02 | 1b73888ae0371879fa3e26943b9d4962d161f4d7 | refs/heads/master | 2022-09-19T00:58:38.083886 | 2020-06-04T15:22:18 | 2020-06-04T15:22:18 | 259,572,141 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | /*
* Copyright (C) 2018 Intel Corporation
* SPDX-License-Identifier: Apache-2.0
*/
package io.agora.openvcall.model;
import static io.agora.openvcall.model.CheckCondition.RCHECK;
/**
* Encoding parameters for sending a video track.
*/
public final class VideoEncodingParameters {
/**
* Maximum bitrate for sending a video track.
* *NOTE* currently setting different bitrates for different video codecs is not supported.
*/
public static int maxBitrate = 0;
/**
* Video codec.
*/
public final VideoCodecParameters codec;
public VideoEncodingParameters(MediaCodecs.VideoCodec codec) {
RCHECK(codec);
this.codec = new VideoCodecParameters(codec);
}
public VideoEncodingParameters(VideoCodecParameters videoCodecParameters) {
RCHECK(videoCodecParameters);
codec = videoCodecParameters;
}
public VideoEncodingParameters(VideoCodecParameters videoCodecParameters, int maxBitrateKbps) {
RCHECK(videoCodecParameters);
RCHECK(maxBitrateKbps > 0);
this.codec = videoCodecParameters;
maxBitrate = maxBitrateKbps;
}
}
| [
"xu.banyao@gmail.com"
] | xu.banyao@gmail.com |
5da9110ee8ed2dace75256d39461524c6eafd66a | 735d9108e4324cac07a361775d578838cd80c5aa | /src/main/java/com/villcore/gis/tiles/server/TileFileManager.java | e96990382e8347b2d784fabfa3cadbc198de1eda | [] | no_license | villcore/SimpleTileServer | 0a22e1ea1b0af7939e896909992d24b1fffd58f5 | 79ab78469af629b73ddb6d68373f9b45339f6f13 | refs/heads/master | 2021-07-14T21:10:32.167912 | 2017-10-19T07:22:23 | 2017-10-19T07:22:23 | 107,278,990 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,667 | java | package com.villcore.gis.tiles.server;
import com.villcore.gis.tiles.FilePosition;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.Path;
import java.nio.file.Paths;
public class TileFileManager {
private static final Logger LOGGER = LoggerFactory.getLogger(TileFileManager.class);
private static final byte[] ZERO_BYTES_ARRAY = new byte[0];
private static final int INDEX_BLOCK_LEN = 4 + 4 + 8 + 4;
private Path curRoot;
private int zLevel;
private Path metaPath;
private Path indexPath;
private Path mapPath;
private int xStart;
private int xEnd;
private int yStart;
private int yEnd;
private ByteBuffer indexByteBuffer;
private ByteBuffer mapByteBuffer;
private boolean indexCache = true;
private boolean mapCache = true;
public TileFileManager(int zLevel, Path curRoot) {
this.zLevel = zLevel;
this.curRoot = curRoot;
this.metaPath = Paths.get(curRoot.toString(), zLevel + ".meta");
this.indexPath = Paths.get(curRoot.toString(), zLevel + ".index");
this.mapPath = Paths.get(curRoot.toString(), zLevel + ".map");
}
public void init() throws IOException {
readMeta();
readIndex();
readMap();
}
public byte[] getTileBytes(int xLevel, int yLevel) throws IOException {
System.out.println(correct(xLevel, yLevel));
if (!correct(xLevel, yLevel)) {
return ZERO_BYTES_ARRAY;
}
FilePosition filePosition = getTilePosition(xLevel - xStart, yLevel - yStart);
return getTileToBytes(filePosition);
}
public ByteBuf getTileByteBuf(int xLevel, int yLevel) throws IOException {
if (!correct(xLevel, yLevel)) {
return Unpooled.wrappedBuffer(ZERO_BYTES_ARRAY);
}
int x = xLevel - xStart;
int y = yLevel - yStart;
FilePosition filePosition = getTilePosition(x, y);
return Unpooled.wrappedBuffer(getTileToBuffer(filePosition));
}
private byte[] getTileToBytes(FilePosition filePosition) {
byte[] bytes = new byte[filePosition.len];
mapByteBuffer.position((int) filePosition.start);
mapByteBuffer.get(bytes);
mapByteBuffer.position(0);
return bytes;
}
private ByteBuffer getTileToBuffer(FilePosition filePosition) {
int start = (int) filePosition.start;
int end = (int) (filePosition.start + filePosition.len);
ByteBuffer byteBuffer = mapByteBuffer.duplicate();
byteBuffer.position(start).limit(end);
return byteBuffer;
}
private FilePosition getTilePosition(int x, int y) throws IOException {
long indexPos = getIndexPosition(x, y, INDEX_BLOCK_LEN);
// byte[] bytes = new byte[INDEX_BLOCK_LEN];
//
// indexByteBuffer.position((int) indexPos);
// indexByteBuffer.get(bytes);
// indexByteBuffer.position(0);
//
// ByteBuffer indexBlockBuffer = ByteBuffer.wrap(bytes);
// LOGGER.debug("start = {}, len = {}", indexByteBuffer.position(), indexByteBuffer.limit());
LOGGER.debug("X = {}, Y = {}", x, y);
return new FilePosition(indexByteBuffer.getLong((int) (indexPos + 4 + 4)), indexByteBuffer.getInt((int) (indexPos + 4 + 4 + 8)));
}
private long getIndexPosition(int xPos, int yPos, int blockLen) {
return (xPos * (yEnd - yStart + 1) + yPos) * blockLen;
}
private boolean correct(int xLevel, int yLevel) {
if (!(xLevel >= xStart && xLevel <= xEnd)) {
return false;
}
if (!(yLevel >= yStart && yLevel <= yEnd)) {
return false;
}
return true;
}
private void readMeta() throws IOException {
RandomAccessFile metaFile = new RandomAccessFile(metaPath.toFile(), "r");
this.xStart = metaFile.readInt();
this.xEnd = metaFile.readInt();
this.yStart = metaFile.readInt();
this.yEnd = metaFile.readInt();
LOGGER.debug("read meta, xStart = {}, xEnd = {}, yStart = {}, yEnd = {}", new Object[]{
xStart, xEnd, yStart, yEnd
});
}
private void readIndex() throws IOException {
RandomAccessFile indexFile = new RandomAccessFile(indexPath.toFile(), "r");
FileChannel indexFileChannel = indexFile.getChannel();
this.indexByteBuffer = indexFileChannel.map(FileChannel.MapMode.READ_ONLY, 0, indexFile.length());
LOGGER.debug("file size = {}, indexBuffer pos = {}, limit = {}", indexFile.length(), indexByteBuffer.position(), indexByteBuffer.limit());
if(indexCache) {
this.indexByteBuffer = cacheByteBuffer(this.indexByteBuffer);
}
}
private void readMap() throws IOException {
RandomAccessFile mapFile = new RandomAccessFile(mapPath.toFile(), "r");
FileChannel indexFileChannel = mapFile.getChannel();
this.mapByteBuffer = indexFileChannel.map(FileChannel.MapMode.READ_ONLY, 0, mapFile.length());
if (mapCache) {
this.mapByteBuffer = cacheByteBuffer(this.mapByteBuffer);
}
}
private ByteBuffer cacheByteBuffer(ByteBuffer src) {
int capcity = src.capacity();
ByteBuffer memByteBuffer = ByteBuffer.allocateDirect(capcity);
memByteBuffer.put(src);
return memByteBuffer;
}
public void close() {
}
}
| [
"villcore@163.com"
] | villcore@163.com |
f798df2fddcaf42c1826b3ae7fac03ab2545c32e | 1bba4131d1758cc820040145d61b41ab1da3dfa7 | /FileShare/src/server/api/APILocalDisk.java | ec4049bd43f051f28b23112d2d2d113acdb11c01 | [] | no_license | donlyconan/Bigbook | 13465bc31fdd8eaa38bf4727ca22c8d7458d15f0 | d617ee34d790c41b57e78d64e7f002894e73d8ca | refs/heads/master | 2023-01-11T11:48:52.862752 | 2020-11-15T18:10:09 | 2020-11-15T18:10:09 | 213,190,262 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,334 | java | package server.api;
import java.io.File;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import server.gui.item.FTPFileItem;
import server.platform.Platform;
public class APILocalDisk extends VBox implements Platform {
private ProgressBar procgress;
private Text header;
private Label disk;
private Text text;
private String file;
public APILocalDisk(File file) {
disk = new Label("Local Disk " + file.getAbsolutePath());
procgress = new ProgressBar((double) file.getUsableSpace() / file.getTotalSpace());
String use = String.format("%.2f", file.getUsableSpace() / Math.pow(1024, 3));
String tol = String.format("%.2f", file.getTotalSpace() / Math.pow(1024, 3));
disk.setStyle(FTPFileItem.STYLE_CSS + "-fx-font-weight: bold;");
Text info = new Text(use + " GB Free space / " + tol + " GB");
info.setStyle(FTPFileItem.STYLE_CSS);
procgress.setPrefSize(220, 30);
getChildren().addAll(disk, procgress, info);
setPadding(new Insets(0, 10, 0, 0));
this.file = file.getAbsolutePath();
header = new Text(file.getAbsolutePath());
header.setStyle(FTPFileItem.STYLE_CSS + "-fx-font-weight: bold;");
}
public Text getHeader() {
return header;
}
public void setHeader(Text header) {
this.header = header;
}
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
public void setOnEvent(EventHandler<MouseEvent> e) {
procgress.setOnMouseClicked(e);
header.setOnMouseClicked(e);
}
public ProgressBar getSource() {
return procgress;
}
public ProgressBar getProcgress() {
return procgress;
}
public void setProcgress(ProgressBar procgress) {
this.procgress = procgress;
}
public Label getDisk() {
return disk;
}
public void setDisk(Label disk) {
this.disk = disk;
}
public Text getText() {
return text;
}
public void setText(Text text) {
this.text = text;
}
public File getCurrentFile() {
return new File(file);
}
public void setCurFile(File curFile) {
this.file = curFile.getAbsolutePath();
}
}
| [
"donly@DESKTOP-FP3RM5E"
] | donly@DESKTOP-FP3RM5E |
5ccc5dcc605d7e14f789fca0a44034163ecb837b | 13bbfbeb57791715058b9ba60cd686c9a2f2415a | /backend/src/main/java/payments/service/impl/MediaServiceImpl.java | 1c40b22d110518244d359a03e5b979f57171b952 | [] | no_license | flashxxx2/coinkeeper | 8e1d9a1e5e03f3673cd28830127ebe0e02a1bd4d | 296feb4341ddd2093d9ce02d33c81058c60a588c | refs/heads/master | 2023-06-23T03:59:28.340358 | 2021-07-23T07:40:43 | 2021-07-23T07:40:43 | 370,146,150 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,992 | java | package payments.service.impl;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import payments.exception.PaymentImagesNotFoundException;
import payments.exception.PaymentNotFoundException;
import payments.mapper.Mapper;
import payments.models.FileModel;
import payments.repository.MediaRepository;
import payments.repository.PaymentRepository;
import payments.service.api.MediaService;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@Service
public class MediaServiceImpl implements MediaService {
public final String uploadDir;
private final PaymentRepository paymentRepository;
private final MediaRepository mediaRepository;
public MediaServiceImpl(@Value("${app.upload.dir:${user.home}}") String uploadDir, PaymentRepository paymentRepository, MediaRepository mediaRepository) {
this.uploadDir = uploadDir;
this.paymentRepository = paymentRepository;
this.mediaRepository = mediaRepository;
}
@Override
@Cacheable(value = "itemCache")
public InputStream getImage(String path) {
try {
return FileUtils.openInputStream
(new File(path));
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
public byte[] uploadImage(Long id) {
var file = getPaymentFile(id);
InputStream content = getImage(file.get(0).getUrl());
try {
return IOUtils.toByteArray(content);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
public List<FileModel> getPaymentFile(Long id) {
var paymentEntity= paymentRepository.findById(id)
.orElseThrow(PaymentNotFoundException::new);
var fileUploadEntity = mediaRepository.findAllByPayment(paymentEntity);
return fileUploadEntity.stream().map(entity -> new FileModel(
entity.getId(),
entity.getName(),
entity.getUrl())).collect(Collectors.toList());
}
@Override
@Cacheable(value = "itemCache")
public List<FileModel> getPaymentImages(Long id) {
final var entity = Optional.ofNullable(paymentRepository.getById(id))
.orElseThrow(PaymentImagesNotFoundException::new);
return mediaRepository.findAllByPayment(entity)
.stream()
.map(Mapper::convertToFileModel)
.collect(Collectors.toList());
}
@Override
@Scheduled(cron = "0 22 * * * *")
public void deleteUnMappedFiles() {
mediaRepository.deleteUnMappedRows();
}
}
| [
"amaximov@i-novus.ru"
] | amaximov@i-novus.ru |
fd3cd77cd0c5c5686d888b3e890939e3491f5fbb | e37b5703af392360cf52003a51287b3550f8d006 | /app/src/main/java/com/app/mijandev/mediary/di/module/DbModule.java | a953d15a1e79febebd73e3e3ee217378e7251c3e | [] | no_license | Mijann/Mediary | 8907358d4fc314e5132232329d4087b6104b35da | ecfb2d070211022c2a4b28708700936513fee14c | refs/heads/master | 2020-12-27T10:14:52.345335 | 2020-02-03T01:42:28 | 2020-02-03T01:42:28 | 237,865,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 908 | java | package com.app.mijandev.mediary.di.module;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.room.Room;
import com.app.mijandev.mediary.data.AppDatabase;
import com.app.mijandev.mediary.data.dao.NoteDao;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
@Module
public class DbModule {
/*
* The method returns the Database object
* */
@Provides
@Singleton
AppDatabase provideDatabase(@NonNull Application application) {
return AppDatabase.getInstance(application.getApplicationContext());
}
/*
* We need the NoteDao module.
* For this, We need the AppDatabase object
* So we will define the providers for this here in this module.
* */
@Provides
@Singleton
NoteDao provideNoteDao(@NonNull AppDatabase appDatabase) {
return appDatabase.noteDao();
}
}
| [
"50623@siswa.unimas.my"
] | 50623@siswa.unimas.my |
85a5c6227835cbf7dfaf085b368ce85755dc7337 | b72ae99674edcb2b267499b7e4ee0e60d7e19477 | /app/src/main/java/com/dl7/shopping/adapter/LoveListAdapter.java | 8e99e34bad458e3d3efeb66d5969d7d20d4ad0d0 | [] | no_license | Superingxz/Shopping | 4bb1333f8ea5fae5f8aa19d9751c6a5b999870cd | b4ff1c34245ef96dd728aeede0042178e9ac92ff | refs/heads/master | 2021-01-01T17:49:22.255556 | 2017-08-07T14:22:46 | 2017-08-07T14:22:46 | 98,165,148 | 1 | 2 | null | 2017-08-03T08:47:29 | 2017-07-24T08:02:20 | Java | UTF-8 | Java | false | false | 2,286 | java | package com.dl7.shopping.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.dl7.shopping.R;
import com.dl7.shopping.bean.LoveListBean;
import java.util.List;
/**
* Created by MC.Zeng on 2017-07-01.
*/
public class LoveListAdapter extends BaseAdapter {
private String[] address={"天河区","天河区","天河区","天河区","天河区","天河区","天河区","天河区","天河区","天河区","天河区","天河区"};
private Context context;
private List<LoveListBean.DataBean.ListBean> mlist;
public LoveListAdapter(List<LoveListBean.DataBean.ListBean> mlist,Context context) {
this.mlist=mlist;
// public LoveListAdapter(String[] address,Context context) {
// this.address=address;
this.context = context;
}
@Override
public int getCount() {
return mlist.size();
}
@Override
public Object getItem(int position) {
return mlist.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder=new ViewHolder();
if (convertView==null) {
convertView = LayoutInflater.from(context).inflate(R.layout.item_item_love_day, parent, false);
holder.info= (TextView) convertView.findViewById(R.id.tv_love_item_info);
holder.loveNum= (TextView) convertView.findViewById(R.id.tv_love_item_love_num);
holder.time= (TextView) convertView.findViewById(R.id.tv_love_item_time);
convertView.setTag(holder);
}else{
holder= (ViewHolder) convertView.getTag();
}
// holder.info.setText(address[position]);
holder.info.setText(mlist.get(position).getNotes());
holder.time.setText(mlist.get(position).getCreate_time());
if (mlist.get(position).getType().equals("INCOME")){
holder.loveNum.setText("+"+mlist.get(position).getSource());
}
return convertView;
}
class ViewHolder{
TextView info,time,loveNum;
}
}
| [
"zhugezhi5802837@sina.com"
] | zhugezhi5802837@sina.com |
462680ad9697747f7b0fa98ce0a884aab44a763d | 1ca565c24994b19e2dea1a5cc4d9d1dae92fb062 | /src/main/java/com/wl/www/dto/OrderNumberCreate.java | e540ff4c1b2cabc88b967e69dc2250857bfe7822 | [] | no_license | wang-ling-1/Test | 5b4f78a55776c22a186981f848f52d22a8675174 | e7c8054bf12b3fd269032d8a6f45703c6d05e3bd | refs/heads/master | 2022-06-22T03:07:26.064303 | 2019-10-21T11:24:35 | 2019-10-21T11:24:35 | 216,506,368 | 0 | 0 | null | 2021-04-22T18:41:51 | 2019-10-21T07:39:52 | JavaScript | UTF-8 | Java | false | false | 1,503 | java | package com.wl.www.dto;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class OrderNumberCreate {
//商户/订单号
private static final long ONE_STEP = 10;
private static final Lock LOCK = new ReentrantLock();
private static long lastTime = System.currentTimeMillis();
private static short lastCount = 0;
private static int count = 0;
@SuppressWarnings("finally")
public static String nextId()
{
LOCK.lock();
try {
if (lastCount == ONE_STEP) {
boolean done = false;
while (!done) {
long now = System.currentTimeMillis();
if (now == lastTime) {
try {
Thread.currentThread();
Thread.sleep(1);
} catch (InterruptedException e) {
}
continue;
} else {
lastTime = now;
lastCount = 0;
done = true;
}
}
}
count = lastCount++;
}
finally
{
LOCK.unlock();
return lastTime+""+String.format("%03d",count);
}
}
public static void main(String[] args)
{
for(int i=0;i<1000;i++)
{
System.out.println(nextId());
}
}
}
| [
"wl13111196339@126.com"
] | wl13111196339@126.com |
c7e2546f5243d48f8de37e27947ce78d9d2e4ef1 | ea51ef3d4f04887133d00110fdc3d4a351359491 | /src/main/java/com/employee/crud/example/entity/Department.java | 6ddbb94f34a65ca84fa2278365590b17f4180227 | [] | no_license | praveenkumar233/spring-boot-crud-example | 00ee8d002dadc3e5b60655bbccdb90cf4b814850 | ebeec976be27505047d63cea19daba7e662752ea | refs/heads/master | 2023-04-16T09:44:52.610588 | 2021-04-27T07:59:18 | 2021-04-27T07:59:18 | 362,035,947 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 533 | java | package com.employee.crud.example.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.OneToMany;
import java.util.List;
@Entity
public class Department {
private Integer Id;
private String name;
@OneToMany(mappedBy = "department")
private List<Employee> employees;
public Department(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"praveenkumareee068@gmail.com"
] | praveenkumareee068@gmail.com |
590a67abfb82008fe9585be389c8a51daa1638d1 | 1ab7640a3e2cee58c056007de0f09d43d7e90314 | /Java/homeworkFiles/IntroToListsHW/edu/franklin/util/ArrayCollectionTest.java | 989fab8c2ffcac7f3b64a29d5da9cb4aea2f2bf2 | [] | no_license | dianacollins323/Franklin-CourseWork | f68c144fc3dc9a38a85cb070f3641139d9b4ef87 | b3974f19d3d19df9706996158cd70fdfaa11ac93 | refs/heads/master | 2021-01-18T14:45:06.282752 | 2014-03-03T21:14:57 | 2014-03-03T21:14:57 | 17,380,345 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,766 | java | package edu.franklin.util;
import edu.franklin.misc.DataGenerator;
/**
* Test cases specific to the concrete class ArrayCollection. Most of the
* test cases for the concrete implementation are inherited from
* AbstractCollectionTest.
*
* @author Todd A. Whittaker
* @version 2005-09
*/
public class ArrayCollectionTest extends AbstractCollectionTest
{
/**
* Default constructor for test class ArrayCollectionTest.
*/
public ArrayCollectionTest()
{
}
/**
* Sets up the test fixture.
*
* Called before every test case method.
*/
protected void setUp()
{
}
/**
* Tears down the test fixture.
*
* Called after every test case method.
*/
protected void tearDown()
{
}
/**
* Creates an ArrayCollection containing data from the specified
* generator.
* @param <E> the type of data to generate
* @param generator the object which will provide the data
* @return an ArrayCollection containing the data
*/
public <E> Collection<E> getCollection(DataGenerator<E> generator)
{
Collection<E> coll = new ArrayCollection<E>();
while (generator.hasNext())
{
coll.add(generator.next());
}
return coll;
}
/**
* Try to create an ArrayCollection with a bad initial capacity.
*/
public void testBadCreating()
{
try
{
Collection<Integer> coll = new ArrayCollection<Integer>(-10);
fail("Should have trown an IllegalArgumentException");
}
catch (IllegalArgumentException e)
{
assertTrue(true);
}
}
}
| [
"dianacollins323@gmail.com"
] | dianacollins323@gmail.com |
810b458e49b28da16b9e9ed85f45ee4ba5c22302 | f405015899c77fc7ffcc1fac262fbf0b6d396842 | /sec2-saml-base/src/test/java/org/sec2/saml/engine/Sec2SignatureProfileValidatorTests.java | 5b1eb3c154c2d655024df9983af2a2b387c59758 | [] | no_license | OniXinO/Sec2 | a10ac99dd3fbd563288b8d21806afd949aea4f76 | d0a4ed1ac97673239a8615a7ddac1d0fc0a1e988 | refs/heads/master | 2022-05-01T18:43:42.532093 | 2016-01-18T19:28:20 | 2016-01-18T19:28:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,694 | java | /*
* Copyright 2012 Ruhr-University Bochum, Chair for Network and Data Security
*
* This source code is part of the "Sec2" project and as this remains property
* of the project partners. Content and concepts have to be treated as
* CONFIDENTIAL. Publication or partly disclosure without explicit
* written permission is prohibited.
* For details on "Sec2" and its contributors visit
*
* http://nds.rub.de/research/projects/sec2/
*/
package org.sec2.saml.engine;
import junit.framework.TestCase;
import org.opensaml.saml2.core.Assertion;
import org.opensaml.saml2.core.Response;
import org.opensaml.xml.io.MarshallingException;
import org.opensaml.xml.validation.ValidationException;
import org.sec2.saml.XMLProcessingTestHelper;
import org.sec2.saml.engine.mockups.MockupSAMLEngine;
import org.sec2.saml.exceptions.SAMLEngineException;
/**
* Tests for the sec2 specific signature profile.
*
* @author Dennis Felsch - dennis.felsch@rub.de
* @version 0.1
*
* December 05, 2012
*/
public class Sec2SignatureProfileValidatorTests extends TestCase {
/**
* Tests that a signature that signs a subtree is invalid.
* Creates a Response with a nested assertion. The assertion is signed, but
* not the Response (which is root). This is valid SAML, but not for sec2.
*/
public void testNonRootSignature() {
Response parsedReponse = null;
try {
SAMLEngine engine = MockupSAMLEngine.getInstance();
Assertion a = SAMLEngine.getXMLObject(Assertion.class);
a.setID("testid"); //necessary, because OpenSAML would use
//<ds:Reference URI=""> without an id. That
//would mean, that the root element is referenced
engine.getSignatureEngine().signXMLObject(a);
Response r = SAMLEngine.getXMLObject(Response.class);
r.getAssertions().add(a);
String xml = XMLHelper.getXMLString(r);
parsedReponse = XMLProcessingTestHelper.
parseXMLElement(xml, Response.class);
} catch (SAMLEngineException e) {
e.log();
fail(e.toString());
} catch (MarshallingException e) {
fail(e.toString());
}
Sec2SignatureProfileValidator validator =
new Sec2SignatureProfileValidator();
try {
validator.validate(parsedReponse.getAssertions().get(0).
getSignature());
fail("Should have failed with a ValidationException");
} catch (ValidationException e) {
assertTrue(e.getLocalizedMessage().contains("root element"));
}
}
}
| [
"developer@developer-VirtualBox"
] | developer@developer-VirtualBox |
01d225dc7191ea4f07757e999149c6ae752b48eb | 8ed0125275b9b453553d5e92238fd91a666629ec | /Note/star5.java | eba8256b2324fd0ab924872668a9dadf204e1457 | [] | no_license | sitaramaraju123/Core | 3ae8d0a04284587c71d8d84ca78f9463327f244e | 59b48cdcb1d2bc8176a664723ae77f1030e8274a | refs/heads/master | 2023-03-21T23:05:41.398893 | 2021-03-16T05:18:20 | 2021-03-16T05:18:20 | 341,440,459 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 249 | java | public class Star5{
public static void main(String[] args){
for(int i=1;i<5;i++){
if(i==1){
System.out.println("0");
}
for(int j=0;j<=i;j++){
if(i!=j){
System.out.print("0");
}else{
System.out.print("1");
}
}
System.out.println(" ");
}
}
} | [
"sitaramaraju123463@gmail.com"
] | sitaramaraju123463@gmail.com |
f9a66f1ea9b8ce6f231b07dac51255c41b242575 | f358544f24543e7fe1379e91b48220f7b08af1e2 | /app/src/main/java/com/coolweather/android/db/County.java | 34fac42569b2b8b244c976288340dc410e9b8260 | [
"Apache-2.0"
] | permissive | hcy520/coolweather | 92402cd496dac1b7a613070fa118c67eacf7359a | 083804ba6b298c09f3ab2bca3e9fa03cc97d6a04 | refs/heads/master | 2021-08-06T10:25:32.616539 | 2017-11-05T03:28:17 | 2017-11-05T03:28:17 | 109,490,245 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 818 | java | package com.coolweather.android.db;
import org.litepal.crud.DataSupport;
/**
* Created by dell3020mt-58 on 2017/11/5.
*/
public class County extends DataSupport {
private int id;
private String countName;
private String weatherId;
private int cityId;
public int getId(){
return id;
}
public void setId(int id){
this.id=id;
}
public String getCountName(){
return countName;
}
public void setCountName(String countName){
this.countName=countName;
}
public String getWeatherId(){
return weatherId;
}
public void setWeatherId(String weatherId){
this.weatherId=weatherId;
}
public int getCityId(){
return cityId;
}
public void setCityId(int cityId){
this.cityId=cityId;
}
}
| [
"The flying pig@gmail.com"
] | The flying pig@gmail.com |
e11d29218ed6b077dcb4dca98ebd2b4e6573cf75 | e41de6df364fdecc006e0d8736e856153fa52d5c | /Application_Engineering_Development/Aed_Assignments/Assignment 3/Problem_2/src/Business/VitalSignHistory.java | 8ede4acab1720bd6c74535869d27d133cca63cd6 | [] | no_license | rajputne/Neerajsing_Repository | 6dc8e1b69b0e248b898f314368ec441154eda412 | 1e71c7ba7aa1d704b5b37d1bdb7a342f6a4eb947 | refs/heads/master | 2021-01-21T13:57:21.328105 | 2016-05-16T15:49:55 | 2016-05-16T15:49:55 | 59,698,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 858 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Business;
import java.util.ArrayList;
/**
*
* @author Neerajsing Rajput
*/
public class VitalSignHistory {
private ArrayList<VitalSign> vitalSignList;
public VitalSignHistory() {
this.vitalSignList = new ArrayList<>();
}
public ArrayList<VitalSign> getVitalSignList() {
return vitalSignList;
}
public VitalSign addVitalSign() {
VitalSign vs = new VitalSign();
vitalSignList.add(vs);
return vs;
}
public void deleteVitalSing(VitalSign vitalSign) {
vitalSignList.remove(vitalSign);
}
@Override
public String toString() {
return "VitalSignHistory";
}
}
| [
"Neerajsing Rajput"
] | Neerajsing Rajput |
7c6dd1fc062833863163ef96d50ae31fa4da6183 | 5ac5aac2a39416fbc56f8de38112c26a11cb5223 | /Maxim.java | ac8a08d7ede7edd30c29b4439370f7785e2650a2 | [] | no_license | DragoescuGeorgiana/Java | fb9ab2084f0c14225cb52215c906731e4b1af17c | 41231b830fd53a65800b40da270b08a064b5c96d | refs/heads/master | 2020-06-13T06:43:56.279460 | 2017-03-16T15:28:07 | 2017-03-16T15:28:07 | 75,419,802 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package if_else;
// Sa se calculeze maximul a doua numere
public class Maxim {
public static void main(String[] args) {
int a, b, m;
a = 12;
b = 5;
if (a > b)
m = a;
else
m = b;
System.out.println("Maximul dintre" + " " + a + " " + "si" + " " + b + " "+ "este:" + " " + m);
}
}
| [
"noreply@github.com"
] | DragoescuGeorgiana.noreply@github.com |
22598b6a697f3609db924aa54603738ccb9c7289 | fa93c9be2923e697fb8a2066f8fb65c7718cdec7 | /sources/io/reactivex/observers/DisposableSingleObserver.java | a9e466e1be77841837879ce002a33dfa32c5d750 | [] | no_license | Auch-Auch/avito_source | b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b | 76fdcc5b7e036c57ecc193e790b0582481768cdc | refs/heads/master | 2023-05-06T01:32:43.014668 | 2021-05-25T10:19:22 | 2021-05-25T10:19:22 | 370,650,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,042 | java | package io.reactivex.observers;
import io.reactivex.SingleObserver;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.internal.disposables.DisposableHelper;
import io.reactivex.internal.util.EndConsumerHelper;
import java.util.concurrent.atomic.AtomicReference;
public abstract class DisposableSingleObserver<T> implements SingleObserver<T>, Disposable {
public final AtomicReference<Disposable> a = new AtomicReference<>();
@Override // io.reactivex.disposables.Disposable
public final void dispose() {
DisposableHelper.dispose(this.a);
}
@Override // io.reactivex.disposables.Disposable
public final boolean isDisposed() {
return this.a.get() == DisposableHelper.DISPOSED;
}
public void onStart() {
}
@Override // io.reactivex.SingleObserver
public final void onSubscribe(@NonNull Disposable disposable) {
if (EndConsumerHelper.setOnce(this.a, disposable, getClass())) {
onStart();
}
}
}
| [
"auchhunter@gmail.com"
] | auchhunter@gmail.com |
6d87fdb3c289ed557d407eceaa1285b9ac84e986 | 52550f98197d2f97186f21ad1c6b7e75de001747 | /src/main/java/za/ac/cputweekassignment/MainDriver.java | 046dbe6764734c321c1c744caf92ce7a743383ba | [] | no_license | KingCodeST/demo8 | cff11a3bb340b7bbf99496335bb3c3504885dac8 | efc8fd59719ca959df65cd9737517d7802dc14df | refs/heads/master | 2020-05-15T14:16:00.876100 | 2019-04-19T21:56:06 | 2019-04-19T21:56:06 | 182,330,143 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package za.ac.cputweekassignment;
public class MainDriver {
public static void main(String[] args){
Facade facade =new Facade();
int x =3;
System.out.println("Cube of"+x+":"+facade.cubeX(3));
System.out.println("Cube of"+x+"times 2:"+facade.cubeXTimes2(3));
System.out.println(x+"to sixth power times 2:"+facade.xToSixthPowerTimes2(3));
}
}
| [
"Tya@2017"
] | Tya@2017 |
01533eb748efacad1ad601a540271b1bd50de89d | d30cb4ae7c22cb637617b8f660959f2a5abd64b2 | /basic number theory/Pascal.java | 219ab671fea64d81c04566a4bc2bf2f199e0642a | [] | no_license | zion830/algorithm-study | a40cdc648f282b5c34edc28a065bfe2b08ebff72 | 81ef516fad1ed933842c666603fbcfad5f96e193 | refs/heads/master | 2021-07-08T04:14:03.530389 | 2020-07-22T16:37:46 | 2020-07-22T16:37:46 | 153,259,952 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 769 | java | import java.util.Scanner;
public class Pascal {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int m = scanner.nextInt();
int[][] twoArr = new int[10][];
for (int i = 0; i < twoArr.length; i++) {
twoArr[i] = new int[i + 1];
}
for (int i = 0; i < twoArr.length; i++) {
for (int j = 0; j < i; j++) {
twoArr[i][j] = 1;
if (i > 1 && j >= 1 && j < i - 1) {
twoArr[i][j] = twoArr[i - 1][j - 1] + twoArr[i - 1][j];
}
System.out.print(twoArr[i][j]);
}
System.out.print("\n");
}
}
}
| [
"noreply@github.com"
] | zion830.noreply@github.com |
2acbda0474a876e48a86d760968ff956eddec3f6 | af21e93a5c904708963a31582ff0a5412bbe4098 | /201802 3UI/Summative/Rowan's stuff to show people so he doesn't have to leave it open on his computer all class/SS6/src/E62b.java | b0f93dda6a4d2f10cc7fc2fd4c883b6a60f1408a | [] | no_license | Mrgfhci/201802-projects | 56deaa95c56befebcba2542d12013d23ebf2e491 | 7712a9136277f92db3ffa3836cf0b6c2fea3bbd0 | refs/heads/master | 2020-03-21T05:35:44.103163 | 2018-06-21T12:37:34 | 2018-06-21T12:37:34 | 138,168,018 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 477 | java |
//import java.util.*;
//import java.text.NumberFormat;
public class E62b {
public static void main(String[] args) {
int arnFreq[] = new int[31], nRand;
System.out.println ("Thinking...");
for (int i = 0; i < 2000; i++) {
nRand = (int) (Math.random() * 21) + 10;
arnFreq[nRand] ++;
}
for (int i = 10; i < arnFreq.length; i++){
System.out.println (i + "'s :" + arnFreq[i]);
}
}
}
| [
"scott_grondin@wrdsb.on.ca"
] | scott_grondin@wrdsb.on.ca |
7c5817c0ed947dcb33ef348b46725a94501a0eea | 2951532236d8d59fb94999aa830b6976534b0dcc | /src/main/weka/reconcile/weka/classifiers/xml/XMLClassifier.java | a3f765441ba71e61a7d6f6431ce20d3dfba75042 | [] | no_license | davidbuttler/reconcile | 6e48eb7d8a326095653c1b39e5dd9d9933f39cf3 | e69f75755e06dd655a832ec0f1d7e193c336bdc6 | refs/heads/master | 2016-09-05T22:33:44.482458 | 2010-12-08T00:11:01 | 2010-12-08T00:11:01 | 1,148,076 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,746 | java | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* XMLClassifier.java
* Copyright (C) 2004 University of Waikato, Hamilton, New Zealand
*/
package reconcile.weka.classifiers.xml;
import reconcile.weka.core.xml.XMLBasicSerialization;
/**
* This class serializes and deserializes a Classifier instance to and
* fro XML.<br>
*
* @author FracPete (fracpete at waikato dot ac dot nz)
* @version $Revision: 1.1 $
*/
public class XMLClassifier extends XMLBasicSerialization {
/**
* initializes the serialization
*
* @throws Exception if initialization fails
*/
public XMLClassifier() throws Exception {
super();
}
/**
* generates internally a new XML document and clears also the IgnoreList and
* the mappings for the Read/Write-Methods
*/
public void clear() throws Exception {
super.clear();
// allow
m_Properties.addAllowed(reconcile.weka.classifiers.Classifier.class, "debug");
m_Properties.addAllowed(reconcile.weka.classifiers.Classifier.class, "options");
}
}
| [
"buttler1@tux256.llnl.gov"
] | buttler1@tux256.llnl.gov |
94ced8d1cf3d55814fa5ce6904ffd9733bb6ea28 | 575a0aa12ab5328765e52116afb61e3ecc0257bd | /FeedTestApp/app/src/main/java/com/feed/plugin/adapter/items/ThumbnailItem.java | 561cd1a0d79e435c2e245de435f7e6e0ddcca272 | [] | no_license | feel2503/ImageFeedUnity | 6ce326c4c2aed87e27e1465201fbbe291071eae1 | 00de87f0b2f3705edec16ed3b5385b315b841d5a | refs/heads/master | 2020-04-17T21:14:12.892508 | 2019-08-09T12:26:52 | 2019-08-09T12:26:52 | 166,940,584 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 572 | java | package com.feed.plugin.adapter.items;
import android.graphics.Bitmap;
import com.feed.plugin.android.gpuimage.GPUImageView;
import com.feed.plugin.android.gpuimage.filter.GPUImageFilter;
import com.feed.plugin.util.FilterUtils;
public class ThumbnailItem{
public String filterName;
public Bitmap image;
public GPUImageFilter filter;
public FilterUtils.FilterType filteType;
public boolean isSelected = false;
public boolean isSetted = false;
public ThumbnailItem() {
image = null;
filter = new GPUImageFilter();
}
}
| [
"phill.kim@pointmobile.co.kr"
] | phill.kim@pointmobile.co.kr |
532922f14d1414590c4ed2a136f930fe040592c1 | 0a77e37c8fd2f11b7460e581e53b2949c781d7fa | /src/java_api_testing/java_text_api/MyResourceBundle_ru.java | a0bb0e5e5c478b7e9260576c8ffa2cc290ecdade | [] | no_license | vuquangtin/JavaExamples | b7cee34916b4627662299f05a63f6bddca37911c | 843ab3ed3a213a7309f6ff6ff200316f5212dbdf | refs/heads/master | 2020-06-11T18:13:18.041256 | 2017-07-10T12:49:53 | 2017-07-10T12:49:53 | null | 0 | 0 | null | null | null | null | WINDOWS-1251 | Java | false | false | 539 | java | package java_api_testing.java_text_api;
import java.util.ListResourceBundle;
/**
* Русская локализация ресурса MyResourceBundle (см. класс MyResourceBundle)
* @author Alex
*
*/
public class MyResourceBundle_ru extends ListResourceBundle {
private final static String [][] MY_BUNDLE_CONTENT_RU = {
{"HelloMessage", "Привет на Русском!"},
{"ByeMessage", "Пока по Русски..."}
};
@Override
protected Object[][] getContents() {
return MY_BUNDLE_CONTENT_RU;
}
}
| [
"amvrosovalex@gmail.com"
] | amvrosovalex@gmail.com |
925ad689cd6a3ce8821f0446d6ac798f12993ef0 | 9d4f4d7bf74870db0579378f9b399dca5ec156a3 | /Fungsi/src/fungsi/LatihanFungsiV1.java | 932db9df51e7a0e8be8caf4fb5881fc46fa24db9 | [] | no_license | Adityacprtm/NetBeansProjects | 910420020f8c087c1f97b48970a18896e82f25d6 | f82d39ab2f3531c3a2ec615452e0a51703e3aa2e | refs/heads/master | 2020-03-20T19:21:45.666764 | 2019-01-05T09:30:10 | 2019-01-05T09:30:10 | 137,634,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,421 | java | package fungsi;
import java.util.Scanner;
public class LatihanFungsiV1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Nama = ");
String nama = in.nextLine();
System.out.print("NIM = ");
String nim = in.next();
System.out.println();
System.out.println(mk(2));
System.out.println(mk(3));
System.out.println(mk(4));
}
static int mk(int n) {
Scanner in = new Scanner(System.in);
System.out.print("Matkul = ");
String matkul = in.nextLine();
System.out.print("Jumlah SKS = ");
int sks = in.nextInt();
System.out.print("nilai = ");
int nilai = in.nextInt();
if (nilai > 80 && nilai <= 100) {
nilai = 4;
System.out.println("Bobot A");
} else if (nilai > 70 && nilai <= 80) {
nilai = 3;
System.out.println("Bobot B");
} else if (nilai > 60 && nilai <= 70) {
nilai = 2;
System.out.println("Bobot C");
} else if (nilai > 50 && nilai <= 60) {
nilai = 1;
System.out.println("Bobot D");
} else if (nilai >= 0 && nilai <= 50) {
nilai = 0;
System.out.println("Bobot E");
}
int a = nilai;
int b = sks;
System.out.println();
return n;
}
}
| [
"pratamaditya7@gmail.com"
] | pratamaditya7@gmail.com |
ee47ae508ad90e11618aec81e56d893da9f79d80 | 8872775d1e18ee0779bcd8540631643c71af03a6 | /src/main/java/com/citibank/common/DataSourceFactory.java | 92a7e2a2a7ede1d075ea14f5d0b737c372c5e352 | [] | no_license | liwangadd/CitiBankBg | 4ccf612bab4d4e5b24772e029f98e4778570f241 | 187771afd8a8ed0955f3b5a418edd71da9593f66 | refs/heads/master | 2021-07-18T13:12:45.396159 | 2017-10-26T11:05:23 | 2017-10-26T11:05:23 | 108,400,028 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,967 | java | package com.citibank.common;
import com.citibank.exception.BaseRuntimeException;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
public class DataSourceFactory {
private static Object dataSourceFactory = null ;
private static String DB_TYPE = "db.dataSource.type";
private static String DB_DATABASECLASSNAME="db.dataBaseClassName";
// private static String DB_KEY="db.dataSource.key";
private static String ROOT_KEY="ess.comm_root_key";
// private static String DB_DECIPHERFIELD="db.dataSource.decipherField";
private static String DB_CLASS_ISSINGLETON = "isSingleton";
private static String DB_CLASS_GETINSTANCE = "getInstance";
//可以加载不同的数据源
//dbcp/c3p0/jndi ...
//统一加载
//加密连接字符串
// <bean id="dataSource" class="DataSourceFactory" factory-method="getInstance" />
private DataSourceFactory() {
}
public static Object getInstance(String basenames)
{
System.out.println("加载文件:"+basenames);
if (dataSourceFactory !=null) {
return dataSourceFactory;
}
try {
Properties properties = getProPerties(basenames);
//加密密钥
// String encryptionKey = properties.getProperty(DB_KEY);
String rootKey = properties.getProperty(ROOT_KEY);
PropertyPlaceholderHelper prHelper = new PropertyPlaceholderHelper(properties,rootKey);
properties = prHelper.resolveProperties();
//加载的数据源类
String className = properties.getProperty(DB_DATABASECLASSNAME);
//数据源类型
String type = properties.getProperty(DB_TYPE);
//需要解密的字段
// String[] decipherfield = properties.getProperty(DB_DECIPHERFIELD).split(",");
Class<?> c = Class.forName(className);
Object dataSource = c.newInstance();
// System.out.println("b:"+dataSource);
// Method[] ms=c.getDeclaredMethods();
Method[] ms=c.getMethods();
//判断是否是单例方法
boolean isObj =false;
for(Method m:ms){
if (m.getName().equals(DB_CLASS_ISSINGLETON)) {
Class<?>[] value_type = m.getParameterTypes();
Method m1 = c.getMethod(m.getName(),value_type);
isObj= (Boolean) m1.invoke(dataSource);
System.out.println("isSingleton: "+isObj);
if (isObj == true) {
for(Method m_c:ms){
if (m_c.getName().equals(DB_CLASS_GETINSTANCE) && properties.containsKey(type+"."+DB_CLASS_GETINSTANCE)) {
Class<?>[] value_type_c = m_c.getParameterTypes();
Method m1_c = c.getMethod(m_c.getName(),value_type_c);
dataSourceFactory = m1_c.invoke(dataSource,changeValueType(value_type_c, properties.get(type+"."+DB_CLASS_GETINSTANCE).toString()));
// System.out.println("e:"+dataSourceFactory);
return dataSourceFactory;
}
}
throw new IllegalArgumentException("Return the singleton object error!");
}else {
throw new IllegalArgumentException("Return the singleton object error!");
}
}
}
Map<String, String> propertesMap = new HashMap<String, String>();
for(Object key : properties.keySet()){
String k = (String) key;
if (k.substring(0, type.length()).equals(type)) {
String value = properties.getProperty(k);
// for (int i = 0; i < decipherfield.length; i++) {
// if (k.equals(decipherfield[i])) {
// value = decoder(encryptionKey, value);
// break;
// }
// }
k = k.substring(type.length()+1);
k = k.substring(0, 1).toUpperCase()+k.substring(1);
propertesMap.put("set"+k, value);
}
}
//循环自身的方法
// System.out.println(ms.length);
for(Method m:ms){
// System.out.println(m.getName());
if (propertesMap.containsKey(m.getName())) {
Class<?>[] value_type = m.getParameterTypes();
// Method m1 = c.getDeclaredMethod(m.getName(),value_type);
Method m1 = c.getMethod(m.getName(),value_type);
System.out.println(m.getName()+"-->"+propertesMap.get(m.getName()));
m1.invoke(dataSource, changeValueType(value_type, propertesMap.get(m.getName())));
propertesMap.remove(m.getName());
}
}
//判断propertesMap里面还有没有需要设置的方法,如果有则在其父类中查找
// System.out.println(propertesMap.size());
if (propertesMap.size()>0) {
for (Method m:c.getMethods()) {
if (propertesMap.containsKey(m.getName())) {
Class<?>[] value_type = m.getParameterTypes();
Method m1 = getMethod(c,m.getName(),value_type);
if (m1 == null) {
throw new NoSuchMethodException(m.getName()+" is not found");
}
// System.out.println(m.getName()+"-->"+propertesMap.get(m.getName()));
m1.invoke(dataSource, changeValueType(value_type, propertesMap.get(m.getName())));
propertesMap.remove(m.getName());
}
}
}
// System.out.println("e:"+dataSource);
dataSourceFactory = dataSource;
return dataSource;
} catch (Exception e) {
e.printStackTrace();
throw new BaseRuntimeException(e);
}
}
/**
* 反射获得方法,若本类不存在该方法则递归调用父类查找,若方法始终不存在返回空
* @author lzxz
* @param clazz 类对象
* @param methodName 方法名
* @param parameterTypes 方法参数列表
* @return 此方法获得Method对象总是可用的
*/
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
Method method = null;
try {
if(clazz == null) return null;
method = clazz.getDeclaredMethod(methodName, parameterTypes);
method.setAccessible(true);
return method;
} catch (NoSuchMethodException e) {
return getMethod(clazz.getSuperclass(), methodName, parameterTypes);
} catch (Exception e)
{
e.printStackTrace();
}
return null;
}
// private static String decoder(String encryptionKey,String value) throws Exception{
// //加密数据解密
// return DBUtil.decoder(value);
// }
public static Object[] changeValueType(Class<?>[] c,String... value) throws NumberFormatException, InstantiationException, IllegalAccessException
{
Object[] obj = new Object[value.length];
if (c.length != value.length) {
throw new IllegalArgumentException("Method error parameters");
}
for (int i = 0; i < c.length; i++) {
if (c[i].equals(boolean.class)) {
obj[i]=Boolean.valueOf(value[i].trim());
}else if(c[i].equals(int.class)){
obj[i]=Integer.parseInt(value[i].trim());
}else if(c[i].equals(String.class)){
obj[i]=value[i].trim();
}else if(c[i].equals(long.class)){
obj[i]=Long.valueOf(value[i].trim());
}
}
return obj;
}
private static Properties getProPerties(String basenames) throws IOException
{
Properties props = PropertiesUtil.load(basenames);
return props;
}
}
| [
"liwangadd@gmail.com"
] | liwangadd@gmail.com |
32bd061305ffccc503444547e9a585cde812f7c1 | e72a46f1e8507bde694cb7c3cd8e656ef0c0e73c | /seata/sc-seata-mstest3/src/main/java/com/sc/seata/mstest3/ScSeata3TestApplication.java | 82923cb71cfbbaa0e3dd4b387e95e57db5283c49 | [] | no_license | zhangdberic/springcloud-old | 13e3b1958b88bcbfeee801c813d442ae39893842 | 678407deeaf9af122c8544b4299f3d2754efe6e9 | refs/heads/master | 2023-04-04T22:29:33.169833 | 2020-04-02T06:50:33 | 2020-04-02T06:50:33 | 221,382,550 | 0 | 0 | null | 2021-03-31T21:38:32 | 2019-11-13T05:49:35 | Java | UTF-8 | Java | false | false | 528 | java | package com.sc.seata.mstest3;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@SpringBootApplication
@EnableFeignClients
@EnableJpaRepositories
public class ScSeata3TestApplication {
public static void main(String[] args) {
SpringApplication.run(ScSeata3TestApplication.class, args);
}
}
| [
"Administrator@heige-PC"
] | Administrator@heige-PC |
bc86a51c1efc282e769611ac5a1076a35936f695 | 58ce82c620898459045c21b3f3e6abb985d85e60 | /JMessaging/src/FileTypeFilter.java | c9f77bd54be1ce5b57f05a09e652a0b8714f7e96 | [] | no_license | dgyoung/JMessaging | 6eb3f141ca874ffcf17264ea3342688c6c2ff96e | 5e1849849ac10905b5c1e03909d51e413b1cba9d | refs/heads/master | 2021-01-20T20:32:28.145482 | 2016-06-27T17:58:16 | 2016-06-27T17:58:16 | 62,076,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,833 | java | /*
|| Program name: FileTypeFilter.java
|| Created by: Michael McLaughlin | Copyright 2002
|| Creation date: 04/07/02
|| History:
|| ----------------------------------------------------------------------
|| Date Author Purpose
|| -------- ---------------------- ---------------------------------
|| dd/mm/yy {Name} {Brief statement of change.}
|| ----------------------------------------------------------------------
|| Execution method: Methods used as custom FileFilter for File IO.
|| Program purpose: Designed as a custom FileFilter class.
*/
// Class imports.
import java.io.*; // Required for Java streams.
import javax.swing.*; // Required for Swing widgets.
import javax.swing.filechooser.*; // Required for FileFilter.
// ------------------------------ Begin Class --------------------------------/
// Class definition.
class FileTypeFilter extends javax.swing.filechooser.FileFilter
{
// -------------------------- Class Variables ------------------------------/
// Define String(s) and String array(s).
private String label;
private String[] types;
// ------------------------- Begin Constructor -----------------------------/
/*
|| The constructors of the class are:
|| =========================================================================
|| Access Constructor Type Constructor
|| --------- ---------------- -------------------------------------------
|| public Default FileTypeFilter(String label,String[] types)
*/
// -------------------------------------------------------------------------/
// Default constructor.
public FileTypeFilter(String label,String[] types)
{
// Assign label to class label variable.
this.label = label;
// Define a new array.
this.types = (String[]) types.clone();
// Set the types.
setTypes();
} // End of default constructor.
// --------------------------- Begin Methods -------------------------------/
/*
|| The static methods define the library:
|| =========================================================================
|| Return Type Method Name Access Parameter List
|| ----------- ----------------------------- --------- -----------------
|| boolean accept() public File file
|| String getDescription() public
|| String getTypes() private
|| void setTypes() private
*/
// -------------------------------------------------------------------------/
// Implement FileFilter accept() method.
public boolean accept(File file)
{
// Define and initialize return value.
boolean retValue = false;
// Define local object(s).
String name = file.getName();
// If file is a directory.
if (file.isDirectory())
{
// Return value.
retValue = true;
} // End of if file is a directory.
else
{
// Evaluate types.
for (int i = 0;i < types.length;i++)
{
// If file has correct type.
if (name.endsWith(types[i])) { retValue = true; }
} // End of for-loop through file types.
} // End of else file is not a directory.
// Return false if File is not valid or not a Directory.
return retValue;
} // End of accept() method.
// -------------------------------------------------------------------------/
// Define getTypes() method.
private String getTypes()
{
// Define return type and initialize with beginning character.
String s = new String("(");
// Iterate through the types and append them to a String.
for (int i = 0;i < types.length;i++)
{
// Evaluate if last item in array.
if (i == (types.length - 1))
{
// Assign last item with a closing pararenthsis.
s += "*" + types[i] + ")";
} // End if last item in array.
else
{
// Assign item and delimiting comma.
s += "*" + types[i] + ",";
} // End of if last item or not.
} // End of for-loop to evaluate all type values.
// Return file types.
return s;
} // End of getTypes() method.
// -------------------------------------------------------------------------/
// Implement FileFilter getDescription() method.
public String getDescription()
{
// Return file types.
return (label + " " + getTypes());
} // End of getDescription() method.
// -------------------------------------------------------------------------/
// Define setTypes() method.
public void setTypes()
{
// Iterate through array and append a period where missing.
for (int i = 0;i < types.length;i++)
{
// If type does not start with a period.
if (!types[i].startsWith("."))
{
// Prepend a period and assign the type.
types[i] = "." + types[i];
} // End of if type does not start with a period.
} // End of loop through submitted types.
} // End of setTypes() method.
// ---------------------------- End Methods --------------------------------/
// ------------------------- Begin Inner Class -----------------------------/
// -------------------------- End Inner Class ------------------------------/
// ------------------------- Begin Static Main -----------------------------/
// -------------------------- End Static Main ------------------------------/
} // End of FileTypeFilter class.
// ------------------------------- End Class ---------------------------------/ | [
"davey.1@live.com"
] | davey.1@live.com |
64db088df5cbf127a9244a95aa6f6ee512fdafdc | f0410068f934b3f80bc20ebbf2fab7d044e2fe90 | /src/ru/silversxd/javaTasks/task31/CreditCardPay.java | 16abd47974c407941dfc302d1c260bd1bfd9537f | [] | no_license | SilversxD/JavaTasks | 04cdf9a4d3766e864e5ffa470cbe77be7f19cea6 | 4baff7058258cfc15919a96c1ef01112f3213931 | refs/heads/master | 2023-02-02T01:20:15.124651 | 2020-12-09T14:52:58 | 2020-12-09T14:52:58 | 294,778,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | package ru.silversxd.javaTasks.task31;
public class CreditCardPay implements PayStrategy {
@Override
public void pay(int sum) {
System.out.println("Оплата через кредитную карту на сумму: " + sum);
}
} | [
"silverscjserge@gmail.com"
] | silverscjserge@gmail.com |
45b864da1208a98ce4a7327d2af8ba25a40da0cd | f290c9e73273f2e21a36eea44954da624df125e8 | /Dailoo/src/com/dailoo/domain/ViewpointSimple.java | 9be3c41e195dba79dcc3e9b62535da72e37d4468 | [] | no_license | waiting0324/DailooServer | 9ac4316ca82f1cd7f3b6a9fc270df23b81239287 | 268ec3c95e70ff5ab664d0e27a941b1666159bb5 | refs/heads/master | 2021-10-08T03:18:37.143770 | 2018-12-07T07:13:11 | 2018-12-07T07:13:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,545 | java | package com.dailoo.domain;
import java.sql.Timestamp;
public class ViewpointSimple {
private String id;
private String name;
private String subtitle;
private String theme;
private String behalfPhotoUrl;
private String shortUrl;
private String speakerName;
private String speakerPhotoUrl;
private int audioLength;
private int isPublish;
private int isPriority;
private int isPay;
private Double distance;
private Timestamp updateTime; //上傳時間
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSubtitle() {
return subtitle;
}
public void setSubtitle(String subtilte) {
this.subtitle = subtilte;
}
public String getBehalfPhotoUrl() {
return behalfPhotoUrl;
}
public void setBehalfPhotoUrl(String behalfPhotoUrl) {
this.behalfPhotoUrl = behalfPhotoUrl;
}
public String getSpeakerName() {
return speakerName;
}
public void setSpeakerName(String speakerName) {
this.speakerName = speakerName;
}
public String getSpeakerPhotoUrl() {
return speakerPhotoUrl;
}
public void setSpeakerPhotoUrl(String speakerPhotoUrl) {
this.speakerPhotoUrl = speakerPhotoUrl;
}
public String getShortUrl() {
return shortUrl;
}
public void setShortUrl(String shortUrl) {
this.shortUrl = shortUrl;
}
public int getAudioLength() {
return audioLength;
}
public void setAudioLength(int audioLength) {
this.audioLength = audioLength;
}
public String getTheme() {
return theme;
}
public void setTheme(String theme) {
this.theme = theme;
}
public int getIsPublish() {
return isPublish;
}
public void setIsPublish(int isPublish) {
this.isPublish = isPublish;
}
public int getIsPriority() {
return isPriority;
}
public void setIsPriority(int isPriority) {
this.isPriority = isPriority;
}
public int getIsPay() {
return isPay;
}
public void setIsPay(int isPay) {
this.isPay = isPay;
}
public Double getDistance() {
return distance;
}
public void setDistance(Double distance) {
this.distance = distance;
}
public Timestamp getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Timestamp updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
return "ViewpointSimple [id=" + id + ", name=" + name + ", subtilte="
+ subtitle + ", behalfPhotoUrl=" + behalfPhotoUrl
+ ", speakerName=" + speakerName + ", audioLength="
+ audioLength + "]";
}
}
| [
"tony60107@yahoo.com.tw"
] | tony60107@yahoo.com.tw |
54eee9671a098100115590174dd9a77a8e2c7a54 | 3c73a700a7d89b1028f6b5f907d4d0bbe640bf9a | /android/src/main/kotlin/lib/org/bouncycastle/math/ec/ScaleXPointMap.java | e94c8a9f83d92cd27a6bd39a5cf64acccb633c56 | [] | no_license | afterlogic/flutter_crypto_stream | 45efd60802261faa28ab6d10c2390a84231cf941 | 9d5684d5a7e63d3a4b2168395d454474b3ca4683 | refs/heads/master | 2022-11-02T02:56:45.066787 | 2021-03-25T17:45:58 | 2021-03-25T17:45:58 | 252,140,910 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 303 | java | package lib.org.bouncycastle.math.ec;
public class ScaleXPointMap implements ECPointMap
{
protected final ECFieldElement scale;
public ScaleXPointMap(ECFieldElement scale)
{
this.scale = scale;
}
public ECPoint map(ECPoint p)
{
return p.scaleX(scale);
}
}
| [
"princesakenny98@gmail.com"
] | princesakenny98@gmail.com |
51360095c398149ac65db7d1e15cc6a2a0279101 | 46772468cf1e9116a334b1cf95f38c8b6f24bfb0 | /src/by/it/plugatar/calc/Scalar.java | 6aa13d106bffda65f2f7501136265b3ab0491015 | [] | no_license | ilyashpakovski/JD2019-12-03 | 3f8b0d0d73103bc1a925fd18dcae4850149da45e | 80efcd87697ec00370305eacb5ee6f0f37dd14a0 | refs/heads/master | 2020-11-25T07:30:37.036435 | 2020-03-04T18:22:06 | 2020-03-04T18:22:06 | 228,557,550 | 1 | 2 | null | 2019-12-17T07:23:07 | 2019-12-17T07:23:06 | null | UTF-8 | Java | false | false | 2,496 | java | package by.it.plugatar.calc;
class Scalar extends Var {
private double value;
public double getValue() {
return value;
}
Scalar(double value) {
this.value = value;
}
@Override
public Var add(Var other) throws CalcException{
if (other instanceof Scalar){
double sum=this.value+((Scalar) other).value;
return new Scalar(sum);
//Scalar op2 = (Scalar) other;
//return new Scalar(value.this.value+op2.value);
}
else
return other.add(this);
}
@Override
public Var sub(Var other) throws CalcException{
if (other instanceof Scalar){
double sub=this.value-((Scalar) other).value;
return new Scalar(sub);
}
else
// return other.add(this);
return new Scalar(-1).mul(other).add(this);
}
@Override
public Var mul(Var other) throws CalcException{
if (other instanceof Scalar){
double mul=this.value*((Scalar) other).value;
return new Scalar(mul);
//Scalar op2 = (Scalar) other;
//return new Scalar(value.this.value+op2.value);
}
else
return other.mul(this);
}
@Override
public Var div(Var other) throws CalcException{
if (other instanceof Scalar){
if (((Scalar) other).value==0)
throw new CalcException("Деление на 0");
double div=this.value/((Scalar) other).value;
return new Scalar(div);
}
else
return super.div(other);
}
Scalar(String str) {
this.value = Double.parseDouble(str);
}
Scalar(Scalar scalar){
this.value=scalar.value;
}
@Override
public String toString() {
return Double.toString(value);
//return "Это класс Scalar";
}
/*
Scalar (Scalar otherScalar)
*/
/*
@Override
public Var add(Var other){
if (other instanceof Scalar){
Scalar op2 = (Scalar) other;
return new Scalar(value.this.value+op2.value);
}
return other.add(this);
}
*/
/*
@Override
public Var sub(Var other){
if (other instanceof Scalar){
Scalar op2 = (Scalar) other;
return new Scalar(value.this.value-((Scalar) other.value));
}
//return new Scalar(value:-1).mul(other.sub(this))//other.add(this);
}
*/
}
| [
"henadzi.pluhatar@gmail.com"
] | henadzi.pluhatar@gmail.com |
41749c69665c2182c88207c933e51e5eaeb2beb1 | cf14828c77bb6733dac09cd2a6e1ab659d46af5e | /src/test/java/test/rabbitmq/rabbitmq/RabbitmqApplicationTests.java | 652e84602759fb116da0b34f8f088b6897879dca | [] | no_license | tangjiahao/rabbitmqDemo | 1ed65401c97f6895862952f145ac3d7dbdc32505 | 1253fd285f9667a5a909471c3967f3e21a35d50c | refs/heads/master | 2023-02-20T01:00:18.050353 | 2021-01-22T07:21:42 | 2021-01-22T07:21:42 | 331,823,452 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package test.rabbitmq.rabbitmq;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class RabbitmqApplicationTests {
@Test
void contextLoads() {
}
}
| [
"1971419718@qq.com"
] | 1971419718@qq.com |
55be92df8743a8bec5b99213c49228af3b5ac65d | ea013b8ed1afffe8a1c00ee39a900679ec166b76 | /QuranMp3/src/com/quranmp3/model/SpinnerNavItem.java | 6c6bf485bcb06916516d707e86f2866dac18926b | [] | no_license | abodali/MP3Quran-V2 | 06b6b1d427ac678e1214974cb8116c5441ca8335 | db5c37e60dc189d2d7e151911f2da07442baafb1 | refs/heads/master | 2020-05-21T12:49:12.080082 | 2015-04-02T09:29:08 | 2015-04-02T09:29:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package com.quranmp3.model;
public class SpinnerNavItem {
private String title;
private int icon;
public SpinnerNavItem(String title, int icon){
this.title = title;
this.icon = icon;
}
public String getTitle(){
return this.title;
}
public int getIcon(){
return this.icon;
}
}
| [
"abed_q@hotmail.com"
] | abed_q@hotmail.com |
bf1d616b27644b9dc759a1fe3090d1c5fa701083 | 9c726e47b90906f301e5e40ef4ee7379a57fe745 | /app/src/main/java/pl/karol202/paintplus/tool/gradient/GradientProperties.java | a1e027c328392943421d4960dc627a0426711e35 | [
"Apache-2.0"
] | permissive | veritas44/PaintPlusPlus | e4b1abf2db28edf5ca3eeaa2c94563311661d847 | 4d0029d6d355317f45f0d359ec4bf436e0ad992f | refs/heads/master | 2021-04-27T09:46:05.099756 | 2017-12-03T22:17:57 | 2017-12-03T22:17:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,649 | java | /*
* Copyright 2017 karol-202
*
* 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 pl.karol202.paintplus.tool.gradient;
import android.os.Bundle;
import android.view.*;
import android.widget.AdapterView;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.Spinner;
import pl.karol202.paintplus.R;
import pl.karol202.paintplus.tool.ToolProperties;
import pl.karol202.paintplus.tool.gradient.ToolGradient.OnGradientEditListener;
public class GradientProperties extends ToolProperties implements OnGradientEditListener, AdapterView.OnItemSelectedListener, View.OnClickListener, GradientDialog.OnGradientUpdateListener, CompoundButton.OnCheckedChangeListener
{
private ToolGradient toolGradient;
private GradientShapes shapes;
private GradientShapeAdapter adapterGradientShape;
private GradientRepeatabilityAdapter adapterGradientRepeatability;
private View view;
private GradientPreviewView gradientPreview;
private CheckBox checkGradientRevert;
private Spinner spinnerGradientShape;
private Spinner spinnerGradientRepeatability;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
super.onCreateView(inflater, container, savedInstanceState);
setHasOptionsMenu(true);
view = inflater.inflate(R.layout.properties_gradient, container, false);
toolGradient = (ToolGradient) tool;
toolGradient.setOnGradientEditListener(this);
shapes = toolGradient.getShapes();
adapterGradientShape = new GradientShapeAdapter(getActivity(), shapes.getShapes());
adapterGradientRepeatability = new GradientRepeatabilityAdapter(getActivity());
gradientPreview = view.findViewById(R.id.gradient_preview);
gradientPreview.setGradient(toolGradient.getGradient());
gradientPreview.setOnClickListener(this);
checkGradientRevert = view.findViewById(R.id.check_gradient_revert);
checkGradientRevert.setChecked(toolGradient.isReverted());
checkGradientRevert.setOnCheckedChangeListener(this);
spinnerGradientShape = view.findViewById(R.id.spinner_gradient_shape);
spinnerGradientShape.setAdapter(adapterGradientShape);
spinnerGradientShape.setSelection(shapes.getIdOfShape(toolGradient.getShape()));
spinnerGradientShape.setOnItemSelectedListener(this);
spinnerGradientRepeatability = view.findViewById(R.id.spinner_gradient_repeatability);
spinnerGradientRepeatability.setAdapter(adapterGradientRepeatability);
spinnerGradientRepeatability.setSelection(toolGradient.getRepeatability().ordinal());
spinnerGradientRepeatability.setOnItemSelectedListener(this);
return view;
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
{
if(toolGradient.isInEditMode()) inflater.inflate(R.menu.menu_tool_gradient, menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
int id = item.getItemId();
if(toolGradient.isInEditMode())
{
switch(id)
{
case R.id.action_apply:
toolGradient.apply();
break;
case R.id.action_cancel:
toolGradient.cancel();
break;
}
getActivity().invalidateOptionsMenu();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onGradientSet()
{
getActivity().invalidateOptionsMenu();
}
@Override
public void onClick(View v)
{
GradientDialog dialog = new GradientDialog(getActivity(), toolGradient.getGradient());
dialog.setGradientUpdateListener(this);
dialog.show();
}
@Override
public void onGradientUpdated()
{
gradientPreview.update();
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id)
{
if(parent == spinnerGradientShape)
toolGradient.setShape(shapes.getShape(position));
else if(parent == spinnerGradientRepeatability)
toolGradient.setRepeatability(GradientRepeatability.values()[position]);
}
@Override
public void onNothingSelected(AdapterView<?> parent)
{
System.err.println("nothing!");
}
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b)
{
toolGradient.setRevert(b);
}
} | [
"karoljurski1@gmail.com"
] | karoljurski1@gmail.com |
39f0e5a3d230159d42d83a50121e3cf64ba0f881 | 8daa438adea47c2532ff6f1af8dacf75c4d3781d | /src/main/java/io/reflection/salesdatagather/model/nondb/LeasedTask.java | e4f3a5234a113bd1bcbb1cb7fc1a2a0655835243 | [] | no_license | ReflectionIO/SalesDataGather | 142ab3b13c4687971cd923e479ecc389e51746b0 | 99e5a1c186219bf4eda3bbc78a549abcf0dd0071 | refs/heads/master | 2021-05-31T13:18:28.516473 | 2015-11-06T16:24:36 | 2015-11-06T16:24:36 | 38,682,150 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 711 | java | package io.reflection.salesdatagather.model.nondb;
import java.util.Map;
import com.google.api.services.taskqueue.model.Task;
public class LeasedTask {
private Task googleLeasedTask;
private Map<String, String> paramMap;
public LeasedTask(Map<String, String> paramMap, Task googleLeasedTask) {
this.paramMap = paramMap;
this.googleLeasedTask = googleLeasedTask;
}
public Task getGoogleLeasedTask() {
return googleLeasedTask;
}
public void setGoogleLeasedTask(Task googleLeasedTask) {
this.googleLeasedTask = googleLeasedTask;
}
public Map<String, String> getParamMap() {
return paramMap;
}
public void setParamMap(Map<String, String> paramMap) {
this.paramMap = paramMap;
}
}
| [
"mitul@reflection.io"
] | mitul@reflection.io |
db74833656f0c3599efb65383d2e39d5b308edfa | 7dae5c6fdb30645a2b1f518cab8ca8012e445135 | /V2/src/test/java/com/VideoGameTracker/V2/UserTest.java | c9866a73e09e7d283b478ffcc957ccfd030b2b66 | [] | no_license | frenchy0943/CaseStudyWithSpring | fc8b59e2e5191957670493d8d5e8de0ea504f8ed | cd6a2949d5cb621867673de0095d0e5426026b47 | refs/heads/main | 2023-04-02T17:51:19.765978 | 2021-04-12T13:49:04 | 2021-04-12T13:49:04 | 356,322,897 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,152 | java | package com.VideoGameTracker.V2;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.transaction.annotation.Transactional;
import com.VideoGameTracker.entities.Game;
import com.VideoGameTracker.entities.User;
import com.VideoGameTracker.repo.UserRepository;
import com.VideoGameTracker.service.UserService;
@SpringBootTest
class UserTest {
@Autowired
UserService us;
@Autowired
UserRepository ur;
User testUser;
@BeforeAll
static void setUpBeforeClass() throws Exception {
}
@AfterAll
static void tearDownAfterClass() throws Exception {
}
@BeforeEach
void setUp() throws Exception {
testUser = new User("testUser", "Testpass1", "Testpass1");
ur.save(testUser);
}
@AfterEach
void tearDown() throws Exception {
}
@Test
@Transactional
void testAdd() {
us.addUser(new User("Brandon", "Password1", "Password1"));
assertTrue(ur.existsById("Brandon"));
}
@Test
@Transactional
void testGetById() {
User actual = us.getById("testUser");
assertEquals(testUser, actual);
}
@Test
@Transactional
void testValidate() {
assertTrue(us.validateUser("testUser", "Testpass1"));
assertFalse(us.validateUser("testUser", "testPass1"));
}
@Test
@Transactional
void testRegister() {
assertTrue(us.registerUser("testUser2", "Password1", "Password1"));
assertFalse(us.registerUser("testUser2", "Password1", "Password1"));
}
@Test
@Transactional
void testAddToList() {
assertEquals(1, us.addToList("testUser", new Game("Nioh 2"), "current"));
assertEquals(0, us.addToList("testUser", new Game("Nioh 2"), "currentList"));
}
@Test
@Transactional
void testRemoveFromList() {
assertEquals(1, us.removeFromList("testUser", new Game("Nioh 2"), "current"));
assertEquals(0, us.removeFromList("testUser", new Game("Nioh 2"), "currentList"));
}
}
| [
"brf82345@bethel.edu"
] | brf82345@bethel.edu |
83fb3e5b0f3a148921488ce8ec86a0cd310f981a | fcc620d6b23999fd824b548d81ae83350894aaa4 | /nkop-api/nkop-framework/src/main/java/com/newkdd/framework/util/tree/TreeBuilder.java | ecf4d6831783ee993b0d933259fcd69728162f49 | [] | no_license | newkdd/nkop | f047afd91d99fa5faefec1411182974ece9e3396 | 63e903c30b43e1a3432b7cf952fcb5379e037e92 | refs/heads/master | 2020-03-09T23:59:56.130404 | 2018-06-19T14:59:23 | 2018-06-19T14:59:23 | 129,071,555 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,940 | java | package com.newkdd.framework.util.tree;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Mike on 2018/4/14.
*/
public class TreeBuilder <T extends Node>{
List<T> nodes = new ArrayList<>();
public TreeBuilder() {
}
public TreeBuilder(List<T> nodes) {
super();
this.nodes = nodes;
}
// 构建树形结构
public List<T> buildTree() {
List<T> treeNodes = new ArrayList<>();
List<T> rootNodes = getRootNodes();
for (T rootNode : rootNodes) {
buildChildNodes(rootNode);
treeNodes.add(rootNode);
}
return treeNodes;
}
// 递归子节点
public void buildChildNodes(T T) {
List<T> children = getChildNodes(T);
if (!children.isEmpty()) {
for (T child : children) {
buildChildNodes(child);
}
T.setChildren((List<Node>) children);
}
}
// 获取父节点下所有的子节点
public List<T> getChildNodes(T pnode) {
List<T> childNodes = new ArrayList<>();
for (T n : nodes) {
if (pnode.getId().equals(n.getParentId())) {
childNodes.add(n);
}
}
return childNodes;
}
// 判断是否为根节点
public boolean rootNode(T T) {
boolean isRootNode = true;
for (T n : nodes) {
if(T.getParentId()==null){
System.out.println("test");
}
if (T.getParentId().equals(n.getId())) {
isRootNode = false;
break;
}
}
return isRootNode;
}
// 获取集合中所有的根节点
public List<T> getRootNodes() {
List<T> rootNodes = new ArrayList<>();
for (T n : nodes) {
if (rootNode(n)) {
rootNodes.add(n);
}
}
return rootNodes;
}
} | [
"newkdd@163.com"
] | newkdd@163.com |
1cd2d4c818a75e9132c7e15bba421a7e7e1c3e03 | f256e4b5fd1ccda05f4d342aeb295eb45e9b8d17 | /OpenCVLibrary320/src/main/java/com/kongqw/view/CameraFaceDetectionView.java | a67288723a8b80a2298cd3b7d1ca1ffb2342193c | [] | no_license | AndroidEx-SDK/FaceCard | 602c7a6e27c0316f81f7e766d5d403228a473797 | 90277bcc7cd3f1af8879ca004360451cb10f838e | refs/heads/master | 2021-01-19T02:26:55.198198 | 2017-05-26T16:43:23 | 2017-05-26T16:43:23 | 87,279,072 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,154 | java | package com.kongqw.view;
import android.content.Context;
import android.hardware.Camera;
import android.util.AttributeSet;
import android.util.Log;
import com.kongqw.interfaces.OnFaceDetectorListener;
import com.kongqw.interfaces.OnOpenCVInitListener;
import org.opencv.R;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.JavaCameraView;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.core.Size;
import org.opencv.imgproc.Imgproc;
import org.opencv.objdetect.CascadeClassifier;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by kqw on 2016/9/9.
* CameraFaceDetectionView
*/
public class CameraFaceDetectionView extends JavaCameraView implements CameraBridgeViewBase.CvCameraViewListener2 {
private static final String TAG = "RobotCameraView";
private OnFaceDetectorListener mOnFaceDetectorListener;
private OnOpenCVInitListener mOnOpenCVInitListener;
private static final Scalar FACE_RECT_COLOR = new Scalar(0, 255, 0, 255);
public static CascadeClassifier mJavaDetector;
// 记录切换摄像头点击次数
private int mCameraSwitchCount = 0;
private Mat mRgba;
private Mat mGray;
private int mAbsoluteFaceSize = 0;
// 脸部占屏幕多大面积的时候开始识别
private static final float RELATIVE_FACE_SIZE = 0.2f;
public CameraFaceDetectionView(Context context, AttributeSet attrs) {
super(context, attrs);
}
/**
* 加载OpenCV
*
* @param context context
* @return 是否安装了OpenCV
*/
public boolean loadOpenCV(Context context) {
// 初始化OpenCV
boolean isLoaded = OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_2_0, context, mLoaderCallback);
if (isLoaded) {
// OpenCV加载成功
setCvCameraViewListener(this);
} else {
// 加载失败
Log.i(TAG, "loadOpenCV: ----------------------------");
Log.i(TAG, "loadOpenCV: " + "请先安装OpenCV Manager! ");
Log.i(TAG, "loadOpenCV: ----------------------------");
}
return isLoaded;
}
private boolean isLoadSuccess = false;
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(getContext().getApplicationContext()) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
Log.i(TAG, "onManagerConnected: OpenCV加载成功");
if (null != mOnOpenCVInitListener) {
mOnOpenCVInitListener.onLoadSuccess();
}
isLoadSuccess = true;
try {
InputStream is = getResources().openRawResource(R.raw.lbpcascade_frontalface);
File cascadeDir = getContext().getApplicationContext().getDir("cascade", Context.MODE_PRIVATE);
File cascadeFile = new File(cascadeDir, "lbpcascade_frontalface.xml");
FileOutputStream os = new FileOutputStream(cascadeFile);
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = is.read(buffer)) != -1) {
os.write(buffer, 0, bytesRead);
}
is.close();
os.close();
mJavaDetector = new CascadeClassifier(cascadeFile.getAbsolutePath());
if (mJavaDetector.empty()) {
Log.e(TAG, "级联分类器加载失败");
mJavaDetector = null;
}else{
Log.e(TAG, "级联分类器加载成功");
}
} catch (IOException e) {
e.printStackTrace();
Log.e(TAG, "没有找到级联分类器");
}
enableView();
break;
case LoaderCallbackInterface.MARKET_ERROR: // OpenCV loader can not start Google Play Market.
Log.i(TAG, "onManagerConnected: 打开Google Play失败");
if (null != mOnOpenCVInitListener) {
mOnOpenCVInitListener.onMarketError();
}
break;
case LoaderCallbackInterface.INSTALL_CANCELED: // Package installation has been canceled.
Log.i(TAG, "onManagerConnected: 安装被取消");
if (null != mOnOpenCVInitListener) {
mOnOpenCVInitListener.onInstallCanceled();
}
break;
case LoaderCallbackInterface.INCOMPATIBLE_MANAGER_VERSION: // Application is incompatible with this version of OpenCV Manager. Possibly, a service update is required.
Log.i(TAG, "onManagerConnected: 版本不正确");
if (null != mOnOpenCVInitListener) {
mOnOpenCVInitListener.onIncompatibleManagerVersion();
}
break;
default: // Other status,
Log.i(TAG, "onManagerConnected: 其他错误");
super.onManagerConnected(status);
if (null != mOnOpenCVInitListener) {
mOnOpenCVInitListener.onOtherError();
}
// super.onManagerConnected(status);
break;
}
}
};
@Override
public void enableView() {
if (isLoadSuccess) {
super.enableView();
}
}
@Override
public void disableView() {
if (isLoadSuccess) {
super.disableView();
}
}
@Override
public void onCameraViewStarted(int width, int height) {
mGray = new Mat();
mRgba = new Mat();
}
@Override
public void onCameraViewStopped() {
mGray.release();
mRgba.release();
}
@Override
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
// 子线程(非UI线程)
mRgba = inputFrame.rgba();
mGray = inputFrame.gray();
if (mAbsoluteFaceSize == 0) {
int height = mGray.rows();
if (Math.round(height * RELATIVE_FACE_SIZE) > 0) {
mAbsoluteFaceSize = Math.round(height * RELATIVE_FACE_SIZE);
}
}
if (mJavaDetector != null) {
MatOfRect
faces = new MatOfRect();
mJavaDetector.detectMultiScale(mGray, // 要检查的灰度图像
faces, // 检测到的人脸
1.1, // 表示在前后两次相继的扫描中,搜索窗口的比例系数。默认为1.1即每次搜索窗口依次扩大10%;
10, // 默认是3 控制误检测,表示默认几次重叠检测到人脸,才认为人脸存在
2,//CV_HAAR_DO_CANNY_PRUNING ,// CV_HAAR_SCALE_IMAGE, // TODO: objdetect.CV_HAAR_SCALE_IMAGE
new Size(mAbsoluteFaceSize, mAbsoluteFaceSize),
new Size(mGray.width(), mGray.height()));
// 检测到人脸
Rect[] facesArray = faces.toArray();
for (Rect aFacesArray : facesArray) {
Imgproc.rectangle(mRgba, aFacesArray.tl(), aFacesArray.br(), FACE_RECT_COLOR, 3);
if (null != mOnFaceDetectorListener) {
mOnFaceDetectorListener.onFace(mRgba, aFacesArray);
}
}
}
return mRgba;
}
/**
* 切换摄像头
*
* @return 切换摄像头是否成功
*/
public boolean switchCamera() {
// 摄像头总数
int numberOfCameras = 0;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
numberOfCameras = Camera.getNumberOfCameras();
}
// 2个及以上摄像头
if (1 < numberOfCameras) {
// 设备没有摄像头
int index = ++mCameraSwitchCount % numberOfCameras;
disableView();
setCameraIndex(index);
enableView();
return true;
}
return false;
}
/**
* 添加人脸识别额监听
*
* @param listener 回调接口
*/
public void setOnFaceDetectorListener(OnFaceDetectorListener listener) {
mOnFaceDetectorListener = listener;
}
/**
* 添加加载OpenCV的监听
*
* @param listener 回调接口
*/
public void setOnOpenCVInitListener(OnOpenCVInitListener listener) {
mOnOpenCVInitListener = listener;
}
}
| [
"yangfch@androidex.cn"
] | yangfch@androidex.cn |
f091dbce2fa2b6ed30480242783a0dde8a6247d6 | 5e1d91e296957560dea2033581b9fc1d8267e74f | /src/controller/GameController.java | a9e5d7cb3ce19a50c65d3206b7855762ebf30c76 | [] | no_license | BBWProjekte/visualnovel | 716294c461e9b30288c1b0f97db5325fd67931a9 | 204c92b4d6337028904af450299d76f26ca16bc8 | refs/heads/master | 2021-01-21T21:39:48.105632 | 2015-07-06T19:22:24 | 2015-07-06T19:22:24 | 36,064,028 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 933 | java | package controller;
/*
* 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.
*/
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import model.GameModel;
import view.MainMenu;
/**
*
* @author janes.thomas
*/
public class GameController {
private MainMenu _view;
private GameModel _model;
public GameController(){
this._model = new GameModel();
this._view = new MainMenu();
addListener();
}
public void showView(){
this._view.setVisible(true);
}
/**
* Die Listener, die wir aus den Internen Klassen generieren
* werden der View bekannt gemacht, sodass diese mit
* uns (dem Controller) kommunizieren kann
*/
private void addListener(){
}
}
| [
"kajtorvaldgrey@googlemail.com"
] | kajtorvaldgrey@googlemail.com |
917ab8c416b15d2f79f470b3a9d5f097f8a3d26e | beb8db7c4421e070aa4d63c335d4fb5208eed660 | /src/com/handling/SuggestionTextBox/TC02_Handling_Suggestion_TextBox.java | 564a52f7d649d970a5f73e6fc6654483af740991 | [] | no_license | ShaikPraveen/SELENIUM_2019 | ba3780b870db7c1e932f720e6b678b2a33562d9b | a142151c249a8e585c18a1db330b1dc0190d2779 | refs/heads/master | 2020-04-22T12:59:15.319343 | 2019-04-16T16:27:33 | 2019-04-16T16:27:33 | 170,393,084 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,756 | java | package com.handling.SuggestionTextBox;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
public class TC02_Handling_Suggestion_TextBox
{
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+"\\Drivers\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.manage().timeouts().pageLoadTimeout(50, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.get("https://apsrtconline.in/oprs-web/");
Assert.assertEquals(driver.getTitle(), "APSRTC Official Website for Online Bus Ticket Booking - APSRTConline.in");
driver.findElement(By.xpath("//input[@name='source']")).clear();
driver.findElement(By.xpath("//input[@name='source']")).sendKeys("ban");
List<WebElement> cities=driver.findElements(By.xpath("/html[1]/body[1]/ul[1]/li/a[1]"));
System.out.println(cities.size());
String expcity,actcity;
expcity="GUDIBANDA";
boolean cityexist=true;
for (int i = 0; i < cities.size(); i++)
{
actcity=cities.get(i).getText();
if (actcity.contains(expcity))
{
cityexist=true;
break;
}
}
if (cityexist)
{
System.out.println("TEST PASS : EXPECTED CITY IS PRESENT "+expcity);
} else
{
System.out.println("TEST FAIL : EXPECTED CITY IS NOT PRESENT "+expcity);
}
Assert.assertEquals(driver.getCurrentUrl(), "https://apsrtconline.in/oprs-web/");
driver.close();
}
}
| [
"info.praveen@gmail.com"
] | info.praveen@gmail.com |
4e94ff0719892be931cb25bdafdb295c89d5ef2b | 551b573f739f5220c581133205d5dc2af91c820b | /SortingHelpers.java | cd812eb261c4fb38acc8a0e50f297e64916509bd | [] | no_license | jsutStacy/Algorithms | 891c8e2494ac5ba666fb573a8c014ab616d29e66 | 4edb359fd3df43fcac664cb7f6770cbfe526d0b6 | refs/heads/master | 2021-05-27T02:56:47.259264 | 2014-05-04T18:03:49 | 2014-05-04T18:03:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 504 | java | public class SortingHelpers
{
protected static boolean less(Comparable p, Comparable q)
{
return p.compareTo(q) < 0;
}
protected static void exch(Comparable[] a, int i, int j)
{
Comparable swap = a[i];
a[i] = a[j];
a[j] = swap;
}
protected static boolean isSorted(Comparable[] a, int lo, int hi)
{
for (int i = lo; i < hi; i++)
if (less(a[i+1], a[i]))
return false;
return true;
}
} | [
"srbhatia10@gmail.com"
] | srbhatia10@gmail.com |
86f4ce16705a792ade497619be27ef2999e9134a | 7d8622045826ca5328cccb57466821409e40715a | /src/practice/XMLParser.java | 5174a963f6a7c7cf439a9b6e795c51a04e213092 | [] | no_license | yashiljijhotiya/Interview-Prep | 5f298f7ad22a19396c6c06821778e58dde9b0019 | 190eccbac554a1afc85b8ae9990ee7a09955b081 | refs/heads/master | 2022-11-04T20:43:53.263403 | 2022-10-10T12:00:51 | 2022-10-10T12:00:51 | 227,983,786 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,496 | java | package practice;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.io.StringReader;
public class XMLParser {
public static void main(String[] args) throws ParserConfigurationException, IOException, SAXException {
// String xml = "<employees>\n" +
// " <employee id=\"111\">\n" +
// " <firstName>Lokesh</firstName>\n" +
// " <lastName>Gupta</lastName>\n" +
// " <location>India</location>\n" +
// " </employee>\n" +
// " <employee id=\"222\">\n" +
// " <firstName>Alex</firstName>\n" +
// " <lastName>Gussin</lastName>\n" +
// " <location>Russia</location>\n" +
// " </employee>\n" +
// " <employee id=\"333\">\n" +
// " <firstName>David</firstName>\n" +
// " <lastName>Feezor</lastName>\n" +
// " <location>USA</location>\n" +
// " </employee>\n" +
// "</employees>";
String xml = "<INProfileResponse><Header><SystemCode>0</SystemCode><MessageText></MessageText><ReportDate>20211129</ReportDate><ReportTime>104859</ReportTime></Header><UserMessage><UserMessageText>Normal Response</UserMessageText></UserMessage><CreditProfileHeader><Enquiry_Username>ecv_ondemand__finbit_ondemand_em</Enquiry_Username><ReportDate>20211129</ReportDate><ReportTime>104859</ReportTime><Version>V2.4</Version><ReportNumber>1638163139252</ReportNumber><Subscriber></Subscriber><Subscriber_Name>Bureau Disclosure Report with Credit Caps</Subscriber_Name></CreditProfileHeader><Current_Application><Current_Application_Details><Enquiry_Reason>6</Enquiry_Reason><Finance_Purpose></Finance_Purpose><Amount_Financed>0</Amount_Financed><Duration_Of_Agreement>0</Duration_Of_Agreement><Current_Applicant_Details><Last_Name>thirupathi</Last_Name><First_Name>srinivasan</First_Name><Middle_Name1></Middle_Name1><Middle_Name2></Middle_Name2><Middle_Name3></Middle_Name3><Gender_Code>2</Gender_Code><IncomeTaxPan>BQGPM7388M</IncomeTaxPan><PAN_Issue_Date></PAN_Issue_Date><PAN_Expiration_Date></PAN_Expiration_Date><Passport_number></Passport_number><Passport_Issue_Date></Passport_Issue_Date><Passport_Expiration_Date></Passport_Expiration_Date><Voter_s_Identity_Card></Voter_s_Identity_Card><Voter_ID_Issue_Date></Voter_ID_Issue_Date><Voter_ID_Expiration_Date></Voter_ID_Expiration_Date><Driver_License_Number></Driver_License_Number><Driver_License_Issue_Date></Driver_License_Issue_Date><Driver_License_Expiration_Date></Driver_License_Expiration_Date><Ration_Card_Number></Ration_Card_Number><Ration_Card_Issue_Date></Ration_Card_Issue_Date><Ration_Card_Expiration_Date></Ration_Card_Expiration_Date><Universal_ID_Number></Universal_ID_Number><Universal_ID_Issue_Date></Universal_ID_Issue_Date><Universal_ID_Expiration_Date></Universal_ID_Expiration_Date><Date_Of_Birth_Applicant>19901013</Date_Of_Birth_Applicant><Telephone_Number_Applicant_1st></Telephone_Number_Applicant_1st><Telephone_Extension></Telephone_Extension><Telephone_Type></Telephone_Type><MobilePhoneNumber>8553896458</MobilePhoneNumber><EMailId>srinivasan@finbit.io</EMailId></Current_Applicant_Details><Current_Other_Details><Income>0</Income><Marital_Status></Marital_Status><Employment_Status></Employment_Status><Time_with_Employer></Time_with_Employer><Number_of_Major_Credit_Card_Held></Number_of_Major_Credit_Card_Held></Current_Other_Details><Current_Applicant_Address_Details><FlatNoPlotNoHouseNo>D 673 SRINIVAS APT GANDHI RD</FlatNoPlotNoHouseNo><BldgNoSocietyName></BldgNoSocietyName><RoadNoNameAreaLocality></RoadNoNameAreaLocality><City>Pune</City><Landmark></Landmark><State>27</State><PINCode>412207</PINCode><Country_Code>IB</Country_Code></Current_Applicant_Address_Details><Current_Applicant_Additional_AddressDetails/></Current_Application_Details></Current_Application><CAIS_Account><CAIS_Summary><Credit_Account><CreditAccountTotal>2</CreditAccountTotal><CreditAccountActive>2</CreditAccountActive><CreditAccountDefault>0</CreditAccountDefault><CreditAccountClosed>0</CreditAccountClosed><CADSuitFiledCurrentBalance>0</CADSuitFiledCurrentBalance></Credit_Account><Total_Outstanding_Balance><Outstanding_Balance_Secured>12000</Outstanding_Balance_Secured><Outstanding_Balance_Secured_Percentage>44</Outstanding_Balance_Secured_Percentage><Outstanding_Balance_UnSecured>15000</Outstanding_Balance_UnSecured><Outstanding_Balance_UnSecured_Percentage>56</Outstanding_Balance_UnSecured_Percentage><Outstanding_Balance_All>27000</Outstanding_Balance_All></Total_Outstanding_Balance></CAIS_Summary><CAIS_Account_DETAILS><Identification_Number>BP03090001</Identification_Number><Subscriber_Name>XXXX</Subscriber_Name><Account_Number>XXXXXXXX2632</Account_Number><Portfolio_Type>R</Portfolio_Type><Account_Type>10</Account_Type><Open_Date>20160116</Open_Date><Credit_Limit_Amount>50000</Credit_Limit_Amount><Highest_Credit_or_Original_Loan_Amount>75000</Highest_Credit_or_Original_Loan_Amount><Terms_Duration></Terms_Duration><Terms_Frequency></Terms_Frequency><Scheduled_Monthly_Payment_Amount></Scheduled_Monthly_Payment_Amount><Account_Status>78</Account_Status><Payment_Rating>2</Payment_Rating><Payment_History_Profile>N</Payment_History_Profile><Special_Comment></Special_Comment><Current_Balance>15000</Current_Balance><Amount_Past_Due>7000</Amount_Past_Due><Original_Charge_Off_Amount></Original_Charge_Off_Amount><Date_Reported>20201228</Date_Reported><Date_of_First_Delinquency></Date_of_First_Delinquency><Date_Closed></Date_Closed><Date_of_Last_Payment></Date_of_Last_Payment><SuitFiledWillfulDefaultWrittenOffStatus></SuitFiledWillfulDefaultWrittenOffStatus><SuitFiled_WilfulDefault></SuitFiled_WilfulDefault><Written_off_Settled_Status></Written_off_Settled_Status><Value_of_Credits_Last_Month></Value_of_Credits_Last_Month><Occupation_Code></Occupation_Code><Settlement_Amount></Settlement_Amount><Value_of_Collateral></Value_of_Collateral><Type_of_Collateral></Type_of_Collateral><Written_Off_Amt_Total></Written_Off_Amt_Total><Written_Off_Amt_Principal></Written_Off_Amt_Principal><Rate_of_Interest></Rate_of_Interest><Repayment_Tenure>0</Repayment_Tenure><Promotional_Rate_Flag></Promotional_Rate_Flag><Income></Income><Income_Indicator></Income_Indicator><Income_Frequency_Indicator></Income_Frequency_Indicator><DefaultStatusDate></DefaultStatusDate><LitigationStatusDate></LitigationStatusDate><WriteOffStatusDate></WriteOffStatusDate><DateOfAddition>20201228</DateOfAddition><CurrencyCode>INR</CurrencyCode><Subscriber_comments></Subscriber_comments><Consumer_comments></Consumer_comments><AccountHoldertypeCode>1</AccountHoldertypeCode><CAIS_Account_History><Year>2020</Year><Month>12</Month><Days_Past_Due>60</Days_Past_Due><Asset_Classification>?</Asset_Classification></CAIS_Account_History><CAIS_Holder_Details><Surname_Non_Normalized>SRINIVASAN</Surname_Non_Normalized><First_Name_Non_Normalized>VENKAT</First_Name_Non_Normalized><Middle_Name_1_Non_Normalized></Middle_Name_1_Non_Normalized><Middle_Name_2_Non_Normalized></Middle_Name_2_Non_Normalized><Middle_Name_3_Non_Normalized></Middle_Name_3_Non_Normalized><Alias></Alias><Gender_Code>1</Gender_Code><Income_TAX_PAN>XXXXXX388M</Income_TAX_PAN><Passport_Number></Passport_Number><Voter_ID_Number></Voter_ID_Number><Date_of_birth>19901013</Date_of_birth></CAIS_Holder_Details><CAIS_Holder_Address_Details><First_Line_Of_Address_non_normalized>D 673</First_Line_Of_Address_non_normalized><Second_Line_Of_Address_non_normalized>SRINIVAS APT</Second_Line_Of_Address_non_normalized><Third_Line_Of_Address_non_normalized>GANDHI RD</Third_Line_Of_Address_non_normalized><City_non_normalized>KALYANI NAGAR</City_non_normalized><Fifth_Line_Of_Address_non_normalized></Fifth_Line_Of_Address_non_normalized><State_non_normalized>27</State_non_normalized><ZIP_Postal_Code_non_normalized>412207</ZIP_Postal_Code_non_normalized><CountryCode_non_normalized>IB</CountryCode_non_normalized><Address_indicator_non_normalized></Address_indicator_non_normalized><Residence_code_non_normalized></Residence_code_non_normalized></CAIS_Holder_Address_Details><CAIS_Holder_Phone_Details><Telephone_Number>XXXXXX6458</Telephone_Number><Telephone_Type></Telephone_Type><Telephone_Extension></Telephone_Extension><Mobile_Telephone_Number></Mobile_Telephone_Number><FaxNumber></FaxNumber><EMailId>SXXXXXXXXN@FXXXXX.IO</EMailId></CAIS_Holder_Phone_Details><CAIS_Holder_ID_Details><Income_TAX_PAN>XXXXXX388M</Income_TAX_PAN><PAN_Issue_Date></PAN_Issue_Date><PAN_Expiration_Date></PAN_Expiration_Date><Passport_Number></Passport_Number><Passport_Issue_Date></Passport_Issue_Date><Passport_Expiration_Date></Passport_Expiration_Date><Voter_ID_Number></Voter_ID_Number><Voter_ID_Issue_Date></Voter_ID_Issue_Date><Voter_ID_Expiration_Date></Voter_ID_Expiration_Date><Driver_License_Number></Driver_License_Number><Driver_License_Issue_Date></Driver_License_Issue_Date><Driver_License_Expiration_Date></Driver_License_Expiration_Date><Ration_Card_Number></Ration_Card_Number><Ration_Card_Issue_Date></Ration_Card_Issue_Date><Ration_Card_Expiration_Date></Ration_Card_Expiration_Date><Universal_ID_Number></Universal_ID_Number><Universal_ID_Issue_Date></Universal_ID_Issue_Date><Universal_ID_Expiration_Date></Universal_ID_Expiration_Date><EMailId></EMailId></CAIS_Holder_ID_Details></CAIS_Account_DETAILS><CAIS_Account_DETAILS><Identification_Number>BP03090001</Identification_Number><Subscriber_Name>XXXX</Subscriber_Name><Account_Number>XXXXXXXX2629</Account_Number><Portfolio_Type>I</Portfolio_Type><Account_Type>03</Account_Type><Open_Date>20160113</Open_Date><Credit_Limit_Amount></Credit_Limit_Amount><Highest_Credit_or_Original_Loan_Amount>60000</Highest_Credit_or_Original_Loan_Amount><Terms_Duration></Terms_Duration><Terms_Frequency></Terms_Frequency><Scheduled_Monthly_Payment_Amount></Scheduled_Monthly_Payment_Amount><Account_Status>71</Account_Status><Payment_Rating>1</Payment_Rating><Payment_History_Profile>N</Payment_History_Profile><Special_Comment></Special_Comment><Current_Balance>12000</Current_Balance><Amount_Past_Due>4000</Amount_Past_Due><Original_Charge_Off_Amount></Original_Charge_Off_Amount><Date_Reported>20201228</Date_Reported><Date_of_First_Delinquency></Date_of_First_Delinquency><Date_Closed></Date_Closed><Date_of_Last_Payment></Date_of_Last_Payment><SuitFiledWillfulDefaultWrittenOffStatus></SuitFiledWillfulDefaultWrittenOffStatus><SuitFiled_WilfulDefault></SuitFiled_WilfulDefault><Written_off_Settled_Status></Written_off_Settled_Status><Value_of_Credits_Last_Month></Value_of_Credits_Last_Month><Occupation_Code></Occupation_Code><Settlement_Amount></Settlement_Amount><Value_of_Collateral></Value_of_Collateral><Type_of_Collateral></Type_of_Collateral><Written_Off_Amt_Total></Written_Off_Amt_Total><Written_Off_Amt_Principal></Written_Off_Amt_Principal><Rate_of_Interest></Rate_of_Interest><Repayment_Tenure>0</Repayment_Tenure><Promotional_Rate_Flag></Promotional_Rate_Flag><Income></Income><Income_Indicator></Income_Indicator><Income_Frequency_Indicator></Income_Frequency_Indicator><DefaultStatusDate></DefaultStatusDate><LitigationStatusDate></LitigationStatusDate><WriteOffStatusDate></WriteOffStatusDate><DateOfAddition>20201228</DateOfAddition><CurrencyCode>INR</CurrencyCode><Subscriber_comments></Subscriber_comments><Consumer_comments></Consumer_comments><AccountHoldertypeCode>1</AccountHoldertypeCode><CAIS_Account_History><Year>2020</Year><Month>12</Month><Days_Past_Due>30</Days_Past_Due><Asset_Classification>?</Asset_Classification></CAIS_Account_History><CAIS_Holder_Details><Surname_Non_Normalized>SRINIVASAN</Surname_Non_Normalized><First_Name_Non_Normalized>VENKAT</First_Name_Non_Normalized><Middle_Name_1_Non_Normalized></Middle_Name_1_Non_Normalized><Middle_Name_2_Non_Normalized></Middle_Name_2_Non_Normalized><Middle_Name_3_Non_Normalized></Middle_Name_3_Non_Normalized><Alias></Alias><Gender_Code>1</Gender_Code><Income_TAX_PAN>XXXXXX388M</Income_TAX_PAN><Passport_Number></Passport_Number><Voter_ID_Number></Voter_ID_Number><Date_of_birth>19901013</Date_of_birth></CAIS_Holder_Details><CAIS_Holder_Address_Details><First_Line_Of_Address_non_normalized>D 673</First_Line_Of_Address_non_normalized><Second_Line_Of_Address_non_normalized>SRINIVAS APT</Second_Line_Of_Address_non_normalized><Third_Line_Of_Address_non_normalized>GANDHI RD</Third_Line_Of_Address_non_normalized><City_non_normalized>KALYANI NAGAR</City_non_normalized><Fifth_Line_Of_Address_non_normalized></Fifth_Line_Of_Address_non_normalized><State_non_normalized>27</State_non_normalized><ZIP_Postal_Code_non_normalized>412207</ZIP_Postal_Code_non_normalized><CountryCode_non_normalized>IB</CountryCode_non_normalized><Address_indicator_non_normalized></Address_indicator_non_normalized><Residence_code_non_normalized></Residence_code_non_normalized></CAIS_Holder_Address_Details><CAIS_Holder_Phone_Details><Telephone_Number>XXXXXX6458</Telephone_Number><Telephone_Type></Telephone_Type><Telephone_Extension></Telephone_Extension><Mobile_Telephone_Number></Mobile_Telephone_Number><FaxNumber></FaxNumber><EMailId>SXXXXXXXXN@FXXXXX.IO</EMailId></CAIS_Holder_Phone_Details><CAIS_Holder_ID_Details><Income_TAX_PAN>XXXXXX388M</Income_TAX_PAN><PAN_Issue_Date></PAN_Issue_Date><PAN_Expiration_Date></PAN_Expiration_Date><Passport_Number></Passport_Number><Passport_Issue_Date></Passport_Issue_Date><Passport_Expiration_Date></Passport_Expiration_Date><Voter_ID_Number></Voter_ID_Number><Voter_ID_Issue_Date></Voter_ID_Issue_Date><Voter_ID_Expiration_Date></Voter_ID_Expiration_Date><Driver_License_Number></Driver_License_Number><Driver_License_Issue_Date></Driver_License_Issue_Date><Driver_License_Expiration_Date></Driver_License_Expiration_Date><Ration_Card_Number></Ration_Card_Number><Ration_Card_Issue_Date></Ration_Card_Issue_Date><Ration_Card_Expiration_Date></Ration_Card_Expiration_Date><Universal_ID_Number></Universal_ID_Number><Universal_ID_Issue_Date></Universal_ID_Issue_Date><Universal_ID_Expiration_Date></Universal_ID_Expiration_Date><EMailId></EMailId></CAIS_Holder_ID_Details></CAIS_Account_DETAILS></CAIS_Account><Match_result><Exact_match>Y</Exact_match></Match_result><TotalCAPS_Summary><TotalCAPSLast7Days>0</TotalCAPSLast7Days><TotalCAPSLast30Days>0</TotalCAPSLast30Days><TotalCAPSLast90Days>0</TotalCAPSLast90Days><TotalCAPSLast180Days>0</TotalCAPSLast180Days></TotalCAPS_Summary><CAPS><CAPS_Summary><CAPSLast7Days>0</CAPSLast7Days><CAPSLast30Days>0</CAPSLast30Days><CAPSLast90Days>0</CAPSLast90Days><CAPSLast180Days>0</CAPSLast180Days></CAPS_Summary></CAPS><NonCreditCAPS><NonCreditCAPS_Summary><NonCreditCAPSLast7Days>0</NonCreditCAPSLast7Days><NonCreditCAPSLast30Days>0</NonCreditCAPSLast30Days><NonCreditCAPSLast90Days>0</NonCreditCAPSLast90Days><NonCreditCAPSLast180Days>0</NonCreditCAPSLast180Days></NonCreditCAPS_Summary></NonCreditCAPS><SCORE><BureauScore>813</BureauScore><BureauScoreConfidLevel>H</BureauScoreConfidLevel></SCORE></INProfileResponse>";
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xml)));
document.getDocumentElement().normalize();
Element root = document.getDocumentElement();
System.out.println(root.getNodeName());
NodeList nList = document.getElementsByTagName("SCORE");
System.out.println("======================================"+nList.getLength());
for(int i = 0; i < nList.getLength(); i++){
Node node = nList.item(i);
Element element = (Element) node;
// System.out.println("Employee id -- "+ element.getAttribute("BureauScore"));
//System.out.println("firstName -- "+element.getAttribute("firstName"));
System.out.println("date closed -- "+ element.getElementsByTagName("BureauScore").item(0).getTextContent());
// System.out.println("date reported -- "+element.getElementsByTagName("Date_Reported").item(0).getTextContent());
}
}
}
| [
"Yashil.Jijhotiya@yodlee.com"
] | Yashil.Jijhotiya@yodlee.com |
a80da18579b75dd4aba7a4dd138ed082a6b5fa66 | b0ce38092ac97d37fe84e7d38bbb5b92b5c1ccea | /dbcp_member_model2/src/dao/MemberDAO.java | 61163e69489b41e80f2fcc01cfe8a641d1479020 | [] | no_license | lovemellow/dbcp_member_model2 | d38315c293c3ee16b88b28451708875dbaf1dfba | 7bb73b621ad21009e67b45e4e461c28722b82701 | refs/heads/master | 2020-03-28T22:13:40.021337 | 2018-09-18T02:42:03 | 2018-09-18T02:42:03 | 149,215,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,294 | java | package dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import vo.MemberVO;
public class MemberDAO {
private Connection con=null;
private PreparedStatement pstmt=null;
private ResultSet rs=null;
private DataSource ds=null;
private Connection getConnection() {
Context ctx;
try {
ctx = new InitialContext();
ds=(DataSource)ctx.lookup("java:comp/env/jdbc/MySQL");
con=ds.getConnection();
} catch (NamingException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
return con;
}
private void close(Connection con,PreparedStatement pstmt,
ResultSet rs) {
try{
if(rs!=null) rs.close();
if(pstmt!=null) pstmt.close();
if(con!=null) con.close();
}catch (SQLException e) {
e.printStackTrace();
}
}
private void close(Connection con,PreparedStatement pstmt){
try{
if(pstmt!=null) pstmt.close();
if(con!=null) con.close();
}catch (SQLException e) {
e.printStackTrace();
}
}
//로그인
public MemberVO isLogin(String id,String pwd) {
MemberVO vo=null;
try {
con=getConnection();
con.setAutoCommit(false);
String sql="select userid,name from member where userid=? "
+ "and password=?";
pstmt=con.prepareStatement(sql);
pstmt.setString(1, id);
pstmt.setString(2, pwd);
rs=pstmt.executeQuery();
if(rs.next()) {
vo=new MemberVO();
vo.setUserid(rs.getString(1));
vo.setName(rs.getString(2));
}
con.commit();
}catch(Exception e) {
try {
con.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally {
close(con,pstmt,rs);
}
return vo;
}
//회원가입
public int join_member(MemberVO vo) {
int result=0;
try {
con=getConnection();
con.setAutoCommit(false);
String sql="insert into member values(?,?,?,?,?)";
pstmt=con.prepareStatement(sql);
pstmt.setString(1, vo.getUserid());
pstmt.setString(2, vo.getPassword());
pstmt.setString(3, vo.getName());
pstmt.setString(4, vo.getGender());
pstmt.setString(5, vo.getEmail());
result=pstmt.executeUpdate();
if(result>0)
con.commit();
}catch(Exception e) {
try {
con.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally {
close(con,pstmt);
}
return result;
}
//회원탈퇴
//회원정보수정
public int update_member(MemberVO vo) {
int result=0;
try {
con=getConnection();
con.setAutoCommit(false);
String sql="update member set password=?, email=? where userid=?"; ;
pstmt=con.prepareStatement(sql);
pstmt.setString(1, vo.getPassword());
pstmt.setString(2, vo.getEmail());
pstmt.setString(3, vo.getUserid());
result=pstmt.executeUpdate();
if(result>0)
con.commit();
}catch(Exception e) {
try {
con.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally {
close(con,pstmt);
}
return result;
}
//회원리스트
//비밀번호 확인 후 회원정보 담기
public MemberVO pwdCheck(String id,String password) {
MemberVO vo=null;
try {
con=getConnection();
con.setAutoCommit(false);
String sql="select * from member where userid=? "
+ "and password=?";
pstmt=con.prepareStatement(sql);
pstmt.setString(1, id);
pstmt.setString(2, password);
rs=pstmt.executeQuery();
if(rs.next()) {
vo=new MemberVO();
vo.setUserid(rs.getString(1));
vo.setName(rs.getString(3));
vo.setGender(rs.getString(4));
vo.setEmail(rs.getString(5));
}
con.commit();
}catch(Exception e) {
try {
con.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally {
close(con,pstmt,rs);
}
return vo;
}
//회원 탈퇴
public int member_leave(String userid) {
int result=0;
try {
con=getConnection();
con.setAutoCommit(false);
String sql="delete from member where userid=?";
pstmt=con.prepareStatement(sql);
pstmt.setString(1, userid);
result=pstmt.executeUpdate();
if(result>0)
con.commit();
} catch (SQLException e) {
try {
con.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally {
close(con,pstmt);
}
return result;
}
public boolean checkId(String userid) {
boolean flag=false;
try {
con=getConnection();
con.setAutoCommit(false);
String sql="select * from member where userid=?";
pstmt=con.prepareStatement(sql);
pstmt.setString(1, userid);
rs=pstmt.executeQuery();
if(rs.next()) {
flag=true;
}
con.commit();
}catch(Exception e) {
try {
con.rollback();
}catch(SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally {
close(con,pstmt,rs);
}
return flag;
}
}
| [
"exsug1691@gmail.com"
] | exsug1691@gmail.com |
1a2484852f021acd72860269ca501c00fc69ac74 | 49dc27443bb5720460430cc793cf03a60ad9f9c3 | /app/src/main/java/com/example/androideatits/ui/home/HomeFragment.java | 619a06a4bafd3e933155485ca855254a065af840 | [] | no_license | LJuggernaut/Order-Food | b47fc98a8cbd6cd1128151bf1ca45d77954cf8c4 | 714a9e22588fda813c203e658d38590c2f9d4108 | refs/heads/master | 2022-12-01T17:05:12.579730 | 2020-08-20T03:49:15 | 2020-08-20T03:49:15 | 288,898,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,160 | java | package com.example.androideatits.ui.home;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.example.androideatits.R;
public class HomeFragment extends Fragment {
private HomeViewModel homeViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
homeViewModel =
ViewModelProviders.of(this).get(HomeViewModel.class);
View root = inflater.inflate(R.layout.fragment_home, container, false);
final TextView textView = root.findViewById(R.id.text_home);
homeViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
return root;
}
} | [
"you@example.com"
] | you@example.com |
197ed5c8915c204ac9f5dea1ed9a960553d46ac0 | fa5cf4def3c9c9cec35cc3baf5ce7eac080c7800 | /src/main/java/com/luxoft/hibernate/dao/service/CompositionService.java | 3c78f6dc865e323cc44f88e76da9db7e6acd1e3b | [] | no_license | GBoroda/hibernate_2.0 | c7d4f4c19d22a84dcdbe42f925ce338995ed7742 | 8fc91b31358f43c48353b83676bac349dd7fc1b8 | refs/heads/master | 2021-01-10T21:37:08.321665 | 2014-10-18T12:33:47 | 2014-10-18T12:33:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 293 | java | package com.luxoft.hibernate.dao.service;
import com.luxoft.hibernate.dao.entity.Composition;
import java.util.List;
public interface CompositionService {
List<Composition> getCompositions();
void saveOrUpdate(Composition composition);
void remove(Composition composition);
}
| [
"MSBoroda@gmail.com"
] | MSBoroda@gmail.com |
a145c23d358946c57dc9852f1209af8814b30b8a | 1bd4a498c280b2042568217d4bae215442fef138 | /src/com/zca/tcp/ServerTest01.java | f4f37825e812717741a19b8c374c518c0bbbcf74 | [] | no_license | Altria11043/Java_Net | 1c78bc2d51e3946035dcfb9352c59e7b717a710d | 84145fae7c45b1b2d08fbd3c866224256d5e0398 | refs/heads/master | 2020-08-06T10:16:44.766081 | 2019-10-07T15:46:31 | 2019-10-07T15:46:31 | 212,940,257 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,069 | java | package com.zca.tcp;
import java.io.DataInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
/**
* 创建服务器
* 1. 指定端口 使用ServerSocket创建服务器
* 2. 阻塞式等待连接accept
* 3. 操作: 输入输出流操作
* 4. 释放资源
* @author Altria
* @date: 2019/10/6 23:25
*/
public class ServerTest01 {
public static void main(String[] args) throws IOException {
// 1. 指定端口 使用ServerSocket创建服务器
ServerSocket socket = new ServerSocket(8888);
// 2. 阻塞式等待连接accept
Socket client = socket.accept();
System.out.println("一个客户端建立了连接");
// 3. 操作: 输入输出流操作
DataInputStream dis = new DataInputStream(client.getInputStream());
String data = dis.readUTF();
System.out.println(data);
// 4. 释放资源
dis.close();
client.close();
// 如果要关闭服务器就可以考虑添加socket.close()
socket.close();
}
}
| [
"51522497+Altria11043@users.noreply.github.com"
] | 51522497+Altria11043@users.noreply.github.com |
10015b8437f7710542076866d5262256bb7b11d8 | f1fc585aa3f253de3a6f6c767f10f6c024df6398 | /Blatt_3/Tobias/Kassette.java | 6c7821f2baad745c77258089ed2a639b059e0e7b | [] | no_license | ole-thoeb/OoSe | a2f50d4156036515a8ac0ec064ddd5c5f0633838 | b976085443fcc245712f4d4282cf39acf97778bd | refs/heads/master | 2020-05-07T13:07:16.311456 | 2019-06-23T19:46:48 | 2019-06-23T19:46:48 | 180,534,842 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 120 | java |
public class Kassette implements Playable{
public void song()
{
System.out.println("Alle meine Entchen...");
}
}
| [
"noreply@github.com"
] | ole-thoeb.noreply@github.com |
afdd24b685da3850d352396da7916d3fff857783 | 11e1baca23219f6a03cecc72c156038615631e87 | /src/test/java/de/acosix/alfresco/simplecontentstores/repo/FileContentStoreTest.java | be148b7e8e28d4cb720e0f0c129f5c1e4e82e277 | [
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | ikaygorodov/alfresco-simple-content-stores | 817365149b4571e3f7ac31dbbcb49348974088ff | 65aa3def31cf80df493653fb301d6c83d4373c7f | refs/heads/master | 2023-01-08T01:41:28.358669 | 2020-11-04T14:45:15 | 2020-11-04T14:45:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,492 | java | /*
* Copyright 2017 - 2020 Acosix GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.acosix.alfresco.simplecontentstores.repo;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileVisitOption;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.SecureRandom;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import org.alfresco.repo.content.ContentContext;
import org.alfresco.repo.content.ContentStore;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import com.thedeanda.lorem.Lorem;
import com.thedeanda.lorem.LoremIpsum;
import de.acosix.alfresco.simplecontentstores.repo.store.StoreConstants;
import de.acosix.alfresco.simplecontentstores.repo.store.context.ContentStoreContext;
import de.acosix.alfresco.simplecontentstores.repo.store.file.FileContentStore;
/**
*
* @author Axel Faust
*/
public class FileContentStoreTest
{
private static final String STORE_PROTOCOL = FileContentStoreTest.class.getSimpleName();
private static final SecureRandom SEED_PRNG;
static
{
try
{
SEED_PRNG = new SecureRandom(DeduplicatingContentStoreTest.class.getName().getBytes(StandardCharsets.UTF_8.name()));
}
catch (final UnsupportedEncodingException ex)
{
throw new RuntimeException("Java does not support UTF-8 anymore, so run for your lives...", ex);
}
}
@Rule
public ExpectedException thrown = ExpectedException.none();
private File storeFolder;
private File linkedFolder;
@Before
public void setup() throws IOException
{
this.storeFolder = TestUtilities.createFolder();
}
@After
public void tearDown()
{
TestUtilities.delete(this.storeFolder);
if (this.linkedFolder != null)
{
TestUtilities.delete(this.linkedFolder);
}
}
@Test
public void unconfiguredWriteReadDelete() throws Exception
{
final FileContentStore store = this.createDefaultStore();
store.afterPropertiesSet();
Assert.assertTrue("Store should support write", store.isWriteSupported());
final String testText = generateText(SEED_PRNG.nextLong());
final Date dateBeforeWrite = new Date();
final ContentWriter writer = this.testIndividualWriteAndRead(store, testText);
final String contentUrl = writer.getContentUrl();
final DateFormat df = new SimpleDateFormat("yyyy/M/d/H/m", Locale.ENGLISH);
df.setTimeZone(TimeZone.getDefault());
final String expectedPattern = "^" + STORE_PROTOCOL + ContentStore.PROTOCOL_DELIMITER + df.format(dateBeforeWrite)
+ "/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\\.bin$";
Assert.assertTrue("Content URL did not match expected date-based pattern with UUID", contentUrl.matches(expectedPattern));
Assert.assertTrue("Content should have been deleted", store.delete(contentUrl));
final Path rootPath = this.storeFolder.toPath();
final long subPathCount = TestUtilities.walk(rootPath, (stream) -> {
return stream.filter((path) -> {
return !path.equals(rootPath);
}).count();
}, FileVisitOption.FOLLOW_LINKS);
Assert.assertEquals("Store path should not contain any elements after delete", 0, subPathCount);
}
@Test
public void dontDeleteEmptryDirs() throws Exception
{
final FileContentStore store = this.createDefaultStore();
store.setDeleteEmptyDirs(false);
store.afterPropertiesSet();
Assert.assertTrue("Store should support write", store.isWriteSupported());
final String testText = generateText(SEED_PRNG.nextLong());
final ContentWriter writer = this.testIndividualWriteAndRead(store, testText);
final String contentUrl = writer.getContentUrl();
Assert.assertTrue("Content should have been deleted", store.delete(contentUrl));
final Path rootPath = this.storeFolder.toPath();
final long subPathCount = TestUtilities.walk(rootPath, (stream) -> {
return stream.filter((path) -> {
return !path.equals(rootPath);
}).count();
}, FileVisitOption.FOLLOW_LINKS);
Assert.assertNotEquals("Store path should contain additional elements after delete without allowing empty directory deletion", 0,
subPathCount);
final long filesCount = TestUtilities.walk(rootPath, (stream) -> {
return stream.filter((path) -> {
return path.toFile().isFile();
}).count();
}, FileVisitOption.FOLLOW_LINKS);
Assert.assertEquals("Store path should not contain any content files after deletion", 0, filesCount);
}
// TODO Don't run test on Windows systems - no support for symbolic links
@Test
@Ignore
public void deleteEmptyParentsButNotSymbolicLinks() throws Exception
{
this.linkedFolder = TestUtilities.createFolder();
final DateFormat df = new SimpleDateFormat("yyyy/M/d", Locale.ENGLISH);
df.setTimeZone(TimeZone.getDefault());
final String relativePathForSymbolicLink = df.format(new Date());
final String relativePathForFolder = relativePathForSymbolicLink.substring(0, relativePathForSymbolicLink.lastIndexOf('/'));
final String linkName = relativePathForSymbolicLink.substring(relativePathForSymbolicLink.lastIndexOf('/') + 1);
final Path folderForLink = Files.createDirectories(this.storeFolder.toPath().resolve(relativePathForFolder));
final Path linkPath = folderForLink.resolve(linkName);
Files.createSymbolicLink(linkPath, this.linkedFolder.toPath());
final FileContentStore store = this.createDefaultStore();
store.afterPropertiesSet();
Assert.assertTrue("Store should support write", store.isWriteSupported());
final String testText = generateText(SEED_PRNG.nextLong());
final ContentWriter writer = this.testIndividualWriteAndRead(store, testText);
final String contentUrl = writer.getContentUrl();
Assert.assertTrue("Content should have been deleted", store.delete(contentUrl));
final Path linkedRootPath = this.linkedFolder.toPath();
final long linkedFolderSubPaths = TestUtilities.walk(linkedRootPath, (stream) -> {
return stream.filter((path) -> {
return !path.equals(linkedRootPath);
}).count();
}, FileVisitOption.FOLLOW_LINKS);
Assert.assertEquals("Linked folder should not contain additional elements after delete", 0, linkedFolderSubPaths);
Assert.assertTrue("Link should still exist after delete", Files.exists(linkPath));
}
@Test
public void predeterminedContentURL() throws Exception
{
final FileContentStore store = this.createDefaultStore();
store.afterPropertiesSet();
Assert.assertTrue("Store should support write", store.isWriteSupported());
final String testText = generateText(SEED_PRNG.nextLong());
final String dummyContentUrl = STORE_PROTOCOL + ContentStore.PROTOCOL_DELIMITER + "any/path/will/do";
final ContentWriter writer = this.testIndividualWriteAndRead(store, new ContentContext(null, dummyContentUrl), testText);
final String contentUrl = writer.getContentUrl();
Assert.assertEquals("Effective content URL did not match provided URL", dummyContentUrl, contentUrl);
}
@Test
public void wildcardContentURL() throws Exception
{
final FileContentStore store = this.createDefaultStore();
store.afterPropertiesSet();
Assert.assertTrue("Store should support write", store.isWriteSupported());
final String testText = generateText(SEED_PRNG.nextLong());
final String dummyContentUrl = StoreConstants.WILDCARD_PROTOCOL + ContentStore.PROTOCOL_DELIMITER + "any/path/will/do";
final String expectedContentUrl = STORE_PROTOCOL + ContentStore.PROTOCOL_DELIMITER + "any/path/will/do";
final ContentWriter writer = this.testIndividualWriteAndRead(store, new ContentContext(null, dummyContentUrl), testText);
final String contentUrl = writer.getContentUrl();
Assert.assertEquals("Effective content URL did not match expected URL", expectedContentUrl, contentUrl);
Assert.assertTrue("Wildcard-based content URL should have been reported as supported",
store.isContentUrlSupported(dummyContentUrl));
Assert.assertTrue("Wildcard-based content URL should have been reported as existing", store.exists(dummyContentUrl));
final ContentReader reader = store.getReader(dummyContentUrl);
Assert.assertNotNull("Wildcard-based content URL should have yielded a reader", reader);
Assert.assertTrue("Wildcard-based content URL should have yielded a reader to existing content", reader.exists());
final String readContent = reader.getContentString();
Assert.assertEquals("Content read from reader for wildcard-based content URL did not match written content", testText, readContent);
Assert.assertTrue("Content should have been deleted using wildcard-based content URL", store.delete(dummyContentUrl));
Assert.assertFalse(
"Content should not be reported as existing for explicit content URL after having been deleted via wildcard-based content URL",
store.exists(contentUrl));
}
@Test
public void readOnlyWrite()
{
final FileContentStore store = this.createDefaultStore();
store.setReadOnly(true);
store.afterPropertiesSet();
Assert.assertFalse("Store should not support write", store.isWriteSupported());
final String testText = generateText(SEED_PRNG.nextLong());
final String dummyContentUrl = STORE_PROTOCOL + ContentStore.PROTOCOL_DELIMITER + "any/path/will/do";
this.thrown.expect(UnsupportedOperationException.class);
this.testIndividualWriteAndRead(store, new ContentContext(null, dummyContentUrl), testText);
}
@Test
public void readOnlyDelete()
{
final FileContentStore store = this.createDefaultStore();
store.setReadOnly(true);
store.afterPropertiesSet();
Assert.assertFalse("Store should not support write", store.isWriteSupported());
final String dummyContentUrl = STORE_PROTOCOL + ContentStore.PROTOCOL_DELIMITER + "any/path/will/do";
this.thrown.expect(UnsupportedOperationException.class);
store.delete(dummyContentUrl);
}
private FileContentStore createDefaultStore()
{
final FileContentStore store = new FileContentStore();
store.setRootDirectory(this.storeFolder.getAbsolutePath());
store.setProtocol(STORE_PROTOCOL);
return store;
}
private ContentWriter testIndividualWriteAndRead(final FileContentStore fileContentStore, final String testText)
{
return this.testIndividualWriteAndRead(fileContentStore, new ContentContext(null, null), testText);
}
private ContentWriter testIndividualWriteAndRead(final FileContentStore fileContentStore, final ContentContext context,
final String testText)
{
return ContentStoreContext.executeInNewContext(() -> {
final ContentWriter writer = fileContentStore.getWriter(context);
writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
writer.setEncoding(StandardCharsets.UTF_8.name());
writer.setLocale(Locale.ENGLISH);
writer.putContent(testText);
final String contentUrl = writer.getContentUrl();
Assert.assertNotNull("Content URL was not set after writing content", contentUrl);
Assert.assertTrue("Content URL does not start with the configured protocol",
contentUrl.startsWith(STORE_PROTOCOL + ContentStore.PROTOCOL_DELIMITER));
Assert.assertTrue("Store does not report content URL to exist after writing content", fileContentStore.exists(contentUrl));
final String relativePath = contentUrl
.substring(contentUrl.indexOf(ContentStore.PROTOCOL_DELIMITER) + ContentStore.PROTOCOL_DELIMITER.length());
final Path rootPath = this.storeFolder.toPath();
final File file = rootPath.resolve(relativePath).toFile();
Assert.assertTrue("File should be stored in literal path from content URL", file.exists());
final ContentReader properReader = fileContentStore.getReader(contentUrl);
Assert.assertTrue("Reader was not returned for freshly written content", properReader != null);
Assert.assertTrue("Reader does not refer to existing file for freshly written content", properReader.exists());
// reader does not know about mimetype (provided via persisted ContentData at server runtime)
properReader.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
final String readText = properReader.getContentString();
Assert.assertEquals("Read content does not match written test content", testText, readText);
return writer;
});
}
private static String generateText(final long seed)
{
final Lorem lorem = new LoremIpsum(Long.valueOf(seed));
final String text = lorem.getParagraphs(5, 25);
return text;
}
}
| [
"axel.faust@acosix.org"
] | axel.faust@acosix.org |
91d2c60d5578082f8a4a46184666f44bd0a62f15 | ab845c8745a094b6e90da7b27fc8befc5e9bcca8 | /app/src/main/java/com/example/proydiseo/CarryOn/VistaCliente/EditPerfilC.java | d3e51e45fe4025f11f359cbf5f353343b9a22460 | [] | no_license | Akuseru3/COMovil | 195f5e3e2b4637f2704610c11fae84afcc6e1bf1 | 5fb944efa680de081ad3e831891333146eb401b0 | refs/heads/master | 2020-12-19T08:29:26.692670 | 2020-01-28T06:50:54 | 2020-01-28T06:50:54 | 235,681,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,316 | java | package com.example.proydiseo.CarryOn.VistaCliente;
import android.content.Intent;
import android.database.Cursor;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.proydiseo.CarryOn.Controlador.Validations;
import com.example.proydiseo.CarryOn.Modelo.Conexion;
import com.example.proydiseo.CarryOn.Modelo.ExtraTools;
import com.example.proydiseo.CarryOn.Modelo.GmailAPI;
import com.example.proydiseo.CarryOn.Modelo.UserData;
import com.example.proydiseo.R;
public class EditPerfilC extends AppCompatActivity {
private String correo;
private String nombre;
private String apellidos;
private String telefono;
private String fecha;
private EditText tvNombre;
private EditText tvApellidos;
private EditText tvTelefono;
private EditText tvD;
private EditText tvM;
private EditText tvA;
private EditText tvCode;
private EditText tvPass;
private EditText tvPassR;
private int result;
private String actualCode = "";
private Button btnSendCode;
private Button btnModGeneral;
private Button btnPassMod;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.edit_perfil_c);
Intent in = getIntent();
correo = in.getStringExtra("USER_MAIL");
nombre = in.getStringExtra("USER_NAME");
apellidos = in.getStringExtra("USER_LNAME");
telefono = in.getStringExtra("USER_PHONE");
fecha = in.getStringExtra("USER_BDAY");
tvNombre = findViewById(R.id.editTextNombre);
tvApellidos = findViewById(R.id.editTextApellidos);
tvTelefono = findViewById(R.id.editTextTelefono);
tvD = findViewById(R.id.editTextD);
tvM = findViewById(R.id.editTextM);
tvA = findViewById(R.id.editTextA);
tvCode = findViewById(R.id.editTextCode);
tvPass = findViewById(R.id.editTextPass);
tvPassR = findViewById(R.id.editTextPass4);
btnSendCode = findViewById(R.id.btnCodeMail);
btnSendCode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sendToMail();
}
});
btnModGeneral = findViewById(R.id.btnModGen);
btnModGeneral.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
validarDatosMod();
}
});
btnPassMod = findViewById(R.id.btnModPass);
btnPassMod.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
validarDatosContra();
}
});
setActualInfo();
}
private void setActualInfo(){
String[] result = fecha.split("-");
String dia = result[2];
String mes = result[1];
String año = result[0];
tvNombre.setText(nombre);
tvApellidos.setText(apellidos);
tvTelefono.setText(telefono);
tvD.setText(dia);
tvM.setText(mes);
tvA.setText(año);
}
private void sendToMail(){
actualCode = ExtraTools.generateCode();
System.out.println(actualCode);
new sendMail().execute();
}
private void validarDatosMod(){
String errores = "";
errores = Validations.validateUserMod(tvNombre.getText().toString(),tvApellidos.getText().toString(),tvD.getText().toString(),tvM.getText().toString(),tvA.getText().toString(),tvTelefono.getText().toString());
if(errores.equals("")){
new updateUsuario().execute();
}
else{
Toast.makeText(this, errores, Toast.LENGTH_SHORT).show();
}
}
private class sendMail extends AsyncTask<Object, Object, Cursor> {
@Override
protected Cursor doInBackground(Object... params) {
try
{
GmailAPI.sendEndMail(correo,actualCode,"RataKevin","8500");
return null;
}
catch (Exception e)
{ e.printStackTrace();
return null;}
}
@Override
protected void onPostExecute(Cursor result) {
btnSendCode.setText("Reenviar código");
}
}
private class updateUsuario extends AsyncTask<Object, Object, Cursor> {
@Override
protected Cursor doInBackground(Object... params) {
try
{
String fecha = tvA.getText().toString()+"-"+tvM.getText().toString()+"-"+tvD.getText().toString();
result = UserData.modifyUser(correo,tvNombre.getText().toString(),tvApellidos.getText().toString(),tvTelefono.getText().toString(),fecha);
return null;
}
catch (Exception e)
{ e.printStackTrace();
return null;}
}
@Override
protected void onPostExecute(Cursor result) {
finishMod();
}
}
private void finishMod(){
if(result==1){
Toast.makeText(this, "Se ha modificado la información con exito.", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, PerfilC.class);
intent.putExtra("USER_MAIL",correo);
startActivity(intent);
this.overridePendingTransition(0, 0);
finish();
}
else{
Toast.makeText(this, "No se pudo conectar con la base de datos", Toast.LENGTH_SHORT).show();
}
}
private void validarDatosContra(){
if(tvCode.getText().toString().equals(actualCode) && !actualCode.equals("")){
if(tvPass.getText().toString().equals(tvPassR.getText().toString()))
new updatePassword().execute();
else
Toast.makeText(this, "Las contraseñas no coinciden", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(this, "El codigo ingresado es incorrecto", Toast.LENGTH_SHORT).show();
}
}
private class updatePassword extends AsyncTask<Object, Object, Cursor> {
@Override
protected Cursor doInBackground(Object... params) {
try
{
result = UserData.modifyPassword(correo,tvPass.getText().toString());
return null;
}
catch (Exception e)
{ e.printStackTrace();
return null;}
}
@Override
protected void onPostExecute(Cursor result) {
finishModP();
}
}
private void finishModP(){
if(result==1){
Toast.makeText(this, "Se ha cambiado la contraseña con exito.", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, PerfilC.class);
intent.putExtra("USER_MAIL",correo);
startActivity(intent);
this.overridePendingTransition(0, 0);
finish();
}
else{
Toast.makeText(this, "No se pudo conectar con la base de datos", Toast.LENGTH_SHORT).show();
}
}
}
| [
"axel2799@hotmail.com"
] | axel2799@hotmail.com |
c010cd08c0c044f672ad5c9359a03032d98dc96a | dccb53561a7546b2c42db366cb476bc6ae973de1 | /itheima_spring_aop/src/main/java/com/itheima/proxy/cglib/ProxyTest.java | bcc0fe3d76a33812061f099303423da3a3bb6cf5 | [] | no_license | MyStudentGet/spring | 1c306989d6682001952ccbee97acaa6112c9a71b | 8c63ad4ccfacb930d7e91b80a0b22e70fa0100c7 | refs/heads/master | 2023-07-21T01:18:43.211771 | 2021-09-02T07:44:08 | 2021-09-02T07:44:08 | 355,438,618 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,739 | java | package com.itheima.proxy.cglib;
import org.springframework.cglib.proxy.Enhancer;
import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;
import java.lang.reflect.Method;
// 基于cglib的代理实现(目标对象没有接口时使用)
/*
一、创建目标对象
二、获得增强对象(切面类)
三、创建增强器
1、创建增强器
2、设置父类(目标类)
3、设置回调
四、创建代理对象(因为是父子关系,所以可以用目标对象去接)
*/
public class ProxyTest {
public static void main(String[] args) {
//创建目标对象
final Target target = new Target();
// 获得增强对象
final Advice advice = new Advice();
// 返回值就是动态生成的代理对象
//1、创建增强器
Enhancer enhancer = new Enhancer();
//2、设置父类(目标)
enhancer.setSuperclass(Target.class);
//3、设置回调
enhancer.setCallback(new MethodInterceptor() {
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
// 执行前置
advice.before();
//执行目标方法(要加强的方法)
Object invoke = method.invoke(target, args);
// 执行后置
advice.afterReturning();
return invoke;
}
});
//4、创建代理对象
//因为是父子关系,所以可以用目标对象类型去接
Target proxy = (Target) enhancer.create();
proxy.save();
}
}
| [
"2920936986@qq.com"
] | 2920936986@qq.com |
d59e01b0850b1a618f8515b587ca8fe1d8ef3086 | 16a2e514e014d1afd13f2cd5e0b5cf6029ba36bb | /platform-integration/test-automation-framework/org.wso2.carbon.automation.core/src/main/java/org/wso2/carbon/automation/core/context/securitycontext/Store.java | 8ca1f2e3683c4d9b3f41214cd026a282369653e8 | [] | no_license | Vishanth/platform | 0386ee91c506703e0c256a0e318a88b268f76f6f | e5ac79db4820b88b739694ded697384854a3afba | refs/heads/master | 2020-12-25T12:08:05.306968 | 2014-03-03T06:08:57 | 2014-03-03T06:08:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,333 | java | /*
*Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
*WSO2 Inc. licenses this file to you 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.wso2.carbon.automation.core.context.securitycontext;
/*
* parent class for the representations keystore and trustStore
*/
public class Store {
private String fileName;
private String type;
private String password;
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"dharshanaw@wso2.com@a5903396-d722-0410-b921-86c7d4935375"
] | dharshanaw@wso2.com@a5903396-d722-0410-b921-86c7d4935375 |
1a8fa364b23fd6977a7ce4c104c475b7c66e0ada | 1a11243f3a15d85c5a881d449057d8aa60352168 | /background/src/main/java/com/sast/user/security/CustomUserDetailsService.java | 240ee1dbe1e919adef3972fc7a89b41690b5caa2 | [] | no_license | itoshiko/dpi-sast-lab | d6b51d8ce5966394e86b5f56333dc104769de40b | 724a97a331c3045da88b02d3ecca4bdac6128812 | refs/heads/master | 2023-04-11T08:47:06.439427 | 2020-10-08T09:42:40 | 2020-10-08T09:42:40 | 283,254,285 | 1 | 0 | null | 2021-04-26T20:34:16 | 2020-07-28T15:32:55 | Java | UTF-8 | Java | false | false | 1,892 | java | package com.sast.user.security;
import com.sast.user.pojo.SysRole;
import com.sast.user.pojo.SysUser;
import com.sast.user.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.DisabledException;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection;
@Service("userDetailsService")
public class CustomUserDetailsService implements UserDetailsService {
private SysUserService userService;
@Autowired
public void setUserService(SysUserService userService) {
this.userService = userService;
}
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
Collection<GrantedAuthority> authorities = new ArrayList<>();
// 从数据库中取出用户信息
SysUser user = userService.selectByName(username);
// 判断用户是否存在
if(user == null) {
throw new UsernameNotFoundException("用户名不存在");
}
if(!user.isEnabled()) {
throw new UsernameNotFoundException("用户无效");
}
// 添加权限
for (SysRole sysRole: user.getSysRoles()) {
authorities.add(new SimpleGrantedAuthority(sysRole.getRoleName()));
}
// 返回UserDetails实现类
return new User(user.getUsername(), user.getPassword(), authorities);
}
}
| [
"tuhanz20121705@gmail.com"
] | tuhanz20121705@gmail.com |
42387d59ab5d5393840b34c6fb1da4ea65e9972f | eee834084287eaeb58804122473ac0032cb273f1 | /xmodule-common-support/src/main/java/com/penglecode/xmodule/common/util/ModelDecodeUtils.java | 6975f9882e45f9389feb60d4ef644855da5c1b80 | [
"Apache-2.0"
] | permissive | zhangwenchao2020/xmodule | d7726be3cc754216eb56752067418454a180e520 | 6e3f7711048904ec48875e2416d904bae5d90f1a | refs/heads/master | 2022-04-15T18:22:24.625990 | 2020-04-01T08:52:56 | 2020-04-01T08:52:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,155 | java | package com.penglecode.xmodule.common.util;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import com.penglecode.xmodule.common.support.BaseModel;
/**
* 数据模型中字段值解码
* 例如将字段中的 typeCode=1进行解码转义得到typeName="字面意义"
*
* @author pengpeng
* @date 2017年6月6日 下午4:45:57
* @version 1.0
*/
public class ModelDecodeUtils {
public static <T extends BaseModel<T>> T decodeModel(T model) {
return model != null ? model.decode() : null;
}
public static <T extends BaseModel<T>> List<T> decodeModel(List<T> modelList) {
Optional.ofNullable(modelList).ifPresent(models -> {
models.stream().forEach(model -> model.decode());
});
return modelList;
}
public static <T> T decodeModel(T model, Consumer<T> consumer) {
Optional.ofNullable(model).ifPresent(consumer);
return model;
}
public static <T> List<T> decodeModel(List<T> modelList, Consumer<T> consumer) {
Optional.ofNullable(modelList).ifPresent(models -> {
models.stream().forEach(consumer);
});
return modelList;
}
}
| [
"pengp@certusnet.com.cn"
] | pengp@certusnet.com.cn |
6696d265f61c273d15be6c25f42ba0cc6c889d06 | b63248e428faeee4e36308830c0632050d9f5223 | /app/src/main/java/com/example/test2_20200523/MainActivity.java | 5814446669e468815440ff6fcb64f88d75cda631 | [] | no_license | radenir/bluetooth-example | d155b8024bba57287cdc226d88710ef63c3253cd | 8262fd203ce7a5f634ea210defc061c8e8e8df4a | refs/heads/master | 2022-08-21T22:43:02.333783 | 2020-05-23T18:01:23 | 2020-05-23T18:01:23 | 266,390,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,941 | java | package com.example.test2_20200523;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.test2_20200523.bluetooth.BluetoothHandler;
public class MainActivity extends AppCompatActivity {
TextView helloWorldTextView;
Button helloWorldButton, buttonConnect, buttonDisconnect;
ImageView imageView;
BluetoothHandler bluetoothHandler;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bluetoothHandler = new BluetoothHandler("123456");
helloWorldTextView = findViewById(R.id.hello_world_textview);
helloWorldButton = findViewById(R.id.hello_world_button);
buttonConnect = findViewById(R.id.button_connect);
buttonDisconnect = findViewById(R.id.button_disconnect);
imageView = findViewById(R.id.itemImageView);
helloWorldTextView.setText("My first app!");
helloWorldButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
helloWorldTextView.setText("Changed text...");
imageView.setImageResource(R.drawable.ic_bluetooth_disabled);
}
});
buttonConnect.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
bluetoothHandler.connect();
bluetoothHandler.getDEVICE_ID();
}
});
buttonDisconnect.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
bluetoothHandler.disconnect();
bluetoothHandler.getDEVICE_ID();
}
});
}
}
| [
"radomski.adr@gmail.com"
] | radomski.adr@gmail.com |
fcf6580a2af16632915695d71bda43dc3b7a1250 | 44e7adc9a1c5c0a1116097ac99c2a51692d4c986 | /aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ConnectionNotification.java | 51701ee9ccf533a183986d00d6277814a166c127 | [
"Apache-2.0"
] | permissive | QiAnXinCodeSafe/aws-sdk-java | f93bc97c289984e41527ae5bba97bebd6554ddbe | 8251e0a3d910da4f63f1b102b171a3abf212099e | refs/heads/master | 2023-01-28T14:28:05.239019 | 2020-12-03T22:09:01 | 2020-12-03T22:09:01 | 318,460,751 | 1 | 0 | Apache-2.0 | 2020-12-04T10:06:51 | 2020-12-04T09:05:03 | null | UTF-8 | Java | false | false | 17,454 | java | /*
* Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
* <p>
* Describes a connection notification for a VPC endpoint or VPC endpoint service.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConnectionNotification" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ConnectionNotification implements Serializable, Cloneable {
/**
* <p>
* The ID of the notification.
* </p>
*/
private String connectionNotificationId;
/**
* <p>
* The ID of the endpoint service.
* </p>
*/
private String serviceId;
/**
* <p>
* The ID of the VPC endpoint.
* </p>
*/
private String vpcEndpointId;
/**
* <p>
* The type of notification.
* </p>
*/
private String connectionNotificationType;
/**
* <p>
* The ARN of the SNS topic for the notification.
* </p>
*/
private String connectionNotificationArn;
/**
* <p>
* The events for the notification. Valid values are <code>Accept</code>, <code>Connect</code>, <code>Delete</code>,
* and <code>Reject</code>.
* </p>
*/
private com.amazonaws.internal.SdkInternalList<String> connectionEvents;
/**
* <p>
* The state of the notification.
* </p>
*/
private String connectionNotificationState;
/**
* <p>
* The ID of the notification.
* </p>
*
* @param connectionNotificationId
* The ID of the notification.
*/
public void setConnectionNotificationId(String connectionNotificationId) {
this.connectionNotificationId = connectionNotificationId;
}
/**
* <p>
* The ID of the notification.
* </p>
*
* @return The ID of the notification.
*/
public String getConnectionNotificationId() {
return this.connectionNotificationId;
}
/**
* <p>
* The ID of the notification.
* </p>
*
* @param connectionNotificationId
* The ID of the notification.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionNotification withConnectionNotificationId(String connectionNotificationId) {
setConnectionNotificationId(connectionNotificationId);
return this;
}
/**
* <p>
* The ID of the endpoint service.
* </p>
*
* @param serviceId
* The ID of the endpoint service.
*/
public void setServiceId(String serviceId) {
this.serviceId = serviceId;
}
/**
* <p>
* The ID of the endpoint service.
* </p>
*
* @return The ID of the endpoint service.
*/
public String getServiceId() {
return this.serviceId;
}
/**
* <p>
* The ID of the endpoint service.
* </p>
*
* @param serviceId
* The ID of the endpoint service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionNotification withServiceId(String serviceId) {
setServiceId(serviceId);
return this;
}
/**
* <p>
* The ID of the VPC endpoint.
* </p>
*
* @param vpcEndpointId
* The ID of the VPC endpoint.
*/
public void setVpcEndpointId(String vpcEndpointId) {
this.vpcEndpointId = vpcEndpointId;
}
/**
* <p>
* The ID of the VPC endpoint.
* </p>
*
* @return The ID of the VPC endpoint.
*/
public String getVpcEndpointId() {
return this.vpcEndpointId;
}
/**
* <p>
* The ID of the VPC endpoint.
* </p>
*
* @param vpcEndpointId
* The ID of the VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionNotification withVpcEndpointId(String vpcEndpointId) {
setVpcEndpointId(vpcEndpointId);
return this;
}
/**
* <p>
* The type of notification.
* </p>
*
* @param connectionNotificationType
* The type of notification.
* @see ConnectionNotificationType
*/
public void setConnectionNotificationType(String connectionNotificationType) {
this.connectionNotificationType = connectionNotificationType;
}
/**
* <p>
* The type of notification.
* </p>
*
* @return The type of notification.
* @see ConnectionNotificationType
*/
public String getConnectionNotificationType() {
return this.connectionNotificationType;
}
/**
* <p>
* The type of notification.
* </p>
*
* @param connectionNotificationType
* The type of notification.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConnectionNotificationType
*/
public ConnectionNotification withConnectionNotificationType(String connectionNotificationType) {
setConnectionNotificationType(connectionNotificationType);
return this;
}
/**
* <p>
* The type of notification.
* </p>
*
* @param connectionNotificationType
* The type of notification.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConnectionNotificationType
*/
public ConnectionNotification withConnectionNotificationType(ConnectionNotificationType connectionNotificationType) {
this.connectionNotificationType = connectionNotificationType.toString();
return this;
}
/**
* <p>
* The ARN of the SNS topic for the notification.
* </p>
*
* @param connectionNotificationArn
* The ARN of the SNS topic for the notification.
*/
public void setConnectionNotificationArn(String connectionNotificationArn) {
this.connectionNotificationArn = connectionNotificationArn;
}
/**
* <p>
* The ARN of the SNS topic for the notification.
* </p>
*
* @return The ARN of the SNS topic for the notification.
*/
public String getConnectionNotificationArn() {
return this.connectionNotificationArn;
}
/**
* <p>
* The ARN of the SNS topic for the notification.
* </p>
*
* @param connectionNotificationArn
* The ARN of the SNS topic for the notification.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionNotification withConnectionNotificationArn(String connectionNotificationArn) {
setConnectionNotificationArn(connectionNotificationArn);
return this;
}
/**
* <p>
* The events for the notification. Valid values are <code>Accept</code>, <code>Connect</code>, <code>Delete</code>,
* and <code>Reject</code>.
* </p>
*
* @return The events for the notification. Valid values are <code>Accept</code>, <code>Connect</code>,
* <code>Delete</code>, and <code>Reject</code>.
*/
public java.util.List<String> getConnectionEvents() {
if (connectionEvents == null) {
connectionEvents = new com.amazonaws.internal.SdkInternalList<String>();
}
return connectionEvents;
}
/**
* <p>
* The events for the notification. Valid values are <code>Accept</code>, <code>Connect</code>, <code>Delete</code>,
* and <code>Reject</code>.
* </p>
*
* @param connectionEvents
* The events for the notification. Valid values are <code>Accept</code>, <code>Connect</code>,
* <code>Delete</code>, and <code>Reject</code>.
*/
public void setConnectionEvents(java.util.Collection<String> connectionEvents) {
if (connectionEvents == null) {
this.connectionEvents = null;
return;
}
this.connectionEvents = new com.amazonaws.internal.SdkInternalList<String>(connectionEvents);
}
/**
* <p>
* The events for the notification. Valid values are <code>Accept</code>, <code>Connect</code>, <code>Delete</code>,
* and <code>Reject</code>.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setConnectionEvents(java.util.Collection)} or {@link #withConnectionEvents(java.util.Collection)} if you
* want to override the existing values.
* </p>
*
* @param connectionEvents
* The events for the notification. Valid values are <code>Accept</code>, <code>Connect</code>,
* <code>Delete</code>, and <code>Reject</code>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionNotification withConnectionEvents(String... connectionEvents) {
if (this.connectionEvents == null) {
setConnectionEvents(new com.amazonaws.internal.SdkInternalList<String>(connectionEvents.length));
}
for (String ele : connectionEvents) {
this.connectionEvents.add(ele);
}
return this;
}
/**
* <p>
* The events for the notification. Valid values are <code>Accept</code>, <code>Connect</code>, <code>Delete</code>,
* and <code>Reject</code>.
* </p>
*
* @param connectionEvents
* The events for the notification. Valid values are <code>Accept</code>, <code>Connect</code>,
* <code>Delete</code>, and <code>Reject</code>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectionNotification withConnectionEvents(java.util.Collection<String> connectionEvents) {
setConnectionEvents(connectionEvents);
return this;
}
/**
* <p>
* The state of the notification.
* </p>
*
* @param connectionNotificationState
* The state of the notification.
* @see ConnectionNotificationState
*/
public void setConnectionNotificationState(String connectionNotificationState) {
this.connectionNotificationState = connectionNotificationState;
}
/**
* <p>
* The state of the notification.
* </p>
*
* @return The state of the notification.
* @see ConnectionNotificationState
*/
public String getConnectionNotificationState() {
return this.connectionNotificationState;
}
/**
* <p>
* The state of the notification.
* </p>
*
* @param connectionNotificationState
* The state of the notification.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConnectionNotificationState
*/
public ConnectionNotification withConnectionNotificationState(String connectionNotificationState) {
setConnectionNotificationState(connectionNotificationState);
return this;
}
/**
* <p>
* The state of the notification.
* </p>
*
* @param connectionNotificationState
* The state of the notification.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConnectionNotificationState
*/
public ConnectionNotification withConnectionNotificationState(ConnectionNotificationState connectionNotificationState) {
this.connectionNotificationState = connectionNotificationState.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getConnectionNotificationId() != null)
sb.append("ConnectionNotificationId: ").append(getConnectionNotificationId()).append(",");
if (getServiceId() != null)
sb.append("ServiceId: ").append(getServiceId()).append(",");
if (getVpcEndpointId() != null)
sb.append("VpcEndpointId: ").append(getVpcEndpointId()).append(",");
if (getConnectionNotificationType() != null)
sb.append("ConnectionNotificationType: ").append(getConnectionNotificationType()).append(",");
if (getConnectionNotificationArn() != null)
sb.append("ConnectionNotificationArn: ").append(getConnectionNotificationArn()).append(",");
if (getConnectionEvents() != null)
sb.append("ConnectionEvents: ").append(getConnectionEvents()).append(",");
if (getConnectionNotificationState() != null)
sb.append("ConnectionNotificationState: ").append(getConnectionNotificationState());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ConnectionNotification == false)
return false;
ConnectionNotification other = (ConnectionNotification) obj;
if (other.getConnectionNotificationId() == null ^ this.getConnectionNotificationId() == null)
return false;
if (other.getConnectionNotificationId() != null && other.getConnectionNotificationId().equals(this.getConnectionNotificationId()) == false)
return false;
if (other.getServiceId() == null ^ this.getServiceId() == null)
return false;
if (other.getServiceId() != null && other.getServiceId().equals(this.getServiceId()) == false)
return false;
if (other.getVpcEndpointId() == null ^ this.getVpcEndpointId() == null)
return false;
if (other.getVpcEndpointId() != null && other.getVpcEndpointId().equals(this.getVpcEndpointId()) == false)
return false;
if (other.getConnectionNotificationType() == null ^ this.getConnectionNotificationType() == null)
return false;
if (other.getConnectionNotificationType() != null && other.getConnectionNotificationType().equals(this.getConnectionNotificationType()) == false)
return false;
if (other.getConnectionNotificationArn() == null ^ this.getConnectionNotificationArn() == null)
return false;
if (other.getConnectionNotificationArn() != null && other.getConnectionNotificationArn().equals(this.getConnectionNotificationArn()) == false)
return false;
if (other.getConnectionEvents() == null ^ this.getConnectionEvents() == null)
return false;
if (other.getConnectionEvents() != null && other.getConnectionEvents().equals(this.getConnectionEvents()) == false)
return false;
if (other.getConnectionNotificationState() == null ^ this.getConnectionNotificationState() == null)
return false;
if (other.getConnectionNotificationState() != null && other.getConnectionNotificationState().equals(this.getConnectionNotificationState()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getConnectionNotificationId() == null) ? 0 : getConnectionNotificationId().hashCode());
hashCode = prime * hashCode + ((getServiceId() == null) ? 0 : getServiceId().hashCode());
hashCode = prime * hashCode + ((getVpcEndpointId() == null) ? 0 : getVpcEndpointId().hashCode());
hashCode = prime * hashCode + ((getConnectionNotificationType() == null) ? 0 : getConnectionNotificationType().hashCode());
hashCode = prime * hashCode + ((getConnectionNotificationArn() == null) ? 0 : getConnectionNotificationArn().hashCode());
hashCode = prime * hashCode + ((getConnectionEvents() == null) ? 0 : getConnectionEvents().hashCode());
hashCode = prime * hashCode + ((getConnectionNotificationState() == null) ? 0 : getConnectionNotificationState().hashCode());
return hashCode;
}
@Override
public ConnectionNotification clone() {
try {
return (ConnectionNotification) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
cd1e479019018094f8eeb0bf9da1f9ead49f22ca | a48c761d09f1d4db3e96af4331d4afb6aa5934d3 | /src/java/ru/ifmo/eshop/servlets/LabelServlet.java | 1983d96ec5e1bbb43ff348a90af4bdd731fe60d8 | [] | no_license | marwinxxii/eshop | b3a7608ae1a040df492c251ad02bc34933066537 | 7e3a3608c2d69955f12c4013d0626170ff891e9d | refs/heads/master | 2020-12-24T14:45:02.462987 | 2011-06-05T22:06:24 | 2011-06-05T22:06:24 | 1,567,863 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,106 | java | package ru.ifmo.eshop.servlets;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import ru.ifmo.eshop.Eshop;
import ru.ifmo.eshop.storage.Label;
import ru.ifmo.eshop.storage.StorageManager;
/**
*
* @author alex
*/
public class LabelServlet extends HttpServlet {
/**
* Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
}
/**
* Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
//TODO check user role
String act=request.getParameter("act");
boolean add=true;
boolean delete=false;
if (act!=null && act.equals("save")) {
add=false;
} else if (act!=null && act.equals("del")) {
delete=true;
add=false;
}
boolean error=false;
String title=null;
String country=null;
PrintWriter writer=response.getWriter();
int ids[]=null;
if (!delete) {
title=request.getParameter("title");
country=request.getParameter("country");
if (title==null || title.isEmpty()) {
error=true;
writer.println("Title have to be set");
} else if (title.length()>Label.TITLE_LENGTH) {
error=true;
writer.println("Title is too long");
}
if (country!=null && country.length()>Label.COUNTRY_LENGTH) {
error=true;
writer.println("Country is too long");
}
/*if (error) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}*/
} else {
String genres=request.getParameter("ids");
if(genres==null || genres.isEmpty()) {
error=true;
} else {
int i=0;
String gs[]=genres.split(",");
ids=new int[gs.length];
for (String g:gs) {
ids[i++]=Integer.parseInt(g);
}
}
}
int id=0;
if (!add && !delete) {
String sid=request.getParameter("id");
if (sid==null || sid.isEmpty()) {
error=true;
writer.println("ID is null");
} else {
try {
id=Integer.parseInt(sid);
if (id<=0) error=true;
writer.println("Wrong id");
} catch (NumberFormatException e) {
error=true;
}
}
}
if (error) {
//response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
try {
StorageManager sm = Eshop.getStorageManager();
if (add) {
sm.addLabel(title,country);
} else if (!delete) {
sm.updateLabel(id, title, country);
} else {
//TODO optimization
for (int i:ids) {
sm.deleteLabel(i);
}
}
sm.close();
response.sendRedirect("/admin/labels.jsp");
//} catch (ClassNotFoundException ex) {
} catch (Exception ex) {
//TODO logging and exceptions
ex.printStackTrace();
//response.sendError(HttpServletResponse.SC_BAD_GATEWAY);
Cookie c=new Cookie("errorCode", "1");
c.setPath("/admin");
response.addCookie(c);
c=new Cookie("return","/admin/labels.jsp?act="+act+"&id="+id);
c.setPath("/admin");
response.addCookie(c);
response.sendRedirect("/admin/error.jsp");
}/* catch (SQLException ex) {
ex.printStackTrace();
//response.sendError(HttpServletResponse.SC_BAD_GATEWAY);
}*/
}
/**
* Returns a short description of the servlet.
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Servlet for adding/editing labels";
}
}
| [
"marwinxxii@gmail.com"
] | marwinxxii@gmail.com |
5048c165fb27922a7da8c6d8bd7efee52730e7b5 | 92b7cf18097dae9de957f17055713594e01d75fb | /10. Room-test/java/app/src/main/java/com/dicoding/academies/ui/bookmark/BookmarkFragment.java | 596545a02512c27a23a4cba1dc599dee8924f9b8 | [] | no_license | faridrama123/MyAndroidJetpack | bc90fa4519f530438cee24b45991c74fb96332ff | 7122b4a94e9d8002ffec2037959a5b66c5faf3f9 | refs/heads/master | 2023-07-01T23:15:07.215937 | 2021-08-08T06:50:38 | 2021-08-08T06:50:38 | 332,739,965 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,886 | java | package com.dicoding.academies.ui.bookmark;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ShareCompat;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.dicoding.academies.data.source.local.entity.CourseEntity;
import com.dicoding.academies.databinding.FragmentBookmarkBinding;
import com.dicoding.academies.viewmodel.ViewModelFactory;
/**
* A simple {@link Fragment} subclass.
*/
public class BookmarkFragment extends Fragment implements BookmarkFragmentCallback {
private FragmentBookmarkBinding fragmentBookmarkBinding;
public BookmarkFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
fragmentBookmarkBinding = FragmentBookmarkBinding.inflate(inflater);
return fragmentBookmarkBinding.getRoot();
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (getActivity() != null) {
ViewModelFactory factory = ViewModelFactory.getInstance(getActivity());
BookmarkViewModel viewModel = new ViewModelProvider(this, factory).get(BookmarkViewModel.class);
BookmarkAdapter adapter = new BookmarkAdapter(this);
fragmentBookmarkBinding.progressBar.setVisibility(View.VISIBLE);
viewModel.getBookmarks().observe(this, courses -> {
fragmentBookmarkBinding.progressBar.setVisibility(View.GONE);
adapter.setCourses(courses);
adapter.notifyDataSetChanged();
});
fragmentBookmarkBinding.rvBookmark.setLayoutManager(new LinearLayoutManager(getContext()));
fragmentBookmarkBinding.rvBookmark.setHasFixedSize(true);
fragmentBookmarkBinding.rvBookmark.setAdapter(adapter);
}
}
@Override
public void onShareClick(CourseEntity course) {
if (getActivity() != null) {
String mimeType = "text/plain";
ShareCompat.IntentBuilder
.from(getActivity())
.setType(mimeType)
.setChooserTitle("Bagikan aplikasi ini sekarang.")
.setText(String.format("Segera daftar kelas %s di dicoding.com", course.getTitle()))
.startChooser();
}
}
@Override
public void onDestroy() {
super.onDestroy();
fragmentBookmarkBinding = null;
}
} | [
"systemcalls915@gmail.com"
] | systemcalls915@gmail.com |
b5b7370ae5074c60e8764476e39ac74edf75e282 | c02b5da9a5284780d78dbd401e25a0cde298dc96 | /mebatis/src/main/java/cn/com/mebatis/v2/plugin/Plugin.java | b2180ed9bca03eaf7590f5e9ed1264c37ef18153 | [] | no_license | gaopengchao666/mybatis | df4d156a8f183192eaa7ad3d222de996aa6616c2 | f38d1e7679b1c1f247f3d12e426ac480276a06af | refs/heads/master | 2020-05-17T13:12:03.574793 | 2019-05-06T11:51:44 | 2019-05-06T11:51:44 | 183,730,086 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,796 | java | package cn.com.mebatis.v2.plugin;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import cn.com.mebatis.v2.annotation.Intercepts;
/**
* 代理类,用于代理被拦截对象
* 同时提供了创建代理类的方法
*/
public class Plugin implements InvocationHandler {
private Object target;
private Interceptor interceptor;
/**
*
* @param target 被代理对象
* @param interceptor 拦截器(插件)
*/
public Plugin(Object target, Interceptor interceptor) {
this.target = target;
this.interceptor = interceptor;
}
/**
* 对被代理对象进行代理,返回代理类
* @param obj
* @param interceptor
* @return
*/
public static Object wrap(Object obj, Interceptor interceptor) {
Class clazz = obj.getClass();
return Proxy.newProxyInstance(clazz.getClassLoader(), clazz.getInterfaces(), new Plugin(obj, interceptor));
}
/**
*
* @param proxy
* @param method
* @param args
* @return
* @throws Throwable
*/
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
// 自定义的插件上有@Intercepts注解,指定了拦截的方法
if (interceptor.getClass().isAnnotationPresent(Intercepts.class)) {
// 如果是被拦截的方法,则进入自定义拦截器的逻辑
if (method.getName().equals(interceptor.getClass().getAnnotation(Intercepts.class).value())) {
return interceptor.intercept(new Invocation(target, method, args));
}
}
// 非被拦截方法,执行原逻辑
return method.invoke(target, method, args);
}
}
| [
"Administrator@gaopengchao"
] | Administrator@gaopengchao |
039db6ce8bfc3abbffbafcea312dfa9e2d79a0f0 | f5c36f1f295fa29ed916c03213d50f7ff52c706f | /src/main/java/com/CarRental/dao/clientDao/ClientDaoImpl.java | 377521df707f94d7a660da9589790f271f8c0343 | [] | no_license | SKlimczuk/CarRentalProject | 41b11585441a3f586d40c1e62ec23a4b139e2b94 | 5c28c7c044a6e21d2fccfc49f3dc73ff46ddb944 | refs/heads/master | 2020-03-07T01:48:03.661163 | 2018-03-28T20:29:47 | 2018-03-28T20:29:47 | 110,351,203 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,278 | java | package com.CarRental.dao.clientDao;
import com.CarRental.dao.DbConnection;
import com.CarRental.model.Client;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
public class ClientDaoImpl implements ClientDao {
Connection connection = DbConnection.getInstance().getConnection();
@Override
public void add(Client client) {
try {
PreparedStatement prep = connection.prepareStatement(
"INSERT INTO Client (person_id, driving_license) VALUES (?,?)");
prep.setInt(1, client.getPerson_id());
prep.setInt(2, client.getDriving_license());
prep.execute();
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
public void update(Client client) {
try {
PreparedStatement prep = connection.prepareStatement(
"UPDATE Client SET person_id=?, driving_license=? WHERE id=?");
prep.setInt(1, client.getPerson_id());
prep.setInt(2, client.getDriving_license());
prep.setInt(3, client.getId());
prep.execute();
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
public void delete(int id) {
try {
PreparedStatement prep = connection.prepareStatement(
"DELETE FROM Client WHERE person_id=?");
prep.setInt(1,id);
prep.execute();
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
public List<Client> getAll() {
try {
PreparedStatement prep = connection.prepareStatement(
"SELECT id, person_id,driving_license FROM Client");
ResultSet rs = prep.executeQuery();
List<Client> clientList = new ArrayList<>();
while (rs.next())
{
clientList.add(Client
.builder()
.id(rs.getInt(1))
.person_id(rs.getInt(2))
.driving_license(rs.getInt(3))
.build());
}
return clientList;
} catch (SQLException e) {
e.printStackTrace();
}
return null;
}
@Override
public Optional<Client> getOne(int id) {
try {
PreparedStatement prep = connection.prepareStatement(
"SELECT id, person_id,driving_license FROM Client WHERE id=?");
prep.setInt(1,id);
ResultSet rs = prep.executeQuery();
while (rs.next())
{
return Optional.of(Client
.builder()
.id(rs.getInt(1))
.person_id(rs.getInt(2))
.driving_license(rs.getInt(3))
.build());
}
} catch (SQLException e) {
e.printStackTrace();
}
return Optional.empty();
}
}
| [
"klimczukszymon@gmail.com"
] | klimczukszymon@gmail.com |
b1112e648e1887ccf25f06845bba5958bbb8cad8 | 7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b | /Crawler/data/BaseObject.java | e8186d4b878ab9dc7a7135b1e6959ac6be7d85da | [] | no_license | NayrozD/DD2476-Project | b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0 | 94dfb3c0a470527b069e2e0fd9ee375787ee5532 | refs/heads/master | 2023-03-18T04:04:59.111664 | 2021-03-10T15:03:07 | 2021-03-10T15:03:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 864 | java | 23
https://raw.githubusercontent.com/WeBankFinTech/Exchangis/master/modules/executor/engine/datax/datax-core/src/main/java/com/alibaba/datax/common/base/BaseObject.java
package com.alibaba.datax.common.base;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class BaseObject {
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this, false);
}
@Override
public boolean equals(Object object) {
return EqualsBuilder.reflectionEquals(this, object, false);
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this,
ToStringStyle.MULTI_LINE_STYLE);
}
}
| [
"veronika.cucorova@gmail.com"
] | veronika.cucorova@gmail.com |
02d0bd49477e7224a136abbcc0406bf7a15b225d | c3ee376ffa3814a34a1737412d24a3d6fba0a2a5 | /src/com/melissaluna/java/Square.java | 3620324b1afa4495a14eb7b8db5b8f244358f770 | [] | no_license | Melissa-Luna/Figuras | 3ab0d29021d684cc72ef4b4c5d06769c92f73fd1 | 318cbeb650d5d6fbabb3ca030b0d1425b004e005 | refs/heads/master | 2023-01-11T02:56:45.476634 | 2020-11-10T02:51:02 | 2020-11-10T02:51:02 | 311,527,376 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 649 | java | package com.melissaluna.java;
import java.util.Scanner;
public class Square implements Shape {
protected double lado;
public Square (double lado){
this.lado = lado;
}
public Square() {
System.out.println("Ingresa el Valor del lado");
Scanner scanner = new Scanner(System.in);
lado = scanner.nextDouble();
}
public void setLado(double lado){
this.lado = lado;
}
public double getLado(){
return lado;
}
@Override
public double area() {
return lado * lado;
}
@Override
public double perimeter() {
return lado * 4;
}
}
| [
"melisaluna21@outlook.com"
] | melisaluna21@outlook.com |
3cd4082b71ebe92d94917390d37ca3e0cf87a775 | d799a4bc1b00200d3589060cc5624ccfdca4d885 | /fisa-backend/src/main/java/de/fraunhofer/iosb/ilt/fisabackend/model/definitions/FisaObjectDefinition.java | c55ffa850177ca49978206592fad9efcade39bec | [
"MIT"
] | permissive | FISA-Team/FISA | 0e0142cb971fdc7d250d8b7abe7030dc41c5fb04 | 0508841e70aaa66220e75016cf1166647184b02a | refs/heads/master | 2023-01-02T10:59:17.366300 | 2020-10-23T16:32:57 | 2020-10-23T16:32:57 | 294,176,043 | 0 | 2 | MIT | 2020-10-23T16:32:59 | 2020-09-09T17:00:05 | TypeScript | UTF-8 | Java | false | false | 5,913 | java | package de.fraunhofer.iosb.ilt.fisabackend.model.definitions;
import java.util.List;
/**
* The FisaObjectDefinition defines a generic object of a use-case.
*/
public class FisaObjectDefinition {
private String name;
private String infoText;
private boolean isTopLayer;
private String mapsTo;
private List<FisaObjectAttributeDefinition> attributes;
private ExampleData exampleData;
private ChildDefinition[] children;
private String[] positionAttributes;
private String caption;
private boolean isNotReusable;
/**
* The default constructor of FisaObjectDefinition.
*/
public FisaObjectDefinition() {
}
/**
* Instantiates a FisaObjectDefinition.
* @param name Name of the FisaObjectDefinition
* @param infoText Informational text about the FisaObjectDefinition
* @param isTopLayer Boolean to flag, if objects of this definition are on top of the project hierarchy
* @param mapsTo Name of the entity in the SensorThings-API the FisaObjectDefinition maps to
* @param attributes List of FisaObjectAttributeDefinition
* @param exampleData Exemplary data of FisaObjectDefinition
* @param children List of child definitions
* @param positionAttributes coordinates of a position of format: [longitude, latitude]
* @param caption Contains caption to display to users
* @param isNotReusable Boolean flag, whether this attribute can be used multiple times
*/
public FisaObjectDefinition(
String name,
String infoText,
boolean isTopLayer,
String mapsTo,
List<FisaObjectAttributeDefinition> attributes,
ExampleData exampleData,
ChildDefinition[] children,
String[] positionAttributes,
String caption,
boolean isNotReusable) {
this.name = name;
this.infoText = infoText;
this.isTopLayer = isTopLayer;
this.mapsTo = mapsTo;
this.attributes = attributes;
this.exampleData = exampleData;
this.children = children;
this.positionAttributes = positionAttributes;
this.caption = caption;
this.isNotReusable = isNotReusable;
}
/**
* @return The child-definitions of this ObjectDefinition
*/
public ChildDefinition[] getChildren() {
return children;
}
/**
* @return The name of the described object
*/
public String getName() {
return this.name;
}
/**
* @return The info-text, explaining this object in more detail
*/
public String getInfoText() {
return this.infoText;
}
/**
* @return Whether the object can appear at the project-root
*/
public boolean getIsTopLayer() {
return this.isTopLayer;
}
/**
* @return The corresponding SensorThings-API entity
*/
public String getMapsTo() {
return this.mapsTo;
}
/**
* @return All attributes the objects has
*/
public List<FisaObjectAttributeDefinition> getAttributes() {
return this.attributes;
}
/**
* @return The definition of example-data
*/
public ExampleData getExampleData() {
return this.exampleData;
}
/**
* @return - the position attributes
*/
public String[] getPositionAttributes() {
return positionAttributes;
}
/**
* @return - the caption
*/
public String getCaption() {
return caption;
}
/**
* @return Boolean flag, to signal if attribute can be used multiple times
*/
public boolean getIsNotReusable() {
return isNotReusable;
}
/**
* Sets the name of the described object.
*
* @param name name of described object
*/
public void setName(String name) {
this.name = name;
}
/**
* Sets the info-text for the user.
*
* @param infoText information text for the user
*/
public void setInfoText(String infoText) {
this.infoText = infoText;
}
/**
* Sets whether the object can appear at the root of the project.
*
* @param isTopLayer boolean flag
*/
public void setIsTopLayer(boolean isTopLayer) {
this.isTopLayer = isTopLayer;
}
/**
* Sets the corresponding SensorThings-API entity.
*
* @param mapsTo Corresponding SensorThings-API entity
*/
public void setMapsTo(String mapsTo) {
this.mapsTo = mapsTo;
}
/**
* Sets the attributes-definitions of the object-definition.
*
* @param attributes attribute definitions
*/
public void setAttributes(List<FisaObjectAttributeDefinition> attributes) {
this.attributes = attributes;
}
/**
* Sets the children of the definition.
*
* @param children Children
*/
public void setChildren(ChildDefinition[] children) {
this.children = children;
}
/**
* Sets the definition of the example-data.
*
* @param exampleData Example-data
*/
public void setExampleData(ExampleData exampleData) {
this.exampleData = exampleData;
}
/**
* Sets the positionAttributes.
*
* @param positionAttributes New coordinates of format: [longitude, latitude]
*/
public void setPositionAttributes(String[] positionAttributes) {
this.positionAttributes = positionAttributes;
}
/**
* Sets caption.
*
* @param caption New caption
*/
public void setCaption(String caption) {
this.caption = caption;
}
/**
* Sets whether objects of this definition can be used multiple times in a project
*
* @param notReusable New boolean value
*/
public void setIsNotReusable(boolean notReusable) {
isNotReusable = notReusable;
}
}
| [
"max.streicher@campusjaeger.de"
] | max.streicher@campusjaeger.de |
eb4bb9699bcb71c83d2b167b654d0bd15875915e | 554bff8877dd4c6c05411ab77265c14eea0decc2 | /app/src/main/java/com/example/admin/fashionstyle/LoginActivity.java | eb5b5afb898800682ba78363345b63537e1761b4 | [] | no_license | litalopaets/FashionStyle | 3b1916cb6735908468bbd769d6362d54d15dcc8a | 43a4760790847e1897081f5e3c1039a7ff2e3678 | refs/heads/master | 2020-05-02T21:04:03.916136 | 2019-07-31T18:55:29 | 2019-07-31T18:55:29 | 178,209,489 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,326 | java | package com.example.admin.fashionstyle;
import android.app.ProgressDialog;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.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.TextView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
public class LoginActivity extends AppCompatActivity {
EditText email,password;
Button login;
TextView txt_signup;
FirebaseAuth auth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
email = findViewById(R.id.email);
password = findViewById(R.id.password);
login = findViewById(R.id.login);
txt_signup = findViewById(R.id.txt_signup);
auth = FirebaseAuth.getInstance();
txt_signup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(LoginActivity.this, SignUpActivity.class));
}
});
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final ProgressDialog pd = new ProgressDialog(LoginActivity.this);
pd.setMessage("Please Wait...");
pd.show();
String str_email = email.getText().toString();
String str_password = password.getText().toString();
if (TextUtils.isEmpty(str_email) || TextUtils.isEmpty(str_password)) {
Toast.makeText(LoginActivity.this, "All fields are rewuired!", Toast.LENGTH_SHORT).show();
} else {
auth.signInWithEmailAndPassword(str_email, str_password)
.addOnCompleteListener(LoginActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child("Users")
.child(auth.getCurrentUser().getUid());
reference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
pd.dismiss();
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
finish();
}
@Override
public void onCancelled(DatabaseError databaseError) {
pd.dismiss();
}
});
} else {
pd.dismiss();
Toast.makeText(LoginActivity.this, "Authentication failed!", Toast.LENGTH_SHORT).show();
}
}
});
}
}
});
}
}
| [
"leibman.daniel@gmail.com"
] | leibman.daniel@gmail.com |
3a63226a07a2ed9959271a7279539cb0742572f4 | 2851384b67fc053a6ec8bb32fe366f328be782b4 | /iqvia_demos/productapp/src/main/java/com/iqvia/dao/ProductDaoImpl.java | 7713b43a621020921b63fbd0ac2cfc673aa0834c | [] | no_license | ullasnaik/FullstackProjects | 3869becd021702544dbfa5785a43aac4f6eaf5ad | d23a7e143756a5cff7a38bc6c8730e776d123a2e | refs/heads/main | 2022-12-30T01:52:13.202058 | 2020-10-21T11:13:39 | 2020-10-21T11:13:39 | 305,998,267 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,061 | java | package com.iqvia.dao;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.dao.model.Product;
@Repository
public class ProductDaoImpl implements ProductDao {
private static List<Product> productRepository = new ArrayList<>();
@Override
public Product addProduct(Product product) {
productRepository.add(product);
return product;
}
@Override
public Product getProduct(int productCode) {
return null;
}
@Override
public List<Product> getProducts() {
return productRepository;
}
@Override
public List<Product> getProductsByCategory(String category) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean deleteProduct(int prodCode) {
Iterator<Product> iterator = productRepository.iterator();
boolean found = false;
while (iterator.hasNext()) {
Product product = iterator.next();
if (product.getProdCode() == prodCode) {
iterator.remove();
found = true;
break;
}
}
return found;
}
}
| [
"naik.ullas@gmail.com"
] | naik.ullas@gmail.com |
6a4f9ff840b8634f57e9fb2de979979926c856d1 | 600f9c547a0f862053552c16c252a359a0d6c7a3 | /TestCustomerOrders.java | ea38d81a82aa1b066ba77b264dc489e592215b85 | [] | no_license | medesigndd/Appman-Test-How-much-it-can-hold | d498068b2e1e0cf4d224709c381fad84e439d8a7 | 33a9e2be435963cc4d1743eee40d686dcdca2fb8 | refs/heads/master | 2022-03-02T08:59:29.468656 | 2019-09-17T09:15:49 | 2019-09-17T09:15:49 | 209,009,927 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,901 | java | package Ass8;
public class CustomerOrder {
//declare variables and arrays
public final int MAX_CAPACITY = 20;
private long orderId;
private String customerName;
private long customerId;
private long[] productId = new long[MAX_CAPACITY];
private double[] productCost = new double[MAX_CAPACITY];
int size = 0;
//constructor
public CustomerOrder(long orderId, String customerName, long customerId) {
this.orderId = orderId;
this.customerName = customerName;
this.customerId = customerId;
}
public boolean addItem(long productid, double productcost) {
//declare an boolean variable
boolean validOrder;
if(size < MAX_CAPACITY) { //if the size is below the max capacity
validOrder = true; //set to true
//populate the array elements
productId[size] = productid;
productCost[size] = productcost;
//increase size by 1
size++;
}
else {
validOrder = false; //set to false
}
return validOrder;
}
public double getOrderCost() {
//declare an accumulator
double sum = 0;
for(int i = 0; i < getNumberOfItems(); i++) { //loop
//add cost to accumulator
sum += productCost[i];
}
return sum;
}
public int getNumberOfItems() {
return size + 1; //return a value
}
public void printOrderInfo() {
//print the info
System.out.println("Order ID: " + orderId);
System.out.println("Customer Name: " + customerName);
System.out.println("Customer ID: " + customerId);
System.out.println("Order Cost: $" + getOrderCost());
System.out.println("Item\tCost");
for(int i = 0; i < getNumberOfItems() - 1; i++) {
System.out.println(productId[i] + "\t$" + productCost[i]);
}
}
public static void main(String[] args) {
//declare an object
CustomerOrder order1 = new CustomerOrder(1, "Billy Bob", 1);
//add 2 items
order1.addItem(23, 3.45);
order1.addItem(36, 4.47);
//print info
order1.printOrderInfo();
}
} | [
"medesigndd@gmail.com"
] | medesigndd@gmail.com |
c46b51e75de1f3adbfbd3cc738fbb2e6ae2a1bd5 | 6238c38a7dd8d922482b669bdac300ef8d347aca | /app/src/main/java/com/ue/uebook/LoginActivity/Pojo/LoginBody.java | eccb73d786192404389e6c643c4415bf47db0d85 | [] | no_license | vansh28/UEbook | 9736a465cab56562bfb5b0993108dd4f7643620f | 3697d468cdb36d695a5c7af65ad07af9c172dadc | refs/heads/master | 2020-07-17T16:12:42.109421 | 2020-04-10T12:54:32 | 2020-04-10T12:54:32 | 206,050,687 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | package com.ue.uebook.LoginActivity.Pojo;
public class LoginBody {
private String user_name;
private String password;
public LoginBody(String email, String password) {
this.user_name = email;
this.password = password;
}
}
| [
"vansh@seoessence.com"
] | vansh@seoessence.com |
2766dde5ffee8fbd44e43e9e1ed29113bb9a48eb | e975947fdeefef12f8227232da08c59a6250f43f | /samples/counter/impl/src/main/java/com/counter/HashMapResourceHome.java | 7993fba2f83e351952300177a7b7ed4686f0f942 | [] | no_license | turtlebender/gt5 | 7490fc7837fc741b9ba23ce6240960af474cc1cb | f03c0cd6a50d74c886531d4f04008452d3bc715e | refs/heads/master | 2022-12-23T05:47:55.208101 | 2009-02-13T15:27:43 | 2009-02-13T15:27:43 | 111,295 | 1 | 0 | null | 2022-12-15T23:27:49 | 2009-01-20T20:33:15 | Java | UTF-8 | Java | false | false | 528 | java | package com.counter;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
public class HashMapResourceHome<T,V> {
private Map<T,V> resources = new HashMap<T,V>();
public Collection<T> getIds(){
return resources.keySet();
}
public void addResource(T id, V resource){
this.resources.put(id, resource);
}
public V findResource(T id){
return this.resources.get(id);
}
public void deleteResource(T id){
this.resources.remove(id);
}
}
| [
"trhowe@uchicago.edu"
] | trhowe@uchicago.edu |
45d6b34df638f0717d6563337dcf4a863489527d | 9735bcb65420b8c19c1d1e5bd87df0b874ccccd9 | /ch22_prj1_MovieRatings_classDemo/src/business/MovieCollection.java | 53e53e441b99ee11f783e2c03da28054eb751f03 | [] | no_license | sean-blessing/java_201803 | 9512217d75a18e5e536b2553df44683be8e10020 | 2a01928061271d6551577533ebc206a737a0f3eb | refs/heads/master | 2020-04-05T16:34:02.100391 | 2019-08-28T21:07:33 | 2019-08-28T21:07:33 | 157,018,528 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,114 | java | package business;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
public class MovieCollection {
private List<Movie> movies;
public MovieCollection() {
movies = new ArrayList<>();
}
public List<Movie> getMovies() {
return movies;
}
public void setMovies(List<Movie> movies) {
this.movies = movies;
}
public void add(Movie m) {
movies.add(m);
}
public List<Movie> filterMovies(Predicate<Movie> condition) {
/*List<Movie> filteredMovies = new ArrayList<>();
for (Movie m: movies) {
if (condition.test(m))
filteredMovies.add(m);
}
return filteredMovies;*/
return movies.stream().filter(condition)
.collect(Collectors.toList());
}
public double getLowestRating() {
double lr = 5.0;
// for (Movie m: movies) {
// lr = Math.min(lr, m.getRating());
// }
// lr = movies.stream()
// .map(r -> r.getRating())
// .reduce(5.0, (a, b) -> Math.min(a, b));
// lr = movies.stream()
// .map(Movie::getRating)
// .reduce(5.0, Math::min);
// lr = movies.stream()
// .mapToDouble(r -> r.getRating())
// .min().getAsDouble();
lr = movies.stream()
.mapToDouble(Movie::getRating)
.min().getAsDouble();
return lr;
}
public double getHighestRating() {
double hr = movies.stream()
.map(r -> r.getRating())
.reduce(1.0, (a, b) -> Math.max(a, b));
return hr;
}
public String getAverageRating() {
/*double sum = movies.stream()
.map(r -> r.getRating())
.reduce(0.0, (a, b) -> (a+b));
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMaximumFractionDigits(2);
return nf.format(sum/movies.size());
*/
double avg = movies.stream()
.mapToDouble(r -> r.getRating())
.average().getAsDouble();
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMaximumFractionDigits(2);
return nf.format(avg);
}
public int getSize() {
return movies.size();
}
}
| [
"snblessing@gmail.com"
] | snblessing@gmail.com |
9f4fdb33ce8a67ffeb5fd22505ef7e3c92be4421 | eb635a713c3adc3655a2f71c6bb0a900235fab16 | /basic/RestSample/src/main/java/com/samples/Init.java | 108418982f200cd4c12e2f9d42e9c8f82c264abf | [] | no_license | ruplim/spring-integration | 55a98b2cc67c96fa2e3e0587a578956ce91f1bd0 | b1a92d5be7bf4fd0592dce6655cff29bb84fe579 | refs/heads/master | 2020-04-06T07:12:05.230494 | 2016-08-31T19:45:10 | 2016-08-31T19:45:10 | 65,327,504 | 0 | 0 | null | 2016-08-10T20:11:23 | 2016-08-09T20:53:05 | Java | UTF-8 | Java | false | false | 923 | java | package com.samples;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.web.client.RestTemplate;
public class Init {
/*
public static void main(String[] args) {
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
//headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
headers.set("Accept", MediaType.APPLICATION_XML_VALUE);
HttpEntity<?> entity = new HttpEntity<>(headers);
HttpEntity<com.samples.jaxb.Employee> response = restTemplate.exchange(
"http://localhost:8080/RestSample/emps/100",
HttpMethod.GET,
entity,
com.samples.jaxb.Employee.class);
System.out.println(response.getBody().getEmpId() + ":" + response.getBody().getEmpFirstName());
}
*/
}
| [
"ruplimbora@gmail.com"
] | ruplimbora@gmail.com |
2e5f626d88219e5d4376c9fe4bc165d84ebb41e5 | 0b17f05c7ea2d1dde78151bec7e5f316e6ce0864 | /adminpanel/src/main/java/com/adminpanel/domain/User.java | 0338235af9340984a1168e1d7d75bd602edcfa43 | [] | no_license | mosay360/project_share | 427a6ccb45fae9c8ecc6b3dd55520bd81f4569c7 | 59b3ba8b22e7b77efbf6606678ec8d3c3c09a442 | refs/heads/master | 2020-03-19T00:57:40.302368 | 2018-05-31T00:52:09 | 2018-05-31T00:52:09 | 135,512,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,908 | java | package com.adminpanel.domain;
import com.adminpanel.domain.security.Authority;
import com.adminpanel.domain.security.UserRole;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import javax.persistence.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@Entity
public class User implements UserDetails{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id", nullable = false, updatable = false)
private Long id;
private String username;
private String password;
private String firstname;
private String lastname;
@Column(name = "email", nullable = false, updatable = false)
private String email;
private String phone;
private boolean enable=true;
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JsonIgnore
private Set<UserRole> userRoles = new HashSet< >();
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public void setEnable(boolean enable) {
this.enable = enable;
}
public Set<UserRole> getUserRoles() {
return userRoles;
}
public void setUserRoles(Set<UserRole> userRoles) {
this.userRoles = userRoles;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
Set<GrantedAuthority> authorities = new HashSet<>();
userRoles.forEach(ur->authorities.add(new Authority(ur.getRole().getName())));
return authorities;
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return enable;
}
}
| [
"33404326+mosay360@users.noreply.github.com"
] | 33404326+mosay360@users.noreply.github.com |
47bd80642c047d9740474448115f47baa2cde397 | abf6e1529c0c8a417fc13bb1756be1a97db75f5c | /src/Tree/TestArrayBinaryTree.java | 456a3f772335fd078a1eac6ad341fbc450372e2e | [] | no_license | lookforsohpie/Algorithm | e7149f25b28953884aa78dae11a72e9d258fed36 | cd19f2bfcd5aa88c09080eb8930bf0898e0b5252 | refs/heads/master | 2020-04-30T21:25:28.791189 | 2019-04-02T14:08:45 | 2019-04-02T14:08:45 | 177,092,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 251 | java | package Tree;
public class TestArrayBinaryTree {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] data = new int[]{1,2,3,4,5,6,7};
ArrayBinaryTree tree = new ArrayBinaryTree(data);
tree.frongtShoe(0);
}
}
| [
"wujinpeng_up@163.com"
] | wujinpeng_up@163.com |
6dc6f429aedbf46249e3081037be2db77a40dc56 | ab276d2ad5f2993eb7d711b63cbddfacfd2ad967 | /app/src/main/java/sonar2/tistory/com/busan/easydisabledemploy/Busan9Activity.java | 0cb892d7c48d77d50ea49c4509efcfb137ccb13e | [] | no_license | parkyongjoon1/EasyDisabledEmploy | f0a621cd67f66f3ce4fa433f42bbbf60ea15c506 | b27fa41887a9867ac58c9a62af8e174a442c2eb4 | refs/heads/master | 2023-04-03T11:53:53.177258 | 2023-03-22T08:59:10 | 2023-03-22T08:59:10 | 243,422,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,967 | java | package sonar2.tistory.com.busan.easydisabledemploy;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import pl.polidea.view.ZoomView;
public class Busan9Activity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_busan9);
//화면확대
final View v = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.activity_busan9, null, false);
ConstraintLayout.LayoutParams layoutParams = new ConstraintLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
ZoomView zoomView = new ZoomView(this);
zoomView.addView(v);
zoomView.setLayoutParams(layoutParams);
zoomView.setMiniMapEnabled(false); // 좌측 상단 검은색 미니맵 설정
zoomView.setMaxZoom(4f); // 줌 Max 배율 설정 1f 로 설정하면 줌 안됩니다.
ConstraintLayout container = findViewById(R.id.container);
container.addView(zoomView);//스와이프 구현
v.setOnTouchListener(new OnSwipeTouchListener(getApplicationContext()) {
@Override
public void onSwipeRight() {
onCLickPrev(v);
}
public void onSwipeLeft() {
Toast.makeText(getApplicationContext(),"마지막 페이지 입니다.",Toast.LENGTH_SHORT).show();
}
});
}
public void onCLickPrev(View view) {
finish();
overridePendingTransition(R.anim.slide_enter, R.anim.slide_exit);
}
public void onCLickHome(View view) {
setResult(2);
finish();
}
}
| [
"yjpark@kut.ac.kr"
] | yjpark@kut.ac.kr |
6cc0a8df39ebedae2faf4dfd8a117cde08a7d79f | fd546b57da5f24fd47cd813e80a83a0d92285109 | /src/main/java/com/practice/jwtautt/dto/MessageResponseDTO.java | d0b08112e552cf1b37e113fcf89273807083561d | [] | no_license | ChaitanyaMM/spring-boot-jwt-application | 306370b2d6023a9cded364ac3519e6e1cb528c92 | 0b5f1963dabf45a261b845b656f937b49b11cc0e | refs/heads/main | 2023-06-18T00:43:57.443437 | 2021-07-15T04:34:38 | 2021-07-15T04:34:38 | 385,875,276 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 179 | java | package com.practice.jwtautt.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class MessageResponseDTO {
private String message;
}
| [
"krishnachaitu.17@gmail.com"
] | krishnachaitu.17@gmail.com |
7f1f84592d74a5767f03f372f4c3b5640c247292 | f58cfd5dcbe9a8e1fc3271ba6215443005d5bedb | /DependencyDemo/src/main/java/com/example/demo/DependencyDemoApplication.java | a9a8f496d25ed82fe1a79097d4ff7dce3409973f | [] | no_license | RupeshKashyap/Spring-boot | 989845067a32a114c7e147d7b7fea75407ff7895 | 6a6a69e7975701d618d3105e200a484cab50e17a | refs/heads/master | 2023-04-01T22:08:13.648907 | 2021-04-15T13:20:38 | 2021-04-15T13:20:38 | 358,263,973 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 556 | java | package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import com.example.demo.utils.Customers;
@SpringBootApplication
public class DependencyDemoApplication {
public static void main(String[] args) {
ConfigurableApplicationContext context = SpringApplication.run(DependencyDemoApplication.class, args);
Customers customers = context.getBean(Customers.class);
customers.display();
}
}
| [
"rupeshkashyap1996@gmail.com"
] | rupeshkashyap1996@gmail.com |
0a22c2627aa1f8287e2507112114c770906f7622 | 12adc9013be2e2274f837c330471e3c49edbb830 | /src/main/java/ca/joyfactory/coims/controller/DocumentController.java | 3de120119c9bc33d618640b281de2f53d3693e05 | [] | no_license | johndpope/coims | 77501b71e58183e09f4c2f3044e814b5f39e4ef0 | 41218665b211c97d293ecec646212fc475ae00f6 | refs/heads/master | 2023-06-19T17:45:54.933065 | 2021-07-19T17:04:01 | 2021-07-19T17:04:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,829 | java | package ca.joyfactory.coims.controller;
import ca.joyfactory.coims.domain.Document;
import ca.joyfactory.coims.domain.FileDto;
import ca.joyfactory.coims.service.DocumentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* Created by Joinsu on 2018-09-28.
*/
@Controller
@RequestMapping("/document")
public class DocumentController {
@Autowired
DocumentService documentService;
@RequestMapping( value = "/add", method = RequestMethod.PUT)
public ResponseEntity< List<Document>> addDocument(@RequestBody Document document){
documentService.addDocument( document);
List<Document> documentList = documentService.findDefaultDocumentList();
return new ResponseEntity( documentList, HttpStatus.OK);
}
@RequestMapping( value = "/add-more", method = RequestMethod.POST)
public ResponseEntity< Document> addMoreDocument(@RequestBody Document document){
return new ResponseEntity( documentService.addDocument( document), HttpStatus.OK);
}
@RequestMapping( value = "/find-default-list", method = RequestMethod.GET)
public ResponseEntity< List<Document>> findDefaultDocumentList(){
List<Document> documentList = documentService.findDefaultDocumentList();
return new ResponseEntity( documentList, HttpStatus.OK);
}
@RequestMapping( value = "/find-by-doc-code", method = RequestMethod.POST)
public ResponseEntity<Document> findByDocCode( @RequestBody String docCode){
return new ResponseEntity( documentService.findDocumentByCode( docCode), HttpStatus.OK);
}
@RequestMapping( value = "/delete-and-return-doc-list", method = RequestMethod.DELETE)
public ResponseEntity< List<Document>> deleteDocument(@RequestParam(value = "id") Long documentId){
documentService.deleteDocumentById( documentId);
List<Document> documentList = documentService.findDefaultDocumentList();
return new ResponseEntity( documentList, HttpStatus.OK);
}
@RequestMapping( value = "/modify", method = RequestMethod.PUT)
public ResponseEntity< List<Document>> modifyDocument(@RequestBody Document document){
documentService.modifyDocument( document);
List<Document> documentList = documentService.findDefaultDocumentList();
return new ResponseEntity( documentList, HttpStatus.OK);
}
}
| [
"positiveinsu@gmail.com"
] | positiveinsu@gmail.com |
0bad50feaff5ef3830f6bb8a6c83eec3825a1e23 | be6ecb96729090e66c14dcb251c52504ad4be05e | /Practica1/BibEJBserver/src/main/java/datos/LibroDAO.java | 57917a659b315e4e585917f7519c36d44a595ba3 | [] | no_license | aviscainoc/Practica1 | 85a0ec99e28b3d2f82bf4e1c38a0ddfb35d9f1d3 | 0994814b15a1b7000e342ef1a2a83fddebb0fb49 | refs/heads/master | 2020-09-22T13:41:34.707973 | 2020-04-13T15:41:50 | 2020-04-13T15:41:50 | 225,221,735 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,136 | java | package datos;
import java.util.List;
import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import modelo.Libro;
@Stateless
public class LibroDAO {
@Inject
private EntityManager em;
public void insert(Libro libro) {
em.persist(libro);
System.out.println("se guardo");
}
public void update(Libro libro) {
em.merge(libro);
}
public void remove(int codigo) {
Libro libro = this.read(codigo);
em.remove(libro);
}
public Libro read(int codigo) {
Libro l = em.find(Libro.class, codigo);
return l;
}
public List<Libro> getLibros(){
String jpql = "SELECT l FROM Libro l";
Query q = em.createQuery(jpql, Libro.class);
List<Libro> libros = q.getResultList();
return libros;
}
/*
public List<Libro> getLibrosXNombre(String filtro){
String jpql = "SELECT l FROM Libro l WHERE titulo LIKE ?1";
Query q = em.createQuery(jpql, Libro.class);
q.setParameter(1, "%" + filtro + "%");
List<Libro> libros = q.getResultList();
return libros;
}*/
}
| [
"noreply@github.com"
] | aviscainoc.noreply@github.com |
e6d113b40d9eafe339198287f59120a702ab4527 | 12e610ff2b76c44e7f102769bb86fdcf4aae22d1 | /TopUp/src/Assignment/Q3/RandomShapes.java | a7911cb81f7fae592ba8e4caf5e2a8554895aacd | [] | no_license | KaChing32/DataStructureProject | a8df34a48111d2ac27148dcb300716a8f68591e2 | da8bbf05671c06e1001eef0246e3a1454aa2c74e | refs/heads/master | 2020-04-08T05:15:53.845995 | 2018-11-26T13:34:37 | 2018-11-26T13:34:37 | 159,053,318 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,123 | java | package Assignment.Q3;
public class RandomShapes {
public static void main(String[] args) {
double ranX, ranY, ranRad, ranWid, ranHeig;
Ashape[] shapes = new Ashape[5];
for (int i = 0; i < shapes.length; i++) {
int CorR = (int) (Math.random() * 2 + 1);
ranX = (int) ((Math.random() * 100) + 1);
ranY = (int) ((Math.random() * 100) + 1);
ranRad = (int) ((Math.random() * 100) + 1);
ranWid = (int) ((Math.random() * 100) + 1);
ranHeig = (int) ((Math.random() * 100) + 1);
if (CorR == 1) {
shapes[i] = new Circle(ranX, ranY);
((Circle) shapes[i]).setRadius(ranRad);
System.out.println("\nnumber" + (i+1) + shapes[i].toString());
} else {
shapes[i] = new Rectangle(ranX, ranY);
((Rectangle) shapes[i]).setHei(ranHeig);
((Rectangle) shapes[i]).setWid(ranWid);
System.out.println("\nnumber" + (i+1) + shapes[i].toString());
}
}
}
}
| [
"noreply@github.com"
] | KaChing32.noreply@github.com |
067b408c4d4e1bb08a2dda5454fb0a5966846712 | f4e03466211fe282d4ba426b44f2b057e6576804 | /144_Binary_Tree_Preorder_Traversal.java | 76b2970671c8a6adeee199bfe087cf067ebadf18 | [] | no_license | jerrychlee/LeetCode | 1e83322b631e004c66f64a3b9df1a02e8015bdfc | c6f9eb64ed115bd4f4b4417d3da93d174580d1f7 | refs/heads/master | 2022-06-02T23:52:36.596287 | 2022-05-25T04:59:21 | 2022-05-25T04:59:21 | 109,255,647 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,041 | java | 144. Binary Tree Preorder Traversal
Given a binary tree, return the preorder traversal of its nodes' values.
Example:
Input: [1,null,2,3]
1
\
2
/
3
Output: [1,2,3]
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
List<Integer> orderList = new ArrayList();
public List<Integer> preorderTraversal(TreeNode root) {
Deque<TreeNode> stack = new ArrayDeque<TreeNode>();
if(root == null){
return orderList;
}
stack.addFirst(root);
while (stack.size()!=0) {
root = stack.removeFirst();
orderList.add(root.val);
if(root.right != null){
stack.addFirst(root.right);
}
if(root.left != null){
stack.addFirst(root.left);
}
}
return orderList;
}
} | [
"jerrychlee@gmail.com"
] | jerrychlee@gmail.com |
88a5f8ecafcfd341b6e48fa10077699c42482993 | be1f80804f35c13c6f70e7513d2be18ab0d4ee0d | /p4java/src/com/perforce/p4java/option/server/GetDirectoriesOptions.java | e4ee5b73a7f50b8dec8ce9382bb884f1ac9d8da9 | [
"Apache-2.0",
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | seanshou/p4ic4idea | 8908aed6b94d90fd9ca48523ddb0a0d26dea5fe9 | bc01eaa85319f3076b8b8155540efad3822c78f1 | refs/heads/master | 2020-05-20T23:11:50.618633 | 2016-03-12T00:30:39 | 2016-03-12T00:30:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,881 | java | /**
*
*/
package com.perforce.p4java.option.server;
import java.util.List;
import com.perforce.p4java.exception.OptionsException;
import com.perforce.p4java.option.Options;
import com.perforce.p4java.server.IServer;
/**
* Options class for IOptionsServer getDirectories method.
*
* @see com.perforce.p4java.server.IOptionsServer#getDirectories(List, com.perforce.p4java.option.server.GetDirectoriesOptions)
*/
public class GetDirectoriesOptions extends Options {
/**
* Options: -C, -D, -H, -S[stream]
*/
public static final String OPTIONS_SPECS = "b:C b:D b:H s:S";
/**
* If true, limit the returns to directories that are mapped in
* the current Perforce client workspace. Corresponds to -C.
*/
protected boolean clientOnly = false;
/**
* If true, includes directories with only deleted files.
* Corresponds to -D.
*/
protected boolean deletedOnly = false;
/**
* If true, lists directories of files on the 'have' list.
* Corresponds to -H.
*/
protected boolean haveListOnly = false;
/**
* If non-null, limits output to depot directories mapped in a stream's
* client view. Corresponds to the "-S stream" flag.
*/
protected String stream = null;
/**
* Default constructor -- sets all fields to false.
*/
public GetDirectoriesOptions() {
super();
}
/**
* Strings-based constructor; see 'p4 help [command]' for possible options.
* <p>
*
* <b>WARNING: you should not pass more than one option or argument in each
* string parameter. Each option or argument should be passed-in as its own
* separate string parameter, without any spaces between the option and the
* option value (if any).<b>
* <p>
*
* <b>NOTE: setting options this way always bypasses the internal options
* values, and getter methods against the individual values corresponding to
* the strings passed in to this constructor will not normally reflect the
* string's setting. Do not use this constructor unless you know what you're
* doing and / or you do not also use the field getters and setters.</b>
*
* @see com.perforce.p4java.option.Options#Options(String...)
*/
public GetDirectoriesOptions(String... options) {
super(options);
}
/**
* Explicit-value constructor.
*/
public GetDirectoriesOptions(boolean clientOnly, boolean deletedOnly,
boolean haveListOnly) {
super();
this.clientOnly = clientOnly;
this.deletedOnly = deletedOnly;
this.haveListOnly = haveListOnly;
}
/**
* Explicit-value constructor.
*/
public GetDirectoriesOptions(boolean clientOnly, boolean deletedOnly,
boolean haveListOnly, String stream) {
super();
this.clientOnly = clientOnly;
this.deletedOnly = deletedOnly;
this.haveListOnly = haveListOnly;
this.stream = stream;
}
/**
* @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer)
*/
public List<String> processOptions(IServer server) throws OptionsException {
this.optionList = this.processFields(OPTIONS_SPECS,
this.isClientOnly(),
this.isDeletedOnly(),
this.isHaveListOnly(),
this.getStream());
return this.optionList;
}
public boolean isClientOnly() {
return clientOnly;
}
public GetDirectoriesOptions setClientOnly(boolean clientOnly) {
this.clientOnly = clientOnly;
return this;
}
public boolean isDeletedOnly() {
return deletedOnly;
}
public GetDirectoriesOptions setDeletedOnly(boolean deletedOnly) {
this.deletedOnly = deletedOnly;
return this;
}
public boolean isHaveListOnly() {
return haveListOnly;
}
public GetDirectoriesOptions setHaveListOnly(boolean haveListOnly) {
this.haveListOnly = haveListOnly;
return this;
}
public String getStream() {
return stream;
}
public GetDirectoriesOptions setStream(String stream) {
this.stream = stream;
return this;
}
}
| [
"matt@groboclown.net"
] | matt@groboclown.net |
9f844963edde677dd6d002355fef456a9f5c8f4e | 028cbe18b4e5c347f664c592cbc7f56729b74060 | /external/modules/bean-validator/hibernate-validator/4.2.0.Final/hibernate-validator/src/main/java/org/hibernate/validator/util/privilegedactions/GetDeclaredMethod.java | fade03e602a42658f706592b082d4758a93e9c11 | [
"Apache-2.0"
] | permissive | dmatej/Glassfish-SVN-Patched | 8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e | 269e29ba90db6d9c38271f7acd2affcacf2416f1 | refs/heads/master | 2021-05-28T12:55:06.267463 | 2014-11-11T04:21:44 | 2014-11-11T04:21:44 | 23,610,469 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,709 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* 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.hibernate.validator.util.privilegedactions;
import java.lang.reflect.Method;
import java.security.PrivilegedAction;
/**
* @author Kevin Pollet - SERLI - (kevin.pollet@serli.com)
*/
public final class GetDeclaredMethod implements PrivilegedAction<Method> {
private final Class<?> clazz;
private final String methodName;
private final Class<?>[] parameterTypes;
public static GetDeclaredMethod action(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
return new GetDeclaredMethod( clazz, methodName, parameterTypes );
}
private GetDeclaredMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
this.clazz = clazz;
this.methodName = methodName;
this.parameterTypes = parameterTypes;
}
public Method run() {
try {
return clazz.getDeclaredMethod( methodName, parameterTypes );
}
catch ( NoSuchMethodException e ) {
return null;
}
}
}
| [
"janey@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5"
] | janey@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5 |
c5c4338742d83e70802e187257ba92109f85df9c | 3d7a08fa65f78d7f1c2f435c4ad1d0ef35617b2e | /src/client/Account.java | 6e74561e6955284c3eadd8fe9332b5f5efca8c01 | [] | no_license | MHaveFaith/Chatv2 | dcca505fed53e6e6facc5b9195c8e5368f67dbdf | ce71a2478db0eecbe3901942f2b8c18cf38fabd3 | refs/heads/master | 2021-04-28T23:53:48.865313 | 2017-01-06T23:23:32 | 2017-01-06T23:23:32 | 77,725,024 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 5,087 | java | package client;
/**
*
* @author Keno
*/
public class Account extends javax.swing.JFrame {
String message;
/**
* Creates new form Account
*/
public Account(String message) {
this.message = message;
initComponents();
setText();
}
private void setText(){
String split_message [] = message.split(":");
String username = split_message[0];
String rank = split_message[1];
String reg_date = split_message[2];
usernameField.setText(username);
rankField.setText(rank.toUpperCase());
regdateField.setText(reg_date);
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
usernameLabel = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
rankField = new javax.swing.JTextField();
regdateField = new javax.swing.JTextField();
usernameField = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Account");
setResizable(false);
usernameLabel.setText("Username:");
jLabel2.setText("Your rank:");
jLabel3.setText("Reg date:");
rankField.setEditable(false);
rankField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
rankField.setText("null");
regdateField.setEditable(false);
regdateField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
regdateField.setText("null");
usernameField.setEditable(false);
usernameField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
usernameField.setText("null");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(usernameLabel)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(regdateField, javax.swing.GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)
.addComponent(usernameField)
.addComponent(rankField))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(usernameLabel)
.addComponent(usernameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(rankField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(regdateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
setLocationRelativeTo(null);
pack();
}// </editor-fold>
// Variables declaration - do not modify
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField rankField;
private javax.swing.JTextField regdateField;
private javax.swing.JTextField usernameField;
private javax.swing.JLabel usernameLabel;
// End of variables declaration
}
| [
"adekunlekujore@icloud.com"
] | adekunlekujore@icloud.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.