blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 7 5.41M | extension stringclasses 11
values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13d87651f53e853afad0b70546e49b1ea8fe508b | e4d19c5289a3be082275685fbf27ed42cddc43a6 | /rising-city/src/risingCity.java | a59fa3e33608667592eba46e8d18a9abae3a84b4 | [] | no_license | Sachet19/construction-scheduler | 0af99d23d9b9380388d88c2e4db6e0d529ce0b51 | f302969c311b88b08807ace25d3d6e19f4638e9b | refs/heads/master | 2021-01-07T16:13:56.701097 | 2020-02-20T01:26:27 | 2020-02-20T01:26:27 | 241,749,881 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,585 | java | // The primary class which gets executed to schedule the construction of the various buildings. It reads the specified input command file and generates the required outpur file
import java.io.*;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class risingCity {
private RBT tree = new RBT(); //Object containing the red-black tree
private MinHeap heap = new MinHeap(); //Object containing the min heap
private FileWriter fileWriter; //Object used to write into the outpur file
private HeapNode underConstructionBuilding = null; //Object holding the node representing the building currently under construction
private int globalTime = 0; //Variable that maintains the global time
private int timeForConstructionPeriodEnd = 0; //Variable to keep track of each construction period
private int timeForCurrentBuildingCompletion = 0; // Variable that keeps track of the time needed to complete the construction of the under construction building
private static String FILE_INPUT;
private static final String FILE_OUTPUT = "output_file.txt";
public static void main(String[] args) {
FILE_INPUT = args[0]; // Read name of input file from command line arguments
risingCity constructCity = new risingCity();
constructCity.begin();
}
private void begin() {
BufferedReader bufferedReader = null;
FileReader fileReader = null;
try {
String sCurrentLine;
String[] params;
String filepath = new File(FILE_INPUT).getAbsolutePath(); //Reading the input file
fileReader = new FileReader(new File(filepath));
bufferedReader = new BufferedReader(fileReader);
fileWriter = new FileWriter(FILE_OUTPUT);
while ((sCurrentLine = bufferedReader.readLine()) != null) {
Pattern pattern = Pattern.compile("(^\\d+): ([a-zA-Z]+)\\((.+)\\)"); // Regular expression to decode the commands in each line of the input file
Matcher matcher = pattern.matcher(sCurrentLine);
if (matcher.find()) {
params = matcher.group(3).split(",");
int cmdExecTime = Integer.parseInt(matcher.group(1));
while (cmdExecTime != globalTime) {
updateConstruction();
incrementTime();
}
switch (matcher.group(2)) {
case "Insert": { // Processing an insert command
int buildingNo = Integer.parseInt(params[0]);
int totalConstructionTime = Integer.parseInt(params[1]);
insertNewBuilding(buildingNo, totalConstructionTime);
break;
}
case "PrintBuilding": { // Processing the two variations of the print command
if(params.length == 1)
{
//Single building print
int buildingNo = Integer.parseInt(params[0]);
printSingleBuilding(buildingNo);
}
else
{
//Range print
int buildingNo1 = Integer.parseInt(params[0]);
int buildingNo2 = Integer.parseInt(params[1]);
printBuildingsInRange(buildingNo1, buildingNo2);
}
break;
}
}
}
updateConstruction();
incrementTime();
}
completeConstruction();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
fileWriter.close();
fileReader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
//Function to insert a new building into the construction schedule by inserting it into both the min heap and the red black tree. It also establishes the link between the two nodesg
private void insertNewBuilding(int buildingNo, int totalConstructionTime) {
RBTNode rbNode = new RBTNode(buildingNo);
rbNode.timeNeeded = totalConstructionTime;
HeapNode heapNode = new HeapNode(0);
rbNode.heapPointer = heapNode;
heapNode.rbNode = rbNode;
tree.insertNode(rbNode);
heap.insert(heapNode);
}
//Function to print the details of a single building based on the building number
private void printSingleBuilding(int buildingNo) throws IOException {
RBTNode rbNode = tree.find(buildingNo);
if (rbNode == null) {
printNonExistingBuilding();
} else {
printBuildingInformation(rbNode);
}
}
//Function to print the buildings falling in the range of the specified building numbers
private void printBuildingsInRange(int buildingNo1, int buildingNo2) throws IOException {
List<RBTNode> list = tree.findInRange(buildingNo1, buildingNo2);
if (!list.isEmpty()) {
StringBuilder sb = new StringBuilder();
for (RBTNode node : list) {
sb.append("(" + node.id + "," + node.heapPointer.key + "," + node.timeNeeded + "),");
}
sb.deleteCharAt(sb.length() - 1);
sb.append("\n");
fileWriter.write(sb.toString());
} else {
fileWriter.write("(0,0,0)\n");
}
}
//Function to print output when requested building does not exist
private void printNonExistingBuilding() throws IOException {
fileWriter.write("(0,0,0)\n");
}
//Function to specify the format of the the print output and write the data to the outpur file
private void printBuildingInformation(RBTNode node) throws IOException {
if (node.id == underConstructionBuilding.rbNode.id) {
fileWriter.write("(" + node.id + "," + underConstructionBuilding.key + "," + node.timeNeeded + ")\n");
} else {
fileWriter.write("(" + node.id + "," + node.heapPointer.key + "," + node.timeNeeded + ")\n");
}
}
//Function which selects a building for construction based on time spent on the building and the building number. Buildings that finish completion are removed from the data structures
private void updateConstruction() throws IOException {
if (underConstructionBuilding == null) {
if (heap.isEmpty()) {
return;
} else {
underConstructionBuilding = heap.extractMin();
timeForConstructionPeriodEnd = globalTime + 5;
timeForCurrentBuildingCompletion = globalTime + underConstructionBuilding.rbNode.timeNeeded - underConstructionBuilding.key;
}
} else {
if (timeForCurrentBuildingCompletion <= timeForConstructionPeriodEnd) {
if (globalTime == timeForCurrentBuildingCompletion) {
printCompletedBuilding(underConstructionBuilding.rbNode.id);
tree.deleteNode(underConstructionBuilding.rbNode);
underConstructionBuilding = null;
timeForConstructionPeriodEnd = 0;
timeForCurrentBuildingCompletion = 0;
updateConstruction();
}
} else {
if (globalTime == timeForConstructionPeriodEnd) {
heap.insert(underConstructionBuilding);
underConstructionBuilding = null;
timeForConstructionPeriodEnd = 0;
timeForCurrentBuildingCompletion = 0;
updateConstruction();
}
}
}
}
//Function that prints the building number and the time of completion of a completed building
private void printCompletedBuilding(int buildingNo) throws IOException {
RBTNode rbNode = tree.find(buildingNo);
if (rbNode == null) {
fileWriter.write("(0,0,0)\n");
} else {
fileWriter.write("(" + rbNode.id + "," + globalTime + ")\n");
}
}
//Function which advances the global timer
private void incrementTime() {
globalTime++;
if (underConstructionBuilding != null) {
underConstructionBuilding.key++;
}
}
//Function to complete all unfinished buildings after all commands from the input file have been processed
private void completeConstruction() throws IOException {
while (underConstructionBuilding != null) {
updateConstruction();
incrementTime();
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
b031e014c047dde719407bb212dcf40af5ef4896 | 8f013cb0b01ce48140e61d643493cf8183cd2d1f | /app/src/main/java/com/dawn/restroview/adminfrags/MonthlyFrag.java | d88ca68485ded35484d31b3eea68fd0a5c617654 | [] | no_license | SantoshDawanse/restroview | e705e0b1cd8fe247c018964db3e7adc06675ec4b | e54b80196c462c88ace16a1f891f05f78ac60444 | refs/heads/master | 2021-10-21T18:37:39.146376 | 2019-03-05T16:56:59 | 2019-03-05T16:56:59 | 173,985,832 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 688 | java | package com.dawn.restroview.adminfrags;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.dawn.restroview.R;
/**
* A simple {@link Fragment} subclass.
*/
public class MonthlyFrag extends Fragment {
public MonthlyFrag() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_monthly, container, false);
}
}
| [
"dawanse.santosh@gmail.com"
] | dawanse.santosh@gmail.com |
751f2fe62430a98328e1c8e232d5c77e8c4b03b7 | 399e4bea3cc729982425a9c0e4b2dec9900281da | /app/src/main/java/com/android/shamim/taketour/helper/ExpenditureAdapter.java | 882ba59592bb8c0085447bbbec05c7c4088ab854 | [] | no_license | Mahmudullahmak/TakeTour | ca081b86172128b6c323836dc172e2ae91e64c3b | 7ae96c97f5433067288c8788f0d5b810a4a74ba9 | refs/heads/master | 2020-05-25T08:02:01.273209 | 2019-05-20T19:32:02 | 2019-05-20T19:32:02 | 187,701,068 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,020 | java | package com.android.shamim.taketour.helper;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.PopupMenu;
import android.widget.TextView;
import android.widget.Toast;
import com.android.shamim.taketour.AddEvent;
import com.android.shamim.taketour.EventDetail;
import com.android.shamim.taketour.EventList;
import com.android.shamim.taketour.ExpenditureList;
import com.android.shamim.taketour.R;
import com.android.shamim.taketour.pojjoclass.Events;
import com.android.shamim.taketour.pojjoclass.Expenditure;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
/**
* Created by SHAMIM on 1/25/2018.
*/
public class ExpenditureAdapter extends RecyclerView.Adapter<ExpenditureAdapter.ExpenseViewHolder>{
private Context context;
private ArrayList<Expenditure> expenses;
private int count = 0;
public ExpenditureAdapter(Context context, ArrayList<Expenditure> expenses){
this.context = context;
this.expenses = expenses;
}
@Override
public ExpenseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
View v = inflater.inflate(R.layout.single_expenditure_row,parent,false);
return new ExpenseViewHolder(v);
}
@Override
public void onBindViewHolder(final ExpenseViewHolder holder, int position) {
final Expenditure expens = expenses.get(position);
holder.extitle.setText(expenses.get(position).getDescription());
holder.excost.setText("Tk. "+String.valueOf(expenses.get(position).getExpense())+"0");
holder.createDate.setText( "On: "+expenses.get(position).getCreatedate());
holder.optionDigit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
PopupMenu popupMenu = new PopupMenu(context,holder.optionDigit);
popupMenu.inflate(R.menu.option_menu2);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()){
case R.id.edit:
try {
((ExpenditureList) v.getContext()).editExpenseDialog(expens);
} catch (Exception e) {
// ignore
}
break;
case R.id.delete:
try {
((ExpenditureList) v.getContext()).deleteRecord(expens);
} catch (Exception e) {
// ignore
}
break;
}
return false;
}
});
popupMenu.show();
}
});
holder.excost.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
PopupMenu popupMenu = new PopupMenu(context,holder.optionDigit);
popupMenu.inflate(R.menu.option_menu2);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()){
case R.id.edit:
try {
((ExpenditureList) v.getContext()).editExpenseDialog(expens);
} catch (Exception e) {
// ignore
}
break;
case R.id.delete:
try {
((ExpenditureList) v.getContext()).deleteRecord(expens);
} catch (Exception e) {
// ignore
}
break;
}
return false;
}
});
popupMenu.show();
}
});
holder.createDate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
PopupMenu popupMenu = new PopupMenu(context,holder.optionDigit);
popupMenu.inflate(R.menu.option_menu2);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()){
case R.id.edit:
try {
((ExpenditureList) v.getContext()).editExpenseDialog(expens);
} catch (Exception e) {
// ignore
}
break;
case R.id.delete:
try {
((ExpenditureList) v.getContext()).deleteRecord(expens);
} catch (Exception e) {
// ignore
}
break;
}
return false;
}
});
popupMenu.show();
}
});
holder.extitle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
PopupMenu popupMenu = new PopupMenu(context,holder.optionDigit);
popupMenu.inflate(R.menu.option_menu2);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()){
case R.id.edit:
try {
((ExpenditureList) v.getContext()).editExpenseDialog(expens);
} catch (Exception e) {
// ignore
}
break;
case R.id.delete:
try {
((ExpenditureList) v.getContext()).deleteRecord(expens);
} catch (Exception e) {
// ignore
}
break;
}
return false;
}
});
popupMenu.show();
}
});
}
@Override
public int getItemCount() {
return expenses.size();
}
public class ExpenseViewHolder extends RecyclerView.ViewHolder {
DatabaseReference root;
private EventAdapter eventAdapter;
FirebaseUser user;
private FirebaseAuth auth;
TextView extitle ;
TextView excost ;
TextView optionDigit;
TextView createDate;
public ExpenseViewHolder(View itemView) {
super(itemView);
extitle = itemView.findViewById(R.id.roweventname);
excost = itemView.findViewById(R.id.budgetrow);
createDate = itemView.findViewById(R.id.createtDaterow);
optionDigit = itemView.findViewById(R.id.optionDigit);
}
}
}
| [
"mahmudullahmak@gmail.com"
] | mahmudullahmak@gmail.com |
f15dc34d47fac4635f676971795de363e9905eab | 2c2bf267bd521a7ae5cd383dee73d93e92da09b3 | /vag-ejb/src/main/java/entities/Article.java | 994fca546dc16fde149e144bf5391c75f739ec5c | [] | no_license | zodijacky/Virtual-Association-of-Gamer | 438d3821de70a564ed9370ef8894720acfc9a79a | 5c910057f950f15959529bd9600e98cb1858cc3b | refs/heads/master | 2021-05-01T22:28:11.289701 | 2017-09-13T12:13:20 | 2017-09-13T12:13:20 | 77,258,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,988 | java | package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
@Entity
public class Article implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int idArticle;
private String titleArticle;
private Date dateArticle;
private String descriptionArticle;
private int nbLike;
private int nbDislike;
@Lob
public int getNbLike() {
return nbLike;
}
public void setNbLike(int nbLike) {
this.nbLike = nbLike;
}
public int getNbDislike() {
return nbDislike;
}
public void setNbDislike(int nbDislike) {
this.nbDislike = nbDislike;
}
// relation
public int getIdArticle() {
return idArticle;
}
public void setIdArticle(int idArticle) {
this.idArticle = idArticle;
}
public String getTitleArticle() {
return titleArticle;
}
public void setTitleArticle(String titleArticle) {
this.titleArticle = titleArticle;
}
public Date getDateArticle() {
return dateArticle;
}
public void setDateArticle(Date dateArticle) {
this.dateArticle = dateArticle;
}
public String getDescriptionArticle() {
return descriptionArticle;
}
public void setDescriptionArticle(String descriptionArticle) {
this.descriptionArticle = descriptionArticle;
}
public Article() {
}
@Override
public String toString() {
return "Article [idArticle=" + idArticle + ", titleArticle="
+ titleArticle + ", dateArticle=" + dateArticle
+ ", descriptionArticle=" + descriptionArticle
+ ", getClass()=" + getClass() + ", hashCode()=" + hashCode()
+ ", toString()=" + super.toString() + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((dateArticle == null) ? 0 : dateArticle.hashCode());
result = prime
* result
+ ((descriptionArticle == null) ? 0 : descriptionArticle
.hashCode());
result = prime * result + idArticle;
result = prime * result
+ ((titleArticle == null) ? 0 : titleArticle.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Article other = (Article) obj;
if (dateArticle == null) {
if (other.dateArticle != null)
return false;
} else if (!dateArticle.equals(other.dateArticle))
return false;
if (descriptionArticle == null) {
if (other.descriptionArticle != null)
return false;
} else if (!descriptionArticle.equals(other.descriptionArticle))
return false;
if (idArticle != other.idArticle)
return false;
if (titleArticle == null) {
if (other.titleArticle != null)
return false;
} else if (!titleArticle.equals(other.titleArticle))
return false;
return true;
}
}
| [
"omar.mansour@esprit.tn"
] | omar.mansour@esprit.tn |
637d18d49ae3c1d3c2f6e8a784383b320115c784 | 2c65c53ef5390bd70fd2ddb9bbc2b19027f2479f | /pay-spring-boot-starter/src/main/java/io/github/pactstart/pay/wxpay/request/OrderQueryRequest.java | dde59fd1250202c120ce4225030f5e0ccb21c470 | [] | no_license | zt6220493/kangaroo | f37cdaa815708fb56e33d8f4ed7d83885551011a | 16c8a9f7589ec33f01559d3308f8dd8e49493afe | refs/heads/master | 2022-12-28T04:50:48.186699 | 2019-09-25T10:40:27 | 2019-09-25T10:40:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 545 | java | package io.github.pactstart.pay.wxpay.request;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class OrderQueryRequest {
/**
* 微信的订单号,优先使用
*/
private String transaction_id;
/**
* 商户系统内部的订单号,当没提供transaction_id时需要传这个。
*/
private String out_trade_no;
public OrderQueryRequest(String transaction_id, String out_trade_no) {
this.transaction_id = transaction_id;
this.out_trade_no = out_trade_no;
}
}
| [
"1203208955@qq.com"
] | 1203208955@qq.com |
01103145c238b72e876bbb155765635b30d5daab | 6dbe879e81b1ceb9a332f6f2548c31c827f2f3a6 | /prj/back-end/src/main/java/prj/project/Simon/Silvia/repository/jdbc/JDBCReviewRepository.java | 57578dafe556939d2bc17e357af4a11c8755c7e0 | [] | no_license | utcn-sd-serban/project-sssilvia9977 | a4298f0d87b2e08d298320e7c3213c59aaeb7ffc | 310663ffd04371e11d9a16a0ed968e8f3fdbc4ee | refs/heads/master | 2023-01-10T06:35:18.803260 | 2019-05-26T19:50:05 | 2019-05-26T19:50:05 | 176,081,959 | 0 | 0 | null | 2023-01-03T22:42:48 | 2019-03-17T09:44:26 | JavaScript | UTF-8 | Java | false | false | 2,418 | java | package prj.project.Simon.Silvia.repository.jdbc;
import lombok.RequiredArgsConstructor;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
import prj.project.Simon.Silvia.entity.Appointment;
import prj.project.Simon.Silvia.entity.Review;
import prj.project.Simon.Silvia.repository.ReviewRepository;
import prj.project.Simon.Silvia.repository.jdbc.mapper.AppointmentMapper;
import prj.project.Simon.Silvia.repository.jdbc.mapper.ReviewMapper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
@RequiredArgsConstructor
public class JDBCReviewRepository implements ReviewRepository {
public final JdbcTemplate template;
@Override
public Review save(Review review) {
if (review.getId() == null) {
review.setId(insert(review));
} else {
update(review);
}
return review;
}
@Override
public void removeReview(Review review) {
template.update("DELETE FROM review WHERE id = ?", review.getId());
}
@Override
public List<Review> findAll() {
{
return template.query("SELECT * FROM review", new ReviewMapper());
}
}
@Override
public List<Review> findAllForClient(Integer userId) {
return findAll().stream().filter(
(Review a) ->
a.getClientId().equals(userId)).collect(Collectors.toList());
}
@Override
public Optional<Review> findById(Integer id) {
List<Review> reviews = template.query("SELECT * FROM review WHERE id = ?", new ReviewMapper(), id);
return reviews.isEmpty() ? Optional.empty() : Optional.of(reviews.get(0));
}
private int insert(Review review) {
SimpleJdbcInsert insert = new SimpleJdbcInsert(template);
insert.setTableName("review");
insert.usingGeneratedKeyColumns("id");
Map<String, Object> map = new HashMap<>();
map.put("client_user_id", review.getClientId());
map.put("text", review.getText());
return insert.executeAndReturnKey(map).intValue();
}
private void update(Review review) {
template.update("UPDATE review SET client_user_id = ?, text = ? WHERE id = ?",
review.getClientId(), review.getText(), review.getId());
}
}
| [
"44817470+sssilvia9977@users.noreply.github.com"
] | 44817470+sssilvia9977@users.noreply.github.com |
756d27fafa753da7ce16349b5d31fd14df3168b8 | 2c248ae702bf22bcc45d3c33096ba12f726aa0ac | /src/main/java/com/chahar/core/serialization/externalizationprocess/ExternalizationProcessApp.java | 781698c0a9e7bae44239d504f92b532f951d0acf | [] | no_license | sonuchahar511/coreJava_REPO | a3b851e61595505dace16a0a27d9301480f09d45 | 1c4603c2f9ca080b64dd09832f5c8111278aac10 | refs/heads/master | 2022-07-14T15:55:33.788654 | 2019-06-21T13:21:45 | 2019-06-21T13:21:45 | 192,708,133 | 0 | 0 | null | 2022-07-07T19:32:59 | 2019-06-19T10:08:41 | HTML | UTF-8 | Java | false | false | 819 | java | package com.chahar.core.serialization.externalizationprocess;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
public class ExternalizationProcessApp {
public static void main(String[] args) throws Exception {
User userWrite = new User(1, "johndoeSingh", "John Doe");
FileOutputStream fos = new FileOutputStream("testfile");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(userWrite);
oos.flush();
oos.close();
User userRead;
FileInputStream fis = new FileInputStream("testfile");
ObjectInputStream ois = new ObjectInputStream(fis);
userRead = (User)ois.readObject();
ois.close();
System.out.println("username: " + userRead.getUsername());
}
}
| [
"sonuchahar511@gmail.com"
] | sonuchahar511@gmail.com |
2a3b9a5cce4178cfc477ce371aac9f1664b9e002 | 9bbebca53c9ef13d83023481d84d97fb272aa31b | /src/main/java/com/caoyunhao/petshop_admin/common/util/IGetDataMethod.java | cc2414f124e2bcab3d9702d7e02034d6ceddd022 | [] | no_license | caoyunhao/spring-boot-petshop-admin | acd788513ec763b75d3f4bcb6eaf3b9113527822 | a9f7c9ff63ccdb4d6bc354834bd6d8ae7b012fc7 | refs/heads/master | 2020-03-10T20:58:47.213596 | 2018-04-15T06:08:27 | 2018-04-15T06:08:27 | 129,582,245 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 202 | java | package com.caoyunhao.petshop_admin.common.util;
import java.util.Optional;
/**
* @author Yunhao.Cao
* @version 1.0 2018/4/9
*/
public interface IGetDataMethod<T> {
Optional<T> get(Long id);
}
| [
"1067233@gmail.com"
] | 1067233@gmail.com |
52a6bba7c255878b23ebaa3fb0c3a9e219d98b34 | e18a3f297f4677c5a4c019ca1e3aa6a46a14cf02 | /src/main/java/pl/us/pawel/cwieka/travellingsalesmanproblem/resource/AcoInput.java | 0d9cfc4322e12d778b7c0b75a8228cec620cf89e | [] | no_license | pcwieka/travelling-salesman-problem | c247c375dee7764557f142fc53f25180037f430d | 04e6ee41ad63e45147686dee1b0bcc752414ff75 | refs/heads/master | 2020-03-28T23:09:30.158057 | 2018-09-18T11:49:20 | 2018-09-18T11:49:20 | 149,279,111 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,283 | java | package pl.us.pawel.cwieka.travellingsalesmanproblem.resource;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
public class AcoInput {
@JsonProperty("alpha")
private Double alpha;
@JsonProperty("beta")
private Double beta;
@JsonProperty("evaporation")
private Double evaporation;
@JsonProperty("q")
private Double q;
@JsonProperty("antFactor")
private Double antFactor;
@JsonProperty("randomFactor")
private Double randomFactor;
@JsonProperty("attempts")
private Integer attempts;
@JsonProperty("iterations")
private Integer iterations;
@JsonProperty("cities")
private List<City> cities;
public Double getAlpha() {
return alpha;
}
public Double getBeta() {
return beta;
}
public Double getEvaporation() {
return evaporation;
}
public Double getQ() {
return q;
}
public Double getAntFactor() {
return antFactor;
}
public Double getRandomFactor() {
return randomFactor;
}
public Integer getAttempts() {
return attempts;
}
public Integer getIterations() {
return iterations;
}
public List<City> getCities() {
return cities;
}
}
| [
"="
] | = |
e7e93f7448fbd92a19c9ec961e90f186158e1c18 | 0caffe05aeee72bc681351c7ba843bb4b2a4cd42 | /dcma-gwt/dcma-gwt-login/src/main/java/com/ephesoft/dcma/gwt/login/client/LoginRemoteService.java | 49df4dd615576c75d18e8b8f94fd67cd0e3c82b8 | [] | no_license | plutext/ephesoft | d201a35c6096f9f3b67df00727ae262976e61c44 | d84bf4fa23c9ed711ebf19f8d787a93a71d97274 | refs/heads/master | 2023-06-23T10:15:34.223961 | 2013-02-13T18:35:49 | 2013-02-13T18:35:49 | 43,588,917 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,645 | java | /*********************************************************************************
* Ephesoft is a Intelligent Document Capture and Mailroom Automation program
* developed by Ephesoft, Inc. Copyright (C) 2010-2012 Ephesoft Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY EPHESOFT, EPHESOFT DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact Ephesoft, Inc. headquarters at 111 Academy Way,
* Irvine, CA 92617, USA. or at email address info@ephesoft.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Ephesoft" logo.
* If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by Ephesoft".
********************************************************************************/
package com.ephesoft.dcma.gwt.login.client;
import java.io.IOException;
import com.ephesoft.dcma.gwt.core.client.DCMARemoteService;
import com.ephesoft.dcma.gwt.core.shared.exception.GWTException;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
@RemoteServiceRelativePath("loginService")
public interface LoginRemoteService extends DCMARemoteService {
/**
* API to get the application version in use.
*
* @return {@link String}
* @throws IOException
*/
String getProductVersion() throws IOException;
/**
* API to get license expiry message.
*
* @throws GWTException
*/
void getLicenseExpiryMsg() throws GWTException;
}
| [
"enterprise.support@ephesoft.com"
] | enterprise.support@ephesoft.com |
027328c1efdf0732cf8ef860dd229229ec73a14b | fe474e2912d3c35307636b5b7438efdd38dd44af | /GeckoBase/src/main/java/com/ljwm/gecko/base/entity/ProviderServices.java | ab14fa24478bdae86d87433746db9d0aab618d7b | [] | no_license | 15005187552/spring-boot-structrue | ae3b522ff9906216cc13cf3e6dcc02be3ed9a415 | fe683e1f16c1e976164ebb72310feabe8ad8cb57 | refs/heads/master | 2020-04-02T14:18:44.527953 | 2018-10-31T10:06:25 | 2018-10-31T10:06:25 | 154,499,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,621 | java | package com.ljwm.gecko.base.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 服务商关联服务分类表
* </p>
*
* @author xixil
* @since 2018-09-13
*/
@Data
@SuppressWarnings("ALL")
@Accessors(chain = true)
@TableName("`t_provider_services`")
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "服务商关联服务分类表", subTypes = {ProviderServices.class})
public class ProviderServices implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "ID")
@TableId(value = "`ID`", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "服务分类ID")
@TableField("`SERVICE_ID`")
private Integer serviceId;
@ApiModelProperty(value = "服务商ID")
@TableField("`PROVIDER_ID`")
private Long providerId;
@ApiModelProperty(value = "审核状态 1 待审核 2 审核通过 3 审核失败")
@TableField("`VALIDATE_STATE`")
private Integer validateState;
@ApiModelProperty(value = "认证人id")
@TableField("`VALIDATOR_ID`")
private Long validatorId;
@ApiModelProperty(value = "认证时间")
@TableField("`VALIDATE_TIME`")
private Date validateTime;
@ApiModelProperty(value = "认证内容")
@TableField("`VALIDATE_TEXT`")
private String validateText;
@TableField("`CREATE_TIME`")
private Date createTime;
@TableField("`UPDATE_TIME`")
private Date updateTime;
@ApiModelProperty("版本号")
@TableField("`VERSION`")
private Integer version;
@ApiModelProperty("是否启用")
@TableField("`DISABLED`")
private Integer disabled;
public static final String ID = "`ID`";
public static final String SERVICE_ID = "`SERVICE_ID`";
public static final String PROVIDER_ID = "`PROVIDER_ID`";
public static final String VALIDATE_STATE = "`VALIDATE_STATE`";
public static final String VALIDATOR_ID = "`VALIDATOR_ID`";
public static final String VALIDATE_TIME = "`VALIDATE_TIME`";
public static final String VALIDATE_TEXT = "`VALIDATE_TEXT`";
public static final String CREATE_TIME = "`CREATE_TIME`";
public static final String UPDATE_TIME = "`UPDATE_TIME`";
}
| [
"lj-yy@189china.net"
] | lj-yy@189china.net |
c926c61b5ccca3dc483372ef90e3f306fbd8946f | dc69afb71b24b99fff4d42c80384c8e5aacf350d | /chapter_002/src/main/java/ru/job4j/tracker/MenuOutException.java | 2dd1d7ea5628fc3d6135fb7b1093db5913014600 | [
"Apache-2.0"
] | permissive | GlyzinAI/job4j | d694704f1449d53ab5e66d20db1a6e45cdcdca28 | 56488930ec96393e5022f6440259a4ec7f5bb55a | refs/heads/master | 2022-12-27T04:06:14.499040 | 2019-06-11T20:57:59 | 2019-06-11T20:57:59 | 123,602,249 | 0 | 0 | Apache-2.0 | 2020-10-12T22:55:10 | 2018-03-02T16:21:04 | Java | UTF-8 | Java | false | false | 345 | java | package ru.job4j.tracker;
/**
* MenuOutException - свой класс для обработки исключительной ситуации.
*
* @author Artur Glyzin.
* @version 1.0.
* @since 11.08.2018.
*/
public class MenuOutException extends RuntimeException {
public MenuOutException(String msg) {
super(msg);
}
}
| [
"aglizin@yandex.ru"
] | aglizin@yandex.ru |
0acad3868eac7fe5a7ed2707e3052679bc56fe93 | f359a61c3d1e0cf056e03ed0c3294ed8a9976755 | /src/Engine/Keyword.java | 18c2e334fd269c3ed955d1e05b80a385e609018e | [] | no_license | xuwilliam01/NutriGO | 8f65e709377bda367e6e8c2cfbf17eea82fa1e24 | 3408c6fc5162e345b71690fc737c8fb8f3399344 | refs/heads/master | 2021-07-19T01:52:15.744741 | 2016-06-20T00:59:11 | 2016-06-20T00:59:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,422 | java | package Engine;
/**
* Used to make searching more efficient by storing various foods under their corresponding keywords
* @author Alex Raita & William Xu
*
*/
public class Keyword implements Comparable<Keyword>
{
private String keyword;
private DoublyLinkedList<Food> listOfFoods = new DoublyLinkedList<Food>();
/**
* Constructor
* @param keyword the string that defines the keyword object
*/
public Keyword (String keyword)
{
this.keyword = keyword.toLowerCase();
}
/**
* Adds a food to the list
* @param item the food to be added
*/
public void addFood(Food item)
{
listOfFoods.add(item);
}
/**
* Compares two keywords by their keyword string
* @param other the keyword to be compared to
* @return the integer difference between the keywords
*/
public int compareTo(Keyword other)
{
return keyword.compareTo(other.getKeyword());
}
/**
* Gets the keyword
* @return the keyword
*/
public String getKeyword()
{
return keyword;
}
/**
* Gets the list of foods
* @return the list of foods
*/
public DoublyLinkedList<Food> getListOfFoods()
{
return listOfFoods;
}
/**
* Gets the index of a given food
* @param item the given food
* @return the index of the food, -1 if food is not in the list
*/
public int indexOf(Food item)
{
return listOfFoods.indexOf(item);
}
}
| [
"xuwilliam01@gmail.com"
] | xuwilliam01@gmail.com |
8c13f492e3da9ae3edccec17c02a46323267013e | db80d530b9b72f72642b1ec2688df43cce4b6f04 | /app/src/main/java/com/example/tourschiapasbeta/tourschiapas/AsientosActivity.java | ecc12ec65f33685412ee6f70ffa80847d5e8b1a8 | [] | no_license | MarcosLopez25/ToursChiapas | bfcfc63ccfbf9d7d4e3e9ddba0bf303a5fc2b1f8 | 2b12a64562c72b71915192f58523eb76ca6a7c90 | refs/heads/master | 2020-06-03T18:35:10.843092 | 2019-06-13T03:37:52 | 2019-06-13T03:37:52 | 191,684,716 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,380 | java | package com.example.tourschiapasbeta.tourschiapas;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.getbase.floatingactionbutton.FloatingActionButton;
import java.util.ArrayList;
public class AsientosActivity extends AppCompatActivity {
ListView listViewClientes;
ArrayList<Cliente> clientes;
Cliente cliente;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_asientos);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab1 = (FloatingActionButton) findViewById(R.id.fab1);
fab1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(AsientosActivity.this, ClientesToursActivity.class);
startActivity(i);
//Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
//.setAction("Action", null).show();
}
});
}
}
| [
"171114@ids.upchiapas.edu.mx"
] | 171114@ids.upchiapas.edu.mx |
4448a6f3f7ee28f75712ddcf1ff90da5ce30f1f1 | 3290722eb5b35fa38836a8b2d9b4a8ce62082ba5 | /lib_base/src/main/java/com/wkq/base/frame/fragment/MvpBindingFragment.java | d8d3aa1d786016d905b7383b53073472fee1d520 | [] | no_license | wukuiqing49/wkq_mvvm_mvp_base | 8b048e21ff984fe078e17e100e2a971362676113 | 9f54db50dea5c82baaddfaaf33ca0dd740f53ee6 | refs/heads/master | 2020-05-29T21:01:16.919868 | 2019-12-21T15:01:40 | 2019-12-21T15:01:40 | 189,367,921 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 958 | java | package com.wkq.base.frame.fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import com.wkq.base.frame.mosby.delegate.MvpPresenter;
import com.wkq.base.frame.mosby.delegate.MvpView;
/**
* 作者: 吴奎庆
* <p>
* 时间: 2019/5/29
* <p>
* 简介: 不绑定数据的基类(手动绑定数据)
*/
public abstract class MvpBindingFragment<V extends MvpView, P extends MvpPresenter<V>, T extends ViewDataBinding> extends MvpFragment<V, P> {
public T binding;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false);
return binding.getRoot();
}
}
| [
"1571478933@qq.com"
] | 1571478933@qq.com |
3daa770f27b5eea999a26ff50a4566ac23fab789 | df2bc45fdaf5313cafac821673c5d59a661e7d8c | /src/message/ChunkLocationPackage.java | f502d786651772af22463830e40222f3dcb8f749 | [] | no_license | mchao409/simpledfs | 9eacc8580367371333dd45e15ada09ad4a364e8d | d8fa6d753437314367154a25930e7876ab40ed53 | refs/heads/master | 2020-04-13T05:58:23.923051 | 2019-01-31T17:45:23 | 2019-01-31T17:45:27 | 163,008,228 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 611 | java | package message;
import java.util.HashMap;
import java.util.List;
import network.TCPServerInfo;
public class ChunkLocationPackage extends MessagePackage {
private HashMap<Integer, List<TCPServerInfo>> chunk_locs;
private String identifier;
public ChunkLocationPackage(String command, HashMap<Integer, List<TCPServerInfo>> chunk_locs, String identifier) {
super(command);
this.chunk_locs = chunk_locs;
this.identifier = identifier;
}
public HashMap<Integer, List<TCPServerInfo>> get_chunk_locations() {
return chunk_locs;
}
public String get_identifier() {
return identifier;
}
}
| [
"mc2244@cornell.edu"
] | mc2244@cornell.edu |
2992c8fd90be298e2b607b4dad528fcf3a0e0f52 | 29eb88574ccf80a338596593af3686d7d35bd82b | /YourLogo/src/test/java/pages/HomePage.java | d971d2119b0d8d789601327d44451ab11f735cd1 | [] | no_license | PrasanthLevelUp/YourLogo | b7310bf6e44fa65a099edca17889f01d53431b85 | 7cb8e18c55e3536afc3ec4d1d204b7cf9e86b50f | refs/heads/master | 2023-04-03T10:41:29.753483 | 2021-04-18T13:46:52 | 2021-04-18T13:46:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,687 | java | package pages;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class HomePage {
WebDriver driver;
@FindBy(name = "userName") WebElement usernametxtbx;
@FindBy(name = "password") WebElement passwordtxtbx;
@FindBy(name = "login") WebElement SignBtn;
@FindBy(xpath = "//a[contains(text(),'SIGN-OFF')]") WebElement SignOffLink;
@FindBy(xpath = "//a[contains(text(),'REGISTER')]") WebElement RegistrerLink;
@FindBy(xpath = "//a[contains(text(),'SUPPORT')]") WebElement SupportLink;
@FindBy(xpath = "//a[contains(text(),'CONTACT')]") WebElement ContactLink;
@FindBy(xpath = "//a[contains(text(),'Home')]") WebElement HomeLink;
@FindBy(xpath = "//a[contains(text(),'Flights')]") WebElement FlightsLink;
@FindBy(xpath = "//a[contains(text(),'Hotels')]") WebElement HotelsLink;
@FindBy(xpath = "//a[contains(text(),'Car Rentals')]") WebElement CarRentalsLink;
@FindBy(xpath = "//a[contains(text(),'Cruises')]") WebElement CruisesLink;
@FindBy(xpath = "//a[contains(text(),'Destinations')]") WebElement DestinationsLink;
@FindBy(xpath = "//a[contains(text(),'Vacations')]") WebElement VacationsLink;
public HomePage(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}
public void setUsername(String usrname) {
usernametxtbx.sendKeys(usrname);
}
public void setPassword(String pwd) {
passwordtxtbx.sendKeys(pwd);
}
public void clicSignup() {
SignBtn.click();
}
public void SignUp(String usr,String pwd) {
this.setUsername(usr);
this.setPassword(pwd);
this.clicSignup();
}
}
| [
"10prasanth1994@gmail.com"
] | 10prasanth1994@gmail.com |
8302ab599428d925f1432ccfb9f1a9c251314e01 | 029a60dd1daeac58f1683503d70f9a756d550bbc | /level16/src/main/java/lesson13/bonus01/common/ImageReader.java | 412e2a77809a6b7ef1a0323106e6286d8983bdfc | [] | no_license | Borislove/JavaRush-1 | 4d66837bd07697299d97c234b751c0310ea57042 | 752373a5972c32e57fa1bffa60013a0da9e49b67 | refs/heads/master | 2023-05-03T12:32:29.577155 | 2021-05-24T13:12:55 | 2021-05-24T13:12:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 67 | java | package lesson13.bonus01.common;
public interface ImageReader {
}
| [
"krohmal_kirill@mail.ru"
] | krohmal_kirill@mail.ru |
5549586567435a89287bceabce77883c7dbb3672 | c103ff5a77bbc8cba3aed87c9f19eb040bacc8da | /sgm-core/src/main/java/com/origami/sgm/entities/CatPredioS4.java | 60715092b3bfde1ff6f3d49be7ed864311ed3696 | [] | no_license | origamigt/modulo_catastro | 9a134d9e87b15a2cae45961a92ff21dbf03639aa | 3468f579199b914d875d049623f0b9260144b7c0 | refs/heads/master | 2023-03-10T12:39:34.332951 | 2021-02-23T16:53:10 | 2021-02-23T16:53:10 | 338,333,465 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 20,555 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.origami.sgm.entities;
import com.google.gson.annotations.Expose;
import com.origami.annotations.ReportField;
import com.origami.enums.FieldType;
import com.origami.sgm.database.SchemasConfig;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.codehaus.jackson.annotate.JsonIgnore;
/**
*
* @author CarlosLoorVargas
*/
@Entity
@Table(name = "cat_predio_s4", schema = SchemasConfig.APP1, uniqueConstraints = {
@UniqueConstraint(columnNames = {"predio"})})
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "CatPredioS4.findAll", query = "SELECT c FROM CatPredioS4 c"),
@NamedQuery(name = "CatPredioS4.findById", query = "SELECT c FROM CatPredioS4 c WHERE c.id = :id"),
@NamedQuery(name = "CatPredioS4.findByIdPredio", query = "SELECT c FROM CatPredioS4 c WHERE c.predio.id = :idPredio"),
@NamedQuery(name = "CatPredioS4.findByFrente1", query = "SELECT c FROM CatPredioS4 c WHERE c.frente1 = :frente1"),
@NamedQuery(name = "CatPredioS4.findByFrente2", query = "SELECT c FROM CatPredioS4 c WHERE c.frente2 = :frente2"),
@NamedQuery(name = "CatPredioS4.findByFrente3", query = "SELECT c FROM CatPredioS4 c WHERE c.frente3 = :frente3"),
@NamedQuery(name = "CatPredioS4.findByFrente4", query = "SELECT c FROM CatPredioS4 c WHERE c.frente4 = :frente4"),
@NamedQuery(name = "CatPredioS4.findByFrenteTotal", query = "SELECT c FROM CatPredioS4 c WHERE c.frenteTotal = :frenteTotal"),
@NamedQuery(name = "CatPredioS4.findByFondo1", query = "SELECT c FROM CatPredioS4 c WHERE c.fondo1 = :fondo1"),
@NamedQuery(name = "CatPredioS4.findByFondo2", query = "SELECT c FROM CatPredioS4 c WHERE c.fondo2 = :fondo2"),
@NamedQuery(name = "CatPredioS4.findByAreaCalculada", query = "SELECT c FROM CatPredioS4 c WHERE c.areaCalculada = :areaCalculada"),
@NamedQuery(name = "CatPredioS4.findByNumHombres", query = "SELECT c FROM CatPredioS4 c WHERE c.numHombres = :numHombres"),
@NamedQuery(name = "CatPredioS4.findByNumMujeres", query = "SELECT c FROM CatPredioS4 c WHERE c.numMujeres = :numMujeres"),
@NamedQuery(name = "CatPredioS4.findByNumAdultos", query = "SELECT c FROM CatPredioS4 c WHERE c.numAdultos = :numAdultos"),
@NamedQuery(name = "CatPredioS4.findByNumNinos", query = "SELECT c FROM CatPredioS4 c WHERE c.numNinos = :numNinos")})
@org.hibernate.annotations.DynamicUpdate
public class CatPredioS4 implements Serializable {
private static final long serialVersionUID = 8799656478674716638L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SchemasConfig.APPUNISEQ_ORM)
@SequenceGenerator(name = SchemasConfig.APPUNISEQ_ORM, sequenceName = SchemasConfig.APP1 + "." + SchemasConfig.APPUNISEQ_DB, allocationSize = 1)
@Basic(optional = false)
@Column(name = "id", nullable = false)
@Expose
private Long id;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "frente1", precision = 10, scale = 2)
@Expose
@ReportField(description = "Frente")
private BigDecimal frente1;
@Column(name = "frente2", precision = 10, scale = 2)
@Expose
private BigDecimal frente2;
@Column(name = "frente3", precision = 10, scale = 2)
@Expose
private BigDecimal frente3;
@Column(name = "frente4", precision = 10, scale = 2)
@Expose
private BigDecimal frente4;
@Column(name = "superficie", precision = 10, scale = 2)
@Expose
private BigDecimal superfice;
@Column(name = "frente_total", precision = 10, scale = 2)
@Expose
private BigDecimal frenteTotal;
@ReportField(description = "Fondo Relativo")
@Column(name = "fondo1", precision = 10, scale = 5)
@Expose
private BigDecimal fondo1;
@Column(name = "fondo2", precision = 10, scale = 2)
@Expose
private BigDecimal fondo2;
@Column(name = "area_calculada", precision = 15, scale = 2)
@Expose
private BigDecimal areaCalculada;
@Column(name = "num_hombres")
@Expose
private Short numHombres;
@Column(name = "num_mujeres")
@Expose
private Short numMujeres;
@Column(name = "num_adultos")
@Expose
private Short numAdultos;
@Column(name = "num_ninos")
@Expose
private Short numNinos;
@Column(name = "area_escritura", precision = 15, scale = 2)
@Expose
private BigDecimal areaEscritura;
@Column(name = "area_grafica_lote", precision = 10, scale = 6)
@Expose
@ReportField(description = "Área Gráfica")
private BigDecimal areaGraficaLote;
@JoinTable(name = "cat_predio_s4_has_accesibilidad", joinColumns = {
@JoinColumn(name = "predio_s4", referencedColumnName = "id", nullable = false)}, inverseJoinColumns = {
@JoinColumn(name = "accesibilidad_ctlg", referencedColumnName = "id", nullable = false)})
@ManyToMany(fetch = FetchType.LAZY)
private Collection<CtlgItem> accesibilidadList;
@JoinColumn(name = "topografia", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
private CtlgItem topografia;
@JoinColumn(name = "tipo_suelo", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
private CtlgItem tipoSuelo;
@JoinColumn(name = "loc_manzana", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
@ReportField(description = "Localizacion en Mz", type = FieldType.COLLECTION_ONE_TO_ONE)
private CtlgItem locManzana;
@JoinColumn(name = "cobertura_predominante", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
@ReportField(description = "Cobertura predominante", type = FieldType.COLLECTION_ONE_TO_ONE)
private CtlgItem coberturaPredominante;
@JoinColumn(name = "ecosistema_relevante", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
@ReportField(description = "Ecosistema Relevante", type = FieldType.COLLECTION_ONE_TO_ONE)
private CtlgItem ecosistemaRelevante;
@JoinColumn(name = "estado_solar", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
@ReportField(description = "Ocupacion", type = FieldType.COLLECTION_ONE_TO_ONE)
private CtlgItem estadoSolar;
@JoinColumn(name = "cerramiento_ctlg", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
private CtlgItem cerramientoCtlg;
@JoinColumn(name = "tipo_obra_mejora", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
private CtlgItem tipoObraMejora;
@JoinColumn(name = "material_mejora", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
private CtlgItem materialMejora;
@JoinColumn(name = "estado_mejora", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
private CtlgItem estadoMejora;
@Column(name = "area_mejora", precision = 10, scale = 6)
@Expose
private BigDecimal areaMejora;
@JoinColumn(name = "predio", referencedColumnName = "id", nullable = false)
@OneToOne(optional = false, fetch = FetchType.LAZY)
private CatPredio predio;
@JoinColumn(name = "riesgo", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
@ReportField(description = "Tipo de Riesgos", type = FieldType.COLLECTION_ONE_TO_ONE)
private CtlgItem riesgo;
@JoinColumn(name = "erosion", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
@ReportField(description = "Erosión", type = FieldType.COLLECTION_ONE_TO_ONE)
private CtlgItem erosion;
@JoinColumn(name = "drenaje", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
@ReportField(description = "Drenaje", type = FieldType.COLLECTION_ONE_TO_ONE)
private CtlgItem drenaje;
@Column(name = "tiene_hipoteca")
@Expose
private Boolean tieneHipoteca;
@Column(name = "inst_financiera_hip")
@Expose
private String instFinancieraHip;
@Column(name = "lote_en_conflicto")
@Expose
private Boolean loteEnConflicto;
@Column(name = "opbserv_lote_en_conflicto")
@Expose
private String opbservLoteEnConflicto;
@Column(name = "tiene_permiso_const")
@Expose
private Boolean tienePermisoConst;
@Column(name = "tiene_adosamiento")
@Expose
private Boolean tieneAdosamiento;
@Column(name = "tiene_retiros")
@Expose
private Boolean tieneRetiros;
@JoinColumn(name = "afectacion_lote", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
private CtlgItem afectacionLote;
@JoinColumn(name = "unidadm_area_grafica", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
private CtlgItem unidadmAreaGrafica;
@JoinColumn(name = "nivel_terreno", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
private CtlgItem nivelTerreno;
@Column(name = "area_acceso_priv", precision = 10, scale = 3)
@Expose
@ReportField(description = "Área acceso privado")
private BigDecimal areaAccesoPriv;
@JoinColumn(name = "rodadura", referencedColumnName = "id")
@ManyToOne(fetch = FetchType.LAZY)
@Expose
@ReportField(description = "Material de Rodadura", type = FieldType.COLLECTION_ONE_TO_ONE)
private CtlgItem rodadura;
@Column(name = "recursos_propios")
@Expose
private Boolean recursosPropios;
public CatPredioS4() {
}
public CatPredioS4(Long id) {
this.id = id;
}
public BigDecimal getAreaAccesoPriv() {
return areaAccesoPriv;
}
public BigDecimal getAreaEscritura() {
return areaEscritura;
}
public void setAreaEscritura(BigDecimal areaEscritura) {
this.areaEscritura = areaEscritura;
}
public void setAreaAccesoPriv(BigDecimal areaAccesoPriv) {
this.areaAccesoPriv = areaAccesoPriv;
}
public CtlgItem getRodadura() {
return rodadura;
}
public void setRodadura(CtlgItem rodadura) {
this.rodadura = rodadura;
}
public Boolean getRecursosPropios() {
return recursosPropios;
}
public void setRecursosPropios(Boolean recursosPropios) {
this.recursosPropios = recursosPropios;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public BigDecimal getFrente1() {
return frente1;
}
public void setFrente1(BigDecimal frente1) {
this.frente1 = frente1;
}
public BigDecimal getFrente2() {
return frente2;
}
public void setFrente2(BigDecimal frente2) {
this.frente2 = frente2;
}
public BigDecimal getFrente3() {
return frente3;
}
public void setFrente3(BigDecimal frente3) {
this.frente3 = frente3;
}
public BigDecimal getFrente4() {
return frente4;
}
public void setFrente4(BigDecimal frente4) {
this.frente4 = frente4;
}
/**
* Porcentaje de excedente o diferencia de actualizacion de areas y linderos
*
* @return
*/
public BigDecimal getFrenteTotal() {
return frenteTotal;
}
/**
* Porcentaje de excedente o diferencia de actualizacion de areas y linderos
*
* @param frenteTotal
*/
public void setFrenteTotal(BigDecimal frenteTotal) {
this.frenteTotal = frenteTotal;
}
public BigDecimal getFondo1() {
return fondo1;
}
public void setFondo1(BigDecimal fondo1) {
this.fondo1 = fondo1;
}
public BigDecimal getFondo2() {
return fondo2;
}
public void setFondo2(BigDecimal fondo2) {
this.fondo2 = fondo2;
}
/**
* Almacena el area de las desmenbraciones para el proceso de actualizacion
* de areas y linderos
*
* @return Area de desmenbracion
*/
public BigDecimal getAreaCalculada() {
return areaCalculada;
}
/**
* Almacena el area de las desmenbraciones para el proceso de actualizacion
*
* @param areaCalculada Area de desmenbracion
*/
public void setAreaCalculada(BigDecimal areaCalculada) {
this.areaCalculada = areaCalculada;
}
public Short getNumHombres() {
return numHombres;
}
public void setNumHombres(Short numHombres) {
this.numHombres = numHombres;
}
public Short getNumMujeres() {
return numMujeres;
}
public void setNumMujeres(Short numMujeres) {
this.numMujeres = numMujeres;
}
public Short getNumAdultos() {
return numAdultos;
}
public void setNumAdultos(Short numAdultos) {
this.numAdultos = numAdultos;
}
public Short getNumNinos() {
return numNinos;
}
public void setNumNinos(Short numNinos) {
this.numNinos = numNinos;
}
public CtlgItem getTopografia() {
return topografia;
}
@XmlTransient
@JsonIgnore
public Collection<CtlgItem> getAccesibilidadList() {
return accesibilidadList;
}
public void setAccesibilidadList(Collection<CtlgItem> accesibilidadList) {
this.accesibilidadList = accesibilidadList;
}
public void setTopografia(CtlgItem topografia) {
this.topografia = topografia;
}
public CtlgItem getTipoSuelo() {
return tipoSuelo;
}
public void setTipoSuelo(CtlgItem tipoSuelo) {
this.tipoSuelo = tipoSuelo;
}
public CtlgItem getLocManzana() {
return locManzana;
}
public void setLocManzana(CtlgItem locManzana) {
this.locManzana = locManzana;
}
public CtlgItem getCerramientoCtlg() {
return cerramientoCtlg;
}
public void setCerramientoCtlg(CtlgItem cerramientoCtlg) {
this.cerramientoCtlg = cerramientoCtlg;
}
public CtlgItem getEstadoSolar() {
return estadoSolar;
}
public void setEstadoSolar(CtlgItem estadoSolar) {
this.estadoSolar = estadoSolar;
}
public CatPredio getPredio() {
return predio;
}
public void setPredio(CatPredio predio) {
this.predio = predio;
}
public CtlgItem getCoberturaPredominante() {
return coberturaPredominante;
}
public void setCoberturaPredominante(CtlgItem coberturaPredominante) {
this.coberturaPredominante = coberturaPredominante;
}
public CtlgItem getEcosistemaRelevante() {
return ecosistemaRelevante;
}
public void setEcosistemaRelevante(CtlgItem ecosistemaRelevante) {
this.ecosistemaRelevante = ecosistemaRelevante;
}
public CtlgItem getRiesgo() {
return riesgo;
}
public void setRiesgo(CtlgItem riesgo) {
this.riesgo = riesgo;
}
public CtlgItem getErosion() {
return erosion;
}
public void setErosion(CtlgItem erosion) {
this.erosion = erosion;
}
public CtlgItem getDrenaje() {
return drenaje;
}
public void setDrenaje(CtlgItem drenaje) {
this.drenaje = drenaje;
}
public BigDecimal getAreaGraficaLote() {
return areaGraficaLote;
}
public void setAreaGraficaLote(BigDecimal areaGraficaLote) {
this.areaGraficaLote = areaGraficaLote;
}
public CtlgItem getTipoObraMejora() {
return tipoObraMejora;
}
public void setTipoObraMejora(CtlgItem tipoObraMejora) {
this.tipoObraMejora = tipoObraMejora;
}
public CtlgItem getMaterialMejora() {
return materialMejora;
}
public void setMaterialMejora(CtlgItem materialMejora) {
this.materialMejora = materialMejora;
}
public CtlgItem getEstadoMejora() {
return estadoMejora;
}
public void setEstadoMejora(CtlgItem estadoMejora) {
this.estadoMejora = estadoMejora;
}
/**
* Se almacena el area escritura ingresada en el proceso de actualizacion de
* areas y linderos
*
* @return Area de escritura
*/
public BigDecimal getAreaMejora() {
return areaMejora;
}
/**
* Se almacena el area escritura ingresada en el proceso de actualizacion de
* predio
*
* @param areaMejora Area de escritura para el proceso de actualizacion de
* areas y linderos
*/
public void setAreaMejora(BigDecimal areaMejora) {
this.areaMejora = areaMejora;
}
public Boolean getTieneHipoteca() {
return tieneHipoteca;
}
public void setTieneHipoteca(Boolean tieneHipoteca) {
this.tieneHipoteca = tieneHipoteca;
}
public String getInstFinancieraHip() {
return instFinancieraHip;
}
public void setInstFinancieraHip(String instFinancieraHip) {
this.instFinancieraHip = instFinancieraHip;
}
public Boolean getLoteEnConflicto() {
return loteEnConflicto;
}
public void setLoteEnConflicto(Boolean loteEnConflicto) {
this.loteEnConflicto = loteEnConflicto;
}
public String getOpbservLoteEnConflicto() {
return opbservLoteEnConflicto;
}
public void setOpbservLoteEnConflicto(String opbservLoteEnConflicto) {
this.opbservLoteEnConflicto = opbservLoteEnConflicto;
}
public Boolean getTienePermisoConst() {
return tienePermisoConst;
}
public void setTienePermisoConst(Boolean tienePermisoConst) {
this.tienePermisoConst = tienePermisoConst;
}
public Boolean getTieneAdosamiento() {
return tieneAdosamiento;
}
public void setTieneAdosamiento(Boolean tieneAdosamiento) {
this.tieneAdosamiento = tieneAdosamiento;
}
public Boolean getTieneRetiros() {
return tieneRetiros;
}
public void setTieneRetiros(Boolean tieneRetiros) {
this.tieneRetiros = tieneRetiros;
}
public CtlgItem getAfectacionLote() {
return afectacionLote;
}
public void setAfectacionLote(CtlgItem afectacionLote) {
this.afectacionLote = afectacionLote;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// : Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CatPredioS4)) {
return false;
}
CatPredioS4 other = (CatPredioS4) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "gob.samborondon.entities.CatPredioS4[ id=" + id + " ]";
}
/**
* Almacena el excendete o la difenrencia
*
* @return Excendete o la difenrencia
*/
public BigDecimal getSuperfice() {
return superfice;
}
/**
* Almacena el excendete o la difenrencia
*
* @param superfice Excendete o la difenrencia
*/
public void setSuperfice(BigDecimal superfice) {
this.superfice = superfice;
}
public CtlgItem getUnidadmAreaGrafica() {
return unidadmAreaGrafica;
}
public void setUnidadmAreaGrafica(CtlgItem unidadmAreaGrafica) {
this.unidadmAreaGrafica = unidadmAreaGrafica;
}
public CtlgItem getNivelTerreno() {
return nivelTerreno;
}
public void setNivelTerreno(CtlgItem nivelTerreno) {
this.nivelTerreno = nivelTerreno;
}
}
| [
"navarroangelr@gmail.com"
] | navarroangelr@gmail.com |
31a2b1be2bcd998e1aedc823f4cddd128e12535e | 0f336e2b778ddd887329c49c3bbd15c42556ae4c | /src/main/java/com/op/gg/ogj/skin/service/valid/SkinValidService.java | d60a785fe0c2ea6dcdd2e79c5e234429818fbb7e | [] | no_license | 13klove/ogj | 3b81598a5e3fbd24a2b96db4f6a5677be9d61544 | e1bff5cef73047eaff2a9860bbdac9905ec47fa9 | refs/heads/master | 2023-05-29T05:44:19.483201 | 2020-09-17T03:36:50 | 2020-09-17T03:36:50 | 283,523,554 | 0 | 0 | null | 2020-09-17T03:36:51 | 2020-07-29T14:38:07 | Java | UTF-8 | Java | false | false | 2,548 | java | package com.op.gg.ogj.skin.service.valid;
import com.op.gg.ogj.character.model.entity.Character;
import com.op.gg.ogj.character.repository.CharacterJpaRepository;
import com.op.gg.ogj.character.valid.CharacterValid;
import com.op.gg.ogj.skin.model.dto.SkinParam;
import com.op.gg.ogj.skin.model.dto.SkinSearch;
import com.op.gg.ogj.skin.model.entity.Skin;
import com.op.gg.ogj.skin.repository.SkinJpaRepository;
import com.op.gg.ogj.skin.valid.SkinValid;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class SkinValidService {
private final SkinJpaRepository skinJpaRepository;
private final CharacterJpaRepository characterJpaRepository;
public void createSkinValid(SkinParam skinParam) {
createUpdateValid(skinParam);
Skin skin = skinJpaRepository.findSkinByCharacter_CharacterIdAndSkinNmAndActYnTrue(skinParam.getCharacterId(), skinParam.getSkinNm());
SkinValid.SKIN_EXIT_SKIN.validLogic(skin);
}
public void updateSkinValid(SkinParam skinParam) {
SkinValid.SKIN_SKIN_ID_LOCK.validLogic(skinParam.getSkinId());
createUpdateValid(skinParam);
Skin skin = skinJpaRepository.findSkinByCharacter_CharacterIdAndSkinNmAndSkinIdIsNotAndActYnTrue(skinParam.getCharacterId(), skinParam.getSkinNm(), skinParam.getSkinId());
SkinValid.SKIN_EXIT_SKIN.validLogic(skin);
}
public void pageSkinValid(SkinSearch skinSearch) { CharacterValid.CHARACTER_ID_LOCK.validLogic(skinSearch.getCharacterId()); }
public void detailSkinValid(SkinSearch skinSearch) { SkinValid.SKIN_SKIN_ID_LOCK.validLogic(skinSearch.getSkinId()); }
public void delSkinValid(SkinParam skinParam) {
SkinValid.SKIN_SKIN_ID_LOCK.validLogic(skinParam.getSkinId());
}
public void delSkinsValid(SkinParam skinParam) {
SkinValid.SKIN_SKINS_ID_LOCK.validLogic(skinParam.getSkinsId());
}
private void createUpdateValid(SkinParam skinParam) {
CharacterValid.CHARACTER_ID_LOCK.validLogic(skinParam.getCharacterId());
SkinValid.SKIN_SKIN_NM_LOCK.validLogic(skinParam.getSkinNm());
SkinValid.SKIN_PRICE_LOCK.validLogic(skinParam.getPrice());
Optional<Character> optionalCharacter = characterJpaRepository.findById(skinParam.getCharacterId());
CharacterValid.CHARACTER_NO_HAVE.validLogic(optionalCharacter);
}
}
| [
"13klove@naver.com"
] | 13klove@naver.com |
31a51753d071817ca3bd33ad6ad4c88ec9ee3139 | 197889bb99e574505056dc3f1e5a7732dc513439 | /src/main/java/com/digipay/cardmanagement/dto/TransactionDTO.java | 8f3715a92d6da690fc2966c2f0873b0ad13b3f19 | [] | no_license | mnazarizadeh/digipay-card-management | 484403f980bc675e20b427f460e361a5d2a3ae0c | 8e1e468c5741aa33885304d9712a144bf94a3c5a | refs/heads/master | 2023-05-15T08:24:55.263281 | 2021-06-05T12:54:43 | 2021-06-05T12:54:43 | 373,166,235 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 598 | java | package com.digipay.cardmanagement.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
@Data
@EqualsAndHashCode
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TransactionDTO {
private Long id;
private String source;
private String destination;
private Double amount;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy HH:mm:ss")
private LocalDateTime startTransaction;
private Boolean verified;
}
| [
"m.nazarizadeh@gmail.com"
] | m.nazarizadeh@gmail.com |
255167634c8a7c8e5634561b6b15eeaa9191a633 | 65a8694e464d361287240ceb3916c53556495c38 | /Drop2/src/com/me/drop2/GameScreen.java | 6741b0bd8d89566bebd85ffea2cb312ac8763b10 | [] | no_license | cloudysheep/test-apps | 064bfdbe1534554cb952e67bf416454d3c211374 | 779cd731c9a30cc64186bd8e97e499c63c8fcc7c | refs/heads/master | 2020-05-18T16:54:20.255170 | 2014-03-27T23:48:24 | 2014-03-27T23:48:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,618 | java | package com.me.drop2;
import java.util.Iterator;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.TimeUtils;
public class GameScreen implements Screen {
final Drop2 game;
Texture dropImage;
Texture bucketImage;
Sound dropSound;
Music rainMusic;
OrthographicCamera camera;
Rectangle bucket;
Array<Rectangle> raindrops;
long lastDropTime;
int dropsGathered;
public GameScreen(final Drop2 gam) {
this.game = gam;
// load the images for the droplet and the bucket, 64x64 pixels each
dropImage = new Texture(Gdx.files.internal("data/droplet.png"));
bucketImage = new Texture(Gdx.files.internal("data/bucket.png"));
// load the drop sound effect and the rain background "music"
dropSound = Gdx.audio.newSound(Gdx.files.internal("data/drop.wav"));
rainMusic = Gdx.audio.newMusic(Gdx.files.internal("data/rain.mp3"));
rainMusic.setLooping(true);
// create the camera and the SpriteBatch
camera = new OrthographicCamera();
camera.setToOrtho(false, 800, 480);
// create a Rectangle to logically represent the bucket
bucket = new Rectangle();
bucket.x = 800 / 2 - 64 / 2; // center the bucket horizontally
bucket.y = 20; // bottom left corner of the bucket is 20 pixels above
// the bottom screen edge
bucket.width = 64;
bucket.height = 64;
// create the raindrops array and spawn the first raindrop
raindrops = new Array<Rectangle>();
spawnRaindrop();
}
private void spawnRaindrop() {
Rectangle raindrop = new Rectangle();
raindrop.x = MathUtils.random(0, 800 - 64);
raindrop.y = 480;
raindrop.width = 64;
raindrop.height = 64;
raindrops.add(raindrop);
lastDropTime = TimeUtils.nanoTime();
}
@Override
public void render(float delta) {
// clear the screen with a dark blue color. The
// arguments to glClearColor are the red, green
// blue and alpha component in the range [0,1]
// of the color to be used to clear the screen.
Gdx.gl.glClearColor(0, 0, 0.2f, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
// tell the camera to update its matrices.
camera.update();
// tell the SpriteBatch to render in the
// coordinate system specified by the camera.
game.batch.setProjectionMatrix(camera.combined);
// begin a new batch and draw the bucket and
// all drops
game.batch.begin();
game.font.draw(game.batch, "Drops Collected: " + dropsGathered, 0, 480);
game.batch.draw(bucketImage, bucket.x, bucket.y);
for (Rectangle raindrop : raindrops) {
game.batch.draw(dropImage, raindrop.x, raindrop.y);
}
game.batch.end();
// process user input
if (Gdx.input.isTouched()) {
Vector3 touchPos = new Vector3();
touchPos.set(Gdx.input.getX(), Gdx.input.getY(), 0);
camera.unproject(touchPos);
bucket.x = touchPos.x - 64 / 2;
}
if (Gdx.input.isKeyPressed(Keys.LEFT))
bucket.x -= 200 * Gdx.graphics.getDeltaTime();
if (Gdx.input.isKeyPressed(Keys.RIGHT))
bucket.x += 200 * Gdx.graphics.getDeltaTime();
// make sure the bucket stays within the screen bounds
if (bucket.x < 0)
bucket.x = 0;
if (bucket.x > 800 - 64)
bucket.x = 800 - 64;
// check if we need to create a new raindrop
if (TimeUtils.nanoTime() - lastDropTime > 1000000000)
spawnRaindrop();
// move the raindrops, remove any that are beneath the bottom edge of
// the screen or that hit the bucket. In the later case we play back
// a sound effect as well.
Iterator<Rectangle> iter = raindrops.iterator();
while (iter.hasNext()) {
Rectangle raindrop = iter.next();
raindrop.y -= 200 * Gdx.graphics.getDeltaTime();
if (raindrop.y + 64 < 0)
iter.remove();
if (raindrop.overlaps(bucket)) {
dropsGathered++;
dropSound.play();
iter.remove();
}
}
}
@Override
public void resize(int width, int height) {
}
@Override
public void show() {
// start the playback of the background music
// when the screen is shown
rainMusic.play();
}
@Override
public void hide() {
}
@Override
public void pause() {
}
@Override
public void resume() {
}
@Override
public void dispose() {
dropImage.dispose();
bucketImage.dispose();
dropSound.dispose();
rainMusic.dispose();
}
}
| [
"4w3s0m3ch0c0bunny@gmail.com"
] | 4w3s0m3ch0c0bunny@gmail.com |
6220dd969d7264497c58341eae9d960e2ef78716 | 5b7ca3cdcda51a7cf7b563782241b87d24e02eee | /app/src/main/java/kr/ac/ssu/teachu/model/StudentInformation.java | 328d92169453d040614a845596e36a0aa59b60d2 | [] | no_license | kyeongwan/teachu | 044290bb4fc4d3eacf3d3406d4227ccac3c4d3ad | 965da63f6250e8453504e5e89b9ccdc723448468 | refs/heads/master | 2021-01-10T08:01:25.897487 | 2015-12-09T06:51:47 | 2015-12-09T06:51:47 | 46,865,223 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 115 | java | package kr.ac.ssu.teachu.model;
/**
* Created by nosubin on 2015-12-09.
*/
public class StudentInformation
{
}
| [
"azure_mca@naver.com"
] | azure_mca@naver.com |
4c5462b1b42949c63f15f5d3b5072c047048c865 | 86692210e9c00afab1f941b3da78d6400aa6f977 | /src/main/java/com/bootdo/dispatch/center/res/group/EmergencyTeamResGroup.java | 377e3e560a8f1bc080e3f7166952ca9dc1d8403f | [] | no_license | Dalin-liang/bootdo | 67e4a76f7ed83b1af910f7966abc9022789f57fe | febd8883c96777c9c467abf7e0d6d808b6fcabd1 | refs/heads/master | 2023-06-09T09:09:13.525556 | 2021-06-17T11:21:38 | 2021-06-17T11:21:38 | 377,760,770 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,721 | java | package com.bootdo.dispatch.center.res.group;
import com.bootdo.common.utils.CommonUtils;
import com.bootdo.dispatch.center.base.DispatchResGroup;
import com.bootdo.dispatch.center.res.EmergencyTeamRes;
import com.bootdo.dispatch.center.vo.TeamMemberVO;
import com.bootdo.support.dao.DeptPersonMapper;
import com.bootdo.support.dao.TeamMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @author JunoGuan
* @version 1.0.0
* @create 2019/8/27
*/
@Service
public class EmergencyTeamResGroup implements DispatchResGroup<EmergencyTeamRes> {
@Autowired
private TeamMapper teamMapper;
@Autowired
private DeptPersonMapper deptPersonMapper;
@Override
public List<EmergencyTeamRes> getAllRes() {
List<EmergencyTeamRes> data = teamMapper.getAllTeam();
if(CollectionUtils.isEmpty(data)) return data;
Map<String,EmergencyTeamRes> mapping = new HashMap<>(data.size());
for (EmergencyTeamRes datum : data) {
datum.ready();
mapping.put(datum.getResId(),datum);
}
List<TeamMemberVO> members = deptPersonMapper.getDeptPersonByTeamIds(mapping.keySet());
if(CommonUtils.isEmpty(members)) return data;
String teamId;
EmergencyTeamRes team;
for (TeamMemberVO member : members) {
teamId = member.getTeamId();
team = mapping.get(teamId);
if(team.getMembers()==null){
team.setMembers(new ArrayList<>(10));
}
team.getMembers().add(member);
}
return data;
}
}
| [
"1409939929@qq.com"
] | 1409939929@qq.com |
7a2eff836dfefe43d803c0b342d7a999c2f9c882 | 9a3bc6f5e86d376801b38761d8da8f63900019b0 | /tika-parsers/tika-parsers-classic/tika-parsers-classic-package/src/test/java/org/apache/tika/parser/pkg/GzipParserTest.java | b45c32a133e473631c911741050c7466eb79e2b6 | [
"EPL-1.0",
"ICU",
"LicenseRef-scancode-bsd-simplified-darwin",
"MPL-2.0",
"LicenseRef-scancode-iptc-2006",
"LicenseRef-scancode-proprietary-license",
"MIT",
"Apache-2.0",
"NetCDF",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unrar",
"Classpath-exception-2.0",
"CDDL-1.1",
"LGP... | permissive | rohan2810/tika | 4f43744de4546cd643fb6b21409aaf77268e731d | af7b2e62bcc99e48023fa60da0945ec6e3469170 | refs/heads/main | 2023-04-20T09:24:35.682735 | 2021-02-17T19:54:12 | 2021-02-17T19:54:12 | 341,782,037 | 2 | 0 | Apache-2.0 | 2021-02-24T04:47:44 | 2021-02-24T04:47:44 | null | UTF-8 | Java | false | false | 3,307 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.apache.tika.parser.pkg;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.sax.BodyContentHandler;
import org.junit.Test;
import org.xml.sax.ContentHandler;
import java.io.InputStream;
import static org.junit.Assert.assertEquals;
/**
* Test case for parsing gzip files.
*/
public class GzipParserTest extends AbstractPkgTest {
@Test
public void testGzipParsing() throws Exception {
ContentHandler handler = new BodyContentHandler();
Metadata metadata = new Metadata();
try (InputStream stream = getResourceAsStream("/test-documents/test-documents.tgz")) {
AUTO_DETECT_PARSER.parse(stream, handler, metadata, recursingContext);
}
assertEquals("application/gzip", metadata.get(Metadata.CONTENT_TYPE));
String content = handler.toString();
assertContains("test-documents/testEXCEL.xls", content);
assertContains("Sample Excel Worksheet", content);
assertContains("test-documents/testHTML.html", content);
assertContains("Test Indexation Html", content);
assertContains("test-documents/testOpenOffice2.odt", content);
assertContains("This is a sample Open Office document", content);
assertContains("test-documents/testPDF.pdf", content);
assertContains("Apache Tika", content);
assertContains("test-documents/testPPT.ppt", content);
assertContains("Sample Powerpoint Slide", content);
assertContains("test-documents/testRTF.rtf", content);
assertContains("indexation Word", content);
assertContains("test-documents/testTXT.txt", content);
assertContains("Test d'indexation de Txt", content);
assertContains("test-documents/testWORD.doc", content);
assertContains("This is a sample Microsoft Word Document", content);
assertContains("test-documents/testXML.xml", content);
assertContains("Rida Benjelloun", content);
}
@Test
public void testSvgzParsing() throws Exception {
ContentHandler handler = new BodyContentHandler();
Metadata metadata = new Metadata();
try (InputStream stream = getResourceAsStream("/test-documents/testSVG.svgz")) {
AUTO_DETECT_PARSER.parse(stream, handler, metadata, recursingContext);
}
assertEquals("application/gzip", metadata.get(Metadata.CONTENT_TYPE));
String content = handler.toString();
assertContains("Test SVG image", content);
}
}
| [
"tallison@apache.org"
] | tallison@apache.org |
fa0e400dc256aefc0aa74db9108eac14e98e2496 | 5991a12d8192df71cd5d213b346455d3b26b9391 | /poxiao-service-api/poxiao-system-api/src/main/java/com/poxiao/api/system/model/SysUserOnline.java | c427b003c15070e1147e41ae0e4dc78e5bc53c4b | [] | no_license | poxiao123456/poxiao-cloud | 81aa7ec63d007861261f23e3c2f960970284876c | 929db6d694073db7b5487a02cb84387e1c9ccdfa | refs/heads/master | 2023-03-31T16:57:58.615924 | 2021-03-22T15:11:37 | 2021-03-22T15:11:37 | 350,388,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,649 | java | package com.poxiao.api.system.model;
import com.poxiao.common.core.enums.OnlineStatus;
import com.poxiao.common.core.model.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 当前在线会话 sys_user_online
*
* @author ruoyi
*/
public class SysUserOnline extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 用户会话id */
private String sessionId;
/** 部门名称 */
private String deptName;
/** 登录名称 */
private String loginName;
/** 登录IP地址 */
private String ipaddr;
/** 登录地址 */
private String loginLocation;
/** 浏览器类型 */
private String browser;
/** 操作系统 */
private String os;
/** session创建时间 */
private Date startTimestamp;
/** session最后访问时间 */
private Date lastAccessTime;
/** 超时时间,单位为分钟 */
private Long expireTime;
/** 在线状态 */
private OnlineStatus status = OnlineStatus.on_line;
public String getSessionId()
{
return sessionId;
}
public void setSessionId(String sessionId)
{
this.sessionId = sessionId;
}
public String getDeptName()
{
return deptName;
}
public void setDeptName(String deptName)
{
this.deptName = deptName;
}
public String getLoginName()
{
return loginName;
}
public void setLoginName(String loginName)
{
this.loginName = loginName;
}
public String getIpaddr()
{
return ipaddr;
}
public void setIpaddr(String ipaddr)
{
this.ipaddr = ipaddr;
}
public String getLoginLocation()
{
return loginLocation;
}
public void setLoginLocation(String loginLocation)
{
this.loginLocation = loginLocation;
}
public String getBrowser()
{
return browser;
}
public void setBrowser(String browser)
{
this.browser = browser;
}
public String getOs()
{
return os;
}
public void setOs(String os)
{
this.os = os;
}
public Date getStartTimestamp()
{
return startTimestamp;
}
public void setStartTimestamp(Date startTimestamp)
{
this.startTimestamp = startTimestamp;
}
public Date getLastAccessTime()
{
return lastAccessTime;
}
public void setLastAccessTime(Date lastAccessTime)
{
this.lastAccessTime = lastAccessTime;
}
public Long getExpireTime()
{
return expireTime;
}
public void setExpireTime(Long expireTime)
{
this.expireTime = expireTime;
}
public OnlineStatus getStatus()
{
return status;
}
public void setStatus(OnlineStatus status)
{
this.status = status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("sessionId", getSessionId())
.append("loginName", getLoginName())
.append("deptName", getDeptName())
.append("ipaddr", getIpaddr())
.append("loginLocation", getLoginLocation())
.append("browser", getBrowser())
.append("os", getOs())
.append("status", getStatus())
.append("startTimestamp", getStartTimestamp())
.append("lastAccessTime", getLastAccessTime())
.append("expireTime", getExpireTime())
.toString();
}
}
| [
"2531144851@qq.com"
] | 2531144851@qq.com |
b5812bce3b4ac2013933acb091d3efe0c44501f1 | 487b7f78ae5a34f2be0f964ac00c233c5c367b1e | /src/com/turbulence6th/concurrency/AwaitTermination.java | 86ce88886030d7a65491ca74cc495de9e195b752 | [] | no_license | turbulence6th/OCP | 8f7deb69ee5b918eda212e918db464ecb6c6a594 | 0ea621e009dec6a712fa17967fc3da3407273872 | refs/heads/master | 2021-05-03T11:57:56.203810 | 2018-02-06T16:45:40 | 2018-02-06T16:45:40 | 120,490,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 741 | java | package com.turbulence6th.concurrency;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
public class AwaitTermination {
public static void main(String[] args) throws InterruptedException {
ExecutorService service = null;
try {
service = Executors.newSingleThreadExecutor();
// Add tasks to the thread executor
} finally {
if (service != null)
service.shutdown();
}
if (service != null) {
service.awaitTermination(1, TimeUnit.MINUTES);
// Check whether all tasks are finished
if (service.isTerminated())
System.out.println("All tasks finished");
else
System.out.println("At least one task is still running");
}
}
}
| [
"turbulence6th@gmail.com"
] | turbulence6th@gmail.com |
de2034923ca5f68a1d05c59d02444f029568b9db | 0014743b5125a88766618076f9487892e820eb47 | /src/Ali/ghanmi/com/museummonastery/factories/RoomFactory.java | 319ffb415b2346369c95defde1ddddc2d1327c8e | [] | no_license | dhall2211/CodingCampus2020bb | 19c068688574937cfe67f4aba84a6057bd2d57a8 | 4e4bb8c8f91b2be470e20316094316590c1e7820 | refs/heads/master | 2023-04-09T05:55:24.074296 | 2021-04-17T10:47:55 | 2021-04-17T10:47:55 | 316,331,072 | 6 | 0 | null | 2020-12-15T17:18:13 | 2020-11-26T20:31:08 | Java | UTF-8 | Java | false | false | 401 | java | package Ali.ghanmi.com.museummonastery.factories;
import Ali.ghanmi.com.museummonastery.Room;
import java.util.LinkedList;
public class RoomFactory {
public static LinkedList<Room> createRooms(int count){
LinkedList<Room> rooms = new LinkedList<>();
for (int i = 1; i <= count; i++) {
rooms.add(new Room(Integer.toString(i)));
}
return rooms;
}
} | [
"lenssolution.ag@gmail.com"
] | lenssolution.ag@gmail.com |
aab105ac6a3565efefdcfde36cf047fb07b81545 | 3b63ef18c5993dc71485f2ed4fd22ca5f8fdc181 | /src/main/java/com/zhaoyiheng/cms/controller/AdminController.java | 25b96f20f27eabb906796d9211f7995eb2823380 | [] | no_license | zhaoyiheng666/1706E-zyh-cms | 299c41c36081f3b06b2e632ee2e9c3394d55bba4 | ef60d904b71dd940e37ea507340e8b07219d7e2a | refs/heads/master | 2022-12-24T04:15:54.327399 | 2019-10-23T07:55:48 | 2019-10-23T07:55:48 | 215,495,181 | 0 | 0 | null | 2022-12-16T04:53:30 | 2019-10-16T08:20:26 | JavaScript | UTF-8 | Java | false | false | 4,511 | java | package com.zhaoyiheng.cms.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.github.pagehelper.PageInfo;
import com.zhaoyiheng.cms.comon.ConstClass;
import com.zhaoyiheng.cms.comon.ResultMsg;
import com.zhaoyiheng.cms.entity.Article;
import com.zhaoyiheng.cms.entity.User;
import com.zhaoyiheng.cms.service.ArticleService;
import com.zhaoyiheng.cms.web.PageUtils;
@Controller
@RequestMapping("admin")
public class AdminController {
@Autowired
ArticleService articelService;
@RequestMapping("index")
public String index() {
return "admin/index";
}
@RequestMapping("manArticle")
public String adminArticle(HttpServletRequest request,
@RequestParam(defaultValue="1") Integer page
,@RequestParam(defaultValue="0") Integer status
) {
PageInfo<Article> pageInfo= articelService.getAdminArticles(page,status);
request.setAttribute("pageInfo", pageInfo);
request.setAttribute("status", status);
//page(HttpServletRequest request, String url, Integer pageSize, List<?> list, Long listCount, Integer page) {
// PageUtils.page(request,"/admin/manArticle?status="+status, 10, pageInfo.getList(),(long)pageInfo.getTotal() , pageInfo.getPageNum());
String pageStr = PageUtils.pageLoad(pageInfo.getPageNum(),pageInfo.getPages() , "/admin/manArticle?status="+status, 10);
request.setAttribute("page", pageStr);
return "admin/article/list";
}
@RequestMapping("getArticle")
public String getArticle(HttpServletRequest request,Integer id) {
Article article = articelService.findById(id);
request.setAttribute("article", article);
return "admin/article/detail";
}
/**
* 审核文章
* @param request
* @param articleId 文章的id
* @param status 审核后的状态 1 审核通过 2 不通过
* @return
*/
@RequestMapping("checkArticle")
@ResponseBody
public ResultMsg checkArticle(HttpServletRequest request,Integer articleId,int status) {
User login = (User)request.getSession().getAttribute(ConstClass.SESSION_USER_KEY);
if(login == null) {
return new ResultMsg(2, "对不起,您尚未登录,不能审核文章", null);
}
if(login.getRole()!= ConstClass.USER_ROLE_ADMIN) {
return new ResultMsg(3, "对不起,您没有权限审核文章", null);
}
Article article = articelService.findById(articleId);
if(article==null) {
return new ResultMsg(4, "哎呀,没有这篇文章!!", null);
}
if(article.getStatus()==status) {
return new ResultMsg(5, "这篇文章的状态就是您要审核的状态,无需此操作!!", null);
}
int result = articelService.updateStatus(articleId,status);
if(result>0) {
return new ResultMsg(1, "恭喜,审核成功!!", null);
}else {
return new ResultMsg(5, "很遗憾,操作失败,请与管理员联系或者稍后再试!!", null);
}
}
/**
* 设置热门
* @param request
* @param articleId 文章的id
* @param status 热门状态 1 审核通过 2 不通过
* @return
*/
@RequestMapping("sethot")
@ResponseBody
public ResultMsg sethot(HttpServletRequest request,Integer articleId,int status) {
User login = (User)request.getSession().getAttribute(ConstClass.SESSION_USER_KEY);
if(login == null) {
return new ResultMsg(2, "对不起,您尚未登录,不能修改文章热门状态", null);
}
if(login.getRole()!= ConstClass.USER_ROLE_ADMIN) {
return new ResultMsg(3, "对不起,您没有权限修改文章热门状态", null);
}
Article article = articelService.findById(articleId);
if(article==null) {
return new ResultMsg(4, "哎呀,没有这篇文章!!", null);
}
if(article.getHot() == status) {
return new ResultMsg(5, "这篇文章的状态就是您要修改的状态,无需此操作!!", null);
}
int result = articelService.updateHot(articleId,status);
if(result>0) {
return new ResultMsg(1, "恭喜,审核成功!!", null);
}else {
return new ResultMsg(5, "很遗憾,操作失败,请与管理员联系或者稍后再试!!", null);
}
}
}
| [
"1007476922@qq.com"
] | 1007476922@qq.com |
8f6069f018161e2f90fea780f76eb9bca4fbde71 | 0e909125b4c53d184239f4ae699880597e2dd7a4 | /Exercise/src/datastructure/trees/huffmandecoding/TreeHuffmanDecoding.java | 1ed6e489bbe4f8243734cd552ce378c473e00b39 | [] | no_license | sangmanla/Exercise | 26d56ab91fdb9979ab82d2ec74df272163132b46 | c63ee851f03be57c746591a6689afff21b20de57 | refs/heads/master | 2023-04-06T15:58:18.449872 | 2021-04-15T04:45:21 | 2021-04-15T04:45:21 | 129,639,796 | 0 | 0 | null | 2023-03-27T22:17:20 | 2018-04-15T18:42:22 | Java | UTF-8 | Java | false | false | 4,014 | java | package datastructure.trees.huffmandecoding;
import java.util.*;
/**
* https://www.hackerrank.com/challenges/tree-huffman-decoding/problem
* @author sam
*
*/
public class TreeHuffmanDecoding {
// input is an array of frequencies, indexed by character code
public static Node buildTree(int[] charFreqs) {
PriorityQueue<Node> trees = new PriorityQueue<Node>();
// initially, we have a forest of leaves
// one for each non-empty character
for (int i = 0; i < charFreqs.length; i++)
if (charFreqs[i] > 0)
trees.offer(new HuffmanLeaf(charFreqs[i], (char)i));
assert trees.size() > 0;
// loop until there is only one tree left
while (trees.size() > 1) {
// two trees with least frequency
Node a = trees.poll();
Node b = trees.poll();
// put into new node and re-insert into queue
trees.offer(new HuffmanNode(a, b));
}
return trees.poll();
}
public static Map<Character,String> mapA=new HashMap<Character ,String>();
public static void printCodes(Node tree, StringBuffer prefix) {
assert tree != null;
if (tree instanceof HuffmanLeaf) {
HuffmanLeaf leaf = (HuffmanLeaf)tree;
// print out character, frequency, and code for this leaf (which is just the prefix)
//System.out.println(leaf.data + "\t" + leaf.frequency + "\t" + prefix);
mapA.put(leaf.data,prefix.toString());
} else if (tree instanceof HuffmanNode) {
HuffmanNode node = (HuffmanNode)tree;
// traverse left
prefix.append('0');
printCodes(node.left, prefix);
prefix.deleteCharAt(prefix.length()-1);
// traverse right
prefix.append('1');
printCodes(node.right, prefix);
prefix.deleteCharAt(prefix.length()-1);
}
}
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String test= input.next();
// we will assume that all our characters will have
// code less than 256, for simplicity
int[] charFreqs = new int[256];
// read each character and record the frequencies
for (char c : test.toCharArray())
charFreqs[c]++;
// build tree
Node tree = buildTree(charFreqs);
// print out results
printCodes(tree, new StringBuffer());
StringBuffer s = new StringBuffer();
for(int i = 0; i < test.length(); i++) {
char c = test.charAt(i);
s.append(mapA.get(c));
}
//System.out.println(s);
Decoding d = new Decoding();
d.decode(s.toString(), tree);
}
}
abstract class Node implements Comparable<Node> {
public int frequency; // the frequency of this tree
public char data;
public Node left, right;
public Node(int freq) {
frequency = freq;
}
// compares on the frequency
public int compareTo(Node tree) {
return frequency - tree.frequency;
}
}
class HuffmanLeaf extends Node {
public HuffmanLeaf(int freq, char val) {
super(freq);
data = val;
}
}
class HuffmanNode extends Node {
public HuffmanNode(Node l, Node r) {
super(l.frequency + r.frequency);
left = l;
right = r;
}
}
class Decoding {
/*
* class Node public int frequency; // the frequency of this tree public
* char data; public Node left, right;
*
*/
void decode(String s, Node root) {
Node cur = root;
for(char ch : s.toCharArray()){
if(ch == '1') {
cur = cur.right;
}else{
cur = cur.left;
}
if(cur instanceof HuffmanLeaf){
System.out.print(cur.data);
cur = root;
}
}
System.out.println();
}
} | [
"sangmanla@naver.com"
] | sangmanla@naver.com |
e56029493fdd07208c02afefa4d104a580dd1ab7 | 871af4d8669819ee914c69f1e1a0e71aece84ccc | /app/src/main/java/com/example/jmack/paint/MainActivity.java | 03e57123fb02238be93860edfbc832a7536db3a5 | [] | no_license | jmccormack200/PaintDrawingApp | 87da17d2009aaaf46e6a8c04ac272a61bd0c95c1 | 5b930129acc5d4256a8be814e50156015bbd780d | refs/heads/master | 2021-01-19T01:47:52.729445 | 2016-06-09T19:22:38 | 2016-06-09T19:22:38 | 59,851,072 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,561 | java | package com.example.jmack.paint;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import java.util.ArrayList;
import java.util.Objects;
import butterknife.ButterKnife;
import butterknife.InjectView;
/**
* The main activity lays out the UI and sets up the animations.
*/
public class MainActivity extends AppCompatActivity {
private static final boolean COLLAPSE = true;
private static final float strokeWidth = 8.0f;
private static final String TRANSLATION_Y = "translationY";
private static final String TRANSLATION_X = "translationX";
private boolean collapsePal = COLLAPSE;
private ArrayList<ViewOffsetPair> paletteArrayList = new ArrayList<>();
private boolean collapseBrush = COLLAPSE;
private ArrayList<ViewOffsetPair> brushArrayList = new ArrayList<>();
private float mStartLocation;
private String mTranslation;
@InjectView(R.id.drawview)
DrawView mDrawView;
@InjectView(R.id.sdbrush)
ViewGroup brushContainer;
@InjectView(R.id.sdpallete)
ViewGroup paletteContainer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.inject(this);
mTranslation = (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) ?
TRANSLATION_Y : TRANSLATION_X;
initCollapseFAB(paletteContainer, paletteArrayList);
initCollapseFAB(brushContainer, brushArrayList);
}
public void initCollapseFAB(final ViewGroup fabContainer,
final ArrayList<ViewOffsetPair> fabArrayList) {
View rootView = fabContainer.getChildAt(0);
mStartLocation = Objects.equals(mTranslation, TRANSLATION_Y) ? rootView.getY() : rootView.getX();
fabContainer.getViewTreeObserver()
.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
fabContainer.getViewTreeObserver().removeOnPreDrawListener(this);
for (int i = (fabContainer.getChildCount() - 1); i > 0; i--) {
View button = fabContainer.getChildAt(i);
View prevButton = fabContainer.getChildAt(i - 1);
float offset;
if (Objects.equals(mTranslation, TRANSLATION_Y)) {
offset = button.getY() - prevButton.getY();
prevButton.setTranslationY(offset);
} else {
offset = button.getX() - prevButton.getX();
prevButton.setTranslationX(offset);
}
ViewOffsetPair viewOffsetPair =
new ViewOffsetPair(fabContainer.getChildAt(i - 1), offset);
fabArrayList.add(viewOffsetPair);
}
return true;
}
});
}
public void onClickPalette(View view) {
collapsePal = !collapsePal;
collapseExpandSpeedDial(paletteArrayList, collapsePal);
}
public void onClickBrush(View view) {
collapseBrush = !collapseBrush;
collapseExpandSpeedDial(brushArrayList, collapseBrush);
}
public void onClickColor(View view) {
ColorStateList colorStateList = view.getBackgroundTintList();
assert colorStateList != null;
mDrawView.changeColor(colorStateList.getDefaultColor());
onClickPalette(view);
}
//TODO: I'd like to take another look at this as the solution feels hacked together.
public void onClickBrushSize(View view) {
for (int i = 0; i < brushContainer.getChildCount(); i++) {
if (brushContainer.getChildAt(i) == view) {
mDrawView.changeStrokeWidth(i * strokeWidth);
}
}
onClickBrush(view);
}
private void collapseExpandSpeedDial(ArrayList<ViewOffsetPair> viewOffsetPairArrayList, boolean collapse) {
AnimatorSet animatorSet = new AnimatorSet();
ArrayList<Animator> animatorArrayList = new ArrayList<>();
for (int i = 0; i < viewOffsetPairArrayList.size(); i++) {
Animator animator = collapseExpandAnimator(
viewOffsetPairArrayList.get(i).getView(),
viewOffsetPairArrayList.get(i).getOffset(),
collapse);
animatorArrayList.add(animator);
}
animatorSet.playTogether(animatorArrayList);
animatorSet.start();
}
private Animator collapseExpandAnimator(View view, float offset, boolean collapse) {
float start = (collapse) ? mStartLocation : offset;
float end = (collapse) ? offset : mStartLocation;
return ObjectAnimator.ofFloat(view, mTranslation, start, end)
.setDuration(getResources().getInteger(android.R.integer.config_mediumAnimTime));
}
public void undoLastLineDrawn(View view) {
mDrawView.clear();
}
}
| [
"mccormack.wgsi@gmail.com"
] | mccormack.wgsi@gmail.com |
16081adcf12c2a0ea2842f4bd774806969b78305 | d7c8038dfe27cb04148455525cfdcfd6dc2d2949 | /app/src/main/java/com/imls/maridoaluguel/Util/Cripto.java | d62a0671a45705a9ceb1c96054e630ac9fbaf5b4 | [] | no_license | MarAlu/SOS-Marido-de-Aluguel-Aplicativo-para-Prestadores-de-Servico | 2e649b4bdae9be416bfd652ef3156f5efaf59d72 | 060158c92ed7880b2be03dc480be10b7dc2469b2 | refs/heads/master | 2020-09-22T02:18:57.993823 | 2019-12-20T20:35:12 | 2019-12-20T20:35:12 | 225,015,504 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 693 | java | package com.imls.maridoaluguel.Util;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class Cripto {
public String converteSt(String senha) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest algorithm = MessageDigest.getInstance("SHA-256");
byte messageDigest[] = algorithm.digest(senha.getBytes("UTF-8"));
StringBuilder hexString = new StringBuilder();
for (byte b : messageDigest) {
hexString.append(String.format("%02X", 0xFF & b));
}
String senhahex = hexString.toString();
return senhahex;
}
}
| [
"marido19aluguel@hotmail.com"
] | marido19aluguel@hotmail.com |
8514626e17d232800366f2879dd00bf9373bcee3 | 61e83c2700e255e833a99a12f05429616fe353d1 | /Practice 3/Palindrome/src/oop/Main.java | 43138daad4341e9815261c0e9ab8545b79b55334 | [] | no_license | SumonAtikul/Java-Practice | 67afd528ace52a4144ca76ac49ffff415625c1ee | ee3c416a3d19034dc1d092116f023844b5f51e1d | refs/heads/main | 2023-08-21T19:35:17.346649 | 2021-10-10T17:17:11 | 2021-10-10T17:17:11 | 415,647,954 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 579 | java | package oop;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner input=new Scanner(System.in);
int num, r, temp, sum=0;
num = input.nextInt();
temp=num;
while(temp!=0)
{
r = temp%10;
sum = sum*10+r;
temp=temp/10;
}
if(sum==num)
{
System.out.println("Palindrome");
}
else
{
System.out.println("NOT");
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
49c4a3a72662eca8347f4748b9a0cc7dd93a2066 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-14263-8-22-NSGA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/display/internal/DefaultDocumentDisplayer_ESTest.java | bf6e18c96cb618065274a2fab8d842db6d872cf8 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 581 | java | /*
* This file was automatically generated by EvoSuite
* Thu Apr 02 23:59:28 UTC 2020
*/
package org.xwiki.display.internal;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class DefaultDocumentDisplayer_ESTest extends DefaultDocumentDisplayer_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
22932f20d5b540e296a651c04249b72487be1b5c | da9d6f51e8e90107262310b7f24f530b9f99edd1 | /Accounting/src/com/invoice/purchase/service/VoucherServiceImpl.java | ef3359157942083882c4deef0e87f9ba2c2467e0 | [] | no_license | ReformistSolutions/Accounting | 1c813e3e9ac09dafab9b5f1e6efb7528364260ce | ddbd3983ce95582ae0e09f84df1dbe4dafa20f6a | refs/heads/master | 2016-09-06T17:56:01.680761 | 2014-12-27T11:34:48 | 2014-12-27T11:34:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,300 | java | package com.invoice.purchase.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.invoice.accounting.beans.NewAccount;
import com.invoice.company.beans.CompanyDetails;
import com.invoice.purchase.beans.PurchaseVoucher;
import com.invoice.purchase.beans.Purchases;
import com.invoice.purchase.beans.Vender;
import com.invoice.purchase.dao.VoucherDao;
@Component(value="voucherService")
public class VoucherServiceImpl implements VoucherService{
VoucherDao voucherDoa;
public VoucherDao getVoucherDoa() {
return voucherDoa;
}
@Autowired
public void setVoucherDoa(VoucherDao voucherDoa) {
this.voucherDoa = voucherDoa;
}
@Transactional(rollbackFor=Exception.class)
@Override
public int saveVoucher(PurchaseVoucher purchaseVoucher) {
int i = voucherDoa.saveVoucher(purchaseVoucher);
return i;
}
@Override
public List<PurchaseVoucher> showVoucher() {
return voucherDoa.showVoucher();
}
@Override
public List<PurchaseVoucher> viewEnquiry(String voucherNo) {
return voucherDoa.viewVoucher(voucherNo);
}
@Override
public List<NewAccount> showAccountNo() {
return voucherDoa.showAccountNo();
}
@Override
public PurchaseVoucher autoId() {
return voucherDoa.autoId();
}
@Override
public int updateVoucher(PurchaseVoucher purchaseVoucher) {
return voucherDoa.updateVoucher(purchaseVoucher);
}
@Override
public List<Purchases> showPurchaseId() {
return voucherDoa.showPurchaseId();
}
@Override
public List<CompanyDetails> getInfo(CompanyDetails companyDetails) {
return voucherDoa.getInfo(companyDetails);
}
@Override
public int delete(String voucherId,float amt) {
return voucherDoa.delete(voucherId,amt);
}
@Override
public List<Vender> retrriveVenderInfo(String vendId, String id) {
return voucherDoa.retrriveVenderInfo(vendId, id);
}
@Override
public List<NewAccount> retriveAccount(String paymode)
{
return voucherDoa.retriveAccount(paymode);
}
@Override
public String avlBalance(String orderId)
{
return voucherDoa.avlBalance(orderId);
}
}
| [
"Reformist@Reformist-PC1"
] | Reformist@Reformist-PC1 |
a9d72bfbe13d88e3930ed010bd012469685e4c3a | b0ba28905410ff45245f17e97b47ab2259ed0f2c | /app/src/main/java/com/example/aaa/photoedittools/LUTFilter.java | e2e33865eeaa8c7d9744c4d59f54685d2a790c3b | [] | no_license | lanhuawei/photoedittools | 38403834fb1bf0791148a09c06cc7a752d6a0c92 | a9edaebd18d4b29cd2d128b9119708bd7b514b48 | refs/heads/master | 2021-01-01T17:54:26.586802 | 2017-07-24T13:50:48 | 2017-07-24T13:50:48 | 98,195,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 926 | java | package com.example.aaa.photoedittools;
/**
* Created by aaa on 2016/1/22.
*/
import com.example.aaa.photoedittools.IImageFilter.Function;
public class LUTFilter implements IImageFilter{
protected int[] m_LUT = new int[256] ;
protected int InitLUTtable (int nLUTIndex){
return nLUTIndex;
}
public Image process(Image imageIn)
{
for (int i=0 ; i <= 0xFF ; i++)
m_LUT[i] = InitLUTtable (i) ;
int r, g, b;
for(int x = 0 ; x < (imageIn.getWidth() - 1) ; x++){
for(int y = 0 ; y < (imageIn.getHeight() - 1) ; y++){
r = imageIn.getRComponent(x, y);
g = imageIn.getGComponent(x, y);
b = imageIn.getBComponent(x, y);
imageIn.setPixelColor(x, y, Image.SAFECOLOR(m_LUT[r]), Image.SAFECOLOR(m_LUT[g]), Image.SAFECOLOR(m_LUT[b]));
}
}
return imageIn;
}
}
| [
"974801031@qq.com"
] | 974801031@qq.com |
da3b1f053a50a0ec657eedf384a4b2a5b94dc65d | 757ff0e036d1c65d99424abb5601012d525c2302 | /sources/com/fimi/kernel/fds/IFdsFileModel.java | 4dbcfe59c7941426929c1ce7ab82eb604e32b826 | [] | no_license | pk1z/wladimir-computin-FimiX8-RE-App | 32179ef6f05efab0cf5af0d4957f0319abe04ad0 | 70603638809853a574947b65ecfaf430250cd778 | refs/heads/master | 2020-11-25T21:02:17.790224 | 2019-12-18T13:28:48 | 2019-12-18T13:28:48 | 228,845,415 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 734 | java | package com.fimi.kernel.fds;
import java.io.File;
import java.util.concurrent.Future;
public interface IFdsFileModel {
File getFile();
String getFileFdsUrl();
String getFileSuffix();
String[] getNeedZipFileBySuffix();
String getObjectName();
FdsUploadTask getRunable();
FdsUploadState getState();
Future<?> getTaskFutrue();
File getZipFile();
void resetFile(File file);
void setFileFdsUrl(String str);
void setFileSuffix(String str);
void setObjectName(String str);
void setRunable(FdsUploadTask fdsUploadTask);
void setState(FdsUploadState fdsUploadState);
void setTaskFutrue(Future<?> future);
void setZipFile(File file);
void stopTask();
}
| [
"you@example.com"
] | you@example.com |
323cabedbb1de5205ab0cb004f53bfd34a3d42da | 1c085d9d044f6a091091e8cde7cff04e2e56c4e0 | /src/homework/week3/Task5.java | b52a07e4cc687f2bad3510149375f4916ab40d32 | [] | no_license | anastasia1296/Homework-week1- | 3ed200730012aa60237c8cc19b6ddd41dd17c0a7 | a4c48b8b96d9f52b97cbbe229e0889b22dd78835 | refs/heads/master | 2021-01-19T08:27:49.778368 | 2017-05-15T19:34:04 | 2017-05-15T19:34:04 | 87,634,453 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 554 | java | package homework.week3;
/**
* Created by Anastasya on 29.04.2017.
*/
//6. Требуется найти самую длинную непрерывную цепочку нулей и единиц в последовательности цифр.
public class Task5 {
public static void main(String[] args) {
int[] numbers = {1, 1, 1, 1, 0, 0, 0, 0, 9, 7};
int max = numbers[0];
int max1=0;
int counter = 1;
for (int i = 0; i < numbers.length; i++) {
}
System.out.println(numbers[0]);
}
} | [
"ivanko.anastasia@gmail.com"
] | ivanko.anastasia@gmail.com |
871dfcd0ae04ada7f8234c3d5c15d85415e69287 | ac49190345e921dded73833e24bd2ca7a0a31578 | /HW06-0036489629/tests/multistack/hr/fer/zemris/java/tecaj/hw6/demo3/PrimesCollectionTest.java | 8843a8e842c6a6e0852f9882750ec609203b937b | [] | no_license | the-JJ/FER-OPJJ | a15871cfd042662bebb1416969b2e96832c0ec07 | fce1288119b60c3a3666c09c463fdc7d208d1888 | refs/heads/master | 2021-06-01T18:00:16.700192 | 2016-09-03T10:58:24 | 2016-09-03T10:58:24 | 67,282,608 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,508 | java | package hr.fer.zemris.java.tecaj.hw6.demo3;
import static org.junit.Assert.*;
import java.util.Iterator;
import java.util.NoSuchElementException;
import org.junit.Test;
import hr.fer.zemris.java.tecaj.hw6.demo3.PrimesCollection;
@SuppressWarnings("javadoc")
public class PrimesCollectionTest {
private final Integer[] primes = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31,
37, 41, 43, 47, 53 };
@SuppressWarnings("unused")
@Test
public void constructorTest() {
PrimesCollection primator = new PrimesCollection(15);
}
@SuppressWarnings("unused")
@Test(expected = IllegalArgumentException.class)
public void invalidConstructorTest() {
PrimesCollection primator = new PrimesCollection(0);
}
@SuppressWarnings("unused")
@Test(expected = IllegalArgumentException.class)
public void invalidConstructorTest2() {
PrimesCollection primator = new PrimesCollection(-1);
}
@Test
public void primeNumbersTest() {
PrimesCollection primator = new PrimesCollection(primes.length);
int i = 0;
for (Integer x : primator) {
assertEquals(primes[i++], x);
}
}
@Test
public void outOfRangeTest() {
PrimesCollection primator = new PrimesCollection(2);
Iterator<Integer> primterator = primator.iterator();
assertEquals(primes[0], primterator.next());
assertEquals(primes[1], primterator.next());
assertFalse(primterator.hasNext());
try {
primterator.next();
} catch (NoSuchElementException e) {
return;
}
fail("Expected NoSuchElementException.");
}
}
| [
"juraj.juricic@gmail.com"
] | juraj.juricic@gmail.com |
8ab1daee65d0c984c64be233db8032a3f1ce5f72 | 13bc6a2869040ae391b8270bbd6e71ec9ad9c57d | /src/java/codificacion/UTF8Filter.java | 98576ec777774149145e04aaffabbdd4e9b48a4e | [] | no_license | mfdborja/rutassegurasjsp | 52b40a9c9659ba6352b6bbb9278657885f2b001c | 387b997726abb2ccd377d6d2ab43206345c02cd0 | refs/heads/master | 2020-06-11T14:11:55.277814 | 2016-12-05T17:12:04 | 2016-12-05T17:12:04 | 75,648,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,429 | java |
package codificacion;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
/**
* Filtro para que la aplicación acepte codificación en formato UTF-8
*/
public class UTF8Filter implements Filter {
private String encoding;
/**
* Recogemos el tipo de codificación definido en el web.xml
* Si no se hubiera especificado ninguno se toma "UTF-8" por defecto
*/
public void init( FilterConfig filterConfig ) throws ServletException {
encoding = filterConfig.getInitParameter( "requestEncoding" );
if( encoding == null ) {
encoding = "UTF-8";
}
}
/**
* Metemos en la request el formato de codificacion UTF-8
*/
public void doFilter( ServletRequest request, ServletResponse response, FilterChain fc )
throws IOException, ServletException {
request.setCharacterEncoding( encoding );
fc.doFilter( request, response );
}
public void destroy() {}
}
| [
""
] | |
fd65b414aa3c95770421051e66872150254725df | fc8b7fddbb62de6a63768f95f157358f3c1e6fc9 | /dx-boot-mvc/src/main/java/com/dx/mvc/controller/VueController.java | 6fa0de1553c682744213f2980a7938b7ba51d07f | [] | no_license | rockstarsteve/dx-boot | c4ceffe22d2580253078dc543e8d97feae5337ba | 0a414fc3f3b0fa3f5da8ed9a072a4bebd76d1fe6 | refs/heads/master | 2021-02-27T11:09:56.672122 | 2020-03-14T06:00:43 | 2020-03-14T06:00:43 | 142,303,790 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 916 | java | package com.dx.mvc.controller;
import com.dx.mvc.bean.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Date;
/**
* Description: com.dx.controller
*
* @author yaoj
* @version 1.0
* @copyright Copyright (c) 文理电信
* @since 2019/9/22
*/
@RestController
@RequestMapping("/vue")
public class VueController {
@RequestMapping("/getData")
public Object getData() {
ArrayList<User> userArrayList = new ArrayList<>();
userArrayList.add(new User("tom", "tom001", "湖南",new Date()));
userArrayList.add(new User("tom2", "tom002", "湖北",new Date()));
userArrayList.add(new User("tom", "tom001", "湖南",new Date()));
userArrayList.add(new User("tom2", "tom002", "湖北",new Date()));
return userArrayList;
}
}
| [
"670139644@qq.com"
] | 670139644@qq.com |
bea5bda56ddd21537be739f53563d0f1d57a340f | 67a37cb15d1ed6ada4c2c1faf9f454d89d93670b | /app/src/main/java/org/drupalchamp/myapp/DatabaseAccess.java | ff482d497d0377305255f51dad2f3abb270c107c | [] | no_license | ankitanandmonu/MyApp | 592f9c25a23a9dc47f7ee2a40356b8fcc9be7cc0 | 266c7389c036eaf3c8a4232734b135c589f3ea23 | refs/heads/master | 2020-12-24T20:42:58.411301 | 2016-04-26T11:00:07 | 2016-04-26T11:00:07 | 57,120,301 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,518 | java | package org.drupalchamp.myapp;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import org.drupalchamp.myapp.model.Contact;
import java.util.ArrayList;
import java.util.List;
/**
* Created by ANKIT ANAND
* Date: 3/4/2016
* Time: 4:30 PM
*/
public class DatabaseAccess {
private SQLiteOpenHelper openHelper;
private SQLiteDatabase database;
private static DatabaseAccess instance;
/**
* Private constructor to aboid object creation from outside classes.
*
* @param context
*/
private DatabaseAccess(Context context) {
this.openHelper = new DatabaseOpenHelper(context);
}
/**
* Return a singleton instance of DatabaseAccess.
*
* @param context the Context
* @return the instance of DabaseAccess
*/
public static DatabaseAccess getInstance(Context context) {
if (instance == null) {
instance = new DatabaseAccess(context);
}
return instance;
}
/**
* Open the database connection.
*/
public void open() {
this.database = openHelper.getWritableDatabase();
}
/**
* Close the database connection.
*/
public void close() {
if (database != null) {
this.database.close();
}
}
/**
* Insert a contact into the database.
*
* @param contact the contact to be inserted
*/
public void insertContact(Contact contact) {
ContentValues values = new ContentValues();
values.put("first_name", contact.getFirstName());
values.put("last_name", contact.getLastName());
values.put("phone", contact.getPhone());
values.put("email", contact.getEmail());
database.insert("Contact", null, values);
}
/**
* Read all contacts from the database.
*
* @return a List of Contacts
*/
public List<Contact> getContacts() {
List<Contact> list = new ArrayList<>();
Cursor cursor = database.rawQuery("SELECT * FROM Contact", null);
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
Contact contact = new Contact();
contact.setFirstName(cursor.getString(0));
contact.setLastName(cursor.getString(1));
contact.setPhone(cursor.getString(2));
contact.setEmail(cursor.getString(3));
list.add(contact);
cursor.moveToNext();
}
cursor.close();
return list;
}
/**
* Update the contact details.
*
* @param oldContact the old contact to be replaced
* @param newContact the new contact to replace
*/
public void updateContact(Contact oldContact, Contact newContact) {
ContentValues values = new ContentValues();
values.put("first_name", newContact.getFirstName());
values.put("last_name", newContact.getLastName());
values.put("phone", newContact.getPhone());
values.put("email", newContact.getEmail());
database.update("Contact", values, "phone = ?", new String[]{oldContact.getPhone()});
}
/**
* Delete the provided contact.
*
* @param contact the contact to delete
*/
public void deleteContact(Contact contact) {
database.delete("Contact", "phone = ?", new String[]{contact.getPhone()});
database.close();
}
}
| [
"User"
] | User |
96d839313495f0b8d991272de2e43369d8ae336e | dbea0bf336f1b7a115a773d975034c762888a116 | /src/main/java/net/imglib2/ops/relation/real/binary/RealLessThanOrEqual.java | d6618a82f7c3b3debdb265fb082cd07bad80d88e | [
"BSD-2-Clause"
] | permissive | bnorthan/imagej-ops | 1232a7f47a847d7af12d7106d51395c2b25b8789 | defeee0eecc113b05685dcc6f0f475060ea1d943 | refs/heads/master | 2021-01-18T09:04:26.218233 | 2014-11-04T21:12:17 | 2014-11-04T21:12:17 | 21,213,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,203 | java | /*
* #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2014 Board of Regents of the University of
* Wisconsin-Madison and University of Konstanz.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package net.imglib2.ops.relation.real.binary;
import net.imglib2.ops.relation.BinaryRelation;
import net.imglib2.type.numeric.RealType;
/**
* Given two real values returns true of the first is less than or equal to the
* second.
*
* @author Barry DeZonia
* @deprecated Use net.imagej.ops instead.
*/
@Deprecated
public final class RealLessThanOrEqual<T extends RealType<T>, U extends RealType<U>>
implements BinaryRelation<T,U>
{
// -- BinaryRelation methods --
@Override
public boolean holds(T val1, U val2) {
return val1.getRealDouble() <= val2.getRealDouble();
}
@Override
public RealLessThanOrEqual<T,U> copy() {
return new RealLessThanOrEqual<T,U>();
}
}
| [
"aparna.pal.1994@gmail.com"
] | aparna.pal.1994@gmail.com |
abbc9dbf7eefd0a20f47011b6bc99c82d486541d | 7e4e96278d6d8b398975587cc9d5e828d4068655 | /dugnad/src/main/java/com/mortenporten/dugnad/core/dao/PersonDao.java | 9c2cc1403e6a101a7aadf23e8d6554a850a3cc39 | [] | no_license | mortenporten/dugnad | 6f6aa73b49d346c9ab49c76420c5639af3cb1343 | 25cb7105254d5e87a41e0e582daa49b65f530e40 | refs/heads/master | 2021-01-10T20:04:58.438922 | 2012-07-30T17:25:19 | 2012-07-30T17:25:19 | 2,768,200 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 446 | java | package com.mortenporten.dugnad.core.dao;
import java.util.List;
import com.mortenporten.dugnad.core.persistence.Duty;
import com.mortenporten.dugnad.core.persistence.Person;
public interface PersonDao {
Person findPersonById(String id);
List<Person> findAllPersons();
public void addPerson(Person person);
public void deletePerson(String id);
void updatePerson(Person person);
boolean containsPerson(Person person);
}
| [
"morteniporten@gmail.com"
] | morteniporten@gmail.com |
c714673a4ad3f23441059d599d0d7d7abbfb38f1 | 9bc98f0e691e9b945bf65d8010eda9de0e010fb8 | /src/main/java/cn/xtrui/database/mapper/FileMapper.java | 3da964b0982c1d880b67ea54d299f294ffa0beca | [] | no_license | xtrui/apistore | 7cea7f5234a2436b21526473e6eaea2f3341ecb6 | 9144c90ddfdcf6e7171568773d947c0f1649c7eb | refs/heads/master | 2022-05-30T01:51:55.743077 | 2019-09-21T03:43:07 | 2019-09-21T03:43:07 | 206,906,014 | 0 | 0 | null | 2022-05-20T21:08:01 | 2019-09-07T02:46:15 | Java | UTF-8 | Java | false | false | 1,082 | java | package cn.xtrui.database.mapper;
import cn.xtrui.database.bean.MyFile;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.Vector;
@Mapper
public interface FileMapper {
@Select("select count(*) from file")
public Integer count();
@Select("select * from file where id = #{id}")
public MyFile getFileById(Integer id);
@Select("select * from file where type = #{type}")
public Vector<MyFile> getFilesByType(String type);
@Select("select * from file where name=#{fileName}")
public MyFile getFileByFileName(String fileName);
@Select("select * from file where id between 10* (#{page}-1) and 10*#{page}")
public Vector<MyFile> getFilesByPage(Integer page);
@Delete("delete from file where id = #{id}")
public boolean deleteFileById(Integer id);
@Insert("insert into file(name,path,type,time) values(#{name},#{path},#{type},NOW())")
public boolean insertFile(MyFile myFile);
}
| [
"haitongjie@qq.com"
] | haitongjie@qq.com |
114bb4914b5e84f98c37d1f5b484178fb9c520f3 | 44035dc0764806ff48b0e08bae4132d9d230753a | /app/src/main/java/com/nikhilchauhan/firestoretodo/ItemClickListner.java | 8ce249fdf2871feec9668041c6ac154bed3b1d9e | [] | no_license | surajsahani/FirestoreTodoApp-Android | a6dbd5f05152e3b99821c9ba7e2e78c930d6f75c | 37fb7c30bd447713bebad3349ea8645d32c3d783 | refs/heads/master | 2022-02-12T23:49:15.352528 | 2019-09-10T07:35:58 | 2019-09-10T07:35:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 173 | java | package com.nikhilchauhan.firestoretodo;
import android.view.View;
public interface ItemClickListner {
void onClick(View view, int Postion, boolean isLongClick);
}
| [
"nikkhil0018@Nikhils-MacBook-Pro.local"
] | nikkhil0018@Nikhils-MacBook-Pro.local |
f78911e3610c87851f8dd2cb27fef64184284073 | b772cf62ac6aa3eb5763eb4c1ff34f52c75a2efd | /src/Triangle.java | 294c25d48c37afab1659e9a5c7299df4ea57bd27 | [] | no_license | iangus/SE1021_Lab3 | ee675b54d3676405219d31954c995fec306c38c9 | 66a9350d732de340319f3ef4a3b202bd28a8cf91 | refs/heads/master | 2021-01-10T10:17:39.313932 | 2016-02-04T05:57:06 | 2016-02-04T05:57:06 | 50,598,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,359 | java |
/**
* SE1021 - 032
* Winter 2016
* Lab 3
* Name: Ian Guswiler
* Created: 12/17/2015
*/
import edu.msoe.se1010.winPlotter.WinPlotter;
import java.awt.Color;
/**
* This class represents a Triangle
* @author Ian Guswiler
* @version 12/20/2015
*/
public class Triangle extends Shape{
protected double base;
protected double height;
/**
* Creates the Triangle
* @param x_origin cartesian x-origin of this Triangle
* @param y_origin cartesian y-origin of this Triangle
* @param b base (along x-axis) of this Triangle
* @param h height (along y-axis) of this Triangle
* @param c the java.awt.Color for this Triangle
*/
public Triangle(double x_origin, double y_origin, double b, double h, Color c){
super(x_origin, y_origin, c);
if (b > 0 && h > 0) {
this.base = b;
this.height = h;
} else {
throw new IllegalArgumentException("Triangle base or height is a negative number.");
}
}
/**
* Draws the Triangle
* @param plotter reference to a WinPlotter object used for drawing
*/
public void draw(WinPlotter plotter){
setPenColor(plotter);
plotter.moveTo(xo,yo);
plotter.drawTo(xo + base, yo);
plotter.drawTo(xo + base/2, yo + height);
plotter.drawTo(xo,yo);
}
}
| [
"iangus97@gmail.com"
] | iangus97@gmail.com |
09ea5fc6e28e8d9186e32fc0b702cb543d40a1c4 | f413d9bb59a1c305f251ff9f5cabec670fd22ea2 | /src/main/java/com/chenxin/authority/dao/BaseRoleModuleRepository.java | ef1a46dc504130fecd3d6723eb7de03662aae205 | [] | no_license | tomlxq/authority | b1a3bc0029a967f87c2f4187dc8726e1edd7d646 | cf46673ec2c07150a1e1e313c8f4a954742c0ffc | refs/heads/master | 2021-01-21T21:43:16.632498 | 2016-05-15T12:57:30 | 2016-05-15T12:57:30 | 28,711,826 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 670 | java | package com.chenxin.authority.dao;
import java.util.List;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.chenxin.authority.pojo.BaseRoleModule;
public interface BaseRoleModuleRepository extends PagingAndSortingRepository<BaseRoleModule, Long>, JpaSpecificationExecutor<BaseRoleModule> {
@Modifying
@Query("delete BaseRoleModule u where u.roleId = ?1")
Integer deleteByRoleId(Long roleId);
List<BaseRoleModule> findByRoleId(Long roleId);
}
| [
"21429503@qq.com"
] | 21429503@qq.com |
1e1ee5b37a300a24e42acdee355436b556d38248 | 2632556bc71f5ad4f8f4ec099a5741f05a7d7195 | /Java_Ex/Skinnable.java | 60e179e58b83e6afca6e2ca81231bbf44439ef56 | [] | no_license | jmas1526/schoo | 6ff037693ed10b1347b931ed5daa30cd4e93d7f1 | 422959ff50baeb82a0b5c26d9604d3d1c3351242 | refs/heads/master | 2022-08-23T13:52:36.638443 | 2020-05-22T02:56:55 | 2020-05-22T02:56:55 | 265,762,290 | 0 | 0 | null | 2020-05-21T05:26:08 | 2020-05-21T05:26:08 | null | UTF-8 | Java | false | false | 139 | java |
public interface Skinnable {
int BLACK = 0;
int RED = 1;
int GREEN = 2;
int BLUE = 3;
int LEOPARD = 4;
void changeSkin(int skin);
}
| [
"65693690+jmas1526@users.noreply.github.com"
] | 65693690+jmas1526@users.noreply.github.com |
01216f47d7c2fec14647dc5a74bd3bec5640ab0e | ca3821fc4ef0d9787ff18a0fca55bf640198a352 | /ebiz-xjf-pom/ebiz-xjf-api/src/main/java/com/xjf/wemall/api/constant/errorCode/ServiceErrorCode.java | 7d8bcade3620cea3f326797cfd2f78b743eafbe3 | [] | no_license | xiejiefeng/newMvcRepository | 00d14fc279ea49750bce226a530f97bc3712e5ef | 697fe8bf4c963923b2ea81b26945b1885c4f4a01 | refs/heads/master | 2021-01-23T21:13:03.521957 | 2017-03-02T08:54:43 | 2017-03-02T08:54:43 | 48,986,025 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,178 | java | /*
* Copyright (C), 2013-2014, 上海汽车集团股份有限公司
* FileName: ServiceErrorCode.java
* Author: baowenzhou
* Date: 2015年09月28日 下午5:25:43
* Description: //模块目的、功能描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package com.xjf.wemall.api.constant.errorCode;
import com.xjf.wemall.api.constant.api.Code;
/**
* 接口异常代码定义<br>
* 定义接口连接错误、连接成功、
*
* @author baowenzhou
* @see [相关类/方法](可选)
* @since [产品/模块版本] (可选)
*/
public enum ServiceErrorCode implements Code<String>{
HTTP_ENCODING("S000001"),
HTTP_IO("S000002"),
HTTP_SECURITY("S000003"),
URL_ENCODE("S000004"),
BEAN_COPY("S000005");
/**异常CODE*/
private String code;
/***
* 默认构造函数
* @param code 代码
*/
private ServiceErrorCode(String code){
this.code = code;
}
/**
* {@inheritDoc}
*/
public String code() {
return this.code;
}
}
| [
"xiejiefeng333@hotmail.com"
] | xiejiefeng333@hotmail.com |
8da073c14825ff51b6ee24ea00f3bc98f16ddf94 | f13fbc97c300bd2fb44dc4e20a8bc24b926f6b0d | /src/main/java/com/packt/webstore/validator/CategoryValidator.java | b072a4e1b6c8b5b14daa1d6aeb5b25017fadab9e | [] | no_license | erlingm/spring-mvc-beginner | ee5ddd3fbcc57dd4830ea495ddfce371e34ea370 | 38846a43e160e2e86cc8ec00fe307e7e3a27d929 | refs/heads/main | 2021-11-10T19:37:31.994009 | 2021-11-08T20:10:51 | 2021-11-08T20:10:51 | 72,732,439 | 1 | 0 | null | 2021-11-08T19:23:43 | 2016-11-03T10:04:31 | Java | UTF-8 | Java | false | false | 697 | java | package com.packt.webstore.validator;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.Arrays;
import java.util.List;
/**
* Created by Erling Molde on 19.11.2016.
*/
public class CategoryValidator implements ConstraintValidator<Category, String> {
private List<String> allowedCategories;
public CategoryValidator() {
allowedCategories = Arrays.asList("Smartphone", "Tablet", "Laptop", "Head phones");
}
public void initialize(Category constraintAnnotation) {
}
public boolean isValid(String value, ConstraintValidatorContext context) {
return allowedCategories.contains(value);
}
} | [
"erling.molde@moldesoft.no"
] | erling.molde@moldesoft.no |
9ba22cf85ea4a854c8b6b769302a624e1d68ec0f | 93ac2cd9f8f6b4a62ac65b7dd64d3eacd0d129ac | /LAB1/src/ElectricShaver.java | 70a6b44920f58f448d0ad25a54203555404d949d | [] | no_license | YazHek/Lab_Java_1 | 9a4fbd95411cf3a09889711c15ead55ae695f024 | c8827b228419aad065bd3956010560600944a7d8 | refs/heads/master | 2020-04-24T02:23:05.343949 | 2019-06-04T08:40:41 | 2019-06-04T08:40:41 | 171,421,993 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,754 | java | public class ElectricShaver {
private static int howMuchShavers = 0;
protected boolean hasWirelessCharghing;
protected boolean isWaterproof;
private int power;
private String model;
private int workTime;
private int changingNozzles;
private String company;
ElectricShaver(){
this(2, "Company", 3, 10, "Model", true, false);
}
ElectricShaver(int WorkTime, String Company, int ChangingNozzles, int Power, String Model, boolean HasWirelessCharghing, boolean Iswaterproof){
this.workTime = WorkTime;
this.company = Company;
this.changingNozzles = ChangingNozzles;
this.power = Power;
this.model = Model;
this.hasWirelessCharghing = true;
this.isWaterproof = false;
howMuchShavers++;
}
ElectricShaver(int WorkTime, String Company, int ChanghingNozzles){
this(WorkTime, Company, ChanghingNozzles, 10, "model", true, false);
}
public void setWorkTime(int WorkTime){
this.workTime = WorkTime;
}
public int getWorkTime(){
return workTime;
}
public void setCompany (String Company){
this.company = Company;
}
public String getCompany(){
return company;
}
public void setChangingNozzles (int ChanghingNozzles){
this.changingNozzles = ChanghingNozzles;
}
public int getChangingNozzles(){
return changingNozzles;
}
public void setPower(int Power){
this.power = Power;
}
public int getPower(){
return power;
}
public void setModel( String Model){
this.model = Model;
}
public String getModel(){
return model;
}
public String toString(){
return "Working Time: " + workTime
+ ", Company: " + company
+ ", Changhing Nozzles: "
+ changingNozzles + ", Power: "
+ power + ", Model: "
+ model + ", Has Wireless Charge: "+ hasWirelessCharghing
+ ", Is Waterproof " + isWaterproof;
}
public void printSvaluse(){
printStaticValue();
}
static void printStaticValue(){
System.out.println("Number Of Shavers:" + howMuchShavers);
}
public void resetValues(int WorkTime, String Company, int ChanghingNozzles, int Power, String Model, boolean HasWirelessCharghing, boolean Iswaterproof){
this.workTime = WorkTime;
this.company = Company;
this.changingNozzles = ChanghingNozzles;
this.power = Power;
this.model = Model;
this.hasWirelessCharghing = HasWirelessCharghing;
this.isWaterproof = Iswaterproof;
}
}
| [
"kruchookjarema@gmail.com"
] | kruchookjarema@gmail.com |
9f2630b2f9bc23bf958b7229278fc474b0f7b913 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_80c0bc88880c8842a498451d9bacbb16b096eee1/BTNode/5_80c0bc88880c8842a498451d9bacbb16b096eee1_BTNode_t.java | bcf8b7c3c5b10d9c55cd888e7bf4f16b944beeeb | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,958 | java | //Ashley Barton
//October 11th, 2013
//Project 1 - BTNode class
import java.util.*;
public class BTNode<E extends Integer> {
private E data;
private BTNode<E> left;
private BTNode<E> right;
private BTNode<E> root;
public BTNode(E initialData, BTNode<E> initialLeft, BTNode<E> initialRight)
{
data = initialData;
left = initialLeft;
right = initialRight;
}
public E getData()
{
return data;
}
public BTNode<E> getLeft()
{
return left;
}
public BTNode<E> getRight()
{
return right;
}
public void setData(E newData)
{
data = newData;
}
public void setLeft(BTNode<E> newLeft)
{
left = newLeft;
}
public void setRight(BTNode<E> newRight)
{
right= newRight;
}
/* public void remove(E removeValue, BTNode <E> node)
{
if(node == null)
{
System.out.println(removeValue + "does not exist");
}
else if(removeValue < node.getData())
{
left.remove(removeValue, left.node);
}
else if(removeValue > node.getData())
{
right.remove(removeValue, right.node);
}
else(removeValue == node.getData()
{
//remove node
//find the largest of the smallest node
//replace that value with the current node and set it equal to null
}
}
*/
public void insert(E insertValue, BTNode<E> node)
{
if(node == null)
{
//need to set something up
//new BTNode<Integer>(insertValue, null, null);
}
else if(insertValue < getData())
{
left.insert(insertValue, left);
}
else if(insertValue > getData())
{
right.insert(insertValue, right);
}
else if(insertValue == getData())
{
System.out.println(insertValue + " already exists, ignore.");
}
}
public String inOrderTrav()
{
if(left !=null)
left.inOrderTrav();
System.out.print(data);
if(right != null)
right.inOrderTrav();
return "wat";
}
public String preOrderTrav()
{
System.out.println(data);
if(left !=null)
left.preOrderTrav();
if(right != null)
right.preOrderTrav();
return "wat";
}
public String postOrderTrav()
{
if(left !=null)
left.postOrderTrav();
if(right != null)
right.postOrderTrav();
System.out.println(data);
return "wat";
}
/*
public BTNode<E> predecessor(BTNode<E> source)
{
}
*/
/*
public BTNode<E> successor(BTNode <E> source)
{
if(source.getData() == data)
if(left !=null)
{
left.inOrderTrav();
}
if(right != null)
{
right.inOrderTrav();
}
}
*/
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
5281a75b4eb7c6b7818c8b0974bc1288561a4c02 | c0073ddebb4c4cb88ca43882a52b73809dba4602 | /spring-recipes/src/main/java/com/sdcuike/spring/demo/domain/ActorDO.java | cfab3d836ce24650bf39f0cb5ac7a1e9a12dc8d2 | [
"Apache-2.0"
] | permissive | codecry/all_learning_201806 | d13f04e479c63e397648ef8828308b4f2cf6a0a3 | 7554fbe58b4a985adb3fbe43016de5641da90c18 | refs/heads/master | 2021-09-20T23:55:58.596922 | 2018-08-17T06:23:14 | 2018-08-17T06:23:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 288 | java | package com.sdcuike.spring.demo.domain;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@NoArgsConstructor
public class ActorDO {
private Short actorId;
private String firstName;
private String lastName;
private Date lastUpdate;
} | [
"sdcuike@aol.com"
] | sdcuike@aol.com |
ccf2d5ce0f0f63b255c2f24f2ef4773ca290740b | 9b184244c3f137e0e9a76296d534656a7d24ba2a | /AccelerometerApp/app/src/main/java/com/spencerpeters/accelerometerapp/ComputedData.java | e4d433c65f099b899a13d498b8d6d8ca7afea775 | [] | no_license | veksarev/dubhacks | 4afeee622293bc18a7c152435e4bc65ca87e1aa8 | b2da814354dc997da80e18f56f4608bd60cd63c6 | refs/heads/master | 2020-02-26T16:07:42.639213 | 2016-10-17T00:21:52 | 2016-10-17T00:21:52 | 71,034,776 | 0 | 0 | null | 2016-10-16T22:04:45 | 2016-10-16T06:46:48 | Java | UTF-8 | Java | false | false | 1,224 | java | package com.spencerpeters.accelerometerapp;
/**
* Created by Spencer on 10/16/16.
*/
public class ComputedData {
public static final int MICROSECONDS_PER_SECOND = 1000000;
public int numPeaks;
public int restingTime;
public int totalTime;
public ComputedData(int numPeaks, int restingTime, int totalTime) {
this.numPeaks = numPeaks;
this.restingTime = restingTime;
this.totalTime = totalTime;
}
// seconds
public ComputedData convertToStandard() {
int restingTime = this.restingTime / MICROSECONDS_PER_SECOND;
int totalTime = this.totalTime / MICROSECONDS_PER_SECOND;
return new ComputedData(this.numPeaks, restingTime, totalTime);
}
public ComputedData delta(ComputedData previous) {
int deltaNumPeaks = this.numPeaks - previous.numPeaks;
int deltaRestingTime = this.restingTime - previous.restingTime;
int deltaTotalTime = this.totalTime - previous.totalTime;
return new ComputedData(deltaNumPeaks, deltaRestingTime, deltaTotalTime);
}
// reps / minute after conversion to standard
public double getFrequency() {
return (double) this.numPeaks * 60 / this.totalTime;
}
}
| [
"spencer@goebelpeters.com"
] | spencer@goebelpeters.com |
d52081d21e58dc7411c3e19d95a5137025dfa72b | ec7b9ebe3f011f6057915d69d21046f09abb0661 | /00.BaseInput/0B303软件项目管理课程相关/开发平台与工具/demo/src/main/java/org/pku/cms/dao/BaseDAO.java | d81aad84d60d6dac3636af40822ba9c6e1752e30 | [
"Apache-2.0"
] | permissive | PKUSS/IDP | a0bb9e3f15a3c4f7dd84016e9831086d86614fa4 | 2dee476201a23e9a4810d9458ae4436c592e6ac4 | refs/heads/master | 2021-01-10T19:11:46.745955 | 2013-10-29T07:29:15 | 2013-10-29T07:29:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 313 | java | package org.pku.cms.dao;
import java.io.Serializable;
import org.pku.cms.model.BaseModel;
import com.googlecode.genericdao.dao.jpa.GenericDAO;
/**
* @author Rick
*
*/
public interface BaseDAO< T extends BaseModel, ID extends Serializable> extends GenericDAO<T, ID>{
public boolean tempDelete(T entity);
}
| [
"1563656796@qq.com"
] | 1563656796@qq.com |
8494c301abf7fa02af413c4a3eb2e57e574f73dc | 8ae6739aed5fdadb8ba3697efafddc90e9926789 | /src/main/java/Seftic/UI/AnadirStock.java | f59e548e59b1f494945091883d90ce6c08356bbb | [] | no_license | JonAnderAsua/SefticAlmacen | 98e73b0aadbd7e809738ac80e2061ac49cb52c7f | eabd56e48365a40c148e7472d4769dd844247056 | refs/heads/master | 2023-07-06T21:52:08.223273 | 2021-08-16T11:04:08 | 2021-08-16T11:04:24 | 386,612,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,786 | java | package Seftic.UI;
import Seftic.App;
import Seftic.DB.RecursosKud;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import java.sql.SQLException;
public class AnadirStock {
@FXML
private TextField descField;
@FXML
private ComboBox<String> comboBoxTipo;
@FXML
private TextField nombreField;
@FXML
private Label labelAviso;
private App app;
private RecursosKud rk = RecursosKud.getInstance();
@FXML
void anadirClick(ActionEvent event) throws SQLException {
if(descField.getText() == null){
descField.setText("");
}
if(nombreField.getText() == null || comboBoxTipo.getValue() == null){
labelAviso.setText("Por favor rellena los campos obligatorios...");
}
else{
boolean existe = rk.comprobarNombre(nombreField.getText());
if(existe){
labelAviso.setText("El producto que quieres añadir ya está en la DB");
}
else{
rk.anadirProducto(nombreField.getText(),descField.getText(),0,comboBoxTipo.getValue());
app.actualizarListaStock();
labelAviso.setText("El producto " + nombreField.getText() + " se ha añadido");
}
}
}
@FXML
void limpiarClick(ActionEvent event) {
descField.setText("");
labelAviso.setText("");
nombreField.setText("");
}
@FXML
void volverClick(ActionEvent event) {
app.mostrarInventario();
}
public void setMainApp(App app) {
this.app = app;
}
@FXML
void initialize(){
comboBoxTipo.getItems().clear();
comboBoxTipo.getItems().addAll("PC", "Video", "Red", "Otro");
}
}
| [
"jonanderasua@gmail.com"
] | jonanderasua@gmail.com |
af0974e7849b235a1b5dcaf2f880e7bc08678d0d | 2a7845907e7eae0a1eb0e37447fd03e2e011fd66 | /serialport/src/main/java/com/youdeyi/serialport/data/CheckStatusCommandParseImpl.java | 6d8179d24aebd65c4e00c8f16d6ad48b70e31bf1 | [] | no_license | ruichaoqun/custom | 8d5118d6f87247eb7010ec69b2389a9a6c55465e | 15f9066dad374baf020566e8ad6b159b6e679a0f | refs/heads/master | 2020-09-06T22:23:10.157483 | 2019-11-09T06:56:11 | 2019-11-09T06:56:11 | 220,573,439 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,475 | java | package com.youdeyi.serialport.data;
import com.youdeyi.serialport.Constant;
import com.youdeyi.serialport.ErrorCode;
/**
* @author Rui Chaoqun
* @date :2019/11/8 14:38
* description:轮询指令应答指令处理类
*/
public class CheckStatusCommandParseImpl extends ICommandParse<String>{
public CheckStatusCommandParseImpl(CallBack callBack) {
super(callBack);
}
@Override
public void parseCommand(String hexStr) {
CheckStatusInfo info = CheckStatusInfo.parseCheckStatusInfo(hexStr);
switch (info.getResult()){
case 0:
break;
case 1:
mCallBack.onError(ErrorCode.ERROR_OVER_CURRENT);
return;
case 2:
mCallBack.onError(ErrorCode.ERROR_OFFLINE);
return;
case 3:
mCallBack.onError(ErrorCode.ERROR_OVERTIME);
return;
default:
}
switch (info.getState()){
case 0:
break;
case 1:
//出货中,继续轮询发送指令
mRealSerialPort.sendCommand(Constant.FULL_POLL_STSTUS);
break;
case 2:
//出货成功,光眼检测到物品掉落
if(info.getPhoteEyeState() == 0){
mCallBack.onCommandRecieve("");
}
break;
default:
}
}
}
| [
"ruichaoqun121@163.com"
] | ruichaoqun121@163.com |
808a6bc4bec468ad9081fa3aabbb5b12802cc6d7 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Math-3/org.apache.commons.math3.util.MathArrays/BBC-F0-opt-70/tests/10/org/apache/commons/math3/util/MathArrays_ESTest.java | 87b64a09dcf953447add4b960c3170797743e803 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 68,717 | java | /*
* This file was automatically generated by EvoSuite
* Tue Oct 19 15:25:51 GMT 2021
*/
package org.apache.commons.math3.util;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.apache.commons.math3.Field;
import org.apache.commons.math3.FieldElement;
import org.apache.commons.math3.util.MathArrays;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class MathArrays_ESTest extends MathArrays_ESTest_scaffolding {
@Test(timeout = 4000)
public void test000() throws Throwable {
Field<Object> field0 = (Field<Object>) mock(Field.class, new ViolatedAssumptionAnswer());
doReturn((Class) null).when(field0).getRuntimeClass();
// Undeclared exception!
try {
MathArrays.buildArray(field0, (-96), 0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.lang.reflect.Array", e);
}
}
@Test(timeout = 4000)
public void test001() throws Throwable {
double[] doubleArray0 = new double[9];
doubleArray0[0] = (-211.8983829965);
MathArrays.normalizeArray(doubleArray0, (-1513.07674833721));
}
@Test(timeout = 4000)
public void test002() throws Throwable {
double[] doubleArray0 = new double[3];
double[] doubleArray1 = new double[6];
MathArrays.equalsIncludingNaN(doubleArray1, doubleArray0);
}
@Test(timeout = 4000)
public void test003() throws Throwable {
double[] doubleArray0 = new double[6];
double[] doubleArray1 = MathArrays.copyOf(doubleArray0, 193);
MathArrays.equals(doubleArray1, doubleArray0);
}
@Test(timeout = 4000)
public void test004() throws Throwable {
float[] floatArray0 = new float[3];
float[] floatArray1 = new float[2];
MathArrays.equalsIncludingNaN(floatArray0, floatArray1);
}
@Test(timeout = 4000)
public void test005() throws Throwable {
float[] floatArray0 = new float[10];
float[] floatArray1 = new float[4];
MathArrays.equals(floatArray0, floatArray1);
}
@Test(timeout = 4000)
public void test006() throws Throwable {
double[] doubleArray0 = new double[8];
double[] doubleArray1 = MathArrays.copyOf(doubleArray0, 188);
try {
MathArrays.linearCombination(doubleArray0, doubleArray1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 8 != 188
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test007() throws Throwable {
double[] doubleArray0 = new double[4];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
double[][] doubleArray1 = new double[1][5];
try {
MathArrays.sortInPlace(doubleArray0, mathArrays_OrderDirection0, doubleArray1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 5 != 4
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test008() throws Throwable {
double[] doubleArray0 = new double[9];
doubleArray0[1] = 1.86285714285714278E18;
doubleArray0[3] = 1.3040000000134212E19;
MathArrays.safeNorm(doubleArray0);
}
@Test(timeout = 4000)
public void test009() throws Throwable {
double[] doubleArray0 = new double[8];
doubleArray0[3] = Double.NEGATIVE_INFINITY;
doubleArray0[4] = Double.NEGATIVE_INFINITY;
MathArrays.safeNorm(doubleArray0);
}
@Test(timeout = 4000)
public void test010() throws Throwable {
double[] doubleArray0 = new double[1];
doubleArray0[0] = 1.304E19;
MathArrays.safeNorm(doubleArray0);
}
@Test(timeout = 4000)
public void test011() throws Throwable {
double[] doubleArray0 = new double[7];
doubleArray0[3] = 3.834E-20;
MathArrays.safeNorm(doubleArray0);
}
@Test(timeout = 4000)
public void test012() throws Throwable {
long[][] longArray0 = new long[4][0];
long[] longArray1 = new long[7];
longArray1[0] = 1868L;
longArray0[0] = longArray1;
MathArrays.checkNonNegative(longArray0);
}
@Test(timeout = 4000)
public void test013() throws Throwable {
long[] longArray0 = new long[8];
longArray0[0] = 2780L;
MathArrays.checkNonNegative(longArray0);
}
@Test(timeout = 4000)
public void test014() throws Throwable {
double[] doubleArray0 = new double[3];
doubleArray0[0] = (-34.833869189332276);
try {
MathArrays.checkPositive(doubleArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// -34.834 is smaller than, or equal to, the minimum (0)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test015() throws Throwable {
long[][] longArray0 = new long[3][3];
long[] longArray1 = new long[6];
longArray0[0] = longArray1;
try {
MathArrays.checkRectangular(longArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// some rows have length 3 while others have length 6
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test016() throws Throwable {
long[][] longArray0 = new long[0][1];
MathArrays.checkRectangular(longArray0);
}
@Test(timeout = 4000)
public void test017() throws Throwable {
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
double[] doubleArray0 = new double[3];
doubleArray0[0] = Double.NEGATIVE_INFINITY;
MathArrays.isMonotonic(doubleArray0, mathArrays_OrderDirection0, false);
}
@Test(timeout = 4000)
public void test018() throws Throwable {
String[] stringArray0 = new String[3];
stringArray0[0] = "DECREASING";
stringArray0[1] = "";
stringArray0[2] = "m(/";
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
MathArrays.isMonotonic(stringArray0, mathArrays_OrderDirection0, true);
}
@Test(timeout = 4000)
public void test019() throws Throwable {
String[] stringArray0 = new String[9];
stringArray0[0] = "";
stringArray0[1] = "5Eo3>#`u#yzX`64o ";
stringArray0[2] = "l{z";
stringArray0[3] = "?7Co1@86]<C!H";
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
MathArrays.isMonotonic(stringArray0, mathArrays_OrderDirection0, true);
}
@Test(timeout = 4000)
public void test020() throws Throwable {
int[] intArray0 = new int[1];
intArray0[0] = 2787;
MathArrays.distanceInf(intArray0, intArray0);
}
@Test(timeout = 4000)
public void test021() throws Throwable {
double[] doubleArray0 = new double[3];
doubleArray0[0] = Double.NaN;
MathArrays.distanceInf(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test022() throws Throwable {
int[] intArray0 = new int[4];
intArray0[0] = 1816;
MathArrays.distance(intArray0, intArray0);
}
@Test(timeout = 4000)
public void test023() throws Throwable {
double[] doubleArray0 = new double[1];
doubleArray0[0] = (-1167.464453798);
MathArrays.distance(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test024() throws Throwable {
double[] doubleArray0 = new double[1];
doubleArray0[0] = (-7613.742882643701);
MathArrays.distance1(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test025() throws Throwable {
double[] doubleArray0 = new double[4];
doubleArray0[0] = (double) 4460L;
MathArrays.ebeDivide(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test026() throws Throwable {
double[] doubleArray0 = new double[1];
double[] doubleArray1 = new double[4];
try {
MathArrays.ebeDivide(doubleArray1, doubleArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 4 != 1
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test027() throws Throwable {
double[] doubleArray0 = new double[4];
doubleArray0[1] = 4933.60644622112;
MathArrays.ebeMultiply(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test028() throws Throwable {
double[] doubleArray0 = new double[4];
double[] doubleArray1 = new double[3];
try {
MathArrays.ebeMultiply(doubleArray1, doubleArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 3 != 4
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test029() throws Throwable {
double[] doubleArray0 = new double[4];
doubleArray0[0] = 6.283185307179586;
MathArrays.ebeSubtract(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test030() throws Throwable {
double[] doubleArray0 = new double[0];
double[] doubleArray1 = new double[3];
try {
MathArrays.ebeSubtract(doubleArray0, doubleArray1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 0 != 3
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test031() throws Throwable {
double[] doubleArray0 = new double[2];
doubleArray0[0] = 0.24740394949913025;
MathArrays.ebeAdd(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test032() throws Throwable {
double[] doubleArray0 = new double[9];
double[] doubleArray1 = MathArrays.convolve(doubleArray0, doubleArray0);
try {
MathArrays.ebeAdd(doubleArray0, doubleArray1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 9 != 17
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test033() throws Throwable {
double[] doubleArray0 = new double[1];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
MathArrays.checkOrder(doubleArray0, mathArrays_OrderDirection0, false);
}
@Test(timeout = 4000)
public void test034() throws Throwable {
double[] doubleArray0 = new double[9];
double[][] doubleArray1 = new double[9][4];
doubleArray1[0] = doubleArray0;
doubleArray1[1] = doubleArray0;
doubleArray1[2] = doubleArray0;
doubleArray1[3] = doubleArray0;
doubleArray1[4] = doubleArray0;
doubleArray1[5] = doubleArray0;
doubleArray1[6] = doubleArray0;
doubleArray1[7] = doubleArray0;
doubleArray1[8] = doubleArray0;
MathArrays.sortInPlace(doubleArray0, doubleArray1);
}
@Test(timeout = 4000)
public void test035() throws Throwable {
double[] doubleArray0 = new double[1];
MathArrays.checkOrder(doubleArray0);
}
@Test(timeout = 4000)
public void test036() throws Throwable {
double[] doubleArray0 = new double[0];
MathArrays.scale((-344.0), doubleArray0);
}
@Test(timeout = 4000)
public void test037() throws Throwable {
double[] doubleArray0 = new double[3];
doubleArray0[0] = 269.802;
MathArrays.linearCombination(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test038() throws Throwable {
double[] doubleArray0 = new double[4];
doubleArray0[3] = 1.34217729E8;
double[] doubleArray1 = MathArrays.copyOf(doubleArray0);
MathArrays.scaleInPlace((-1167.464453798), doubleArray0);
MathArrays.linearCombination(doubleArray0, doubleArray1);
}
@Test(timeout = 4000)
public void test039() throws Throwable {
MathArrays.linearCombination(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, (-2447.769), 0.0);
}
@Test(timeout = 4000)
public void test040() throws Throwable {
MathArrays.linearCombination(2764.1241952962387, (-1206.67317), 2764.1241952962387, 1111.855215694307, 2764.1241952962387, 0.0, 1.304E19, 0.0);
}
@Test(timeout = 4000)
public void test041() throws Throwable {
MathArrays.linearCombination(0.0, 0.0, 0.0, (-382.1775), 0.0, 0.0);
}
@Test(timeout = 4000)
public void test042() throws Throwable {
MathArrays.linearCombination((double) 0L, 0.04168701738764507, 1.25, (-593.0), 1787.7309200046693, (-164.046));
}
@Test(timeout = 4000)
public void test043() throws Throwable {
MathArrays.linearCombination((-4676.436245045575), (-1239.0), (-4676.436245045575), 1.0);
}
@Test(timeout = 4000)
public void test044() throws Throwable {
MathArrays.linearCombination((double) 100L, Double.NEGATIVE_INFINITY, (double) 1023L, (-393.295711));
}
@Test(timeout = 4000)
public void test045() throws Throwable {
double[] doubleArray0 = new double[0];
MathArrays.ebeMultiply(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test046() throws Throwable {
double[] doubleArray0 = new double[0];
MathArrays.ebeAdd(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test047() throws Throwable {
int[] intArray0 = new int[4];
intArray0[1] = 2139895366;
int[] intArray1 = new int[8];
MathArrays.distanceInf(intArray0, intArray1);
}
@Test(timeout = 4000)
public void test048() throws Throwable {
double[] doubleArray0 = new double[3];
doubleArray0[1] = 2028.8791879;
double[] doubleArray1 = new double[7];
MathArrays.distanceInf(doubleArray0, doubleArray1);
}
@Test(timeout = 4000)
public void test049() throws Throwable {
int[] intArray0 = new int[1];
intArray0[0] = 628;
int[] intArray1 = new int[7];
MathArrays.distance1(intArray0, intArray1);
}
@Test(timeout = 4000)
public void test050() throws Throwable {
int[] intArray0 = new int[6];
intArray0[4] = 2144042167;
int[] intArray1 = new int[9];
intArray1[5] = 2144042167;
MathArrays.distance1(intArray0, intArray1);
}
@Test(timeout = 4000)
public void test051() throws Throwable {
double[] doubleArray0 = new double[7];
doubleArray0[0] = (double) 1023L;
double[] doubleArray1 = new double[8];
MathArrays.distance1(doubleArray0, doubleArray1);
}
@Test(timeout = 4000)
public void test052() throws Throwable {
int[] intArray0 = new int[4];
intArray0[0] = 628;
int[] intArray1 = new int[9];
MathArrays.distance(intArray0, intArray1);
}
@Test(timeout = 4000)
public void test053() throws Throwable {
double[] doubleArray0 = new double[1];
doubleArray0[0] = (-1167.464453798);
double[] doubleArray1 = new double[1];
MathArrays.distance(doubleArray0, doubleArray1);
}
@Test(timeout = 4000)
public void test054() throws Throwable {
int[] intArray0 = new int[8];
MathArrays.copyOf(intArray0, 184);
}
@Test(timeout = 4000)
public void test055() throws Throwable {
int[] intArray0 = new int[7];
MathArrays.copyOf(intArray0, 0);
}
@Test(timeout = 4000)
public void test056() throws Throwable {
int[] intArray0 = new int[0];
MathArrays.copyOf(intArray0);
}
@Test(timeout = 4000)
public void test057() throws Throwable {
double[] doubleArray0 = new double[8];
MathArrays.copyOf(doubleArray0, 0);
}
@Test(timeout = 4000)
public void test058() throws Throwable {
Class<FieldElement> class0 = FieldElement.class;
Field<Object> field0 = (Field<Object>) mock(Field.class, new ViolatedAssumptionAnswer());
doReturn(class0).when(field0).getRuntimeClass();
doReturn((Object) null).when(field0).getZero();
MathArrays.buildArray(field0, 3120);
}
@Test(timeout = 4000)
public void test059() throws Throwable {
double[] doubleArray0 = new double[9];
double[][] doubleArray1 = new double[8][5];
try {
MathArrays.sortInPlace(doubleArray0, doubleArray1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 5 != 9
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test060() throws Throwable {
try {
MathArrays.sortInPlace((double[]) null, (double[][]) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// null is not allowed
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test061() throws Throwable {
double[] doubleArray0 = new double[4];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
// Undeclared exception!
try {
MathArrays.sortInPlace(doubleArray0, mathArrays_OrderDirection0, (double[][]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test062() throws Throwable {
// Undeclared exception!
try {
MathArrays.scaleInPlace(0.7937005259840998, (double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test063() throws Throwable {
// Undeclared exception!
try {
MathArrays.scale(0.0, (double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test064() throws Throwable {
// Undeclared exception!
try {
MathArrays.safeNorm((double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test065() throws Throwable {
// Undeclared exception!
try {
MathArrays.normalizeArray((double[]) null, 822.24726);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test066() throws Throwable {
double[] doubleArray0 = new double[3];
// Undeclared exception!
try {
MathArrays.linearCombination((double[]) null, doubleArray0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test067() throws Throwable {
double[] doubleArray0 = new double[1];
// Undeclared exception!
try {
MathArrays.linearCombination(doubleArray0, doubleArray0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 1
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test068() throws Throwable {
Integer[] integerArray0 = new Integer[0];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
// Undeclared exception!
try {
MathArrays.isMonotonic(integerArray0, mathArrays_OrderDirection0, true);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 0
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test069() throws Throwable {
// Undeclared exception!
try {
MathArrays.ebeSubtract((double[]) null, (double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test070() throws Throwable {
// Undeclared exception!
try {
MathArrays.ebeMultiply((double[]) null, (double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test071() throws Throwable {
// Undeclared exception!
try {
MathArrays.ebeDivide((double[]) null, (double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test072() throws Throwable {
// Undeclared exception!
try {
MathArrays.ebeAdd((double[]) null, (double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test073() throws Throwable {
// Undeclared exception!
try {
MathArrays.distanceInf((int[]) null, (int[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test074() throws Throwable {
int[] intArray0 = new int[8];
int[] intArray1 = new int[6];
// Undeclared exception!
try {
MathArrays.distanceInf(intArray0, intArray1);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 6
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test075() throws Throwable {
// Undeclared exception!
try {
MathArrays.distanceInf((double[]) null, (double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test076() throws Throwable {
double[] doubleArray0 = new double[9];
double[] doubleArray1 = new double[6];
// Undeclared exception!
try {
MathArrays.distanceInf(doubleArray0, doubleArray1);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 6
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test077() throws Throwable {
// Undeclared exception!
try {
MathArrays.distance1((int[]) null, (int[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test078() throws Throwable {
int[] intArray0 = new int[9];
int[] intArray1 = new int[3];
// Undeclared exception!
try {
MathArrays.distance1(intArray0, intArray1);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 3
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test079() throws Throwable {
// Undeclared exception!
try {
MathArrays.distance1((double[]) null, (double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test080() throws Throwable {
double[] doubleArray0 = new double[1];
double[] doubleArray1 = MathArrays.copyOf(doubleArray0, 3120);
// Undeclared exception!
try {
MathArrays.distance1(doubleArray1, doubleArray0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 1
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test081() throws Throwable {
int[] intArray0 = new int[7];
// Undeclared exception!
try {
MathArrays.distance((int[]) null, intArray0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test082() throws Throwable {
int[] intArray0 = new int[3];
int[] intArray1 = new int[2];
// Undeclared exception!
try {
MathArrays.distance(intArray0, intArray1);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 2
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test083() throws Throwable {
// Undeclared exception!
try {
MathArrays.distance((double[]) null, (double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test084() throws Throwable {
double[] doubleArray0 = new double[4];
double[] doubleArray1 = MathArrays.convolve(doubleArray0, doubleArray0);
// Undeclared exception!
try {
MathArrays.distance(doubleArray1, doubleArray0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 4
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test085() throws Throwable {
int[] intArray0 = new int[2];
// Undeclared exception!
try {
MathArrays.copyOf(intArray0, (-912));
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test086() throws Throwable {
// Undeclared exception!
try {
MathArrays.copyOf((int[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test087() throws Throwable {
// Undeclared exception!
try {
MathArrays.copyOf((double[]) null, 3120);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test088() throws Throwable {
double[] doubleArray0 = new double[4];
// Undeclared exception!
try {
MathArrays.copyOf(doubleArray0, (-4920));
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test089() throws Throwable {
// Undeclared exception!
try {
MathArrays.copyOf((double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test090() throws Throwable {
try {
MathArrays.checkRectangular((long[][]) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// null is not allowed
//
verifyException("org.apache.commons.math3.util.MathUtils", e);
}
}
@Test(timeout = 4000)
public void test091() throws Throwable {
// Undeclared exception!
try {
MathArrays.checkPositive((double[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test092() throws Throwable {
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
// Undeclared exception!
try {
MathArrays.checkOrder((double[]) null, mathArrays_OrderDirection0, false, true);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test093() throws Throwable {
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
double[] doubleArray0 = new double[0];
// Undeclared exception!
try {
MathArrays.checkOrder(doubleArray0, mathArrays_OrderDirection0, false, false);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 0
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test094() throws Throwable {
double[] doubleArray0 = new double[7];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
try {
MathArrays.checkOrder(doubleArray0, mathArrays_OrderDirection0, true);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// points 0 and 1 are not strictly decreasing (0 <= 0)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test095() throws Throwable {
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
// Undeclared exception!
try {
MathArrays.checkOrder((double[]) null, mathArrays_OrderDirection0, true);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test096() throws Throwable {
double[] doubleArray0 = new double[7];
try {
MathArrays.checkOrder(doubleArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// points 0 and 1 are not strictly increasing (0 >= 0)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test097() throws Throwable {
// Undeclared exception!
try {
MathArrays.checkNonNegative((long[][]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test098() throws Throwable {
// Undeclared exception!
try {
MathArrays.checkNonNegative((long[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test099() throws Throwable {
Class<FieldElement> class0 = FieldElement.class;
Field<Integer> field0 = (Field<Integer>) mock(Field.class, new ViolatedAssumptionAnswer());
doReturn(class0).when(field0).getRuntimeClass();
// Undeclared exception!
MathArrays.buildArray(field0, 1073741824, 1073741824);
}
@Test(timeout = 4000)
public void test100() throws Throwable {
// Undeclared exception!
try {
MathArrays.buildArray((Field<Integer>) null, 628, (-757));
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test101() throws Throwable {
Class<FieldElement> class0 = FieldElement.class;
Field<Integer> field0 = (Field<Integer>) mock(Field.class, new ViolatedAssumptionAnswer());
doReturn(class0).when(field0).getRuntimeClass();
doReturn((Object) null).when(field0).getZero();
// Undeclared exception!
try {
MathArrays.buildArray(field0, (-1261), (-1261));
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.lang.reflect.Array", e);
}
}
@Test(timeout = 4000)
public void test102() throws Throwable {
Class<FieldElement> class0 = FieldElement.class;
Field<Object> field0 = (Field<Object>) mock(Field.class, new ViolatedAssumptionAnswer());
doReturn(class0).when(field0).getRuntimeClass();
doReturn(class0).when(field0).getZero();
// Undeclared exception!
try {
MathArrays.buildArray(field0, 32, 32);
fail("Expecting exception: ArrayStoreException");
} catch(ArrayStoreException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test103() throws Throwable {
Class<FieldElement> class0 = FieldElement.class;
Field<String> field0 = (Field<String>) mock(Field.class, new ViolatedAssumptionAnswer());
doReturn(class0).when(field0).getRuntimeClass();
// Undeclared exception!
try {
MathArrays.buildArray(field0, (-16));
fail("Expecting exception: NegativeArraySizeException");
} catch(NegativeArraySizeException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.lang.reflect.Array", e);
}
}
@Test(timeout = 4000)
public void test104() throws Throwable {
double[] doubleArray0 = new double[1];
Class<FieldElement> class0 = FieldElement.class;
Field<Object> field0 = (Field<Object>) mock(Field.class, new ViolatedAssumptionAnswer());
doReturn(class0).when(field0).getRuntimeClass();
doReturn(doubleArray0[0]).when(field0).getZero();
// Undeclared exception!
try {
MathArrays.buildArray(field0, 3120);
fail("Expecting exception: ArrayStoreException");
} catch(ArrayStoreException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test105() throws Throwable {
double[] doubleArray0 = new double[6];
doubleArray0[0] = 1392.99677028076;
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
try {
MathArrays.checkOrder(doubleArray0, mathArrays_OrderDirection0, true, true);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// points 1 and 2 are not strictly decreasing (0 <= 0)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test106() throws Throwable {
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
double[] doubleArray0 = new double[6];
doubleArray0[1] = (double) 847L;
try {
MathArrays.checkOrder(doubleArray0, mathArrays_OrderDirection0, true, true);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// points 1 and 2 are not strictly increasing (847 >= 0)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test107() throws Throwable {
// Undeclared exception!
try {
MathArrays.copyOf((int[]) null, 0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test108() throws Throwable {
Field<FieldElement<Object>> field0 = (Field<FieldElement<Object>>) mock(Field.class, new ViolatedAssumptionAnswer());
doReturn((Class) null).when(field0).getRuntimeClass();
// Undeclared exception!
try {
MathArrays.buildArray(field0, (-501));
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.lang.reflect.Array", e);
}
}
@Test(timeout = 4000)
public void test109() throws Throwable {
double[] doubleArray0 = new double[9];
double[] doubleArray1 = new double[0];
try {
MathArrays.convolve(doubleArray0, doubleArray1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// no data
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test110() throws Throwable {
double[] doubleArray0 = new double[0];
try {
MathArrays.convolve(doubleArray0, doubleArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// no data
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test111() throws Throwable {
Class<FieldElement> class0 = FieldElement.class;
Field<Object> field0 = (Field<Object>) mock(Field.class, new ViolatedAssumptionAnswer());
doReturn(class0).when(field0).getRuntimeClass();
doReturn((Object) null, (Object) null, (Object) null, (Object) null, (Object) null).when(field0).getZero();
MathArrays.buildArray(field0, 32, 32);
}
@Test(timeout = 4000)
public void test112() throws Throwable {
double[] doubleArray0 = new double[5];
doubleArray0[0] = 1996.7720719908175;
doubleArray0[3] = Double.NaN;
MathArrays.normalizeArray(doubleArray0, 5912.79703375);
}
@Test(timeout = 4000)
public void test113() throws Throwable {
double[] doubleArray0 = new double[5];
doubleArray0[3] = Double.NaN;
try {
MathArrays.normalizeArray(doubleArray0, 5912.79703375);
fail("Expecting exception: ArithmeticException");
} catch(ArithmeticException e) {
//
// array sums to zero
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test114() throws Throwable {
double[] doubleArray0 = new double[5];
doubleArray0[2] = (double) Float.POSITIVE_INFINITY;
try {
MathArrays.normalizeArray(doubleArray0, 1.0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Array contains an infinite element, \u221E at index 2
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test115() throws Throwable {
double[] doubleArray0 = new double[3];
try {
MathArrays.normalizeArray(doubleArray0, Double.NaN);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Cannot normalize to NaN
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test116() throws Throwable {
double[] doubleArray0 = new double[0];
try {
MathArrays.normalizeArray(doubleArray0, Double.POSITIVE_INFINITY);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Cannot normalize to an infinite value
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test117() throws Throwable {
double[] doubleArray0 = new double[4];
doubleArray0[3] = 1.34217729E8;
double[] doubleArray1 = MathArrays.scale(681.637026, doubleArray0);
MathArrays.equalsIncludingNaN(doubleArray0, doubleArray1);
}
@Test(timeout = 4000)
public void test118() throws Throwable {
double[] doubleArray0 = new double[4];
double[] doubleArray1 = new double[5];
MathArrays.equalsIncludingNaN(doubleArray0, doubleArray1);
}
@Test(timeout = 4000)
public void test119() throws Throwable {
double[] doubleArray0 = new double[3];
MathArrays.equalsIncludingNaN((double[]) null, doubleArray0);
}
@Test(timeout = 4000)
public void test120() throws Throwable {
double[] doubleArray0 = new double[3];
MathArrays.equalsIncludingNaN(doubleArray0, (double[]) null);
}
@Test(timeout = 4000)
public void test121() throws Throwable {
double[] doubleArray0 = new double[4];
MathArrays.equalsIncludingNaN(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test122() throws Throwable {
MathArrays.equalsIncludingNaN((double[]) null, (double[]) null);
}
@Test(timeout = 4000)
public void test123() throws Throwable {
double[] doubleArray0 = new double[4];
doubleArray0[1] = 4933.60644622112;
double[] doubleArray1 = new double[4];
MathArrays.equals(doubleArray0, doubleArray1);
}
@Test(timeout = 4000)
public void test124() throws Throwable {
double[] doubleArray0 = new double[4];
double[] doubleArray1 = MathArrays.convolve(doubleArray0, doubleArray0);
MathArrays.equals(doubleArray0, doubleArray1);
}
@Test(timeout = 4000)
public void test125() throws Throwable {
MathArrays.equals((double[]) null, (double[]) null);
}
@Test(timeout = 4000)
public void test126() throws Throwable {
double[] doubleArray0 = new double[3];
MathArrays.equals(doubleArray0, (double[]) null);
}
@Test(timeout = 4000)
public void test127() throws Throwable {
double[] doubleArray0 = new double[9];
MathArrays.equals(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test128() throws Throwable {
double[] doubleArray0 = new double[2];
MathArrays.equals((double[]) null, doubleArray0);
}
@Test(timeout = 4000)
public void test129() throws Throwable {
float[] floatArray0 = new float[4];
floatArray0[0] = (float) 847L;
float[] floatArray1 = new float[4];
MathArrays.equalsIncludingNaN(floatArray1, floatArray0);
}
@Test(timeout = 4000)
public void test130() throws Throwable {
float[] floatArray0 = new float[3];
float[] floatArray1 = new float[9];
MathArrays.equalsIncludingNaN(floatArray0, floatArray1);
}
@Test(timeout = 4000)
public void test131() throws Throwable {
float[] floatArray0 = new float[3];
MathArrays.equalsIncludingNaN((float[]) null, floatArray0);
}
@Test(timeout = 4000)
public void test132() throws Throwable {
float[] floatArray0 = new float[8];
MathArrays.equalsIncludingNaN(floatArray0, (float[]) null);
}
@Test(timeout = 4000)
public void test133() throws Throwable {
float[] floatArray0 = new float[5];
MathArrays.equalsIncludingNaN(floatArray0, floatArray0);
}
@Test(timeout = 4000)
public void test134() throws Throwable {
MathArrays.equalsIncludingNaN((float[]) null, (float[]) null);
}
@Test(timeout = 4000)
public void test135() throws Throwable {
float[] floatArray0 = new float[4];
floatArray0[0] = (float) 847L;
float[] floatArray1 = new float[4];
MathArrays.equals(floatArray0, floatArray1);
}
@Test(timeout = 4000)
public void test136() throws Throwable {
float[] floatArray0 = new float[7];
MathArrays.equals(floatArray0, floatArray0);
}
@Test(timeout = 4000)
public void test137() throws Throwable {
float[] floatArray0 = new float[0];
float[] floatArray1 = new float[9];
MathArrays.equals(floatArray0, floatArray1);
}
@Test(timeout = 4000)
public void test138() throws Throwable {
float[] floatArray0 = new float[0];
MathArrays.equals((float[]) null, floatArray0);
}
@Test(timeout = 4000)
public void test139() throws Throwable {
float[] floatArray0 = new float[0];
MathArrays.equals(floatArray0, (float[]) null);
}
@Test(timeout = 4000)
public void test140() throws Throwable {
MathArrays.equals((float[]) null, (float[]) null);
}
@Test(timeout = 4000)
public void test141() throws Throwable {
MathArrays.linearCombination(0.0, -0.0, (-3362.017768), Double.NaN, 0.19999954104423523, 5912.79703375, (-608.7989471), 1.0);
}
@Test(timeout = 4000)
public void test142() throws Throwable {
MathArrays.linearCombination(1296.1949004, 9.907131307971773E12, 1296.1949004, 1.304E19, 1.304E19, 1.304E19, 9.907131307971773E12, (-1377.335334625502));
}
@Test(timeout = 4000)
public void test143() throws Throwable {
MathArrays.linearCombination(Double.NaN, 1.34217729E8, 20.0, Double.NaN, Double.NaN, 20.0);
}
@Test(timeout = 4000)
public void test144() throws Throwable {
MathArrays.linearCombination(2902.5985218536, 2902.5985218536, 8.370012724146286E21, 2.17333333333333325E18, 2.17333333333333325E18, 2902.5985218536);
}
@Test(timeout = 4000)
public void test145() throws Throwable {
MathArrays.linearCombination(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, 1.0);
}
@Test(timeout = 4000)
public void test146() throws Throwable {
MathArrays.linearCombination((-2556.0), (double) 0, (double) 0, (double) 0);
}
@Test(timeout = 4000)
public void test147() throws Throwable {
double[] doubleArray0 = new double[5];
doubleArray0[0] = Double.NaN;
MathArrays.linearCombination(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test148() throws Throwable {
double[] doubleArray0 = new double[4];
double[] doubleArray1 = MathArrays.convolve(doubleArray0, doubleArray0);
try {
MathArrays.linearCombination(doubleArray1, doubleArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 7 != 4
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test149() throws Throwable {
double[] doubleArray0 = new double[3];
MathArrays.linearCombination(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test150() throws Throwable {
double[] doubleArray0 = new double[8];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
double[][] doubleArray1 = new double[8][5];
doubleArray1[0] = null;
try {
MathArrays.sortInPlace(doubleArray0, mathArrays_OrderDirection0, doubleArray1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// null is not allowed
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test151() throws Throwable {
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
double[][] doubleArray0 = new double[5][1];
try {
MathArrays.sortInPlace((double[]) null, mathArrays_OrderDirection0, doubleArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// null is not allowed
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test152() throws Throwable {
double[] doubleArray0 = new double[8];
doubleArray0[5] = Double.NaN;
MathArrays.safeNorm(doubleArray0);
}
@Test(timeout = 4000)
public void test153() throws Throwable {
double[] doubleArray0 = new double[8];
doubleArray0[6] = 5.669184079525E-24;
MathArrays.safeNorm(doubleArray0);
}
@Test(timeout = 4000)
public void test154() throws Throwable {
double[] doubleArray0 = new double[9];
doubleArray0[0] = 2.608E18;
doubleArray0[1] = 2973.19451;
double[] doubleArray1 = MathArrays.convolve(doubleArray0, doubleArray0);
MathArrays.safeNorm(doubleArray1);
}
@Test(timeout = 4000)
public void test155() throws Throwable {
double[] doubleArray0 = new double[9];
MathArrays.safeNorm(doubleArray0);
}
@Test(timeout = 4000)
public void test156() throws Throwable {
long[][] longArray0 = new long[3][7];
long[] longArray1 = new long[3];
longArray1[1] = (long) (-659);
longArray0[0] = longArray1;
try {
MathArrays.checkNonNegative(longArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// -659 is smaller than the minimum (0)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test157() throws Throwable {
long[] longArray0 = new long[8];
longArray0[3] = (-304L);
try {
MathArrays.checkNonNegative(longArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// -304 is smaller than the minimum (0)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test158() throws Throwable {
double[] doubleArray0 = new double[1];
MathArrays.scaleInPlace(Double.NaN, doubleArray0);
MathArrays.checkPositive(doubleArray0);
}
@Test(timeout = 4000)
public void test159() throws Throwable {
double[] doubleArray0 = new double[3];
try {
MathArrays.checkPositive(doubleArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 0 is smaller than, or equal to, the minimum (0)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test160() throws Throwable {
long[][] longArray0 = new long[2][6];
long[] longArray1 = new long[3];
longArray0[0] = longArray1;
try {
MathArrays.checkRectangular(longArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// some rows have length 6 while others have length 3
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test161() throws Throwable {
long[][] longArray0 = new long[4][0];
MathArrays.checkRectangular(longArray0);
}
@Test(timeout = 4000)
public void test162() throws Throwable {
double[] doubleArray0 = new double[6];
doubleArray0[1] = (-1.9841269659586505E-4);
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
MathArrays.checkOrder(doubleArray0, mathArrays_OrderDirection0, false, false);
}
@Test(timeout = 4000)
public void test163() throws Throwable {
double[] doubleArray0 = new double[8];
doubleArray0[1] = (-3.141592653589793);
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
MathArrays.isMonotonic(doubleArray0, mathArrays_OrderDirection0, true);
}
@Test(timeout = 4000)
public void test164() throws Throwable {
double[] doubleArray0 = new double[8];
doubleArray0[0] = (double) 4460L;
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
try {
MathArrays.checkOrder(doubleArray0, mathArrays_OrderDirection0, false, true);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// points 0 and 1 are not increasing (4,460 > 0)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test165() throws Throwable {
double[] doubleArray0 = new double[3];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
MathArrays.checkOrder(doubleArray0, mathArrays_OrderDirection0, false, false);
}
@Test(timeout = 4000)
public void test166() throws Throwable {
String[] stringArray0 = new String[8];
stringArray0[0] = "DECREASING";
stringArray0[1] = ">_5c6NnA5";
stringArray0[2] = "m~&|=.%~PA)j";
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
MathArrays.isMonotonic(stringArray0, mathArrays_OrderDirection0, false);
}
@Test(timeout = 4000)
public void test167() throws Throwable {
String[] stringArray0 = new String[3];
stringArray0[0] = "DECREASING";
stringArray0[1] = "";
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
// Undeclared exception!
try {
MathArrays.isMonotonic(stringArray0, mathArrays_OrderDirection0, true);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test168() throws Throwable {
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
String[] stringArray0 = new String[3];
stringArray0[0] = "m(/";
stringArray0[1] = "m(/";
MathArrays.isMonotonic(stringArray0, mathArrays_OrderDirection0, true);
}
@Test(timeout = 4000)
public void test169() throws Throwable {
String[] stringArray0 = new String[8];
stringArray0[0] = "";
stringArray0[1] = "";
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
// Undeclared exception!
try {
MathArrays.isMonotonic(stringArray0, mathArrays_OrderDirection0, false);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test170() throws Throwable {
String[] stringArray0 = new String[8];
stringArray0[0] = "";
stringArray0[1] = "ARRAY_ELEMENT";
stringArray0[2] = "^-jN";
stringArray0[3] = "";
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
MathArrays.isMonotonic(stringArray0, mathArrays_OrderDirection0, false);
}
@Test(timeout = 4000)
public void test171() throws Throwable {
String[] stringArray0 = new String[2];
stringArray0[0] = "";
stringArray0[1] = "";
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
MathArrays.isMonotonic(stringArray0, mathArrays_OrderDirection0, true);
}
@Test(timeout = 4000)
public void test172() throws Throwable {
String[] stringArray0 = new String[3];
stringArray0[0] = "";
stringArray0[1] = "";
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
// Undeclared exception!
try {
MathArrays.isMonotonic(stringArray0, mathArrays_OrderDirection0, false);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test173() throws Throwable {
String[] stringArray0 = new String[1];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
MathArrays.isMonotonic(stringArray0, mathArrays_OrderDirection0, false);
}
@Test(timeout = 4000)
public void test174() throws Throwable {
double[] doubleArray0 = new double[3];
MathArrays.distanceInf(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test175() throws Throwable {
int[] intArray0 = new int[6];
MathArrays.distance1(intArray0, intArray0);
}
@Test(timeout = 4000)
public void test176() throws Throwable {
double[] doubleArray0 = new double[4];
double[] doubleArray1 = MathArrays.convolve(doubleArray0, doubleArray0);
try {
MathArrays.ebeDivide(doubleArray0, doubleArray1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 4 != 7
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test177() throws Throwable {
double[] doubleArray0 = new double[0];
MathArrays.ebeDivide(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test178() throws Throwable {
double[] doubleArray0 = new double[4];
double[] doubleArray1 = new double[5];
try {
MathArrays.ebeMultiply(doubleArray1, doubleArray0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 5 != 4
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test179() throws Throwable {
double[] doubleArray0 = new double[8];
double[] doubleArray1 = new double[3];
try {
MathArrays.ebeSubtract(doubleArray0, doubleArray1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 8 != 3
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test180() throws Throwable {
double[] doubleArray0 = new double[0];
MathArrays.ebeSubtract(doubleArray0, doubleArray0);
}
@Test(timeout = 4000)
public void test181() throws Throwable {
double[] doubleArray0 = new double[3];
double[] doubleArray1 = new double[1];
try {
MathArrays.ebeAdd(doubleArray0, doubleArray1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// 3 != 1
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test182() throws Throwable {
double[] doubleArray0 = new double[2];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
double[][] doubleArray1 = new double[4][2];
MathArrays.sortInPlace(doubleArray0, mathArrays_OrderDirection0, doubleArray1);
}
@Test(timeout = 4000)
public void test183() throws Throwable {
double[] doubleArray0 = new double[4];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
double[][] doubleArray1 = new double[1][5];
doubleArray1[0] = doubleArray0;
MathArrays.sortInPlace(doubleArray0, mathArrays_OrderDirection0, doubleArray1);
}
@Test(timeout = 4000)
public void test184() throws Throwable {
double[] doubleArray0 = new double[3];
// Undeclared exception!
try {
MathArrays.sortInPlace(doubleArray0, (double[][]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test185() throws Throwable {
double[] doubleArray0 = new double[0];
// Undeclared exception!
try {
MathArrays.checkOrder(doubleArray0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 0
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
@Test(timeout = 4000)
public void test186() throws Throwable {
double[] doubleArray0 = new double[3];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.DECREASING;
MathArrays.isMonotonic(doubleArray0, mathArrays_OrderDirection0, false);
}
@Test(timeout = 4000)
public void test187() throws Throwable {
int[] intArray0 = new int[4];
MathArrays.copyOf(intArray0);
}
@Test(timeout = 4000)
public void test188() throws Throwable {
Class<FieldElement> class0 = FieldElement.class;
Field<Object> field0 = (Field<Object>) mock(Field.class, new ViolatedAssumptionAnswer());
doReturn(class0).when(field0).getRuntimeClass();
doReturn((Object) null).when(field0).getZero();
MathArrays.buildArray(field0, 22, (-385));
}
@Test(timeout = 4000)
public void test189() throws Throwable {
double[] doubleArray0 = new double[0];
MathArrays.copyOf(doubleArray0);
}
@Test(timeout = 4000)
public void test190() throws Throwable {
double[] doubleArray0 = new double[3];
double[] doubleArray1 = MathArrays.copyOf(doubleArray0, 1678);
// Undeclared exception!
MathArrays.convolve(doubleArray1, doubleArray1);
}
@Test(timeout = 4000)
public void test191() throws Throwable {
double[] doubleArray0 = new double[0];
MathArrays.OrderDirection mathArrays_OrderDirection0 = MathArrays.OrderDirection.INCREASING;
// Undeclared exception!
try {
MathArrays.checkOrder(doubleArray0, mathArrays_OrderDirection0, true);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// 0
//
verifyException("org.apache.commons.math3.util.MathArrays", e);
}
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
b03c6ff19b3ddb1c9159755f02955ea26b89ccfa | 5a7d792f820bd6cc84b157aff3aa150f0de5835a | /BD_SQlite/BD_SQlite/app/src/main/java/lyrical/alejandro/bd_sqlite/DBManager.java | 142a53a8d178f4e55b60894b259699f2108a83be | [] | no_license | ALEJANDROJ19/DAMO-sandbox | 8f7ca666f50d069181d4e004861140541b331db7 | f0a0d60ba9a8b248118fa4e191364f9467663001 | refs/heads/master | 2020-12-25T14:33:21.143733 | 2016-11-30T09:34:47 | 2016-11-30T09:34:47 | 67,502,558 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 369 | java | package lyrical.alejandro.bd_sqlite;
import android.content.Context;
/**
* Classe DBManager. Facilita la gestió de les consultes.
*/
public class DBManager {
private DBHelper dbHelper;
/**
* Constructora.
* @param context: Context de l'apliació.
*/
DBManager(Context context) {
this.dbHelper = new DBHelper(context);
}
}
| [
"ALEJANDROJ19@hotmail.es"
] | ALEJANDROJ19@hotmail.es |
3a5c96e342afaad2fde07c8179f5adb83a345c99 | 00147dc2dd808fb42daac1029a200e90de51055d | /src/main/java/com/zcf/universe/common/json/serializer/DateFormatSerializer.java | c91bac67f02f5f326e55a01e104fb36907a233f1 | [] | no_license | wudetong/universe | e7a22e809ba1091d1537588f4282123d3739f19b | 5def560c99413020396bf8441f1d1164d499c059 | refs/heads/master | 2020-04-02T16:48:22.246740 | 2018-10-28T02:37:13 | 2018-10-28T02:37:14 | 154,629,389 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 745 | java | package com.zcf.universe.common.json.serializer;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 日期格式化
*
*/
public class DateFormatSerializer extends JsonSerializer<Date> {
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@Override
public void serialize(Date value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
if (value == null) {
jgen.writeNull();
} else {
jgen.writeString(sdf.format(value));
}
}
}
| [
"382809655@qq.com"
] | 382809655@qq.com |
7d9b094636aeeb81b6bf71c2f2a3a545fa674a06 | f56ceae97ece0689a3143291f4bd9e9b599f2356 | /android/app/src/main/java/com/counter/MainApplication.java | d283f38ef02a4f57737b6b138ae2426f9e77dbc7 | [
"Apache-2.0"
] | permissive | nimjetushar/Counter | c69e53f35afef2f35070df8dc007165ea8090f3b | a5df2327fa757216b99715083da77165054ac12c | refs/heads/master | 2020-05-16T00:04:52.502248 | 2019-08-09T15:40:36 | 2019-08-09T15:40:36 | 182,571,361 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,132 | java | package com.counter;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new VectorIconsPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
| [
"tusharnimje21@gmail.com"
] | tusharnimje21@gmail.com |
b8339e252154c6e2e599fd6ce161fe577552aecf | c6788399476a5cfd7ffbdf9e8ea817f62a5dfa4d | /uikit/src/com/netease/sdfnash/uikit/session/helper/VideoMessageHelper.java | 045c977aae23d014082f344d96543825ffefde81 | [] | no_license | sdfnash/TAROTNEW | 5e25d68831f83f37af0f4fd6eb5c4c433ca81dda | ae995871cfd5a9012f2e9908a80c2e40554e729f | refs/heads/master | 2019-08-06T01:06:13.574315 | 2017-10-31T06:26:15 | 2017-10-31T06:26:15 | 66,058,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,501 | java | package com.netease.sdfnash.uikit.session.helper;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import android.widget.Toast;
import com.netease.sdfnash.uikit.R;
import com.netease.sdfnash.uikit.common.ui.dialog.CustomAlertDialog;
import com.netease.sdfnash.uikit.common.util.C;
import com.netease.sdfnash.uikit.common.util.file.AttachmentStore;
import com.netease.sdfnash.uikit.common.util.file.FileUtil;
import com.netease.sdfnash.uikit.common.util.storage.StorageType;
import com.netease.sdfnash.uikit.common.util.storage.StorageUtil;
import com.netease.sdfnash.uikit.common.util.string.MD5;
import com.netease.sdfnash.uikit.common.util.string.StringUtil;
import com.netease.sdfnash.uikit.session.activity.CaptureVideoActivity;
import java.io.File;
/**
* Created by hzxuwen on 2015/4/10.
*/
public class VideoMessageHelper {
private File videoFile;
private String videoFilePath;
private Activity activity;
private VideoMessageHelperListener listener;
private int localRequestCode;
private int captureRequestCode;
public VideoMessageHelper(Activity activity, VideoMessageHelperListener listener) {
this.activity = activity;
this.listener = listener;
}
public interface VideoMessageHelperListener {
void onVideoPicked(File file, String md5);
}
/**
* 显示视频拍摄或从本地相册中选取
*/
public void showVideoSource(int local, int capture) {
this.localRequestCode = local;
this.captureRequestCode = capture;
CustomAlertDialog dialog = new CustomAlertDialog(activity);
dialog.setTitle(activity.getString(R.string.input_panel_video));
dialog.addItem("拍摄视频",new CustomAlertDialog.onSeparateItemClickListener(){
@Override
public void onClick() {
chooseVideoFromCamera();
}
});
dialog.addItem("从相册中选择视频",new CustomAlertDialog.onSeparateItemClickListener() {
@Override
public void onClick() {
chooseVideoFromLocal();
}
});
dialog.show();
}
/************************************************* 视频操作S *******************************************/
/**
* 拍摄视频
*/
protected void chooseVideoFromCamera() {
if (!StorageUtil.hasEnoughSpaceForWrite(activity,
StorageType.TYPE_VIDEO, true)) {
return;
}
videoFilePath = StorageUtil.getWritePath(
activity, StringUtil.get36UUID()
+ C.FileSuffix.MP4, StorageType.TYPE_TEMP);
videoFile = new File(videoFilePath);
// 启动视频录制
CaptureVideoActivity.start(activity, videoFilePath, captureRequestCode);
}
/**
* 从本地相册中选择视频
*/
protected void chooseVideoFromLocal() {
if (Build.VERSION.SDK_INT >= 19) {
chooseVideoFromLocalKitKat();
} else {
chooseVideoFromLocalBeforeKitKat();
}
}
/**
* API19 之后选择视频
*/
protected void chooseVideoFromLocalKitKat() {
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
try {
activity.startActivityForResult(intent, localRequestCode);
} catch (ActivityNotFoundException e) {
Toast.makeText(activity, R.string.gallery_invalid, Toast.LENGTH_SHORT).show();
} catch (SecurityException e) {
}
}
/**
* API19 之前选择视频
*/
protected void chooseVideoFromLocalBeforeKitKat() {
Intent mIntent = new Intent(Intent.ACTION_GET_CONTENT);
mIntent.setType(C.MimeType.MIME_VIDEO_ALL);
mIntent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
try {
activity.startActivityForResult(mIntent, localRequestCode);
} catch (ActivityNotFoundException e) {
Toast.makeText(activity, R.string.gallery_invalid, Toast.LENGTH_SHORT).show();
}
}
/****************************视频选中后回调操作********************************************/
/**
* 获取本地相册视频回调操作
*/
public void onGetLocalVideoResult(final Intent data) {
if (data == null) {
return;
}
String filePath = filePathFromIntent(data);
if (StringUtil.isEmpty(filePath) || !checkVideoFile(filePath)) {
return;
}
String md5 = MD5.getStreamMD5(filePath);
String filename = md5 + "." + FileUtil.getExtensionName(filePath);
String md5Path = StorageUtil.getWritePath(filename, StorageType.TYPE_VIDEO);
if (AttachmentStore.copy(filePath, md5Path) != -1) {
if (listener != null) {
listener.onVideoPicked(new File(md5Path), md5);
}
} else {
Toast.makeText(activity, R.string.video_exception, Toast.LENGTH_SHORT).show();
}
}
/**
* 拍摄视频后回调操作
*/
public void onCaptureVideoResult(Intent data) {
if (videoFile == null || !videoFile.exists()) {
return;
}
//N930拍照取消也产生字节为0的文件
if (videoFile.length() <= 0) {
videoFile.delete();
return;
}
String videoPath = videoFile.getPath();
String md5 = MD5.getStreamMD5(videoPath);
String md5Path = StorageUtil.getWritePath(md5 + ".mp4", StorageType.TYPE_VIDEO);
if (AttachmentStore.move(videoPath, md5Path)) {
if (listener != null) {
listener.onVideoPicked(new File(md5Path), md5);
}
}
}
/**
* 获取文件路径
* @param data intent数据
* @return
*/
private String filePathFromIntent(Intent data) {
Uri uri = data.getData();
try {
Cursor cursor = activity.getContentResolver().query(uri, null, null, null, null);
if (cursor == null) {
//miui 2.3 有可能为null
return uri.getPath();
} else {
cursor.moveToFirst();
return cursor.getString(cursor.getColumnIndex("_data")); // 文件路径
}
} catch (Exception e) {
return null;
}
}
/**
* 检查文件
* @param file 视频文件
* @return boolean
*/
private boolean checkVideoFile(String file) {
if (!AttachmentStore.isFileExist(file)) {
return false;
}
if (new File(file).length() > C.MAX_LOCAL_VIDEO_FILE_SIZE) {
Toast.makeText(activity, R.string.im_choose_video_file_size_too_large, Toast.LENGTH_SHORT).show();
return false;
}
if (!StorageUtil.isInvalidVideoFile(file)) {
Toast.makeText(activity, R.string.im_choose_video, Toast.LENGTH_SHORT).show();
return false;
}
return true;
}
}
| [
"liuyi@baijiahulian.com"
] | liuyi@baijiahulian.com |
29f3b4e53c1ed21057477407502df96b78a38bdd | 56f71a5644c7dd00cc8f7baedd796fa81eb9f99f | /src/test/java/org/talangsoft/bookinventory/integration/BookInventoryIntegrationTest.java | ce8f064e80660587807ed558185b99fd87afc651 | [] | no_license | PalSzak/book-inventory-boot | 096c18d6fa8bd2e36ee7f0cbcfbfa78515a096a3 | f1a6d134b6a52da402d6246f2f52c9dacadf8f95 | refs/heads/master | 2021-01-15T23:36:02.843464 | 2016-01-22T07:53:37 | 2016-01-22T07:53:37 | 50,094,659 | 1 | 0 | null | 2016-01-21T08:53:25 | 2016-01-21T08:53:25 | null | UTF-8 | Java | false | false | 500 | java | package org.talangsoft.bookinventory.integration;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(features = "classpath:bookinventory.integration",
tags = {"@restApiIntegration", "~@ignore"},
format = {"html:target/cucumber-report/bookInventoryIntegration",
"json:target/cucumber-report/bookInventoryIntegration.json"})
public class BookInventoryIntegrationTest {
}
| [
"langtamas@gmail.com"
] | langtamas@gmail.com |
f3fcb145c2aa73814c95cc5ba905c3b0f2993d13 | eecea90b6b56e434f67797fa1b5cfb90a0f2fcd5 | /app/providers/UserProviderImpl.java | e5cd209bbdbc683e514c5b18e80e8712ccd8776d | [
"MIT"
] | permissive | Schmetterling/play-tests-example | f7b243bad34171fdf8ea820f316124195a30824c | 1a72240b7f9de5e1e25b0c210e074d971e3ab4ca | refs/heads/master | 2021-01-09T20:30:34.090391 | 2016-07-14T08:47:12 | 2016-07-14T08:47:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,124 | java | package providers;
import beans.User;
import play.db.DB;
import java.sql.*;
import java.util.Optional;
public class UserProviderImpl implements UserProvider {
@Override
public Optional<User> getUser(Integer id) throws SQLException {
User user = null;
Connection connection = null;
try {
connection = DB.getDataSource("default").getConnection();
PreparedStatement prepareStatement = connection.prepareStatement("select *from tblUser where id = ?");
prepareStatement.setInt(1, id);
ResultSet resultSet = prepareStatement.executeQuery();
if(resultSet.next())
user = new User(
resultSet.getInt("id"),
resultSet.getString("firstName"),
resultSet.getString("lastName"),
resultSet.getString("email")
);
} finally {
if(connection != null && !connection.isClosed())
connection.close();
}
return user != null ? Optional.of(user) : Optional.empty();
}
} | [
"dberchiyan@4tifier.com"
] | dberchiyan@4tifier.com |
ad256d207a6e862fd7c7825344e4391fa6738a3c | 6f0706c60535836d00ca513efef5cf2400813863 | /src/main/java/com/olgaivancic/instateam/config/DataConfig.java | 9e5fe0ec0ab3d8faa4b3da13203eb3b8bdd01b97 | [] | no_license | olgap2015/instateam | f945385a61f76d4d63dab3cb69631a7a15105378 | 4c4eb2e60421c4d01bbc3260e9d48aa84376a937 | refs/heads/master | 2020-04-09T08:33:04.475257 | 2019-01-30T10:03:45 | 2019-01-30T10:03:45 | 160,198,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,613 | java | package com.olgaivancic.instateam.config;
import org.apache.tomcat.dbcp.dbcp2.BasicDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.orm.hibernate5.LocalSessionFactoryBean;
import javax.sql.DataSource;
@Configuration
@PropertySource("app.properties")
public class DataConfig {
@Autowired
private Environment env;
@Bean
public LocalSessionFactoryBean sessionFactory() {
Resource config = new ClassPathResource("hibernate.cfg.xml");
LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
sessionFactory.setConfigLocation(config);
sessionFactory.setPackagesToScan(env.getProperty("instateam.entity.package"));
sessionFactory.setDataSource(dataSource());
return sessionFactory;
}
@Bean
public DataSource dataSource() {
BasicDataSource ds = new BasicDataSource();
// Driver class name
ds.setDriverClassName(env.getProperty("instateam.db.driver"));
// Set URL
ds.setUrl(env.getProperty("instateam.db.url"));
// Set username & password
ds.setUsername(env.getProperty("instateam.db.username"));
ds.setPassword(env.getProperty("instateam.db.password"));
return ds;
}
}
| [
"olgap2015@users.noreply.github.com"
] | olgap2015@users.noreply.github.com |
4cde45683971017c359977ef5b149b9e5ad9ceee | 2939721b0487dbb15b271dd900e2708afa66427c | /JavaBasic/src/kosta/oop3/MyFrame.java | 240f70fbed6b4817415d5bfad952a0bd27357be1 | [] | no_license | seung1110/javaStudy | ec6bb3cf52b248d194b7b183adba8e838d6d3af4 | ab385f3d1fe1cffaddb5ba2c560efda760688953 | refs/heads/main | 2023-03-01T11:24:51.038224 | 2021-02-10T08:56:31 | 2021-02-10T08:56:31 | 336,152,054 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,439 | java | package kosta.oop3;
import java.awt.Button;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
public class MyFrame extends Frame implements ActionListener, WindowListener {
public MyFrame() {
Button b = new Button("button");
b.addActionListener(this);
addWindowListener(this);
add(b);
setSize(300,200);
setLocation(300,300);
setVisible(true);
}
public static void main(String[] args) {
new MyFrame();
}
@Override
public void actionPerformed(ActionEvent e) {
Button b = (Button)e.getSource();
System.out.println(b.getLabel());
}
@Override
public void windowActivated(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowClosed(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
@Override
public void windowDeactivated(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowDeiconified(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowIconified(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowOpened(WindowEvent e) {
// TODO Auto-generated method stub
}
}
| [
"KOSTA@DESKTOP-PKQKM93"
] | KOSTA@DESKTOP-PKQKM93 |
e47593674fe78a5304174d6857d5454ce0320586 | a363c46e7cbb080db2b3a69a70ebf912195e25c7 | /ls-modules/ls-rbac/src/main/java/cn/lonsun/ldap/internal/service/impl/LdapUserServiceImpl.java | 3aac6ddae9d0bd3c12c63b6d94d37c1732ea8b75 | [] | no_license | pologood/excms | 601646dd7ea4f58f8423da007413978192090f8d | e1c03f574d0ecbf0200aaffa7facf93841bab02c | refs/heads/master | 2020-05-14T20:07:22.979151 | 2018-10-06T10:51:37 | 2018-10-06T10:51:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,344 | java | package cn.lonsun.ldap.internal.service.impl;
import java.util.HashMap;
import java.util.List;
import javax.naming.CommunicationException;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.ServiceUnavailableException;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import cn.lonsun.core.exception.BaseRunTimeException;
import cn.lonsun.ldap.internal.entity.ConfigEO;
import cn.lonsun.ldap.internal.exception.CommunicationRuntimeException;
import cn.lonsun.ldap.internal.exception.UidRepeatedException;
import cn.lonsun.ldap.internal.service.IConfigService;
import cn.lonsun.ldap.internal.service.ILdapUserService;
import cn.lonsun.ldap.internal.util.AttributeUtil;
import cn.lonsun.ldap.internal.util.Constants;
import cn.lonsun.ldap.internal.util.LDAPUtil;
import cn.lonsun.rbac.internal.entity.UserEO;
@Service("ldapUserService")
public class LdapUserServiceImpl implements ILdapUserService {
private Logger logger = LoggerFactory.getLogger(LdapUserServiceImpl.class);
@Autowired
private IConfigService configService;
private void init(){
List<ConfigEO> configs = configService.getEntities(ConfigEO.class, new HashMap<String,Object>());
if(configs!=null&&configs.size()>0){
String k = "key";
int i=0;
for(ConfigEO config:configs){
try {
//如果连接成功,那么认为有效
LDAPUtil.getDirContext(config);
String key = k+i;
LDAPUtil.effectiveConfigMap.put(key, config);
LDAPUtil.connectionCountMap.put(key, 0);
i++;
} catch (NamingException e) {
logger.info("LDAP不可用:"+config.getUrl());
e.printStackTrace();
}
}
//如果无可用的LDAP,那么抛出异常
if(i<=0){
throw new CommunicationRuntimeException();
}
}
}
@Override
public boolean login(String uid,String md5Pwd,String ip){
//第一次初始化
if(LDAPUtil.effectiveConfigMap.size()<=0){
init();
}
boolean isLoginSuccess = false;
DirContext dc = null;
String key = null;
ConfigEO config = null;
try {
Object[] objs = LDAPUtil.getDirContextNew();
key = objs[0].toString();
dc = (DirContext)objs[1];
config = LDAPUtil.effectiveConfigMap.get(key);
int startCount = LDAPUtil.connectionCountMap.get(key)+1;
LDAPUtil.connectionCountMap.put(key, startCount);
if(logger.isInfoEnabled()){
//释放连接
logger.info("连接LDAP("+config.getUrl()+")连接,当前连接数为:"+startCount);
}
// 通过uid和userPassword获取用户
SearchControls sc = new SearchControls();
sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
String filter = "(&(objectClass=inetOrgPerson)(uid=".concat(uid).concat(")(userPassword=").concat(md5Pwd).concat("))");
NamingEnumeration<SearchResult> ne = dc.search(Constants.ROOT_DN, filter, sc);
while(ne.hasMore()){
SearchResult result = ne.next();
Attributes attrs = result.getAttributes();
if(attrs!=null){
String username = AttributeUtil.getValue("uid", attrs.get("uid"));
if(!StringUtils.isEmpty(username)){
isLoginSuccess = true;
}
}
break;
}
return isLoginSuccess;
} catch (NamingException e) {
e.printStackTrace();
if(e instanceof CommunicationException || e instanceof ServiceUnavailableException) {
throw new CommunicationRuntimeException();
}else{
throw new BaseRunTimeException();
}
}finally{
int endCount = LDAPUtil.connectionCountMap.get(key)-1;
LDAPUtil.connectionCountMap.put(key, endCount);
if(logger.isInfoEnabled()&&config!=null){
//释放连接
logger.info("释放LDAP("+config.getUrl()+")连接,当前连接数为:"+endCount);
}
try {
dc.close();
} catch (NamingException e) {
e.printStackTrace();
}
}
}
public boolean loginNew(String uid,String md5Pwd,String ip){
boolean isLoginSuccess = false;
DirContext dc = null;
try {
dc = LDAPUtil.getDirContext();
// 通过uid和userPassword获取用户
SearchControls sc = new SearchControls();
sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
String filter = "(&(objectClass=inetOrgPerson)(uid=".concat(uid).concat(")(userPassword=").concat(md5Pwd).concat("))");
NamingEnumeration<SearchResult> ne = dc.search(Constants.ROOT_DN, filter, sc);
while(ne.hasMore()){
SearchResult result = ne.next();
Attributes attrs = result.getAttributes();
if(attrs!=null){
String username = AttributeUtil.getValue("uid", attrs.get("uid"));
if(!StringUtils.isEmpty(username)){
isLoginSuccess = true;
}
}
break;
}
return isLoginSuccess;
} catch (NamingException e) {
e.printStackTrace();
if(e instanceof CommunicationException || e instanceof ServiceUnavailableException) {
throw new CommunicationRuntimeException();
}else{
throw new BaseRunTimeException();
}
}finally{
try {
dc.close();
} catch (NamingException e) {
e.printStackTrace();
}
}
}
@Override
public void update(UserEO user){
String personDn = user.getPersonDn();
if(StringUtils.isEmpty(personDn)||!personDn.startsWith("cn")){
throw new IllegalArgumentException();
}
Attributes attrs = new BasicAttributes();
DirContext dc = null;
try {
dc = LDAPUtil.getDirContext();
//用户状态
attrs.put("title",user.getStatus());
//经过MD5加密的密码
attrs.put("userPassword",user.getPassword()==null?null:user.getPassword());
dc.modifyAttributes(personDn, DirContext.REPLACE_ATTRIBUTE, attrs);
} catch (NamingException e) {
e.printStackTrace();
if(e instanceof CommunicationException || e instanceof ServiceUnavailableException) {
throw new CommunicationRuntimeException();
}else{
throw new BaseRunTimeException();
}
}finally{
try {
dc.close();
} catch (NamingException e) {
e.printStackTrace();
}
}
}
@Override
public void save(UserEO user) throws UidRepeatedException{
String personDn = user.getPersonDn();
if(StringUtils.isEmpty(personDn)||!personDn.startsWith("cn")){
throw new IllegalArgumentException();
}
//验证uid是否已存在
boolean isUidExisted = LDAPUtil.isNodesExisted(Constants.ROOT_DN, "uid=".concat(user.getUid()), SearchControls.SUBTREE_SCOPE);
if(isUidExisted){
throw new UidRepeatedException();
}
Attributes attrs = new BasicAttributes();
DirContext dc = null;
try {
dc = LDAPUtil.getDirContext();
//用户状态
attrs.put("title",user.getStatus());
attrs.put("uid",user.getUid());
//经过MD5加密的密码
String md5Pwd = user.getPassword();
attrs.put("userPassword",md5Pwd);
dc.modifyAttributes(personDn, DirContext.REPLACE_ATTRIBUTE, attrs);
} catch (NamingException e) {
e.printStackTrace();
if(e instanceof CommunicationException || e instanceof ServiceUnavailableException) {
throw new CommunicationRuntimeException();
}else{
throw new BaseRunTimeException();
}
}
}
@Override
public void delete(String uid){
Attributes attrs = new BasicAttributes();
DirContext dc = null;
try {
dc = LDAPUtil.getDirContext();
// 查询条件
SearchControls sc = new SearchControls();
sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
NamingEnumeration<SearchResult> ne = dc.search(Constants.ROOT_DN, "uid=".concat(uid), sc);
//uid唯一
while(ne.hasMore()){
SearchResult result = ne.next();
String personDn = result.getNameInNamespace();
attrs.put("uid","");
attrs.put("userPassword","");
dc.modifyAttributes(personDn, DirContext.REPLACE_ATTRIBUTE, attrs);
break;
}
} catch (NamingException e) {
e.printStackTrace();
if(e instanceof CommunicationException || e instanceof ServiceUnavailableException) {
throw new CommunicationRuntimeException();
}else{
throw new BaseRunTimeException();
}
}
}
@Override
public void updatePassword(String uid,String md5Pwd,String md5NewPassword){
Attributes attrs = new BasicAttributes();
DirContext dc = null;
try {
dc = LDAPUtil.getDirContext();
// 通过uid获取用户
SearchControls sc = new SearchControls();
sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
String filter = "uid=".concat(uid);
if(!StringUtils.isEmpty(md5Pwd)){
filter = "&((uid=".concat(uid).concat(")(userPassword=").concat(md5Pwd).concat("))");
}else{
filter = "uid=".concat(uid);
}
NamingEnumeration<SearchResult> ne = dc.search(Constants.ROOT_DN, filter, sc);
//uid唯一
while(ne.hasMore()){
SearchResult result = ne.next();
String personDn = result.getNameInNamespace();
attrs.put("userPassword",md5NewPassword);
//修改密码
dc.modifyAttributes(personDn, DirContext.REPLACE_ATTRIBUTE, attrs);
break;
}
} catch (NamingException e) {
e.printStackTrace();
if(e instanceof CommunicationException || e instanceof ServiceUnavailableException) {
throw new CommunicationRuntimeException();
}else{
throw new BaseRunTimeException();
}
}
}
/**
* 更新用户状态</br>
* @param uid
* @param status
*/
public void updateStatus(UserEO user){
Attributes attrs = new BasicAttributes();
DirContext dc = null;
try {
dc = LDAPUtil.getDirContext();
// 更新用户状态
attrs.put("title",user.getStatus());
dc.modifyAttributes(user.getPersonDn(), DirContext.REPLACE_ATTRIBUTE, attrs);
} catch (NamingException e) {
e.printStackTrace();
if(e instanceof CommunicationException || e instanceof ServiceUnavailableException) {
throw new CommunicationRuntimeException();
}else{
throw new BaseRunTimeException();
}
}
}
@Override
public UserEO getUser(String uid, String md5Pwd){
DirContext dc = null;
try {
UserEO user = null;
dc = LDAPUtil.getDirContext();
// 通过uid和userPassword获取用户
SearchControls sc = new SearchControls();
sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
String filter = "(&(uid=".concat(uid).concat(")(userPassword=").concat(md5Pwd).concat("))");
NamingEnumeration<SearchResult> ne = dc.search(Constants.ROOT_DN, filter, sc);
while(ne.hasMore()){
SearchResult result = ne.next();
user = getUser(result.getAttributes());
break;
}
return user;
} catch (NamingException e) {
e.printStackTrace();
if(e instanceof CommunicationException || e instanceof ServiceUnavailableException) {
throw new CommunicationRuntimeException();
}else{
throw new BaseRunTimeException();
}
}
}
@Override
public UserEO getUser(String personDn){
//入参验证
if(StringUtils.isEmpty(personDn)||!personDn.startsWith("cn")){
throw new IllegalArgumentException();
}
DirContext dc = null;
try {
dc = LDAPUtil.getDirContext();
// 通过uid和userPassword获取用户
SearchControls sc = new SearchControls();
sc.setSearchScope(SearchControls.OBJECT_SCOPE);
NamingEnumeration<SearchResult> ne = dc.search(personDn, "objectClass=*", sc);
UserEO user = null;
while(ne.hasMore()){
SearchResult result = ne.next();
user = getUser(result.getAttributes());
break;
}
return user;
} catch (NamingException e) {
e.printStackTrace();
if(e instanceof CommunicationException || e instanceof ServiceUnavailableException) {
throw new CommunicationRuntimeException();
}else{
throw new BaseRunTimeException();
}
}
}
/**
* 通过LDAP获取的信息构建用户对象
* @param attrs
* @return
*/
private UserEO getUser(Attributes attrs){
UserEO user = new UserEO();
//用户名
String uid = AttributeUtil.getValue("uid", attrs.get("uid"));
user.setUid(uid);
//密码
String userPassword = AttributeUtil.getValue("userPassword", attrs.get("userPassword"));
user.setPassword(userPassword);
return user;
}
@Override
public boolean isUidExisted(String uid) {
return LDAPUtil.isNodesExisted(Constants.ROOT_DN, "uid=".concat(uid), SearchControls.SUBTREE_SCOPE);
}
}
| [
"2885129077@qq.com"
] | 2885129077@qq.com |
378f7951f75acda9f17f979ece0a5ee485308a32 | 0ae199a25f8e0959734f11071a282ee7a0169e2d | /core/api/src/main/java/org/onosproject/net/group/DefaultGroup.java | 5f5801f757e4ca51e5acf013207d33117d1057ef | [
"Apache-2.0"
] | permissive | lishuai12/onosfw-L3 | 314d2bc79424d09dcd8f46a4c467bd36cfa9bf1b | e60902ba8da7de3816f6b999492bec2d51dd677d | refs/heads/master | 2021-01-10T08:09:56.279267 | 2015-11-06T02:49:00 | 2015-11-06T02:49:00 | 45,652,234 | 0 | 1 | null | 2016-03-10T22:30:45 | 2015-11-06T01:49:10 | Java | UTF-8 | Java | false | false | 6,086 | java | /*
* Copyright 2015 Open Networking Laboratory
*
* 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.onosproject.net.group;
import static com.google.common.base.MoreObjects.toStringHelper;
import java.util.Objects;
import org.onosproject.core.GroupId;
import org.onosproject.net.DeviceId;
/**
* ONOS implementation of default group that is stored in the system.
*/
public class DefaultGroup extends DefaultGroupDescription
implements Group, StoredGroupEntry {
private GroupState state;
private boolean isGroupStateAddedFirstTime;
private long life;
private long packets;
private long bytes;
private long referenceCount;
private GroupId id;
/**
* Initializes default values.
*
* @param newId group id for new group
*/
private void initialize(GroupId newId) {
id = newId;
state = GroupState.PENDING_ADD;
life = 0;
packets = 0;
bytes = 0;
referenceCount = 0;
}
/**
* Default group object constructor with the parameters.
*
* @param id group identifier
* @param groupDesc group description parameters
*/
public DefaultGroup(GroupId id, GroupDescription groupDesc) {
super(groupDesc);
initialize(id);
}
/**
* Default group object constructor with the available information
* from data plane.
*
* @param id group identifier
* @param deviceId device identifier
* @param type type of the group
* @param buckets immutable list of group bucket
*/
public DefaultGroup(GroupId id,
DeviceId deviceId,
GroupDescription.Type type,
GroupBuckets buckets) {
super(deviceId, type, buckets);
initialize(id);
}
/**
* Returns group identifier associated with a group object.
*
* @return GroupId Group Identifier
*/
@Override
public GroupId id() {
return this.id;
}
/**
* Returns current state of a group object.
*
* @return GroupState Group State
*/
@Override
public GroupState state() {
return this.state;
}
/**
* Returns the number of milliseconds this group has been alive.
*
* @return number of millis
*/
@Override
public long life() {
return this.life;
}
/**
* Returns the number of packets processed by this group.
*
* @return number of packets
*/
@Override
public long packets() {
return this.packets;
}
/**
* Returns the number of bytes processed by this group.
*
* @return number of bytes
*/
@Override
public long bytes() {
return this.bytes;
}
/**
* Sets the new state for this entry.
*
* @param newState new group entry state.
*/
@Override
public void setState(Group.GroupState newState) {
this.state = newState;
}
/**
* Sets how long this entry has been entered in the system.
*
* @param life epoch time
*/
@Override
public void setLife(long life) {
this.life = life;
}
/**
* Sets number of packets processed by this group entry.
*
* @param packets a long value
*/
@Override
public void setPackets(long packets) {
this.packets = packets;
}
/**
* Sets number of bytes processed by this group entry.
*
* @param bytes a long value
*/
@Override
public void setBytes(long bytes) {
this.bytes = bytes;
}
@Override
public void setReferenceCount(long referenceCount) {
this.referenceCount = referenceCount;
}
@Override
public long referenceCount() {
return referenceCount;
}
/*
* The deviceId, type and buckets are used for hash.
*
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public int hashCode() {
return super.hashCode() + Objects.hash(id);
}
/*
* The deviceId, groupId, type and buckets should be same.
*
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof DefaultGroup) {
DefaultGroup that = (DefaultGroup) obj;
return super.equals(obj) &&
Objects.equals(id, that.id);
}
return false;
}
@Override
public String toString() {
return toStringHelper(this)
.add("description", super.toString())
.add("groupid", id)
.add("state", state)
.toString();
}
@Override
public void setIsGroupStateAddedFirstTime(boolean isGroupStateAddedFirstTime) {
this.isGroupStateAddedFirstTime = isGroupStateAddedFirstTime;
}
@Override
public boolean isGroupStateAddedFirstTime() {
return isGroupStateAddedFirstTime;
}
}
| [
"lishuai12@huawei.com"
] | lishuai12@huawei.com |
8bb7a0ccf89ba28fb24cb04118a0ebca71da5449 | d9f653a79b25808d825701ef36b892f3f3bdd9be | /openddal-engine/src/main/java/com/openddal/repo/ha/SmartSupport.java | 23cbcc3d8bcefc4d219650096bc3429fae6bf9ac | [
"Apache-2.0"
] | permissive | 416235710/openddal | f337d272e61eaf25380541f04389dc827c275c08 | af404d190f6346162015c378d16a525df5030e7f | refs/heads/master | 2021-01-18T05:39:05.204196 | 2016-06-22T16:25:25 | 2016-06-22T16:25:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,506 | java | /*
* Copyright 2014-2016 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the “License”);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an “AS IS” BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.openddal.repo.ha;
import com.openddal.message.Trace;
import com.openddal.repo.JdbcRepository;
import com.openddal.util.New;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
/**
* @author <a href="mailto:jorgie.mail@gmail.com">jorgie li</a>
*/
public class SmartSupport {
protected final JdbcRepository database;
protected final SmartDataSource dataSource;
protected final Trace trace;
/**
* @param database
* @param dataSource
* @param connection
* @param trace
* @throws SQLException
*/
protected SmartSupport(JdbcRepository database, SmartDataSource dataSource) {
this.database = database;
this.dataSource = dataSource;
this.trace = database.getTrace();
}
protected boolean isDebugEnabled() {
return trace.isDebugEnabled();
}
protected void debug(String text) {
if (trace.isDebugEnabled()) {
trace.debug(dataSource.toString() + text);
}
}
protected Connection applyConnection(boolean readOnly) throws SQLException {
return applyConnection(readOnly, null, null);
}
protected Connection applyConnection(boolean readOnly, String username, String password) throws SQLException {
List<DataSourceMarker> tryList = New.arrayList();
DataSourceMarker selected = dataSource.doRoute(readOnly);
while (selected != null) {
try {
tryList.add(selected);
return (username != null) ? database.getConnection(selected, username, password)
: database.getConnection(selected);
} catch (SQLException e) {
selected = dataSource.doRoute(readOnly, tryList);
}
}
throw new SQLException("No avaliable datasource in shard " + dataSource);
}
}
| [
"wplatform@gmail.com"
] | wplatform@gmail.com |
8c0885ab8046abc46e0f2a8188b290836cacb3cf | 742a5c140cca5d87167174183019926b83d72e73 | /old/opal/align/ConsistencyAligner.java | 6d5702c2f1c6ea16e397d104e13e516e2c676154 | [] | no_license | TravisWheelerLab/Opalv3 | 2fd3321aaffb658ddaab5bc3710f2269c8c471bf | 45d7831d3d6c16c786b8c54380c47152b59f2111 | refs/heads/master | 2020-07-03T05:04:46.333124 | 2016-06-14T19:41:54 | 2016-06-14T19:41:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,204 | java | package opal.align;
import java.util.ArrayList;
import java.util.Iterator;
import com.traviswheeler.libs.LogWriter;
import opal.IO.SequenceConverter;
import opal.align.shapes.ConsistencyShape;
import opal.align.shapes.ConsistencyShapeTester;
import opal.align.shapes.Shape;
import opal.exceptions.GenericOpalException;
import opal.tree.Tree;
import opal.tree.TreeNode;
public class ConsistencyAligner extends ExactCountAligner_Time {
public static enum Direction {vert, horiz, diag };
public static Aligner.AlignmentType alignmentMethod = AlignmentType.exact;
boolean testing = false;
// boolean testing = true;
public Aligner simpleAligner;
PairwiseAlignmentsContainer alignmentContainer;
ConsistencyModifiers_AllPairs mods;
public ConsistencyAligner(Aligner al) {
this(true);
simpleAligner = al;
}
public ConsistencyAligner() {
this(true);
}
public ConsistencyAligner( Alignment A, Alignment B) {
super(A,B);
LogWriter.stdErrLogln("Not expecting to be used that way...");
throw new GenericOpalException("");
}
public ConsistencyAligner( boolean pess) {
super(pess);
}
public ConsistencyAligner( Alignment A, Alignment B, boolean pess) {
super(A,B,pess);
LogWriter.stdErrLogln("Not expecting to be used that way...");
throw new GenericOpalException("");
}
public void setAlignments (Alignment A, Alignment B) {
super.setAlignments(A,B);
simpleAligner.setAlignments(A, B);
}
public void setNode (TreeNode n) {
super.setNode(n);
simpleAligner.setNode(n);
}
public void align () {
//int nodeCount = node.lastLeaf - node.firstLeaf + 1;
int nodeCount = A.K + B.K;
if ( nodeCount > PairwiseAlignmentsContainer.maxSubtreeSize) {
simpleAligner.align();
// set vars to match those results
//} else if (nodeCount == 2 || simpleAligner instanceof ProfileAligner) {
} else if ( (A.K==1 && B.K==1) || alignmentMethod == AlignmentType.profile) {
mods = new ConsistencyModifiers_AllPairs(node, alignmentContainer);
ConsistencyHeuristicAligner al = new ConsistencyHeuristicAligner(this);
al.align();
path = al.getPath();
estimatedCost = al.getEstimatedCost();
// char[][] result = SequenceConverter.convertPathToCharAlignment(path, SequenceConverter.convertIntsToSeqs(A.seqs), SequenceConverter.convertIntsToSeqs(B.seqs));
// int[][] result = SequenceConverter.convertPathToCharAlignment(al.getPath(), A, B);
} else {
super.align();
}
}
public Alignment getAlignment () {
int nodeCount = node.lastLeaf - node.firstLeaf + 1;
if ( nodeCount > PairwiseAlignmentsContainer.maxSubtreeSize) {
return simpleAligner.getAlignment();
} else {
return super.getAlignment();
}
}
public void preprocessTree (Tree tree, float distances[][]) {
super.preprocessTree(tree, distances);
if (PairwiseAlignmentsContainer.blendMethod == PairwiseAlignmentsContainer.BlendType.symmetric ) {
alignmentContainer = new PairwiseAlignmentContainer_symmetricBlend(tree, distances);
} else if (PairwiseAlignmentsContainer.blendMethod == PairwiseAlignmentsContainer.BlendType.simple) {
alignmentContainer = new PairwiseAlignmentContainer_simpleBlend(tree, distances);
} else if (PairwiseAlignmentsContainer.blendMethod == PairwiseAlignmentsContainer.BlendType.asym_oneparam ) {
alignmentContainer = new PairwiseAlignmentContainer_asymBlendOneParam(tree, distances);
} else if (PairwiseAlignmentsContainer.blendMethod == PairwiseAlignmentsContainer.BlendType.asym_twoparam ) {
alignmentContainer = new PairwiseAlignmentContainer_asymBlendTwoParam(tree, distances);
}
}
protected void initialize() {
//pass pairs to PairwiseAlignmentsContainer, do/get all p/w alignts.
mods = new ConsistencyModifiers_AllPairs(node, alignmentContainer);
firstColWithShape_curr = 0;
lastColWithShape_curr = 0;
firstColWithShape_next = -1;
lastColWithShape_next = -1;
// pessimistic alignment. Just used to establish an upper bound.
ConsistencyHeuristicAligner al = new ConsistencyHeuristicAligner( this );
al.setPessimistic(true);
al.align();
int[][] result = SequenceConverter.convertPathToIntAlignment(al.getPath(), A, B);
// char[][] result3 = SequenceConverter.convertPathToCharAlignment(al.getPath(), SequenceConverter.convertIntsToSeqs(A.seqs), SequenceConverter.convertIntsToSeqs(B.seqs));
long estCost = al.getEstimatedCost();
int pessimisticUpperBound = calcConsistencyCost(result);
if (estCost < 0) {
LogWriter.stdErrLogln("Surprise: cost of alignment is negative");
throw new GenericOpalException("Surprise: cost of alignment is negative");
}
if (pessimisticUpperBound > estCost) {
LogWriter.stdErrLogln("Surprise: actual cost of alignment is worse than pessimistic estimate");
throw new GenericOpalException("Surprise: actual cost of alignment is worse than pessimistic estimate");
}
//optimistic alignment. Need to save the tables for bound pruning.
//A and B are reversed because the tables are computed from end to beginning
int[][] revA = SequenceConverter.buildReverseAlignment(A.seqs);
int[][] revB = SequenceConverter.buildReverseAlignment(B.seqs);
Alignment alA = Alignment.buildNewAlignment(revA, A.seqIds);
Alignment alB = Alignment.buildNewAlignment(revB, B.seqIds);
al = new ConsistencyHeuristicAligner(this);
al.setPessimistic(false);
al.setReverseMode(true);
al.setAlignments(alA, alB);
al.align();
// char[][] result2 = SequenceConverter.convertPathToCharAlignment(al.getPath(), SequenceConverter.convertIntsToSeqs(alA.seqs), SequenceConverter.convertIntsToSeqs(alB.seqs));
result = SequenceConverter.convertPathToIntAlignment (al.getPath(), alA, alB);
estCost = al.getEstimatedCost();
int costUpperBound = calcConsistencyCost(result,true);
if (estCost < 0) {
LogWriter.stdErrLogln("Surprise: cost of alignment is negative");
throw new GenericOpalException("Surprise: cost of alignment is negative");
}
if (costUpperBound < estCost) {
LogWriter.stdErrLogln("Surprise: actual cost of alignment is better than optimistic estimate");
throw new GenericOpalException("Surprise: actual cost of alignment is better than optimistic estimate");
}
costUpperBound = Math.min(pessimisticUpperBound, costUpperBound);
shapeTester = new ConsistencyShapeTester (costUpperBound, al.getD(), al.getH(), al.getV());
al.setAlignments(A, B); // back to the non-reverse seqs
// let the GC clean these up
alA = alB = null;
revA = revB = result = null;
//static methods, so I don't need to keep passing these in.
Shape.setAlignments (A, B);
Shape.setParams(costs);
ConsistencyShape.setMods(mods);
currRow = 0;
nextRow = 1;
//allocate dynamic programming table
dpRows = new ArrayList [3][N+1]; // 3 rows to cycle fill in the table. Each row of length N+1, each cell a list of shapes
for (int i=0; i<3; i++){
for(int j=0; j<= N; j++){
dpRows[i][j] = new ArrayList<ConsistencyShape>();
}
}
dpRows[currRow][0].add(new ConsistencyShape()); // initialize entry (0,0) with the flush shape and cost 0
}
protected void fillTable () {
int j;
//fill in the dynamic programming table (row major order)
for (int i = 0; i <= M; i++) {
j = firstColWithShape_curr;
while (j <= lastColWithShape_curr){
Iterator<ConsistencyShape> shapeIterator = dpRows[currRow][j].iterator();
while (shapeIterator.hasNext()) {
ConsistencyShape s = shapeIterator.next();
ConsistencyShape s_new;
if ( i < M ) {
//*** propagate from D[i][j] to D[i+1][j] ***//*
// determine new shape
s_new = (ConsistencyShape)Shape.makeNewShape(s);
s_new.appendColumns(i+1, -1);
if ( !shapeTester.boundPrune(s_new) && !shapeTester.dominancePrune(s_new,dpRows[nextRow][j])) {
dpRows[nextRow][j].add(s_new);
if (firstColWithShape_next==-1 || firstColWithShape_next>j )
firstColWithShape_next = j;
if (lastColWithShape_next<j)
lastColWithShape_next = j;
}
}
if ( j < N ) {
//*** propagate from D[i][j] to D[i][j+1] ***//*
s_new = (ConsistencyShape)Shape.makeNewShape(s);
s_new.appendColumns(-1, j+1);
if ( !shapeTester.boundPrune(s_new) && !shapeTester.dominancePrune(s_new,dpRows[currRow][j+1])) {
dpRows[currRow][j+1].add(s_new);
if (lastColWithShape_curr == j)
lastColWithShape_curr = j+1;
}
}
if ( i < M && j < N ) {
//*** propagate from D[i][j] to D[i+1][j+1] ***//*
s_new = (ConsistencyShape)Shape.makeNewShape(s);
s_new.appendColumns(i+1, j+1);
if ( !shapeTester.boundPrune(s_new) && !shapeTester.dominancePrune(s_new,dpRows[nextRow][j+1])) {
dpRows[nextRow][j+1].add(s_new);
if (firstColWithShape_next==-1)
firstColWithShape_next = j+1;
if (lastColWithShape_next<j+1)
lastColWithShape_next = j+1;
}
}
if (i==M && j==N) {
//for each shape in the last cell,
//need to add closing costs for all gaps still open at completion
s.closeGaps();
}
s.freeUnusedStructures();
}
j++;
}
incrementRow();
}
}
protected int calcConsistencyCost(int[][] C) {
return calcConsistencyCost(C, false);
}
protected int calcConsistencyCost(int[][] C, boolean reverseMode) {
int len = C[0].length;
int cost = 0;
int a,b;
Direction inGap = null;
for (int p=0; p<K; p++) {
int mm = A.posInUgappedString[p][M];
for (int q=0 ; q<L; q++) {
int nn = B.posInUgappedString[q][N];
int cc = 0, cc2 = 0;
inGap = null;
int beg=0;
//skip the initial and terminal all-space columns
while (SequenceConverter.GAP_VAL == C[p][beg] && SequenceConverter.GAP_VAL == C[q+K][beg]) beg++;
int end = len-1;
while (SequenceConverter.GAP_VAL == C[p][end] && SequenceConverter.GAP_VAL == C[q+K][end]) end--;
ConsistencyModifiers_Pair modpair = mods.modifiers[p][q];
int posA=0, posB=0;
for (int i=beg; i<=end; i++) {
a = C[p][i];
if (a!=SequenceConverter.GAP_VAL) posA++;
b = C[q+K][i];
if (b!=SequenceConverter.GAP_VAL) posB++;
if (a != SequenceConverter.GAP_VAL && b != SequenceConverter.GAP_VAL) { // substitution\
if (reverseMode) cc += modpair.subs[mm-(posA-1)][nn-(posB-1)];
else cc += modpair.subs[posA][posB];
if (inGap == Direction.vert) {
if (reverseMode) cc += modpair.vGammaOpens[mm-(posA-1-1)][nn-(posB-1)];
else cc += modpair.vGammaCloses[posA-1][posB-1];
} else if (inGap == Direction.horiz) {
if (reverseMode) cc += modpair.hGammaOpens[mm-(posA-1)][nn-(posB-1-1)];
else cc += modpair.hGammaCloses[posA-1][posB-1];
}
inGap = null;
} else if (a != SequenceConverter.GAP_VAL) { //gap in B, i.e. VERT
if (reverseMode) cc += modpair.vLambdas[mm-(posA-1)][nn-posB];
else cc += modpair.vLambdas[posA][posB];
if (inGap != Direction.vert) {
if (reverseMode) cc += modpair.vGammaCloses[mm-(posA-1)][nn-posB];
else cc += modpair.vGammaOpens[posA][posB];
if (inGap == Direction.horiz)
if (reverseMode) cc += modpair.hGammaOpens[mm-(posA-1)][nn-(posB-1)];
else cc += modpair.hGammaCloses[posA-1][posB];
inGap = Direction.vert;
}
} else if (b != SequenceConverter.GAP_VAL) { //gap in A, i.e. HORIZ
if (reverseMode) cc += modpair.hLambdas[mm-posA][nn-(posB-1)];
else cc += modpair.hLambdas[posA][posB];
if (inGap != Direction.horiz) {
if (reverseMode) cc += modpair.hGammaCloses[mm-posA][nn-(posB-1)];
else cc += modpair.hGammaOpens[posA][posB];
if (inGap == Direction.vert)
if (reverseMode) cc += modpair.vGammaOpens[mm-(posA-1)][nn-(posB-1)];
else cc += modpair.vGammaCloses[posA][posB-1];
inGap = Direction.horiz;
}
} // otherwise, it's a double-dash column
if (testing) LogWriter.stdOutLogln("col " + i + " : " + cc);
cc2 += cc;
cc = 0;
}
//all done; did I just close a gap?
int xx = 0;
if (inGap == Direction.vert) {
if (reverseMode) xx = modpair.vGammaOpens[1][0];
else xx = modpair.vGammaCloses[mm][nn];
} else if (inGap == Direction.horiz) {
if (reverseMode) cc2 += modpair.hGammaOpens[0][1];
else cc2 += modpair.hGammaCloses[mm][nn];
}
if (xx>0) {
if (testing) LogWriter.stdOutLogln("a little more: " + xx);
cc2 += xx;
}
cost += cc2;
}
}
return cost;
}
public PairwiseAlignmentsContainer getAlignmentContainer () {
return alignmentContainer;
}
public ConsistencyModifiers_AllPairs getConsistencyModifiers () {
return mods;
}
}
| [
"dan@dandeblasio.com"
] | dan@dandeblasio.com |
b394150b660c4cd3f25ff39391a85acc0f1b04c3 | de9e7dc12245012c14c507b7d90dd408088167e6 | /src/com/deimos/perk/parser/Parser.java | 7546e03c877bcb861edc2cb842320f84dc2d06da | [] | no_license | crueda/PERK | 32ae169778230054ce87515db7397acbb1a66261 | 5c3c5d68926fd7c47cf801fe8c803621d8e4ce0d | refs/heads/master | 2020-04-14T19:40:10.932891 | 2012-09-28T07:02:00 | 2012-09-28T07:02:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 124 | java | package com.deimos.perk.parser;
public interface Parser {
public abstract void parse(byte[] copyOfRange, int deviceID);
}
| [
"crueda@gmail.com"
] | crueda@gmail.com |
30d26db10f84731f6074d015d0391224cd789997 | 984611697fca7cf7c3e4eb1f4bb9c19fa4832f23 | /Learning_Java/src/Tree/Node.java | 349fe4dd7bf138e547c2114294dbc09b348c37f6 | [] | no_license | PlayerForever/Learning_Java | ec694a995057fb339ac67cf318fcc85b5976cf34 | 918b9cbf87becae828b033fe01602e079c59d397 | refs/heads/master | 2020-04-14T05:25:14.884318 | 2019-01-02T11:31:14 | 2019-01-02T11:31:14 | 163,660,263 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 246 | java | package Tree;
public class Node { // node of binary tree
public long data;
public String sData;
public Node leftChild;
public Node rightChild;
public Node(long data, String sData) {
this.data = data;
this.sData = sData;
}
}
| [
"chyneya@gmail.com"
] | chyneya@gmail.com |
48ae2faf087b752aa9c40821cfd566e57fbb6e66 | 237ce9bfc5c9bd690015df3effac74bbc9a336cc | /src/main/java/com/fh/shop/api/category/mapper/CategoryMapper.java | 624b779d9a61215b53d8640aa7de840463ad11a3 | [] | no_license | xxxxxx-hub/shop-api | 4a614f8c26a27ec9cfd0f11114b9da1cbb3187ab | 33767adf4183ec8634f2448acd2bb8b0a6280709 | refs/heads/master | 2022-12-01T02:31:27.680349 | 2020-08-09T11:30:56 | 2020-08-09T11:30:56 | 286,214,819 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 327 | java | package com.fh.shop.api.category.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fh.shop.api.category.po.Category;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface CategoryMapper extends BaseMapper<Category> {
}
| [
"1183315612@qq.com"
] | 1183315612@qq.com |
515440edc446abd17d5ac8925d554ccbe59eaa98 | 0dc91366e40a3a9dee51654c0d509da3e7572e68 | /src/me/xiaopan/examples/android/activity/MediasActivity.java | 02e6f8fee668137d65c9783dfeee830fd68c8d91 | [] | no_license | wang9090980/Examples | 3a879ad6abb5d8bc56d0fb298f54dcb38e17fd4b | 7a8acc49d82192b861dc6a9fef8d699ba16e3f1b | refs/heads/master | 2020-12-26T03:21:36.125340 | 2014-01-06T09:57:15 | 2014-01-06T09:57:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,347 | java | /*
* Copyright 2013 Peng fei Pan
*
* 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 me.xiaopan.examples.android.activity;
import java.util.ArrayList;
import me.xiaopan.examples.android.BaseActivtyEntryActivity;
import me.xiaopan.examples.android.R;
import me.xiaopan.examples.android.activity.media.PlaySoundActivity;
import me.xiaopan.examples.android.adapter.TextAdapter.Text;
import me.xiaopan.examples.android.bean.ActivityEntry;
import android.os.Bundle;
/**
* 动画
*/
public class MediasActivity extends BaseActivtyEntryActivity{
@Override
public void onInitData(Bundle savedInstanceState) {
ArrayList<Text> texts = new ArrayList<Text>();
texts.add(new ActivityEntry(getString(R.string.activityTitle_playSound), PlaySoundActivity.class));
setTexts(texts);
super.onInitData(savedInstanceState);
}
}
| [
"i@xiaopan.me"
] | i@xiaopan.me |
38beb5b23eb8f546b8bd3592831365a80107e37e | fae903349e8af319bec67dd9e1687f8c77a1ca3d | /app/src/main/java/adapters/TransportListAdapter.java | 739b7c29f9254e5e50c96dcb47aa2cdbf0b4bfc0 | [] | no_license | sazzad-rocky/ccholodesh | 78b29af0d84505126e6c92c7b609ed53d2e2aaad | f62a4ef5935a645a2969d8fa635ff6032d4d6be5 | refs/heads/master | 2020-05-29T13:14:55.682472 | 2019-05-29T04:50:32 | 2019-05-29T04:50:32 | 189,153,370 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,719 | java | /*
* Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
* Vestibulum commodo. Ut rhoncus gravida arcu.
*/
package adapters;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.olivine.parjatanbichitra.cholodesh.R;
import model.TransportProvider;
/**
* Created by Olivine on 5/13/2017.
*/
public class TransportListAdapter extends ArrayAdapter<TransportProvider> {
Context mContext;
TransportProvider [] transportProviders;
private int [] drawables=new int[]{R.drawable.icon_bus_white,R.drawable.icon_airoplane,R.drawable.icon_train,R.drawable.icon_ship};
public TransportListAdapter(@NonNull Context mContext,@NonNull TransportProvider[] transportProviders) {
super(mContext, R.layout.layout_transport_list, transportProviders);
this.mContext = mContext;
this.transportProviders = transportProviders;
}
@Override
public int getCount() {
return transportProviders.length;
}
@Nullable
@Override
public TransportProvider getItem(int position) {
return transportProviders[position];
}
@Override
public long getItemId(int position) {
return position;
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
TransportProvider transportProvider=transportProviders[position];
TransportListViewHolder viewHolder=null;
if(convertView==null){
View view=LayoutInflater.from(mContext).inflate(R.layout.layout_transport_list,parent,false);
convertView=view;
viewHolder=new TransportListViewHolder();
viewHolder.transportSignature= (ImageView) convertView.findViewById(R.id.transportSignature);
viewHolder.txtProviderName= (TextView) convertView.findViewById(R.id.txtProviderName);
viewHolder.txtCost= (TextView) convertView.findViewById(R.id.txtCost);
viewHolder.txtEstimatedHour= (TextView) convertView.findViewById(R.id.txtEstimatedHour);
convertView.setTag(viewHolder);
}else{
viewHolder= (TransportListViewHolder) convertView.getTag();
}
String providerName=transportProvider.getTransportInfoOperatorName();
// if (providerName == null || providerName == "")
// {
// Toast.makeText(mContext,"No Transport Available at this moment",Toast.LENGTH_LONG).show();
// return convertView;
// }
if (providerName == null || providerName == "")
{
viewHolder.txtProviderName.setText("NA");
viewHolder.txtEstimatedHour.setText("NA");
viewHolder.txtCost.setText("0");
viewHolder.transportSignature.setImageResource(R.drawable.icon_dummy_transport);
return convertView;
}
else
{
viewHolder.txtProviderName.setText(providerName);
viewHolder.txtEstimatedHour.setText(transportProvider.getTransportInfoEstimatedTime()+" Hour Journey");
viewHolder.txtCost.setText(transportProvider.getTransportInfoPrice()+"৳");
viewHolder.transportSignature.setImageResource(R.drawable.icon_dummy_transport);
String tranpostType=transportProvider.getTtName();
if(tranpostType==null || tranpostType.length()<1){
tranpostType="NA";
}
switch (tranpostType.substring(0,1)){
case "B" :
viewHolder.transportSignature.setImageResource(drawables[0]);
break;
case "A":
viewHolder.transportSignature.setImageResource(drawables[1]);
break;
case "T":
viewHolder.transportSignature.setImageResource(drawables[2]);
break;
case "C":
viewHolder.transportSignature.setImageResource(drawables[3]);
}
return convertView;
}
}
}
class TransportListViewHolder{
ImageView transportSignature;
TextView txtProviderName;
TextView txtEstimatedHour;
TextView txtCost;
} | [
"sazzad555rocky@gmail.com"
] | sazzad555rocky@gmail.com |
7f4342d983b52171751692bf1fe160e9c818d101 | e2267702600e0f73b9af52cab4dba45782901f11 | /CartServiceImpl.java | c2096eed2d1173c5f25386e388513553b124af05 | [] | no_license | onkars81/Dreamfurn | 6f2c2f089b8afb0e6876b882f8690f5bff6f4b02 | 3b6ecc3702b156460a17b2c14f2ec456f0f94e87 | refs/heads/master | 2021-01-20T15:50:49.991603 | 2016-06-11T11:23:00 | 2016-06-11T11:23:00 | 60,240,614 | 0 | 0 | null | 2016-06-11T11:24:58 | 2016-06-02T07:06:35 | Java | UTF-8 | Java | false | false | 566 | java | package com.ex.model;
import com.ex.model.CartDao;
import com.ex.model.Cart;
import com.ex.model.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CartServiceImpl implements CartService
{
@Autowired
private CartDao cartDao;
public Cart getCartById(int cartId)
{
return cartDao.getCartById(cartId);
}
public void update(Cart cart){
cartDao.update(cart);
}
} // The End of Class;
| [
"onkars80@yahoo.com"
] | onkars80@yahoo.com |
ba2dedc1fee3a97b295526b577f812a71afa03a3 | d7b154ca2d72cbe64194670de3149aaca2750772 | /Windowz.java | f1dba233e6d42288e257bf85dd03c5c259628ec2 | [] | no_license | kwaegel/winterballz | 0cc3d0dbf13f1a8d52de231f7c0c4c21635d9115 | 4aed6d22c1a4574e3d56dec1a5fc087747ba7a5b | refs/heads/master | 2021-01-17T16:38:03.906462 | 2010-05-03T18:02:33 | 2010-05-03T18:02:33 | 32,244,913 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,621 | java |
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Windowz extends JFrame implements KeyListener {
/**
*
*/
private static final long serialVersionUID = 2224732343525761156L;
private JFrame m_sizeFrame;
private JPanel m_buttonPanel;
private DrawPanel m_drawPanel;
private JButton m_calibrateButton;
private JButton m_beginButton;
private Dimension m_gameDimension;
private Point m_location;
public Windowz ()
{
super("Winter Ballz");
initialize ();
build ();
display ();
}
public void initialize ()
{
this.setPreferredSize(new Dimension (800, 600));
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.addKeyListener(this);
m_buttonPanel = new JPanel ();
m_buttonPanel.setFocusable(false);
m_drawPanel = new DrawPanel ();
m_drawPanel.setPreferredSize(new Dimension(500, 500));
m_calibrateButton = new JButton ("Calibrate");
m_calibrateButton.setFocusable(false);
m_calibrateButton.addActionListener( new ActionListener ()
{
@Override
public void actionPerformed(ActionEvent e) {
Runnable r = new Runnable ()
{
public void run ()
{
getScreenCalibration ();
}
};
new Thread (r).start ();
}
});
m_beginButton = new JButton ("Begin");
m_beginButton.setFocusable(false);
m_beginButton.addActionListener( new ActionListener ()
{
@Override
public void actionPerformed(ActionEvent e) {
Runnable r = new Runnable ()
{
public void run ()
{
startRobot ();
}
};
new Thread (r).start ();
}
});
}
private void startRobot ()
{
Botz bot = new Botz (m_gameDimension, m_location);
bot.setPanel(m_drawPanel);
while (true)
{
bot.update();
//bot.delay(100);
}
}
private void build ()
{
this.setLayout(new BorderLayout ());
m_buttonPanel.add(m_calibrateButton);
m_buttonPanel.add(m_beginButton);
this.add(m_buttonPanel, BorderLayout.CENTER);
this.add(m_drawPanel,BorderLayout.SOUTH);
}
private void display ()
{
this.pack();
this.setVisible(true);
}
private void getScreenCalibration ()
{
m_sizeFrame = new JFrame ("SIZE ME CORRECTLY !");
m_sizeFrame.setSize(750, 500);
JPanel bPanel = new JPanel ();
JButton finished = new JButton ("Finished");
finished.addActionListener( new ActionListener ()
{
@Override
public void actionPerformed(ActionEvent e) {
m_gameDimension = m_sizeFrame.getSize();
m_location = m_sizeFrame.getLocationOnScreen();
m_sizeFrame.setVisible(false);
//System.out.println(m_gameDimension);
}
});
bPanel.add(finished);
m_sizeFrame.setLayout(new BorderLayout ());
m_sizeFrame.add(bPanel,BorderLayout.CENTER);
m_sizeFrame.setVisible(true);
}
@Override
public void keyPressed(KeyEvent e) {
// TODO Auto-generated method stub
if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
{
System.exit(0);
}
}
@Override
public void keyReleased(KeyEvent e) {
// TODO Auto-generated method stub
}
@Override
public void keyTyped(KeyEvent e) {
}
}
| [
"rootmr1@f4b91ead-f813-9f07-509a-2f76cc3e8b08"
] | rootmr1@f4b91ead-f813-9f07-509a-2f76cc3e8b08 |
f65c7b7cba760fb52093c540bf4f16e1549cd912 | eb0da89a3f4fb891fee035b09b8e2eebfec432f5 | /SongApp/app/src/main/java/com/apps/zientara/rafal/songapp/helpers/FileReader.java | 647fe08192c836460e2fa8305e0358130f60345d | [] | no_license | EvilMebel/SongApp | 02d4ecf9efc5d5ada5fd2daaa75bc3af4d8d965b | 354cbdfe664ade05842e1784fc1c07a59e417324 | refs/heads/master | 2021-01-20T02:49:15.591744 | 2017-09-05T22:12:38 | 2017-09-05T22:12:38 | 101,335,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 764 | java | package com.apps.zientara.rafal.songapp.helpers;
import android.content.Context;
import java.io.IOException;
import java.io.InputStream;
public class FileReader {
private final String filePath;
public FileReader(String filePath) {
this.filePath = filePath;
}
public String loadJSONFromAsset(Context context) {
String json = null;
try {
InputStream is = context.getAssets().open(filePath);
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
json = new String(buffer, "UTF-8");
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
return json;
}
}
| [
"rafal.zientara92@gmail.com"
] | rafal.zientara92@gmail.com |
7d027adf87e0b8e1f874cda33ff2112c00f4acb3 | 86c34267eaec48edde5d846a51fbae869bbed03e | /WuZiGame/src/oms/cj/WuZiWay/Way1.java | 64305a9c45b8617fba3b763ac43942efcc3fe8d9 | [] | no_license | whogiawho/original | 0c8950d5700795d5106985f252556c34ea52400c | ccf749cfd29b8449b01e48772b5707975f95fed4 | refs/heads/master | 2021-01-19T06:31:54.055911 | 2013-03-31T11:57:15 | 2013-03-31T11:57:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,653 | java | package oms.cj.WuZiWay;
import oms.cj.WuZiLogic.ISuggest;
import oms.cj.WuZiLogic.VirtualWuZi;
import android.os.Handler;
//Way1的判断序列:
//1. 成5
//2. 成活4
//3. 成冲4活3
//4. 成双3
//5. 成冲4冲3
//6. 成冲4活2
//7. 成活3
//8. 成双冲3
//9. 成冲3活2
//10. 冲3
public class Way1 extends Way implements ISuggest {
@SuppressWarnings("unused")
private final static String TAG="Way1";
private final int mStrategy;
public Way1(VirtualWuZi v, Handler handler, int strategy) {
super(v, handler);
mStrategy = strategy;
}
private int[] getMustStep(){
int[] suggestPos=null;
Way[] ways = {
new Get5(mV, null),
new GetLive4(mV, null),
new GetChong4Live3(mV, null),
new GetDoubleLive3(mV, null),
new GetChong4Chong3(mV, null, mStrategy),
new GetChong4Live2(mV, null, mStrategy),
new GetLive3(mV, null),
new GetDoubleChong3(mV, null, mStrategy),
new GetDoubleLive2(mV, null, mStrategy),
new GetChong3Live2(mV, null, mStrategy),
new GetChong3(mV, null),
new GetLive2(mV, null),
};
for(int i=0;i<ways.length;i++){
Way way=ways[i];
suggestPos=way.suggestPosition();
if(suggestPos!=null)
return suggestPos;
}
return suggestPos;
}
@Override
public int[] suggestPosition() {
int[] suggestPos=null;
suggestPos = getMustStep();
if(suggestPos!=null)
return suggestPos;
//随机返回可选空位中的一个
suggestPos=this.getByCandidateEmptyPos();
if(suggestPos!=null)
return suggestPos;
//最后的方法是用RandomWay随机返回一个空位
suggestPos=getByRandomWay();
return suggestPos;
}
} | [
"root@computer0OfGod.(none)"
] | root@computer0OfGod.(none) |
a61ec8e50eb123abaadc07ff42c1a2fa0e56afa9 | 151230e321cab21d1929d26177988b189a279aeb | /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/utils/config/RESTAPIConfigurationElement.java | d917e467571d6d93e536aeff55296f963a0d08c2 | [
"Apache-2.0"
] | permissive | wso2/carbon-analytics-common | 22a49d6c8c52d9ad31258eb3f7144fb876f2c2dd | 66ed092b2efff2c62628033624afe26c8b43f490 | refs/heads/master | 2023-08-29T14:02:00.248314 | 2023-02-20T08:17:59 | 2023-02-20T08:17:59 | 31,999,455 | 42 | 294 | Apache-2.0 | 2023-09-13T13:41:12 | 2015-03-11T05:08:43 | Java | UTF-8 | Java | false | false | 1,461 | java | /*
* Copyright (c) 2017, 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.analytics.idp.client.core.utils.config;
import org.wso2.carbon.config.annotation.Configuration;
import org.wso2.carbon.config.annotation.Element;
import java.util.ArrayList;
import java.util.List;
/**
* REST API Authentication config Element.
*/
@Configuration(description = "REST API Auth configurations")
public class RESTAPIConfigurationElement {
@Element(description = "Enable authentication for REST API", required = true)
private String authEnable = "true";
@Element(description = "APIs to be excluded when auth is enabled", required = true)
private List<String> exclude = new ArrayList<>();
public String getAuthEnable() {
return authEnable;
}
public List<String> getExclude() {
return exclude;
}
}
| [
"niveathika@wso2.com"
] | niveathika@wso2.com |
43fc2e78b68024072936b114a2789acb4f535db8 | 6bb874562791236daac222c2a14d6b5098ce7eff | /src/org/pathrate/core/ICancelTask.java | f44ca3478aab6cc7c12657e1a3fb7a00ae4e38f4 | [] | no_license | antoniomacri/smartpathrate | 6835e2f9ce267f761ea3e8f63166ce0317437609 | 9410070596100b64c1680fed2ca9683e2c28d375 | refs/heads/master | 2021-01-12T12:58:28.765430 | 2016-10-02T10:42:59 | 2016-10-02T10:42:59 | 69,763,607 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 162 | java | /**
* @author Antonio Macrì, Francesco Racciatti, Silvia Volpe
*/
package org.pathrate.core;
public interface ICancelTask
{
public boolean isCancelled();
}
| [
"ing.antonio.macri@gmail.com"
] | ing.antonio.macri@gmail.com |
758db5b71730180d13ec018f3c585c3e1dd17169 | ccba5751cb78af19339f94cdba0ed4f8a572a4ec | /titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/serialize/SupportsNullSerializer.java | 18c11d5efdf7474acd1ce497c04e2aed1cf9b6cb | [
"Apache-2.0",
"BSD-3-Clause",
"Sleepycat",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | v4liulv/titan-titan10 | fa98c9783b7fa08ab64b8c689c807f892c1760cc | 89afe0484573b7e20356486b30a0bbb30062bc0c | refs/heads/master | 2022-10-13T05:15:52.794788 | 2019-08-11T09:20:43 | 2019-08-11T09:20:43 | 201,743,373 | 0 | 0 | Apache-2.0 | 2022-10-04T23:54:06 | 2019-08-11T09:21:02 | Java | UTF-8 | Java | false | false | 385 | java | package com.thinkaurelius.titan.graphdb.database.serialize;
import com.google.common.base.Preconditions;
import com.thinkaurelius.titan.core.attribute.AttributeSerializer;
/**
* Marker interface to indicate that a given serializer supports serializing
* null values effectively.
*
* @author Matthias Broecheler (me@matthiasb.com)
*/
public interface SupportsNullSerializer {
}
| [
"469549118@qq.com"
] | 469549118@qq.com |
c1654a27940ab38252f3232706465ee96ab0a06b | 94bd2fb9fa7a8b137698f01f83a264c038997e51 | /src/Home_poly/CodingQ1/Ex1.java | 3a502abd27e023b45516bb5f182b4432ba581418 | [] | no_license | mayuravachat9850/Program | 15af07d5e2021a2bc8ef725df154c6f7b2cff322 | dd617e3a95043bcbb2eaf3ff3a0e72bcfb14c8ce | refs/heads/master | 2023-08-14T17:05:38.892416 | 2021-09-27T11:27:25 | 2021-09-27T11:27:25 | 389,029,762 | 0 | 0 | null | 2021-08-11T12:43:57 | 2021-07-24T07:21:31 | Java | UTF-8 | Java | false | false | 233 | java | package Home_poly.CodingQ1;
public class Ex1 {
public static void main(String[] args) {
int[] arr = ArrayBuilder.getArray(10, 20, 30);
for (int ele: arr) {
System.out.println(ele);
}
}
}
| [
"87423951+mayuravachat9850@users.noreply.github.com"
] | 87423951+mayuravachat9850@users.noreply.github.com |
c14c7222cd1f7dec38ee097fa0251bcace71fabf | 8f30a192c2317748c6e3cec9f8f46bdb859d5040 | /src/main/java/untref/tesis/gio/domain/entity/User.java | 5b4e35646520cb40f3e5b168fde1fb7b69c2d548 | [] | no_license | Fscorpiniti/gio_mobile | ac2dac7d127f3a8aa83efcd0a777d8677c429c0e | 6d7c06a750f1aaba4cfb1b823e0070d36aa9ec52 | refs/heads/master | 2021-01-23T03:27:20.228387 | 2017-07-08T14:43:22 | 2017-07-08T14:43:22 | 86,078,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 709 | java | package untref.tesis.gio.domain.entity;
public class User {
private Integer id;
private String email;
private String name;
private UserEconomy userEconomy;
public User(Integer id, String email, String name, UserEconomy userEconomy) {
this.id = id;
this.email = email;
this.name = name;
this.userEconomy = userEconomy;
}
public Integer getId() {
return id;
}
public String getEmail() {
return email;
}
public String getName() {
return name;
}
public UserEconomy getUserEconomy() {
return userEconomy;
}
public Double getCoins() {
return userEconomy.getCoins();
}
}
| [
"fernando.scorpiniti@gmail.com"
] | fernando.scorpiniti@gmail.com |
1cab1bc06d7a556958dfb8b883bce44a3bdd99df | 622af922f10e77e7e61854beb9c0cea672bd9004 | /src/main/java/com/example/springboot/SpringBootDemo.java | c3ee3d5889497aafc59b476ed5d3fe8f0a7b2dc2 | [] | no_license | HamLeeGit/springboot_demo | 2c3ab585f58d4bf87d9ca22f3791bdbb78ed8fbe | 06d60ece8b579a8589b310313e5fe3d573bd3d4e | refs/heads/master | 2022-09-11T15:59:33.041260 | 2019-06-12T10:14:08 | 2019-06-12T10:14:08 | 191,532,530 | 0 | 0 | null | 2022-09-01T23:08:15 | 2019-06-12T08:42:58 | Java | UTF-8 | Java | false | false | 382 | java | package com.example.springboot;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SpringBootDemo {
@RequestMapping("/hello")
public String Demo(){
return "My First SpringBoot";
}
}
| [
"493725788@qq.com"
] | 493725788@qq.com |
4aaa6ccc1dd451294f2f3474719fe8aec538093b | 5fd813bca8f9b7fab10092e619aa8ef231f5befb | /src/main/java/edu/bu/met/cs665/deliverysystem/Dispatch.java | 41a0fd0fde815996598ac3ad84fae94a85d3a721 | [] | no_license | jeffreydalby/DeliverySimulator | b6cfaf98e0af029854f94c996e8e396ec3d01420 | 938f520ec47d0795bfc5020efcd620c839ba1147 | refs/heads/master | 2020-04-05T04:48:05.769614 | 2018-08-10T18:40:11 | 2018-08-10T18:40:11 | 156,567,449 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,428 | java | package edu.bu.met.cs665.deliverysystem;
import edu.bu.met.cs665.simulator.clockticker.ClockTicker;
import edu.bu.met.cs665.Display.Display;
import edu.bu.met.cs665.geography.Distances;
import edu.bu.met.cs665.orders.Order;
import edu.bu.met.cs665.simulator.OrderSimulator;
import edu.bu.met.cs665.simulator.PrimarySimulator;
import java.util.*;
import java.util.List;
//singleton, only one dispatcher per system
//Automated dispatcher that tracks orders and finds the closest driver
//with the right equipment to deliver it
public class Dispatch implements Subject, Runnable {
private static Dispatch dispatchInstance;
//dispatch thread so we can shut it down when done
public Thread getDispatchThread() {
return dispatchThread;
}
private Thread dispatchThread;
//Map of all of our drivers
public static Map<String, DeliveryVehicle> getDriverMap() {
return driverMap;
}
private static Map<String, DeliveryVehicle> driverMap = new HashMap<>();
private static Deque<Order> orders = new ArrayDeque<>(); //deque to hold the orders
private static List<Delivery> deliveryList = new ArrayList<>(); //list to hold deliveries as they are created
private Dispatch() {
this.dispatchThread = new Thread(this);
this.dispatchThread.start();
}
public static synchronized Dispatch getInstance() {
if (dispatchInstance == null) dispatchInstance = new Dispatch();
return dispatchInstance;
}
/**
* Lets drivers register themselves to be able to deliver orders
*
* @param identity - name of the driver
* @param vehicle - driverObject
*/
@Override
public void registerObserver(String identity, DeliveryVehicle vehicle) {
//if our driver map already has a driver with this name make it unique by adding
//the current length of the map to it otherwise we'll loose track of a thread
if (driverMap.containsKey(identity)) {
identity += " #" + driverMap.size();
vehicle.setDriverName(identity);
}
driverMap.put(identity, vehicle);
}
/**
* Remove driver from the driving map
*
* @param driverName - name of driver to remove
*/
@Override
public void removeObserver(String driverName) {
driverMap.remove(driverName);
}
//The dispatch system is responsible for sending out notifications to the available driver
// and doesn't have a need to multicast
@Override
public void notifyObserver(DeliveryDriver deliveryDriver, Delivery delivery) {
deliveryDriver.updateDelivery(delivery);
}
/**
* Requested all drivers post an update to where they are
*/
@Override
public void notifyAllObservers() {
//go through each registered driver and ask for an update
driverMap.values().forEach(theDriver -> ((Observer) theDriver).updateStatus());
}
//main automated dispatch system
@Override
public void run() {
//create a loop to run constantly
while (true) {
//check if we have been interrupted
if (Thread.currentThread().isInterrupted()) break;
//output an update of the current dispatch summary
displayDispatchSummary();
//process the next order, if we are out of orders break out of the loop
if (processNextOrder()) break;
//display an update from all of our drivers
this.notifyAllObservers();
//take a nap to let things process
try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
Display.output("Killed Dispatch Thread");
//reset thread so while loop catches it
Thread.currentThread().isInterrupted();
}
}
}
private boolean processNextOrder() {
DeliveryDriver driver;
//check for order in the queue and at least one available driver
if (!orders.isEmpty() && driverMap.values().stream().anyMatch(DeliveryVehicle::isAvailable)) {
Order nextOrder= orders.removeFirst();
//get a driver
driver = getNearestAvailableDriver(nextOrder);
if (driver != null) {
//let people know we have a traffic event
if (isItRushHour() && nextOrder.isNeedsCold())
Display.output("Traffic event, routing refrigerated truck.");
//create the delivery and notify the driver
createDelivery(driver, nextOrder, isItRushHour() && nextOrder.isNeedsCold());
}
//no driver matches so the poor person gets their order sent to the bottom of the queue
//consider implementing a priority queue so we can bubble things up to the top
else {
orders.addLast(nextOrder);
}
} else if (orders.isEmpty()) {
Display.output("Order Queue is Empty!");
//if the order system is done creating orders and all drivers are available
// and the order queus is empty we can assume we are done
if (!OrderSimulator.getInstance().isCreatingOrders() && driverMap.values().stream().allMatch(DeliveryVehicle::isAvailable)) {
PrimarySimulator.stopSimulation();
if (Thread.currentThread().isInterrupted()) return true;
}
}
return false;
}
private void displayDispatchSummary() {
Display.output("Dispatch Update:"
+ "\nNumber of orders: " + orders.size()
+ "\nDrivers Waiting on Assignment: " + driverMap.values().stream().filter(DeliveryVehicle::isAvailable).count()
+ "\nCurrently Rush hour: " + isItRushHour());
}
/**
* Create the Delivery Object
*
* @param driver - driver object who is handling the delivery
* @param order- the order to be delivered
* @param rushHour- was the order created during a traffic event (rush hour)
*/
private void createDelivery(DeliveryDriver driver, Order order, boolean rushHour) {
Delivery newDelivery = new Delivery(driver, order);
newDelivery.setRefergerated(rushHour);
deliveryList.add(newDelivery);
//notify the driver
notifyObserver(driver, newDelivery);
}
/**
* Find the closest driver that can handle the order
*
* @param order - the order we are trying to handle
* @return
*/
private DeliveryDriver getNearestAvailableDriver(Order order) {
DeliveryDriver returnDriver = null;
//initialize to max so we know we'll get the closest
double closestValue = Double.MAX_VALUE;
//make sure we have drivers
if (!driverMap.isEmpty()) {
for (DeliveryVehicle vehicle : driverMap.values()
) {
//Available vehicles, if it needs heat make sure we have a heater
if (vehicle.isAvailable()) {
//if it needs to be heated and the car has no warmer move on
if (order.isNeedsWarm() && !vehicle.hasWarmer()) continue;
double storeToCustomerDistance = Distances.getDistanceBetweenPoints(order.getCustomer().getLocation(), order.getStore().getLocation());
//if it needs cold we have to check distance and if it is rush hour
//if it is rush hour and the vehicle has no cooler move on
if (order.isNeedsCold() && isItRushHour()) {
if (!vehicle.hasCooler()) continue;
}
//if the distance is > 2000 units (20 blocks) and no cooler and needs cold move on
if (storeToCustomerDistance >= 2000 && !vehicle.hasCooler() && order.isNeedsCold()) continue;
//figure out if this is the closest vehicle
double thisVehicleDistance = Distances.getDistanceBetweenPoints(order.getStore().getLocation(), vehicle.getCurrentLocation());
if (thisVehicleDistance < closestValue) {
closestValue = thisVehicleDistance;
returnDriver = (DeliveryDriver) vehicle;
}
}
}
} else Display.output("No Drivers Registered");
if (returnDriver != null)
Display.output("Found nearest available driver: " + returnDriver.getDriverName() + "\nDistance to store: " + (int) closestValue + " blocks");
return returnDriver;
}
/**
* Add the order to the queue
*
* @param order - the order to be added
*/
public void placeOrder(Order order) {
Display.output("New Order From Customer: \n"
+ "Order #" + order.getOrderNumber()
+ " \n" + order.toString());
orders.addLast(order);
}
@Override
public String toString() {
//return our list of drivers
StringBuilder returnString = new StringBuilder();
driverMap.forEach((k, v) -> returnString.append(v.toString() + "\n"));
return returnString.toString();
}
private boolean isItRushHour() {
return ClockTicker.getClockTickerInstance().getSimulatorClock() > 20 && ClockTicker.getClockTickerInstance().getSimulatorClock() < 80;
}
}
| [
"jdalby@dalbydigital.com"
] | jdalby@dalbydigital.com |
172051364373d2add9f6e9c26d85f49e213d35cf | 707d5801389840f892bf95dcc3afb2e7af41b2f8 | /eve.java | da0487f2c04accaf505f5fa25e55e154a2a4baf4 | [] | no_license | balamurugan1999v/bala | cd0cc2c47b0893851f79cad39b84bdb59a70d8a8 | ec2d83a81c3088e4a706737200fd79da53956268 | refs/heads/master | 2021-01-23T02:16:42.535764 | 2019-01-20T17:43:19 | 2019-01-20T17:43:19 | 102,438,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | import java.util.*;
class eve
{
public static void main(String[] arg)
{
Scanner s=new Scanner(System.in);
int a,b,i;
a=s.nextInt();
b=s.nextInt();
for(i=a+1;i<b;i++)
{
if((i%2)==0)
{
System.out.println(i);
}
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
125aa4622e8f3b0d947cb82c11adfe7a8ac77ac9 | 45dc6a608bfaaedf29be9b043c3ac627b82a4b7a | /src/com/javarush/test/level23/lesson04/task01/Solution.java | fb79b0dadb95ec09b5a8c91afb8b8905e8497b50 | [] | no_license | deft1991/JavaRush | ae453c08a0fda0a48a814a8c53ffa53226fff979 | 6ea64ef2afdace80903b826a68592d77cd290810 | refs/heads/master | 2021-01-21T04:41:34.306074 | 2016-07-19T13:29:53 | 2016-07-19T13:29:53 | 44,170,267 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,236 | java | package com.javarush.test.level23.lesson04.task01;
/* Inner
Реализовать метод getTwoSolutions, который должен возвращать массив из 2-х экземпляров класса Solution.
Для каждого экземпляра класса Solution инициализировать поле innerClasses двумя значениями.
Инициализация всех данных должна происходить только в методе getTwoSolutions.
*/
public class Solution {
public InnerClass[] innerClasses = new InnerClass[2];
public class InnerClass {
}
public static Solution[] getTwoSolutions() {
Solution[]solutions= new Solution[2];
Solution s1 = new Solution();
Solution s2 = new Solution();
Solution.InnerClass ic1= s1.new InnerClass();
Solution.InnerClass ic2= s1.new InnerClass();
Solution.InnerClass ic3= s1.new InnerClass();
Solution.InnerClass ic4= s1.new InnerClass();
s1.innerClasses[0]=ic1;
s1.innerClasses[1]=ic2;
solutions[0]=s1;
s2.innerClasses[0]=ic3;
s2.innerClasses[1]=ic4;
solutions[1]=s2;
return solutions;
}
}
| [
"deft1991@gmail.com"
] | deft1991@gmail.com |
d34fd09b9b9833ebc747d2c1112dc8c54076ad1c | b4f7f96ceb15ee755a16a97ab9fcb5326367763f | /VotingProtocol/src/code/message/client/ReadRequestMessage.java | b71af646527c8815c5ef383c7d4e51ffc8c9ae08 | [] | no_license | sanketc/VotingProtocol | 3fbf2c655276605d1fab8c111baf10be4fd86e38 | 17c650406356c02837f8379bc21b676a4f95f688 | refs/heads/master | 2020-05-30T12:08:22.654109 | 2014-02-04T05:11:15 | 2014-02-04T05:11:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 567 | java | package code.message.client;
import java.io.Serializable;
import code.common.ConfigInfo;
@SuppressWarnings("serial")
public class ReadRequestMessage extends RequestMessage implements Serializable {
public ReadRequestMessage() {
}
public ReadRequestMessage(ConfigInfo config, int requestId, int dataObjectId) {
super(config, requestId, dataObjectId);
}
@Override
public String toString() {
return "[ READ_REQUEST_MESSAGE | FROM=" + getConfig().getFullId() +
" | REQ_ID=" + getRequestId() +
" | DATA_OBJ_ID=" + getDataObjectId() + " ]";
}
} | [
"sanketchandorkar@yahoo.com"
] | sanketchandorkar@yahoo.com |
eb6e8e31f77975c0cc0f524ecc8f50a6144a4dba | f4b7924a03289706c769aff23abf4cce028de6bc | /smart_logic/src/main/java/de/ibw/tms/ma/physical/TrackElementStatus.java | ff69944a93857cc68cb80db8fcdf912e1e955226 | [] | no_license | jimbok8/ebd | aa18a2066b4a873bad1551e1578a7a1215de9b8b | 9b0d5197bede5def2972cc44e63ac3711010eed4 | refs/heads/main | 2023-06-17T21:16:08.003689 | 2021-07-05T14:53:38 | 2021-07-05T14:53:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,147 | java | package de.ibw.tms.ma.physical;
import com.google.gson.annotations.Expose;
import de.ibw.tms.ma.physical.intf.IControlledElementStatus;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* @author iberl@verkehr.tu-darmstadt.de
* @version MVP5
* @since 2021-03-12
*/
public class TrackElementStatus implements Serializable, IControlledElementStatus {
public enum Status {
UNKNOWN, LEFT, RIGHT
}
@Expose
public List<Status> statusList = new ArrayList<>();
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TrackElementStatus that = (TrackElementStatus) o;
return Objects.equals(statusList, that.statusList);
}
@Override
public int hashCode() {
return Objects.hash(statusList);
}
@Override
public String toString() {
return new ToStringBuilder(this)
.append("statusList", statusList)
.toString();
}
}
| [
"iberl@verkehr.tu-darmstadt.de"
] | iberl@verkehr.tu-darmstadt.de |
ad723b0c67405a3eb52cbd180c539843d786c148 | 5abdc0e9d108adc2c51cc061674d9de6b71e9a6e | /src/main/java/tos/entity/Flight.java | 954162498911f55cfbb505d4931c98b3d9500f93 | [] | no_license | ashot123/TOS_JPA_SpringMVC_1 | 3e1d51e699cad027376ec7d98a75221e939796fa | 3d6cab95b9a8fcf6262848ad1c8b699aa8be7667 | refs/heads/master | 2020-04-04T16:36:36.966440 | 2018-11-06T15:31:44 | 2018-11-06T15:31:44 | 156,085,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,159 | java | package tos.entity;
import javax.persistence.*;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by Ashot Karakhanyan on 24-12-2013
*/
@Entity
@Table(name = "flights")
public class Flight extends AbstractEntity {
@Column(name = "departure_date")
private Date departureDate;
@Column(name = "arrival_date")
private Date arrivalDate;
@ManyToOne
@JoinColumn(name = "departure_city_id")
private City departureCity;
@ManyToOne
@JoinColumn(name = "arrival_city_id")
private City arrivalCity;
@ManyToOne/*(cascade={CascadeType.PERSIST, CascadeType.MERGE} )*/
@JoinColumn(name = "aircraft_id")
private Aircraft aircraft;
@Column(name = "class1_price")
private int class1Price;
@Column(name = "class2_price")
private int class2Price;
@Column(name = "class1_tickets_available")
private int class1TicketsAvailable;
@Column(name = "class2_tickets_available")
private int class2TicketsAvailable;
public Flight() {
}
public Flight(Date departureDate,
Date arrivalDate,
City departureCity,
City arrivalCity,
Aircraft aircraft,
int class1Price,
int class2Price) {
this.departureDate = departureDate;
this.arrivalDate = arrivalDate;
this.departureCity = departureCity;
this.arrivalCity = arrivalCity;
this.aircraft = aircraft;
this.class1Price = class1Price;
this.class2Price = class2Price;
}
public Date getDepartureDate() {
return departureDate;
}
public void setDepartureDate(Date departureDate) {
this.departureDate = departureDate;
}
public Date getArrivalDate() {
return arrivalDate;
}
public void setArrivalDate(Date arrivalDate) {
this.arrivalDate = arrivalDate;
}
public int getClass1Price() {
return class1Price;
}
public void setClass1Price(int class1Price) {
this.class1Price = class1Price;
}
public int getClass2Price() {
return class2Price;
}
public void setClass2Price(int class2Price) {
this.class2Price = class2Price;
}
public City getDepartureCity() {
return departureCity;
}
public void setDepartureCity(City departureCity) {
this.departureCity = departureCity;
}
public City getArrivalCity() {
return arrivalCity;
}
public void setArrivalCity(City arrivalCity) {
this.arrivalCity = arrivalCity;
}
public Aircraft getAircraft() {
return aircraft;
}
public void setAircraft(Aircraft aircraft) {
this.aircraft = aircraft;
}
public int getClass1TicketsAvailable() {
return class1TicketsAvailable;
}
public void setClass1TicketsAvailable(int class1TicketsAvailable) {
this.class1TicketsAvailable = class1TicketsAvailable;
}
public int getClass2TicketsAvailable() {
return class2TicketsAvailable;
}
public void setClass2TicketsAvailable(int class2TicketsAvailable) {
this.class2TicketsAvailable = class2TicketsAvailable;
}
@Override
public String toString() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
return "Flight{" +
"departureDate=" + dateFormat.format(departureDate) +
", arrivalDate=" + dateFormat.format(arrivalDate) +
", departureCity=" + departureCity +
", arrivalCity=" + arrivalCity +
", aircraft=" + aircraft +
", class1Price=" + class1Price +
", class2Price=" + class2Price +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Flight)) return false;
Flight flight = (Flight) o;
if (class1Price != flight.class1Price) return false;
if (class1TicketsAvailable != flight.class1TicketsAvailable) return false;
if (class2Price != flight.class2Price) return false;
if (class2TicketsAvailable != flight.class2TicketsAvailable) return false;
if (!aircraft.equals(flight.aircraft)) return false;
if (!arrivalCity.equals(flight.arrivalCity)) return false;
if (!arrivalDate.equals(flight.arrivalDate)) return false;
if (!departureCity.equals(flight.departureCity)) return false;
if (!departureDate.equals(flight.departureDate)) return false;
return true;
}
@Override
public int hashCode() {
int result = departureDate.hashCode();
result = 31 * result + arrivalDate.hashCode();
result = 31 * result + departureCity.hashCode();
result = 31 * result + arrivalCity.hashCode();
result = 31 * result + aircraft.hashCode();
result = 31 * result + class1Price;
result = 31 * result + class2Price;
result = 31 * result + class1TicketsAvailable;
result = 31 * result + class2TicketsAvailable;
return result;
}
}
| [
"ashot2005@yahoo.com"
] | ashot2005@yahoo.com |
4edf5ff2f90c12966e698dfd88d020267bc586c9 | 07c7d4f036a658f54207de0ef9626f5e7611f9d7 | /src/repository/BookRepository.java | 8dec1ef3cb7bed3ed372fddea0aaa20f5161b3ec | [] | no_license | dsovago/bookshop | c9ecf86b988d0189afff77f48ceac7372c403d90 | ecdf2dd5c86c648c9a424986b15e81b0f75032c7 | refs/heads/master | 2022-06-09T01:36:54.627566 | 2020-05-06T12:32:39 | 2020-05-06T12:32:39 | 261,411,998 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,431 | java | package repository;
import model.Book;
import model.Cart;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class BookRepository implements IBookRepository {
private List<Book> allBooks;
private static BookRepository instance;
protected BookRepository() {
allBooks = new ArrayList<>();
}
@Override
public List<Book> findAll() {
return allBooks;
}
@Override
public void save(Book book) {
book.setId(nextBookId());
allBooks.add(book);
}
@Override
public void remove(Book book) {
allBooks.remove(book);
}
@Override
public Book getBookById(int id) {
for (Book book : allBooks) {
if (book.getId() == id)
return book;
}
return null;
}
@Override
public List<Book> getBooksOfCart(Cart cart) {
List<Integer> bookIdList = cart.getBooks();
List<Book> books = new ArrayList<>();
for (int bookId : bookIdList){
books.add(getBookById(bookId));
}
return books;
}
private int nextBookId(){
int size = findAll().size();
if (size == 0)
return 1;
return findAll().get(size-1).getId() + 1;
}
public static BookRepository getInstance(){
if (instance == null)
instance = new BookRepository();
return instance;
}
}
| [
"dsovago@edu.bme.hu"
] | dsovago@edu.bme.hu |
6239345b20be97824fd09256e69dde57d0ae4d15 | c3ad5315f41734dac04e50673c00ec40958ad290 | /src/slidemenu/SampleListFragment.java | 2b7e89c8eedb2b35109833d8f4316862827ddecc | [] | no_license | olliem36/pp-android | f4c4da3fde8066fca3d0dd830f779422d14fe15c | 0ee33be2ad9848a26a9a3334ab439420061e6555 | refs/heads/master | 2016-09-06T16:47:16.080392 | 2014-10-14T15:57:42 | 2014-10-14T15:57:42 | 20,771,183 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,647 | java | package slidemenu;
import com.theteachermate.app.R;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class SampleListFragment extends ListFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.list, null);
}
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
SampleAdapter adapter = new SampleAdapter(getActivity());
for (int i = 0; i < 20; i++) {
adapter.add(new SampleItem("Sample List", android.R.drawable.ic_menu_search));
}
setListAdapter(adapter);
}
private class SampleItem {
public String tag;
public int iconRes;
public SampleItem(String tag, int iconRes) {
this.tag = tag;
this.iconRes = iconRes;
}
}
public class SampleAdapter extends ArrayAdapter<SampleItem> {
public SampleAdapter(Context context) {
super(context, 0);
}
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(R.layout.row, null);
}
ImageView icon = (ImageView) convertView.findViewById(R.id.row_icon);
icon.setImageResource(getItem(position).iconRes);
TextView title = (TextView) convertView.findViewById(R.id.row_title);
title.setText(getItem(position).tag);
return convertView;
}
}
}
| [
"olivermahoney@me.com"
] | olivermahoney@me.com |
2a806d6c123a6c38860cb5fa904575da293025e6 | fdcf4a4ca44c3dfc30125c3fd008bd3637a14060 | /Wishlist/src/com/softwaresmithy/view/CategoryDivider.java | aad2ea4b210e400679936cdf1e6a9272e4c1c1a5 | [] | no_license | praveen171987/booktracker | aa1e5f162a9ea50535f8723fe5ea660bd3e8db34 | 8c3a1e01db5770e682ae5db3892277de8ad32785 | refs/heads/master | 2016-09-06T18:09:06.649989 | 2011-11-23T04:33:05 | 2011-11-23T04:33:05 | 32,809,906 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | package com.softwaresmithy.view;
import android.R;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
/**
* I'd like to do this by making a style that extends listSeparatorTextViewStyle, but unfortunately,
* it's private :(
*
* @author matt
*/
public class CategoryDivider extends TextView {
public CategoryDivider(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
int vertPadding = (int) Math.round(2.0 * getResources().getDisplayMetrics().density);
int leftPadding = (int) Math.round(5.0 * getResources().getDisplayMetrics().density);
setPadding(leftPadding, vertPadding, vertPadding, 0);
}
public CategoryDivider(Context context, AttributeSet attrs) {
this(context, attrs, R.attr.listSeparatorTextViewStyle);
}
public CategoryDivider(Context context) {
this(context, null, R.attr.listSeparatorTextViewStyle);
}
}
| [
"levan.matthew@gmail.com@c5e6f7e9-6356-0410-84d0-c5af5997a13e"
] | levan.matthew@gmail.com@c5e6f7e9-6356-0410-84d0-c5af5997a13e |
8c05ad331d995a7d3b3bc81f5b8eb3f050857268 | bb0d5c12fce0daef6732c0af29001b8ffa29eee2 | /src/main/java/ua/com/ladyshoes/entity/IdHolder.java | 4ba601ab7189f0597810d3d880becf7fc2baf0ec | [] | no_license | VolodymyrHorodetskyy/ladyshoesshop | d7159f2e86e17b74a3688dc455220e59b17272cc | 35cecb709e08854f73eba7ad7253ac111f15202d | refs/heads/master | 2022-06-24T12:13:25.338727 | 2020-01-06T12:45:20 | 2020-01-06T12:45:20 | 212,365,906 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package ua.com.ladyshoes.entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
@MappedSuperclass
public class IdHolder {
@Id
@GeneratedValue
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
| [
"volodymyr.horodetskyi@ppb.com"
] | volodymyr.horodetskyi@ppb.com |
23d1fe6bc7572143308097771445b223522ed399 | 05a6630a841e18bed4793187396083f41c355908 | /jetcd-core/src/main/java/io/etcd/jetcd/api/StatusRequest.java | 4447853894cf9437f31dd403a0e5c40b7d542a3a | [] | no_license | ZhiYu2018/jetcd | 55240bb17d49bbdefaf2a869247284d351749ef2 | b6a25fd03653ca605a2e1cd076b011ad51378788 | refs/heads/master | 2023-07-25T21:24:27.909059 | 2019-09-11T14:43:37 | 2019-09-11T14:43:37 | 207,834,506 | 2 | 0 | null | 2023-07-05T20:42:54 | 2019-09-11T14:37:27 | Java | UTF-8 | Java | false | true | 13,502 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: rpc.proto
package io.etcd.jetcd.api;
/**
* Protobuf type {@code etcdserverpb.StatusRequest}
*/
public final class StatusRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:etcdserverpb.StatusRequest)
StatusRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use StatusRequest.newBuilder() to construct.
private StatusRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private StatusRequest() {
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private StatusRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.etcd.jetcd.api.JetcdProto.internal_static_etcdserverpb_StatusRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.etcd.jetcd.api.JetcdProto.internal_static_etcdserverpb_StatusRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.etcd.jetcd.api.StatusRequest.class, io.etcd.jetcd.api.StatusRequest.Builder.class);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.etcd.jetcd.api.StatusRequest)) {
return super.equals(obj);
}
io.etcd.jetcd.api.StatusRequest other = (io.etcd.jetcd.api.StatusRequest) obj;
boolean result = true;
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.etcd.jetcd.api.StatusRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.etcd.jetcd.api.StatusRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.etcd.jetcd.api.StatusRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.etcd.jetcd.api.StatusRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.etcd.jetcd.api.StatusRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.etcd.jetcd.api.StatusRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.etcd.jetcd.api.StatusRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.etcd.jetcd.api.StatusRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.etcd.jetcd.api.StatusRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.etcd.jetcd.api.StatusRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.etcd.jetcd.api.StatusRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.etcd.jetcd.api.StatusRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.etcd.jetcd.api.StatusRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code etcdserverpb.StatusRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:etcdserverpb.StatusRequest)
io.etcd.jetcd.api.StatusRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.etcd.jetcd.api.JetcdProto.internal_static_etcdserverpb_StatusRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.etcd.jetcd.api.JetcdProto.internal_static_etcdserverpb_StatusRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.etcd.jetcd.api.StatusRequest.class, io.etcd.jetcd.api.StatusRequest.Builder.class);
}
// Construct using io.etcd.jetcd.api.StatusRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.etcd.jetcd.api.JetcdProto.internal_static_etcdserverpb_StatusRequest_descriptor;
}
public io.etcd.jetcd.api.StatusRequest getDefaultInstanceForType() {
return io.etcd.jetcd.api.StatusRequest.getDefaultInstance();
}
public io.etcd.jetcd.api.StatusRequest build() {
io.etcd.jetcd.api.StatusRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.etcd.jetcd.api.StatusRequest buildPartial() {
io.etcd.jetcd.api.StatusRequest result = new io.etcd.jetcd.api.StatusRequest(this);
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.etcd.jetcd.api.StatusRequest) {
return mergeFrom((io.etcd.jetcd.api.StatusRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.etcd.jetcd.api.StatusRequest other) {
if (other == io.etcd.jetcd.api.StatusRequest.getDefaultInstance()) return this;
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.etcd.jetcd.api.StatusRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.etcd.jetcd.api.StatusRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:etcdserverpb.StatusRequest)
}
// @@protoc_insertion_point(class_scope:etcdserverpb.StatusRequest)
private static final io.etcd.jetcd.api.StatusRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.etcd.jetcd.api.StatusRequest();
}
public static io.etcd.jetcd.api.StatusRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<StatusRequest>
PARSER = new com.google.protobuf.AbstractParser<StatusRequest>() {
public StatusRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new StatusRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<StatusRequest> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<StatusRequest> getParserForType() {
return PARSER;
}
public io.etcd.jetcd.api.StatusRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| [
"forbelief@126.com"
] | forbelief@126.com |
b761dda7f765e922778f646d31f7eec277dce6b3 | f6899a2cf1c10a724632bbb2ccffb7283c77a5ff | /glassfish-3.0/appclient/client/acc/src/main/java/org/glassfish/appclient/client/acc/ACCClassLoader.java | 69bb919f3f57b8eefea8c386dda6d45f71a9ce48 | [] | no_license | Appdynamics/OSS | a8903058e29f4783e34119a4d87639f508a63692 | 1e112f8854a25b3ecf337cad6eccf7c85e732525 | refs/heads/master | 2023-07-22T03:34:54.770481 | 2021-10-28T07:01:57 | 2021-10-28T07:01:57 | 19,390,624 | 2 | 13 | null | 2023-07-08T02:26:33 | 2014-05-02T22:42:20 | null | UTF-8 | Java | false | false | 9,626 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can obtain
* a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
* or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
* Sun designates this particular file as subject to the "Classpath" exception
* as provided by Sun in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the License
* Header, with the fields enclosed by brackets [] replaced by your own
* identifying information: "Portions Copyrighted [year]
* [name of copyright owner]"
*
* Contributor(s):
*
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package org.glassfish.appclient.client.acc;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.IllegalClassFormatException;
import java.lang.reflect.Field;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.security.ProtectionDomain;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author tjquinn
*/
public class ACCClassLoader extends URLClassLoader {
private static final String AGENT_LOADER_CLASS_NAME =
"org.glassfish.appclient.client.acc.agent.ACCAgentClassLoader";
private static ACCClassLoader instance = null;
private ACCClassLoader shadow = null;
private boolean shouldTransform = false;
private final List<ClassFileTransformer> transformers =
Collections.synchronizedList(
new ArrayList<ClassFileTransformer>());
public static ACCClassLoader newInstance(ClassLoader parent,
final boolean shouldTransform) {
if (instance != null) {
throw new IllegalStateException("already set");
}
final ClassLoader currentCL = Thread.currentThread().getContextClassLoader();
ClassLoader parentForACCCL = currentCL;
final boolean currentCLWasAgentCL = currentCL.getClass().getName().equals(
AGENT_LOADER_CLASS_NAME);
if (currentCLWasAgentCL) {
parentForACCCL = currentCL.getParent();
}
instance = new ACCClassLoader(userClassPath(), parentForACCCL, shouldTransform);
if (currentCLWasAgentCL) {
try {
adjustACCAgentClassLoaderParent(instance);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
return instance;
}
public static ACCClassLoader instance() {
return instance;
}
private static void adjustACCAgentClassLoaderParent(final ACCClassLoader instance)
throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
final ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
if (systemClassLoader.getClass().getName().equals(AGENT_LOADER_CLASS_NAME)) {
final Field jwsLoaderParentField = ClassLoader.class.getDeclaredField("parent");
jwsLoaderParentField.setAccessible(true);
jwsLoaderParentField.set(systemClassLoader, instance);
System.setProperty("org.glassfish.appclient.acc.agentLoaderDone", "true");
}
}
private static URL[] userClassPath() {
final URI GFSystemURI = GFSystemURI();
final List<URL> result = classPathToURLs(System.getProperty("java.class.path"));
for (ListIterator<URL> it = result.listIterator(); it.hasNext();) {
final URL url = it.next();
try {
if (url.toURI().equals(GFSystemURI)) {
it.remove();
}
} catch (URISyntaxException ex) {
throw new RuntimeException(ex);
}
}
result.addAll(classPathToURLs(System.getenv("APPCPATH")));
return result.toArray(new URL[result.size()]);
}
private static URI GFSystemURI() {
try {
Class agentClass = Class.forName("org.glassfish.appclient.client.acc.agent.AppClientContainerAgent");
return agentClass.getProtectionDomain().getCodeSource().getLocation().toURI().normalize();
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
private static List<URL> classPathToURLs(final String classPath) {
if (classPath == null) {
return Collections.EMPTY_LIST;
}
final List<URL> result = new ArrayList<URL>();
try {
for (String classPathElement : classPath.split(File.pathSeparator)) {
result.add(new File(classPathElement).toURI().normalize().toURL());
}
return result;
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
public ACCClassLoader(ClassLoader parent, final boolean shouldTransform) {
super(new URL[0], parent);
this.shouldTransform = shouldTransform;
}
//
// public ACCClassLoader(URL[] urls) {
// super(urls);
// }
public ACCClassLoader(URL[] urls, ClassLoader parent) {
super(urls, parent);
}
// public ACCClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory) {
// super(urls, parent, factory);
// }
private ACCClassLoader(URL[] urls, ClassLoader parent, boolean shouldTransform) {
this(urls, parent);
this.shouldTransform = shouldTransform;
}
public synchronized void appendURL(final URL url) {
addURL(url);
if (shadow != null) {
shadow.addURL(url);
}
}
public void addTransformer(final ClassFileTransformer xf) {
transformers.add(xf);
}
public void setShouldTransform(final boolean shouldTransform) {
this.shouldTransform = shouldTransform;
}
synchronized ACCClassLoader shadow() {
if (shadow == null) {
shadow = new ACCClassLoader( getURLs(), getParent());
}
return shadow;
}
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
if ( ! shouldTransform) {
return super.findClass(name);
}
final ACCClassLoader s = shadow();
final Class<?> c = s.findClassUnshadowed(name);
return copyClass(c);
}
private Class<?> copyClass(final Class c) throws ClassNotFoundException {
final String name = c.getName();
final ProtectionDomain pd = c.getProtectionDomain();
byte[] bytecode = readByteCode(name);
for (ClassFileTransformer xf : transformers) {
try {
bytecode = xf.transform(this, name, null, pd, bytecode);
} catch (IllegalClassFormatException ex) {
throw new ClassNotFoundException(name, ex);
}
}
return defineClass(name, bytecode, 0, bytecode.length, pd);
}
private Class<?> findClassUnshadowed(String name) throws ClassNotFoundException {
return super.findClass(name);
}
private byte[] readByteCode(final String className) throws ClassNotFoundException {
final String resourceName = className.replace('.', '/') + ".class";
InputStream is = getResourceAsStream(resourceName);
if (is == null) {
throw new ClassNotFoundException(className);
}
try {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final byte[] buffer = new byte[8196];
int bytesRead;
while ( (bytesRead = is.read(buffer)) != -1) {
baos.write(buffer, 0, bytesRead);
}
return baos.toByteArray();
} catch (IOException e) {
throw new ClassNotFoundException(className, e);
} finally {
try {
is.close();
} catch (IOException e) {
throw new ClassNotFoundException(className, e);
}
}
}
}
| [
"ddimalanta@appdynamics.com"
] | ddimalanta@appdynamics.com |
38679fadd760e6229d8db97b027dbd6cfa064c24 | 5296fbb0f71d671519119ca557d5250409abf834 | /src/main/java/com/timedtester/lib/utils/CollectionData.java | 567f7a52fdf1bf879eb66972b2cac423b7aad0c3 | [] | no_license | garbouz-victor/TimedTester | bc051c858cae9bc1f4c4ea220856046629b92c39 | da57f3f82ccf5e4c64ac9371e1b972aeafc0b7d1 | refs/heads/master | 2021-01-20T00:02:39.657515 | 2017-04-25T05:15:21 | 2017-04-25T05:15:21 | 89,071,132 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package com.timedtester.lib.utils;
import java.util.ArrayList;
/**
*
* @author Victor
*/
public class CollectionData<T> extends ArrayList<T> {
public CollectionData(Generator<T> gen, int quantity) {
for (int i = 0; i < quantity; i++) {
add(gen.next());
}
}
public static <T> CollectionData<T> list(Generator<T> gen, int quantity) {
return new CollectionData<>(gen, quantity);
}
}
| [
"garbouz.victor@gmail.com"
] | garbouz.victor@gmail.com |
c29d0c22b3ddb1f130008adba87ef1d1870053df | 20aa3290787d76e095f1145aec52b5fd7a27f657 | /src/game/characters/Pupil.java | 029d160bc02875262652c1b121dc706afc826d1a | [] | no_license | DenisSam23/homeTask_17.12 | 3b198ef2b612d09ea4e712d8360c3654b7c35ee1 | 2f18a9a3668a9b88c9caebe16c7849aabf2e58c0 | refs/heads/master | 2020-11-24T14:13:36.467375 | 2019-12-15T13:22:19 | 2019-12-15T13:22:19 | 228,187,217 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | package game.characters;
public class Pupil {
private int rate;
private int selfRating;
private int mood;
private int hunger;
public int getRate() {
return rate;
}
public void setRate(int rate) {
this.rate = rate;
}
public int getSelfRating() {
return selfRating;
}
public void setSelfRating(int selfRating) {
this.selfRating = selfRating;
}
public int getMood() {
return mood;
}
public void setMood(int mood) {
this.mood = mood;
}
public int getHunger() {
return hunger;
}
public void setHunger(int hunger) {
this.hunger = hunger;
}
public void toEat(int points){
hunger += points;
mood +=1;
}
}
| [
"denissam2004@gmail.com"
] | denissam2004@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.