blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9adde96864e8884c5a1dc502f0ebc7a4154c05eb
|
76cb82d4e308382d72a326c234731b90b9780ea8
|
/src/statistics/Project.java
|
bd1a97028dbf0de35f06dc8ad4004735c597f6b4
|
[] |
no_license
|
prga/conflictsAnalyzer
|
b601abbe7643161ca08b0434866154d8ab9e554c
|
a7701a633a088d99bc6dd828e4ffdb1ab1d3c3ce
|
refs/heads/master
| 2021-07-24T21:39:15.157922 | 2021-07-13T21:00:33 | 2021-07-13T21:00:33 | 22,661,424 | 0 | 6 | null | 2016-03-31T13:18:29 | 2014-08-05T22:20:40 |
Groovy
|
UTF-8
|
Java
| false | false | 8,610 |
java
|
package statistics;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
public class Project {
private String name;
private String repo;
private String resultData;
private ArrayList<MergeCommit> analyzedMergeCommits;
private String downloadPath;
private HashMap<String, int[]> authorsSummary;
private HashMap<String, Integer> mergesSummary;
public Project(String repo, String resultData, String downloadPath){
String[] temp = repo.split("/");
this.repo = temp[0];
this.name = temp[1];
this.resultData = resultData;
this.analyzedMergeCommits = new ArrayList<>();
this.downloadPath = downloadPath;
this.initializeAuthorSummary();
this.initializeMergesSummary();
}
public void initializeAuthorSummary(){
this.authorsSummary = new HashMap<String, int[]>();
for(NumDevCategories c : NumDevCategories.values()){
String cat = c.toString();
int[] numbers = new int[4];
this.authorsSummary.put(cat, numbers);
}
}
public void initializeMergesSummary(){
this.mergesSummary = new HashMap<String, Integer>();
for(NumDevCategories c : NumDevCategories.values()){
String cat = c.toString();
this.mergesSummary.put(cat + "_with_Conflict", 0);
this.mergesSummary.put(cat + "_without_Conflict", 0);
}
}
public void updateAuthorSummary(MergeCommit mc){
String category = mc.getNumDevCategory();
int[] mcSummary = mc.getConfSummary();
int[] values = this.authorsSummary.get(category);
for(int i = 0; i < 4; i++){
values[i] = values[i] + mcSummary[i];
}
this.authorsSummary.put(category, values);
}
public void updateMergesSummary(MergeCommit mc){
String category = mc.getNumDevCategory();
if(mc.getHasConflictsJava() ||mc.getHasConflictsNonJava()){
category = category + "_with_Conflict";
}else{
category = category + "_without_Conflict";
}
int value = this.mergesSummary.get(category);
value++;
this.mergesSummary.put(category, value);
}
public String toString(){
String result = this.name;
for(NumDevCategories c : NumDevCategories.values()){
String cat = c.toString();
int[] values = this.authorsSummary.get(cat);
for(int i = 0; i < values.length; i++){
result = result + ";" + values[i];
}
}
return result;
}
public String mergesSummary(){
String result = this.name;
for(NumDevCategories c : NumDevCategories.values()){
String cat = c.toString();
int value = this.mergesSummary.get(cat + "_with_Conflict");
int value2 = this.mergesSummary.get(cat + "_without_Conflict");
result = result + ";" + value + ";" + value2;
}
return result;
}
public void analyzeMergeCommits(){
System.out.println("Loading merge commit data");
HashMap<String, Integer> mcNonJava = this.loadMCNonJava();
HashMap<String, ArrayList<MergeCommit>> mc = this.loadMCFile(mcNonJava);
this.computeMCSummary(mc);
System.out.println("Merge commit data loaded");
if(!cloneExists()){
System.out.println("Cloning project " + this.name);
this.cloneProject();
System.out.println("Project cloned successfully");
}
System.out.println("Starting to get the number of developers");
this.getNumberOfDevs();
System.out.println("Finished to analyze the number of developers");
}
public void getNumberOfDevs(){
int current = 1;
int total = this.analyzedMergeCommits.size();
for(MergeCommit mc : this.analyzedMergeCommits){
System.out.println("Analyzing merge " + mc.getName() + " ["
+ current + "] from [" + total + "]");
String clone = this.downloadPath + File.separator + this.name;
mc.analyzeNumberOfDevelopers(clone);
DevNumberPrinter.printMergeCommitReport(this.name, mc.toString());
this.updateAuthorSummary(mc);
this.updateMergesSummary(mc);
current++;
}
}
public boolean cloneExists(){
boolean cloneExists = false;
File file = new File(this.downloadPath + File.separator + this.name);
if(file.exists()){
cloneExists = true;
}
return cloneExists;
}
public void cloneProject(){
String cmd = "git clone https://github.com/" + this.repo + File.separator + this.name + ".git";
Process p;
try {
p = Runtime.getRuntime().exec(cmd, null, new File(this.downloadPath));
int result = p.waitFor();
System.out.println("Process result = " + result);
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public HashMap<String, ArrayList<MergeCommit>> loadMCFile(HashMap<String, Integer> mcNonJava){
HashMap<String, ArrayList<MergeCommit>> result = new HashMap<String, ArrayList<MergeCommit>>();
File merges = new File(this.resultData + File.separator + this.name +
File.separator + "mergeCommits.csv");
BufferedReader br = null;
String line = "";
try {
br = new BufferedReader(new FileReader(merges));
while ((line = br.readLine()) != null) {
if(!line.startsWith("Merge")){
String [] data = line.split(",");
String sha = data[0];
String parent1 = data[1];
String parent2 = data[2];
MergeCommit mc = new MergeCommit(sha, parent1, parent2);
String rev_name = mc.getName();
if(mcNonJava.containsKey(rev_name)){
mc.setHasConflictsNonJava(true);
}
ArrayList<MergeCommit> mcs = null;
if(result.containsKey(rev_name)){
mcs = result.get(rev_name);
}else{
mcs = new ArrayList<MergeCommit>();
}
mcs.add(mc);
result.put(rev_name, mcs);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
public HashMap<String, Integer> loadMCNonJava(){
HashMap<String, Integer> conflictingMC = new HashMap<String, Integer>();
File report = new File(this.resultData + File.separator + this.name +
File.separator + "mergeWithNonJavaFilesConflicting.csv");
BufferedReader br = null;
String line = "";
try {
br = new BufferedReader(new FileReader(report));
while ((line = br.readLine()) != null) {
if(!line.equals("")){
conflictingMC.put(line, 0);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return conflictingMC;
}
public void computeMCSummary(HashMap<String, ArrayList<MergeCommit>> mcList){
File report = new File(this.resultData + File.separator + this.name +
File.separator + "MergeScenariosReport.csv");
BufferedReader br = null;
String line = "";
try {
br = new BufferedReader(new FileReader(report));
while ((line = br.readLine()) != null) {
if(!line.startsWith("Merge_scenario")){
String [] data = line.split(",");
String name = data[0];
ArrayList<MergeCommit> mcs = mcList.get(name);
if(mcs!=null){
MergeCommit mc = mcs.get(0);
mc.computeConfSummary(data);
if(!data[6].equals(" 0")){
mc.setHasConflictsJava(true);
}
this.analyzedMergeCommits.add(mc);
mcs.remove(0);
}
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRepo() {
return repo;
}
public void setRepo(String repo) {
this.repo = repo;
}
public ArrayList<MergeCommit> getAnalyzedMergeCommits() {
return analyzedMergeCommits;
}
public void setAnalyzedMergeCommits(ArrayList<MergeCommit> conflictingMergeCommits) {
this.analyzedMergeCommits = conflictingMergeCommits;
}
public String getResultData() {
return resultData;
}
public void setResultData(String resultData) {
this.resultData = resultData;
}
public String getDownloadPath() {
return downloadPath;
}
public void setDownloadPath(String downloadPath) {
this.downloadPath = downloadPath;
}
public HashMap<String, int[]> getAuthorsSummary() {
return authorsSummary;
}
public void setAuthorsSummary(HashMap<String, int[]> authorsSummary) {
this.authorsSummary = authorsSummary;
}
public HashMap<String, Integer> getMergesSummary() {
return mergesSummary;
}
public void setMergesSummary(HashMap<String, Integer> mergesSummary) {
this.mergesSummary = mergesSummary;
}
public static void main(String[] args) {
Project p = new Project("AndlyticsProject/andlytics",
"/Users/paolaaccioly/Dropbox/workspace_emse/ResultData", "downloads2");
p.analyzeMergeCommits();
System.out.println(p);
}
}
|
[
"[email protected]"
] | |
455d4d3f514e5e45e406a2ad701d7368d70e7cd2
|
5622bd18f6a2a028846ac93588184aaa8cb82b41
|
/java5.java
|
c7ab7d3e76bd223c1f2c5f09a4fb54aea493603b
|
[] |
no_license
|
S1MPLE001/core-java
|
224655ea746a80b4975b8873b179351bc6fa4016
|
e46b0e7f0f48894b88fe090ef20a7d7b6b66674a
|
refs/heads/master
| 2020-03-14T10:30:00.852208 | 2018-04-30T11:20:03 | 2018-04-30T11:20:03 | 131,568,458 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 17,901 |
java
|
/* COLOR TO THE FRAME */
/*package javaapplication7;
import java.awt.*;
public class appwin extends Frame {
appwin(String title)
{
super(title);
}
public void paint(Graphics g)
{
setForeground(Color.red);
setBackground(Color.cyan);
Color c1=new Color(202,146,20);
Color c2=new Color(202,146,20);
Color c3=new Color(202,146,20);
g.setColor(c1);
g.drawLine(7, 64, 78, 100);
g.setColor(c2);
g.drawLine(50, 32, 300, 78);
g.setColor(c3);
g.drawLine(100, 78, 50, 40);
g.setColor(Color.yellow);
g.drawLine(200, 92, 100, 100);
g.setColor(Color.red);
g.drawOval(50, 60, 50, 60);
g.fillOval(42,83, 44,88);
g.drawString("DOMINGO",20,40);
}
public static void main(String v[])
throws Exception
{
appwin a=new appwin("FRAME WINDOW");
a.setSize(new Dimension(700,600));
a.setVisible(true);
//Thread.sleep(5000);
//a.setTitle("AN -AT BASED ");
//appwin a=new appwin("FRAME WINDOW");
Thread.sleep(100000);
a.setVisible(false);
System.exit(0);
}
}
*/
FONTS IN JAVA
/*
package javaapplication7;
import java.awt.*;
public class appwin extends Frame {
appwin(String title)
{
super(title);
}
public void paint(Graphics g)
{
setForeground(Color.red);
setBackground(Color.cyan);
Font c1=new Font("ZINDABAAD",Font.BOLD,50);
Font c2=new Font("DOMINGO",Font.ITALIC,25);
Font c3=new Font("VICRANT",Font.ITALIC+Font.BOLD,25);
g.setFont(c1);
// g.drawLine(7, 64, 78, 100);
for(int i=20;i<=400;i+=80)
{
g.drawString("DOMINGO",i,200);
}
g.setFont(c2);
g.drawString("vicrant",20,60);
// g.drawLine(50, 32, 300, 78);
g.setFont(c3);
// g.drawLine(100, 78, 50, 40);
g.drawString("S1mple",20,80);
}
public static void main(String v[])
//throws Exception
{
appwin a=new appwin("FRAME WINDOW");
a.setSize(new Dimension(700,600));
a.setVisible(true);
//Thread.sleep(5000);
//a.setTitle("AN -AT BASED ");
//appwin a=new appwin("FRAME WINDOW");
Thread.sleep(4000);
a.setVisible(false);
System.exit(0);
}
}
*/
/* FRAME AND APPLET */
/*
<applet code="AppletFrame" width=300 height=150 >
</applet>
*/
/*
import java.applet.Applet;
import java.awt.*;
class SampleFrame extends Frame {
SampleFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.drawString("THIS IS THE WINDOW",10,40);
}
}
public class appfr extends Applet
{
Frame f;
public void init() {
f=new SampleFrame("THIS IS MY FIRST ");
f.setSize(250,250);
f.setVisible(true);
}
public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void paint(Graphics g)
{g.drawString("this is the win",10,20);
}
*/
/*
/*
<applet code="AppletFrame" width=300 height=150 >
</applet>
*/
import java.applet.Applet;
import java.awt.*;
/*class SampleFrame extends Frame {
SampleFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.drawString("THIS IS THE WINDOW",10,40);
}
}
*/
/* LABELS ---------------------------------->
public class appfr extends Applet
{
//Frame f;
public void init() {
Color c =new Color(100,100,255);
setBackground(c);
Label one =new Label("ONE");
Label two =new Label("TWO");
Label three=new Label("THREE");
add(one);
add(two);
add(three);
}
}
/*public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void paint(Graphics g)
{g.drawString("this is the win",10,20);
}
}
*/
/*
CHECK BOX IN --------->>>JAVA
/*
<applet code="AppletFrame" width=300 height=150 >
</applet>
*/
import java.applet.Applet;
import java.awt.*;
/*class SampleFrame extends Frame {
SampleFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.drawString("THIS IS THE WINDOW",10,40);
}
}
*/
/*public class appfr extends Applet
{
//Frame f;
CheckboxGroup gp;
public void init() {
Checkbox a,b,c;
Color d =new Color(100,100,255);
setBackground(d);
a=new Checkbox("A",gp,true);
b=new Checkbox("B",gp,false);
c=new Checkbox("C",gp,false);
add(a);
add(b);
add(c);
}
public void paint(Graphics g)
{
String s;
s="domingo";
g.drawString(s, 20,100);
}
}
/*public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void paint(Graphics g)
{g.drawString("this is the win",10,20);
}
}
*/
/*
public class appfr extends Applet
{
//Frame f;
Choice a,b;
public void init() {
//Checkbox a,b,c;
Color d =new Color(100,100,255);
setBackground(d);
a=new Choice();
b=new Choice();
a.add("nor");
a.add("sou");
b.add("dom");
b.add("com");
add(a);
add(b);
}
*/
/* LIST----------------------->>>>>>>>>>>>>>>>>>>>>
/*
<applet code="AppletFrame" width=300 height=150 >
</applet>
*/
/*import java.applet.Applet;
import java.awt.*;
/*class SampleFrame extends Frame {
SampleFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.drawString("THIS IS THE WINDOW",10,40);
}
}
*/
/*public class appfr extends Applet
{
//Frame f;
List a,b;
public void init() {
//Checkbox a,b,c;
Color d =new Color(100,100,255);
setBackground(d);
a=new List(4,true);
b=new List(4,false);
a.add("nor");
a.add("sou");
b.add("dom");
b.add("com");
add(a);
add(b);
}
public void paint(Graphics g)
{
String s;
Font c1=new Font("ZINDABAAD",Font.BOLD,50);
g.setFont(c1);
g.setColor(Color.yellow);
s="domingo";
g.drawString(s, 20,100);
}
}
/*public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void paint(Graphics g)
{g.drawString("this is the win",10,20);
}
}
*/
/*
<applet code="AppletFrame" width=300 height=150 >
</applet>
*/
import java.applet.Applet;
import java.awt.*;
/*class SampleFrame extends Frame {
SampleFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.drawString("THIS IS THE WINDOW",10,40);
}
}
*/
public class appfr extends Applet
{
//Frame f;
TextField a,b;
public void init() {
//Checkbox a,b,c;
Color d =new Color(100,100,255);
setBackground(d);
Label ab=new Label("NAME: ",Label.RIGHT);
Label bb=new Label("NAME: ",Label.RIGHT);
a=new TextField(12);
b=new TextField(8);
add(a);
add(b);
add(ab);
add(bb);
}
public void paint(Graphics g)
{
String s;
Font c1=new Font("ZINDABAAD",Font.BOLD,50);
g.setFont(c1);
g.setColor(Color.yellow);
s="domingo";
g.drawString(s, 20,100);
}
}
/*
/*public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void paint(Graphics g)
{g.drawString("this is the win",10,20);
}
}
*/
/* ................................BUTTON---------------------------------------------*/
/*
<applet code="AppletFrame" width=300 height=150 >
</applet>
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*class SampleFrame extends Frame {
SampleFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.drawString("THIS IS THE WINDOW",10,40);
}
}
*/
public class appfr extends Applet implements ActionListener
{
//Frame f;
// TextField a,b;
Button yes,no,maybe;
String s;
public void init() {
//Checkbox a,b,c;
/* Label ab=new Label("NAME: ",Label.RIGHT);
Label bb=new Label("NAME: ",Label.RIGHT);
*/
yes=new Button("yes");
no=new Button("no");
maybe=new Button("maybe");
add(yes);
add(no);
add(maybe);
yes.addActionListener(this);
no.addActionListener(this);
maybe.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String str=ae.getActionCommand();
if(str.equals("yes"))
s="YOU PASSED YES";
else if(str.equals("no"))
s="YOU PASSED NO";
else
s="KUCH BII";
repaint();
}
public void paint(Graphics g)
{
Color d =new Color(100,100,255);
setBackground(d);
Font c1=new Font("",Font.BOLD,30);
g.setFont(c1);
g.setColor(Color.yellow);
//s="domingo";
//g.drawString(s, 20,100);
//showStatus(s);
}
}
/*public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void paint(Graphics g)
{g.drawString("this is the win",10,20);
}
}
*/
/*-------------------------------------------------------------------------------------------------------------------*/
/*
<applet code="AppletFrame" width=300 height=150 >
</applet>
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*; //for interface ....this is requried
import java.applet.*;
/*class SampleFrame extends Frame {
SampleFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.drawString("THIS IS THE WINDOW",10,40);
}
}
*/
public class appfr extends Applet implements ItemListener
{
//Frame f;
// TextField a,b;
Checkbox a,b,c;
String s;
public void init() {
//Checkbox a,b,c;
/* Label ab=new Label("NAME: ",Label.RIGHT);
Label bb=new Label("NAME: ",Label.RIGHT);
*/
a=new Checkbox("A",null,true);
b=new Checkbox("B");
c=new Checkbox("C");
add(a);
add(b);
add(c);
a.addItemListener(this);
b.addItemListener(this);
c.addItemListener(this);
}
public void itemStateChanged(ItemEvent ie)
{
repaint();
}
public void paint(Graphics g)
{
Color d =new Color(100,100,255);
setBackground(d);
Font c1=new Font("",Font.BOLD,15);
g.setFont(c1);
g.setColor(Color.red);
s="currentState";
g.drawString(s, 20,60);
s="A STATUS: "+a.getState();
g.setColor(Color.yellow);
g.drawString(s, 20,80);
s="B STATUS: "+b.getState();
g.drawString(s, 20,100);
s="C STATUS: "+c.getState();
g.drawString(s, 20,120);
//showStatus(s);
}
}
/*public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void paint(Graphics g)
{g.drawString("this is the win",10,20);
}
}
*/
*/
/*****************************************************
ADDITION
/*
<applet code="AppletFrame" width=300 height=150 >
</applet>
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*; //for interface ....this is requried
import java.applet.*;
/*class SampleFrame extends Frame {
SampleFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.drawString("THIS IS THE WINDOW",10,40);
}
}
*/
public class appfr extends Applet implements ItemListener
{
//Frame f;
// TextField a,b;
Checkbox a,b,c,d;
CheckboxGroup cb,cbg;
String s;
public void init() {
//Checkbox a,b,c;
/* Label ab=new Label("NAME: ",Label.RIGHT);
Label bb=new Label("NAME: ",Label.RIGHT);
*/
cbg=new CheckboxGroup();
cb=new CheckboxGroup();
a=new Checkbox("1",cbg,true);
b=new Checkbox("2",cbg,false);
c=new Checkbox("3",cb,true);
d=new Checkbox("4",cb,false);
add(a);
add(b);
add(c);
add(d);
a.addItemListener(this);
b.addItemListener(this);
c.addItemListener(this);
d.addItemListener(this);
}
public void itemStateChanged(ItemEvent ie)
{
repaint();
}
public void paint(Graphics g)
{
Color d =new Color(100,100,255);
setBackground(d);
Font c1=new Font("",Font.BOLD,25);
Font c2=new Font("",Font.BOLD,15);
g.setFont(c1);
g.setColor(Color.red);
s="currentState";
//s+=cbg.getSelectedCheckbox().getLabel()+cb.getSelectedCheckbox().getLabel();
g.drawString(s,20, 100);
int p=Integer.parseInt(cbg.getSelectedCheckbox().getLabel())+Integer.parseInt(cb.getSelectedCheckbox().getLabel());
g.drawString(p+"",20, 120);
}
}
/*public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void paint(Graphics g)
{g.drawString("this is the win",10,20);
}
}
*/
/*
/*
<applet code="AppletFrame" width=300 height=150 >
</applet>
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*; //for interface ....this is requried
import java.applet.*;
/*class SampleFrame extends Frame {
SampleFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.drawString("THIS IS THE WINDOW",10,40);
}
}
*/
public class appfr extends Applet implements ActionListener
{
//Frame f;
TextField a,b;
// Checkbox a,b,c,d;
//CheckboxGroup cb,cbg;
String s;
public void init() {
//Checkbox a,b,c;
Label ab=new Label("NAME: ",Label.RIGHT);
Label bb=new Label("PASSWORD: ",Label.RIGHT);
a=new TextField(12);
b=new TextField(8);
b.setEchoChar('.');
add(ab);
add(a);
add(bb);
add(b);
b.addActionListener(this);
a.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
repaint();
}
public void paint(Graphics g)
{
Color d =new Color(100,100,255);
setBackground(d);
Font c1=new Font("",Font.BOLD,25);
Font c2=new Font("",Font.BOLD,15);
g.setFont(c1);
g.setColor(Color.red);
//s="value :";
//s+=cbg.getSelectedCheckbox().getLabel()+cb.getSelectedCheckbox().getLabel();
//g.drawString(s,10, 100);
// int p=Integer.parseInt(cbg.getSelectedCheckbox().getLabel())+Integer.parseInt(cb.getSelectedCheckbox().getLabel());
g.drawString("name :"+a.getText(),20,100);
g.drawString("password :"+b.getText(),20,120);
}
}
/*public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void paint(Graphics g)
{g.drawString("this is the win",10,20);
}
}
*/
/*----------------------------------------------------------------------------------------------------------------------------
/*
/* CALUCLATOR ------------------------------>>>>>>>>>>>>>>>>>>>>>WITH USING GRAPHICS
<applet code="AppletFrame" width=300 height=150 >
</applet>
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*; //for interface ....this is requried
import java.applet.*;
/*class SampleFrame extends Frame {
SampleFrame(String title)
{
super(title);
}
public void paint(Graphics g)
{
g.drawString("THIS IS THE WINDOW",10,40);
}
}
*/
public class appfr extends Applet implements ActionListener
{
//Frame f;
TextField a,b;
Button add,sub,mul,div;
// Checkbox a,b,c,d;
//CheckboxGroup cb,cbg;
String s1="";
public void init() {
//Checkbox a,b,c;
Label ab=new Label("NAME: ",Label.RIGHT);
Label bb=new Label("PASSWORD: ",Label.RIGHT);
a=new TextField(12);
b=new TextField(8);
add= new Button("+");
sub= new Button("-");
mul=new Button("*");
//b.setEchoChar('.');
add(ab);
add(a);
add(bb);
add(b);
add(add);add(sub);add(mul);
add.addActionListener(this);
sub.addActionListener(this);
mul.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String s=ae.getActionCommand();
int p;
if(s.equals("+"))
{
p=Integer.parseInt(a.getText())+Integer.parseInt(b.getText());
s1=p+"";
}
if(s.equals("-"))
{
p=Integer.parseInt(a.getText())-Integer.parseInt(b.getText());
s1=p+"";
}
if(s.equals("*"))
{
p=Integer.parseInt(a.getText())*(Integer.parseInt(b.getText()));
s1=p+"";
}
repaint();
}
public void paint(Graphics g)
{
Color d =new Color(100,100,255);
setBackground(d);
Font c1=new Font("",Font.BOLD,25);
Font c2=new Font("",Font.BOLD,15);
g.setFont(c1);
g.setColor(Color.red);
//s="value :";
//s+=cbg.getSelectedCheckbox().getLabel()+cb.getSelectedCheckbox().getLabel();
//g.drawString(s,10, 100);
// int p=Integer.parseInt(cbg.getSelectedCheckbox().getLabel())+Integer.parseInt(cb.getSelectedCheckbox().getLabel());
g.drawString("RESULT : "+s1,20,100);
//g.drawString("password :"+b.getText(),20,120);
}
}
/*public void start()
{
f.setVisible(true);
}
public void stop()
{
f.setVisible(false);
}
public void paint(Graphics g)
{g.drawString("this is the win",10,20);
}
}
*/
|
[
"[email protected]"
] | |
4c4f8380778840e8d9b8ce9613eb8f63c44273ac
|
d8820cbe4cc71e2abd31743f60df111d90d09ed3
|
/telegram-core/src/main/java/org/telegram/api/functions/upload/TLRequestUploadSaveBigFilePart.java
|
6cb7b6ee0e94cecfdc28446586626e357234cc11
|
[] |
no_license
|
DmytroKanivets/TelegramSearch
|
b15a939b8eb36cfd24f8db5eca2c7850b4e51b6c
|
ad9b367ee23443be14afd46eeb8606ed28483617
|
refs/heads/master
| 2021-05-07T00:35:05.315291 | 2018-06-17T19:17:00 | 2018-06-17T19:17:00 | 110,167,656 | 0 | 0 | null | 2018-05-03T19:36:15 | 2017-11-09T21:22:08 |
Java
|
UTF-8
|
Java
| false | false | 3,153 |
java
|
package org.telegram.api.functions.upload;
import org.telegram.tl.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* The type TL request upload save big file part.
*/
public class TLRequestUploadSaveBigFilePart extends TLMethod<TLBool> {
/**
* The constant CLASS_ID.
*/
public static final int CLASS_ID = 0xde7b673d;
private long fileId;
private int filePart;
private int fileTotalParts;
private TLBytes bytes;
/**
* Instantiates a new TL request upload save big file part.
*/
public TLRequestUploadSaveBigFilePart() {
super();
}
public int getClassId() {
return CLASS_ID;
}
public TLBool deserializeResponse(InputStream stream, TLContext context)
throws IOException {
TLObject res = StreamingUtils.readTLObject(stream, context);
if (res == null)
throw new IOException("Unable to parse response");
if ((res instanceof TLBool))
return (TLBool) res;
throw new IOException("Incorrect response type. Expected org.telegram.tl.TLBool, got: " + res.getClass().getCanonicalName());
}
/**
* Gets file id.
*
* @return the file id
*/
public long getFileId() {
return this.fileId;
}
/**
* Sets file id.
*
* @param value the value
*/
public void setFileId(long value) {
this.fileId = value;
}
/**
* Gets file part.
*
* @return the file part
*/
public int getFilePart() {
return this.filePart;
}
/**
* Sets file part.
*
* @param value the value
*/
public void setFilePart(int value) {
this.filePart = value;
}
/**
* Gets file total parts.
*
* @return the file total parts
*/
public int getFileTotalParts() {
return this.fileTotalParts;
}
/**
* Sets file total parts.
*
* @param value the value
*/
public void setFileTotalParts(int value) {
this.fileTotalParts = value;
}
/**
* Gets bytes.
*
* @return the bytes
*/
public TLBytes getBytes() {
return this.bytes;
}
/**
* Sets bytes.
*
* @param value the value
*/
public void setBytes(TLBytes value) {
this.bytes = value;
}
public void serializeBody(OutputStream stream)
throws IOException {
StreamingUtils.writeLong(this.fileId, stream);
StreamingUtils.writeInt(this.filePart, stream);
StreamingUtils.writeInt(this.fileTotalParts, stream);
StreamingUtils.writeTLBytes(this.bytes, stream);
}
public void deserializeBody(InputStream stream, TLContext context)
throws IOException {
this.fileId = StreamingUtils.readLong(stream);
this.filePart = StreamingUtils.readInt(stream);
this.fileTotalParts = StreamingUtils.readInt(stream);
this.bytes = StreamingUtils.readTLBytes(stream, context);
}
public String toString() {
return "upload.saveBigFilePart#de7b673d";
}
}
|
[
"[email protected]"
] | |
7b6b957ace0996d2099c2d2eed86e78a87f7080c
|
7fd94a908e35cfc12079bf71ebe898ae7c006d45
|
/김현수/01주차/1000번 A+B.java
|
9ec0089f2311021e3f745dfb83131bf038c8ada0
|
[] |
no_license
|
tomy9729/TargetIsPlatinum5
|
9391edb1dbd58f9fe6fb318de0d391018e79e36e
|
22d767fc9f6eb4e0e61ee3066c4083f0e4b1fd61
|
refs/heads/main
| 2023-09-06T02:26:01.675721 | 2021-11-06T14:58:20 | 2021-11-06T14:58:20 | 388,791,393 | 1 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 233 |
java
|
//1000번 A+B.java
import java.util.Scanner;
public class AplusB_1000 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(a+b);
}
}
|
[
"[email protected]"
] | |
9e045d147e5ed1f17e0dd7cbe234d901910c4291
|
a86844423ab7742c73ed65285cd6df41560ba009
|
/src/main/java/com/cnaidun/police/service/impl/SysRoleServiceImpl.java
|
9276c1a32de71c8ae3d176f0b38f469fc5177292
|
[] |
no_license
|
zhouyawen66/xq-system
|
e745584b61d056920890b3664b66b358131d10ce
|
b9e6044148b24a1c2db340b1e8a19bafa4372b26
|
refs/heads/master
| 2020-12-06T14:54:03.174427 | 2020-01-08T07:53:29 | 2020-01-08T07:53:29 | 232,490,617 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 701 |
java
|
package com.cnaidun.police.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.cnaidun.police.entity.SysRole;
import com.cnaidun.police.mapper.SysRoleMapper;
import com.cnaidun.police.service.SysRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @ClassName SysRoleServiceImpl
* @Description TODO
* @Author Administrator
* @Date 2019/12/4 15:17
* @Version 1.0
*/
@Service
@Transactional(rollbackFor = Exception.class,readOnly = true)
@Slf4j
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
}
|
[
"[email protected]"
] | |
5192f54b026f075c1645083ac76fa9155b2671ae
|
1b30be21bf77b15cdbe56226fcd41cf09ba5c989
|
/SGH/src/Ventanas/Sala/VentanaReporte.java
|
c910775bf89b3204d4f8e1dce1e4beebc509aa1f
|
[] |
no_license
|
AchmedCL/SGH
|
0bb9c504702f6a3fb56477c421f292c83a1481af
|
275ab818ca365d2652dde2003d5dde1e145aed96
|
refs/heads/master
| 2020-03-18T08:18:55.662501 | 2018-05-22T06:34:36 | 2018-05-22T06:34:36 | 134,502,104 | 0 | 0 | null | 2018-05-23T02:32:37 | 2018-05-23T02:32:37 | null |
UTF-8
|
Java
| false | false | 14,050 |
java
|
package Ventanas.Sala;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import principal.*;
public class VentanaReporte extends javax.swing.JFrame {
private Hospital hospi;
private Sala sala;
public VentanaReporte() {
initComponents();
}
public VentanaReporte(ActionEvent evt, Hospital hospi, Sala sala){
initComponents();
setHospital(hospi);
setSala(sala);
mostrar(evt);
}
public void setHospital(Hospital hospi){
this.hospi = hospi;
}
public void setSala(Sala sala){
this.sala = sala;
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
Nombre = new javax.swing.JLabel();
Número = new javax.swing.JLabel();
Especialidad = new javax.swing.JLabel();
Piso = new javax.swing.JLabel();
Doctor = new javax.swing.JLabel();
Capacidad = new javax.swing.JLabel();
botonMostrar = new javax.swing.JButton();
nombre = new javax.swing.JTextField();
numero = new javax.swing.JTextField();
especialidad = new javax.swing.JTextField();
doctor = new javax.swing.JTextField();
piso = new javax.swing.JTextField();
capacidad = new javax.swing.JTextField();
botonVolver = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
Nombre.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
Nombre.setText("Nombre");
Número.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
Número.setText("Número");
Especialidad.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
Especialidad.setText("Especialidad");
Piso.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
Piso.setText("Piso");
Doctor.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
Doctor.setText("RUN doctor");
Capacidad.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
Capacidad.setText("Capacidad");
botonMostrar.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
botonMostrar.setText("Mostrar");
botonMostrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
botonMostrarActionPerformed(evt);
}
});
nombre.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
numero.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
especialidad.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
doctor.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
piso.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
capacidad.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
botonVolver.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
botonVolver.setText("Volver");
botonVolver.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
botonVolverActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(Especialidad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Capacidad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Piso, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Doctor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Número, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Nombre, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(nombre)
.addComponent(numero)
.addComponent(especialidad)
.addComponent(doctor)
.addComponent(piso)
.addComponent(capacidad, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(botonVolver, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
.addComponent(botonMostrar, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(nombre, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
.addComponent(Nombre, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(numero, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
.addComponent(Número, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(especialidad, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
.addComponent(Especialidad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(doctor, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
.addComponent(Doctor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(piso, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
.addComponent(Piso, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(Capacidad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(capacidad, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(botonMostrar, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(botonVolver, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 8, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void botonMostrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonMostrarActionPerformed
mostrar(evt);
}//GEN-LAST:event_botonMostrarActionPerformed
private void botonVolverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonVolverActionPerformed
final VentanaMenuSala vr ;
vr = new VentanaMenuSala(evt,hospi);
botonVolver.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
vr.setVisible(true);
vr.setLocationRelativeTo(null);
VentanaReporte.this.dispose();
} catch (final Exception excep) {
System.exit(0);
}
}
});
}//GEN-LAST:event_botonVolverActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(VentanaReporte.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(VentanaReporte.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(VentanaReporte.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(VentanaReporte.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new VentanaReporte().setVisible(true);
}
});
}
public void mostrar(java.awt.event.ActionEvent evt)
{
this.nombre.setText(sala.getNombreSala());
this.numero.setText(Integer.toString(sala.getNumeroSala()));
this.especialidad.setText(sala.getEspecialidad());
this.doctor.setText(sala.getRutDoctor());
this.piso.setText(Integer.toString(sala.getPiso()));
this.capacidad.setText(Integer.toString(sala.getCapacidadMaxima()));
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel Capacidad;
private javax.swing.JLabel Doctor;
private javax.swing.JLabel Especialidad;
private javax.swing.JLabel Nombre;
private javax.swing.JLabel Número;
private javax.swing.JLabel Piso;
private javax.swing.JButton botonMostrar;
private javax.swing.JButton botonVolver;
private javax.swing.JTextField capacidad;
private javax.swing.JTextField doctor;
private javax.swing.JTextField especialidad;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField nombre;
private javax.swing.JTextField numero;
private javax.swing.JTextField piso;
// End of variables declaration//GEN-END:variables
}
|
[
""
] | |
71a5d91266c9e871b7a4708b62ce5aab0b3babb7
|
f660a79c138f4e8842f0cfe2a1eaeca47ed9293e
|
/src/com/aoyou/test/app/Result/contentModel/GetActivityPanicBuyingProducts_ProductViewInfoModel.java
|
c0286236dabac3b0df367d6a6c15903b3a8c76a3
|
[] |
no_license
|
hahalovesj/aoyouWebInterface_liuze
|
37751b18f119cf49559eec5423696228a9a8c494
|
73f4655b7446b630dcf137ac39a7f3a7a9b0e50d
|
refs/heads/master
| 2016-09-12T18:39:42.150189 | 2016-04-11T10:27:21 | 2016-04-11T10:27:21 | 55,963,131 | 0 | 0 | null | null | null | null |
GB18030
|
Java
| false | false | 1,799 |
java
|
package com.aoyou.test.app.Result.contentModel;
import java.util.List;
public class GetActivityPanicBuyingProducts_ProductViewInfoModel {
//产品ID
public int ProductID;
//产品编号
public String ProductNo;
//产品名称
public String ProductName;
//产品状态
public int ProductStatus;
//产品描述
public String ProductDescription;
//图片列表
public List<String> ImageUrlList;
//产品录入部门
public String ProductDept;
//产品录入时间
public String InputDate;
//产品子名称
public String ProductSubName;
//出发时间
public String DepartureDate;
//产品销售渠道
public int SalesChannel;
//优惠ID
public int ActivityID;
//跟团ID
public int GroupID;
//出发城市ID
public int BeginCityID;
//截止时间
public String EndTime;
//产品原始价格
public double OrginalPrice;
//产品类型
public int ProductType;
//子产品分类
public int ProductSubType;
//促销价
public double PromotionalPrice;
//已购买数量
public int PruchasedNum;
//剩余数量
public int SurplusNum;
//行程天数
public int ProductDays;
//出入境标示
public int ProductInterFlag;
//单房差
public double SingleRoomPrice;
//最大出行人数
public int MaxBookingNum;
//最小出行数量
public int MinBookingNum;
//出发城市名称
public String DepartCityName;
//产品在网站上的展示地址
public String ProductWebsiteDisplayUrl;
//出发时间
public List<String> DepartureDateList;
//上线时间
public String OnlineTime;
//抢购标识
public int DiscountFLag;
//开始预订时间
public String StartBookingTime;
//目的地城市ID
public int DestCityId;
//目的地城市名称
public String DestCityName;
}
|
[
"[email protected]"
] | |
6eddd306ccd55149aa77a6102da1237f4710bee0
|
7a7ba2805a15059c30f31e1b352ab6aa30592de7
|
/awd.cloud.suppers/awd.cloud.suppers.interface/src/main/java/awd/cloud/suppers/interfaces/service/kss/CzjlService.java
|
1c1d031e1fe72ac66b68cf1ca422223e64baf515
|
[] |
no_license
|
tony-catalina/Peking_cloud2
|
bc1bf7f377b68ce06c77d2de36554893eaabc697
|
c47db69483c203f4aefd37a034ada6aeb182c4fd
|
refs/heads/master
| 2022-12-13T14:55:37.859352 | 2020-03-02T08:13:48 | 2020-03-02T08:13:48 | 244,308,357 | 0 | 1 | null | 2022-12-06T00:46:17 | 2020-03-02T07:35:13 |
JavaScript
|
UTF-8
|
Java
| false | false | 477 |
java
|
package awd.cloud.suppers.interfaces.service.kss;
import awd.cloud.suppers.interfaces.utils.PagerResult;
import awd.cloud.suppers.interfaces.utils.ResponseMessage;
import java.util.Map;
public interface CzjlService {
public ResponseMessage<PagerResult<Map<String, Object>>> getCzjl(Map<String, Object> map);
public ResponseMessage<String> saveCzjl(Map<String, Object> map);
public ResponseMessage<String> updateCzjlById(String id ,Map<String, Object> map);
}
|
[
"[email protected]"
] | |
fc037fe6d2b524d9ea5e36c6824cc6ae2dc3a28b
|
56f85d85ae85e6666e472d4eeb9fed1fe5411195
|
/src/it/polito/tdp/artsmia/model/Model.java
|
5ccf23ecb04e36be1b22b38414f68c092ca6749d
|
[] |
no_license
|
IACOVELLIGABRIELE/2017-07-10
|
1b63c61cdeb8ec898abcc1ee8776f6e50c3619e0
|
d51c6ea5c5ca8a7400c5769030773c6ab24f70c2
|
refs/heads/master
| 2020-03-16T09:51:39.629341 | 2018-05-22T11:21:02 | 2018-05-22T11:21:02 | 132,624,221 | 0 | 0 | null | 2018-05-08T14:52:29 | 2018-05-08T14:52:28 | null |
WINDOWS-1252
|
Java
| false | false | 4,202 |
java
|
package it.polito.tdp.artsmia.model;
import java.util.*;
import org.jgrapht.*;
import org.jgrapht.graph.*;
import it.polito.tdp.artsmia.db.ArtsmiaDAO;
public class Model {
private List<ArtObject> artObjects ;
private Graph<ArtObject, DefaultWeightedEdge> graph; //grafo con vertici ArtObject e visto che non è orientato ma pesato metto DefaultWeightEdge
private List<ArtObject> best;
/**
* Popola la lista artObject dal database
*/
public void creaGrafo() {
//Leggi lista oggetti DB e salva nella lista artObjects
ArtsmiaDAO dao = new ArtsmiaDAO();
this.artObjects = dao.listObjects();
//Crea il grafo con zero vertici e zero archi
// grafo pesato, semplice e non orientato
this.graph = new SimpleWeightedGraph<>(DefaultWeightedEdge.class);
//aggiungi i vertici
/* for(ArtObject ao : this.artObjects) {
this.graph.addVertex(ao);
}
questa opzione viene fatta da "Graphs.addAllVertices(this.graph, this.artObjects);"
*/
Graphs.addAllVertices(this.graph, this.artObjects);
//Aggiungi archi e il loro peso
for(ArtObject ao : this.artObjects) {
List<ArtObjectAndCount> connessi = dao.listArtObjectAndCount(ao);
for(ArtObjectAndCount c : connessi) {
ArtObject dest = new ArtObject(c.getArtObjectId(), null, null, null, 0, null, null, null, null, null, 0, null, null, null, null, null);
Graphs.addEdge(this.graph, ao, dest, c.getCount());
System.out.format("(%d, %d) peso %d \n", ao.getId(), dest.getId(), c.getCount());
}
}
/* VERSIONE 1
for(ArtObject partenza : this.artObjects) {
for(ArtObject arrivo : this.artObjects) {
if(!partenza.equals(arrivo) && partenza.getId() < arrivo.getId()) { //escludo i loop && faccio si che il grafo non sia orientato non ripeto archi ( es. 1-5, 5-1) nei grafi non orientati è lo stesso arco
int peso = exhibitionComuni(partenza, arrivo);
//System.out.format("(%d, %d) peso %d \n", partenza.getId(), arrivo.getId(),peso);
if(peso != 0) {
System.out.format("(%d, %d) peso %d\n", partenza.getId(), arrivo.getId(),peso);
Graphs.addEdge(this.graph, partenza, arrivo, peso);
//questa dichiarazione ha lo stesso valore
//DefaultWeightedEdge e = this.graph.addEdge(partenza, arrivo);
// this.graph.setEdgeWeight(e, peso);
}
}
}
}*/
}
private int exhibitionComuni(ArtObject partenza, ArtObject arrivo) {
ArtsmiaDAO dao = new ArtsmiaDAO();
int comuni = dao.contaExhibitionComuni(partenza, arrivo);
return comuni;
}
// 2 PUNTO RICORSIONE
public List<ArtObject> camminoMassimo(int startId, int LUN){
//trovare vertice partenza
ArtObject start = null;
for(ArtObject ao : this.artObjects) {
if(ao.getId() == startId) {
// start.setClassification(ao.getClassification());
}
}
List<ArtObject> parziale = new ArrayList<>();
parziale.add(start);
best = parziale;
cerca(parziale,1,LUN);
return best;
}
private void cerca (List<ArtObject> parziale, int livello, int LUN) {
if(livello == LUN) {
//caso terminale
if(peso(parziale) > peso(best)) {
best = new ArrayList<>(parziale);
System.out.println(best);
}
}
//trova vertici adiacenti all'ultimo della sequenza
ArtObject ultimo = parziale.get(parziale.size()-1); //non posso fare ricorsione su lista vuota
List<ArtObject> adiacenti = Graphs.neighborListOf(this.graph, ultimo);
for(ArtObject prova : adiacenti) {
if(!parziale.contains(prova) && prova.getClassification().equals(parziale.get(0).getClassification())) {
parziale.add(prova);
cerca(parziale,livello+1,LUN);
parziale.remove(parziale.size()-1);
}
}
}
public int peso(List<ArtObject> parziale) {
int peso = 0;
for(int i=0; i<parziale.size()-1;i++) {
DefaultWeightedEdge e = this.graph.getEdge(parziale.get(i), parziale.get(i+1));
int pesoarco = (int) graph.getEdgeWeight(e);
peso += pesoarco;
}
return peso;
}
}
|
[
"[email protected]"
] | |
e3756d47ace8d4b9cec215c275efb26c68e3234e
|
76e221970f091ff137c6b09a7af1cd06de435053
|
/finalRelease/PaperService/EmployeeService/src/main/java/com/ishan/app/hystrix/AllocationCommand.java
|
3d05b9e9cab484adb11386859fee5ec32b484eb1
|
[] |
no_license
|
ishanRox/Virtusa-Training
|
605fc557276d11063007585f042e48a65a60f04f
|
967188164f6239e8887666d41aad5f3af99eac63
|
refs/heads/master
| 2023-01-23T01:16:59.839764 | 2021-01-14T19:05:05 | 2021-01-14T19:05:05 | 231,940,123 | 0 | 3 | null | 2023-01-07T15:40:44 | 2020-01-05T15:50:39 |
Java
|
UTF-8
|
Java
| false | false | 1,817 |
java
|
package com.ishan.app.hystrix;
import com.ishan.app.model.Allocation;
import com.ishan.app.model.Employee;
import com.netflix.hystrix.HystrixCommand;
import com.netflix.hystrix.HystrixCommandGroupKey;
import org.springframework.cloud.netflix.hystrix.HystrixCommands;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
public class AllocationCommand extends HystrixCommand<Allocation[]> {
Employee employee;
HttpHeaders httpHeaders;
RestTemplate restTemplate;
public AllocationCommand(Employee employee, HttpHeaders httpHeaders, RestTemplate restTemplate) {
super(HystrixCommandGroupKey.Factory.asKey("default"));
this.employee = employee;
this.httpHeaders = httpHeaders;
this.restTemplate = restTemplate;
}
@Override
protected Allocation[] run() throws Exception {
HttpEntity<String> httpEntity = new HttpEntity<>("", httpHeaders);
ResponseEntity<Allocation[]> responseEntity = restTemplate.exchange(
"http://allocater/services/getbyid/" + employee.getId(), HttpMethod.GET, httpEntity,
Allocation[].class);
return responseEntity.getBody();
}
@Override
protected Allocation[] getFallback() {
// This is because we must return Allocation []
// So we use one object array Trick to make method belive we return an array
// Allocation[] allocation = new Allocation[1];
// allocation[1].setProjectName("Server Down");
// allocation[1].setStartDate("2222");
// return allocation;
Allocation[] allocations= new Allocation[5];
Allocation allocation= new Allocation();
allocation.setEmpid(1);
allocation.setProjectName("sdfasfafafaf");
allocations[0]=allocation;
return allocations;
}
}
|
[
"[email protected]"
] | |
adb275f3fc3872518f8555de0db5a546a693b85e
|
c390b9ca43af9f69cdcf2bde9a261c51a0258dea
|
/ProjectFirst04/app/src/main/java/com/snz/rskj/android/bean/andiencebean/Audience.java
|
ba8b120bf82c1da64773b8fd00f657da08f3ed13
|
[] |
no_license
|
zzy1147/ccc
|
701d6b53f0fa01980ba1ecd0c803b6aaff3d3492
|
3b130e48e1cdf0bffdf49a997ea276e8412c35b0
|
refs/heads/master
| 2020-04-16T04:19:53.625081 | 2019-01-11T15:15:52 | 2019-01-11T15:15:52 | 165,262,750 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,170 |
java
|
package com.snz.rskj.android.bean.andiencebean;
import com.netease.nimlib.sdk.avchat.constant.AVChatType;
import com.snz.rskj.android.activitylive.MicStateEnum;
public class Audience {
private String andienceName;
private String andienceImageUrl;
private Boolean andienceAttention;
private Boolean andienceConnectM;
private String andienceGoldNum;
/* private String account;
private String name;
private String avatar;
private AVChatType avChatType;
private boolean isSelected;*/
private MicStateEnum micStateEnum;
public MicStateEnum getMicStateEnum() {
return micStateEnum;
}
public void setMicStateEnum(MicStateEnum micStateEnum) {
this.micStateEnum = micStateEnum;
}
public Audience(String andienceName, String andienceImageUrl, Boolean andienceAttention, Boolean andienceConnectM, String andienceGoldNum) {
this.andienceName = andienceName;
this.andienceImageUrl = andienceImageUrl;
this.andienceAttention = andienceAttention;
this.andienceConnectM = andienceConnectM;
this.andienceGoldNum = andienceGoldNum;
}
public Audience() {
}
public String getAndienceName() {
return andienceName;
}
public void setAndienceName(String andienceName) {
this.andienceName = andienceName;
}
public String getAndienceImageUrl() {
return andienceImageUrl;
}
public void setAndienceImageUrl(String andienceImageUrl) {
this.andienceImageUrl = andienceImageUrl;
}
public Boolean getAndienceAttention() {
return andienceAttention;
}
public void setAndienceAttention(Boolean andienceAttention) {
this.andienceAttention = andienceAttention;
}
public Boolean getAndienceConnectM() {
return andienceConnectM;
}
public void setAndienceConnectM(Boolean andienceConnectM) {
this.andienceConnectM = andienceConnectM;
}
public String getAndienceGoldNum() {
return andienceGoldNum;
}
public void setAndienceGoldNum(String andienceGoldNum) {
this.andienceGoldNum = andienceGoldNum;
}
}
|
[
"[email protected]"
] | |
7e30e2f622829cfd0c41f5ee0bb0a0db7e5f6230
|
6b2a8dd202fdce77c971c412717e305e1caaac51
|
/solutions_5634947029139456_1/java/volodymyr/Charging.java
|
bf2f52661d5dc7d3d420872fa428b569fd65cac0
|
[] |
no_license
|
alexandraback/datacollection
|
0bc67a9ace00abbc843f4912562f3a064992e0e9
|
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
|
refs/heads/master
| 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,117 |
java
|
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
import java.math.BigInteger;
import java.util.Scanner;
public class Charging {
private static InputStream in;
private static PrintStream out;
private static Scanner sc;
private static BigInteger[] outlets;
private static BigInteger[] plugs;
private static int n;
private static int l;
static {
try {
in =
new FileInputStream("A-large.in");
// System.in;
out =
new PrintStream(new FileOutputStream("out.txt"));
// System.out;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args) {
sc = new Scanner(in);
int numCases = sc.nextInt();
for (int i = 0; i < numCases; i++) {
out.println("Case #" + (i + 1) + ": " + solve());
}
}
private static String solve() {
n = sc.nextInt();
l = sc.nextInt();
outlets = new BigInteger[n];
plugs = new BigInteger[n];
for (int i = 0; i < n; i++) {
BigInteger outlet = new BigInteger("0");
String line = sc.next();
for (int j = 0; j < l; j++) {
if (line.charAt(j) == '1') {
outlet=outlet.setBit(j);
}
}
outlets[i] = outlet;
}
for (int i = 0; i < n; i++) {
BigInteger plug = new BigInteger("0");
String line = sc.next();
for (int j = 0; j < l; j++) {
if (line.charAt(j) == '1') {
plug=plug.setBit(j);
}
}
plugs[i] = plug;
}
int min = Integer.MAX_VALUE;
for (int i = 0; i < n; i++) {
BigInteger mask = convertTo(outlets[0], plugs[i]);
if (valid(mask, i)) {
int diff = numberOfOnes(mask);
if (diff < min) {
min = diff;
}
}
}
return (min == Integer.MAX_VALUE ? "NOT POSSIBLE" : "" + min);
}
private static boolean valid(BigInteger mask, int pUsed) {
boolean[] plugUsed = new boolean[n];
plugUsed[pUsed] = true;
return isValid(plugUsed, 1, mask);
}
private static boolean isValid(boolean[] plugUsed, int i, BigInteger mask) {
if (i == n)
return true;
for (int j = 0; j < n; j++) {
if (plugUsed[j])
continue;
if (matches(mask,outlets[i], plugs[j])) {
plugUsed[j] = true;
if (isValid(plugUsed, i + 1, mask))
return true;
plugUsed[j] = false;
}
}
return false;
}
private static boolean matches(BigInteger mask, BigInteger i1,
BigInteger i2) {
for (int i = 0; i < l; i++) {
if (i1.testBit(i) != i2.testBit(i)) {
if(!mask.testBit(i))return false;
}else{
if(mask.testBit(i))return false;
}
}
return true;
}
private static int numberOfOnes(BigInteger mask) {
int res = 0;
for (int i = 0; i < l; i++) {
if (mask.testBit(i)) {
res++;
}
}
return res;
}
private static BigInteger convertTo(BigInteger i1, BigInteger i2) {
BigInteger result = new BigInteger("0");
for (int i = 0; i < l; i++) {
if (i1.testBit(i) != i2.testBit(i)) {
result=result.setBit(i);
}
}
return result;
}
}
|
[
"[email protected]"
] | |
23df115b8176a3006642afbdeabe0998aafaee0f
|
c885ef92397be9d54b87741f01557f61d3f794f3
|
/results/JacksonDatabind-112/com.fasterxml.jackson.databind.deser.std.StringCollectionDeserializer/BBC-F0-opt-90/tests/4/com/fasterxml/jackson/databind/deser/std/StringCollectionDeserializer_ESTest.java
|
42468662c8369bc9f5f7102e2cc06e3262804f36
|
[
"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 | 41,071 |
java
|
/*
* This file was automatically generated by EvoSuite
* Thu Oct 14 05:52:34 GMT 2021
*/
package com.fasterxml.jackson.databind.deser.std;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import com.fasterxml.jackson.annotation.ObjectIdResolver;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.io.IOContext;
import com.fasterxml.jackson.core.json.ReaderBasedJsonParser;
import com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer;
import com.fasterxml.jackson.core.util.BufferRecycler;
import com.fasterxml.jackson.core.util.JsonParserSequence;
import com.fasterxml.jackson.databind.BeanProperty;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.InjectableValues;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.cfg.BaseSettings;
import com.fasterxml.jackson.databind.cfg.ConfigOverrides;
import com.fasterxml.jackson.databind.cfg.ContextAttributes;
import com.fasterxml.jackson.databind.deser.BeanDeserializerFactory;
import com.fasterxml.jackson.databind.deser.DefaultDeserializationContext;
import com.fasterxml.jackson.databind.deser.DeserializationProblemHandler;
import com.fasterxml.jackson.databind.deser.NullValueProvider;
import com.fasterxml.jackson.databind.deser.ValueInstantiator;
import com.fasterxml.jackson.databind.deser.std.StringCollectionDeserializer;
import com.fasterxml.jackson.databind.introspect.BasicBeanDescription;
import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver;
import com.fasterxml.jackson.databind.jsontype.SubtypeResolver;
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
import com.fasterxml.jackson.databind.jsontype.impl.AsArrayTypeDeserializer;
import com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver;
import com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;
import com.fasterxml.jackson.databind.type.CollectionType;
import com.fasterxml.jackson.databind.type.MapLikeType;
import com.fasterxml.jackson.databind.type.ReferenceType;
import com.fasterxml.jackson.databind.type.ResolvedRecursiveType;
import com.fasterxml.jackson.databind.type.SimpleType;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.RootNameLookup;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.PipedReader;
import java.time.format.TextStyle;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Stack;
import java.util.Vector;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.evosuite.runtime.mock.java.io.MockFile;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class StringCollectionDeserializer_ESTest extends StringCollectionDeserializer_ESTest_scaffolding {
@Test(timeout = 4000)
public void test00() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, (JsonDeserializer<?>) null, valueInstantiator_Base0);
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
StringCollectionDeserializer stringCollectionDeserializer1 = new StringCollectionDeserializer(javaType0, valueInstantiator_Base0, stringCollectionDeserializer0, (JsonDeserializer<?>) null, (NullValueProvider) null, (Boolean) null);
// Undeclared exception!
try {
stringCollectionDeserializer1.deserialize((JsonParser) null, (DeserializationContext) defaultDeserializationContext_Impl0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.DeserializationContext", e);
}
}
@Test(timeout = 4000)
public void test01() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
JavaType javaType0 = TypeFactory.unknownType();
JsonDeserializer<ObjectIdGenerators.UUIDGenerator> jsonDeserializer0 = (JsonDeserializer<ObjectIdGenerators.UUIDGenerator>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, jsonDeserializer0, (ValueInstantiator) null);
BeanProperty.Bogus beanProperty_Bogus0 = new BeanProperty.Bogus();
Boolean boolean0 = new Boolean(false);
StringCollectionDeserializer stringCollectionDeserializer1 = stringCollectionDeserializer0.withResolved(stringCollectionDeserializer0, stringCollectionDeserializer0, stringCollectionDeserializer0, boolean0);
JsonDeserializer<?> jsonDeserializer1 = stringCollectionDeserializer1.createContextual(defaultDeserializationContext_Impl0, beanProperty_Bogus0);
assertTrue(jsonDeserializer1.isCachable());
}
@Test(timeout = 4000)
public void test02() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
JavaType javaType0 = TypeFactory.unknownType();
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, (JsonDeserializer<?>) null, (ValueInstantiator) null);
Boolean boolean0 = Boolean.TRUE;
BeanProperty.Bogus beanProperty_Bogus0 = new BeanProperty.Bogus();
StringCollectionDeserializer stringCollectionDeserializer1 = stringCollectionDeserializer0.withResolved(stringCollectionDeserializer0, (JsonDeserializer<?>) null, (NullValueProvider) null, boolean0);
// Undeclared exception!
try {
stringCollectionDeserializer1.createContextual(defaultDeserializationContext_Impl0, beanProperty_Bogus0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.DeserializationContext", e);
}
}
@Test(timeout = 4000)
public void test03() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
Boolean boolean0 = Boolean.TRUE;
JsonDeserializer<JavaType> jsonDeserializer0 = (JsonDeserializer<JavaType>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, valueInstantiator_Base0, jsonDeserializer0, jsonDeserializer0, jsonDeserializer0, boolean0);
ReferenceType referenceType0 = ReferenceType.upgradeFrom(javaType0, javaType0);
StringCollectionDeserializer stringCollectionDeserializer1 = new StringCollectionDeserializer(referenceType0, stringCollectionDeserializer0, valueInstantiator_Base0);
JsonFactory jsonFactory0 = new JsonFactory();
JsonParser jsonParser0 = jsonFactory0.createNonBlockingByteArrayParser();
JsonParserSequence jsonParserSequence0 = JsonParserSequence.createFlattened(true, jsonParser0, jsonParser0);
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
RootNameLookup rootNameLookup0 = new RootNameLookup();
ConfigOverrides configOverrides0 = new ConfigOverrides();
DeserializationConfig deserializationConfig0 = new DeserializationConfig((BaseSettings) null, (SubtypeResolver) null, (SimpleMixInResolver) null, rootNameLookup0, configOverrides0);
DeserializationProblemHandler deserializationProblemHandler0 = mock(DeserializationProblemHandler.class, new ViolatedAssumptionAnswer());
doReturn((Object) null).when(deserializationProblemHandler0).handleMissingInstantiator(any(com.fasterxml.jackson.databind.DeserializationContext.class) , any(java.lang.Class.class) , any(com.fasterxml.jackson.databind.deser.ValueInstantiator.class) , any(com.fasterxml.jackson.core.JsonParser.class) , anyString());
doReturn((Object) null).when(deserializationProblemHandler0).handleUnexpectedToken(any(com.fasterxml.jackson.databind.DeserializationContext.class) , any(java.lang.Class.class) , any(com.fasterxml.jackson.core.JsonToken.class) , any(com.fasterxml.jackson.core.JsonParser.class) , anyString());
DeserializationConfig deserializationConfig1 = deserializationConfig0.withHandler(deserializationProblemHandler0);
HashMap<String, Object> hashMap0 = new HashMap<String, Object>();
InjectableValues.Std injectableValues_Std0 = new InjectableValues.Std(hashMap0);
DefaultDeserializationContext defaultDeserializationContext0 = defaultDeserializationContext_Impl0.createInstance(deserializationConfig1, jsonParser0, injectableValues_Std0);
Collection<String> collection0 = stringCollectionDeserializer1.deserialize((JsonParser) jsonParserSequence0, (DeserializationContext) defaultDeserializationContext0);
assertNull(collection0);
}
@Test(timeout = 4000)
public void test04() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, (JsonDeserializer<?>) null, (ValueInstantiator) null);
Boolean boolean0 = Boolean.TRUE;
StringCollectionDeserializer stringCollectionDeserializer1 = stringCollectionDeserializer0.withResolved((JsonDeserializer<?>) null, (JsonDeserializer<?>) null, (NullValueProvider) null, boolean0);
assertNotSame(stringCollectionDeserializer1, stringCollectionDeserializer0);
}
@Test(timeout = 4000)
public void test05() throws Throwable {
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer((JavaType) null, (JsonDeserializer<?>) null, (ValueInstantiator) null);
boolean boolean0 = stringCollectionDeserializer0.isCachable();
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test06() throws Throwable {
JsonDeserializer<TextStyle> jsonDeserializer0 = (JsonDeserializer<TextStyle>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
Class<ResolvedRecursiveType> class0 = ResolvedRecursiveType.class;
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(class0);
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer((JavaType) null, jsonDeserializer0, valueInstantiator_Base0);
ValueInstantiator valueInstantiator0 = stringCollectionDeserializer0.getValueInstantiator();
assertFalse(valueInstantiator0.canCreateFromInt());
}
@Test(timeout = 4000)
public void test07() throws Throwable {
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer((JavaType) null, (JsonDeserializer<?>) null, (ValueInstantiator) null);
JsonDeserializer<Object> jsonDeserializer0 = stringCollectionDeserializer0.getContentDeserializer();
assertNull(jsonDeserializer0);
}
@Test(timeout = 4000)
public void test08() throws Throwable {
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer((JavaType) null, (JsonDeserializer<?>) null, (ValueInstantiator) null);
Boolean boolean0 = Boolean.TRUE;
StringCollectionDeserializer stringCollectionDeserializer1 = stringCollectionDeserializer0.withResolved((JsonDeserializer<?>) null, stringCollectionDeserializer0, (NullValueProvider) null, boolean0);
JsonDeserializer<Object> jsonDeserializer0 = stringCollectionDeserializer1.getContentDeserializer();
assertNotNull(jsonDeserializer0);
assertFalse(stringCollectionDeserializer1.isCachable());
}
@Test(timeout = 4000)
public void test09() throws Throwable {
Class<TextStyle> class0 = TextStyle.class;
SimpleType simpleType0 = SimpleType.constructUnsafe(class0);
MapLikeType mapLikeType0 = MapLikeType.upgradeFrom(simpleType0, simpleType0, simpleType0);
ReferenceType referenceType0 = ReferenceType.upgradeFrom(mapLikeType0, mapLikeType0);
JsonDeserializer<TextStyle> jsonDeserializer0 = (JsonDeserializer<TextStyle>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(class0);
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(referenceType0, jsonDeserializer0, valueInstantiator_Base0);
StringCollectionDeserializer stringCollectionDeserializer1 = stringCollectionDeserializer0.withResolved(stringCollectionDeserializer0, stringCollectionDeserializer0, stringCollectionDeserializer0, (Boolean) null);
JsonDeserializer<Object> jsonDeserializer1 = stringCollectionDeserializer1.getContentDeserializer();
assertFalse(jsonDeserializer1.isCachable());
}
@Test(timeout = 4000)
public void test10() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
JavaType javaType0 = TypeFactory.unknownType();
JsonDeserializer<ObjectIdResolver> jsonDeserializer0 = (JsonDeserializer<ObjectIdResolver>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, jsonDeserializer0, (ValueInstantiator) null);
StringCollectionDeserializer stringCollectionDeserializer1 = new StringCollectionDeserializer(javaType0, stringCollectionDeserializer0, (ValueInstantiator) null);
BeanProperty.Bogus beanProperty_Bogus0 = new BeanProperty.Bogus();
JsonDeserializer<?> jsonDeserializer1 = stringCollectionDeserializer1.createContextual(defaultDeserializationContext_Impl0, beanProperty_Bogus0);
assertTrue(jsonDeserializer1.isCachable());
}
@Test(timeout = 4000)
public void test11() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
JavaType javaType0 = TypeFactory.unknownType();
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, (JsonDeserializer<?>) null, (ValueInstantiator) null);
ObjectMapper objectMapper0 = new ObjectMapper();
JsonFactory jsonFactory0 = new JsonFactory(objectMapper0);
File file0 = MockFile.createTempFile("JSON", "");
JsonParser jsonParser0 = jsonFactory0.createParser(file0);
// Undeclared exception!
try {
stringCollectionDeserializer0.deserializeWithType(jsonParser0, defaultDeserializationContext_Impl0, (TypeDeserializer) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.deser.std.StringCollectionDeserializer", e);
}
}
@Test(timeout = 4000)
public void test12() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
Boolean boolean0 = Boolean.TRUE;
JsonDeserializer<TextStyle> jsonDeserializer0 = (JsonDeserializer<TextStyle>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
doReturn((Object) null).when(jsonDeserializer0).deserialize(any(com.fasterxml.jackson.core.JsonParser.class) , any(com.fasterxml.jackson.databind.DeserializationContext.class));
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, valueInstantiator_Base0, jsonDeserializer0, jsonDeserializer0, jsonDeserializer0, boolean0);
JsonFactory jsonFactory0 = new JsonFactory();
JsonParser jsonParser0 = jsonFactory0.createNonBlockingByteArrayParser();
JsonNodeFactory jsonNodeFactory0 = new JsonNodeFactory(true);
ArrayNode arrayNode0 = new ArrayNode(jsonNodeFactory0);
List<String> list0 = arrayNode0.findValuesAsText("0Qc!Ppq`T[z5faD");
// Undeclared exception!
try {
stringCollectionDeserializer0.deserialize(jsonParser0, (DeserializationContext) null, (Collection<String>) list0);
fail("Expecting exception: UnsupportedOperationException");
} catch(UnsupportedOperationException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.util.AbstractList", e);
}
}
@Test(timeout = 4000)
public void test13() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
Boolean boolean0 = Boolean.TRUE;
JsonDeserializer<Integer> jsonDeserializer0 = (JsonDeserializer<Integer>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
byte[] byteArray0 = new byte[7];
ByteArrayInputStream byteArrayInputStream0 = new ByteArrayInputStream(byteArray0, (byte)1, (byte)1);
JsonDeserializer<ByteArrayInputStream> jsonDeserializer1 = (JsonDeserializer<ByteArrayInputStream>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
doReturn(byteArrayInputStream0).when(jsonDeserializer1).deserialize(any(com.fasterxml.jackson.core.JsonParser.class) , any(com.fasterxml.jackson.databind.DeserializationContext.class));
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, (ValueInstantiator) null, jsonDeserializer0, jsonDeserializer1, (NullValueProvider) null, boolean0);
ObjectMapper objectMapper0 = new ObjectMapper();
JsonFactory jsonFactory0 = new JsonFactory(objectMapper0);
File file0 = MockFile.createTempFile("JSON", (String) null);
JsonParser jsonParser0 = jsonFactory0.createParser(file0);
Vector<String> vector0 = new Vector<String>();
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
// Undeclared exception!
try {
stringCollectionDeserializer0.deserialize(jsonParser0, (DeserializationContext) defaultDeserializationContext_Impl0, (Collection<String>) vector0);
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// java.io.ByteArrayInputStream cannot be cast to java.lang.String
//
verifyException("com.fasterxml.jackson.databind.deser.std.StringCollectionDeserializer", e);
}
}
@Test(timeout = 4000)
public void test14() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
JsonFactory jsonFactory0 = new JsonFactory();
JsonParser jsonParser0 = jsonFactory0.createNonBlockingByteArrayParser();
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
LinkedHashSet<String> linkedHashSet0 = new LinkedHashSet<String>();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
JsonDeserializer<Module> jsonDeserializer0 = (JsonDeserializer<Module>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, jsonDeserializer0, valueInstantiator_Base0);
StdSubtypeResolver stdSubtypeResolver0 = new StdSubtypeResolver();
RootNameLookup rootNameLookup0 = new RootNameLookup();
ConfigOverrides configOverrides0 = new ConfigOverrides();
DeserializationConfig deserializationConfig0 = new DeserializationConfig((BaseSettings) null, stdSubtypeResolver0, (SimpleMixInResolver) null, rootNameLookup0, configOverrides0);
ContextAttributes contextAttributes0 = ContextAttributes.getEmpty();
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, contextAttributes0, false);
PipedReader pipedReader0 = new PipedReader(3);
ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0);
CharsToNameCanonicalizer charsToNameCanonicalizer0 = CharsToNameCanonicalizer.createRoot();
ReaderBasedJsonParser readerBasedJsonParser0 = new ReaderBasedJsonParser(iOContext0, 2443, pipedReader0, objectMapper0, charsToNameCanonicalizer0);
DefaultDeserializationContext defaultDeserializationContext0 = defaultDeserializationContext_Impl0.createInstance(deserializationConfig0, readerBasedJsonParser0, (InjectableValues) null);
try {
stringCollectionDeserializer0.deserialize(jsonParser0, (DeserializationContext) defaultDeserializationContext0, (Collection<String>) linkedHashSet0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// Unexpected end-of-input when binding data into `java.lang.Object`
// at [Source: UNKNOWN; line: 1, column: 0]
//
verifyException("com.fasterxml.jackson.databind.exc.MismatchedInputException", e);
}
}
@Test(timeout = 4000)
public void test15() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
Boolean boolean0 = Boolean.TRUE;
JsonDeserializer<JavaType> jsonDeserializer0 = (JsonDeserializer<JavaType>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
doReturn((Object) null).when(jsonDeserializer0).deserialize(any(com.fasterxml.jackson.core.JsonParser.class) , any(com.fasterxml.jackson.databind.DeserializationContext.class));
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, valueInstantiator_Base0, jsonDeserializer0, jsonDeserializer0, jsonDeserializer0, boolean0);
JsonFactory jsonFactory0 = new JsonFactory();
JsonParser jsonParser0 = jsonFactory0.createNonBlockingByteArrayParser();
JsonParserSequence jsonParserSequence0 = JsonParserSequence.createFlattened(true, jsonParser0, jsonParser0);
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
RootNameLookup rootNameLookup0 = new RootNameLookup();
ConfigOverrides configOverrides0 = new ConfigOverrides();
DeserializationConfig deserializationConfig0 = new DeserializationConfig((BaseSettings) null, (SubtypeResolver) null, (SimpleMixInResolver) null, rootNameLookup0, configOverrides0);
DeserializationProblemHandler deserializationProblemHandler0 = mock(DeserializationProblemHandler.class, new ViolatedAssumptionAnswer());
doReturn(beanDeserializerFactory0).when(deserializationProblemHandler0).handleMissingInstantiator(any(com.fasterxml.jackson.databind.DeserializationContext.class) , any(java.lang.Class.class) , any(com.fasterxml.jackson.databind.deser.ValueInstantiator.class) , any(com.fasterxml.jackson.core.JsonParser.class) , anyString());
DeserializationConfig deserializationConfig1 = deserializationConfig0.withHandler(deserializationProblemHandler0);
HashMap<String, Object> hashMap0 = new HashMap<String, Object>();
InjectableValues.Std injectableValues_Std0 = new InjectableValues.Std(hashMap0);
DefaultDeserializationContext defaultDeserializationContext0 = defaultDeserializationContext_Impl0.createInstance(deserializationConfig1, jsonParser0, injectableValues_Std0);
// Undeclared exception!
try {
stringCollectionDeserializer0.deserialize((JsonParser) jsonParserSequence0, (DeserializationContext) defaultDeserializationContext0);
fail("Expecting exception: ClassCastException");
} catch(ClassCastException e) {
//
// com.fasterxml.jackson.databind.deser.BeanDeserializerFactory cannot be cast to java.util.Collection
//
verifyException("com.fasterxml.jackson.databind.deser.std.StringCollectionDeserializer", e);
}
}
@Test(timeout = 4000)
public void test16() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
JavaType javaType0 = TypeFactory.unknownType();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, (JsonDeserializer<?>) null, valueInstantiator_Base0);
BeanProperty.Bogus beanProperty_Bogus0 = new BeanProperty.Bogus();
// Undeclared exception!
try {
stringCollectionDeserializer0.createContextual(defaultDeserializationContext_Impl0, beanProperty_Bogus0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.DeserializationContext", e);
}
}
@Test(timeout = 4000)
public void test17() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer((JavaType) null, (JsonDeserializer<?>) null, (ValueInstantiator) null);
Boolean boolean0 = Boolean.TRUE;
TypeFactory typeFactory0 = TypeFactory.defaultInstance();
Class<LinkedList> class0 = LinkedList.class;
CollectionType collectionType0 = typeFactory0.constructCollectionType(class0, class0);
StringCollectionDeserializer stringCollectionDeserializer1 = new StringCollectionDeserializer(collectionType0, (ValueInstantiator) null, (JsonDeserializer<?>) null, stringCollectionDeserializer0, (NullValueProvider) null, boolean0);
BeanProperty.Bogus beanProperty_Bogus0 = new BeanProperty.Bogus();
// Undeclared exception!
try {
stringCollectionDeserializer1.createContextual(defaultDeserializationContext_Impl0, beanProperty_Bogus0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.deser.std.StringCollectionDeserializer", e);
}
}
@Test(timeout = 4000)
public void test18() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
Boolean boolean0 = Boolean.TRUE;
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer((JavaType) null, (ValueInstantiator) null, (JsonDeserializer<?>) null, (JsonDeserializer<?>) null, (NullValueProvider) null, boolean0);
ObjectMapper objectMapper0 = new ObjectMapper();
JsonFactory jsonFactory0 = new JsonFactory(objectMapper0);
File file0 = MockFile.createTempFile("6IF|pz62xG", "JSON");
JsonParser jsonParser0 = jsonFactory0.createParser(file0);
Vector<String> vector0 = new Vector<String>();
// Undeclared exception!
try {
stringCollectionDeserializer0.deserialize(jsonParser0, (DeserializationContext) defaultDeserializationContext_Impl0, (Collection<String>) vector0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.DeserializationContext", e);
}
}
@Test(timeout = 4000)
public void test19() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
JsonFactory jsonFactory0 = new JsonFactory();
JsonParser jsonParser0 = jsonFactory0.createNonBlockingByteArrayParser();
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
LinkedHashSet<String> linkedHashSet0 = new LinkedHashSet<String>();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
JsonDeserializer<Module> jsonDeserializer0 = (JsonDeserializer<Module>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
doReturn((Object) null).when(jsonDeserializer0).deserialize(any(com.fasterxml.jackson.core.JsonParser.class) , any(com.fasterxml.jackson.databind.DeserializationContext.class));
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, jsonDeserializer0, valueInstantiator_Base0);
StdSubtypeResolver stdSubtypeResolver0 = new StdSubtypeResolver();
RootNameLookup rootNameLookup0 = new RootNameLookup();
ConfigOverrides configOverrides0 = new ConfigOverrides();
DeserializationConfig deserializationConfig0 = new DeserializationConfig((BaseSettings) null, stdSubtypeResolver0, (SimpleMixInResolver) null, rootNameLookup0, configOverrides0);
ContextAttributes contextAttributes0 = ContextAttributes.getEmpty();
DeserializationFeature deserializationFeature0 = DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY;
DeserializationConfig deserializationConfig1 = deserializationConfig0.with(deserializationFeature0);
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, contextAttributes0, false);
PipedReader pipedReader0 = new PipedReader(3);
DefaultSerializerProvider.Impl defaultSerializerProvider_Impl0 = new DefaultSerializerProvider.Impl();
ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0, defaultSerializerProvider_Impl0, defaultDeserializationContext_Impl0);
CharsToNameCanonicalizer charsToNameCanonicalizer0 = CharsToNameCanonicalizer.createRoot();
ReaderBasedJsonParser readerBasedJsonParser0 = new ReaderBasedJsonParser(iOContext0, 2443, pipedReader0, objectMapper0, charsToNameCanonicalizer0);
DefaultDeserializationContext defaultDeserializationContext0 = defaultDeserializationContext_Impl0.createInstance(deserializationConfig1, readerBasedJsonParser0, (InjectableValues) null);
Collection<String> collection0 = stringCollectionDeserializer0.deserialize(jsonParser0, (DeserializationContext) defaultDeserializationContext0, (Collection<String>) linkedHashSet0);
assertNotNull(collection0);
}
@Test(timeout = 4000)
public void test20() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
JavaType javaType0 = TypeFactory.unknownType();
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, (JsonDeserializer<?>) null, (ValueInstantiator) null);
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
Stack<String> stack0 = new Stack<String>();
Boolean boolean0 = Boolean.valueOf(false);
StringCollectionDeserializer stringCollectionDeserializer1 = new StringCollectionDeserializer(javaType0, valueInstantiator_Base0, stringCollectionDeserializer0, stringCollectionDeserializer0, stringCollectionDeserializer0, boolean0);
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, boolean0, false);
PipedReader pipedReader0 = new PipedReader();
JsonFactory jsonFactory0 = new JsonFactory();
DefaultSerializerProvider.Impl defaultSerializerProvider_Impl0 = new DefaultSerializerProvider.Impl();
ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0, defaultSerializerProvider_Impl0, defaultDeserializationContext_Impl0);
CharsToNameCanonicalizer charsToNameCanonicalizer0 = CharsToNameCanonicalizer.createRoot();
ReaderBasedJsonParser readerBasedJsonParser0 = new ReaderBasedJsonParser(iOContext0, 0, pipedReader0, objectMapper0, charsToNameCanonicalizer0);
// Undeclared exception!
try {
stringCollectionDeserializer1.deserialize((JsonParser) readerBasedJsonParser0, (DeserializationContext) defaultDeserializationContext_Impl0, (Collection<String>) stack0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.DeserializationContext", e);
}
}
@Test(timeout = 4000)
public void test21() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, (JsonDeserializer<?>) null, (ValueInstantiator) null);
Boolean boolean0 = new Boolean("");
StringCollectionDeserializer stringCollectionDeserializer1 = new StringCollectionDeserializer(javaType0, (ValueInstantiator) null, stringCollectionDeserializer0, (JsonDeserializer<?>) null, stringCollectionDeserializer0, boolean0);
boolean boolean1 = stringCollectionDeserializer1.isCachable();
assertFalse(boolean1);
assertTrue(stringCollectionDeserializer0.isCachable());
}
@Test(timeout = 4000)
public void test22() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
JsonDeserializer<JsonDeserializer<String>> jsonDeserializer0 = (JsonDeserializer<JsonDeserializer<String>>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, jsonDeserializer0, (ValueInstantiator) null);
boolean boolean0 = stringCollectionDeserializer0.isCachable();
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test23() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
JsonDeserializer<ObjectReader> jsonDeserializer0 = (JsonDeserializer<ObjectReader>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, valueInstantiator_Base0, jsonDeserializer0, jsonDeserializer0, jsonDeserializer0, (Boolean) null);
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
BeanProperty.Bogus beanProperty_Bogus0 = new BeanProperty.Bogus();
JsonDeserializer<?> jsonDeserializer1 = stringCollectionDeserializer0.createContextual(defaultDeserializationContext_Impl0, beanProperty_Bogus0);
assertFalse(jsonDeserializer1.isCachable());
assertNotSame(stringCollectionDeserializer0, jsonDeserializer1);
}
@Test(timeout = 4000)
public void test24() throws Throwable {
JsonFactory jsonFactory0 = new JsonFactory();
ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0);
HashMap<String, Object> hashMap0 = new HashMap<String, Object>();
InjectableValues.Std injectableValues_Std0 = new InjectableValues.Std(hashMap0);
ObjectReader objectReader0 = objectMapper0.reader((InjectableValues) injectableValues_Std0);
Class<BasicBeanDescription> class0 = BasicBeanDescription.class;
ObjectReader objectReader1 = objectReader0.forType(class0);
assertFalse(objectReader1.equals((Object)objectReader0));
}
@Test(timeout = 4000)
public void test25() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, (JsonDeserializer<?>) null, (ValueInstantiator) null);
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, bufferRecycler0, false);
PipedReader pipedReader0 = new PipedReader(2);
ObjectMapper objectMapper0 = new ObjectMapper((JsonFactory) null);
CharsToNameCanonicalizer charsToNameCanonicalizer0 = CharsToNameCanonicalizer.createRoot();
ReaderBasedJsonParser readerBasedJsonParser0 = new ReaderBasedJsonParser(iOContext0, 1, pipedReader0, objectMapper0, charsToNameCanonicalizer0);
DeserializationContext deserializationContext0 = objectMapper0.getDeserializationContext();
TypeFactory typeFactory0 = TypeFactory.defaultInstance();
ClassNameIdResolver classNameIdResolver0 = new ClassNameIdResolver(javaType0, typeFactory0);
AsArrayTypeDeserializer asArrayTypeDeserializer0 = new AsArrayTypeDeserializer(javaType0, classNameIdResolver0, "tpu5-/", false, javaType0);
try {
stringCollectionDeserializer0.deserializeWithType(readerBasedJsonParser0, deserializationContext0, asArrayTypeDeserializer0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// Could not resolve type id 'java.lang.Object' as a subtype of [simple type, class java.lang.Object]: problem: (java.lang.NullPointerException) null
//
verifyException("com.fasterxml.jackson.databind.exc.InvalidTypeIdException", e);
}
}
@Test(timeout = 4000)
public void test26() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
JsonDeserializer<JsonDeserializer<String>> jsonDeserializer0 = (JsonDeserializer<JsonDeserializer<String>>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
StringCollectionDeserializer stringCollectionDeserializer0 = new StringCollectionDeserializer(javaType0, jsonDeserializer0, (ValueInstantiator) null);
stringCollectionDeserializer0.getValueInstantiator();
assertFalse(stringCollectionDeserializer0.isCachable());
}
}
|
[
"[email protected]"
] | |
37f84c2509883d7195ac27f2225a22651f35d9dc
|
8f16dc5803d6eeea3b06de993cd09c4032a2afd6
|
/80.删除排序数组中的重复项-ii.java
|
2950d6363c67f25842326d5f4f5fc0c28a0b07a7
|
[] |
no_license
|
pongshy/LeetCode
|
2b3976972930eabd5af7b548a9f981327e267288
|
26f9ceec33aa58ed287fea86192b9b6753ae9a24
|
refs/heads/master
| 2022-12-04T05:53:30.620246 | 2020-08-31T08:47:47 | 2020-08-31T08:47:47 | 286,688,362 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 793 |
java
|
/*
* @lc app=leetcode.cn id=80 lang=java
*
* [80] 删除排序数组中的重复项 II
*/
// @lc code=start
class Solution {
public int removeDuplicates(int[] nums) {
// Result: Accepted
// two-pointers
// Your runtime beats 97.82 % of java submissions
// Your memory usage beats 12 % of java submissions (40.2 MB)
int p1 = 1;
int count = 1;
int n = nums.length;
if (n == 0) {
return 0;
}
for (int p2 = 1; p2 < n; ++p2) {
if (nums[p2] == nums[p2 - 1]) {
count++;
} else {
count = 1;
}
if (count <= 2) {
nums[p1++] = nums[p2];
}
}
return p1;
}
}
// @lc code=end
|
[
"[email protected]"
] | |
4ccca241f7c4ec2fc672a36c11d5b7ea538fcf8c
|
69bb2c3f6e921c35758b2ec7a687124125f85467
|
/src/com/alprojects/oldapi/StudentService.java
|
46679791da08b3b48578abe0ea775c086ec7cbdf
|
[] |
no_license
|
githubwalker/Studs
|
82cabd1887e6aac23e49ae1fe2ae2685e1cb0c06
|
d1addb66de98c8bc9b42fc9c0fec4ca1c9f9ec30
|
refs/heads/master
| 2022-12-28T18:07:43.122914 | 2020-01-18T21:52:31 | 2020-01-18T21:52:31 | 58,858,325 | 1 | 0 | null | 2022-12-15T23:30:12 | 2016-05-15T11:33:50 |
CSS
|
UTF-8
|
Java
| false | false | 5,523 |
java
|
package com.alprojects.oldapi;
import java.io.IOException;
import javax.servlet.ServletContext;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
import com.alprojects.data.JsonBuilder;
import com.alprojects.data.Student;
import com.alprojects.data.StudentJdbcDAO;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import com.sun.jersey.api.client.ClientResponse.Status;
// http://www.simplecodestuffs.com/ajax-based-crud-operations-in-jsp-and-servlet-using-jtable-jquery-plug-in/
// http://stackoverflow.com/questions/21415413/access-file-inside-webcontent-from-servlet
// http://localhost:8080/StudentService/crunchify/students
// REST
// http://www.programming-free.com/2013/08/ajax-based-crud-operations-in-java-web.html
// https://github.com/hikalkan/jtable/issues/772
// http://crunchify.com/create-very-simple-jersey-rest-service-and-send-json-data-from-java-client/
// https://www.nabisoft.com/tutorials/java-ee/producing-and-consuming-json-or-xml-in-java-rest-services-with-jersey-and-jackson
// AUTH
// http://devcolibri.com/3810
@Path("/students")
public class StudentService {
private StudentJdbcDAO studDAO;
public StudentService( @Context ServletContext ctx ) {
String strPath = ctx.getRealPath("/WEB-INF/jdbc.xml");
ApplicationContext context =
new FileSystemXmlApplicationContext(strPath);
studDAO = (StudentJdbcDAO) context.getBean("studentJDBCDAO");
}
private static String nonnull( String str ) { return str == null ? "<null>" : str;}
private static Integer nonnull( Integer intgr )
{
return intgr == null ? 0 : intgr;
}
@POST
@Produces(MediaType.APPLICATION_JSON)
@Path("/getPage/{startIndex}/{numberItems}")
public Response getPage(
@PathParam("startIndex") Integer startIndex,
@PathParam("numberItems") Integer numberItems
)
{
try {
Integer nStuds = studDAO.getTotalStudents();
String strResponse = new JsonBuilder()
.add("Result", "OK" )
.add("TotalRecordCount", nStuds )
.add( "Records", studDAO.listStudentsPaged(startIndex, numberItems) )
.build();
return Response.ok(strResponse, MediaType.APPLICATION_JSON).build();
} catch (IOException e) {
e.printStackTrace();
if ( e instanceof JsonProcessingException )
{
System.out.println("Unsupported media type");
return Response.status(Status.UNSUPPORTED_MEDIA_TYPE).build();
}
}
return Response.serverError().build();
}
@POST
@Produces(MediaType.APPLICATION_JSON)
@Path("/getall")
public Response getStudents()
{
try {
String strResponse = new JsonBuilder()
.add("Result", "OK" )
.add("Records", studDAO.listStudents())
.build();
return Response.ok(strResponse, MediaType.APPLICATION_JSON).build();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return Response.serverError().build();
}
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/append")
public Response appendStudent(
String strstud
) {
System.out.println( "appendStudent. object received : " + nonnull(strstud) );
ObjectMapper mapper = new ObjectMapper();
StudentAdd sa;
try {
sa = mapper.readValue(strstud, StudentAdd.class);
int id = studDAO.create(sa.getName(), sa.getAge());
Student stud = new Student(id, sa.getName(), sa.getAge());
String strResponse = new JsonBuilder()
.add( "Result", "OK" )
.add( "Record", stud )
.build();
return Response.ok(strResponse, MediaType.APPLICATION_JSON).build();
} catch (IOException e) {
if ( e instanceof JsonProcessingException )
{
System.out.println("Unsupported media type");
e.printStackTrace();
return Response.status(Status.UNSUPPORTED_MEDIA_TYPE).build();
}
}
return Response.serverError().build();
}
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/update/{id}")
public Response updateStudent(
@PathParam("id") Integer id,
String strstud
) {
System.out.println( "updateStudent. object received : " + nonnull(strstud) );
ObjectMapper mapper = new ObjectMapper();
Student stud_in;
try {
stud_in = mapper.readValue(strstud, Student.class);
studDAO.update( id, stud_in.getName(), stud_in.getAge() );
String strResponse = new JsonBuilder()
.add( "Result", "OK" )
.add( "Record", stud_in )
.build();
return Response.ok(strResponse, MediaType.APPLICATION_JSON).build();
} catch (IOException e) {
if ( e instanceof JsonProcessingException )
{
System.out.println("Unsupported media type");
e.printStackTrace();
return Response.status(Status.UNSUPPORTED_MEDIA_TYPE).build();
}
}
return Response.serverError().build();
}
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/delete/{id}")
public Response deleteStudent(
@PathParam("id") Integer id
)
{
System.out.println( "deleteStudent. id received : " + nonnull(id) );
try {
studDAO.delete( id );
String strResponse = new JsonBuilder()
.add( "Result", "OK" )
.build();
return Response.ok(strResponse, MediaType.APPLICATION_JSON).build();
} catch (Exception e) {
// something wrong happened
}
return Response.serverError().build();
}
}
|
[
"[email protected]"
] | |
c8dc130f494330718157dff109109f3d9b391a0d
|
a3e9c134e5b47a912c22775c98b7aeb57a32639b
|
/DoubleKnapsack.java
|
9baa99720b3de837c5e0842f0b34d310632611dd
|
[] |
no_license
|
abhishekphere/Analysis-Of-Algorithms
|
c52d3e1ab81ac3aed8c773bd42929de806136e09
|
b42590fddcdb1f7386dc475224158362460d8cfb
|
refs/heads/master
| 2021-04-08T08:23:31.165674 | 2020-03-20T13:12:19 | 2020-03-20T13:12:19 | 248,757,834 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,843 |
java
|
/**
* Donut.java
*
* Version:
* v1.2, 2/27/2018, 16:11:09
*
* Initial revision
*/
/**
* This program determines the maximum cost possible when splitting the n items in two different bags of weights W1 and W2 respectively.
*
* @author Patil, Abhishek Sanjay
*
*/
//importing the module
import java.util.Scanner;
public class DoubleKnapsack {
//function to return the maximum of the two values
public static int maximum(int i, int j)
{
int result = Math.max(i, j);
return result;
}
//function to initialize the 3-dimensional array and return the same.
public static int[][][] init(int items[][], int W1, int W2)
{
int n = items.length;
int S[][][] = new int[n + 1][W1 + 1][W2 + 1];
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= W1; j++) {
for (int k = 0; k <= W2; k++) {
S[i][0][0] = 0;
S[i][0][k] = 0;
S[i][j][0] = 0;
}
}
}
return S;
}
//the main function to calculate the maximum cost
public static int knapsack(int S[][][], int items[][], int W1, int W2)
{
int n = items.length;
for (int i = 1; i <n; i++) {
for (int j = 0; j <= W1; j++) {
for (int k = 0; k <= W2; k++) {
S[i][j][k] = S[i - 1][j][k];
if (items[i][0] <= j && items[i][0] <= k){
S[i][j][k] = maximum((maximum(((S[i - 1][j - items[i][0]][k]) + items[i][1]), ((S[i - 1][j][k - items[i][0]]) + items[i][1]))), S[i - 1][j][k]);
}
else if (items[i][0] <= j &&items[i][0]> k ){
S[i][j][k] = maximum((((S[i - 1][j - items[i][0]][k]) + items[i][1])), S[i - 1][j][k]);
}
else if(items[i][0] <= k &&items[i][0] > j ){
S[i][j][k] = maximum((S[i - 1][j][k - items[i][0]] + items[i][1]), S[i - 1][j][k]);
}
}
}
}
return S[n-1][W1][W2];
}
public static void main(String args[])
{
//taking the items, W1 and W2 as input from the user
int n, W1, W2;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
int[][] items = new int[n+1][2];
W1 = sc.nextInt();
W2 = sc.nextInt();
items[0][0]=0;
items[0][1]=0;
for (int x = 1; x <= n; x++) {
for (int y = 0; y < 2; y++) {
items[x][y] = sc.nextInt();
}
}
//calling the different functions
int S[][][]= init(items, W1, W2);
int result = knapsack(S, items, W1, W2);
//Printing the required
System.out.println(result);
}
}
|
[
"[email protected]"
] | |
aa050b65b6d204bf5799512009ed011fd7511e41
|
de2eff0e71efe69175d7e54889d84d449d6ed974
|
/ext-api/src/main/java/org/omg/dds/NOT_NEW_VIEW_STATE.java
|
c0389c055e630336170ba4c4f8c1741ae3762962
|
[] |
no_license
|
mmusgrov/corba
|
bb266f631ebdcbabb4719f7d70cb8c766609a3e5
|
03d993498b68d745018061b39196e7818e0fe64d
|
refs/heads/master
| 2021-01-18T10:42:20.114343 | 2013-01-22T06:02:07 | 2013-01-22T06:02:07 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 242 |
java
|
package org.omg.dds;
/**
* Generated from IDL const "NOT_NEW_VIEW_STATE".
*
* @author JacORB IDL compiler V 2.3.1, 27-May-2009
* @version generated at 10/01/2013 11:46:18 AM
*/
public interface NOT_NEW_VIEW_STATE
{
int value = 1<<1;
}
|
[
"[email protected]"
] | |
8fd01b0bc30d4f28596dd2631cce3be0adc03ac8
|
f3f067c85c341134bce70a9fa5618d1285ee3059
|
/app/src/main/java/com/nust/socialapp/linphone/compatibility/ApiTwentyEightPlus.java
|
51a97152fe454ecababad24910e4f432a952fd86
|
[
"Apache-2.0"
] |
permissive
|
FahadZaheerfzr/OurSocialApp
|
c4e17d66cd30dbea5fb6defd7d8a243134ff4fac
|
7388de50cb9b7c615d275705faf8e9a7c51bcacb
|
refs/heads/master
| 2022-12-08T01:59:42.529927 | 2020-08-29T13:35:37 | 2020-08-29T13:35:37 | 291,121,744 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,866 |
java
|
/*
* Copyright (c) 2010-2019 Belledonne Communications SARL.
*
* This file is part of linphone-android
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nust.socialapp.linphone.compatibility;
import android.annotation.TargetApi;
import android.app.ActivityManager;
import android.app.Notification;
import android.app.PendingIntent;
import android.app.Person;
import android.app.RemoteInput;
import android.app.usage.UsageStatsManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.Icon;
import com.nust.socialapp.R;
import com.nust.socialapp.linphone.notifications.*;
import static com.nust.socialapp.linphone.compatibility.Compatibility.CHAT_NOTIFICATIONS_GROUP;
import static com.nust.socialapp.linphone.compatibility.Compatibility.INTENT_LOCAL_IDENTITY;
import static com.nust.socialapp.linphone.compatibility.Compatibility.INTENT_MARK_AS_READ_ACTION;
import static com.nust.socialapp.linphone.compatibility.Compatibility.INTENT_NOTIF_ID;
import static com.nust.socialapp.linphone.compatibility.Compatibility.INTENT_REPLY_NOTIF_ACTION;
import static com.nust.socialapp.linphone.compatibility.Compatibility.KEY_TEXT_REPLY;
@TargetApi(28)
class ApiTwentyEightPlus {
public static Notification createMessageNotification(
Context context, Notifiable notif, Bitmap contactIcon, PendingIntent intent) {
Person me = new Person.Builder().setName(notif.getMyself()).build();
Notification.MessagingStyle style = new Notification.MessagingStyle(me);
for (NotifiableMessage message : notif.getMessages()) {
Icon userIcon = null;
if (message.getSenderBitmap() != null) {
userIcon = Icon.createWithBitmap(message.getSenderBitmap());
}
Person.Builder builder = new Person.Builder().setName(message.getSender());
if (userIcon != null) {
builder.setIcon(userIcon);
}
Person user = builder.build();
Notification.MessagingStyle.Message msg =
new Notification.MessagingStyle.Message(
message.getMessage(), message.getTime(), user);
if (message.getFilePath() != null)
msg.setData(message.getFileMime(), message.getFilePath());
style.addMessage(msg);
}
if (notif.isGroup()) {
style.setConversationTitle(notif.getGroupTitle());
}
style.setGroupConversation(notif.isGroup());
return new Notification.Builder(
context, context.getString(R.string.notification_channel_id))
.setSmallIcon(R.drawable.topbar_chat_notification)
.setAutoCancel(true)
.setContentIntent(intent)
.setDefaults(
Notification.DEFAULT_SOUND
| Notification.DEFAULT_VIBRATE
| Notification.DEFAULT_LIGHTS)
.setLargeIcon(contactIcon)
.setCategory(Notification.CATEGORY_MESSAGE)
.setGroup(CHAT_NOTIFICATIONS_GROUP)
.setVisibility(Notification.VISIBILITY_PRIVATE)
.setPriority(Notification.PRIORITY_HIGH)
.setNumber(notif.getMessages().size())
.setWhen(System.currentTimeMillis())
.setShowWhen(true)
.setColor(context.getColor(R.color.notification_led_color))
.setStyle(style)
.addAction(Compatibility.getReplyMessageAction(context, notif))
.addAction(Compatibility.getMarkMessageAsReadAction(context, notif))
.build();
}
public static boolean isAppUserRestricted(Context context) {
ActivityManager activityManager =
(ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
return activityManager.isBackgroundRestricted();
}
public static int getAppStandbyBucket(Context context) {
UsageStatsManager usageStatsManager =
(UsageStatsManager) context.getSystemService(Context.USAGE_STATS_SERVICE);
return usageStatsManager.getAppStandbyBucket();
}
public static String getAppStandbyBucketNameFromValue(int bucket) {
switch (bucket) {
case UsageStatsManager.STANDBY_BUCKET_ACTIVE:
return "STANDBY_BUCKET_ACTIVE";
case UsageStatsManager.STANDBY_BUCKET_FREQUENT:
return "STANDBY_BUCKET_FREQUENT";
case UsageStatsManager.STANDBY_BUCKET_RARE:
return "STANDBY_BUCKET_RARE";
case UsageStatsManager.STANDBY_BUCKET_WORKING_SET:
return "STANDBY_BUCKET_WORKING_SET";
}
return null;
}
public static Notification.Action getReplyMessageAction(Context context, Notifiable notif) {
String replyLabel = context.getResources().getString(R.string.notification_reply_label);
RemoteInput remoteInput =
new RemoteInput.Builder(KEY_TEXT_REPLY).setLabel(replyLabel).build();
Intent replyIntent = new Intent(context, NotificationBroadcastReceiver.class);
replyIntent.setAction(INTENT_REPLY_NOTIF_ACTION);
replyIntent.putExtra(INTENT_NOTIF_ID, notif.getNotificationId());
replyIntent.putExtra(INTENT_LOCAL_IDENTITY, notif.getLocalIdentity());
PendingIntent replyPendingIntent =
PendingIntent.getBroadcast(
context,
notif.getNotificationId(),
replyIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
return new Notification.Action.Builder(
R.drawable.chat_send_over,
context.getString(R.string.notification_reply_label),
replyPendingIntent)
.addRemoteInput(remoteInput)
.setAllowGeneratedReplies(true)
.setSemanticAction(Notification.Action.SEMANTIC_ACTION_REPLY)
.build();
}
public static Notification.Action getMarkMessageAsReadAction(
Context context, Notifiable notif) {
Intent markAsReadIntent = new Intent(context, NotificationBroadcastReceiver.class);
markAsReadIntent.setAction(INTENT_MARK_AS_READ_ACTION);
markAsReadIntent.putExtra(INTENT_NOTIF_ID, notif.getNotificationId());
markAsReadIntent.putExtra(INTENT_LOCAL_IDENTITY, notif.getLocalIdentity());
PendingIntent markAsReadPendingIntent =
PendingIntent.getBroadcast(
context,
notif.getNotificationId(),
markAsReadIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
return new Notification.Action.Builder(
R.drawable.chat_send_over,
context.getString(R.string.notification_mark_as_read_label),
markAsReadPendingIntent)
.setSemanticAction(Notification.Action.SEMANTIC_ACTION_MARK_AS_READ)
.build();
}
}
|
[
"[email protected]"
] | |
f107ecb1e111ea648abcf2b5638ea403fd129c0d
|
45471ad5fd41b4cfa0deff2ed64e370ec6f221ce
|
/src/main/java/br/com/pedidos/repository/FormaDePagamentoRepository.java
|
f88fbcaebc962ce36add6e1fd6f0c94ad13e75cb
|
[] |
no_license
|
adbys/ControlePedidos
|
ea28473b362dd0aa94bc700855057f121c712542
|
278775ea54b355d156ef439418ecd7ac1f2941b0
|
refs/heads/master
| 2021-09-06T20:17:01.956724 | 2018-02-02T14:31:43 | 2018-02-02T14:31:43 | 105,637,860 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 241 |
java
|
package br.com.pedidos.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import br.com.pedidos.model.FormaDePagamento;
public interface FormaDePagamentoRepository extends JpaRepository<FormaDePagamento, Long> {
}
|
[
"[email protected]"
] | |
e189a15032dc6d1164b00ac66b34e746ea7938e3
|
335f785d3eaf1e4d370f5a19693a9f208aab957f
|
/src/main/java/fr/jhagai/consumerpublisher/ConsumerPublisherApplication.java
|
ba5e6605df804eedf7841dae92f6b17a39783db9
|
[] |
no_license
|
jhagai/consumer-receiver
|
3736e65ba38a217774fd2faccc11ecb524ec7583
|
62b664212dafa0fe5bd58fd821f33aac53bd9bd4
|
refs/heads/master
| 2022-11-21T22:38:08.549650 | 2020-07-28T10:14:07 | 2020-07-28T10:14:07 | 283,174,236 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,271 |
java
|
package fr.jhagai.consumerpublisher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Slf4j
@SpringBootApplication
public class ConsumerPublisherApplication {
public static void main(String[] args) {
final ConfigurableApplicationContext run = SpringApplication.run(ConsumerPublisherApplication.class, args);
final MyEntityService bean = run.getBean(MyEntityService.class);
final ThroughputMeasure measure = run.getBean(ThroughputMeasure.class);
ExecutorService executorInserts = Executors.newFixedThreadPool(1);
executorInserts.execute(
() -> {
while (true) {
MyEntity myEntity = new MyEntity();
bean.save(myEntity);
log.info("Saved {}", myEntity.getId());
measure.saved.incrementAndGet();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
);
int nbThreads = 2;
ExecutorService executorProcess = Executors.newFixedThreadPool(nbThreads);
for (int i = 0; i < nbThreads; i++) {
executorProcess.execute(
() -> {
while (true) {
log.info("---- START ----");
bean.process();
measure.processed.incrementAndGet();
log.info("---- END ----");
}
}
);
}
try {
Thread.sleep(20000);
} catch (InterruptedException e) {
e.printStackTrace();
}
log.info("----- MEASURES ------");
log.info("SAVED {}", measure.saved.get());
log.info("PROCESSED {}", measure.processed.get());
System.exit(0);
}
}
|
[
"[email protected]"
] | |
5cf587ebc9b19a985ac92f846bef5c0bc442d789
|
e6f35161a0991b2bc2b34d25ca790bd28e67b5f0
|
/src/InputUtils.java
|
6ba5d9283373440461910c4e9a80afe239aac5f5
|
[] |
no_license
|
jeromegauzins/SlickAndroidConverter
|
8e5b02462755dc984f2c76fe77d29fe2c81d8082
|
961605dfec89a39143ff36c6d5474b10312962c7
|
refs/heads/master
| 2021-09-24T10:40:48.888653 | 2018-10-08T13:05:12 | 2018-10-08T13:05:12 | 105,533,437 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 759 |
java
|
public class InputUtils {
public static String getDefaultAndroidInput(String key){
String indexInput = "Input.";
if(key.contains("KEY_DOWN")) indexInput += "BUTTON_DOWN";
else if(key.contains("KEY_UP")) indexInput += "BUTTON_UP";
else if(key.contains("KEY_LEFT"))indexInput += "BUTTON_LEFT";
else if(key.contains("KEY_RIGHT"))indexInput += "BUTTON_RIGHT";
else if(key.contains("KEY_ESCAPE"))indexInput += "BUTTON_BACK";
else if(key.contains("KEY_BACK"))indexInput += "BUTTON_BACK";
else if(key.contains("KEY_SPACE"))indexInput += "PRESS_SCREEN_DOWN";
else if(key.contains("KEY_ENTER"))indexInput += "PRESS_SCREEN_DOWN";
else if(key.contains("KEY_S"))indexInput += "BUTTON_1";
else indexInput += "NONE";
return indexInput;
}
}
|
[
"[email protected]"
] | |
48b63ed988b7bcc656fc757264239cbdfe6da105
|
e80671acd3f690ea71367fb37bc8beb38eb92f0b
|
/CentiScaPe2.1NRNB/src/main/java/org/cytoscape/centiscape/internal/charts/CentPlotLineNodesByNetworks.java
|
f63d1c883b348b5feee9027017a28ed978370a5f
|
[] |
no_license
|
nrnb/nrnbacademy2015sakshi
|
b9998e4fb39301c1cc12d3f0d83ef75c51c078d4
|
3a3ac4e7a9b0675f0c19a48949ac4f6f68b413d6
|
refs/heads/master
| 2020-05-18T05:12:07.729275 | 2015-08-27T01:42:01 | 2015-08-27T01:42:01 | 41,709,017 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,062 |
java
|
package org.cytoscape.centiscape.internal.charts;
import java.awt.Color;
import java.awt.GradientPaint;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JPanel;
import org.cytoscape.centiscape.internal.visualizer.CentVisualizer;
import org.cytoscape.centiscape.internal.visualizer.Centrality;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyRow;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.labels.CategoryToolTipGenerator;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.LineAndShapeRenderer;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
public class CentPlotLineNodesByNetworks extends JFrame {
ArrayList <String> centralityNames;
public ArrayList<CyNode> nodes;
// public static DefaultCategoryDataset dds = new DefaultCategoryDataset();
public LineAndShapeRenderer mybarrenderer;
// public static MyBarRenderer mybarrenderer;
public DefaultCategoryDataset dds = new DefaultCategoryDataset();
public List <CyNetwork> networks;
private final String plottype;
private final HashMap CentralityHashMap;
// polymorphic constructor
public CentPlotLineNodesByNetworks(List <CyNetwork> networks,ArrayList<CyNode> nodes,ArrayList <String> centralityNames,HashMap CentralityHashMap,String plottype) {
super("Plot By Node visualization");
this.networks = networks;
this.setDefaultCloseOperation(this.HIDE_ON_CLOSE);
this.centralityNames = centralityNames;
this.plottype=plottype;
this.CentralityHashMap=CentralityHashMap;
this.nodes = nodes;
JPanel jpanel = createDemoPanel();
setContentPane(jpanel);
}
private CategoryDataset createDataset() {
dds.clear();
int nodeSize=nodes.size();
int networkSize=networks.size();
int CentralitySize=centralityNames.size();
DefaultCategoryDataset defaultcategorydataset = new DefaultCategoryDataset();
double data[][]=new double[CentralitySize][networkSize+1];
boolean networkExists[]=new boolean[networkSize];
for(int i=0;i<networkSize;i++)
{
CyRow row=networks.get(i).getDefaultNodeTable().getRow(nodes.get(0).getSUID());
Double value=row.get(centralityNames.get(0), Double.class);
for(int k=1;k<nodeSize;k++)
{
if(value!=null)
break;
row =networks.get(i).getDefaultNodeTable().getRow(nodes.get(k).getSUID());
value=row.get(centralityNames.get(0), Double.class);
}
if(value!=null)
{
networkExists[i]=true;
double total=1;
for (int j=0;j<CentralitySize;j++)
{
if(plottype.equals("Norm by max"))
{
String name=centralityNames.get(0).split(" ")[0];
Vector v=(Vector)CentralityHashMap.get(networks.get(i));
for (int z=0;z<v.size();z++)
{
String n=((Centrality)v.get(j)).getName();
if(n.equals(name))
{
break;
}
}
total=((Centrality)v.get(j)).getMaxValue();
if(total==0)
total=1;
}
data[j][i]=row.get(centralityNames.get(j), Double.class)/total;
}
}
else
System.out.println("Not found");
}
for (int i=0;i<CentralitySize;i++) {
String centralityname = centralityNames.get(i);
for(int j=0;j<networkSize;j++)
{
if(networkExists[j]==true)
{
defaultcategorydataset.addValue(data[i][j], centralityname,networks.get(j).getDefaultNetworkTable().toString());
dds.addValue(data[i][j], centralityname,networks.get(j).getDefaultNetworkTable().toString());
}
}
}
return defaultcategorydataset;
// return null;
}
JFreeChart createChart(CategoryDataset categorydataset) {
// static JFreeChart createChart(CategoryDataset categorydataset) {
JFreeChart jfreechart = ChartFactory.createBarChart("Node chart", "centrality statistics", "Value", categorydataset, PlotOrientation.VERTICAL, true, true, false);
jfreechart.setBackgroundPaint(Color.white);
// plotting setup
CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
categoryplot.setBackgroundPaint(Color.lightGray);
categoryplot.setDomainGridlinePaint(Color.white);
categoryplot.setDomainGridlinesVisible(true);
categoryplot.setRangeGridlinePaint(Color.white);
NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis();
numberaxis.setStandardTickUnits(NumberAxis.createStandardTickUnits());
//bar renderer setup
mybarrenderer = new LineAndShapeRenderer ();
// permit bar outline marking
// mybarrenderer.setDrawBarOutline(true);
categoryplot.setRenderer(mybarrenderer);
// gradients for plots
for(int j=0;j<networks.size();j++)
{ int val=(int)(Math.random()*1000)%256;
GradientPaint gradientpaint = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, new Color(0, 0, val));
mybarrenderer.setSeriesPaint(0, gradientpaint);
}
return jfreechart;
}
public JPanel createDemoPanel() {
JFreeChart jfreechart = createChart(createDataset());
CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
LineAndShapeRenderer mybarrenderer = (LineAndShapeRenderer ) categoryplot.getRenderer();
JPanel chartPlaceholderPanel = new JPanel();
ChartPanel chartpanel = new ChartPanel(jfreechart);
chartPlaceholderPanel.add(chartpanel);
//tooltip setup
mybarrenderer.setToolTipGenerator(new CategoryToolTipGenerator() {
public CategoryDataset realValues = dds;
public String generateToolTip(CategoryDataset arg0, int arg1, int arg2) {
return (realValues.getValue(arg1, arg2).toString());
}
});
return chartPlaceholderPanel;
}
}
|
[
"[email protected]"
] | |
21e7de9f313cfd9e23d99640a558cf502c4391bd
|
61d3961e473ebc2f1334258f931e91977bd9530c
|
/java-implement/strategy/src/strategy/strategy.java
|
3dbbd0f95b013e77b8e65048ca80ceb9445b7aff
|
[] |
no_license
|
ENGLISH-LIGHT/23patterns
|
da96d4256d57431912c2c78bd55c00b9195f9f4f
|
34d61de2efb2072f395e630e820a249d87a602f1
|
refs/heads/master
| 2021-09-03T04:24:00.768224 | 2018-01-05T14:03:00 | 2018-01-05T14:03:00 | 115,706,696 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 86 |
java
|
package strategy;
public interface strategy {
public int excute(int a, int b);
}
|
[
"[email protected]"
] | |
278590dae8842c09037e257d5545d3b18bb61e4d
|
f7a748eb6803a9f2b609dad279e30513497fa0be
|
/src/com/facebook/buck/rules/macros/AbstractExecutableMacro.java
|
d115168f56d75fb04669a5e316d1987d8f42262d
|
[
"Apache-2.0"
] |
permissive
|
MMeunierSide/buck
|
a44937e207a92a8a8d5df06c1e65308aa2d42328
|
b1aa036a203acb8c4cf2898e0af2a1b88208d232
|
refs/heads/master
| 2020-03-09T23:25:38.016401 | 2018-04-11T04:11:59 | 2018-04-11T05:04:57 | 129,057,807 | 1 | 0 |
Apache-2.0
| 2018-04-11T08:06:36 | 2018-04-11T08:06:35 | null |
UTF-8
|
Java
| false | false | 841 |
java
|
/*
* Copyright 2017-present Facebook, Inc.
*
* 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.facebook.buck.rules.macros;
import com.facebook.buck.util.immutables.BuckStyleTuple;
import org.immutables.value.Value;
@Value.Immutable
@BuckStyleTuple
abstract class AbstractExecutableMacro extends BuildTargetMacro {}
|
[
"[email protected]"
] | |
b7314d598b7d38efcfff09c4afd7d6ab2bae7617
|
fa1f63ac494d3efdc18d62b2b58f5bab9b919361
|
/LangerPopulator/src/main/java/com/langer/client/config/interceptors/SecurityInterceptor.java
|
4060ee511430bdd59a0e165bcb340ecac633d30c
|
[] |
no_license
|
barakc82/langer
|
5e6a14669c8572aa2f6950cdfdd06e6e065c2379
|
a13d3a256854697abd24c775088834ee507cf2f1
|
refs/heads/master
| 2023-01-11T02:30:06.095100 | 2020-12-20T18:52:58 | 2020-12-20T18:52:58 | 195,468,128 | 0 | 0 | null | 2023-01-07T22:43:55 | 2019-07-05T21:16:23 |
Java
|
UTF-8
|
Java
| false | false | 568 |
java
|
package com.langer.client.config.interceptors;
import com.langer.server.api.LangerApiGlobal;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class SecurityInterceptor implements RequestInterceptor
{
@Value("${langer.security.client.secret}")
private String secret;
@Override
public void apply(RequestTemplate requestTemplate)
{
requestTemplate.header(LangerApiGlobal.HEADER_AUTH, secret);
}
}
|
[
"[email protected]"
] | |
570116c1d35bcece131a42e2e693b10a75f1e2bc
|
fb530a7aa2546ee9796fbc63951904ec6606864b
|
/jbpm-mvn-example-bpms640/jbpm-mvn-rest-controller/src/main/java/com/sample/DeleteServerViaControllerExample.java
|
81061c495876ce8b76f209672f8472f9facdeaca
|
[] |
no_license
|
ranjay2017/jbpm6example
|
08985b0cb27d8143778b7ebb7c29138995459d9a
|
a1a0612eeef748d7253064d07e0b7c474aae703f
|
refs/heads/master
| 2023-04-07T13:41:23.511365 | 2018-10-17T02:57:29 | 2018-10-17T02:57:29 | 117,191,733 | 0 | 0 | null | 2018-01-12T04:20:23 | 2018-01-12T04:20:22 | null |
UTF-8
|
Java
| false | false | 1,220 |
java
|
package com.sample;
import org.kie.server.api.marshalling.MarshallingFormat;
import org.kie.server.api.model.KieContainerResource;
import org.kie.server.api.model.KieContainerResourceList;
import org.kie.server.api.model.KieContainerStatus;
import org.kie.server.api.model.KieServerInfo;
import org.kie.server.api.model.ReleaseId;
import org.kie.server.api.model.ServiceResponse;
import org.kie.server.client.KieServicesClient;
import org.kie.server.client.KieServicesConfiguration;
import org.kie.server.client.KieServicesFactory;
import org.kie.server.controller.api.model.KieServerInstance;
public class DeleteServerViaControllerExample {
private static final String CONTROLLER_URL = "http://localhost:8080/business-central/rest/controller";
private static final String USERNAME = "kieserver";
private static final String PASSWORD = "kieserver1!";
public static void main(String[] args) {
// Controller Client
KieServerControllerClient controllerClient = new KieServerControllerClient(CONTROLLER_URL, USERNAME, PASSWORD);
controllerClient.setMarshallingFormat(MarshallingFormat.JAXB);
controllerClient.deleteKieServerInstance("local-server-456");
}
}
|
[
"[email protected]"
] | |
4acaf4ab6e94a83a59fd6c4a7226c1ff0f042372
|
6158b4e903f808e520f814a3fab8d524a1a92539
|
/app/src/main/java/ashiana/com/foodie/MainActivity.java
|
84cc9c19cc984e301fca9f86bb60ef4072f03063
|
[] |
no_license
|
Ankitamishra239/Foodie-
|
7635511744d89552d0ab756082af8d5b8422606e
|
589e33b33d2311636f80b36f0ee412ddf522ceda
|
refs/heads/master
| 2023-07-10T23:13:14.698758 | 2021-08-14T21:41:37 | 2021-08-14T21:41:37 | 342,316,109 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,955 |
java
|
package ashiana.com.foodie;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatImageButton;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.MobileAds;
import java.io.File;
import java.util.Objects;
public class MainActivity extends AppCompatActivity {
private Toolbar toolbar;
private Button btn1, btn2;
private AppCompatImageButton cambtn;
ImageView imageView;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.options_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()){
case R.id.item1:
Intent aboutIntent = new Intent(MainActivity.this, AboutUs.class);
startActivity(aboutIntent);
return true;
case R.id.item2:
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Checkout This Application");
shareIntent.putExtra(Intent.EXTRA_TEXT, "Application Link Here");
startActivity(Intent.createChooser(shareIntent,"Share Via"));
return true;
case R.id.item3:
Intent reportIntent = new Intent(MainActivity.this, ComplaintActivity.class);
startActivity(reportIntent);
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
btn1 = findViewById(R.id.button1);
btn2 = findViewById(R.id.button2);
cambtn = findViewById(R.id.cam_Button);
MobileAds.initialize(this);
loadAds();
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent IngrIntent = new Intent(MainActivity.this, IngredientSearchActivity.class);
startActivity(IngrIntent);
}
});
btn2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent Intent = new Intent(MainActivity.this, SearchByNameActivity.class);
startActivity(Intent);
}
});
cambtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// open camera activity
Intent intent1 = new Intent(MainActivity.this, CameraActivity.class);
startActivity(intent1);
}
});
}
private void loadAds(){
AdView mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
}
}
|
[
"[email protected]"
] | |
44701132a3dff29852adfa5f8b6457dedcf7d887
|
ddff1c4ddd632312f6fbb1361f11a20f10d3abcc
|
/src/main/java/com/kindsonthegenius/fleetms/controllers/VehicleHireController.java
|
b2790c5bba53b0e579934dc3bb230029ccd24eef
|
[] |
no_license
|
aayush416/fleetms
|
87893fdbf308e9795976c690d5c114a563665f16
|
f8059e736b799eac4bd6644d5213f75ea4e04980
|
refs/heads/master
| 2023-03-30T13:09:06.494924 | 2021-04-11T15:59:58 | 2021-04-11T15:59:58 | 356,912,560 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,261 |
java
|
package com.kindsonthegenius.fleetms.controllers;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.kindsonthegenius.fleetms.models.VehicleHire;
import com.kindsonthegenius.fleetms.services.ClientService;
import com.kindsonthegenius.fleetms.services.LocationService;
import com.kindsonthegenius.fleetms.services.VehicleHireService;
import com.kindsonthegenius.fleetms.services.VehicleService;
@Controller
public class VehicleHireController {
@Autowired private VehicleHireService vehicleHireService;
@Autowired private ClientService clientService;
@Autowired private LocationService locationService;
@Autowired private VehicleService vehicleService;
//Get All VehicleHires
@GetMapping("vehicleHires")
public String findAll(Model model){
model.addAttribute("vehicleHires", vehicleHireService.findAll());
model.addAttribute("clients", clientService.findAll());
model.addAttribute("locations", locationService.findAll());
model.addAttribute("vehicles", vehicleService.findAll());
return "vehicleHire";
}
@RequestMapping("vehicleHires/findById")
@ResponseBody
public Optional<VehicleHire> findById(Integer id)
{
return vehicleHireService.findById(id);
}
//Add VehicleHire
@PostMapping(value="vehicleHires/addNew")
public String addNew(VehicleHire vehicleHire) {
vehicleHireService.save(vehicleHire);
return "redirect:/vehicleHires";
}
@RequestMapping(value="vehicleHires/update", method = {RequestMethod.PUT, RequestMethod.GET})
public String update(VehicleHire vehicleHire) {
vehicleHireService.save(vehicleHire);
return "redirect:/vehicleHires";
}
@RequestMapping(value="vehicleHires/delete", method = {RequestMethod.DELETE, RequestMethod.GET})
public String delete(Integer id) {
vehicleHireService.delete(id);
return "redirect:/vehicleHires";
}
}
|
[
"[email protected]"
] | |
aeb3f98ebfe7e8e39269806f2bea571153f97117
|
2f8104b6d1501571d33ec786354b8673f879f895
|
/manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/utils/MapTypeHandler.java
|
926cbd3bdd8687eccc800a663c52ef90f5307585
|
[] |
no_license
|
enboling/otter
|
b6bbf67c1ed16c25881c95cd306658a7b3806405
|
b76a2b15070bd4ca42895b5aa125fdf7a3f73269
|
refs/heads/master
| 2021-01-16T20:22:42.295422 | 2013-08-16T10:03:58 | 2013-08-16T10:03:58 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 938 |
java
|
package com.alibaba.otter.manager.biz.config.utils;
import java.sql.SQLException;
import java.util.Map;
import com.alibaba.otter.shared.common.utils.JsonUtils;
import com.ibatis.sqlmap.client.extensions.ParameterSetter;
import com.ibatis.sqlmap.client.extensions.ResultGetter;
import com.ibatis.sqlmap.client.extensions.TypeHandlerCallback;
/**
* 用于Map数据结构的解析,ibatis相关
*
* @author simon
*/
public class MapTypeHandler implements TypeHandlerCallback {
@Override
public void setParameter(ParameterSetter setter, Object parameter) throws SQLException {
setter.setString(JsonUtils.marshalToString(parameter));
}
@Override
public Object getResult(ResultGetter getter) throws SQLException {
return JsonUtils.unmarshalFromString(getter.getString(), Map.class);
}
public Object valueOf(String s) {
return JsonUtils.unmarshalFromString(s, Map.class);
}
}
|
[
"[email protected]"
] | |
7fadef7690e29c77ee64f7ce4dd49ff1b85e6917
|
53e71f46f12b99879168938695dfccae8e3fc1ca
|
/src/main/java/com/qm/service/impl/UserServiceImpl.java
|
323ba3a8d318ac5f40ef38b012e787a0ef97a3e4
|
[] |
no_license
|
qm1995/demo
|
5efb4a262c994371132adc20fa1c765c8c99b01a
|
9d76e63e7d24b089313d995109ea8927faace924
|
refs/heads/master
| 2020-03-10T16:48:38.727539 | 2018-12-24T08:03:02 | 2018-12-24T08:03:02 | 129,483,396 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,352 |
java
|
package com.qm.service.impl;
import java.util.Date;
import java.util.List;
import com.qm.service.Userservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;
import com.qm.mapper.FriendUserMapper;
import com.qm.mapper.UserMapper;
import com.qm.pojo.FriendUserExample;
import com.qm.pojo.FriendUserKey;
import com.qm.pojo.User;
import com.qm.pojo.UserExample;
import com.qm.pojo.UserExample.Criteria;
import com.qm.util.ActionResult;
@Service
public class UserServiceImpl implements Userservice {
@Autowired
private UserMapper userMapper;
@Autowired
private FriendUserMapper friendMapper;
@Override
public ActionResult login(String username,String pwd) {
String md5Pwd = DigestUtils.md5DigestAsHex(pwd.getBytes());
UserExample example = new UserExample();
Criteria criteria = example.createCriteria();
criteria.andUsernameEqualTo(username);
criteria.andPwdEqualTo(md5Pwd);
List<User> users = userMapper.selectByExample(example);
if(users == null || users.size() != 1) {
return ActionResult.build(400, "用户名或密码错误");
}
User user = users.get(0);
updateLoginState(user, 1);
return ActionResult.Ok(users.get(0));
}
@Override
public void registerUser(User user) {
user.setPwd(DigestUtils.md5DigestAsHex(user.getPwd().getBytes()));
user.setIslogin(0);
user.setLogindate(new Date());
user.setRegisterdate(new Date());
userMapper.insertSelective(user);
return;
}
@Override
public boolean checkNameIsExist(String username) {
UserExample example = new UserExample();
Criteria criteria = example.createCriteria();
criteria.andUsernameEqualTo(username);
List<User> list = userMapper.selectByExample(example);
if(list.size() == 0 || list == null) {
return false;
}
return true;
}
@Override
public List<User> getFriendsById(Integer uid){
List<User> friendList = userMapper.findFriendsById(uid);
return friendList;
}
@Override
public List<User> findUsersByName(String username) {
// TODO Auto-generated method stub
UserExample example = new UserExample();
Criteria criteria = example.createCriteria();
criteria.andUsernameLike(username);
List<User> list = userMapper.selectByExample(example);
return list;
}
@Override
public boolean addFriend(Integer uid, Integer fid) {
// TODO Auto-generated method stub
FriendUserExample example = new FriendUserExample();
com.qm.pojo.FriendUserExample.Criteria createCriteria = example.createCriteria();
createCriteria.andFidEqualTo(fid);
createCriteria.andUidEqualTo(uid);
List<FriendUserKey> list = friendMapper.selectByExample(example);
if(list.size() > 0){
return false;//此时已经存在好友关系
}
FriendUserKey record = new FriendUserKey();
record.setFid(fid);
record.setUid(uid);
int insert = friendMapper.insert(record);
if(insert == 1){
return true;
}
return false;
}
@Override
public boolean logout(User user) {
// TODO Auto-generated method stub
return updateLoginState(user, 0);
}
/**
* 私有的方法,
* 用于更新用户的状态
* @param uid
* @return
*/
private boolean updateLoginState(User user,Integer state){
user.setIslogin(state);
int i = userMapper.updateByPrimaryKey(user);
return i==1;
}
}
|
[
"[email protected]"
] | |
69c44a3d340588952b99226275c5557e7f9aceb6
|
2bc6fb1dac3dea0a10c90c83d5efd1082b137c56
|
/src/main/java/com/brsanthu/dataexporter/model/RowDetails.java
|
9178cca30081bb101e37ea95cecbf2be82e18422
|
[] |
no_license
|
jan-moxter/data-exporter
|
0c6eaa94a62435dcf66fff7bb50c003df5727932
|
88eff41fb58c1555059ebc64d48745aa25d0b935
|
refs/heads/master
| 2021-01-18T02:57:52.917492 | 2015-12-12T18:22:37 | 2015-12-12T18:22:37 | 37,241,470 | 3 | 0 | null | 2015-06-11T05:38:17 | 2015-06-11T05:38:16 |
Java
|
UTF-8
|
Java
| false | false | 1,779 |
java
|
/*
* #%L
* data-exporter
* %%
* Copyright (C) 2012 - 2013 http://www.brsanthu.com
* %%
* 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.
* #L%
*/
package com.brsanthu.dataexporter.model;
/**
* Bean contains the details of row being written like row index, actual row
* and height of the row.
*
* @author Santhosh Kumar
*/
public class RowDetails {
private Table table = null;
private int rowIndex = 0;
private Row row = null;
private int rowHeight = 1;
public RowDetails() {
//do nothing
}
public RowDetails(Table table, int rowIndex, Row row) {
super();
this.table = table;
this.rowIndex = rowIndex;
this.row = row;
}
public Table getTable() {
return table;
}
public void setTable(Table table) {
this.table = table;
}
public int getRowHeight() {
return rowHeight;
}
public void setRowHeight(int rowHeight) {
this.rowHeight = rowHeight;
}
public int getRowIndex() {
return rowIndex;
}
public void setRowIndex(int rowIndex) {
this.rowIndex = rowIndex;
}
public Row getRow() {
return row;
}
public void setRow(Row row) {
this.row = row;
}
}
|
[
"[email protected]"
] | |
80526d575b1d6240d331a7ea3de4fc12121d1a5a
|
c3ad4c6aab6c664093e9c3c431f5827d30bd09e4
|
/src/main/java/net/haesleinhuepf/imagej/demo/FlipCLDemo.java
|
c1be7726e1f9d82bbbee941294f1606c7ecf931b
|
[] |
no_license
|
skalarproduktraum/clearclij
|
a28072d07fe74fcc3b8e396dddeda0c1516983a3
|
da8cb84f971e62aa9183c0f2868b702514eb3316
|
refs/heads/master
| 2020-04-09T18:35:57.111136 | 2018-12-05T09:40:37 | 2018-12-05T09:40:37 | 160,517,396 | 0 | 0 | null | 2018-12-05T12:48:48 | 2018-12-05T12:48:48 | null |
UTF-8
|
Java
| false | false | 2,069 |
java
|
package net.haesleinhuepf.imagej.demo;
import clearcl.ClearCLImage;
import net.haesleinhuepf.imagej.ClearCLIJ;
import ij.IJ;
import ij.ImageJ;
import ij.ImagePlus;
import ij.plugin.Duplicator;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.img.display.imagej.ImageJFunctions;
import net.imglib2.type.numeric.integer.UnsignedShortType;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* This
*
* Author: Robert Haase (http://haesleinhuepf.net) at MPI CBG (http://mpi-cbg.de)
* February 2018
*/
public class FlipCLDemo
{
public static void main(String... args) throws IOException
{
new ImageJ();
ImagePlus
lInputImagePlus =
IJ.openImage("src/main/resources/flybrain.tif");
RandomAccessibleInterval<UnsignedShortType>
lInputImg =
ImageJFunctions.wrap(lInputImagePlus);
RandomAccessibleInterval<UnsignedShortType>
lOutputImg =
ImageJFunctions.wrap(new Duplicator().run(lInputImagePlus));
ImageJFunctions.show(lInputImg);
ClearCLIJ lCLIJ = new ClearCLIJ("hd"); //ClearCLIJ.getInstance();
// ---------------------------------------------------------------
// Example 1: Flip image in X
{
ClearCLImage
lSrcImage =
lCLIJ.converter(lInputImg).getClearCLImage();
ClearCLImage
lDstImage =
lCLIJ.converter(lOutputImg).getClearCLImage();
Map<String, Object> lParameterMap = new HashMap<>();
lParameterMap.put("src", lSrcImage);
lParameterMap.put("dst", lDstImage);
lParameterMap.put("flipx", 1);
lParameterMap.put("flipy", 0);
lParameterMap.put("flipz", 0);
lCLIJ.execute("src/main/java/clearcl/imagej/kernels/flip.cl",
"flip_3d",
lParameterMap);
RandomAccessibleInterval
lResultImg =
lCLIJ.converter(lDstImage).getRandomAccessibleInterval();
ImageJFunctions.show(lResultImg);
}
}
}
|
[
"[email protected]"
] | |
79d9d29cfd404f2f3f665ed8b66f4a08dd64a14e
|
32571068cb2d1af0140af0f3f91945648730c4d2
|
/RoomDemo/app/src/main/java/com/ebookfrenzy/roomdemo/Product.java
|
6b007e5604b9c49c98a22f4542022219f6f455e8
|
[] |
no_license
|
raquelgrogan/CPS251
|
987b101a6796a7d12e9a57fa870acdd0824b93d5
|
4d2e73468c4746d2dbc81f0047ed37657cbe083c
|
refs/heads/master
| 2022-04-25T13:52:16.287587 | 2020-04-23T12:13:36 | 2020-04-23T12:13:36 | 233,965,703 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,030 |
java
|
package com.ebookfrenzy.roomdemo;
import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
@Entity(tableName = "products")
public class Product {
//Table named product with variables with constructor and getters and setters
@PrimaryKey(autoGenerate = true)
@NonNull
@ColumnInfo(name = "productId")
private int id;
@ColumnInfo(name = "productName")
private String name;
private int quantity;
public Product(String name, int quantity) {
this.id = id;
this.name = name;
this.quantity = quantity;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
}
|
[
"raque@DESKTOP-FOIJBSU.(none)"
] |
raque@DESKTOP-FOIJBSU.(none)
|
979e14fb53e728518ba49b2d900ac989dcf4ced6
|
da3d351b26a8d0e11b03ca2b9fa00cc64876d551
|
/app/src/main/java/jlox/Resolver.java
|
68817dc47fa11300e2f0306ec33d4ea2603929b2
|
[] |
no_license
|
zerox7felf/crafting-interpreters-java
|
6df165d85029cdfb737b4328501ead2db34d8b17
|
715c41a9c50dd41a87d65920a72ed14092a8b6cc
|
refs/heads/master
| 2023-07-15T01:20:31.545653 | 2021-08-19T03:01:07 | 2021-08-19T03:01:07 | 378,141,038 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,724 |
java
|
package jlox;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
class Resolver implements Expr.Visitor<Void>, Stmt.Visitor<Void> {
private final Interpreter interpreter;
private final Stack<Map<String, Boolean>> scopes = new Stack<>();
private FunctionType currentFunction = FunctionType.NONE;
private ClassType currentClass = ClassType.NONE;
Resolver(Interpreter interpreter) {
this.interpreter = interpreter;
}
private enum FunctionType {
NONE, FUNCTION, METHOD, INITIALIZER
}
private enum ClassType {
NONE, CLASS, SUBCLASS
}
@Override
public Void visitBlockStmt(Stmt.Block stmt) {
beginScope();
resolve(stmt.statements);
endScope();
return null;
}
@Override
public Void visitExpressionStmt(Stmt.Expression stmt) {
resolve(stmt.expression);
return null;
}
@Override
public Void visitIfStmt(Stmt.If stmt) {
resolve(stmt.condition);
resolve(stmt.thenBranch);
if (stmt.elseBranch != null) resolve(stmt.elseBranch);
return null;
}
@Override
public Void visitPrintStmt(Stmt.Print stmt) {
resolve(stmt.expression);
return null;
}
@Override
public Void visitReturnStmt(Stmt.Return stmt) {
if (currentFunction == FunctionType.NONE)
App.error(stmt.keyword, "Can't return from top-level code.");
if (stmt.value != null) {
if (currentFunction == FunctionType.INITIALIZER)
App.error(stmt.keyword, "Can't return from initializer.");
resolve(stmt.value);
}
return null;
}
@Override
public Void visitWhileStmt(Stmt.While stmt) {
resolve(stmt.condition);
resolve(stmt.body);
return null;
}
@Override
public Void visitFunctionStmt(Stmt.Function stmt) {
declare(stmt.name);
define(stmt.name); // Immediately define the function aswell, to allow for recursion
resolveFunction(stmt.params, stmt.body, FunctionType.FUNCTION);
return null;
}
@Override
public Void visitVarStmt(Stmt.Var stmt) {
declare(stmt.name);
if (stmt.initializer != null)
resolve(stmt.initializer);
define(stmt.name);
return null;
}
@Override
public Void visitClassStmt(Stmt.Class stmt) {
ClassType enclosingClass = currentClass;
currentClass = ClassType.CLASS;
declare(stmt.name);
if (stmt.superclass != null &&
stmt.name.lexeme.equals(stmt.superclass.name.lexeme)
){
App.error(stmt.superclass.name, "A class cannot inherit itself!");
}
if (stmt.superclass != null) {
currentClass = ClassType.SUBCLASS;
resolve(stmt.superclass);
}
if (stmt.superclass != null) {
beginScope();
scopes.peek().put("super", true);
}
beginScope();
scopes.peek().put("this", true);
for (Stmt.Function method : stmt.methods) {
FunctionType declaration = FunctionType.METHOD;
if (method.name.lexeme.equals("init"))
currentFunction = FunctionType.INITIALIZER;
resolveFunction(method.params, method.body, declaration);
}
endScope();
define(stmt.name);
if (stmt.superclass != null) endScope();
currentClass = enclosingClass;
return null;
}
@Override
public Void visitTernaryExpr(Expr.Ternary expr) {
resolve(expr.condition);
resolve(expr.truePath);
if (expr.falsePath != null) resolve(expr.falsePath);
return null;
}
@Override
public Void visitAssignExpr(Expr.Assign expr) {
resolve(expr.value);
resolveLocal(expr, expr.name);
return null;
}
public Void visitVariableExpr(Expr.Variable expr) {
if (!scopes.isEmpty() &&
scopes.peek().get(expr.name.lexeme) == Boolean.FALSE
){
App.error(expr.name, "Can't read local variable in it's own initializer");
}
resolveLocal(expr, expr.name);
return null;
}
@Override
public Void visitLambdaExpr(Expr.Lambda expr) {
resolveFunction(expr.params, expr.body, FunctionType.FUNCTION);
return null;
}
@Override
public Void visitUnaryExpr(Expr.Unary expr) {
resolve(expr.right);
return null;
}
@Override
public Void visitLogicalExpr(Expr.Logical expr) {
resolve(expr.left);
resolve(expr.right);
return null;
}
@Override
public Void visitBinaryExpr(Expr.Binary expr) {
resolve(expr.left);
resolve(expr.right);
return null;
}
@Override
public Void visitCallExpr(Expr.Call expr) {
resolve(expr.callee);
for (Expr argument : expr.arguments) {
resolve(argument);
}
return null;
}
@Override
public Void visitGetExpr(Expr.Get expr) {
resolve(expr.object);
return null;
}
@Override
public Void visitSetExpr(Expr.Set expr) {
resolve(expr.value);
resolve(expr.object);
return null;
}
@Override
public Void visitSuperExpr(Expr.Super expr) {
if (currentClass == ClassType.NONE) {
throw new RuntimeError(expr.keyword, "Cannot use super outside of class.");
} else if (currentClass == ClassType.CLASS) {
throw new RuntimeError(expr.keyword, "Cannot use super in class without superclass.");
}
resolveLocal(expr, expr.keyword);
return null;
}
@Override
public Void visitThisExpr(Expr.This expr) {
if (currentClass != ClassType.CLASS) {
App.error(expr.keyword, "Can't use 'this' outside of class.");
return null;
}
resolveLocal(expr, expr.keyword);
return null;
}
@Override
public Void visitGroupingExpr(Expr.Grouping expr) {
resolve(expr.expression);
return null;
}
@Override
public Void visitLiteralExpr(Expr.Literal expr) {
return null;
}
void resolve(List<Stmt> statements) {
for (Stmt statement : statements) {
statement.accept(this);
}
}
private void resolve(Stmt stmt) {
stmt.accept(this);
}
private void resolve(Expr expr) {
expr.accept(this);
}
private void resolveFunction(List<Token> params, List<Stmt> body, FunctionType type) {
FunctionType enclosingFunction = currentFunction;
currentFunction = type;
beginScope();
for (Token param : params) {
declare(param);
define(param);
}
resolve(body);
endScope();
currentFunction = enclosingFunction;
}
private void beginScope() {
scopes.push(new HashMap<String, Boolean>());
}
private void endScope() {
scopes.pop();
}
private void declare(Token name) {
if (scopes.isEmpty()) return;
Map<String, Boolean> scope = scopes.peek();
scope.put(name.lexeme, false);
}
private void define(Token name) {
if (scopes.isEmpty()) return;
scopes.peek().put(name.lexeme, true);
}
private void resolveLocal(Expr expr, Token name) {
for (int i = scopes.size() - 1; i >= 0; i--) {
if (scopes.get(i).containsKey(name.lexeme)) {
interpreter.resolve(expr, scopes.size() - 1 - i);
return;
}
}
}
}
|
[
"[email protected]"
] | |
7e0fb42d255e683f04a52d4005bf4c359f52d9f0
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/mockito--mockito/3133e1a7ab662c52c4350bdecb512874b7afe9b1/before/InvalidUseOfMatchersTest.java
|
261a707e15765a9903afbf7b6a210044cf7dd609
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,935 |
java
|
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockitousage.matchers;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.eq;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.AdditionalMatchers;
import org.mockito.Mockito;
import org.mockito.RequiresValidState;
import org.mockito.StateResetter;
import org.mockito.exceptions.misusing.InvalidUseOfMatchersException;
import org.mockitousage.IMethods;
@SuppressWarnings("unchecked")
public class InvalidUseOfMatchersTest extends RequiresValidState {
private IMethods mock;
@Before
public void setUp() {
StateResetter.reset();
mock = Mockito.mock(IMethods.class);
}
@After
public void resetState() {
StateResetter.reset();
}
@Test
public void shouldDetectWrongNumberOfMatchersWhenStubbing() {
Mockito.stub(mock.threeArgumentMethod(1, "2", "3")).andReturn(null);
try {
Mockito.stub(mock.threeArgumentMethod(1, eq("2"), "3")).andReturn(null);
fail();
} catch (InvalidUseOfMatchersException e) {}
}
@Test
public void shouldDetectStupidUseOfMatchersWhenVerifying() {
mock.oneArg(true);
eq("that's the stupid way");
eq("of using matchers");
try {
Mockito.verify(mock).oneArg(true);
fail();
} catch (InvalidUseOfMatchersException e) {}
}
@Test
public void shouldScreamWhenMatchersAreInvalid() {
mock.simpleMethod(AdditionalMatchers.not(eq("asd")));
try {
mock.simpleMethod(AdditionalMatchers.not("jkl"));
fail();
} catch (InvalidUseOfMatchersException e) {
assertEquals(
"\n" +
"No matchers found for Not(?)." +
"\n" +
"Read more: http://code.google.com/p/mockito/matchers"
, e.getMessage());
}
try {
mock.simpleMethod(AdditionalMatchers.or(eq("jkl"), "asd"));
fail();
} catch (InvalidUseOfMatchersException e) {
assertEquals(
"\n" +
"2 matchers expected, 1 recorded." +
"\n" +
"Read more: http://code.google.com/p/mockito/matchers"
, e.getMessage());
}
try {
mock.threeArgumentMethod(1, "asd", eq("asd"));
fail();
} catch (InvalidUseOfMatchersException e) {
assertEquals(
"\n" +
"3 matchers expected, 1 recorded." +
"\n" +
"Read more: http://code.google.com/p/mockito/matchers"
, e.getMessage());
}
}
}
|
[
"[email protected]"
] | |
96cc9d46551194f5396ec06d67423e49f63577ab
|
434448d18471b3f43acc0cef10386d6002f60e1d
|
/MyJava/src/tw/brad/java/example/Brad57.java
|
d29952a40b86a6a3680f59f14307351fdaaf6f7e
|
[] |
no_license
|
bradchao/tcca_java
|
5fb0d8b379f8f1a53a5199fc2e6c6d623bb7c04b
|
e773b38169b22cf9b629f7ad92b0b6c7d0b4333d
|
refs/heads/master
| 2021-08-15T05:52:42.862930 | 2017-11-17T12:56:48 | 2017-11-17T12:56:48 | 107,122,929 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 620 |
java
|
package tw.brad.java.example;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
public class Brad57 {
public static void main(String[] args) {
try {
ObjectInputStream oin =
new ObjectInputStream(new FileInputStream("brad.oo"));
Object obj1 = oin.readObject();
Student s1 = (Student)obj1;
System.out.println(s1.calSum());
System.out.println(s1.calAvg());
Object obj2 = oin.readObject();
Student s2 = (Student)obj2;
System.out.println(s2.calSum());
System.out.println(s2.calAvg());
oin.close();
}catch(Exception ee) {
}
}
}
|
[
"User@NX"
] |
User@NX
|
7f3fc8627e3c25010614b2c82c3b705445bfed64
|
73267be654cd1fd76cf2cb9ea3a75630d9f58a41
|
/services/projectman/src/main/java/com/huaweicloud/sdk/projectman/v4/model/ListProjectIssuesRecordsV4Response.java
|
b03c46f14936116eba14ca9f59e7b05ac72c5f22
|
[
"Apache-2.0"
] |
permissive
|
huaweicloud/huaweicloud-sdk-java-v3
|
51b32a451fac321a0affe2176663fed8a9cd8042
|
2f8543d0d037b35c2664298ba39a89cc9d8ed9a3
|
refs/heads/master
| 2023-08-29T06:50:15.642693 | 2023-08-24T08:34:48 | 2023-08-24T08:34:48 | 262,207,545 | 91 | 57 |
NOASSERTION
| 2023-09-08T12:24:55 | 2020-05-08T02:27:00 |
Java
|
UTF-8
|
Java
| false | false | 3,138 |
java
|
package com.huaweicloud.sdk.projectman.v4.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;
/**
* Response Object
*/
public class ListProjectIssuesRecordsV4Response extends SdkResponse {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "records")
private List<IssueAttrHistoryRecord> records = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "total")
private Integer total;
public ListProjectIssuesRecordsV4Response withRecords(List<IssueAttrHistoryRecord> records) {
this.records = records;
return this;
}
public ListProjectIssuesRecordsV4Response addRecordsItem(IssueAttrHistoryRecord recordsItem) {
if (this.records == null) {
this.records = new ArrayList<>();
}
this.records.add(recordsItem);
return this;
}
public ListProjectIssuesRecordsV4Response withRecords(Consumer<List<IssueAttrHistoryRecord>> recordsSetter) {
if (this.records == null) {
this.records = new ArrayList<>();
}
recordsSetter.accept(this.records);
return this;
}
/**
* 历史记录
* @return records
*/
public List<IssueAttrHistoryRecord> getRecords() {
return records;
}
public void setRecords(List<IssueAttrHistoryRecord> records) {
this.records = records;
}
public ListProjectIssuesRecordsV4Response withTotal(Integer total) {
this.total = total;
return this;
}
/**
* 总数
* @return total
*/
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ListProjectIssuesRecordsV4Response that = (ListProjectIssuesRecordsV4Response) obj;
return Objects.equals(this.records, that.records) && Objects.equals(this.total, that.total);
}
@Override
public int hashCode() {
return Objects.hash(records, total);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ListProjectIssuesRecordsV4Response {\n");
sb.append(" records: ").append(toIndentedString(records)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"[email protected]"
] | |
0d7363f706fbb28888ce7b538b00b732da628702
|
cbf15fee5adcb253caad27668c43e60e462186d9
|
/src/main/java/com/example/springmvc/core/util/EncryptUtil.java
|
b408087b07d396622da87f86fb34200481da794c
|
[] |
no_license
|
henryyue2010/SpringMVC-MyBatis-Shiro-Example
|
6807d8e79f207413181d2d5ce4f14c8fa3be29c6
|
b96dedc7be378ba86fbf7e8e70b89e0f898347d9
|
refs/heads/master
| 2021-01-10T10:40:08.005920 | 2017-04-30T23:14:49 | 2017-04-30T23:14:49 | 48,177,818 | 1 | 3 | null | null | null | null |
UTF-8
|
Java
| false | false | 361 |
java
|
package com.example.springmvc.core.util;
import org.apache.shiro.crypto.hash.Md5Hash;
/**
* EncryptUtil for Shiro
*
* @author henryyue
*
*/
public class EncryptUtil {
public static final String encryptMD5(String source) {
if (source == null) {
source = "";
}
Md5Hash md5 = new Md5Hash(source);
return md5.toString();
}
}
|
[
"[email protected]"
] | |
d51241b153665fd06ee77fb7a66de920be54b240
|
8141b48132c059437f6f52b1a467d5468cd5b6ab
|
/src/test/java/com/lab3/MainTest.java
|
04c75db3e69240dfe6ba24cb42058e543c4e018e
|
[] |
no_license
|
OlyaDbd/Lab3
|
df0e8b58c4b33a97996be3b99d32c1332c9d939d
|
a7e6d8c40c2af878806270144116bcd99232a185
|
refs/heads/master
| 2022-12-26T00:56:11.510242 | 2020-10-15T11:18:35 | 2020-10-15T11:18:35 | 304,301,990 | 0 | 0 | null | 2020-10-15T11:26:19 | 2020-10-15T11:18:20 |
Java
|
UTF-8
|
Java
| false | false | 1,338 |
java
|
package com.lab3;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class MainTest {
@Test
void testFirst() {
List<String> text = new ArrayList<>(
Arrays.asList("java class", "hello world", "1234 5678"));
List<String> expected = Main.reverseStrings(text);
List<String> actual = new ArrayList<>(
Arrays.asList("avaj", "ssalc", "olleh", "dlrow", "4321", "8765"));
Assertions.assertIterableEquals(expected, actual);
}
@Test
void testSecond() {
List<String> text = new ArrayList<>(
Arrays.asList("types.of.computer.system", "abc 123"));
List<String> expected = Main.reverseStrings(text);
List<String> actual = new ArrayList<>(
Arrays.asList("sepyt", "fo", "retupmoc", "metsys", "cba", "321"));
Assertions.assertIterableEquals(expected, actual);
}
@Test
void testThirdEmpty() {
List<String> text = new ArrayList<>(
Arrays.asList(""));
List<String> expected = Main.reverseStrings(text);
List<String> actual = new ArrayList<>(
Arrays.asList(""));
Assertions.assertIterableEquals(expected, actual);
}
}
|
[
"[email protected]"
] | |
09001611d595e189c7619dff7f39101f8772b881
|
9f82fd6e1f03a254fc28f4b335b70f43d01d90cc
|
/java/src/eu/finwest/vo/QuestionAnswerVO.java
|
7163676a3c78558b3ce59f979b4477e0d5ca5dcf
|
[] |
no_license
|
f-inwest/inwestuj-w-firmy
|
1d7c869dc75c313cbaedce7d6b57c8be147bb9a5
|
75cd370c53e9686e56b3a092677f0f6c10b3fd86
|
refs/heads/master
| 2021-01-01T06:45:13.417668 | 2015-07-31T12:44:26 | 2015-07-31T12:44:26 | 10,626,165 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,688 |
java
|
package eu.finwest.vo;
import java.util.Date;
import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import eu.finwest.util.DateSerializer;
/**
*
* @author "Grzegorz Nittner" <[email protected]>
*/
@JsonAutoDetect(getterVisibility=Visibility.NONE, setterVisibility=Visibility.NONE,
fieldVisibility=Visibility.NONE, isGetterVisibility=Visibility.NONE)
public class QuestionAnswerVO extends BaseVO implements UserDataUpdatable {
@JsonProperty("question_id") private String id;
@JsonProperty("listing_id") private String listing;
@JsonProperty("from_user_id") private String user;
@JsonProperty("from_user_avatar") private String avatar;
@JsonProperty("from_user_nickname") private String userNickname;
@JsonProperty("from_user_class") private String userClass;
@JsonProperty("create_date") @JsonSerialize(using=DateSerializer.class) private Date created;
@JsonProperty("question") private String question;
@JsonProperty("answer") private String answer;
@JsonProperty("answer_date") @JsonSerialize(using=DateSerializer.class) private Date answerDate;
@JsonProperty("published") private boolean published;
public QuestionAnswerVO() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getListing() {
return listing;
}
public void setListing(String listing) {
this.listing = listing;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getUserNickname() {
return userNickname;
}
public void setUserNickname(String userNickname) {
this.userNickname = userNickname;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public Date getAnswerDate() {
return answerDate;
}
public void setAnswerDate(Date answerDate) {
this.answerDate = answerDate;
}
public boolean isPublished() {
return published;
}
public void setPublished(boolean published) {
this.published = published;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getUserClass() {
return userClass;
}
public void setUserClass(String userClass) {
this.userClass = userClass;
}
}
|
[
"[email protected]"
] | |
4e0669fb87fc484ed1f8f0ef34b0bdf084190638
|
3659b1303cbf5e6f5bee0a886b56827f05030e76
|
/src/com/cognizant/truyum/servlet/EditMenuItemServlet.java
|
448426267c523f466aa08aee4d1a930458d7f519
|
[] |
no_license
|
VishnuKumar18/TruYum-Pratice-Check-
|
29a382c47f0e2213c93195b22cac7c222b829ab7
|
2d247947fa7b269f90432209f2d5656799b2a21a
|
refs/heads/master
| 2020-09-23T23:20:41.778407 | 2019-12-03T12:27:12 | 2019-12-03T12:27:12 | 225,613,431 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,696 |
java
|
package com.cognizant.truyum.servlet;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.cognizant.truyum.dao.MenuItemDao;
import com.cognizant.truyum.dao.MenuItemDaoSqlImpl;
import com.cognizant.truyum.model.MenuItem;
/**
* Servlet implementation class EditMenuItemServlet
*/
@WebServlet("/EditMenuItemServlet")
public class EditMenuItemServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public EditMenuItemServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
* response)
*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
* response)
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
boolean activeFlag;
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
// request.getAttribute("menuItem");
MenuItemDaoSqlImpl menuItemDaoSqlImpl = new MenuItemDaoSqlImpl();
MenuItemDao menuItemDao = menuItemDaoSqlImpl;
String name = request.getParameter("itemName");
String id = request.getParameter("menuitemid");
String price = request.getParameter("price");
String active = request.getParameter("active");
if (active.equals("yes")) {
activeFlag = true;
} else {
activeFlag = false;
}
String date = request.getParameter("date");
String itemType = request.getParameter("itemType");
boolean freeDelivery = request.getParameter("freedelivery") != null;
MenuItem menuItem = new MenuItem();
menuItem.setCategory(itemType);
menuItem.setFreeDelivery(freeDelivery);
menuItem.setId(Long.parseLong(id));
menuItem.setName(name);
menuItem.setPrice(Float.parseFloat(price));
Date dateOfLaunch;
try {
dateOfLaunch = sdf.parse(date);
menuItem.setDateofLaunch(dateOfLaunch);
menuItemDao.modifyMenuItem(menuItem);
System.out.println(menuItem);
response.sendRedirect("edit-menu-item-status.jsp");
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
|
[
"[email protected]"
] | |
1d2b6ef85cf5939319b25f9d92ab7be3b6bf549a
|
424eac1dcf1dea0d3bb955333d0daf8e3e2d9b3a
|
/src/java/Modelos/NovedadesEmpleado/clsNovedadesEmpleado.java
|
fc8e84495d2b8bb33659f79e68d81133e29ea6f3
|
[] |
no_license
|
Marnac12/Servipro
|
1eb3b7f4d88260020c918ca90632e9de14c678c0
|
a46760477af8c7cd57841925c2583f4516af47ca
|
refs/heads/master
| 2020-12-02T10:46:49.168367 | 2019-12-30T22:01:44 | 2019-12-30T22:01:44 | 230,986,646 | 1 | 0 | null | 2019-12-30T22:12:54 | 2019-12-30T22:12:54 | null |
UTF-8
|
Java
| false | false | 1,314 |
java
|
package Modelos.NovedadesEmpleado;
public class clsNovedadesEmpleado {
public int Id_novedad_empleado;
public clsEmpleado obclsEmpleado;
public clsTipoNovedad obclsTipoNovedad;
public String detalle;
public String fecha;
public int dia;
public int getId_novedad_empleado() {
return Id_novedad_empleado;
}
public void setId_novedad_empleado(int Id_novedad_empleado) {
this.Id_novedad_empleado = Id_novedad_empleado;
}
public clsEmpleado getObclsEmpleado() {
return obclsEmpleado;
}
public void setObclsEmpleado(clsEmpleado obclsEmpleado) {
this.obclsEmpleado = obclsEmpleado;
}
public clsTipoNovedad getObclsTipoNovedad() {
return obclsTipoNovedad;
}
public void setObclsTipoNovedad(clsTipoNovedad obclsTipoNovedad) {
this.obclsTipoNovedad = obclsTipoNovedad;
}
public String getDetalle() {
return detalle;
}
public void setDetalle(String detalle) {
this.detalle = detalle;
}
public String getFecha() {
return fecha;
}
public void setFecha(String fecha) {
this.fecha = fecha;
}
public int getDia() {
return dia;
}
public void setDia(int dia) {
this.dia = dia;
}
}
|
[
"[email protected]"
] | |
2771483bab34f90c1045c4252af33ddd8512651f
|
d884455a9fbc20e77d72535546e6b5c455a8a4fb
|
/ZipEngine/src/com/progdan/zipengine/apps/Deck.java
|
4006e53ea1370a33e91282dc439f7313869237af
|
[] |
no_license
|
maksymmykytiuk/EDMIS
|
53634f4d071829a805f58efd497eba011f4e2c03
|
4dff1ca6f68cede51ee9f6076d1641fd1c5711fd
|
refs/heads/master
| 2021-05-28T20:03:38.711307 | 2013-02-08T18:21:20 | 2013-02-08T18:21:20 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,049 |
java
|
// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov Date: 2/12/2004 17:14:35
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: Deck.java
package com.progdan.zipengine.apps;
import java.util.Random;
public class Deck
{
public int ncards()
{
return ncards;
}
public Deck(int i)
{
r = new Random();
cards = new int[i];
ncards = i;
for(int j = 0; j < i; j++)
cards[j] = j;
}
public void discard(int i)
{
for(int j = 0; j < i; j++)
draw();
}
public int draw()
{
int i = r.nextInt();
if(i < 0)
i = -i;
i %= ncards;
ncards--;
int j = cards[ncards];
cards[ncards] = cards[i];
cards[i] = j;
return cards[ncards];
}
public Random r;
private int cards[];
private int ncards;
}
|
[
"[email protected]"
] | |
155cdacfa3782dfc6cf5672c0af5aae5e111e88d
|
db9a1aad6e699f0c01a7a8f6d642752026eb4d39
|
/demo.springboot.jdbc/demo.springboot.jdbc.mybatis/src/main/java/demo/springboot/jdbc/mybatis/application/CityMapper.java
|
d5c36865059b5648433c8b7acc7df340e8448faf
|
[] |
no_license
|
QiangZhu/demo.springboot
|
4188360bfb17e47e7f3d7a4b129cee7be336f1b5
|
6092c6ed57d6fe32f0a9c94e58a869869f5cf9b3
|
refs/heads/master
| 2021-01-22T20:12:45.642027 | 2018-09-20T06:47:12 | 2018-09-20T06:47:12 | 85,294,248 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 221 |
java
|
package demo.springboot.jdbc.mybatis.application;
import org.apache.ibatis.annotations.Mapper;
import demo.springboot.jdbc.mybatis.core.City;
@Mapper
public interface CityMapper {
City selectByCityId(int city_id);
}
|
[
"[email protected]"
] | |
c559f98d168f3616a6e8fcec258f878ce96840e2
|
0dc39c75f5b6fe6fbb65f72aea16e4075130a004
|
/src/com/design/mode/observe/Client.java
|
b997cb4c5724ae2cb21bcea4f374999caf7aa0d0
|
[] |
no_license
|
qingfeng9924/design-mode
|
a14f1cdcffff6030d921587bdcd2df05fe969e00
|
b2d35e876d9fbc4ce689287300719ff0ccac0e06
|
refs/heads/master
| 2021-01-03T17:11:16.715559 | 2020-06-09T13:52:12 | 2020-06-09T13:52:12 | 240,164,492 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 686 |
java
|
package com.design.mode.observe;
/**
* Created by zhangyuan on 2020/2/21 0021.
*/
public class Client {
public static void main(String []args){
ConcreteSubject concreteSubject = new ConcreteSubject();
ConcreteObserver concreteObserver1 = new ConcreteObserver("状态1",concreteSubject);
ConcreteObserver concreteObserver2 = new ConcreteObserver("状态3",concreteSubject);
concreteSubject.addObserver(concreteObserver1);
concreteSubject.addObserver(concreteObserver2);
concreteSubject.setStatus("状态三");
concreteSubject.update();
System.out.println(concreteObserver1);
System.out.println(concreteObserver2);
}
}
|
[
"[email protected]"
] | |
9350754a36fbdc888433a46f9849fea2c4872be1
|
54ea2744071c601ba00cb92036314267a3fbda53
|
/src/main/java/org/lee/algorithm/array/Person.java
|
dc7b63f793356e6ffbcddde8d801eb055d02f167
|
[] |
no_license
|
lqpLee/simpleDemo
|
db78e6ffe5d4112048700d58d260efdd58ecfe78
|
69d66ebea910ab0f0b66469b8d0113011e3f2835
|
refs/heads/master
| 2022-07-08T02:20:20.976724 | 2020-08-02T07:12:13 | 2020-08-02T07:12:13 | 104,983,968 | 1 | 0 | null | 2022-07-01T17:39:44 | 2017-09-27T07:03:19 |
Java
|
UTF-8
|
Java
| false | false | 677 |
java
|
package org.lee.algorithm.array;
/**
* 目标对象
* <p>
* Created by liqiangpeng on 2017/11/10.
*/
public class Person {
private String lastName;
private String firstName;
private int age;
public Person(String lastName, String firstName, int age) {
this.lastName = lastName;
this.firstName = firstName;
this.age = age;
}
public String getLastName() {
return lastName;
}
@Override
public String toString() {
return "Person{" +
"lastName='" + lastName + '\'' +
", firstName='" + firstName + '\'' +
", age=" + age +
'}';
}
}
|
[
"[email protected]"
] | |
64832d93f7f8ee3d8ae347df0c4620f5797c4a61
|
54179ac0bf839a9205c55caa416c4e0449e5688f
|
/Chapter 2/ch2_recipe6/src/com/packtpub/java7/concurrency/chapter2/recipe6/core/Main.java
|
01c87a7053e21733de3138d29ca2472269fed12e
|
[] |
no_license
|
sjzpc040529/thread_demo
|
d3a587cce1f1b0af738e36e31a451b0cc260b323
|
92367cc05d81d8d4006504e5dac0e37fa43747ae
|
refs/heads/master
| 2016-09-05T09:35:42.119995 | 2015-09-06T03:34:43 | 2015-09-06T03:34:43 | 33,657,837 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 847 |
java
|
package com.packtpub.java7.concurrency.chapter2.recipe6.core;
import com.packtpub.java7.concurrency.chapter2.recipe6.task.Job;
import com.packtpub.java7.concurrency.chapter2.recipe6.task.PrintQueue;
/**
* Main class of the example
*
*/
public class Main {
/**
* Main method of the example
* @param args
*/
public static void main (String args[]){
// Creates the print queue
PrintQueue printQueue=new PrintQueue();
// Cretes ten jobs and the Threads to run them
Thread thread[]=new Thread[10];
for (int i=0; i<10; i++){
thread[i]=new Thread(new Job(printQueue),"Thread "+i);
}
// Launch a thread ever 0.1 seconds
for (int i=0; i<10; i++){
thread[i].start();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
|
[
"[email protected]"
] | |
2e41105ad330b37ca342ccef6374d124f6ac6932
|
5b7645c48c6c9cd5cd328a73b5a2add6f7000b2a
|
/android-support/skin-support-appcompat/src/main/java/skin/support/content/res/SkinCompatVectorResources.java
|
216415e45db35ecab551292402f366daaa04a433
|
[
"MIT"
] |
permissive
|
ZhangKuixun/Android-skin-support
|
9e33ff110c86b5bf9231729ac122621b91550ba1
|
56221997cca08316da5f1aadc1fb4cf82d22123b
|
refs/heads/master
| 2020-03-23T23:26:06.029350 | 2018-08-28T07:52:59 | 2018-08-28T07:52:59 | 142,234,087 | 0 | 0 |
MIT
| 2018-08-28T07:53:00 | 2018-07-25T02:01:00 |
Java
|
UTF-8
|
Java
| false | false | 2,722 |
java
|
package skin.support.content.res;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.content.res.AppCompatResources;
public class SkinCompatVectorResources implements SkinResources {
private static SkinCompatVectorResources sInstance;
private SkinCompatVectorResources() {
SkinCompatResources.getInstance().addSkinResources(this);
}
public static SkinCompatVectorResources getInstance() {
if (sInstance == null) {
synchronized (SkinCompatVectorResources.class) {
if (sInstance == null) {
sInstance = new SkinCompatVectorResources();
}
}
}
return sInstance;
}
@Override
public void clear() {
SkinCompatDrawableManager.get().clearCaches();
}
private Drawable getSkinDrawableCompat(Context context, int resId) {
if (AppCompatDelegate.isCompatVectorFromResourcesEnabled()) {
if (!SkinCompatResources.getInstance().isDefaultSkin()) {
try {
return SkinCompatDrawableManager.get().getDrawable(context, resId);
} catch (Exception e) {
e.printStackTrace();
}
}
// SkinCompatDrawableManager.get().getDrawable(context, resId) 中会调用getSkinDrawable等方法。
// 这里只需要拦截使用默认皮肤的情况。
if (!SkinCompatUserThemeManager.get().isColorEmpty()) {
ColorStateList colorStateList = SkinCompatUserThemeManager.get().getColorStateList(resId);
if (colorStateList != null) {
return new ColorDrawable(colorStateList.getDefaultColor());
}
}
if (!SkinCompatUserThemeManager.get().isDrawableEmpty()) {
Drawable drawable = SkinCompatUserThemeManager.get().getDrawable(resId);
if (drawable != null) {
return drawable;
}
}
Drawable drawable = SkinCompatResources.getInstance().getStrategyDrawable(context, resId);
if (drawable != null) {
return drawable;
}
return AppCompatResources.getDrawable(context, resId);
} else {
return SkinCompatVectorResources.getDrawableCompat(context, resId);
}
}
public static Drawable getDrawableCompat(Context context, int resId) {
return getInstance().getSkinDrawableCompat(context, resId);
}
}
|
[
"[email protected]"
] | |
77dff97d9d4ceb968a2167faec2d9ef87e3a14e7
|
e7ab156fc4a61b75ea47d921948ad7ff0c009bea
|
/src/main/java/com/discountasciiwarehouse/ecommerce/bean/UserContainer.java
|
2c04c1491d78047bb6570dc786d8e1abb23d147f
|
[] |
no_license
|
dcassiani/xteam
|
891819d74ebf1247feb6b6c4d799af2c215321ff
|
b3f672badaeb09f9188fcb56ae1430b03fc31575
|
refs/heads/master
| 2021-01-10T12:49:12.221238 | 2016-01-07T19:52:02 | 2016-01-07T19:52:02 | 48,544,337 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 354 |
java
|
package com.discountasciiwarehouse.ecommerce.bean;
import java.io.Serializable;
public class UserContainer implements Serializable{
private static final long serialVersionUID = 9024388139990710853L;
private UserDTO user;
public UserDTO getUser() {
return user;
}
public void setUser(UserDTO user) {
this.user = user;
}
}
|
[
"[email protected]"
] | |
381788126a288ef3e649aec6e1372834e03e6d61
|
1e150854c7e959e764453b29c3a611ef8890892d
|
/gen/com/pernix/HolaMundo/BuildConfig.java
|
5f0aba18b2338aac072db93af5da33d014620fd3
|
[] |
no_license
|
pablocastromontero/HolaMundo
|
a2490745ebd34d500f77cd510fa4e2e31a1199cf
|
b0b19828674893ec22d69b5b1faa75c9085d46a8
|
refs/heads/master
| 2016-09-06T07:40:46.955841 | 2012-06-06T21:59:08 | 2012-06-06T21:59:08 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 162 |
java
|
/** Automatically generated file. DO NOT MODIFY */
package com.pernix.HolaMundo;
public final class BuildConfig {
public final static boolean DEBUG = true;
}
|
[
"[email protected]"
] | |
3468eb415a7419e934ec42545fed136ea9ce689c
|
04265ce4a30742bd9ad9701224d1ab1cc86e0496
|
/rest-demo/src/main/java/ru/phi/modules/osm/UpdateObjects.java
|
69831a61044b55691e7f56805c6cee083a699263
|
[
"Apache-2.0"
] |
permissive
|
Pastor/modules
|
500587289cf3dc5bdeaae08519f145bf9bff6e6d
|
5d07030f74ada0a7630973acb2959e7f345eda62
|
refs/heads/master
| 2021-01-16T23:14:08.301878 | 2018-10-19T13:12:44 | 2018-10-19T13:12:44 | 62,468,459 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,204 |
java
|
package ru.phi.modules.osm;
import com.google.common.base.Charsets;
import com.google.common.io.Files;
import lombok.experimental.UtilityClass;
import okhttp3.*;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Attribute;
import org.jsoup.nodes.Attributes;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import ru.phi.modules.osm.generated.Nd;
import ru.phi.modules.osm.generated.Node;
import ru.phi.modules.osm.generated.Way;
import javax.xml.bind.JAXBException;
import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.util.List;
import static java.text.MessageFormat.format;
import static ru.phi.modules.osm.LoadObjects.gson;
@UtilityClass
public final class UpdateObjects {
private static final OkHttpClient client = new OkHttpClient();
public static void main(String[] args) throws IOException, JAXBException {
final LoadObjects.Element[] elements = load();
for (int i = 0, elementsLength = elements.length; i < elementsLength; i++) {
final LoadObjects.Element element = elements[i];
update(element);
element.polygon = polygon(element.longitude, element.latitude);
System.out.println(format("Element {0}: processed", i));
}
final String content = gson.toJson(elements);
Files.write(content, new File("u_objects.json"), Charsets.UTF_8);
}
private static void update(LoadObjects.Element element) throws IOException {
final HttpUrl url = HttpUrl.parse("http://176.112.215.104/osis/ReadOSI")
.newBuilder()
.addQueryParameter("id", element.id)
.build();
final Request request = new Request.Builder().url(url).get().build();
final Call call = client.newCall(request);
final Response execute = call.execute();
final String content = execute.body().string();
if (execute.isSuccessful()) {
final LoadObjects.Element update = gson.fromJson(content, LoadObjects.Element.class);
element.latitude = update.latitude;
element.longitude = update.longitude;
}
}
private static LoadObjects.Location[] polygon(double longitude, double latitude) throws IOException, JAXBException {
final HttpUrl url = HttpUrl
.parse("http://www.openstreetmap.org/geocoder/search_osm_nominatim_reverse")
.newBuilder()
.addQueryParameter("lat", format("{0,number,#.########}", latitude).replaceAll(",", "."))
.addQueryParameter("lon", format("{0,number,#.########}", longitude).replaceAll(",", "."))
.build();
final Request request = new Request.Builder().url(url).get().build();
final Call call = client.newCall(request);
final Response execute = call.execute();
final String content = execute.body().string();
if (execute.isSuccessful()) {
final Document document = Jsoup.parse(content);
final Elements elements = document.select("a");
for (org.jsoup.nodes.Element element : elements) {
final Attributes attributes = element.attributes();
for (Attribute attribute : attributes) {
if (attribute.getKey().equalsIgnoreCase("data-id")) {
final String id = attribute.getValue();
final Way way = Resource.get(Resource.Type.WAY, Long.parseLong(id), Way.class);
if (way == null)
return new LoadObjects.Location[0];
final List<Nd> nodes = Resource.filter(way.getRest(), Nd.class);
final LoadObjects.Location[] locations = new LoadObjects.Location[nodes.size()];
for (int i = 0; i < nodes.size(); i++) {
Nd nd = nodes.get(i);
final Node node = Resource.get(Resource.Type.NODE, nd.getRef().longValue(), Node.class);
if (node != null) {
locations[i] = new LoadObjects.Location();
locations[i].latitude = node.getLat();
locations[i].longitude = node.getLon();
}
}
return locations;
}
}
}
}
System.out.println(content);
return new LoadObjects.Location[0];
}
private static LoadObjects.Element[] load() throws IOException {
final HttpUrl url = HttpUrl.parse("http://176.112.215.104/osis/ReadOSIs");
final Request request = new Request.Builder().url(url).get().build();
final Call call = client.newCall(request);
final Response execute = call.execute();
final ResponseBody body = execute.body();
if (execute.isSuccessful()) {
try (Reader reader = body.charStream()) {
return gson.fromJson(reader, LoadObjects.Element[].class);
}
}
System.out.println(body.string());
return new LoadObjects.Element[0];
}
}
|
[
"[email protected]"
] | |
bd78c8b84c7851f1db87f9a9086f3695b1c73d6c
|
501243689241be0a22b63628b4d44694c8ea9329
|
/org.eclipse.om2m.SmartSecurity/src/main/java/org/eclipse/om2m/SmartSecurity/controller/AuthenticationController.java
|
6fec65609c526722e3d47c1d82d22d6465247f13
|
[] |
no_license
|
tinsae-debele/Smart_E-Health-System-
|
f2e6364eb396cc21d3f591b9bb524b903c5417c3
|
7ba6f029e7d9112ae46e533347f5790c80be1fd1
|
refs/heads/main
| 2023-04-01T22:54:14.136583 | 2021-04-13T20:22:31 | 2021-04-13T20:22:31 | 346,442,151 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,630 |
java
|
package org.eclipse.om2m.SmartSecurity.controller;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import org.eclipse.om2m.SmartSecurity.model.Authentication;
public class AuthenticationController {
private Authentication auth = new Authentication();
public boolean checkUser(String username, String userDeatil){
return auth.checkUsername(username , userDeatil);
}
public void startup() {}
public boolean checkPassword(String name,String password , String userDATA) {
MessageDigest hashAlg;
try {
//getting the User details to take out the salt to encrypt and the password to verify.
Authentication Auth = new Authentication();
String []originalPass = Auth.getPasswordandSalt(name , userDATA);
byte [] salt = new byte[64];
byte [] Password = new byte[32];
String [] temp = (originalPass[1].substring(1, originalPass[1].length()-1)).split(",");
String [] temp2 = (originalPass[0].substring(1, originalPass[0].length()-1)).split(",");
for (int i = 0; i <salt.length;i++) {
salt[i] = Byte.parseByte(temp[i].replace(" ", ""));
if(i % 2 == 0) {Password[i/2] = Byte.parseByte(temp2[i/2].replace(" ", ""));}
}
hashAlg = MessageDigest.getInstance("SHA-256");
hashAlg.update(salt);
if(originalPass[0].equals(Arrays.toString(hashAlg.digest(password.getBytes())))) { return true; }
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return false;
}
public String setUserNameandRole(String username , String userDetail) {
return auth.setUserNameandRole(username , userDetail);
}
}
|
[
"[email protected]"
] | |
754bcf030609fe301cd9c7da088afde45f239148
|
b780b760a17420c9cbbcfdc9cfe58d1c60696113
|
/applibrary/src/main/java/hzxmkuar/com/applibrary/domain/wash/WashItemTo.java
|
af8a6be12830aa16a7bea1d6433b44aaee5970e1
|
[] |
no_license
|
hupulin/MyApplication
|
70d804b373d65723effffa48b7446b159307f507
|
2db5f5f4c51af47b30370140f749343d4bb5954b
|
refs/heads/master
| 2020-04-13T01:52:21.725658 | 2019-09-11T13:52:57 | 2019-09-11T13:52:57 | 162,886,234 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 346 |
java
|
package hzxmkuar.com.applibrary.domain.wash;
import lombok.Data;
/**
* Created by Administrator on 2018/12/26.
*/
@Data
public class WashItemTo {
private String imageUrl="http://118.190.201.28:8080/img/weiyi.png";
private String name="卫衣";
private boolean select;
private String aroma_money="99";
private int num=1;
}
|
[
"[email protected]"
] | |
5567e728ae557975689afe65f1d7a8744aebf573
|
ab3b992f71c4c1d9bad8cc3b449d57e47f19864f
|
/src/main/java/pl/edu/utp/po/services/NoteServiceImpl.java
|
43caee91acd3f7d378b1792ee2ab5097d1a14ecb
|
[] |
no_license
|
zenderable-student/lab3_notes
|
50e99c4e5f4a42dd4a18160acee124d88d3dd9c2
|
c4c5b76fbcd2466c9fe26034df3ca335285ced36
|
refs/heads/master
| 2022-10-25T19:28:18.988783 | 2020-06-15T20:05:15 | 2020-06-15T20:05:15 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 649 |
java
|
package pl.edu.utp.po.services;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pl.edu.utp.po.domain.Note;
import pl.edu.utp.po.repositories.NoteRepository;
@Service
public class NoteServiceImpl implements NoteService {
private NoteRepository noteRepository;
@Autowired
public NoteServiceImpl(NoteRepository noteRepository) {
this.noteRepository = noteRepository;
}
@Override
public List<Note> listOfNotes() {
return noteRepository.findByOrderByTimestampDesc();
}
@Override
public void addNote(Note n) {
noteRepository.save(n);
}
}
|
[
"[email protected]"
] | |
7e6a7490d42a6a788526c083f4aff9e2d9119858
|
f0b89bd7213751caf9a94f226684cbe03f31b0c8
|
/Reporter/src/com/example/reporter/FlashPhase3Activity.java
|
929f80816cf91e13878d8cf77e5e22a8b941cb40
|
[] |
no_license
|
codeforresilience/readysaster
|
e58199df58c6818e61eb597205b7be191a324988
|
3cb7abafbc49a3c826879d4eab989820a3bfb717
|
refs/heads/master
| 2021-01-18T03:36:54.912348 | 2014-05-11T05:05:12 | 2014-05-11T05:05:12 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,606 |
java
|
package com.example.reporter;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.telephony.SmsManager;
import android.util.Log;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.CompoundButton;
import android.widget.Toast;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.os.Build;
import android.widget.CheckBox;
public class FlashPhase3Activity extends ActionBarActivity implements OnCheckedChangeListener, OnClickListener {
private Bundle bundle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_flash_phase3);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}
bundle = getIntent().getExtras();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.phase3, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_flash_phase3,
container, false);
return rootView;
}
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO Auto-generated method stub
}
@Override
public void onClick(View v) {
String search = ((CheckBox) findViewById(R.id.checkBoxSearch)).isChecked() ? "1" : "0";
String evacuation = ((CheckBox) findViewById(R.id.checkBoxEvacuation)).isChecked() ? "1" : "0";
String protection = ((CheckBox) findViewById(R.id.checkBoxProtection)).isChecked() ? "1" : "0";
String medicine = ((CheckBox) findViewById(R.id.checkBoxMedicine)).isChecked() ? "1" : "0";
String shelter = ((CheckBox) findViewById(R.id.checkBoxShelter)).isChecked() ? "1" : "0";
String food = ((CheckBox) findViewById(R.id.checkBoxFood)).isChecked() ? "1" : "0";
String water = ((CheckBox) findViewById(R.id.checkBoxWater)).isChecked() ? "1" : "0";
String sanitation = ((CheckBox) findViewById(R.id.checkBoxSanitation)).isChecked() ? "1" : "0";
String repair = ((CheckBox) findViewById(R.id.checkBoxRepair)).isChecked() ? "1" : "0";
//bundle.putString("phase3", "|" + search + "|" + evacuation + "|" + protection + "|" + medicine + "|" + shelter + "|" + food + "|" + water + "|" + sanitation + "|" + repair);
// getting gps
String stringLatitude = "0.0";
String stringLongitude = "0.0";
GPSTracker gpsTracker = new GPSTracker(this);
if (gpsTracker.canGetLocation())
{
stringLatitude = String.valueOf(gpsTracker.latitude);
stringLongitude = String.valueOf(gpsTracker.longitude);
}
else
{
// can't get location
// GPS or Network is not enabled
// Ask user to enable GPS/network in settings
}
String phase1 = bundle.getString("phase1")+"|"+stringLatitude+","+stringLongitude;
String phase2 = bundle.getString("phase2");
String phase3 = "|" + search + "|" + evacuation + "|" + protection + "|" + medicine + "|" + shelter + "|" + food + "|" + water + "|" + sanitation + "|" + repair;
String phoneNo = "+639167343602";
String message = phase1 + phase2 + phase3;
Log.d("text", message);
// check if there are values for both
if (phoneNo.length()>0 && message.length()>0)
sendSMS(phoneNo, message);
else
Toast.makeText(getBaseContext(),
"Please enter both phone number and message.",
Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, SubmitActivity.class);
//intent.putExtras(bundle);
startActivity(intent);
}
private void sendSMS(String phoneNumber, String message) {
finish();
// this will re-open the Sms1Activity upon completion
PendingIntent pi = PendingIntent.getActivity(this,
0,
new Intent(this, MainActivity.class),
0);
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber,
null, // null == use default SMSC
message,
pi, // sent intent
null);
}
}
|
[
"[email protected]"
] | |
840a256b2f5cba2c0f3112136d62d85ec1d03684
|
93d4a81be9a45d826ae391c69eca3335b506673e
|
/api-parent/api-framework/src/main/java/org/redcenter/api/vo/ApiAttribute.java
|
0c72fba0029fc3f741aa7ade0b5684a31d6e502a
|
[] |
no_license
|
boneman1231/api
|
4d47a4e376bb28834899eb1a58eefa5d79e5cc38
|
665ac12c89e2bcdcad683502baa463aefdc95a90
|
refs/heads/master
| 2021-01-23T19:14:07.403988 | 2015-10-25T12:41:13 | 2015-10-25T12:41:13 | 35,485,253 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,615 |
java
|
package org.redcenter.api.vo;
import java.util.ArrayList;
import org.redcenter.api.HtmlUtils;
public class ApiAttribute {
protected String key;
protected String name;
protected String type;
protected String value;
protected ArrayList<ApiAttribute> options;
protected String description;
public ApiAttribute() {
}
public ApiAttribute(String key, String value) {
this.key = key;
this.name = key;
this.type = String.class.getName();
this.value = value;
this.description = "";
}
public ApiAttribute(String key, String name, String type, String value,
String description) {
this.key = key;
this.name = name;
this.type = type;
this.value = value;
this.description = description;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getType() {
return type;
}
public void setType(Class<?> typeClass) {
// get input type for Angular JS
this.type = HtmlUtils.getInputType(typeClass);
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public ArrayList<ApiAttribute> getOptions() {
return options;
}
public void setOptions(ArrayList<ApiAttribute> options) {
this.options = options;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
|
[
"[email protected]"
] | |
10e1729c8e6ea037432ce009832fa78f488a479e
|
b3f2f06be2fa0965c2919ff2b90307895b4a3e59
|
/ProjectSupportSystem/src/com/projectsupport/services/CookieFilter.java
|
234e65baf3e4ee87ac2c2a6ef952539a09c11a82
|
[] |
no_license
|
websterKAT/GroupProject
|
6c07cad701e89ff23e4e38c0ccb0b7a5283d65d2
|
6e33843064a9e5f7c3e140e5fc6ae245d8ba73ae
|
refs/heads/master
| 2021-01-19T15:09:26.184361 | 2017-08-21T20:15:41 | 2017-08-21T20:15:41 | 100,946,714 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,887 |
java
|
package com.projectsupport.services;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Map;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import com.projectsupport.models.User;
@WebFilter(filterName = "cookieFilter",urlPatterns = {"/*"})
public class CookieFilter implements Filter{
public CookieFilter(){
}
@Override
public void init(FilterConfig fConfig) throws ServletException {
// TODO Auto-generated method stub
}
@Override
public void destroy() {
// TODO Auto-generated method stub
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
HttpSession session = req.getSession();
User userInSession = MyUtils.getLoginedUser(session);
if(userInSession != null){
session.setAttribute("COOKIE_CHECKED", "CHECKED");
chain.doFilter(request, response);
return;
}
Connection conn = MyUtils.getStoredConnection(request);
String checked = (String) session.getAttribute("COOKIE_CHECKED");
if(checked == null && conn != null){
String userName = MyUtils.getUserNameInCookie(req);
try{
User user = UserServices.findUser(conn, userName);
MyUtils.storeLoginedUser(session, user);
} catch(SQLException e){
e.printStackTrace();
}
session.setAttribute("COOKIE_CHECKED", "CHECKED");
}
chain.doFilter(request, response);
}
}
|
[
"[email protected]"
] | |
30ed5d3d812a461978627334d1d6fed2722ccb8c
|
a02b9f80dd2f039a9d12d206af38d44aedc24e66
|
/SillyChildTrave/app/src/main/java/com/yinglan/sct/adapter/loginregister/SelectCountryCodeViewAdapter.java
|
a5679cb3d4defbd465ae4dec33e2440e47f45094
|
[
"Apache-2.0"
] |
permissive
|
921668753/SillyChildTravel-Android
|
6bab2129cb3cb9b600166193f478cb5a64651722
|
eb2574bf1bb5934b3efbc7cb87f0a8ec3bbfa03f
|
refs/heads/master
| 2020-03-31T15:35:51.838597 | 2018-10-19T10:13:20 | 2018-10-19T10:13:20 | 152,343,076 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,582 |
java
|
package com.yinglan.sct.adapter.loginregister;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.yinglan.sct.R;
import com.yinglan.sct.entity.loginregister.SelectCountryCodeBean.DataBean;
import java.util.List;
/**
* 国家地区码 适配器
* Created by Admin on 2017/8/15.
*/
public class SelectCountryCodeViewAdapter extends RecyclerView.Adapter<SelectCountryCodeViewAdapter.ViewHolder> {
protected Context mContext;
protected List<DataBean> mDatas;
protected LayoutInflater mInflater;
private ViewCallBack callBack;//回调
public SelectCountryCodeViewAdapter(Context mContext, List<DataBean> mDatas) {
this.mContext = mContext;
this.mDatas = mDatas;
mInflater = LayoutInflater.from(mContext);
}
public List<DataBean> getDatas() {
return mDatas;
}
public SelectCountryCodeViewAdapter setDatas(List<DataBean> datas) {
mDatas = datas;
return this;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new ViewHolder(mInflater.inflate(R.layout.item_selectcountry, parent, false));
}
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
final DataBean resultBean = mDatas.get(position);
holder.tv_country.setText(resultBean.getChina_name());
holder.tv_areaCode.setText("+" + resultBean.getCountry_code());
holder.content.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
callBack.onClickListener(resultBean.getCountry_code());
}
});
}
@Override
public int getItemCount() {
return mDatas != null ? mDatas.size() : 0;
}
public static class ViewHolder extends RecyclerView.ViewHolder {
TextView tv_country;
TextView tv_areaCode;
View content;
public ViewHolder(View itemView) {
super(itemView);
tv_country = (TextView) itemView.findViewById(R.id.tv_country);
tv_areaCode = (TextView) itemView.findViewById(R.id.tv_areaCode);
content = itemView.findViewById(R.id.content);
}
}
public void setViewCallBack(ViewCallBack callBack) {
this.callBack = callBack;
}
public interface ViewCallBack {
void onClickListener(String code);
}
}
|
[
"[email protected]"
] | |
4f65bfaa117e48cfbbde2dbb24f357a47c1d53ec
|
82941071f4d04f9fddf208f5cbeb9cca1c9ee5c2
|
/src/kran/poly/graphics/Texture.java
|
3282ba2427b2a9533aa060c18bf094eaa288f458
|
[] |
no_license
|
markhwrh/PolyEngine
|
a64f9eb8981d658712ac5232ec50e30dd7bc9555
|
18ceb58b3a080c700e8c9d65ec412a833c51b78a
|
refs/heads/master
| 2021-05-29T01:44:42.393045 | 2015-04-17T22:08:31 | 2015-04-17T22:08:31 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 525 |
java
|
package kran.poly.graphics;
import static org.lwjgl.opengl.GL11.*;
/**
* Created by Mark on 2015-04-17.
*/
public class Texture {
public final int handle;
public final int width;
public final int height;
public Texture(int width, int height) {
handle = glGenTextures();
this.width = width;
this.height = height;
}
public void bind() {
glBindTexture(GL_TEXTURE_2D, handle);
}
public void unbind() {
glBindTexture(GL_TEXTURE_2D, 0);
}
public void destroy() {
glDeleteTextures(handle);
}
}
|
[
"[email protected]"
] | |
925a20798d9941e9cee75f83bc497eef23bea526
|
ee26e1ee900382981a0310db751c232da8906bab
|
/.svn/pristine/6f/6f88c0033f6fdd8295aa1908130863bcf6f237d9.svn-base
|
bd2cc89cdba148e63e2bc25679a50a163c46936a
|
[] |
no_license
|
ChoiMK/Outsourcing-Platform
|
7c984b42488578dfba4f16ece09d86096899c71e
|
e4b564a22f8c1e3d566ad2b9fe89c3e435f15609
|
refs/heads/master
| 2020-12-03T07:59:12.415775 | 2017-06-28T08:10:09 | 2017-06-28T08:10:09 | 95,645,021 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,530 |
package kr.or.plzdvl.reference.dao;
import java.util.List;
import java.util.Map;
import kr.or.plzdvl.reference.vo.ReferenceVO;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository("referenceDao")
public class ReferenceDao {
@Autowired
private SqlSessionTemplate sqlSession;
// 자료실 등록
public void insertReference(ReferenceVO referenceInfo) throws Exception {
sqlSession.insert("reference.insertReference", referenceInfo);
}
// 자료실 수정
public int updateReference(ReferenceVO referenceInfo) throws Exception {
return sqlSession.update("reference.updateReference", referenceInfo);
}
// 자료실 삭제
public int deleteReference(Map<String, String> params ) throws Exception {
return sqlSession.update("reference.deleteReference", params);
}
// 자료실 리스트
public List<ReferenceVO> getReferenceList(Map<String, String> params) throws Exception {
return sqlSession.selectList("reference.referenceList", params);
}
// 자료실 상세보기 & 조회수 증가
public ReferenceVO getReferenceInfo(Map<String, String> params) throws Exception {
sqlSession.update("reference.hitReference", params);
return (ReferenceVO) sqlSession.selectOne("reference.referenceInfo", params);
}
// 좋아요 수 증가
public int goodReference(Map<String, String> params) throws Exception {
return sqlSession.update("reference.goodReference", params);
}
}
|
[
"[email protected]"
] | ||
a8d4d4b30113b6281cc27b90659a40175b7b25e3
|
7be623b46a8a2d4c9eb3a3653b9e44bf22c6f375
|
/src/cn/minelock/android/SettingMoreActivity.java
|
8e4dea5e6fb77719cd989cdf83a3c31232bfca3e
|
[] |
no_license
|
atlantisy/meiyan
|
b796489b41cc654fb85804dbd0d1eab4993024b1
|
893294e52d7c4a84a7e45356990aaf8e8862dbee
|
refs/heads/master
| 2021-01-15T13:01:59.892006 | 2015-04-21T15:54:42 | 2015-04-21T15:54:42 | 11,230,902 | 2 | 2 | null | null | null | null |
GB18030
|
Java
| false | false | 7,288 |
java
|
package cn.minelock.android;
import cn.minelock.android.SettingActivity.OnCheckedListener;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageButton;
import android.widget.RadioButton;
import android.widget.RadioGroup;
public class SettingMoreActivity extends Activity {
private SharedPreferences prefs = null;
public static final String PREFS = "lock_pref";// pref文件名
public static final String STATUSBAR = "statusbar";
public static final String VIBRATE = "vibrate";
public static final String SHOWRIGHT = "showRight";
public static final String LEFTCAMERA = "leftCamera";
public static final String SHOWPASSWORD = "showPassword";
public static final String PWCOLOR = "passwordColor";
private CheckBox statusbar_checkbox = null;
private CheckBox vibrate_checkbox = null;
private CheckBox showright_checkbox = null;
private CheckBox leftcamera_checkbox = null;
private CheckBox showpassword_checkbox = null;
private CheckBox colorpassword_checkbox = null;
private boolean mStatusbar = false;
private boolean mVibrate = true;
private boolean mShowRight = true;
private boolean mLeftCamera = false;
private boolean mShowPassword = true;
private boolean mColorPassword = true;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settingmore);
// 获取保存的prefs数据
prefs = getSharedPreferences(PREFS, 0);
//prefs = PreferenceManager.getDefaultSharedPreferences(this);
// 显示状态栏
mStatusbar = prefs.getBoolean(STATUSBAR, false);
statusbar_checkbox = (CheckBox) findViewById(R.id.statusbar_checkbox);
statusbar_checkbox.setChecked(mStatusbar);
statusbar_checkbox.setOnClickListener(new OnStatusbarListener());
// 开启振动
mVibrate = prefs.getBoolean(VIBRATE, true);
vibrate_checkbox = (CheckBox) findViewById(R.id.vibrate_checkbox);
vibrate_checkbox.setChecked(mVibrate);
vibrate_checkbox.setOnClickListener(new OnVibrateListener());
// 显示右滑箭头
mShowRight = prefs.getBoolean(SHOWRIGHT, true);
showright_checkbox = (CheckBox) findViewById(R.id.showright_checkbox);
showright_checkbox.setChecked(mShowRight);
showright_checkbox.setOnClickListener(new OnShowRightListener());
// 左滑相机
mLeftCamera = prefs.getBoolean(LEFTCAMERA, false);
leftcamera_checkbox = (CheckBox) findViewById(R.id.lefttocamera_checkbox);
leftcamera_checkbox.setChecked(mLeftCamera);
leftcamera_checkbox.setOnClickListener(new OnLeftCameraListener());
// 显示手势密码轨迹
mShowPassword = prefs.getBoolean(SHOWPASSWORD, true);
showpassword_checkbox = (CheckBox) findViewById(R.id.showpassword_checkbox);
showpassword_checkbox.setChecked(mShowPassword);
showpassword_checkbox.setOnClickListener(new OnShowPasswordListener());
// 显示彩色手势密码
mColorPassword = prefs.getBoolean(PWCOLOR, true);
colorpassword_checkbox = (CheckBox) findViewById(R.id.colorpassword_checkbox);
colorpassword_checkbox.setChecked(mColorPassword);
colorpassword_checkbox.setOnClickListener(new OnColorPasswordListener());
// 选择手势密码颜色
/* RadioGroup radioGroup = (RadioGroup) findViewById(R.id.PatternColorGroup);
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener(){
@Override
public void onCheckedChanged(RadioGroup group, int checkedId){
// TODO Auto-generated method stub
RadioButton alpha = (RadioButton) findViewById(R.id.PatternAlpha);
RadioButton red = (RadioButton) findViewById(R.id.PatternRed);
RadioButton yellow = (RadioButton) findViewById(R.id.PatternYellow);
RadioButton green = (RadioButton) findViewById(R.id.PatternGreen);
RadioButton blue = (RadioButton) findViewById(R.id.PatternBlue);
int color = 1;
if(checkedId == alpha.getId()){
color = 1;
}
else if(checkedId == red.getId()){
color = 2;
}
else if(checkedId == yellow.getId()){
color = 3;
}
else if(checkedId == green.getId()){
color = 4;
}
else if(checkedId == blue.getId()){
color = 5;
}
// 将颜色值存入pref中
SharedPreferences.Editor editor = prefs.edit();
editor.putInt(PWCOLOR, color);
editor.commit();
}
});*/
// 返回按钮
ImageButton return_btn = (ImageButton) findViewById(R.id.moresetting_return);
return_btn.setOnClickListener(returnOnClickListener);
}
// 显示状态栏
class OnStatusbarListener implements OnClickListener {
public void onClick(View v) {
mStatusbar = statusbar_checkbox.isChecked();
//将开关check值存入pref中
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean(STATUSBAR, mStatusbar);
editor.commit();
}
}
// 开启振动
class OnVibrateListener implements OnClickListener {
public void onClick(View v) {
mVibrate = vibrate_checkbox.isChecked();
//将开关check值存入pref中
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean(VIBRATE, mVibrate);
editor.commit();
}
}
// 显示右滑箭头
class OnShowRightListener implements OnClickListener {
public void onClick(View v) {
mShowRight = showright_checkbox.isChecked();
//将开关check值存入pref中
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean(SHOWRIGHT, mShowRight);
editor.commit();
}
}
// 左滑相机
class OnLeftCameraListener implements OnClickListener {
public void onClick(View v) {
mLeftCamera = leftcamera_checkbox.isChecked();
//将开关check值存入pref中
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean(LEFTCAMERA, mLeftCamera);
editor.commit();
}
}
// 显示手势密码轨迹
class OnShowPasswordListener implements OnClickListener {
public void onClick(View v) {
mShowPassword = showpassword_checkbox.isChecked();
//将开关check值存入pref中
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean(SHOWPASSWORD, mShowPassword);
editor.commit();
}
}
// 显示多彩手势密码
class OnColorPasswordListener implements OnClickListener {
public void onClick(View v) {
mColorPassword = colorpassword_checkbox.isChecked();
//将开关check值存入pref中
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean(PWCOLOR, mColorPassword);
editor.commit();
}
}
// 返回按钮
private OnClickListener returnOnClickListener = new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
/* startActivity(new Intent(SettingMoreActivity.this, SettingActivity.class));
overridePendingTransition(R.anim.push_right_in,R.anim.push_right_out);*/
finish();
}
};
}
|
[
"[email protected]"
] | |
5a6f9e9a3e14a766511cc89abcbb2b3f84f8db43
|
1d786de7af47dfc96e66088a1babecac317855d9
|
/src/com/microlabs/newsandmedia/form/ArchivesForm.java
|
570171c05d4d20acbbdd0c1116fa1228131190bc
|
[] |
no_license
|
rvkumar/EMicro
|
1c67cafc17caf8440f8557c187d900c6e1ada0f7
|
258f8fa52c88fd8f25e37b30093f0f1ff4d76589
|
refs/heads/master
| 2020-03-08T13:57:27.754922 | 2018-04-05T07:05:01 | 2018-04-05T07:05:01 | 128,171,647 | 0 | 0 | null | 2018-04-09T10:26:40 | 2018-04-05T07:15:58 |
Java
|
UTF-8
|
Java
| false | false | 1,430 |
java
|
package com.microlabs.newsandmedia.form;
import org.apache.struts.action.ActionForm;
public class ArchivesForm extends ActionForm {
private int id;
private int year;
private String linkName;
private String contentDescription;
private String filePath;
private String subLinkName;
private String videoPath;
private String mainLinkName;
public String getMainLinkName() {
return mainLinkName;
}
public void setMainLinkName(String mainLinkName) {
this.mainLinkName = mainLinkName;
}
public String getSubLinkName() {
return subLinkName;
}
public void setSubLinkName(String subLinkName) {
this.subLinkName = subLinkName;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public String getLinkName() {
return linkName;
}
public void setLinkName(String linkName) {
this.linkName = linkName;
}
public String getContentDescription() {
return contentDescription;
}
public void setContentDescription(String contentDescription) {
this.contentDescription = contentDescription;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getVideoPath() {
return videoPath;
}
public void setVideoPath(String videoPath) {
this.videoPath = videoPath;
}
}
|
[
"[email protected]"
] | |
1c021129fa0793c125ab099e5c76368600404f90
|
012e3f785979d76ee0152da826506e60d4efcbd4
|
/application/src/main/java/com/sap/cloud/s4hana/examples/addressmgr/commands/CreateAddressCommand.java
|
9cc130044e3532bd7ad2821efe1180afa08a4d12
|
[] |
no_license
|
macdaly/address-manager
|
bdc32b81c804d5d10226e9afdbce98b08f9c72f8
|
0c1468b317f75fcfffa7308d89f1c0fe7f5dafb8
|
refs/heads/master
| 2020-04-07T18:04:12.335472 | 2018-11-28T20:00:55 | 2018-11-28T20:00:55 | 158,595,542 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,369 |
java
|
package com.sap.cloud.s4hana.examples.addressmgr.commands;
import com.sap.cloud.sdk.frameworks.hystrix.HystrixUtil;
import com.sap.cloud.sdk.s4hana.connectivity.ErpCommand;
import org.slf4j.Logger;
import com.sap.cloud.sdk.cloudplatform.logging.CloudLoggerFactory;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.businesspartner.BusinessPartnerAddress;
import com.sap.cloud.sdk.s4hana.datamodel.odata.services.BusinessPartnerService;
public class CreateAddressCommand extends ErpCommand<BusinessPartnerAddress> {
private static final Logger logger = CloudLoggerFactory.getLogger(CreateAddressCommand.class);
private final BusinessPartnerService service;
private final BusinessPartnerAddress addressToCreate;
public CreateAddressCommand(final BusinessPartnerService service, final BusinessPartnerAddress addressToCreate) {
super(HystrixUtil.getDefaultErpCommandSetter(
CreateAddressCommand.class,
HystrixUtil.getDefaultErpCommandProperties().withExecutionTimeoutInMilliseconds(10000)));
this.service = service;
this.addressToCreate = addressToCreate;
}
@Override
protected BusinessPartnerAddress run() throws Exception {
// TODO: Replace with Virtual Data Model query
return service.createBusinessPartnerAddress(this.addressToCreate).execute();
}
}
|
[
"[email protected]"
] | |
1e1e6dadf7045e24dfa320de5fc4120a77a06689
|
fa2a44412aa81efb725c177ff92ba4bbdccff294
|
/microservicecloud-eureka-7001/src/main/java/com/atguigu/springcloud/EurekaServer7001_App.java
|
2024e410ab20f6ea301e37e483002b770c732e73
|
[] |
no_license
|
zhengxing2/springcloudOne
|
dbd341382a55b24793fbb86b7f48057f2bf2589a
|
081d701018138286dfc83774fc61e70ed6741bf4
|
refs/heads/master
| 2023-06-26T17:17:10.232866 | 2021-07-29T03:13:05 | 2021-07-29T03:13:05 | 390,584,209 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 629 |
java
|
package com.atguigu.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
/**
* @program: miroservicecloudM
* @description: Eureka启动类
* @author: ZX
* @create: 2021-06-28 15:58
* @version: 1.0
**/
@SpringBootApplication
@EnableEurekaServer//EurekaServer服务器端启动类,接受其它微服务注册进来
public class EurekaServer7001_App {
public static void main(String[] args) {
SpringApplication.run(EurekaServer7001_App.class,args);
}
}
|
[
"Z983373864"
] |
Z983373864
|
f4872a98d63342fdc7a6ff874c48da43fa23864b
|
c3752205af13b9c38625c2251485b866340867ef
|
/ProyectoWiaw2/src/main/java/org/escoladeltreball/proyectowiaw2/exceptions/DownloadDeniedException.java
|
67f65d7711cdcc014df472ec56240e2e00351ee8
|
[] |
no_license
|
Daviid-P/proyectoWiaw2
|
8862014fcc820233821ebc1f633c683c0e780333
|
01548024c8a19bed3ae38577ffc5bc23a588c94e
|
refs/heads/main
| 2023-08-26T22:07:46.671529 | 2021-11-08T10:48:59 | 2021-11-08T10:48:59 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 165 |
java
|
package org.escoladeltreball.proyectowiaw2.exceptions;
public class DownloadDeniedException extends Exception {
public DownloadDeniedException() { super(); }
}
|
[
"[email protected]"
] | |
4536ad0cf523d0dc5e0c8d0efb04e5c0c1f07316
|
6dd7ba2a9c22f42d7d24fee277985dd82947c162
|
/src/main/java/gt/app/exception/InvalidDataException.java
|
7986d5b9a2c5a766c6c148c06a440f2d0b2ecd83
|
[] |
no_license
|
SafoSDSolutions/spring-boot-blog-app
|
d2926533d4a8108d467126b96f3bbb7b82b143e0
|
07465365a4febfeebbe6ae2371826a123ce56648
|
refs/heads/master
| 2023-07-11T18:59:30.284217 | 2021-08-29T02:11:21 | 2021-08-29T02:11:21 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 358 |
java
|
package gt.app.exception;
import java.io.Serial;
public class InvalidDataException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
public InvalidDataException(String message) {
super(message);
}
public InvalidDataException(String message, Throwable e) {
super(message, e);
}
}
|
[
"[email protected]"
] | |
83b433d8b43bf2c1771d7e1b0f461dca38be1e24
|
3161c796da5663662d8449d9de38d0deae7d593a
|
/WolfKill/app/src/main/java/com/nwsuaf/werewolf/common/util/sys/AndTools.java
|
fe946f21fcc61b6c10ea1d4d59acf50fc3b85b29
|
[] |
no_license
|
lzc598906167/MyProject
|
5f0fed3c8e0a8302266f1d6b4461b28829c61ca5
|
11c995f0c3e3d6cc99c7084298a3896e8d841671
|
refs/heads/master
| 2021-07-04T11:03:41.184501 | 2018-07-03T07:58:33 | 2018-07-03T07:58:33 | 96,624,671 | 3 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,273 |
java
|
package com.nwsuaf.werewolf.common.util.sys;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.os.PowerManager;
import android.telephony.TelephonyManager;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Field;
public class AndTools {
public static int dp2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
public static int px2dip(Context context, float pxValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (pxValue / scale + 0.5f);
}
/**
* 在某个Activity中隐藏输入法
*
* @param context
*/
public static void hideIME(Activity context) {
try {
((InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(
context.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
} catch (Exception npe) {
;
}
}
public static int getVerCode(Context context) {
int verCode = -1;
try {
verCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
} catch (NameNotFoundException e) {
e.printStackTrace();
}
return verCode;
}
public static String getVerName(Context context) {
String verName = "";
try {
verName = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
} catch (NameNotFoundException e) {
e.printStackTrace();
}
return verName;
}
public static String getDeviceId(Activity context) {
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
return tm.getDeviceId();
}
/**
* 显示键盘
* @param view
*/
public static void showKeyboard(Activity context, View view){
InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(view, 0);
}
/**
* 隐藏键盘
*/
public static void hideKeyboard(Activity context, View view) {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
/**
* 获取键盘是否已经打开
*/
public static boolean isKeyboardShowing(Activity context, View view) {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
return imm.isAcceptingText();
}
private static PowerManager.WakeLock m_wakeLockObj = null;
@SuppressWarnings("deprecation")
public static void AcquireWakeLock(long milltime,Context context) {
ReleaseWakeLock();
if (m_wakeLockObj == null) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
m_wakeLockObj = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK
| PowerManager.ACQUIRE_CAUSES_WAKEUP
| PowerManager.ON_AFTER_RELEASE, "AcquireWakeLock");
m_wakeLockObj.acquire(milltime);
}
}
public static void ReleaseWakeLock() {
if (m_wakeLockObj != null && m_wakeLockObj.isHeld()) {
m_wakeLockObj.release();
}
m_wakeLockObj = null;
}
/** 判断手机是否root,不弹出root请求框<br/> */
public static boolean isRoot() {
String binPath = "/system/bin/su";
String xBinPath = "/system/xbin/su";
if (new File(binPath).exists() && isExecutable(binPath))
return true;
if (new File(xBinPath).exists() && isExecutable(xBinPath))
return true;
return false;
}
//未root手机,大部分手机没有这两个文件夹,小米手机有这个文件夹,因此还需要判断文件拥有者对这个文件是否具有可执行权限
private static boolean isExecutable(String filePath) {
Process p = null;
try {
p = Runtime.getRuntime().exec("ls -l " + filePath);
// 获取返回内容
BufferedReader in = new BufferedReader(new InputStreamReader(
p.getInputStream()));
String str = in.readLine();
if (str != null && str.length() >= 4) {
char flag = str.charAt(3);
if (flag == 's' || flag == 'x')
return true;
}
} catch (IOException e) {
e.printStackTrace();
}finally{
if(p!=null){
p.destroy();
}
}
return false;
}
/**
* fuction: 设置固定的宽度,高度随之变化,使图片不会变形
*
* @param target
* 需要转化bitmap参数
* @param newWidth
* 设置新的宽度
* @return
*/
public static Bitmap fitBitmap(Bitmap target, int newWidth)
{
if(target == null){
return null;
}
int width = target.getWidth();
int height = target.getHeight();
Matrix matrix = new Matrix();
float scaleWidth = ((float) newWidth) / width;
matrix.postScale(scaleWidth, scaleWidth);
Bitmap bmp = Bitmap.createBitmap(target, 0, 0, width, height, matrix,true);
return bmp;
}
public static void fixInputMethodManagerLeak(Context destContext) {
if (destContext == null) {
return;
}
InputMethodManager imm = (InputMethodManager) destContext.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm == null) {
return;
}
String [] arr = new String[]{"mCurRootView", "mServedView", "mNextServedView"};
Field f;
Object obj_get;
for (String param : arr) {
try{
f = imm.getClass().getDeclaredField(param);
if (!f.isAccessible()) {
f.setAccessible(true);
}
obj_get = f.get(imm);
if (obj_get != null && obj_get instanceof View) {
View v_get = (View) obj_get;
if (v_get.getContext() == destContext) { // 被InputMethodManager持有引用的context是想要目标销毁的
f.set(imm, null); // 置空,破坏掉path to gc节点
} else {
// 不是想要目标销毁的,即为又进了另一层界面了,不要处理,避免影响原逻辑,也就不用继续for循环了
break;
}
}
}catch(Throwable t){
t.printStackTrace();
}
}
}
}
|
[
"[email protected]"
] | |
9b1302fb0b2ec2fda6e24ff1a294965ea33167bf
|
404475cfd3471e197b4a6637398a0ffcdc0c2904
|
/app/src/main/java/com/yiaosi/aps/ui/RemindNoticeListFragment.java
|
cfdfaaa836de9132172f32d9af0d7dbe5a4ff595
|
[] |
no_license
|
Lion2003/APSDemo
|
826d0752323ec0e9c55b69f49c061d3c936d29f7
|
b8c2f32140d48836d90dcc17eba4b185c35ac236
|
refs/heads/master
| 2021-01-01T20:31:19.390078 | 2017-12-27T16:13:19 | 2017-12-27T16:13:19 | 98,874,696 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,380 |
java
|
package com.yiaosi.aps.ui;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.yiaosi.aps.R;
import com.yiaosi.aps.adapter.RemindNoticeAdapter;
import com.yiaosi.aps.mvp.bean.RemindNoticeTypeEntity;
import com.yiaosi.aps.tool.DividerItemDecoration;
import java.util.List;
import jp.wasabeef.recyclerview.adapters.SlideInBottomAnimationAdapter;
/**
* Created by Administrator on 2017-07-20.
*/
public class RemindNoticeListFragment extends Fragment {
private View view;
private RecyclerView mRecyclerView;
private LinearLayoutManager layoutManager;
private List<RemindNoticeTypeEntity> list;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment_remind_notice, container, false);
list = (List<RemindNoticeTypeEntity>) getArguments().getSerializable("list");
mRecyclerView = (RecyclerView) view.findViewById(R.id.rv_list);
layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
//添加分割线
mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(),
DividerItemDecoration.VERTICAL_LIST));
RemindNoticeAdapter adapter = new RemindNoticeAdapter(getActivity(), list);
SlideInBottomAnimationAdapter slideAdapter = new SlideInBottomAnimationAdapter(adapter);
slideAdapter.setDuration(800);
mRecyclerView.setAdapter(slideAdapter);
adapter.setOnMyClickListener(new RemindNoticeAdapter.OnMyClickListener() {
@Override
public void onClick(View view) {
Intent it = new Intent(getActivity(), RemindNoticeDetailActivity.class);
startActivity(it);
}
});
return view;
}
}
|
[
"[email protected]"
] | |
962e5bc79d538a5195889045166e8d646010cfe5
|
0f0a2c430cd5471b6ea9062945ef2d51c5804b9b
|
/Java/netBeans/ProvEngineSimpleDB/src/java/prov/engine/util/AmazonCredentials.java
|
635e3d59191fd6d5fb6eb0ec1e46feaacae3e2d4
|
[] |
no_license
|
kamrultopu/JobPrep
|
9bf3dde68b21c87054ecde5775ce181370b4480f
|
28c55082c21254dc6b2223d3fd3ff5e27f4f54b6
|
refs/heads/master
| 2021-01-20T22:23:51.548679 | 2016-06-22T22:26:55 | 2016-06-22T22:26:55 | 61,749,646 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,080 |
java
|
package prov.engine.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import com.amazonaws.auth.AWSCredentials;
public class AmazonCredentials implements AWSCredentials{
Properties prop;
String AccessKeyID;
public AmazonCredentials(String accessKey)
{
AccessKeyID = accessKey;
prop = new Properties();
try {
File userHome = new File(System.getProperty("user.home"));
File propertiesFile = new File(userHome, "AwsCredentialsVolt.properties");
prop.load(new FileInputStream(propertiesFile));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public String getAWSAccessKeyId() {
// TODO Auto-generated method stub
return AccessKeyID;
}
@Override
public String getAWSSecretKey() {
// TODO Auto-generated method stub
return prop.getProperty(AccessKeyID);
}
}
|
[
"[email protected]"
] | |
22f5380016e6775a500fe16f8982ca94f24c2c09
|
f26aa7df29860e30c7a85f40955b672bcddb21c5
|
/src/bfs/BFS_4.java
|
e7757f0bb9540a7348f240a9d3a0a1b025c3d6b6
|
[] |
no_license
|
guodalin8/algorithm_practice
|
ab9a6209f5bd642c8e3cdff5d0ca0cdb123af98c
|
4d5c2477d45b2a923a8bfaf1d676157141a7e2a5
|
refs/heads/master
| 2020-03-17T02:59:38.236583 | 2018-05-13T03:12:59 | 2018-05-13T03:12:59 | 133,215,158 | 1 | 0 | null | 2018-05-13T07:29:16 | 2018-05-13T07:29:16 | null |
UTF-8
|
Java
| false | false | 2,813 |
java
|
package bfs;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
/**
* 其内部实现用的是先进先出的队列 ,直接循环判断相邻点是否都为海岛即可。
* 输入:(输入N),接下来的输入是N*N的二维数组
* 7
* .......
* .##....
* .##....
* ....##.
* ..####.
* ...###.
* .......
* 输出:
* 1
*
* @author danqiusheng
*/
public class BFS_4 {
private static int[][] direction = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
private static int[][] result; // 判断是否经过
private static char[][] map;
private static int N;
// 设置队列
static Queue<Node> que = new LinkedList<Node>();
public static void main(String[] args) {
// 设置头
Scanner read = new Scanner(System.in);
N = read.nextInt();
read.nextLine();
// 初始化
map = new char[N][N];
result = new int[N][N];
// 读取数据
for (int i = 0; i < N; i++) {
map[i] = read.nextLine().toCharArray();
}
Node node = new Node(0,0);
que.add(node);// 起始点进队列
// 标记起始点访问
result[0][0] = 1;
// 以当前点广搜
Node heads;
int sum = 0;
while ((heads = que.poll()) != null) {
int count = 0;// 计数,看相邻的点是否都是小岛
for (int i = 0; i < 4; i++) {
int ty = heads.y + direction[i][1];
int tx = heads.x + direction[i][0];
// 判断是否越界
if (tx < 0 || tx >= N || ty < 0 || ty >= N) {
continue;
}
if (map[tx][ty] == '#') {
count++;
}
// 判断有没有被访问
if (result[tx][ty] == 0) {
Node next = new Node(tx,ty);
result[tx][ty] = 1;
que.add(next);
}
}
if (count == 4) {// 代表当前点不会被淹没,因为周围都是小岛
sum++;
}
}
System.out.println(sum);
}
/**
* Queue
* 队列对象
*/
static class Node {
int x;
int y;
public Node() {
}
public Node(int x, int y) {
this.x = x;
this.y = y;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
@Override
public String toString() {
return "(" + x + "," + y + ")";
}
}
}
|
[
"[email protected]"
] | |
1dda374ecc38d7fbbd6ff658a462b6368cbb3db3
|
27f6a988ec638a1db9a59cf271f24bf8f77b9056
|
/Code-Hunt-data/users/User031/Sector3-Level4/attempt028-20140920-203923.java
|
4434d3efe1af78f87c3280e7186c3d926dc463c1
|
[] |
no_license
|
liiabutler/Refazer
|
38eaf72ed876b4cfc5f39153956775f2123eed7f
|
991d15e05701a0a8582a41bf4cfb857bf6ef47c3
|
refs/heads/master
| 2021-07-22T06:44:46.453717 | 2017-10-31T01:43:42 | 2017-10-31T01:43:42 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 401 |
java
|
public class Program {
public static Boolean Puzzle(char c) {
int ascii = (int) c;
if(!(Character.isWhitespace(c)) && (ascii == 119 ||ascii == 115 ||ascii == 118 ||ascii == 114 ||ascii == 107 ||ascii == 102 ||ascii == 100 ||ascii == 104 ||ascii == 108 ||ascii == 116 ||ascii == 120 ||ascii == 113 ||ascii == 106 || ascii == 98 || ascii == 121))
{
return false;
}
return true;
}
}
|
[
"[email protected]"
] | |
8ec4725a4d2ba7b706f5938fca88544f112337f1
|
6bfb6d2634c4a0f25342ad22d58f63be4ae0f9f6
|
/SQLDeveloper/SQLDeveloper/src/com/kosmo/ui/developer/service/emp/impl/EmpServiceImpl.java
|
d05daf3f75d46ec7a7efcb73d6ae149022766d2f
|
[] |
no_license
|
questsolve/SQLDeveloper
|
9563dc0e2e8fd920a31889cbacc2d8a1851f3fa4
|
08fb790d3dc30556f5ac949cc8556b8bd3150990
|
refs/heads/master
| 2020-03-24T20:42:20.641560 | 2018-08-05T11:50:00 | 2018-08-05T11:50:00 | 142,992,704 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,052 |
java
|
package com.kosmo.ui.developer.service.emp.impl;
import java.util.List;
import com.kosmo.ui.developer.service.domain.EmpVO;
import com.kosmo.ui.developer.service.emp.EmpDao;
import com.kosmo.ui.developer.service.emp.EmpService;
public class EmpServiceImpl implements EmpService {
private EmpDao empDao;
public EmpServiceImpl() {
System.out.println(this.getClass().getName());
empDao = new EmpDaoImpl();
}
public EmpVO select(EmpVO temp) {
return empDao.select(temp);
}
@Override
public int insert(EmpVO vo) {
return empDao.insert(vo);
}
public int update(EmpVO vo) {
return empDao.update(vo);
}
public int updateAuth(EmpVO vo) {
return empDao.updateAuth(vo);
}
public int delete(EmpVO vo) {
return empDao.delete(vo);
}
public List<EmpVO> selectAllEmp(String sql){
return empDao.selectAllEmp(sql);
}
public List<String> getColumnName(String sql){
return empDao.getColumnName(sql);
}
public EmpVO select(int empNo) {
return empDao.select(empNo);
}
}
|
[
"kosmo05@DESKTOP-26RO710"
] |
kosmo05@DESKTOP-26RO710
|
5d5f2db606d2adbe38336dde8155bdc646f5fb02
|
7b58cd8c5138043bf796d6da57938fdc10a0240f
|
/SystemTime/src/Simple.java
|
fa9db43cbb00a9d15c6ccb2e8c34b2dc37b4bfc5
|
[] |
no_license
|
quockunss/CaseStudy-Module2
|
b9f828916f751e104ca5632eb33fd8b0bef29152
|
5872e5d7eb88a840a1f5f44f578df02638aa863f
|
refs/heads/main
| 2023-03-14T12:51:46.466773 | 2021-03-02T08:04:41 | 2021-03-02T08:04:41 | 318,110,022 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 176 |
java
|
import java.util.Date;
public class Simple {
public static void main(String[] args) {
Date now = new Date();
System.out.println("Now is: " + now);
}
}
|
[
"[email protected]"
] | |
4aa5c806457586b453cae0a1ec8be9581edcca5e
|
ed4290d15317271b4f1083b9467e6aae84f53320
|
/DrugDistributionAndManagement/BioGen/src/Business/WorkRequestPackage/ToSalesWorkRequest.java
|
28562e4148447d2ed13c66b62fda9dc304d316cc
|
[] |
no_license
|
krishnakantanand/DrugDistributionAndManagement
|
7959acd5ade8d6305053446b9e8e1f55604a42a4
|
2112bd1ba9b099fec15a1d0c8c451d7d6897ee01
|
refs/heads/master
| 2021-08-22T23:36:46.749106 | 2017-12-01T17:52:50 | 2017-12-01T17:52:50 | 112,768,809 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 913 |
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Business.WorkRequestPackage;
import Business.OrderPackage.Order;
import Business.EnterprisePackage.WarehouseEnterprise;
/**
*
* @author kRISH
*/
public class ToSalesWorkRequest extends WorkRequest{
private WarehouseEnterprise wareHouseEnterprise;
private Order order;
public ToSalesWorkRequest(){}
public WarehouseEnterprise getWareHouseEnterprise() {
return wareHouseEnterprise;
}
public void setWareHouseEnterprise(WarehouseEnterprise wareHouseEnterprise) {
this.wareHouseEnterprise = wareHouseEnterprise;
}
public Order getOrder() {
return order;
}
public void setOrder(Order order) {
this.order = order;
}
@Override
public String toString() {
return order.getOrderID();
}
}
|
[
"[email protected]"
] | |
ae2aef6a7877d3314a3a03ef2dc349c3b703fec1
|
c9ae5bbaf082abe43738a7f17ffab43309327977
|
/Source/FA-GameServer/data/scripts/system/database/mysql5/MySQL5PlayerSkillListDAO.java
|
80683a3b70a00cbc890ab8e74f388df0fa99c22e
|
[] |
no_license
|
Ace65/emu-santiago
|
2071f50e83e3e4075b247e4265c15d032fc13789
|
ddb2a59abd9881ec95c58149c8bf27f313e3051c
|
refs/heads/master
| 2021-01-13T00:43:18.239492 | 2012-02-22T21:14:53 | 2012-02-22T21:14:53 | 54,834,822 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,841 |
java
|
/*
* This file is part of aion-emu <aion-emu.com>.
*
* aion-emu is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* aion-emu is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with aion-emu. If not, see <http://www.gnu.org/licenses/>.
*/
package mysql5;
import gameserver.dao.PlayerSkillListDAO;
import gameserver.model.gameobjects.PersistentState;
import gameserver.model.gameobjects.player.Player;
import gameserver.model.gameobjects.player.SkillList;
import gameserver.model.gameobjects.player.SkillListEntry;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import commons.database.DatabaseFactory;
/**
* Created on: 15.07.2009 19:33:07
* Edited On: 13.09.2009 19:48:00
*
* @author IceReaper, orfeo087, Avol, AEJTester
*/
public class MySQL5PlayerSkillListDAO extends PlayerSkillListDAO
{
private static final Logger log = Logger.getLogger(MySQL5PlayerSkillListDAO.class);
public static final String INSERT_QUERY = "INSERT INTO `player_skills` (`player_id`, `skillId`, `skillLevel`) VALUES (?,?,?) ON DUPLICATE KEY UPDATE `skillLevel` = ?;";
public static final String UPDATE_QUERY = "UPDATE `player_skills` set skillLevel=? where player_id=? AND skillId=?";
public static final String DELETE_QUERY = "DELETE FROM `player_skills` WHERE `player_id`=? AND skillId=?";
public static final String SELECT_QUERY = "SELECT `skillId`, `skillLevel` FROM `player_skills` WHERE `player_id`=?";
/** {@inheritDoc} */
@Override
public SkillList loadSkillList(final int playerId)
{
Map<Integer, SkillListEntry> skills = new HashMap<Integer, SkillListEntry>();
Connection con = null;
try
{
con = DatabaseFactory.getConnection();
PreparedStatement stmt = con.prepareStatement(SELECT_QUERY);
stmt.setInt(1, playerId);
ResultSet rset = stmt.executeQuery();
while(rset.next())
{
int id = rset.getInt("skillId");
int lv = rset.getInt("skillLevel");
skills.put(id, new SkillListEntry(id, false, lv, PersistentState.UPDATED));
}
rset.close();
stmt.close();
}
catch (Exception e)
{
log.fatal("Could not restore SkillList data for player: " + playerId + " from DB: "+e.getMessage(), e);
}
finally
{
DatabaseFactory.close(con);
}
return new SkillList(skills);
}
/**
* Stores all player skills according to their persistence state
*/
@Override
public boolean storeSkills(Player player)
{
SkillListEntry[] skillsActive = player.getSkillList().getAllSkills();
SkillListEntry[] skillsDeleted = player.getSkillList().getDeletedSkills();
store(player, skillsActive);
store(player, skillsDeleted);
return true;
}
/**
*
* @param player
* @param skills
*/
private void store(Player player, SkillListEntry[] skills)
{
for(int i = 0; i < skills.length ; i++)
{
SkillListEntry skill = skills[i];
switch(skill.getPersistentState())
{
case NEW:
addSkill(player.getObjectId(), skill.getSkillId(), skill.getSkillLevel());
break;
case UPDATE_REQUIRED:
updateSkill(player.getObjectId(), skill.getSkillId(), skill.getSkillLevel());
break;
case DELETED:
deleteSkill(player.getObjectId(), skill.getSkillId());
break;
}
skill.setPersistentState(PersistentState.UPDATED);
}
}
/**
* Add a skill information into database
*
* @param playerId player object id
* @param skill skill contents.
*/
private void addSkill(final int playerId, final int skillId, final int skillLevel)
{
Connection con = null;
try
{
con = DatabaseFactory.getConnection();
PreparedStatement stmt = con.prepareStatement(INSERT_QUERY);
stmt.setInt(1, playerId);
stmt.setInt(2, skillId);
stmt.setInt(3, skillLevel);
stmt.setInt(4, skillLevel);
stmt.execute();
}
catch(Exception e)
{
log.error(e);
}
finally
{
DatabaseFactory.close(con);
}
}
/**
* Updates skill in database (after level change)
*
* @param playerId
* @param skillId
* @param skillLevel
*/
private void updateSkill(final int playerId, final int skillId, final int skillLevel)
{
Connection con = null;
try
{
con = DatabaseFactory.getConnection();
PreparedStatement stmt = con.prepareStatement(UPDATE_QUERY);
stmt.setInt(1, skillLevel);
stmt.setInt(2, playerId);
stmt.setInt(3, skillId);
stmt.execute();
}
catch(Exception e)
{
log.error(e);
}
finally
{
DatabaseFactory.close(con);
}
}
/**
* Deletes skill from database
*
* @param playerId
* @param skillId
*/
private void deleteSkill(final int playerId, final int skillId)
{
Connection con = null;
try
{
con = DatabaseFactory.getConnection();
PreparedStatement stmt = con.prepareStatement(DELETE_QUERY);
stmt.setInt(1, playerId);
stmt.setInt(2, skillId);
stmt.execute();
}
catch(Exception e)
{
log.error(e);
}
finally
{
DatabaseFactory.close(con);
}
}
@Override
public boolean supports(String databaseName, int majorVersion, int minorVersion)
{
return MySQL5DAOUtils.supports(databaseName, majorVersion, minorVersion);
}
}
|
[
"[email protected]"
] | |
7515ea08517a2add0b49cafa898e4ff34852965d
|
c8c5f0aa439f9c197f2180e67c40423d26d3f02f
|
/src/Cell.java
|
475eac0ae6fbfacf6396c213073e0163efcdfc7a
|
[] |
no_license
|
Kimbsy/CellularSimulator
|
588811b399d238ff12379ba7d09e42761e9f9b83
|
07c7f9fd26e89ef1faa202e9dc631597e8cb02ee
|
refs/heads/master
| 2021-06-06T17:30:28.970457 | 2016-10-02T22:57:29 | 2016-10-02T22:57:29 | 26,680,536 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 8,589 |
java
|
import java.awt.*;
import java.util.*;
public class Cell extends Sprite implements Living {
// Class constants.
public static final int NONE = 0;
public static final int UP = 1;
public static final int DOWN = 2;
public static final int LEFT = 3;
public static final int RIGHT = 4;
// The size of the Cell.
protected int size = 5;
// List of moves.
protected int[][] moveList;
// Which move the Cell is on.
protected int moveIndex = 0;
// How far the Cell has travelled for this move.
protected int distanceMoved = 0;
// The amount of energy the Cell has.
protected float energy = 512;
// How quickly the Cell uses energy.
protected float metabolicRate = 1.2f;
// What fraction of the Cell's movement is stationary.
protected float stationaryFactor = 1;
/**
* Constructs a Cell specifying coordinates.
*
* Uses the default shape, color and move list.
*
* @param x The X coordinate of the Cell.
* @param y The Y coordinate of the Cell.
*/
public Cell(int x, int y) {
super(x, y);
// Set defaults.
setShape(getDefaultShape());
setColor(getDefaultColor());
setMoveList(getDefaultMoveList());
updateStationaryFactor();
energy = CellularSimulator.rand.nextInt(1024);
}
/**
* Constructs a Cell specifying coordinates, shape and moveList.
*
* @param x The X coordinate of the Cell.
* @param y The Y coordinate of the Cell.
* @param shape The shape of the Cell.
* @param moveList The move list fo the Cell.
*/
public Cell(int x, int y, Shape shape, int[][] moveList) {
super(x, y);
setShape(shape);
setColor(color);
setMoveList(moveList);
energy = CellularSimulator.rand.nextInt(1024);
}
/**
* Gets the default shape for a Cell.
*
* @return The default shape.
*/
public static Polygon getDefaultShape() {
int[] xPoints = {0, 5, 5, 0};
int[] yPoints = {0, 0, 5, 5};
Polygon poly = new Polygon(xPoints, yPoints, 4);
return poly;
}
/**
* Gets the default color for a Cell.
*
* @return The default color.
*/
public static Color getDefaultColor() {
Color color = Color.GREEN;
return color;
}
/**
* Gets the color of a Cell based on its energy level.
*
* @return The color of the Cell.
*/
public Color getColor() {
float percentage = energy / 1024;
int normalised = (int) (percentage * 205);
normalised = Math.min(normalised, 205);
int r = normalised;
int g = normalised + 50;
int b = normalised;
return new Color(r, g, b);
}
/**
* Gets the default move list for a Cell.
*
* @return The default move list.
*/
public static int[][] getDefaultMoveList() {
int[] directions = {UP, RIGHT, DOWN, LEFT};
int[] distances = {20, 20, 20, 20};
int[][] moveList = {directions, distances};
return moveList;
}
/**
* Gets a random move list for a Cell.
*
* @return The random move list.
*/
public static int[][] getRandomMoveList() {
int moveCount = CellularSimulator.rand.nextInt(9) + 1;
int[] directions = new int[moveCount];
int[] distances = new int[moveCount];
for (int i = 0; i < moveCount; i++) {
directions[i] = CellularSimulator.rand.nextInt(5);
distances[i] = CellularSimulator.rand.nextInt(10) + 1;
}
// int[][] list = {{0},{1}};
// return list;
int[][] moveList = {directions, distances};
return moveList;
}
/**
* Gets the list of moves.
*
* @return The list of moves.
*/
public int[][] getMoveList() {
return moveList;
}
/**
* Sets the list of moves.
*
* @param moveList The list of moves.
*/
public void setMoveList(int[][] moveList) {
this.moveList = moveList;
}
/**
* Gets which move the Cell is on.
*
* @return The move index.
*/
public int getMoveIndex() {
return moveIndex;
}
/**
* Sets which move the Cell is on.
*
* @param moveIndex The move index
*/
public void setMoveIndex(int moveIndex) {
this.moveIndex = moveIndex;
}
/**
* Increments the move index.
*
* Wraps around to the start of the list.
*
* @param i How much to increment by.
*/
public void incMoveIndex(int i) {
moveIndex = (moveIndex + i) % moveList[0].length;
}
/**
* Gets how far the Cell has travelled for this move.
*
* @return How far the Cell has travelled.
*/
public int getDistanceMoved() {
return distanceMoved;
}
/**
* Sets how far the Cell has travelled for this move.
*
* @param distanceMoved How far the Cell has travelled for this move.
*/
public void setDistanceMoved(int distanceMoved) {
this.distanceMoved = distanceMoved;
}
/**
* Increments how far the Cell has travelled for this move.
*
* @param i How much to increment by.
*/
public void incDistanceMoved(int i) {
distanceMoved += i;
}
public int getCurrentMove() {
return moveList[0][moveIndex];
}
/**
* Gets the amount of energy the Cell has.
*
* @return The amount of energy.
*/
public float getEnergy() {
return energy;
}
/**
* Sets the amount of energy the Cell has.
*
* @param energy The amount of energy.
*/
public void setEnergy(float energy) {
this.energy = energy;
}
/**
* Gets the rate at which the Cell loses energy.
*
* @return The metabolic rate.
*/
public float getMetabolicRate() {
return metabolicRate;
}
/**
* Sets the rate at which the Cell loses energy.
*/
public void setMetabolicRate(float metabolicRate) {
this.metabolicRate = metabolicRate;
}
/**
* Determines and updates what fraction of the time the Cell spends stationary.
*/
public void updateStationaryFactor() {
float total = 0;
float stationary = 0;
for (int i = 0; i < moveList[0].length; i++) {
total += moveList[1][i];
if (moveList[0][i] == Cell.NONE) {
stationary += moveList[1][i];
}
}
stationaryFactor = stationary / total;
}
/**
* Updates this Cell.
*
* @param sim The simulation.
*/
public void update(CellularSimulator sim) {
move();
absorb(sim.foodMap);
divide(sim.cells);
metabolise(sim.cells);
}
/**
* Moves the Cell based on its moveList, moveIndex and distanceMoved.
*/
public void move() {
int distance = moveList[1][moveIndex];
if (distanceMoved >= distance) {
setDistanceMoved(0);
incMoveIndex(1);
}
switch (getCurrentMove()) {
case NONE:
break;
case UP:
incY(-1);
break;
case DOWN:
incY(1);
break;
case LEFT:
incX(-1);
break;
case RIGHT:
incX(1);
break;
}
incDistanceMoved(1);
}
/**
* Absorbs energy from the surrounding environment.
*/
public void absorb(FoodMap foodMap) {
int minX = x;
int maxX = x + size;
int minY = y;
int maxY = y + size;
float absorbedEnergy = foodMap.absorbFromArea(minX, maxX, minY, maxY);
if (getCurrentMove() == Cell.NONE) {
double multiplier = 4 * Math.pow(stationaryFactor, 4);
absorbedEnergy *= Math.max(multiplier, 1);
}
energy = Math.min((energy + absorbedEnergy), 1024);
}
/**
* Creates a new Cell based on this one.
*
* @param cells The CellCollection.
*/
public void divide(CellCollection cells) {
if (energy >= 1024) {
float newEnergy = energy / 2;
setEnergy(newEnergy);
Cell child = createChildCell();
child.setEnergy(newEnergy);
cells.add(child);
}
}
public Cell createChildCell() {
int x = this.x + CellularSimulator.rand.nextInt(size * 2) - size;
int y = this.y + CellularSimulator.rand.nextInt(size * 2) - size;
Cell child = new Cell(x, y, getShape(), getMoveList());
return child;
}
/**
* Reduces the energy level of the Cell.
*
* If the energy level drops to 0, the Cell is removed from the CellCollection.
*
* @param cells The CellCollection.
*/
public void metabolise(CellCollection cells) {
float reduction = metabolicRate;
// Staying still require no energy.
if (getCurrentMove() == Cell.NONE) {
double multiplier = 50 * Math.pow(stationaryFactor, 4);
reduction /= Math.max(multiplier, 1);
}
energy = Math.max((energy - reduction), 0);
// Destroy Cells with no energy.
if (energy == 0) {
cells.remove(this);
}
}
}
|
[
"[email protected]"
] | |
e3d9502c0710008815ba014df388a88ee4ad2aea
|
aa61cfe3509c1672538b4140ed69fae2936523fe
|
/src/main/java/com/exam/examserver/repository/RoleRepository.java
|
b2fd1ee44da2791845649b2c91e0e9f76910d4ac
|
[] |
no_license
|
vishkada/examserver
|
29c5a874882247fed18d50e60742e147f0e18723
|
8f05159a228658bc1670093a00d52587fff1be1d
|
refs/heads/master
| 2023-08-30T02:25:06.418548 | 2021-11-18T17:00:08 | 2021-11-18T17:00:08 | 429,508,408 | 1 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 213 |
java
|
package com.exam.examserver.repository;
import com.exam.examserver.model.Role;
import org.springframework.data.jpa.repository.JpaRepository;
public interface RoleRepository extends JpaRepository<Role, Long> {
}
|
[
"[email protected]"
] | |
7784c9b9ac20db54bfdeccf3a5e856b660d7354d
|
544cfadc742536618168fc80a5bd81a35a5f2c99
|
/external/conscrypt/repackaged/platform/src/main/java/com/android/org/conscrypt/NativeCryptoJni.java
|
254b45c2086990aeb7381746c85fdc127fb6ba7c
|
[
"Apache-2.0"
] |
permissive
|
ZYHGOD-1/Aosp11
|
0400619993b559bf4380db2da0addfa9cccd698d
|
78a61ca023cbf1a0cecfef8b97df2b274ac3a988
|
refs/heads/main
| 2023-04-21T20:13:54.629813 | 2021-05-22T05:28:21 | 2021-05-22T05:28:21 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 948 |
java
|
/* GENERATED SOURCE. DO NOT MODIFY. */
/*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.org.conscrypt;
/**
* Helper to initialize the JNI libraries. This version runs when compiled
* as part of the platform.
*/
class NativeCryptoJni {
public static void init() {
System.loadLibrary("javacrypto");
}
private NativeCryptoJni() {
}
}
|
[
"[email protected]"
] | |
2cc9d6f0bb380d0358062bf560784190491434e2
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/eclipseswt_cluster/17341/tar_1.java
|
584f5481339807595a89c1320623a014c01fd7a5
|
[] |
no_license
|
martinezmatias/GenPat-data-C3
|
63cfe27efee2946831139747e6c20cf952f1d6f6
|
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
|
refs/heads/master
| 2022-04-25T17:59:03.905613 | 2020-04-15T14:41:34 | 2020-04-15T14:41:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 7,417 |
java
|
/*******************************************************************************
* Copyright (c) 2003, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.swt.browser;
import org.eclipse.swt.*;
import org.eclipse.swt.internal.mozilla.*;
import org.eclipse.swt.internal.gtk.OS;
import org.eclipse.swt.widgets.*;
class HelperAppLauncherDialog {
XPCOMObject supports;
XPCOMObject helperAppLauncherDialog;
int refCount = 0;
public HelperAppLauncherDialog() {
createCOMInterfaces();
}
int AddRef() {
refCount++;
return refCount;
}
void createCOMInterfaces() {
/* Create each of the interfaces that this object implements */
supports = new XPCOMObject(new int[]{2, 0, 0}){
public int /*long*/ method0(int /*long*/[] args) {return QueryInterface(args[0], args[1]);}
public int /*long*/ method1(int /*long*/[] args) {return AddRef();}
public int /*long*/ method2(int /*long*/[] args) {return Release();}
};
helperAppLauncherDialog = new XPCOMObject(new int[]{2, 0, 0, 3, 5}){
public int /*long*/ method0(int /*long*/[] args) {return QueryInterface(args[0], args[1]);}
public int /*long*/ method1(int /*long*/[] args) {return AddRef();}
public int /*long*/ method2(int /*long*/[] args) {return Release();}
public int /*long*/ method3(int /*long*/[] args) {return Show(args[0], args[1], args[2]);}
public int /*long*/ method4(int /*long*/[] args) {return PromptForSaveToFile(args[0], args[1], args[2], args[3], args[4]);}
};
}
void disposeCOMInterfaces() {
if (supports != null) {
supports.dispose();
supports = null;
}
if (helperAppLauncherDialog != null) {
helperAppLauncherDialog.dispose();
helperAppLauncherDialog = null;
}
}
int /*long*/ getAddress() {
return helperAppLauncherDialog.getAddress();
}
int /*long*/ QueryInterface(int /*long*/ riid, int /*long*/ ppvObject) {
if (riid == 0 || ppvObject == 0) return XPCOM.NS_ERROR_NO_INTERFACE;
nsID guid = new nsID();
XPCOM.memmove(guid, riid, nsID.sizeof);
if (guid.Equals(nsISupports.NS_ISUPPORTS_IID)) {
XPCOM.memmove(ppvObject, new int /*long*/[] {supports.getAddress()}, OS.PTR_SIZEOF);
AddRef();
return XPCOM.NS_OK;
}
if (guid.Equals(nsIHelperAppLauncherDialog.NS_IHELPERAPPLAUNCHERDIALOG_IID)) {
XPCOM.memmove(ppvObject, new int /*long*/[] {helperAppLauncherDialog.getAddress()}, OS.PTR_SIZEOF);
AddRef();
return XPCOM.NS_OK;
}
XPCOM.memmove(ppvObject, new int /*long*/[] {0}, OS.PTR_SIZEOF);
return XPCOM.NS_ERROR_NO_INTERFACE;
}
int Release() {
refCount--;
/*
* Note. This instance lives as long as the download it is binded to.
* Its reference count is expected to go down to 0 when the download
* has completed or when it has been cancelled. E.g. when the user
* cancels the File Dialog, cancels or closes the Download Dialog
* and when the Download Dialog goes away after the download is completed.
*/
if (refCount == 0) disposeCOMInterfaces();
return refCount;
}
/* nsIHelperAppLauncherDialog */
public int /*long*/ Show(int /*long*/ aLauncher, int /*long*/ aContext, int /*long*/ aReason) {
/*
* The interface for nsIHelperAppLauncher changed as of mozilla 1.8. Query the received
* nsIHelperAppLauncher for the new interface, and if it is not found then fall back to
* the old interface.
*/
nsISupports supports = new nsISupports(aLauncher);
int /*long*/[] result = new int /*long*/[1];
int rc = supports.QueryInterface(nsIHelperAppLauncher_1_8.NS_IHELPERAPPLAUNCHER_IID, result);
if (rc == 0) { /* >= 1.8 */
nsIHelperAppLauncher_1_8 helperAppLauncher = new nsIHelperAppLauncher_1_8(aLauncher);
rc = helperAppLauncher.SaveToDisk(0, false);
helperAppLauncher.Release();
return rc;
}
nsIHelperAppLauncher helperAppLauncher = new nsIHelperAppLauncher(aLauncher); /* < 1.8 */
return helperAppLauncher.SaveToDisk(0, false);
}
public int /*long*/ PromptForSaveToFile(int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ arg3, int /*long*/ arg4) {
int /*long*/ aDefaultFile, aSuggestedFileExtension, _retval;
boolean hasLauncher = false;
/*
* The interface for nsIHelperAppLauncherDialog changed as of mozilla 1.5 when an
* extra argument was added to the PromptForSaveToFile method (this resulted in all
* subsequent arguments shifting right). The workaround is to provide an XPCOMObject
* that fits the newer API, and to use the first argument's type to infer whether
* the old or new nsIHelperAppLauncherDialog interface is being used (and by extension
* the ordering of the arguments). In mozilla >= 1.5 the first argument is an
* nsIHelperAppLauncher.
*/
/*
* The interface for nsIHelperAppLauncher changed as of mozilla 1.8, so the first
* argument must be queried for both the old and new nsIHelperAppLauncher interfaces.
*/
nsISupports support = new nsISupports(arg0);
int /*long*/[] result = new int /*long*/[1];
int rc = support.QueryInterface(nsIHelperAppLauncher_1_8.NS_IHELPERAPPLAUNCHER_IID, result);
boolean usingMozilla18 = rc == 0;
if (usingMozilla18) {
hasLauncher = true;
nsISupports supports = new nsISupports(result[0]);
supports.Release();
} else {
result[0] = 0;
rc = support.QueryInterface(nsIHelperAppLauncher.NS_IHELPERAPPLAUNCHER_IID, result);
if (rc == 0) {
hasLauncher = true;
nsISupports supports = new nsISupports(result[0]);
supports.Release();
}
}
result[0] = 0;
if (hasLauncher) { /* >= 1.5 */
aDefaultFile = arg2;
aSuggestedFileExtension = arg3;
_retval = arg4;
} else { /* 1.4 */
aDefaultFile = arg1;
aSuggestedFileExtension = arg2;
_retval = arg3;
}
int length = XPCOM.strlen_PRUnichar(aDefaultFile);
char[] dest = new char[length];
XPCOM.memmove(dest, aDefaultFile, length * 2);
String defaultFile = new String(dest);
length = XPCOM.strlen_PRUnichar(aSuggestedFileExtension);
dest = new char[length];
XPCOM.memmove(dest, aSuggestedFileExtension, length * 2);
String suggestedFileExtension = new String(dest);
Shell shell = new Shell();
FileDialog fileDialog = new FileDialog(shell, SWT.SAVE);
fileDialog.setFileName(defaultFile);
fileDialog.setFilterExtensions(new String[] {suggestedFileExtension});
String name = fileDialog.open();
shell.close();
if (name == null) {
if (hasLauncher) {
if (usingMozilla18) {
nsIHelperAppLauncher_1_8 launcher = new nsIHelperAppLauncher_1_8(arg0);
rc = launcher.Cancel(XPCOM.NS_BINDING_ABORTED);
} else {
nsIHelperAppLauncher launcher = new nsIHelperAppLauncher(arg0);
rc = launcher.Cancel();
}
if (rc != XPCOM.NS_OK) Browser.error(rc);
return XPCOM.NS_OK;
}
return XPCOM.NS_ERROR_FAILURE;
}
nsEmbedString path = new nsEmbedString(name);
rc = XPCOM.NS_NewLocalFile(path.getAddress(), true, result);
path.dispose();
if (rc != XPCOM.NS_OK) Browser.error(rc);
if (result[0] == 0) Browser.error(XPCOM.NS_ERROR_NULL_POINTER);
/* Our own nsIDownload has been registered during the Browser initialization. It will be invoked by Mozilla. */
XPCOM.memmove(_retval, result, OS.PTR_SIZEOF);
return XPCOM.NS_OK;
}
}
|
[
"[email protected]"
] | |
28a15f404e857861ac38e0e32968f9d92417524e
|
6b6e273d4c6b71b77a09681ebe89434259cce907
|
/src/com/ict03/class03/Ex15.java
|
03c92627558046b476045aa7e84a9efe1a816b19
|
[] |
no_license
|
wish813/java_dong
|
ff6c0644831585e7cdca58b18f9849c5fb93d4c3
|
52a2480c52d3fc1fbf43f69c1cd046b67aafeb6e
|
refs/heads/master
| 2023-04-08T05:35:50.405493 | 2021-04-16T01:18:54 | 2021-04-16T01:18:54 | 354,700,067 | 0 | 0 | null | null | null | null |
UHC
|
Java
| false | false | 1,094 |
java
|
package com.ict03.class03;
public class Ex15 extends Ex14{
String name = "홍일점";
int id = 2410;
public Ex15() {
super("일지매", 15);
System.out.println("자식클래스 생성자 : " + this);
name = "홍두께";
id = 1004;
}
public Ex15(String name) {
super("태권브이", 37);
this.name = name;
}
public void prn() {
String name = "홍시";
// 지역, 전역, 부모 모두 같은이름의 변수를 가지고 있다. ; 반드시 구분해야함
System.out.println("지역변수이름 : " + name);
System.out.println("전역변수이름 : " + this.name);
System.out.println("부모변수이름 : " + super.name);
// 부모만 가지고 있는 변수
System.out.println("지역변수이름 : " + age);
System.out.println("전역변수이름 : " + this.age);
System.out.println("부모변수이름 : " + super.age);
// 전역변수만 가지고 있는 변수
System.out.println("지역변수이름 : " + id);
System.out.println("전역변수이름 : " + this.id);
//System.out.println("부모변수이름 : " + super.id);
}
}
|
[
"[email protected]"
] | |
b950d84dbbc17ae87c25697528e01869438a354e
|
420f76f14b875a5732b284d47c9084b3a23da6c7
|
/SFMathQuizTake1/app/src/com/mathquiz/android/Question.java
|
322310effd60705fd48c1e3b38fd9e5bdfc4319e
|
[] |
no_license
|
wgithii1/SFMathQuizTake1
|
ad7f8fbde6f6de0b40545cc2a2bf2a8718c645ad
|
f073e53d80b310acc8e28da08698182bc4b8a347
|
refs/heads/main
| 2022-12-21T08:59:50.365006 | 2020-09-29T07:04:12 | 2020-09-29T07:04:12 | 299,532,805 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 2,633 |
java
|
package com.mathquiz.android;
import java.util.Random;
public class Question {
private int firstNumber;
private int secondNumber;
private int answer;
private int [] answerArray;
private int answerPosition;
private int upperLimit;
private String questionPhrase;
public Question(int upperLimit){
this.upperLimit = upperLimit;
Random randomNumberMaker = new Random();
this.firstNumber = randomNumberMaker.nextInt(upperLimit);
this.secondNumber = randomNumberMaker.nextInt(upperLimit);
this.answer = this.firstNumber + this.secondNumber;
this.questionPhrase = firstNumber + " + " + secondNumber + " = ";
this.answerPosition = randomNumberMaker.nextInt(4);
this.answerArray = new int[] {0,1,2,3};
this.answerArray[0] = answer + 1;
this.answerArray[1] = answer + 10;
this.answerArray[2] = answer - 5;
this.answerArray[3] = answer - 2;
this.answerArray = shuffleArray(this.answerArray);
answerArray[answerPosition] = answer;
}
private int [] shuffleArray(int[] array){
int index, temp;
Random randomNumberGenerator = new Random();
for( int i = array.length - 1; i > 0; i--){
index = randomNumberGenerator.nextInt( i + 1);
temp = array[index];
array[index] = array[i];
array[i] = temp;
}
return array;
}
public int getFirstNumber() {
return firstNumber;
}
public void setFirstNumber(int firstNumber) {
this.firstNumber = firstNumber;
}
public int getSecondNumber() {
return secondNumber;
}
public void setSecondNumber(int secondNumber) {
this.secondNumber = secondNumber;
}
public int getAnswer() {
return answer;
}
public void setAnswer(int answer) {
this.answer = answer;
}
public int[] getAnswerArray() {
return answerArray;
}
public void setAnswerArray(int[] answerArray) {
this.answerArray = answerArray;
}
public int getAnswerPosition() {
return answerPosition;
}
public void setAnswerPosition(int answerPosition) {
this.answerPosition = answerPosition;
}
public int getUpperLimit() {
return upperLimit;
}
public void setUpperLimit(int upperLimit) {
this.upperLimit = upperLimit;
}
public String getQuestionPhrase() {
return questionPhrase;
}
public void setQuestionPhrase(String questionPhrase) {
this.questionPhrase = questionPhrase;
}
}
|
[
"[email protected]"
] | |
0fb8539e47a78aa098df2552a4fafb99ac2502d7
|
191ec4cbcc1c5c2a7535bea528584e7c46f5f526
|
/univocity-trader-core/src/test/java/com/univocity/trader/indicators/MovingAverageTest.java
|
c4a0a29179ebc2b5d1449dfafd2c8cddfedfe174
|
[
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
worthmining/univocity-trader
|
2e1e237dfad4db9cd70bf45cd649e3807a522a63
|
2f8b6d431885017132dc27e87a494b5b6c10aa5c
|
refs/heads/master
| 2020-12-10T19:21:17.048626 | 2020-01-13T12:59:39 | 2020-01-13T12:59:39 | 233,686,422 | 1 | 0 |
Apache-2.0
| 2020-01-13T20:25:54 | 2020-01-13T20:25:53 | null |
UTF-8
|
Java
| false | false | 2,648 |
java
|
package com.univocity.trader.indicators;
import org.junit.*;
import static com.univocity.trader.candles.CandleHelper.*;
import static com.univocity.trader.indicators.base.TimeInterval.*;
import static junit.framework.TestCase.*;
public class MovingAverageTest {
@Test
public void isUsable() {
MovingAverage ma = new MovingAverage(5, minutes(1));
assertEquals(1.0, accumulate(ma, 1, 1.0), 0.001);
assertEquals(1.5, accumulate(ma, 2, 2.0), 0.001);
assertEquals(1.3333, accumulate(ma, 3, 1.0), 0.001);
assertEquals(1.5, accumulate(ma, 4, 2.0), 0.001);
assertEquals(1.6, accumulate(ma, 5, 2.0), 0.001);
assertEquals(1.8, accumulate(ma, 6, 2.0), 0.001);
assertEquals(1.8, accumulate(ma, 7, 2.0), 0.001);
assertEquals(2.0, accumulate(ma, 8, 2.0), 0.001);
// 2 min
ma = new MovingAverage(2, minutes(2));
ma.recalculateEveryTick(true);
assertEquals(1.0, accumulate(ma, 1, 1.0), 0.001);
assertEquals(2.0, accumulate(ma, 2, 2.0), 0.001);
assertEquals(1.5, accumulate(ma, 3, 1.0), 0.001);
assertEquals(1.75, accumulate(ma, 4, 1.5), 0.001);
assertEquals(1.25, accumulate(ma, 5, 1.0), 0.001);
assertEquals(3.25, accumulate(ma, 6, 5.0), 0.001);
assertEquals(5.0, accumulate(ma, 7, 5.0), 0.001);
assertEquals(3.0, accumulate(ma, 8, 1.0), 0.001);
// 2 min
ma = new MovingAverage(2, minutes(2));
ma.recalculateEveryTick(true);
assertEquals(1.0, accumulate(ma, 3, 1.0), 0.001); //update
assertEquals(1.5, accumulate(ma, 3, 1.5), 0.001); //update again, same instant
assertEquals(1.5, accumulate(ma, 2, 2.0), 0.001); //noop, previous instant
assertEquals(9.0, accumulate(ma, 4, 9.0), 0.001);
// 2 min
ma = new MovingAverage(2, minutes(2));
ma.recalculateEveryTick(true);
assertEquals(1.0, update(ma, 1, 1.0), 0.001);
assertEquals(2.0, update(ma, 2, 2.0), 0.001);
assertEquals(1.5, update(ma, 3, 1.0), 0.001);
assertEquals(1.75, update(ma, 4, 1.5), 0.001);
assertEquals(1.25, update(ma, 5, 1.0), 0.001);
assertEquals(3.25, update(ma, 6, 5.0), 0.001);
assertEquals(5.0, update(ma, 7, 5.0), 0.001);
assertEquals(3.0, update(ma, 8, 1.0), 0.001);
// 3 min
ma = new MovingAverage(2, minutes(3));
ma.recalculateEveryTick(true);
assertEquals(1.0, update(ma, 1, 1.0), 0.001);
assertEquals(2.0, update(ma, 2, 2.0), 0.001);
assertEquals(1.0, update(ma, 3, 1.0), 0.001);
assertEquals(1.25, update(ma, 4, 1.5), 0.001);
assertEquals(1.0, update(ma, 5, 1.0), 0.001);
assertEquals(3.0, update(ma, 6, 5.0), 0.001);
assertEquals(5.0, update(ma, 7, 5.0), 0.001);
assertEquals(3.0, update(ma, 8, 1.0), 0.001);
assertEquals(3.5, update(ma, 9, 2.0), 0.001);
}
}
|
[
"[email protected]"
] | |
dccb09f32a6374458386fb10e71f77d093b61d79
|
b43e101dfa2149d2288624804411fe77c8562b67
|
/Helloworld/src/Person.java
|
e9507933af5ccc2c3cf90b63dfd07978467b81d6
|
[] |
no_license
|
oakes1218/java
|
fb78f702fa42ea437c40323a930066df97acb1b2
|
89a94064d50832e1c0f384c09dfcb3b79d07d453
|
refs/heads/master
| 2021-01-10T05:50:51.966974 | 2015-10-30T05:37:41 | 2015-10-30T05:37:41 | 44,154,738 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,092 |
java
|
import java.awt.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class Person {
int age ;
String name;
ArrayList<String> hobby = new ArrayList<String>();
Set<Person> children = new HashSet<Person>();
Map<String, Integer> experince = new HashMap<String, Integer>();
public Person(int age, String name,ArrayList<String> hobby , Map<String, Integer> experince, Set<Person> children){
this.age = age;
this.name = name;
this.hobby = hobby;
this.experince = experince;
this.children = children;
}
@Override
public String toString() {
return age + " " + name + " " + hobby + " " + experince;
}
public Integer getAge() {
return age;
}
public String getName() {
return name;
}
public ArrayList<String> gethoppy(){
return hobby;
}
public HashMap<String, Integer> getExperiences() {
return (HashMap<String, Integer>) experince;
}
public Set<Person> getChildren() {
return children;
}
}
|
[
"[email protected]"
] | |
cb5d9098d60805b30872ecb502d5eef9954b9c56
|
f7acd6176f8983a2b0d5f0184a7c14680c937363
|
/simple-jwt-auth/src/main/java/net/entrofi/spring/security/jwt/simplejwtauth/controller/UserController.java
|
651ff43f6ed4461afb751f9866028bac51839e87
|
[] |
no_license
|
entrofi/spring
|
8b6f552da6126066e146d23093d88c060efde9a1
|
4a494039648f8f516f7e99db89586e8e879d31b8
|
refs/heads/master
| 2022-12-01T20:03:48.579731 | 2021-07-16T16:39:03 | 2021-07-16T16:39:03 | 21,819,427 | 0 | 2 | null | 2022-11-24T07:00:17 | 2014-07-14T12:55:53 |
Java
|
UTF-8
|
Java
| false | false | 1,272 |
java
|
/*
* 2017 Hasan COMAK
*/
package net.entrofi.spring.security.jwt.simplejwtauth.controller;
import net.entrofi.spring.security.jwt.simplejwtauth.model.User;
import net.entrofi.spring.security.jwt.simplejwtauth.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/users")
public class UserController {
@Autowired
private UserRepository userRepository;
@Autowired
private PasswordEncoder passwordEncoder;
@PostMapping("/signup")
public HttpEntity<String> signUp(@RequestBody User user) {
user.setPassword(passwordEncoder.encode(user.getPassword()));
User saved = userRepository.save(user);
return new ResponseEntity<String>("User " + saved.getUsername() + " created.", HttpStatus.OK);
}
}
|
[
"[email protected]"
] | |
7b9ae395fd14ff240bbd4b2527f206feffa20d5f
|
cde66143027b8f78075d437508ed1144162359ba
|
/src/main/java/oauth/OauthController.java
|
2845aaa9fce496e66d3a469359bd2e37544c4882
|
[] |
no_license
|
tfSheol/SpringRestDemo
|
061f0864877c83371eb9bbe5f7c1ca00a4b59573
|
5d24067c230f96dc0eb7eda4b1c920607d4a0b96
|
refs/heads/master
| 2023-06-08T06:29:16.235191 | 2020-07-05T20:18:32 | 2020-07-05T20:18:32 | 107,962,324 | 1 | 1 | null | 2023-04-14T17:36:38 | 2017-10-23T09:45:30 |
Java
|
UTF-8
|
Java
| false | false | 2,368 |
java
|
package oauth;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import entity.Account;
import entity.Token;
import io.ebean.Ebean;
import io.ebean.EbeanServer;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tmp.DataSingleton;
import javax.servlet.http.HttpServletResponse;
import java.util.Base64;
import java.util.List;
import java.util.UUID;
/**
* @author sheol on 10/29/17 at 1:00 PM
* @project SpringRestDemo
*/
@RestController
@RequestMapping("/oauth")
public class OauthController {
@PostMapping("/auth")
public String auth(@RequestHeader(value = "authorization") String authorization,
HttpServletResponse response) {
String base64Tmp = authorization.split(" ")[1];
String[] base64DecodeTmp = new String(Base64.getDecoder().decode(base64Tmp)).split(":");
if (base64DecodeTmp.length == 2) {
String username = base64DecodeTmp[0];
String password = base64DecodeTmp[1];
List<Account> accounts = Ebean.createQuery(Account.class).findList();
//List<Account> accounts = DataSingleton.getInstance().getAccounts();
for (Account account : accounts) {
if (account.getUsername().equals(username)
&& account.getPassword().equals(password)) {
Token token = new Token();
token.setToken(UUID.randomUUID().toString());
token.setUser_id(account.getId());
token.setTtl(3600);
//DataSingleton.getInstance().getTokens().add(token);
Ebean.save(token);
return DataSingleton.gson().toJson(token);
}
}
}
response.setStatus(HttpStatus.UNAUTHORIZED.value());
return "";
}
@PostMapping("/token_auth")
public String tokenAuth() {
// TODO: 10/29/17 validate Bearer auth
// TODO: 10/29/17 GrantType.client_credentials
// TODO: 10/29/17 GrantType.refresh_token
// TOKEN_TYPE, ACCESS_TOKEN, EXPIRES_IN
return "";
}
}
|
[
"[email protected]"
] | |
01a56a3d80f7337608190b9ef71bbf2a3fe88a9b
|
de514e258a6e368fea5de242ebaadb16b267c332
|
/concurrentdemo/src/main/java/com/art2cat/dev/concurrency/concurrency_in_practice/the_java_memory_model/EagerInitialization.java
|
23a0590a05993b3d7cabde3ed39ba06b3578cc79
|
[] |
no_license
|
Art2Cat/JavaDemo
|
09e1e10d4bbc13fb80f6afd92e56d4c4bfed3d51
|
08a8a45c3301bfba5856b7edeebf37ebd648111b
|
refs/heads/master
| 2021-06-21T16:40:04.403603 | 2019-08-03T06:14:18 | 2019-08-03T06:14:18 | 104,846,429 | 0 | 1 | null | null | null | null |
UTF-8
|
Java
| false | false | 394 |
java
|
package com.art2cat.dev.concurrency.concurrency_in_practice.the_java_memory_model;
/**
* EagerInitialization
* <p/>
* Eager initialization
*
* @author Brian Goetz and Tim Peierls
*/
public class EagerInitialization {
private static Resource resource = new Resource();
public static Resource getResource() {
return resource;
}
static class Resource {
}
}
|
[
"[email protected]"
] | |
bca1d8cd34508d908f51472ca266b772cc43b013
|
d4ec0e0d50356b63e83db80b343f050ee322ae94
|
/Eschool/src/com/changh/eschool/entity/Send.java
|
e347ea6fdebd036aeaa400e42ef5f41bd5b38920
|
[] |
no_license
|
examw/daliedu
|
b834cbab8498efefd523425a803ddfcda9de7bba
|
f6a46a2c6d85e23f7c3ec92be2cd6681623dd459
|
refs/heads/master
| 2016-09-05T12:13:52.981320 | 2015-03-22T06:28:10 | 2015-03-22T06:28:10 | 32,064,607 | 1 | 2 | null | null | null | null |
GB18030
|
Java
| false | false | 5,587 |
java
|
package com.changh.eschool.entity;
// default package
import java.util.Date;
import com.changh.eschool.until.Constant;
/**
* Send entity. @author MyEclipse Persistence Tools
*/
public class Send implements java.io.Serializable {
// Fields
private Integer sendId;
private Order order;
private Integer id;
private Integer epcId;
// private ExpressCompany company;
private Integer sendStatus; //寄送状态 0:未送,1:在送,2:已送,3:已回寄【退单时用】
private Date sendTime;
private Date sendAddTime;
private String sendPerson;
private Date sendConfirmTime;
private String sendDetail;//赠送详细
private String sendContent;//寄送内容
private double sendCost; //寄送花费
private String epcName;
private Integer sendType;//寄送类型 0:教材;1:发票,2:其他
private String sendExpressNo;//寄送的快递单号
private String sendReceiveName;
private String sendFullAddress;
private String sendMobile;
private String sendPostalCode;
//
private Integer orderId;
private String status;
// Constructors
/** default constructor */
public Send() {
}
/** minimal constructor */
public Send(Integer sendId, Order order, Integer id, Integer sendStatus) {
this.sendId = sendId;
this.order = order;
this.id = id;
this.sendStatus = sendStatus;
}
/** full constructor
public Send(Integer sendId, Order order, Integer id, ExpressCompany company, String sendOrderId, Integer sendStatus, Date sendTime, Date sendAddTime,String sendPerson, Date sendConfirmTime,String sendDetail,double sendCost) {
this.sendId = sendId;
this.order = order;
this.id = id;
this.company= company;
this.sendOrderId = sendOrderId;
this.sendStatus = sendStatus;
this.sendTime = sendTime;
this.sendAddTime = sendAddTime;
this.sendPerson = sendPerson;
this.sendConfirmTime = sendConfirmTime;
this.sendDetail=sendDetail;
this.sendCost=sendCost;
}
*/
// Property accessors
public Integer getSendId() {
return this.sendId;
}
public void setSendId(Integer sendId) {
this.sendId = sendId;
}
public Order getOrder() {
return this.order;
}
public void setOrder(Order order) {
this.order = order;
}
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getSendStatus() {
return this.sendStatus;
}
public void setSendStatus(Integer sendStatus) {
this.sendStatus = sendStatus;
}
public Date getSendTime() {
return this.sendTime;
}
public void setSendTime(Date sendTime) {
this.sendTime = sendTime;
}
public String getSendPerson() {
return this.sendPerson;
}
public void setSendPerson(String sendPerson) {
this.sendPerson = sendPerson;
}
public Date getSendConfirmTime() {
return this.sendConfirmTime;
}
public void setSendConfirmTime(Date sendConfirmTime) {
this.sendConfirmTime = sendConfirmTime;
}
public String getSendDetail() {
return sendDetail;
}
public void setSendDetail(String sendDetail) {
this.sendDetail = sendDetail;
}
///////////////////
public String getStatus()
{
switch(sendStatus)
{
case Constant.PRESEND:return "未送";
case Constant.SENDING:return "送货中";
case Constant.SENT:return "已送";
default : return "unknown";
}
}
public Integer getEpcId() {
return this.epcId;
}
public void setEpcId(Integer epcId) {
this.epcId = epcId;
}
public String getEpcName()
{
return this.epcName;
}
/////////////////////////
public Integer getOrderId() {
return orderId;
}
public void setOrderId(Integer orderId) {
this.orderId = orderId;
}
public Date getSendAddTime() {
return sendAddTime;
}
public void setSendAddTime(Date sendAddTime) {
this.sendAddTime = sendAddTime;
}
public double getSendCost() {
return sendCost;
}
public void setSendCost(double sendCost) {
this.sendCost = sendCost;
}
public void setEpcName(String epcName) {
this.epcName = epcName;
}
public String getSendContent() {
return sendContent;
}
public void setSendContent(String sendContent) {
this.sendContent = sendContent;
}
public Integer getSendType() {
return sendType;
}
public void setSendType(Integer sendType) {
this.sendType = sendType;
}
public String getSendExpressNo() {
return sendExpressNo;
}
public void setSendExpressNo(String sendExpressNo) {
this.sendExpressNo = sendExpressNo;
}
public String getSendReceiveName() {
return sendReceiveName;
}
public void setSendReceiveName(String sendReceiveName) {
this.sendReceiveName = sendReceiveName;
}
public String getSendFullAddress() {
return sendFullAddress;
}
public void setSendFullAddress(String sendFullAddress) {
this.sendFullAddress = sendFullAddress;
}
public String getSendMobile() {
return sendMobile;
}
public void setSendMobile(String sendMobile) {
this.sendMobile = sendMobile;
}
public String getSendPostalCode() {
return sendPostalCode;
}
public void setSendPostalCode(String sendPostalCode) {
this.sendPostalCode = sendPostalCode;
}
}
|
[
"[email protected]"
] | |
98ef04fc2d57cb7eaa75248ba6cf49953b5e8ab2
|
5e0b508d1d03de828be7646c4cee8b9e61244d6e
|
/obj/Debug/android/src/md55afc1eca3667a29f4dc06008fcaafa37/MainActivity.java
|
7ce7ae694f72ed261cac537b8ea18f870d12f34d
|
[] |
no_license
|
Pablo1101/AndroidHangMan
|
34ed9feca2805042b36cd866f3198bd75bf2ab84
|
89718d943a6aad1debaa087460d2673f693abfab
|
refs/heads/master
| 2021-01-15T17:55:35.488618 | 2016-07-06T22:39:04 | 2016-07-06T22:39:04 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,144 |
java
|
package md55afc1eca3667a29f4dc06008fcaafa37;
public class MainActivity
extends android.app.Activity
implements
mono.android.IGCUserPeer
{
static final String __md_methods;
static {
__md_methods =
"n_onCreate:(Landroid/os/Bundle;)V:GetOnCreate_Landroid_os_Bundle_Handler\n" +
"";
mono.android.Runtime.register ("XHangman1.MainActivity, XHangman1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", MainActivity.class, __md_methods);
}
public MainActivity () throws java.lang.Throwable
{
super ();
if (getClass () == MainActivity.class)
mono.android.TypeManager.Activate ("XHangman1.MainActivity, XHangman1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { });
}
public void onCreate (android.os.Bundle p0)
{
n_onCreate (p0);
}
private native void n_onCreate (android.os.Bundle p0);
java.util.ArrayList refList;
public void monodroidAddReference (java.lang.Object obj)
{
if (refList == null)
refList = new java.util.ArrayList ();
refList.add (obj);
}
public void monodroidClearReferences ()
{
if (refList != null)
refList.clear ();
}
}
|
[
"[email protected]"
] | |
7a4976b52b5aab21a47bd37a9e6d4a57235cf348
|
5b57a64f54597e184bce57ec79928ad204f518ab
|
/app/src/main/java/com/dicoding/medicinal_plants/model/Plant.java
|
42b210516b422564ab96a49c93ec8279de834cf3
|
[] |
no_license
|
rendranets/Intent-with-Recycleview
|
3ceb39870a9ae55d8104faee319ab88e432e3aa2
|
9ac55235db7c295bbd59b756a25e3601a2d3839b
|
refs/heads/master
| 2021-01-06T14:57:17.812717 | 2020-02-18T13:40:32 | 2020-02-18T13:40:32 | 241,370,108 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,063 |
java
|
package com.dicoding.medicinal_plants.model;
public class Plant {
private String name;
private String latin_name;
private String detail;
private String detail2;
private String link;
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public String getLatin_name() { return latin_name; }
public void setLatin_name(String latin_name) {
this.latin_name = latin_name;
}
public String getDetail2() {
return detail2;
}
public void setDetail2(String detail2) {
this.detail2 = detail2;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public int getPhoto() {
return photo;
}
public void setPhoto(int photo) {
this.photo = photo;
}
private int photo;
}
|
[
"[email protected]"
] | |
25a3692d6969ae026710d4aa435e2fabc62076d6
|
9aba7582d6345c32fa8ee96a4a78acc5a19ae768
|
/src/main/java/halestormxv/eAngelus/crafting/DualFurnaceRecipes.java
|
0b9f9c0d88974496d34c329ff7ca4b992b9a8f06
|
[] |
no_license
|
HalestormXV/mysticDivination
|
e2a7af3e27762b1fc9943a52d6a5c9e57848bca2
|
fc055bca1880eb35d7a96265c75cff10f2cb40ed
|
refs/heads/master
| 2020-12-02T19:41:01.216543 | 2017-10-21T05:56:28 | 2017-10-21T05:56:28 | 96,375,113 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 3,648 |
java
|
package halestormxv.eAngelus.crafting;
import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Maps;
import com.google.common.collect.Table;
import halestormxv.eAngelus.main.init.eAngelusBlocks;
import halestormxv.eAngelus.main.init.eAngelusItems;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.FMLLog;
import java.util.Map;
/**
* Created by Blaze on 8/26/2017.
*/
public class DualFurnaceRecipes
{
private static final DualFurnaceRecipes SMELTING = new DualFurnaceRecipes();
private final Table<ItemStack, ItemStack, ItemStack> dualSmeltingList = HashBasedTable.<ItemStack, ItemStack, ItemStack>create();
private final Map<ItemStack, Float> experienceList = Maps.<ItemStack, Float>newHashMap();
public static DualFurnaceRecipes instance()
{
return SMELTING;
}
private DualFurnaceRecipes()
{
this.addDualSmeltingRecipe(new ItemStack(Blocks.DIAMOND_ORE), new ItemStack(Blocks.GOLD_ORE), new ItemStack(Items.EMERALD), 12.0F);
this.addDualSmeltingRecipe(new ItemStack(eAngelusItems.demonic_ingot), new ItemStack(eAngelusItems.angelic_ingot), new ItemStack(eAngelusItems.essence), 4.0F);
this.addDualSmeltingRecipe(new ItemStack(eAngelusItems.essence), new ItemStack(eAngelusItems.topazStone), new ItemStack(eAngelusItems.runestone), 3.0F);
this.addDualSmeltingRecipe(new ItemStack(eAngelusItems.topazStone), new ItemStack(eAngelusItems.azuriteStone), new ItemStack(eAngelusItems.mystalDust), 2.2F);
this.addDualSmeltingRecipe(new ItemStack(eAngelusItems.serpentineStone), new ItemStack(eAngelusBlocks.demonic_block), new ItemStack(eAngelusItems.talismans, 1, 0), 2.2F);
this.addDualSmeltingRecipe(new ItemStack(eAngelusItems.azuriteStone), new ItemStack(eAngelusBlocks.angelic_block), new ItemStack(eAngelusItems.talismans, 1, 1), 2.2F);
}
public void addDualSmeltingRecipe(ItemStack input1, ItemStack input2, ItemStack result, float experience)
{
if(getDualSmeltingResult(input1, input2) != ItemStack.EMPTY)
{
FMLLog.info("eAngelus: Ignored dual smelting recipe with conflicting input: " + input1 + " and " + input2 + " = " + result);
return;
}
this.dualSmeltingList.put(input1, input2, result);
this.experienceList.put(result, Float.valueOf(experience));
}
public ItemStack getDualSmeltingResult(ItemStack input1, ItemStack input2)
{
for(Map.Entry<ItemStack, Map<ItemStack, ItemStack>> entry : this.dualSmeltingList.columnMap().entrySet())
if (this.compareItemStacks(input1, (ItemStack)entry.getKey()))
for (Map.Entry<ItemStack, ItemStack> ent : entry.getValue().entrySet())
if(this.compareItemStacks(input2, (ItemStack)ent.getKey()))
return (ItemStack)ent.getValue();
return ItemStack.EMPTY;
}
private boolean compareItemStacks(ItemStack stack1, ItemStack stack2)
{
return stack2.getItem() == stack1.getItem() && (stack2.getMetadata() == 32767 || stack2.getMetadata() == stack1.getMetadata());
}
public Table<ItemStack, ItemStack, ItemStack> getDualSmeltingList()
{
return this.dualSmeltingList;
}
public float getDualSmeltingExperience(ItemStack stack)
{
for(Map.Entry<ItemStack, Float> entry : this.experienceList.entrySet())
if(this.compareItemStacks(stack, (ItemStack)entry.getKey()))
return((Float)entry.getValue().floatValue());
return 0.0f;
}
}
|
[
"[email protected]"
] | |
7c4e541ee461131dcc5aac53345455e356233a80
|
f15b6d1549ca0336e41a5e7fe1df09a30f3c537a
|
/app/src/main/java/com/p_v/flexiblecalendarexample/CalendarActivity4.java
|
bc53caf5b973e889eb0c0ad7312cbf124a318cbe
|
[
"MIT"
] |
permissive
|
msoftware/FlexibleCalendar
|
9de65d23fa880af18ade72e1f566c01313b96111
|
cb6ab51768a4ea8326ec9448e20ff02b09eba734
|
refs/heads/master
| 2021-01-18T05:37:59.382699 | 2015-08-16T10:51:45 | 2015-08-16T11:32:18 | null | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 4,952 |
java
|
package com.p_v.flexiblecalendarexample;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.p_v.flexiblecalendar.FlexibleCalendarView;
import com.p_v.flexiblecalendar.view.BaseCellView;
import java.util.Calendar;
import java.util.Locale;
public class CalendarActivity4 extends ActionBarActivity {
private TextView monthTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_calendary_activity4);
final FlexibleCalendarView calendarView = (FlexibleCalendarView)findViewById(R.id.calendar_view);
ImageView leftArrow = (ImageView)findViewById(R.id.left_arrow);
ImageView rightArrow = (ImageView)findViewById(R.id.right_arrow);
monthTextView = (TextView)findViewById(R.id.month_text_view);
Calendar cal = Calendar.getInstance();
cal.set(calendarView.getSelectedDateItem().getYear(), calendarView.getSelectedDateItem().getMonth(), 1);
monthTextView.setText(cal.getDisplayName(Calendar.MONTH,
Calendar.LONG, Locale.ENGLISH) + " " + calendarView.getSelectedDateItem().getYear());
leftArrow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
calendarView.moveToPreviousMonth();
}
});
rightArrow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
calendarView.moveToNextMonth();
}
});
calendarView.setOnMonthChangeListener(new FlexibleCalendarView.OnMonthChangeListener() {
@Override
public void onMonthChange(int year, int month, @FlexibleCalendarView.Direction int direction) {
Calendar cal = Calendar.getInstance();
cal.set(year, month, 1);
monthTextView.setText(cal.getDisplayName(Calendar.MONTH,
Calendar.LONG, Locale.ENGLISH) + " " + year);
}
});
calendarView.setShowDatesOutsideMonth(true);
calendarView.setCalendarView(new FlexibleCalendarView.ICalendarView() {
@Override
public BaseCellView getCellView(int position, View convertView, ViewGroup parent, boolean isWithinCurrentMonth) {
BaseCellView cellView = (BaseCellView) convertView;
if (cellView == null) {
LayoutInflater inflater = LayoutInflater.from(CalendarActivity4.this);
cellView = (BaseCellView) inflater.inflate(R.layout.calendar3_date_cell_view, null);
}
return cellView;
}
@Override
public BaseCellView getWeekdayCellView(int position, View convertView, ViewGroup parent) {
BaseCellView cellView = (BaseCellView) convertView;
if (cellView == null) {
LayoutInflater inflater = LayoutInflater.from(CalendarActivity4.this);
cellView = (BaseCellView) inflater.inflate(R.layout.calendar3_week_cell_view, null);
cellView.setBackgroundColor(getResources().getColor(android.R.color.holo_purple));
cellView.setTextColor(getResources().getColor(android.R.color.holo_orange_light));
cellView.setTextSize(18);
}
return cellView;
}
@Override
public String getDayOfWeekDisplayValue(int dayOfWeek, String defaultValue) {
return null;
}
});
Button resetButton = (Button)findViewById(R.id.reset_button);
resetButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
calendarView.goToCurrentMonth();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_calendary_activity4, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
|
[
"[email protected]"
] | |
f5ab861229cc2aefd9328a050c84c0ca663f5482
|
35cf2caa0df3a104dea319bce2d5dee7d0f8003e
|
/aigou-product-parent/product-interface/src/main/java/cn/itsource/aigou/query/ProductExtQuery.java
|
29cbfccedf2f8474b428fa18f62f56dd85a6adac
|
[] |
no_license
|
465961342/aigou-parent
|
0c061c6e52b65fad79f191e1227eecab4211c683
|
7178a3402b2afb6d70d206ede14d3870ad84e290
|
refs/heads/master
| 2022-06-21T03:10:16.022880 | 2019-10-24T14:09:49 | 2019-10-24T14:09:49 | 214,109,203 | 0 | 0 | null | 2022-06-21T02:01:52 | 2019-10-10T06:54:18 |
Java
|
UTF-8
|
Java
| false | false | 181 |
java
|
package cn.itsource.aigou.query;
import cn.itsource.basic.query.BaseQuery;
/**
*
* @author kakarotto
* @since 2019-10-17
*/
public class ProductExtQuery extends BaseQuery {
}
|
[
"[email protected]"
] | |
94f567523de1f1e63aa84c4e2f05f1efe6920698
|
d02290125a0b4b08ba5e76a98c10fba9599cf13e
|
/StrutsBoard/src/board/boardVO.java
|
32758fda5991da6645ca0695fdbf3108379b3b22
|
[] |
no_license
|
dhkd5101/board6
|
0726c2c1246e886943d122b0f9b6f53f51dcc8c0
|
458af3d427ff3ce483e67ffca18422d802754d38
|
refs/heads/master
| 2020-03-17T12:22:31.538489 | 2018-05-16T03:41:52 | 2018-05-16T03:41:52 | 133,585,657 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 1,405 |
java
|
package board;
import java.util.Date;
public class boardVO {
private int no;
private String subject;
private String name;
private String password;
private String content;
private String file_orgname;
private String file_savname;
private int readhit;
private Date regdate;
public int getNo() {
return no;
}
public void setNo(int no) {
this.no = no;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public int getReadhit() {
return readhit;
}
public void setReadhit(int readhit) {
this.readhit = readhit;
}
public Date getRegdate() {
return regdate;
}
public void setRegdate(Date regdate) {
this.regdate = regdate;
}
public String getFile_orgname() {
return file_orgname;
}
public void setFile_orgname(String file_orgname) {
this.file_orgname = file_orgname;
}
public String getFile_savname() {
return file_savname;
}
public void setFile_savname(String file_savname) {
this.file_savname = file_savname;
}
}
|
[
"[email protected]"
] | |
5fc1514b5c64edb484e9b3b9b41d2e79c1083b8b
|
0d41ff9dbbd3ff3ced3c0297d18545b6bb1dc60c
|
/shirai/ループ/Kadai15.java
|
777e89ac0b0d28393684cc1637367a7b22cc2ddb
|
[] |
no_license
|
crdoti2/java
|
6eae5a11ee6b5920a6440b28ca2d11f765e3a44f
|
6c1b1b19462fb5c4a92132cc42b0e1622e0fa615
|
refs/heads/master
| 2016-09-14T01:32:22.582890 | 2016-05-27T08:43:13 | 2016-05-27T08:43:13 | 56,293,944 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 268 |
java
|
public class Kadai15{
public static void main(String[] arg){
int a = 2;
int soin = new java.util.Scanner(System.in).nextInt();
while(soin != 1){
if(soin % a == 0){
soin = soin / a;
System.out.println(a);
}
else{
a++;
}
}
}
}
|
[
"[email protected]"
] | |
a69f73aea773c9b0861a71d2e437a9ac4a2ad738
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/1/1_4739a53fed9ef9fc6665b4fd7ea5be68074793fb/Scan/1_4739a53fed9ef9fc6665b4fd7ea5be68074793fb_Scan_s.java
|
13577398a9817d19eb4e61da2cd71d24b2c1aa6b
|
[] |
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 | 7,377 |
java
|
package ru.spbau.bioinf.tagfinder;
import edu.ucsd.msalign.res.MassConstant;
import edu.ucsd.msalign.spec.peak.DeconvPeak;
import edu.ucsd.msalign.spec.sp.Ms;
import edu.ucsd.msalign.spec.sp.MsHeader;
import ru.spbau.bioinf.tagfinder.util.ReaderUtil;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
public class Scan {
private int id;
private List<Peak> peaks = new ArrayList<Peak>();
private double precursorMz;
private int precursorCharge;
private double precursorMass;
private String name;
public Scan(Properties prop, BufferedReader input, int scanId) throws IOException {
id = scanId;
name = Integer.toString(id);
precursorCharge = ReaderUtil.getIntValue(prop, "CHARGE");
precursorMass = ReaderUtil.getDoubleValue(prop, "MONOISOTOPIC_MASS");
List<String[]> datas;
while ((datas = ReaderUtil.readDataUntil(input, "END ENVELOPE")).size() > 0) {
double mass = 0;
double score = 0;
int charge = 0;
for (String[] data : datas) {
if (data.length > 3) {
if ("REAL_MONO_MASS".equals(data[2])) {
mass = Double.parseDouble(data[3]);
}
}
if ("CHARGE".equals(data[0])) {
charge = Integer.parseInt(data[1]);
}
if ("SCORE".equals(data[0])) {
score = Double.parseDouble(data[1]);
}
}
if (mass > 0) {
peaks.add(new Peak(mass, score , charge));
}
}
}
public Scan(Properties prop, BufferedReader input) throws IOException {
id = ReaderUtil.getIntValue(prop, "SCANS");
name = Integer.toString(id);
precursorMz = ReaderUtil.getDoubleValue(prop, "PRECURSOR_MZ");
precursorCharge = ReaderUtil.getIntValue(prop, "PRECURSOR_CHARGE");
precursorMass = ReaderUtil.getDoubleValue(prop, "PRECURSOR_MASS");
List<String[]> datas = ReaderUtil.readDataUntil(input, "END IONS");
for (String[] data : datas) {
double mass = Double.parseDouble(data[0]);
if (mass < precursorMass) {
peaks.add(new Peak(mass, Double.parseDouble(data[1]), Integer.parseInt(data[2])));
}
}
}
public Scan(Scan original, List<Peak> peaks, int proteinId) {
id = original.getId();
name = original.getName() + "/" + proteinId;
precursorMz = original.getPrecursorMz();
precursorCharge = original.getPrecursorCharge();
precursorMass = original.getPrecursorMass();
this.peaks.addAll(peaks);
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public double getPrecursorMass() {
return precursorMass;
}
public List<Peak> getPeaks() {
return peaks;
}
public List<Peak> getYPeaks() {
List<Peak> yPeaks = new ArrayList<Peak>();
for (Peak peak : peaks) {
yPeaks.add(peak.getYPeak(precursorMass));
}
return yPeaks;
}
public int getPrecursorCharge() {
return precursorCharge;
}
public double getPrecursorMz() {
return precursorMz;
}
public List<Peak> createStandardSpectrum() {
List<Peak> peaks = new ArrayList<Peak>();
peaks.addAll(this.peaks);
peaks.add(new Peak(0, 0, 0));
peaks.add(new Peak(getPrecursorMass(), 0, 0));
Collections.sort(peaks);
return peaks;
}
public List<Peak> createSpectrumWithYPeaks(double precursorMassShift) {
List<Peak> peaks = new ArrayList<Peak>();
peaks.addAll(this.peaks);
peaks.add(new Peak(0, 0, 0));
double newPrecursorMass = precursorMass + precursorMassShift;
peaks.add(new Peak(newPrecursorMass, 0, 0));
for (Peak peak : this.peaks) {
peaks.add(peak.getYPeak(newPrecursorMass));
}
Collections.sort(peaks);
return peaks;
}
public void save(File dir) throws IOException {
File file = new File(dir, "scan_" + name.replaceAll("/", "_") + ".env");
PrintWriter out = ReaderUtil.createOutputFile(file);
out.println("BEGIN SPECTRUM");
out.println("ID -1");
out.println("SCANS " + id);
out.println("Ms_LEVEL 2");
out.println("ENVELOPE_NUMBER " + peaks.size());
out.println("MONOISOTOPIC_MASS " + precursorMass);
out.println("CHARGE " + precursorCharge);
for (Peak peak : peaks) {
out.println("BEGIN ENVELOPE");
out.println("REF_IDX 0");
out.println("CHARGE " + peak.getCharge());
out.println("SCORE " + peak.getIntensity());
out.println("THEO_PEAK_NUM 2 REAL_PEAK_NUM 2");
out.println("THEO_MONO_MZ 295.0114742929687 REAL_MONO_MZ 295.0114742929687");
out.println("THEO_MONO_MASS 294.0041982347717 REAL_MONO_MASS " + peak.getMass());
out.println("THEO_INTE_SUM 49471.15545654297 REAL_INTE_SUM 49471.15545654297");
out.println("295.01092529296875 43400.988214475015 true 55 295.01092529296875 48567.5703125");
out.println("296.01386829296877 6070.167242067955 true 57 296.0268859863281 903.5851440429688");
out.println("END ENVELOPE");
}
out.println("END SPECTRUM");
out.close();
}
public String saveTxt(File dir) throws IOException {
String scanName = "scan_" + name.replaceAll("/", "_") + ".txt";
File file = new File(dir, scanName);
PrintWriter out = ReaderUtil.createOutputFile(file);
out.println("BEGIN IONS");
out.println("ID=0");
out.println("SCANS=" + id);
out.println("PRECURSOR_MZ=" + precursorMz);
out.println("PRECURSOR_CHARGE=" + precursorCharge);
out.println("PRECURSOR_MASS=" + precursorMass);
for (Peak peak : peaks) {
out.println(peak.getMass() + "\t" + peak.getIntensity() + "\t" + peak.getCharge());
}
out.println("END IONS");
out.close();
return scanName;
}
public Ms<DeconvPeak> getMsDeconvPeaks() throws Exception {
DeconvPeak deconvPeaks[] = new DeconvPeak[peaks.size()];
for (int i = 0; i < peaks.size(); i++) {
Peak peak = peaks.get(i);
deconvPeaks[i] = new DeconvPeak(i, peak.getMass(), peak.getIntensity(), peak.getCharge());
}
MsHeader header = new MsHeader(precursorCharge);
header.setTitle("sp_" + id);
header.setPrecMonoMz(precursorMass / precursorCharge + MassConstant.getProtonMass());
header.setScans(Integer.toString(id));
header.setId(id);
Ms<DeconvPeak> deconvMs = new Ms<DeconvPeak>(deconvPeaks, header);
deconvMs.sortOnPos();
return deconvMs;
}
}
|
[
"[email protected]"
] | |
5fe64187517b272bcde479944a9c205719aaa0d7
|
b9bfe3e750ec5f54d341f2e5e4e54eef76b91b66
|
/src/main/java/com/lilbecedary/ws/ui/model/requests/MediaRequestModel.java
|
6010cfcc14110c868b0ad8909abf9a923232f5a0
|
[] |
no_license
|
romanaaav/lil-becedary-api
|
81c120cd806561026eb76d4b8c3c8ea2fb58e7c4
|
afb4616da08589c4b2d061ff2bf5a9a1a21145e0
|
refs/heads/master
| 2022-08-26T16:53:08.137308 | 2020-05-20T16:28:50 | 2020-05-20T16:28:50 | 256,059,060 | 2 | 0 | null | 2020-05-20T16:28:51 | 2020-04-15T23:21:17 |
Java
|
UTF-8
|
Java
| false | false | 83 |
java
|
package com.lilbecedary.ws.ui.model.requests;
public class MediaRequestModel {
}
|
[
"[email protected]"
] | |
beebd3e8388f926effbe24caa44a0ad14de19b70
|
474ba93c0a231e3d9ed3103fd0ed00e178338fdd
|
/src/main/java/com/magicpanda/game/jelly/dao/LevelDao.java
|
9a45d1eb408c00a7000428a3cff2db262bb48f4d
|
[] |
no_license
|
magicpanda/JellyGame
|
a835b19d250069d4db0c367a1de425f74e344b5e
|
cf7c2491cf6dee492ea06cd75d641d3db975e44e
|
refs/heads/master
| 2021-01-25T10:39:12.281107 | 2015-03-30T08:06:54 | 2015-03-30T08:06:54 | 32,981,541 | 0 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 979 |
java
|
package com.magicpanda.game.jelly.dao;
import com.magicpanda.game.jelly.model.LevelLayout;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Component;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
/**
* Created by 利彬 on 2015/3/29.
* Level Init Layout Data and etc.DAO
*/
@Component
public class LevelDao extends JdbcDaoSupport {
public List<LevelLayout> getLevelLayoutList() {
String sql = "SELECT * FROM level_layout t";
return super.getJdbcTemplate().query(sql, new RowMapper() {
public LevelLayout mapRow(ResultSet rs, int num) throws SQLException {
LevelLayout levelLayout = new LevelLayout();
levelLayout.setLevel(rs.getInt("level"));
levelLayout.setLayout(rs.getString("layout"));
return levelLayout;
}
});
}
}
|
[
"[email protected]"
] | |
95fc66a7015bb666bc667a3f5280f6df3c801a08
|
b57311e574b51a322963f44319365e5770716b66
|
/com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/core/rss/FeedMessage.java
|
982a93bdf7d11d41d888f3c51c0a131cfd1b4923
|
[
"Apache-2.0"
] |
permissive
|
augint/aws-toolkit-eclipse
|
939ae2f00f5c33d0bf82ee6c96aa5886f14bf671
|
6336cb1043f2d03708001214e61e3afb4506e846
|
refs/heads/master
| 2021-01-22T16:04:58.223795 | 2016-03-25T01:37:12 | 2016-03-25T01:37:12 | 57,072,211 | 1 | 0 | null | 2016-04-25T19:57:45 | 2016-04-25T19:57:45 | null |
UTF-8
|
Java
| false | false | 1,538 |
java
|
/*
* Copyright 2008-2013 Lars Vogel
*
* Licensed under the Eclipse Public License - v 1.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.eclipse.org/legal/epl-v10.html
*
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
* OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and
* limitations under the License.
*/
package com.amazonaws.eclipse.core.rss;
/*
* Represents one RSS message
*/
public class FeedMessage {
String title;
String description;
String link;
String author;
String guid;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getGuid() {
return guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
@Override
public String toString() {
return "FeedMessage [title=" + title + ", description=" + description
+ ", link=" + link + ", author=" + author + ", guid=" + guid
+ "]";
}
}
|
[
"[email protected]"
] | |
36ad2c39a627a8470b86b5bf7dd76bdeae5841db
|
485cea47fd87f58a753ba581eae1e88e67f01be7
|
/CoyoteDX/src/main/java/coyote/commons/eval/Token.java
|
0527aeaf5533223b3c45fa5bad8bb640716fafb3
|
[] |
no_license
|
sdcote/coyote
|
18706dc345addf6cd64809f840e2bddb4309bc17
|
7de908e3f089715ad1652f357dc95d2ceb5483c4
|
refs/heads/main
| 2023-03-06T23:42:49.573817 | 2023-03-02T17:06:31 | 2023-03-02T17:06:31 | 89,138,130 | 8 | 4 | null | 2022-11-10T22:06:36 | 2017-04-23T11:52:21 |
JavaScript
|
UTF-8
|
Java
| false | false | 3,935 |
java
|
package coyote.commons.eval;
/**
* A token of an expression.
*
* <p>When evaluating an expression, it is first split into tokens. These
* tokens can be operators, constants, etc ...
*/
public class Token {
static final Token FUNCTION_ARG_SEPARATOR = new Token(Kind.FUNCTION_SEPARATOR, null);
private final Object content;
private final Kind kind;
protected static Token buildCloseToken(final BracketPair pair) {
return new Token(Kind.CLOSE_BRACKET, pair);
}
protected static Token buildFunction(final Function function) {
return new Token(Kind.FUNCTION, function);
}
protected static Token buildLiteral(final String literal) {
return new Token(Kind.LITERAL, literal);
}
protected static Token buildMethod(final Method method) {
return new Token(Kind.METHOD, method);
}
protected static Token buildOpenToken(final BracketPair pair) {
return new Token(Kind.OPEN_BRACKET, pair);
}
protected static Token buildOperator(final Operator ope) {
return new Token(Kind.OPERATOR, ope);
}
private Token(final Kind kind, final Object content) {
super();
if ((kind.equals(Kind.OPERATOR) && !(content instanceof Operator)) || (kind.equals(Kind.FUNCTION) && !(content instanceof Function)) || (kind.equals(Kind.METHOD) && !(content instanceof Method)) || (kind.equals(Kind.LITERAL) && !(content instanceof String))) {
throw new IllegalArgumentException();
}
this.kind = kind;
this.content = content;
}
/**
* Tests whether the token is a close bracket.
*
* @return true if the token is a close bracket
*/
public boolean isCloseBracket() {
return kind.equals(Kind.CLOSE_BRACKET);
}
/**
* Tests whether the token is a function.
*
* @return true if the token is a function
*/
public boolean isFunction() {
return kind.equals(Kind.FUNCTION);
}
/**
* Tests whether the token is a function argument separator.
*
* @return true if the token is a function argument separator
*/
public boolean isFunctionArgumentSeparator() {
return kind.equals(Kind.FUNCTION_SEPARATOR);
}
/**
* Tests whether the token is a literal or a constant or a variable name.
*
* @return true if the token is a literal, a constant or a variable name
*/
public boolean isLiteral() {
return kind.equals(Kind.LITERAL);
}
/**
* Tests whether the token is a method.
*
* @return true if the token is a method
*/
public boolean isMethod() {
return kind.equals(Kind.METHOD);
}
/**
* Tests whether the token is an open bracket.
*
* @return true if the token is an open bracket
*/
public boolean isOpenBracket() {
return kind.equals(Kind.OPEN_BRACKET);
}
/**
* Tests whether the token is an operator.
*
* @return true if the token is an operator
*/
public boolean isOperator() {
return kind.equals(Kind.OPERATOR);
}
/**
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return content != null ? content.toString() : "NULL";
}
protected Operator.Associativity getAssociativity() {
return getOperator().getAssociativity();
}
protected BracketPair getBrackets() {
return (BracketPair)content;
}
protected Function getFunction() {
return (Function)content;
}
protected Kind getKind() {
return kind;
}
protected String getLiteral() {
if (!kind.equals(Kind.LITERAL)) {
throw new IllegalArgumentException();
}
return (String)content;
}
protected Method getMethod() {
return (Method)content;
}
protected Operator getOperator() {
return (Operator)content;
}
protected int getPrecedence() {
return getOperator().getPrecedence();
}
private enum Kind {
CLOSE_BRACKET, FUNCTION, FUNCTION_SEPARATOR, LITERAL, METHOD, OPEN_BRACKET, OPERATOR
}
}
|
[
"[email protected]"
] | |
70a3e83975fab0b7edf26118f758c66d2e039394
|
5d3d846b1377980e7fcc25fdcc028f0daec7c784
|
/app/src/main/java/com/osamaelsh3rawy/otlop/view/fragment/user/more/FragmentUserMore.java
|
a86d9d73bafc21880bc2ea9fc43cf812640314fb
|
[] |
no_license
|
osaam/Sofra
|
9ea6a7acc05970f0403bf164766a6f68cc4874ae
|
45ca5ff4d911b736d6ffc038487592a38748e300
|
refs/heads/master
| 2021-05-17T07:03:37.052658 | 2020-03-28T01:19:04 | 2020-03-28T01:19:04 | 250,687,581 | 3 | 0 | null | null | null | null |
UTF-8
|
Java
| false | false | 5,182 |
java
|
package com.osamaelsh3rawy.otlop.view.fragment.user.more;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;
import com.osamaelsh3rawy.otlop.R;
import com.osamaelsh3rawy.otlop.data.local.SharedPreferencesManger;
import com.osamaelsh3rawy.otlop.view.activity.ActivitySplashCycle;
import com.osamaelsh3rawy.otlop.view.activity.ActivityUserCycle;
import com.osamaelsh3rawy.otlop.view.activity.ActivityUserLoginCycle;
import com.osamaelsh3rawy.otlop.view.folder.BaseFragment;
import com.osamaelsh3rawy.otlop.view.fragment.user.FragmentUserMyAccount;
import butterknife.ButterKnife;
import butterknife.OnClick;
import static com.osamaelsh3rawy.otlop.data.local.Constanse.User_Api_Takin;
import static com.osamaelsh3rawy.otlop.helper.HelperMethods.replaceFragment;
public class FragmentUserMore extends BaseFragment {
public FragmentUserMore() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_user_more, container, false);
ButterKnife.bind(this, view);
intiFragment();
return view;
}
@Override
public void onBack() {
super.onBack();
}
@Override
public void onDestroy() {
super.onDestroy();
}
@OnClick({R.id.fragment_more_txt_offer, R.id.fragment_more_txt_contact, R.id.fragment_more_txt_about, R.id.fragment_more_txt_change_pass, R.id.fragment_more_txt_log_out})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.fragment_more_txt_offer:
replaceFragment(getActivity().getSupportFragmentManager(), R.id.activity_user_container, new FragmentUserOffers());
break;
case R.id.fragment_more_txt_contact:
if (SharedPreferencesManger.LoadData(getActivity(), User_Api_Takin) != (null)) {
replaceFragment(getActivity().getSupportFragmentManager(), R.id.activity_user_container, new FragmentUserContact());
} else {
Intent intent = new Intent(getActivity(), ActivityUserLoginCycle.class);
startActivity(intent);
}
break;
case R.id.fragment_more_txt_about:
replaceFragment(getActivity().getSupportFragmentManager(), R.id.activity_user_container, new FragmentUserAboutUs());
break;
case R.id.fragment_more_txt_change_pass:
if (SharedPreferencesManger.LoadData(getActivity(), User_Api_Takin) != (null)) {
replaceFragment(getActivity().getSupportFragmentManager(), R.id.activity_user_container, new FragmentUserChangePassword());
} else {
Intent intent = new Intent(getActivity(), ActivityUserLoginCycle.class);
startActivity(intent);
}
break;
case R.id.fragment_more_txt_log_out:
if (SharedPreferencesManger.LoadData(getActivity(), User_Api_Takin) != (null)) {
Dialog dialog = new Dialog(getActivity());
LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(R.layout.dialog_log_out, null);
dialog.setContentView(v);
Button button = (Button) dialog.findViewById(R.id.dialog_yes_btn);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), ActivitySplashCycle.class);
getActivity().startActivity(intent);
getActivity().finish();
SharedPreferencesManger.clean(getActivity());
Toast.makeText(baseActivity, "You Have LogOut", Toast.LENGTH_SHORT).show();
}
});
Button btn_done = (Button) dialog.findViewById(R.id.dialog_no_btn);
btn_done.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
else {
Intent intent = new Intent(getActivity(), ActivityUserLoginCycle.class);
startActivity(intent);
}
break;
}
}
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.