blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
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
684M
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
132 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
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
bef3b98adf2e96d428af616b16ac37bcf7790ce7
310dc91e80723dce75c9e3314b49e7c99a4468c6
/Hippodrome/src/ru/krsu/Horse.java
f76f330138a271c51b545694692014a5c26462bb
[]
no_license
Vlad-Sav/java-console-projects
7878e374c752fd187582956f587cd7868097d099
2e8d311e383a8a460d241a7766b17d0da96de3e2
refs/heads/main
2023-08-24T14:07:29.922356
2021-10-18T11:17:18
2021-10-18T11:17:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
936
java
package ru.krsu; public class Horse { private double distance; private double speed; private String name; public double getDistance() { return distance; } public void setDistance(double distance) { this.distance = distance; } public double getSpeed() { return speed; } public void setSpeed(double s0peed) { this.speed = s0peed; } public String getName() { return name; } public void move(){ distance += speed*Math.random(); } public void print(){ for(int i = 0; i < Math.floor(distance); i++){ System.out.print("."); } System.out.println(name); } public void setName(String name) { this.name = name; } public Horse(String name, double speed, double distance) { this.distance = distance; this.speed = speed; this.name = name; } }
[ "savchenko_vladlen2511@mail.ru" ]
savchenko_vladlen2511@mail.ru
60472551be2d2bfe193bc19318d81429f5d75019
64f9ae91dcd30c82c0d26aed88b0d7991862df75
/app/src/main/java/com/gt/homeNas/domain/UserRepository.java
43f107a06bc42061b755a158bafcd49db05ba419
[]
no_license
jianzhexu/homeNas
9111d81204f3d8516019c567669145b118090252
2a0542807e230126e8aa7e9c61cb8dfcf2f20966
refs/heads/master
2023-04-12T12:46:43.204014
2021-05-02T00:44:06
2021-05-02T00:44:06
363,537,285
0
0
null
null
null
null
UTF-8
Java
false
false
334
java
package com.gt.homeNas.domain; import com.gt.homeNas.domain.entity.User; import com.gt.homeNas.types.UserAccount; import com.gt.homeNas.types.UserId; import java.util.Optional; public interface UserRepository { public Optional<User> findByAccount(UserAccount userAccount); public Optional<User> findById(UserId userId); }
[ "jianzhe.xu@qq.com" ]
jianzhe.xu@qq.com
735250fd40a031d94fa34ae710a4fb20badc7dd3
176ff23723df0bbf555a4cfc3dec5264f60b82f1
/src/main/java/com/company/binaryTree/BinaryTreeTest.java
ad58aa12c487e9d2ba4dfd9f6ed897adb8259b19
[]
no_license
doyoung0205/live-study
6c8df1c2989793f72f6466eb195ca5517932a37d
d8f8a8eba4d30636152ee8491ecab7a9bf3910e1
refs/heads/main
2023-03-26T23:30:14.853907
2021-03-14T06:51:51
2021-03-14T06:51:51
323,946,499
0
0
null
null
null
null
UTF-8
Java
false
false
3,993
java
package com.company.binaryTree; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class BinaryTreeTest { private static BinaryTree binaryTree; final static int rootValue = 23; @BeforeEach public void rootInit() { binaryTree = new BinaryTree(new Node(rootValue)); } @Test @DisplayName("dfs") void dfs() throws IllegalAccessException { // given final BinaryTree binaryTree = sampleBinaryTree(); // when final boolean result = binaryTree.dfs(35); // then assertTrue(result); } @Test @DisplayName("bfs") void bfs() throws IllegalAccessException { // given final BinaryTree binaryTree = sampleBinaryTree(); // when final boolean result = binaryTree.bfs(35); // then assertTrue(result); } @Test @DisplayName("이진트리에 값을 삭제 하는 경우") void deleteNode() throws IllegalAccessException { // given final Node root = sampleBinaryTree().getRoot(); // when assertEquals(root.getRight().getValue(), 29); BinaryTreeTest.binaryTree.deleteNode(29); // then assertAll(() -> { assertEquals(root.getRight().getValue(), 33); assertNotEquals(root.getRight().getValue(), 29); }); } @Test @DisplayName("이진트리에 중복값이 들어갔을 경우") void insertDuplicateValue() { // given binaryTree = new BinaryTree(new Node(rootValue)); // when // then } @Test @DisplayName("이진트리에 제대로 들어 갔을 경우") void insertNode() throws IllegalAccessException { // given final Node root = sampleBinaryTree().getRoot(); assertAll(() -> { assertEquals(root.getLeft().getValue(), 10); assertEquals(root.getLeft().getLeft().getValue(), 4); assertEquals(root.getLeft().getLeft().getLeft().getValue(), 3); assertEquals(root.getRight().getValue(), 29); assertEquals(root.getRight().getLeft().getValue(), 28); assertEquals(root.getRight().getLeft().getLeft().getValue(), 27); assertEquals(root.getRight().getRight().getValue(), 40); assertEquals(root.getRight().getRight().getLeft().getValue(), 33); assertEquals(root.getRight().getRight().getRight().getValue(), 50); assertEquals(root.getRight().getRight().getLeft().getRight().getValue(), 35); }); } private BinaryTree sampleBinaryTree() throws IllegalAccessException { // root 23 에서 왼족으로 10 삽입 binaryTree.insertNode(10); // root 23 에서 오른족으로 15 삽입 binaryTree.insertNode(29); // 29 노드 에서 왼족으로 28 삽입 binaryTree.insertNode(28); // 27 노드 에서 왼족으로 28 삽입 binaryTree.insertNode(27); // 29 노드 에서 오른쪽으로 40 삽입 binaryTree.insertNode(40); // 40 노드 에서 왼쪽으로 33 삽입 binaryTree.insertNode(33); // 40 노드 에서 오른쪽으로 50 삽입 binaryTree.insertNode(50); // 33 노드 에서 오른쪽으로 35 삽입 binaryTree.insertNode(35); // 33 노드 에서 왼쪽으로 32 삽입 binaryTree.insertNode(32); // 10 노드 에서 왼쪽으로 4 삽입 binaryTree.insertNode(4); // 10 노드 에서 오른쪽으로 11 삽입 binaryTree.insertNode(11); // 4 노드 에서 왼쪽으로 3 삽입 binaryTree.insertNode(3); return binaryTree; } @Test @DisplayName("루트 초기화 23 인가요?") void initRoot() { assertEquals(binaryTree.getRoot().getValue(), 23); } }
[ "doyoung0205@naver.com" ]
doyoung0205@naver.com
dbb9bd2300d214f7f39bd0f55d8da68d983c230f
18a4cb5c313c1640d976eeb4352a5f7f376ded85
/src/main/java/com/ronaldo/cursomc/domain/Estado.java
0538178fc3330c8cdaf20c7b157a0b49e7db225c
[]
no_license
ronaldoamui/cursomc
51976474172918d6aa6332f86d0a97539e2f06bb
83ebe01ecedd771fcdbd6a8adbe07772d4184252
refs/heads/master
2022-12-28T06:52:45.930673
2020-10-09T23:03:41
2020-10-09T23:03:41
300,633,493
1
0
null
null
null
null
UTF-8
Java
false
false
1,614
java
package com.ronaldo.cursomc.domain; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import com.fasterxml.jackson.annotation.JsonIgnore; @Entity public class Estado implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private String nome; @JsonIgnore @OneToMany(mappedBy = "estado") private List<Cidade> cidades = new ArrayList<>(); public Estado() { } public Estado(Integer id, String nome) { super(); this.id = id; this.nome = nome; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public List<Cidade> getCidades() { return cidades; } public void setCidades(List<Cidade> cidades) { this.cidades = cidades; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Estado other = (Estado) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }
[ "ronaldoamuikb@hotmail.com" ]
ronaldoamuikb@hotmail.com
31f76ad1e3dee9782cb82cedbd5611b264842738
508cf912d7a6068c2e9e0865bca19c00c49b5ac7
/src/pelib/ui/ProgressDialog.java
0129ba6d87a82540c2c27e19f682b67fba7768b6
[]
no_license
saravananshc/dul
f0f979f9ac86cc69ed0a8ca72132ec2d732e83b6
713c0967c4559ce9d0423699f2876fe23bdad684
refs/heads/master
2021-01-18T17:08:40.088753
2013-04-13T07:02:13
2013-04-13T07:02:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,404
java
/* */ package pelib.ui; /* */ /* */ import java.awt.Dialog; /* */ import java.awt.FlowLayout; /* */ import java.awt.Frame; /* */ import java.awt.Label; /* */ import java.awt.Panel; /* */ /* */ public class ProgressDialog extends Dialog /* */ { /* */ private ProgressBar bar; /* */ private Label label; /* */ /* */ public ProgressDialog(Frame owner) /* */ { /* 17 */ super(owner); /* 18 */ setModal(false); /* */ /* 20 */ Panel panel = new Panel(); /* 21 */ panel.setLayout(new FlowLayout(0)); /* 22 */ this.label = new Label(); /* 23 */ panel.add(this.label); /* */ /* 25 */ this.bar = new ProgressBar(); /* */ /* 27 */ add(panel, "North"); /* 28 */ add(this.bar, "Center"); /* */ /* 30 */ pack(); /* 31 */ setLocationRelativeTo(getOwner()); /* */ } /* */ /* */ public void setProgress(int value, int range) /* */ { /* 36 */ this.bar.setValue(value); /* 37 */ this.bar.setRange(range); /* 38 */ this.bar.updateImmediately(); /* */ } /* */ /* */ public void setDescription(String description) /* */ { /* 43 */ this.label.setText(description); /* */ } /* */ } /* Location: dulux-signed.jar * Qualified Name: pelib.ui.ProgressDialog * JD-Core Version: 0.6.2 */
[ "dawntoworld@gmail.com" ]
dawntoworld@gmail.com
ad2963fb490eaa531de15b88dadb0b8680a4e6b7
8073bc887b4060ebbb2f2649d49167dd33bc6609
/src/main/java/cn/posolft/controller/UserController.java
938e4d2e7e1f3dfc11803e76c0889a8f2be09936
[]
no_license
18221019707/posoft_web
d2ed5a726f5c21a26c562c5ae11602b108ac8c8a
1944067012db8569489e60db12a9cf1267c37e21
refs/heads/master
2021-01-20T10:24:19.099540
2017-05-05T09:11:22
2017-05-05T09:13:47
90,342,541
0
0
null
null
null
null
UTF-8
Java
false
false
812
java
package cn.posolft.controller; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import cn.posolft.pojo.User; import cn.posolft.service.IUserService; @Controller @RequestMapping("/user") public class UserController { @Resource private IUserService userService ; @RequestMapping("/login") public String toIndex(HttpServletRequest request,Model model){ int userId = Integer.parseInt(request.getParameter("id")); User user = this.userService.getUserById(userId); model.addAttribute("user", user); return "admin/index"; } }
[ "1065021156@qq.com" ]
1065021156@qq.com
a4ca50c452db15d234d275ee97572076ebef09ab
cb85fb49b1f5d75736937d6e3465271e874f862e
/src/main/java/com/skd/utils/PropertiesUtil.java
876397d173fb00487292fab4e2f77fecd89a7914
[]
no_license
Zhaoqian1023/graduation
ce58a382e56a525e92539f81ad4a1c3f0798dd64
c46ba397ab89b811bfba98332bfb332838932a13
refs/heads/master
2020-03-13T02:43:01.577882
2018-10-18T01:45:49
2018-10-18T01:45:49
130,929,964
0
1
null
null
null
null
UTF-8
Java
false
false
934
java
/** * @Title: PropertiesUtil.java * @Package com.skd.utils * @Description: TODO * @author zhaoqian * @date 2018年4月27日 */ package com.skd.utils; import java.io.IOException; import java.util.Properties; import org.springframework.beans.factory.config.PropertiesFactoryBean; import org.springframework.core.io.ClassPathResource; /** * ClassName: PropertiesUtil * @Description: TODO * @author zhaoqian * @date 2018年4月27日 */ public class PropertiesUtil { public static Properties getConfigProperties() throws Exception { PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean(); propertiesFactoryBean.setLocation(new ClassPathResource("properties/config.properties")); try { propertiesFactoryBean.afterPropertiesSet(); return propertiesFactoryBean.getObject(); } catch (IOException e) { throw new Exception("read config.properties file error,"+e.getMessage()); } } }
[ "skzhaoqian@outlook.com" ]
skzhaoqian@outlook.com
22282d2ecd2a05360d21d76f04529148599579b9
24cb887d74c11babd99233800ba69d2ba9908ea0
/src/com/company/PuzzleGUI.java
6e675e1bb1c55d17b88a3ff9dfd4dfdb386e1d54
[]
no_license
berire/aicross
8b357b55eba068afab582ae34d3249b52c443d3e
ab3b9d6efda8acef70efb2e39ba3bc4d62206ecb
refs/heads/master
2021-01-20T06:23:04.411241
2017-05-01T01:48:46
2017-05-01T01:48:46
89,871,059
0
0
null
null
null
null
UTF-8
Java
false
false
19,521
java
package com.company; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.simmetrics.StringMetric; import org.simmetrics.metrics.CosineSimilarity; import org.simmetrics.simplifiers.Simplifiers; import org.simmetrics.tokenizers.Tokenizers; import javax.swing.*; import javax.swing.border.EmptyBorder; import java.awt.*; import java.awt.font.LineMetrics; import java.io.IOException; import java.util.ArrayList; import java.util.Locale; import static org.simmetrics.builders.StringMetricBuilder.with; class WordStart { public WordStart(int i, int j, boolean is_across, int length) { this.i = i; this.j = j; this.is_across = is_across; this.length = length; } int i; int j; boolean is_across; // if false, this is a down start int length; } public class PuzzleGUI extends JPanel{ static ArrayList<String> DATACLUE = new ArrayList<>(); static ArrayList<String> DATAANSWER = new ArrayList<>(); static final String[] myCluelist = new String[10]; static final String[] myLabelist = new String[10]; //these variable are for making random puzzles static int xCurrSquare=0; static int yCurrSquare=0; static int xss=500; //xss = x screen size static int yss=500; //yss = y screen size static int word_starts[][]; static final int WALL = -1; static final int BLANK = 0; static final int ACROSS = 1; static final int DOWN = 2; static final int BOTH = 3; static ArrayList<String> wordsUsed = new ArrayList<String>(); static ArrayList<String> words = new ArrayList<String>(); static ArrayList<Integer> counts = new ArrayList<Integer>(); static ArrayList<String> matchedAC=new ArrayList<>(); static ArrayList<String> answrAC=new ArrayList<>(); static ArrayList<String> matchedDW=new ArrayList<>(); static ArrayList<String> answrDW=new ArrayList<>(); static int[] acrossLengths = new int [5]; static int[] downLengths = new int [5]; public void paintComponent(Graphics oldg){ Graphics2D g = (Graphics2D)oldg; g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setColor(Color.white); g.fillRect(0, 0, 500, 500); if (word_starts == null) { return; }g.setColor(Color.black); System.out.println("The puzzle is drawed"); graphics(g); drawOutline(g); } private void drawOutline(Graphics2D g) { // System.out.println("drawOutline"); int xStart =xss*2/11; int yStart =yss*2/11; //g.drawRect(xStart, yStart, xss*7/11, yss*7/11); //g.drawRect(100, 100, 1*7/11, 100); for(int i=0;i<=word_starts[0].length;i++){ int x = (int)(xStart+7.0/11*xss*i/word_starts[0].length); g.drawLine(x, yStart, x , (int)(yStart+yss*7.0/11)); } for(int j=0;j<=word_starts[1].length;j++){ int y=(int) (yStart+7.0/11*yss*j/word_starts[1].length); g.drawLine(xStart, y, (int)(xStart+xss*7.0/11), y); } drawBox(xCurrSquare, yCurrSquare, g, Color.black); } public static void fillBox(int i, int j, Graphics2D g, Color color){ int xStart =xss*2/11; int yStart =yss*2/11; g.setColor(color); g.fillRect((int) (xStart + j * xss * 7.0 / 11 / word_starts[0].length), yStart + (int) (i * yss * 7.0 / 11 / word_starts[0].length), (int) (7.0 / 11 * xss / word_starts[0].length), (int) (7.0 / 11 * yss / word_starts[0].length)); } public static void drawBox(int i, int j, Graphics2D g, Color color){ int xStart =xss*2/11; int yStart =yss*2/11; g.setColor(color); g.drawRect((int) (xStart + j * xss * 7.0 / 11 / word_starts[0].length), yStart + (int) (i * yss * 7.0 / 11 / word_starts[0].length), (int) (7.0 / 11 * xss / word_starts[0].length), (int) (7.0 / 11 * yss / word_starts[0].length)); } private void graphics(Graphics2D g) { Font f = new Font("Arial", Font.PLAIN, 12); g.setFont(f); int count=0; int xStart =xss*2/11; int yStart =yss*2/11; g.setColor(Color.black); for(int i=0;i<word_starts.length;i++){ for(int j=0;j<word_starts[0].length;j++){ if(word_starts[i][j]==WALL){ fillBox(i,j,g,Color.black); } else if(word_starts[i][j]==BLANK) { }else{ count++; LineMetrics lm = f.getLineMetrics(".", g.getFontRenderContext()); g.drawString(count+".", (int)(2+xStart+j*xss*7.0/11/word_starts[0].length), (int)(2+lm.getAscent() + yStart+i*yss*7.0/11/word_starts[0].length)); } } } } public static void main(String[] args) throws IOException { data n=new data(); n.getdata(); //n.printClues(); DATACLUE=n.getclues(); DATAANSWER=n.getAnswers(); String[] dictionaryResults = new String[10]; boolean[] myBoxlist = new boolean[25]; /*String doc = Jsoup.connect("https://www.nytimes.com/crosswords/game/mini").get().outerHtml().toString(); //String text = doc.body().text(); System.out.println(doc); Elements hTags = doc.select("h2");*/ int counter = 0; int counter2 = 0; int counter3 = 0; int acrossCount = 0; int downCount = 0; try { System.out.println("-GOING TO https://www.nytimes.com/crosswords/game/mini-"); System.out.println(); // fetch the document over HTTP Document doc = Jsoup.connect("https://www.nytimes.com/crosswords/game/mini").get(); System.out.println("-GET THE SOURCE CODE-"); // get the page title String title = doc.title(); System.out.println("title: " + title); System.out.println(); // get all links in page Elements links = doc.select("a[href]"); Elements hlist = doc.select("h2"); Elements clabels = doc.select("li[value]"); Elements clues = doc.select("li[value]"); Elements boxes = doc.select("div[class]"); for (Element clabel : clabels) { myLabelist[counter3] = clabel.attr("value"); counter3++; } System.out.println("-TAKING THE CLUES FROM SOURCE CODE-"); for (Element clue : clues) { System.out.print("clue " + myLabelist[counter] + ". "); System.out.println(clue.text()); myCluelist[counter] = clue.text(); counter++; } for(int a=0;a<10;a++){ if(a<5){ dictionaryResults[a]=dictionary(myCluelist[a],acrossLengths[a]); } if(a>=5 && a<10){ dictionaryResults[a]=dictionary(myCluelist[a],downLengths[a-5]); } System.out.println("dictionary result " +a+ " " +dictionaryResults[a]); } System.out.println(); System.out.println("-DEFINING THE PLACE OF THE BLACK CELLS FROM SOURCE CODE-"); for (Element box : boxes) { if((box.attr("class")).equals("flex-cell ")){ myBoxlist[counter2] = true; counter2++; System.out.println(counter2 + ". cell: " + "white"); } if((box.attr("class")).equals("flex-cell black")){ myBoxlist[counter2] = false; counter2++; System.out.println(counter2 + ". cell: " + "black"); } //System.out.println(counter2); } }catch (IOException e) { e.printStackTrace(); } SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame("NY Times Crossword Puzzle"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); frame.setSize(1230, 500); JPanel gui = new JPanel(new BorderLayout(1,0)); gui.setBackground(Color.BLACK); gui.setBorder(new EmptyBorder(2,2,2,2)); System.out.println("In here, the clues of ACROSS are written to the panel"); JPanel panel1 = new JPanel(); panel1.setBorder(new EmptyBorder(15,20,20,20)); panel1.setBackground(Color.WHITE); JLabel label1=new JLabel("<html>ACROSS" + "<br>" + "<br>" + myLabelist[0]+ ". " + myCluelist[0] + "<br>" + myLabelist[1] + ". " + myCluelist[1] + "<br>" + myLabelist[2] + ". " + myCluelist[2] + "<br>" + myLabelist[3] + ". " + myCluelist[3] + "<br>" + myLabelist[4] + ". " + myCluelist[4] + "</html>", SwingConstants.CENTER); Font font = new Font("Courier", Font.BOLD,13); label1.setFont(font); panel1.add(label1); gui.add(panel1, BorderLayout.WEST); System.out.println("In here, the clues of DOWN are written to the panel"); System.out.println(); JPanel panel2 = new JPanel(); panel2.setBorder(new EmptyBorder(15,20,20,20)); panel2.setBackground(Color.WHITE); JLabel label2=new JLabel("<html>DOWN" + "<br>" + "<br>" + myLabelist[5]+ ". " + myCluelist[5] + "<br>" + myLabelist[6] + ". " + myCluelist[6] + "<br>" + myLabelist[7] + ". " + myCluelist[7] + "<br>" + myLabelist[8] + ". " + myCluelist[8] + "<br>" + myLabelist[9] + ". " + myCluelist[9] + "</html>", SwingConstants.CENTER); panel2.add(label2); gui.add(panel2, BorderLayout.EAST); Font font2 = new Font("Courier", Font.BOLD,13); label2.setFont(font2); frame.add(gui, BorderLayout.EAST); PuzzleGUI game = new PuzzleGUI(); frame.add(game, BorderLayout.CENTER); frame.validate(); } }); System.out.println("Now placing black cells to the puzzle"); boolean hasLetter[][] = { {myBoxlist[0], myBoxlist[1], myBoxlist[2], myBoxlist[3], myBoxlist[4]}, {myBoxlist[5], myBoxlist[6], myBoxlist[7], myBoxlist[8], myBoxlist[9]}, {myBoxlist[10], myBoxlist[11], myBoxlist[12], myBoxlist[13], myBoxlist[14]}, {myBoxlist[15], myBoxlist[16], myBoxlist[17], myBoxlist[18], myBoxlist[19]}, {myBoxlist[20], myBoxlist[21], myBoxlist[22], myBoxlist[23], myBoxlist[24]}, }; word_starts = new int[hasLetter.length][hasLetter.length]; char board[][] = new char[hasLetter.length][hasLetter.length]; for (int i = 0; i < word_starts.length; i++) { for (int j = 0; j < word_starts[0].length; j++) { if (hasLetter[i][j] == false) { word_starts[i][j] = WALL; } else { word_starts[i][j] = BLANK; } } } for (int i = 0; i < word_starts.length; i++) { for (int j = 0; j < word_starts[0].length; j++) { int thing=0; if(hasLetter[i][j]==false){ continue; } if((i==0 || hasLetter[i-1][j]==false) && // there is a wall above us AND (i < 4 && hasLetter[i+1][j]==true)) { // no wall below us word_starts[i][j]=DOWN; thing++; } if((j==0 || hasLetter[i][j-1]==false) && (j < 4 && hasLetter[i][j+1]==true)){ if(thing==1){ word_starts[i][j]=BOTH; } else{ word_starts[i][j]=ACROSS; } } } } //System.out.println("Word starts:"); //printStarts(word_starts); System.out.println(); ArrayList<WordStart> word_start_list = new ArrayList<WordStart>(); for (int i = 0; i < word_starts.length; i++) { for (int j = 0; j < word_starts[0].length; j++) { if (word_starts[i][j] == ACROSS || word_starts[i][j] == BOTH) { word_start_list.add(new WordStart(i, j, true, findWordLength(word_starts, i, j, true))); acrossLengths[acrossCount] = findWordLength(word_starts, i, j, true); System.out.println("across" + (acrossCount+1) + " = " + acrossLengths[acrossCount]); acrossCount++; } if (word_starts[i][j] == DOWN || word_starts[i][j] == BOTH) { word_start_list.add(new WordStart(i, j, false, findWordLength(word_starts, i, j, false))); downLengths[downCount] = findWordLength(word_starts, i, j, false); System.out.println("down" + (downCount + 1) + " = " + downLengths[downCount]); downCount++; } } } counts = new ArrayList<Integer>(); for (int i = 0; i < word_start_list.size(); i++) { counts.add(0); } matchedClues(); } static int findWordLength(int[][] word_starts, int i, int j, boolean is_across) { int len; for (len = 1; len < word_starts.length; len++) { if (is_across) { j++; } else { i++; } if (i >= word_starts.length || j >= word_starts.length || word_starts[i][j] == WALL) { break; } } return len; } private static boolean tryToSolve(ArrayList<WordStart> word_starts, char[][] board, int cur_word_start) { if (cur_word_start >= word_starts.size()) { return true; } counts.set(cur_word_start, counts.get(cur_word_start) + 1); WordStart ws = word_starts.get(cur_word_start); //System.out.println("Finding a word for " + ws.i + ", " + ws.j + ", with length " + ws.length + " -- across? " + ws.is_across); // Remember which characters in this word were already set boolean had_letter[] = new boolean[ws.length]; for (int i = 0; i < ws.length; i++) { had_letter[i] = true; } int r=ws.i; int c=ws.j; for (int i = 0; i < ws.length; i++) { if (board[r][c] == 0) { had_letter[i] = false; } if (ws.is_across) c++; else r++; } // Find a word that fits here, given the letters already on the board for (int i = 0; i < words.size(); i++) { String word = words.get(i); if (!wordsUsed.contains(word) && word.length() == ws.length) { boolean word_fits = true; r=ws.i; c=ws.j; for (int j = 0; j < ws.length; j++) { if (board[r][c] != 0 && board[r][c] != word.charAt(j)) { word_fits = false; break; } if (ws.is_across) c++; else r++; } if (word_fits) { // Place this word on the board wordsUsed.add(word); r=ws.i; c=ws.j; for (int j = 0; j < ws.length; j++) { board[r][c] = word.charAt(j); if (ws.is_across) c++; else r++; } // If puzzle can be solved this way, we're done if (tryToSolve(word_starts, board, cur_word_start + 1)) { return true; } // If not, take up letters that we placed and try a different word r=ws.i; c=ws.j; for (int j = 0; j < ws.length; j++) { if (!had_letter[j]) board[r][c] = 0; if (ws.is_across) c++; else r++; } wordsUsed.remove(word); } } } // If no word can work, return false. return false; } private static void printSolution(int[][] word_starts, char[][] board) { for (int i = 0; i < word_starts.length; i++) { for (int j = 0; j < word_starts[0].length; j++) { int ws=word_starts[i][j]; if(ws==WALL){ System.out.print("_ "); } else { System.out.print(board[i][j] + " "); } } System.out.println(); } } public static String dictionary(String clue, int clueLength) throws IOException{ //String clue="run for your wife"; char[] charArray = clue.toCharArray(); ArrayList <String> newCharList = new ArrayList <String>(); for(int i=0;i<charArray.length;i++){ if(Character.isWhitespace(charArray[i])){ newCharList.add("+"); } else if(charArray[i]==':'){ newCharList.add("%3A"); } else if(charArray[i]=='\''){ newCharList.add("%27"); } else if(charArray[i]=='('){ newCharList.add("%28"); } else if(charArray[i]==')'){ newCharList.add("%29"); } else if(charArray[i]=='/'){ newCharList.add("%2F"); } else if(charArray[i]=='\\'){ newCharList.add("%5C"); } else if(charArray[i]==','){ newCharList.add("%2C"); } else if(charArray[i]==','){ newCharList.add("%3B"); } else if(charArray[i]=='?'){ newCharList.add("%3F"); } else if(charArray[i]=='!'){ newCharList.add("%21"); } else if(charArray[i]=='%'){ newCharList.add("%25"); } else if(charArray[i]=='&'){ newCharList.add("%26"); } else if(charArray[i]=='#'){ newCharList.add("%23"); } else if(charArray[i]=='+'){ newCharList.add("%2B"); } else if(charArray[i]=='$'){ newCharList.add("%24"); } else if(charArray[i]=='='){ newCharList.add("%3D"); } else{ newCharList.add(String.valueOf(charArray[i])); } } String s=""; for(int x=0;x<newCharList.size();x++){ s= s+(newCharList.get(x)); } String url="http://www.dictionary.com/fun/crosswordsolver?query="+s+"&pattern=&l="+clueLength; //System.out.println(url); //System.out.println(newCharList); Document doc = Jsoup.connect(url).get(); Elements words = doc.select("div[class]"); int counter=0; int counter2=0; String[] myWordlist= new String[100]; String x; String[] confidencelist= new String[100]; for (Element word : words) { if((word.attr("class")).equals("matching-answer")){ myWordlist[counter] = word.text(); counter++; } if((word.attr("class")).equals("confidence")){ confidencelist[counter] = word.text(); counter2++; } } //System.out.println(myWordlist[1]); String con=confidencelist[1].substring(0,confidencelist[1].length()-1); int x2=Integer.valueOf(con); if(x2>=90) return myWordlist[1]; else return ""; } public static void matchedClues() { StringMetric metric = with(new CosineSimilarity<String>()) .simplify(Simplifiers.toLowerCase(Locale.ENGLISH)) .simplify(Simplifiers.removeDiacritics()) .simplify(Simplifiers.replaceNonWord()) .tokenize(Tokenizers.whitespace()) .tokenize(Tokenizers.qGram(3)) .build(); //StringMetric metric = StringMetrics.cosineSimilarity(); for (int i=0;i<5;i++) { for(int g=0;g<DATACLUE.size();g++) { double sim=similarity(DATACLUE.get(g),myCluelist[i]); float result = metric.compare(DATACLUE.get(g),myCluelist[i]); if(result>=0.7 && (DATAANSWER.get(g).length()==acrossLengths[i])) {matchedAC.add(myCluelist[i]); answrAC.add(DATAANSWER.get(g));} double sim1=similarity(DATACLUE.get(g),myCluelist[i+5]); float result1 = metric.compare(DATACLUE.get(g),myCluelist[i+5]); if(result1>=0.7 && (DATAANSWER.get(g).length()==downLengths[i])) {matchedDW.add(myCluelist[i+5]); answrDW.add(DATAANSWER.get(g));} } } if(matchedAC.size()==0) System.out.println(" NOTING ACROSS"); if(matchedDW.size()==0) System.out.println(" NOTING DOWN"); for(int y=0;y<matchedAC.size();y++) System.out.println("ACROSS MATCHED: "+ matchedAC.get(y)+" ANSWER: "+ answrAC.get(y)); for(int y=0;y<matchedDW.size();y++) System.out.println("DOWN MATCHED: "+ matchedDW.get(y)+" ANSWER: "+ answrDW.get(y)); } /** * Calculates the similarity (a number within 0 and 1) between two strings. */ public static double similarity(String s1, String s2) { String longer = s1, shorter = s2; if (s1.length() < s2.length()) { // longer should always have greater length longer = s2; shorter = s1; } int longerLength = longer.length(); if (longerLength == 0) { return 1.0; /* both strings are zero length */ } /* // If you have StringUtils, you can use it to calculate the edit distance: return (longerLength - StringUtils.getLevenshteinDistance(longer, shorter)) / (double) longerLength; */ return (longerLength - editDistance(longer, shorter)) / (double) longerLength; } // Example implementation of the Levenshtein Edit Distance // See http://rosettacode.org/wiki/Levenshtein_distance#Java public static int editDistance(String s1, String s2) { s1 = s1.toLowerCase(); s2 = s2.toLowerCase(); int[] costs = new int[s2.length() + 1]; for (int i = 0; i <= s1.length(); i++) { int lastValue = i; for (int j = 0; j <= s2.length(); j++) { if (i == 0) costs[j] = j; else { if (j > 0) { int newValue = costs[j - 1]; if (s1.charAt(i - 1) != s2.charAt(j - 1)) newValue = Math.min(Math.min(newValue, lastValue), costs[j]) + 1; costs[j - 1] = lastValue; lastValue = newValue; } } } if (i > 0) costs[s2.length()] = lastValue; } return costs[s2.length()]; } public static void printSimilarity(String s, String t) { System.out.println(String.format( "%.3f is the similarity between \"%s\" and \"%s\"", similarity(s, t), s, t)); } }
[ "berire.gunduz@gmail.com" ]
berire.gunduz@gmail.com
57c8cdcbc494b9fd427bc2173ef0b8a023776536
b9691c5a01152ebe8f8b2e318e040b0c792a0501
/src/main/java/com/udemy/springbrewery/web/model/BeerPagedList.java
37eafd0ffee81c6a1a924e96a35164f0e2353dc7
[]
no_license
nikleft/spring-brewery
e21be05d0628e57c68d49eb33d01eb28ed4a73e0
b3a537f748f264262fcb450792dd3445431dcb23
refs/heads/master
2022-08-31T11:27:14.628274
2020-05-21T20:24:16
2020-05-21T20:24:16
264,519,037
0
0
null
null
null
null
UTF-8
Java
false
false
434
java
package com.udemy.springbrewery.web.model; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; import java.util.List; public class BeerPagedList extends PageImpl<BeerDto> { public BeerPagedList(List<BeerDto> content, Pageable pageable, long total) { super(content, pageable, total); } public BeerPagedList(List<BeerDto> content) { super(content); } }
[ "Maksym_Shumovych@epam.com" ]
Maksym_Shumovych@epam.com
2f331e2c3e6bc3a0c36bb98040d3c93b410afe9e
aed76081b8deffc03314292abdc5a2bb9687a0f0
/BalanceBinaryTree.java
da7368a6ac6dfc36c940dc06f433a2a10e688b91
[]
no_license
putEffortsIntoEverythingYouWant/AlgorithemExercise
4e9241da2c2ec396bc0066a778ddfdad5b05c484
54bafbc85af189dc101239a1e33f5dfc0a6bedf4
refs/heads/master
2021-01-20T11:06:24.964744
2016-02-09T02:20:23
2016-02-09T02:20:23
34,208,473
0
0
null
null
null
null
UTF-8
Java
false
false
925
java
/* Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1. */ /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution { public boolean isBalanced(TreeNode node) { int result = calHeight(node); if(result==-1){ return false; } return true; } public int calHeight(TreeNode node){ if(node==null){ return 0; } int left = calHeight(node.left); int right = calHeight(node.right); if(left==-1 || right ==-1 || Math.abs(left-right)>1){ return -1; } return Math.max(left,right)+1; } }
[ "lisijing7@gmail.com" ]
lisijing7@gmail.com
9b530fc6de0c29b762b82da760dccf754dbbf006
06ed89d0d33082e719d1a236eea821f7a99c56bf
/src/main/java/Application.java
7fcde8b566cf3814d5a1b83fe40a0887bd97d0f3
[]
no_license
ikolomiets/TwitterPlayground
92e4a71e532e3f00fd3686aaf2295bf406a2c580
c3486ea2782603feadda3998899a3d7b4d4d1b0d
refs/heads/master
2021-01-10T09:44:12.712283
2016-01-11T19:45:10
2016-01-11T19:45:10
43,084,074
0
0
null
2015-11-10T22:57:11
2015-09-24T18:06:57
Java
UTF-8
Java
false
false
775
java
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; public class Application { private static final Logger logger = LoggerFactory.getLogger(Application.class); private static final ConfigurableApplicationContext APPLICATION_CONTEXT = new AnnotationConfigApplicationContext(AppConfig.class); public static void main(String[] args) throws RateLimitException { APPLICATION_CONTEXT.registerShutdownHook(); TwitterClient twitterClient = APPLICATION_CONTEXT.getBean(TwitterClient.class); User user = twitterClient.showUserById(146882655); logger.debug("Got {}", user); } }
[ "igork@amayasoftware.com" ]
igork@amayasoftware.com
4fe2a49b6f9edbf1d7223c2c97434fbac2b5f50d
55bd5ac29775ecdcbc425cdbb5d529bcabea66ce
/Java8 Questions/SerialVsParallelSortDemo.java
55299917db88b25073a991fe3c006c176219d442
[]
no_license
vkverma0210/Wipro_PRP_Java_J2EE
10995000800f60f483a83fe6af5a1ceb42c99639
f5ccf40ad0a2528e0d493b808b53453cb63e6369
refs/heads/master
2023-07-15T19:57:37.551685
2021-08-20T03:57:37
2021-08-20T03:57:37
391,072,794
4
0
null
null
null
null
UTF-8
Java
false
false
1,312
java
import java.util.Arrays; import java.util.Random; /** * SerialVsParallelSortDemo */ public class SerialVsParallelSortDemo { public static void main(String[] args) { int[] arraySizes = { 10000, 100000, 1000000, 10000000 }; for (int arraySize : arraySizes) { System.out.println("When Array Size is : " + arraySize); int[] arr = new int[arraySize]; Random random = new Random(); for (int i = 0; i < arraySize; i++) { arr[i] = random.nextInt(arraySize); } int[] sequentialArr = Arrays.copyOf(arr, arr.length); int[] parallelArr = Arrays.copyOf(arr, arr.length); long startTime = System.currentTimeMillis(); Arrays.sort(sequentialArr); long endTime = System.currentTimeMillis(); System.out.println("Time taken for Serial Sort in Milli Seconds : " + (endTime - startTime)); startTime = System.currentTimeMillis(); Arrays.parallelSort(parallelArr); endTime = System.currentTimeMillis(); System.out.println("Time taken for Parallel Sort in Milli Seconds : " + (endTime - startTime)); System.out.println("---------------------------------------------------------"); } } }
[ "vkverma0210@gmail.com" ]
vkverma0210@gmail.com
13ef074fc36aaf08eefa3aca0ff949d8faf832dd
de8976b0045f0ada5c212b4cd64fd86b39ed014b
/src/main/java/decorator/A4.java
5e086db1d14d3296ccfff0a51ff626f25bc6ea2f
[]
no_license
Daniel5629/design_pattern
8eb57f90057af5a90f1741127dfdfda66f2d95d0
6a8c08003410cae293549dfa79cc82c601e8a882
refs/heads/master
2023-05-15T01:50:39.878580
2021-06-09T15:46:56
2021-06-09T15:46:56
373,516,908
0
0
null
null
null
null
UTF-8
Java
false
false
150
java
package decorator; public class A4 extends AudiDecorator{ public A4(ICar audi, String modelName) { super(audi, modelName, 2000); } }
[ "apxls34@gmail.com" ]
apxls34@gmail.com
f1859ece2e11e788a5558e998dedf14517f0ce3b
4acddd316da1c347cef0d9f59d10fca08a9b21e2
/app/build/gen/com/mycompany/magic/BuildConfig.java
3a9812d835788f6bb096aacb9aaf578200894b86
[]
no_license
suryaxmetal/firstapp
b5a0df590527efb4e8be1919d5ada214844b7122
90401b2765c56a0c520d01b4af35d6847913da48
refs/heads/master
2020-04-01T00:07:30.075041
2018-10-12T03:35:03
2018-10-12T03:35:03
152,682,896
0
0
null
null
null
null
UTF-8
Java
false
false
161
java
/** Automatically generated file. DO NOT MODIFY */ package com.mycompany.magic; public final class BuildConfig { public final static boolean DEBUG = true; }
[ "surya.poojary.bangin@gmail.com" ]
surya.poojary.bangin@gmail.com
a95fb9cf73e0cf210655d25774a4999d415f135d
424944da7e0ff52f9d1a61fbeb07bb9f361898b8
/sso-common/src/main/java/sso/common/util/SaltDealer.java
46acadebe380f6c5ce81c99aa8c4ca49fbceabec
[]
no_license
chuningfan/sso
3e4632733230c4c6ce1e67e5897fb82157868ba7
e60dae54f283822e391bc492258d0c05ea1712ca
refs/heads/master
2020-04-11T09:00:54.245535
2018-12-19T08:58:14
2018-12-19T08:58:14
161,577,174
0
0
null
null
null
null
UTF-8
Java
false
false
2,323
java
package sso.common.util; import java.io.UnsupportedEncodingException; import java.util.Base64; import java.util.Random; public class SaltDealer { private static final String[] UPPER_CASE = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "=", "-", "%", "~", "#", "$", "^", "*"}; private static final String[] LOWER_CASE = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "=", "-", "%", "~", "#", "$", "^", "*"}; private static final int[] NUMBERS = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}; private static final int RAN_CHARACTER_LENGTH = UPPER_CASE.length; private static final int RAN_NUMBER_LENGTH = NUMBERS.length; private static final int[] INDEXS = {2, 3, 7}; private static final Random RAN_SELECT = new Random(); public static final String getSaltedString(String string) { String f = UPPER_CASE[RAN_SELECT.nextInt(RAN_CHARACTER_LENGTH)] + LOWER_CASE[RAN_SELECT.nextInt(RAN_CHARACTER_LENGTH)] + NUMBERS[RAN_SELECT.nextInt(RAN_NUMBER_LENGTH)]; String s = UPPER_CASE[RAN_SELECT.nextInt(RAN_CHARACTER_LENGTH)] + LOWER_CASE[RAN_SELECT.nextInt(RAN_CHARACTER_LENGTH)] + NUMBERS[RAN_SELECT.nextInt(RAN_NUMBER_LENGTH)]; String t = UPPER_CASE[RAN_SELECT.nextInt(RAN_CHARACTER_LENGTH)] + LOWER_CASE[RAN_SELECT.nextInt(RAN_CHARACTER_LENGTH)] + NUMBERS[RAN_SELECT.nextInt(RAN_NUMBER_LENGTH)]; String fs = string.substring(0, INDEXS[0]); String ss = string.substring(INDEXS[0], INDEXS[1]); String ts = string.substring(INDEXS[1], INDEXS[2]); String o = string.substring(INDEXS[2]); return fs + f + ss + s + ts + t + o; } public static final String getOriginalString(String saltedString) { StringBuilder builder = new StringBuilder(); builder.append(saltedString.substring(0, 2)) .append(saltedString.substring(5, 6)) .append(saltedString.substring(9, 13)) .append(saltedString.substring(16)); return builder.toString(); } public static final String base64encrypt(String string) { return Base64.getEncoder().encodeToString(string.getBytes()); } public static final String base64decrypt(String encrypted) throws UnsupportedEncodingException { return new String(Base64.getDecoder().decode(encrypted), "UTF-8"); } }
[ "ningfan.chu@activenetwork.com" ]
ningfan.chu@activenetwork.com
48dfde15abd0fe9c27997735b92bd7cdfb8d608f
78037065a3c23998438a6cbdfea142458cfae5f7
/src/ar/edu/unlam/pb2/eva03/Acuatico.java
711279d9317f50a7f9101016ef5652d90252d82a
[]
no_license
IanWagnerLautaro/IanWagnerEda03Recuperatorio
2b6fcb5a9150b1053ff4db4e3f5570f65b26a712
f837e052814b026ec1aca417d42806b622d0c53c
refs/heads/main
2023-01-30T04:39:25.344522
2020-12-09T12:47:18
2020-12-09T12:47:18
319,932,630
0
0
null
null
null
null
UTF-8
Java
false
false
411
java
package ar.edu.unlam.pb2.eva03; import ar.edu.unlam.pb2.eva03.interfaces.IAcuatico; public class Acuatico extends Vehiculo implements IAcuatico { protected Double Profundidad; public Acuatico(Integer n, String d) { super(n, d); this.Profundidad=0.0; } public Double getProfundidad() { return Profundidad; } public void setProfundidad(Double profundidad) { Profundidad = profundidad; } }
[ "ianwagnerlautaro@gmail.com" ]
ianwagnerlautaro@gmail.com
cf599f543ce6a970ceb6ab06f461c9898a7e9b63
377e5e05fb9c6c8ed90ad9980565c00605f2542b
/.gitignore/bin/ext-accelerator/b2bpunchout/src/org/cxml/StatusUpdateRequest.java
dcdeecdc6bae39cdaa00fa3c8916d79396ee44c5
[]
no_license
automaticinfotech/HybrisProject
c22b13db7863e1e80ccc29774f43e5c32e41e519
fc12e2890c569e45b97974d2f20a8cbe92b6d97f
refs/heads/master
2021-07-20T18:41:04.727081
2017-10-30T13:24:11
2017-10-30T13:24:11
108,957,448
0
0
null
null
null
null
UTF-8
Java
false
false
5,137
java
/* * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE or an SAP affiliate company. * All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. * * */ // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.05.12 at 07:19:30 PM EDT // package org.cxml; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "documentReference", "status", "paymentStatusOrSourcingStatusOrInvoiceStatusOrDocumentStatus", "extrinsic" }) @XmlRootElement(name = "StatusUpdateRequest") public class StatusUpdateRequest { @XmlElement(name = "DocumentReference") protected DocumentReference documentReference; @XmlElement(name = "Status", required = true) protected Status status; @XmlElements({ @XmlElement(name = "PaymentStatus", type = PaymentStatus.class), @XmlElement(name = "SourcingStatus", type = SourcingStatus.class), @XmlElement(name = "InvoiceStatus", type = InvoiceStatus.class), @XmlElement(name = "DocumentStatus", type = DocumentStatus.class) }) protected List<Object> paymentStatusOrSourcingStatusOrInvoiceStatusOrDocumentStatus; @XmlElement(name = "Extrinsic") protected List<Extrinsic> extrinsic; /** * Gets the value of the documentReference property. * * @return * possible object is * {@link DocumentReference } * */ public DocumentReference getDocumentReference() { return documentReference; } /** * Sets the value of the documentReference property. * * @param value * allowed object is * {@link DocumentReference } * */ public void setDocumentReference(DocumentReference value) { this.documentReference = value; } /** * Gets the value of the status property. * * @return * possible object is * {@link Status } * */ public Status getStatus() { return status; } /** * Sets the value of the status property. * * @param value * allowed object is * {@link Status } * */ public void setStatus(Status value) { this.status = value; } /** * Gets the value of the paymentStatusOrSourcingStatusOrInvoiceStatusOrDocumentStatus property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the paymentStatusOrSourcingStatusOrInvoiceStatusOrDocumentStatus property. * * <p> * For example, to add a new item, do as follows: * <pre> * getPaymentStatusOrSourcingStatusOrInvoiceStatusOrDocumentStatus().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link PaymentStatus } * {@link SourcingStatus } * {@link InvoiceStatus } * {@link DocumentStatus } * * */ public List<Object> getPaymentStatusOrSourcingStatusOrInvoiceStatusOrDocumentStatus() { if (paymentStatusOrSourcingStatusOrInvoiceStatusOrDocumentStatus == null) { paymentStatusOrSourcingStatusOrInvoiceStatusOrDocumentStatus = new ArrayList<Object>(); } return this.paymentStatusOrSourcingStatusOrInvoiceStatusOrDocumentStatus; } /** * Gets the value of the extrinsic property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the extrinsic property. * * <p> * For example, to add a new item, do as follows: * <pre> * getExtrinsic().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Extrinsic } * * */ public List<Extrinsic> getExtrinsic() { if (extrinsic == null) { extrinsic = new ArrayList<Extrinsic>(); } return this.extrinsic; } }
[ "santosh.kshirsagar@automaticinfotech.com" ]
santosh.kshirsagar@automaticinfotech.com
4da6f351374bfcfcad17b6ee09dae435c2f069f0
631b623527f40bf0948d9613fc7cbd2c0475d5aa
/src/main/java/MainApplication.java
ccad92662d844ff164465b38c27ed84b02064232
[]
no_license
PawelWieczorek/homework3
3e79978274d58a3baa5d4a85807cf8e127e8e68d
109c9e79cdab17f1d61593ccca82041dea3e97b6
refs/heads/master
2020-08-30T17:08:38.862026
2016-09-04T19:40:52
2016-09-04T19:40:52
67,335,649
0
0
null
null
null
null
UTF-8
Java
false
false
1,897
java
import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; /** * Created by pwieczorek on 04.09.16. */ public class MainApplication { static ArrayList<Person> arrPerson = new ArrayList<>(); static Comparator<Person> personComparator = new Comparator<Person>() { @Override public int compare(Person o1, Person o2) { int i = o1.getSurname().compareTo(o2.getSurname()); return ~i; } }; static Comparator<Person> personComparator2 = new Comparator<Person>() { @Override public int compare(Person o1, Person o2) { int i = o1.getAddress().compareTo(o2.getAddress()); return i; } }; static Person person0 = new Person("Jan","Kowalski","Gdańsk"); static Person person1 = new Person("Wojciech","Zieliński","Kwidzyn"); static Person person2 = new Person("Magdalena","Nowak","Warszawa"); static Person person3 = new Person("Anna","Krzemińska","Częstochowa"); static Person person4 = new Person("Mateusz","Żyśko","Sopot"); public static void main(String[] args) { arrPerson.add(person0); arrPerson.add(person4); arrPerson.add(person2); arrPerson.add(person3); arrPerson.add(person1); System.out.println("Przed sortowaniem:"); for(Person person : arrPerson) { System.out.println(person.toString()); } Collections.sort(arrPerson,personComparator); System.out.println("\nPo sortowaniu nazwiskami:"); for(Person person : arrPerson) { System.out.println(person.toString()); } Collections.sort(arrPerson,personComparator2); System.out.println("\nPo sortowaniu adresami:"); for(Person person : arrPerson) { System.out.println(person.toString()); } } }
[ "p.wieczoreknkse@gmail.com" ]
p.wieczoreknkse@gmail.com
0c7568242c3f05b4df1143c2ca5f289c077e13e5
bfad7db19f5a7e46c43735c4b6d131de9634a2d0
/app/src/main/java/com/example/mynewapp/SplashActivity.java
6aac45ae25b8f3165301de56cd0e52d910c16fd2
[]
no_license
PuuMas/Happy-Plants
9e10b6d6bd423592b8885ef9aaef831e30a04ebd
5c6e942bdb0b5ff52796ada6a0bcff11ae320c74
refs/heads/main
2023-06-24T08:39:56.822139
2021-07-09T23:02:21
2021-07-09T23:02:21
381,112,278
1
0
null
null
null
null
UTF-8
Java
false
false
1,464
java
package com.example.mynewapp; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; import android.widget.TextView; public class SplashActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_loading); getSupportActionBar().hide(); View decorView = getWindow().getDecorView(); decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); long splashscreen = 5000L; Animation topAnimation; Animation bottomAnimation; ImageView imageView; TextView textView; //Animations bottomAnimation = AnimationUtils.loadAnimation(this,R.anim.bottom_animation); topAnimation = AnimationUtils.loadAnimation(this,R.anim.top_animation); //Hooks imageView = findViewById(R.id.logo); textView = findViewById(R.id.happy_plants); imageView.startAnimation(topAnimation); textView.startAnimation(bottomAnimation); new Handler().postDelayed (() -> { startActivity(new Intent(this, MainActivity.class)); finish(); }, splashscreen); } }
[ "anssi_salmela@hotmail.com" ]
anssi_salmela@hotmail.com
af45d1f71aca322f6d4d445a6cfd4a1842da848c
997e7ee998590be32a30faef1c2a88dad128deb9
/athens/src/main/java/za/co/sourlemon/acropolis/athens/shader/Shader.java
fe6fe64178b77c93921320e1dfdbdf64453b6750
[]
no_license
danini-the-panini/Acropolis
759217c57253edabb7cc279f49d1aba1abd3b289
c536fb0aef142da871f625231d73c12a69bab3ac
refs/heads/master
2021-05-26T17:43:15.799864
2014-01-27T23:35:48
2014-01-27T23:35:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,159
java
/* * The MIT License * * Copyright 2013 Daniel Smith <jellymann@gmail.com>. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package za.co.sourlemon.acropolis.athens.shader; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import za.co.sourlemon.acropolis.athens.Resource; import static org.lwjgl.opengl.ARBShaderObjects.*; import static org.lwjgl.opengl.GL11.*; /** * * @author Daniel */ public class Shader implements Resource { private int shader = 0; private final File file; private final int type; public Shader(File file, int type) { this.file = file; this.type = type; } @Override public void load() throws IOException { if (shader != 0) { return; } try { shader = glCreateShaderObjectARB(type); if (shader == 0) { return; } glShaderSourceARB(shader, readFileAsString(file)); glCompileShaderARB(shader); if (glGetObjectParameteriARB(shader, GL_OBJECT_COMPILE_STATUS_ARB) == GL_FALSE) { throw new IOException("Error creating shader: " + getLogInfo(shader)); } } catch (IOException exc) { unload(); throw exc; } } @Override public void unload() { glDeleteObjectARB(shader); } private static String getLogInfo(int obj) { return glGetInfoLogARB(obj, glGetObjectParameteriARB(obj, GL_OBJECT_INFO_LOG_LENGTH_ARB)); } static String readFileAsString(File file) throws IOException { String input = ""; try (BufferedReader br = new BufferedReader(new FileReader(file))) { String line; while ((line = br.readLine()) != null) { input += line + "\n"; } } return input; } public void attachTo(int program) { glAttachObjectARB(program, shader); } }
[ "jellymann@gmail.com" ]
jellymann@gmail.com
28ebc6b9c87644f08cd8435b12ce0c9e14544255
05b3e5ad846c91bbfde097c32d5024dced19aa1d
/JavaProgramming/src/ch12/exam14/ExecuteServiceExample2.java
36e383b048ee241c25bef5a0abde24c136fb0b72
[]
no_license
yjs0511/MyRepository
4c2b256cb8ac34869cce8dfe2b1d2ab163b0e5ec
63bbf1f607f9d91374649bb7cacdf532b52e613b
refs/heads/master
2020-04-12T03:05:29.993060
2016-11-17T04:34:51
2016-11-17T04:34:51
65,808,570
0
0
null
null
null
null
UTF-8
Java
false
false
751
java
package ch12.exam14; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class ExecuteServiceExample2 { public static void main(String[] args) { // ThreadPool 생성 ExecutorService executorService = Executors.newFixedThreadPool(100); for (int i = 0; i < 100; i++) { int count = i; // 작업 생성 Runnable task = new Runnable() { @Override public void run() { for (int i = 0; i < 10; i++) { System.out.println("실행 중 ... : (" +count+ ")" + Thread.currentThread().getName()); } } }; // 작업 큐에 작업 넣기 executorService.submit(task); } // 스레드풀 종료 executorService.shutdown(); } }
[ "hypermega22@gmail.com" ]
hypermega22@gmail.com
3ccd7046d1a70843ea3dd171ef5ce79fd2160230
e0e4d35d0e63ad4499a897c0c4209dc228c6fcc8
/org.zero.apps.hadoop.hadoop-utils/src/test/java/org/zero/apps/hadoop/utils/MapWriter.java
9503a277f43a202e247433ac38b4907ddefff8fd
[]
no_license
sengwook81/hbase-manager
3a40be7ce2551a036dc8cafd77bf842cd44350b0
06d65d81ec93162297eed9fa24f2f86a2a84d947
refs/heads/master
2020-04-01T16:58:20.499139
2014-01-21T00:23:23
2014-01-21T00:23:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,838
java
package org.zero.apps.hadoop.utils; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.BytesWritable; import org.apache.hadoop.io.MapFile; import org.apache.hadoop.io.Text; public class MapWriter { public static void main(String[] args) { Configuration conf = new Configuration(); String root = "E:/home/user/mavenCrawler/tempFiles"; try { System.setProperty("HADOOP_USER_NAME", "user"); FileSystem fs = FileSystem.get(new URI("hdfs://name1:9000"), conf); System.out.println("CONNECTED"); byte buffer[] = new byte[1024 * 1024]; //List<FileStatus> fileList = HDFSUtil.getFileList(fs, new Path("/data/srcrepo/xstream/xstream"), null); List<File> fileList = getFiles(new File(root)); System.out.println("SCAN FINISH"); // SequenceFile sqf = new SequenceFile.Reader(fs, file, conf) Path seqPath = new Path("/opensource.map"); System.out.println("seqPath.getName() : " + seqPath.getName()); fs.delete(seqPath, true); MapFile.Writer writer = new MapFile.Writer(conf, fs ,"/opensource.map",Text.class,BytesWritable.class); MapFile.Reader reader = new MapFile.Reader(fs, "/opensource.map",conf); for (File item : fileList) { java.io.ByteArrayOutputStream bout = new ByteArrayOutputStream(); //FSDataInputStream open = fs.open(item.getPath()); FileInputStream open = new FileInputStream(item); //System.out.println(item.getPath().toString()); //System.out.println(item.getPath()); while (open.read(buffer, 0, buffer.length) >= 0) { bout.write(buffer); } String key = item.getPath().substring(root.length() + 1).replace('\\','/'); System.out.println("key : " + key); //writer.(new Text(key),new BytesWritable(bout.toByteArray())); open.close(); bout.close(); } System.out.println("FINISH"); writer.close(); fs.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static List<File> getFiles(File f) { List<File> retData =new ArrayList<File>(); if(f.isDirectory()) { File[] listFiles = f.listFiles(); for(File inf : listFiles) { List<File> files = getFiles(inf); retData.addAll(files); } } else { if(f.getName().endsWith(".jar")) { retData.add(f); } } return retData; } }
[ "Administrator@WIN-3JDR6ORV5IT" ]
Administrator@WIN-3JDR6ORV5IT
6685a86da1064695452697b86b80511464b851fc
253c05fbf769e7f63f60ef6a72371f34144e8abe
/app/src/main/java/com/demo/cl/bakingtime/ui/RecipeDetailActivity.java
60c16704d4dfa7064919a1d306ce5e220afa796e
[]
no_license
ChuliangYang/BakingTime
c7e7bcdaf2ef8fb778a40e5a9df3bf09d4d13c53
8c9774b78975fbe29878f953a09b57ee9d4d2a0c
refs/heads/master
2021-09-07T10:55:03.640319
2018-02-21T22:05:33
2018-02-21T22:05:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,154
java
package com.demo.cl.bakingtime.ui; import android.annotation.SuppressLint; import android.os.Bundle; import android.os.PersistableBundle; import android.support.annotation.Nullable; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.widget.FrameLayout; import com.demo.cl.bakingtime.R; import com.demo.cl.bakingtime.data.RecipesBean; import com.demo.cl.bakingtime.helper.EventHelper; import com.demo.cl.bakingtime.helper.PlayerHelper; import com.demo.cl.bakingtime.ui.fragment.RecipeDetailFragment; import com.demo.cl.bakingtime.ui.fragment.StepDetailFragment; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; /** * Created by CL on 9/16/17. */ public class RecipeDetailActivity extends AppCompatActivity { private Toolbar tb_recipe; private FrameLayout fl_list; private FrameLayout fl_detail; private RecipesBean recipesBean; private boolean isTablet; @SuppressLint("NewApi") @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_whole_fragment); isTablet = getResources().getBoolean(R.bool.isTablet); if (isTablet) { if (savedInstanceState != null) { recipesBean = (RecipesBean) savedInstanceState.get("recipesBean"); } else if (EventBus.getDefault().getStickyEvent(EventHelper.RecipesBeanMessage.class) != null) { recipesBean = EventBus.getDefault().getStickyEvent(EventHelper.RecipesBeanMessage.class).getRecipesBean(); } tb_recipe = findViewById(R.id.tb_recipe); fl_list = findViewById(R.id.fl_list); fl_detail = findViewById(R.id.fl_detail); tb_recipe.setTitle(recipesBean.getName()); tb_recipe.setNavigationOnClickListener(view -> finish()); FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); if (savedInstanceState == null) { fragmentTransaction.replace(R.id.fl_list, new RecipeDetailFragment(), "RecipeDetailFragment"); } fragmentTransaction.commit(); } else { FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); if (savedInstanceState == null) { fragmentTransaction.replace(R.id.fl_content, new RecipeDetailFragment(), "RecipeDetailFragment"); } fragmentTransaction.commit(); } } @Override protected void onSaveInstanceState(Bundle outState) { outState.putParcelable("recipesBean", recipesBean); super.onSaveInstanceState(outState); } @Override public void onStart() { super.onStart(); if (isTablet) { EventBus.getDefault().register(this); } if (isTablet) { PlayerHelper.getInstance().initPlayer(getApplicationContext()); } } @Override protected void onResume() { super.onResume(); if (isTablet) { PlayerHelper.getInstance().startPlayer(); } } @Override public void onPause() { super.onPause(); if (isTablet) { PlayerHelper.getInstance().pausePlayer(); } } @Override public void onStop() { super.onStop(); if (isTablet) { EventBus.getDefault().unregister(this); } if (isTablet) { PlayerHelper.getInstance().releasePlayer(); } } @Subscribe(threadMode = ThreadMode.MAIN) public void onMessageEvent(EventHelper.StepsBeanMessage event) { if (event.refreshFragment()) { FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.fl_detail, new StepDetailFragment(), "StepDetailFragment"); fragmentTransaction.commit(); } } }
[ "mrcarlosyang@gmail.com" ]
mrcarlosyang@gmail.com
e5804a161f55506a276bd7c489273960a3b8832e
b4905fcc953fed65ecbbd62f3277addae448c7a5
/src/Tests/Organizations/AddOrganizationTest.java
291ecaa47e25e3bfa6a2208b9ee24a78c12fe658
[]
no_license
yana-gusti/EasyQA_Test
92668f8ccbcc56854b347f7639d57fd9a166c53a
977a00176d58c229834eaa10197c84899a72a011
refs/heads/master
2020-05-27T18:03:20.116765
2017-03-06T10:02:08
2017-03-06T10:02:08
82,568,019
0
0
null
null
null
null
UTF-8
Java
false
false
6,735
java
package Tests.Organizations; import Methods.Organizations.AddOrganizationPage; import Methods.Organizations.DashboardPage; import Methods.Organizations.MyOrganizationsPage; import Methods.Organizations.OrganizationPage; import Methods.Profile.LoginPage; import Tests.BaseTest; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebElement; import org.testng.annotations.BeforeMethod; import org.openqa.selenium.By; import org.testng.annotations.Test; import java.util.List; import java.util.UUID; import static org.testng.Assert.assertTrue; /** * Created by S&M on 2/13/2017. */ public class AddOrganizationTest extends BaseTest { String _organization_title; String _project_title = "Astreya"; DashboardPage dp = new DashboardPage(); MyOrganizationsPage mop = new MyOrganizationsPage(); AddOrganizationPage ao = new AddOrganizationPage(); OrganizationPage op = new OrganizationPage(); @BeforeMethod public void DeleteOrganization() throws InterruptedException { LoginPage loginplus = new LoginPage(); loginplus.login(driver, "alex.yevtushenko@thinkmobiles.com", "qwerasd1995"); Thread.sleep(2000); _organization_title = UUID.randomUUID().toString(); // try { // dp.OpenMyOrganizations(driver, _organization_title); // Thread.sleep(2000); // mop.FindAndOpenOrganization(driver, _organization_title); // OrganizationPage op = new OrganizationPage(); //Thread.sleep(5000); //op.DeleteOrganization(driver); //Thread.sleep(2000); //} catch (WebDriverException e){} } @Test public void AddOrganizationPositiveTest() throws InterruptedException { dp.ClickAddOrganization(driver); Thread.sleep(2000); ao.CreateOrganization(driver, _organization_title); Thread.sleep(2000); mop.FindAndOpenOrganization(driver, _organization_title); Thread.sleep(2000); assertTrue(driver.findElement(By.cssSelector(".card-header-title")).getText().equals(_organization_title), "Organization wasn't created"); } @Test public void AddOrganizationEmptyTest() throws InterruptedException { String errorMessage = "can't be blank"; dp.ClickAddOrganization(driver); Thread.sleep(2000); ao.CreateOrganization(driver, ""); Thread.sleep(2000); WebElement errorMessageElement = driver.findElement(By.cssSelector(".message")); assertTrue(errorMessageElement.getText().equals(errorMessage), "unexpected error message was displayed"); } @Test public void AddOrganizationExisted() throws InterruptedException { String errorMessage = "has already been taken"; dp.ClickAddOrganization(driver); Thread.sleep(2000); ao.CreateOrganization(driver, _organization_title); Thread.sleep(2000); mop.ClickAddOrganization(driver); Thread.sleep(2000); ao.CreateOrganization(driver, _organization_title); Thread.sleep(2000); WebElement errorMessageElement = driver.findElement(By.cssSelector(".message")); assertTrue(errorMessageElement.getText().equals(errorMessage), "unexpected error message was displayed"); } @Test public void OrganizationNameLenghtTest() throws InterruptedException { _organization_title = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; String errorMessage = "is too long (maximum is 150 characters)"; dp.ClickAddOrganization(driver); Thread.sleep(2000); ao.CreateOrganization(driver, _organization_title); Thread.sleep(2000); WebElement errorMessageElement = driver.findElement(By.cssSelector(".message")); assertTrue(errorMessageElement.getText().equals(errorMessage), "unexpected error message was displayed"); } @Test public void ChangeOrganizationTitleTest() throws InterruptedException { String _NewOrganizationTitle = _organization_title + "!"; dp.ClickAddOrganization(driver); Thread.sleep(2000); ao.CreateOrganization(driver, _organization_title); Thread.sleep(2000); mop.FindAndOpenOrganization(driver,_organization_title); Thread.sleep(2000); driver.findElement(By.cssSelector(".card-header-btn")).click(); Thread.sleep(2000); driver.findElement(By.cssSelector("#organization_title")).sendKeys("!"); driver.findElement(By.cssSelector("[value='Save changes']")).click(); Thread.sleep(2000); assertTrue(driver.findElement(By.cssSelector(".card-header-title")).getText().equals(_NewOrganizationTitle), "Organization name wasn't changed"); } @Test public void CreateNewOrganizationButtonTest() throws InterruptedException { mop.CreateNewOrganization(driver); Thread.sleep(2000); ao.CreateOrganization(driver, _organization_title); Thread.sleep(2000); mop.FindAndOpenOrganization(driver, _organization_title); Thread.sleep(1000); assertTrue(driver.findElement(By.cssSelector(".card-header-title")).getText().equals(_organization_title), "Organization wasn't created"); } @Test public void AddProjectToOrganizationTest () throws InterruptedException { dp.ClickAddOrganization(driver); Thread.sleep(2000); ao.CreateOrganization(driver,_organization_title); Thread.sleep(2000); mop.FindAndOpenOrganization(driver,_organization_title ); Thread.sleep(5000); op.AddProjectToOrganization(driver,_project_title, _organization_title ); Thread.sleep(2000); List<WebElement> project = (List<WebElement>) ((JavascriptExecutor) driver).executeScript("return $('.project-name:contains(" + _project_title + ")')"); assertTrue(project.get(0).getText().equals(_project_title), "Project wasn't created"); } @Test public void AddMemberToOrganizationTest () throws InterruptedException { String _email_address = "boryk@yopmail.com"; dp.ClickAddOrganization(driver); Thread.sleep(2000); ao.CreateOrganization(driver,_organization_title); Thread.sleep(2000); mop.FindAndOpenOrganization(driver,_organization_title ); Thread.sleep(5000); op.AddMemberToOrganization(driver,_email_address); Thread.sleep(5000); List<WebElement> members = driver.findElements(By.cssSelector(".member-name")); Thread.sleep(2000); assertTrue(members.get(1).getText().equals("Oleh Boryk"), "Member wasn't added"); } }
[ "yana.gusti@gmail.com" ]
yana.gusti@gmail.com
f2f8a123c73934fa1044e06a3859f638b55e148b
e4277b7a6796775b683b297a16c48871c7b831cf
/src/main/java/com/myfcit/qbank/core/services/BaseService.java
921c4bf2c3da1334c545bb50eee9d6c261d75c96
[]
no_license
engahmedtahaa/qbankcore
61f41bb41100614a704e58641627383128c1ea77
a6e6d12a64792eeeba83a4e0d5c36a2f1fa54f7b
refs/heads/master
2022-07-12T03:58:34.127813
2019-10-13T09:38:18
2019-10-13T09:38:18
214,794,514
0
0
null
2022-06-21T02:01:52
2019-10-13T09:39:38
Java
UTF-8
Java
false
false
1,336
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.myfcit.qbank.core.services; import com.myfcit.qbank.core.daos.GenericDao; import com.myfcit.qbank.core.exceptions.QbankException; import java.util.List; public class BaseService<T> implements GenericServiceable<T> { protected GenericDao<T> genricDao; public BaseService(GenericDao<T> genricDao) { this.genricDao = genricDao; } @Override public void create(T entity)throws QbankException { genricDao.create(entity); } @Override public void edit(T entity) throws QbankException{ genricDao.edit(entity); } @Override public void remove(T entity)throws QbankException { genricDao.remove(entity); } @Override public T findById(Object id) throws QbankException{ return genricDao.findById(id); } @Override public List<T> findAll()throws QbankException { return genricDao.findAll(); } @Override public List<T> findRange(int[] range)throws QbankException { return genricDao.findRange(range); } @Override public int count()throws QbankException { return genricDao.count(); } }
[ "ahmedtaha777@bitbucket.org" ]
ahmedtaha777@bitbucket.org
d6ddefdd81940fd1d10b2a9bf4463b0270d455ef
f8ce0493db3f2bde39e27afb0c5db5995e16e19f
/Sinalgo/src/sinalgo/configuration/AppConfig.java
f6d52c1638f3c792c699485b85b9a1133990a2bc
[ "BSD-3-Clause" ]
permissive
kelsonribeiro/Cluster_WSN
e1143e016eec7b955704950f61f056776997407e
d2fe398726dd494a0a693e557170ad10cc79d33b
refs/heads/master
2021-04-28T08:33:47.221286
2017-01-30T23:56:51
2017-01-30T23:56:51
122,252,793
2
0
null
2018-02-20T20:34:26
2018-02-20T20:34:26
null
UTF-8
Java
false
false
12,968
java
/* Copyright (c) 2007, Distributed Computing Group (DCG) ETH Zurich Switzerland dcg.ethz.ch All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name 'Sinalgo' nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package sinalgo.configuration; import java.io.File; import java.io.FileWriter; import java.io.IOException; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; import org.jdom.output.Format; import org.jdom.output.XMLOutputter; import sinalgo.runtime.Global; import sinalgo.tools.statistics.Distribution; /** * A config file that stores application wide settings for the user, such as * the size of the windows and the selected project. */ public class AppConfig { String configFile = Configuration.sourceDirPrefix+"/"+Configuration.projectDirInSourceFolder+"/defaultProject/appConfig.xml"; boolean configExists = false; public int projectSelectorWindowWidth = 600; public int projectSelectorWindowHeight= 400; public int projectSelectorWindowPosX= 50; public int projectSelectorWindowPosY= 50; public boolean projectSelectorIsMaximized = false; public int projectSelectorSelectedTab = 1; // 1 = description, 2 = config public String lastChosenProject = ""; public int guiWindowWidth = 800; public int guiWindowHeight = 600; public int guiWindowPosX = 50; public int guiWindowPosY = 50; public boolean guiIsMaximized = false; public long seedFromLastRun = 0; public int helpWindowWidth = 500; public int helpWindowHeight = 500; public int helpWindowPosX = 200; public int helpWindowPosY = 200; public boolean helpWindowIsMaximized = false; public boolean guiControlPanelExpandSimulation = true; public boolean guiControlPanelShowFullViewPanel = true; public boolean guiControlPanelShowTextPanel = true; public boolean guiControlPanelShowProjectControl = true; public boolean guiRunOperationIsLimited = true; // infinite many (rounds/events) or the specified amount? public String lastSelectedFileDirectory = ""; // where the user pointed last to open a file public boolean checkForSinalgoUpdate = true; // check for updates public long timeStampOfLastUpdateCheck = 0; // machine time when Sinalgo checked last for an update public int generateNodesDlgNumNodes = 100; // # of nodes to generate public String previousRunCmdLineArgs = ""; // cmd line args of the previous call to 'Run' private static AppConfig singletonInstance = null; // the singleton instance /** * @return The singleton instance of AppConfig. */ public static AppConfig getAppConfig() { if(singletonInstance == null) { singletonInstance = new AppConfig(); } return singletonInstance; } /** * @return A file describing the directory that was chosen last, * if this directory does not exist anymore, the directory of the * current project. */ public File getLastSelectedFileDirectory() { File f = new File(lastSelectedFileDirectory); if(!f.exists()) { f = new File(Global.getProjectSrcDir()); } return f; } /** * Singleton constructor */ private AppConfig() { File file= new File(configFile); if(file.exists()){ configExists = true; } else { return; } try { Document doc = new SAXBuilder().build(configFile); Element root = doc.getRootElement(); // Read the entries for the Project Selector Element e = root.getChild("ProjectSelector"); if(e != null) { String v = e.getAttributeValue("windowWidth"); if(v != null) { try { projectSelectorWindowWidth = Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("windowHeight"); if(v != null) { try { projectSelectorWindowHeight= Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("windowPosX"); if(v != null) { try { projectSelectorWindowPosX= Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("windowPosY"); if(v != null) { try { projectSelectorWindowPosY= Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("lastChosenProject"); if(v != null) { lastChosenProject = v; } v = e.getAttributeValue("isMaximized"); if(v != null) { projectSelectorIsMaximized = v.equals("true"); } v = e.getAttributeValue("selectedTab"); if(v != null) { try { projectSelectorSelectedTab = Integer.parseInt(v); } catch(NumberFormatException ex) { } } } // Read the entries for the GUI e = root.getChild("GUI"); if(e != null) { String v = e.getAttributeValue("windowWidth"); if(v != null) { try { guiWindowWidth = Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("windowHeight"); if(v != null) { try { guiWindowHeight = Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("windowPosX"); if(v != null) { try { guiWindowPosX = Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("windowPosY"); if(v != null) { try { guiWindowPosY = Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("isMaximized"); if(v != null) { guiIsMaximized = v.equals("true"); } v = e.getAttributeValue("ControlPanelExpandSimulation"); if(v != null) { guiControlPanelExpandSimulation = v.equals("true"); } v = e.getAttributeValue("ControlPanelShowFullViewPanel"); if(v != null) { guiControlPanelShowFullViewPanel = v.equals("true"); } v = e.getAttributeValue("ControlPanelShowTextPanel"); if(v != null) { guiControlPanelShowTextPanel = v.equals("true"); } v = e.getAttributeValue("ControlPanelShowProjectControl"); if(v != null) { guiControlPanelShowProjectControl = v.equals("true"); } v = e.getAttributeValue("RunOperationIsLimited"); if(v != null) { guiRunOperationIsLimited = v.equals("true"); } v = e.getAttributeValue("helpWindowWidth"); if(v != null) { try { helpWindowWidth = Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("helpWindowHeight"); if(v != null) { try { helpWindowHeight= Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("helpWindowPosX"); if(v != null) { try { helpWindowPosX = Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("helpWindowPosY"); if(v != null) { try { helpWindowPosY = Integer.parseInt(v); } catch(NumberFormatException ex) { } } v = e.getAttributeValue("helpWindowIsMaximized"); if(v != null) { try { helpWindowIsMaximized = v.equals("true"); } catch(NumberFormatException ex) { } } } // read the seed from the last run e = root.getChild("RandomSeed"); if(e != null) { String s = e.getAttributeValue("seedFromPreviousRun"); if(s != null) { try { seedFromLastRun = Long.parseLong(s); } catch(NumberFormatException ex) { } } } // Diverse App specific configs e = root.getChild("App"); if(e != null) { String s = e.getAttributeValue("lastSelectedFileDirectory"); if(s != null) { lastSelectedFileDirectory = s; } s = e.getAttributeValue("checkForUpdatesAtStartup"); if(s != null) { checkForSinalgoUpdate = s.equals("true"); } s = e.getAttributeValue("updateCheckTimeStamp"); if(s != null) { try { timeStampOfLastUpdateCheck = Long.parseLong(s); } catch(NumberFormatException ex) { } } s = e.getAttributeValue("runCmdLineArgs"); if(s != null) { previousRunCmdLineArgs = s; } } // Generate Nodes Dlg e = root.getChild("GenNodesDlg"); if(e != null) { String s = e.getAttributeValue("numNodes"); if(s != null) { try { generateNodesDlgNumNodes = Integer.parseInt(s); } catch(NumberFormatException ex) { } } } } catch (JDOMException e1) { } catch (IOException e1) { } } // end of constructor /** * Writes the application wide config */ public void writeConfig() { File file= new File(configFile); Document doc = new Document(); Element root = new Element("sinalgo"); doc.setRootElement(root); Element ps = new Element("ProjectSelector"); root.addContent(ps); ps.setAttribute("windowWidth", Integer.toString(projectSelectorWindowWidth)); ps.setAttribute("windowHeight", Integer.toString(projectSelectorWindowHeight)); ps.setAttribute("lastChosenProject", lastChosenProject); ps.setAttribute("windowPosX", Integer.toString(projectSelectorWindowPosX)); ps.setAttribute("windowPosY", Integer.toString(projectSelectorWindowPosY)); ps.setAttribute("isMaximized", projectSelectorIsMaximized ? "true" : "false"); ps.setAttribute("selectedTab", Integer.toString(projectSelectorSelectedTab)); Element gui = new Element("GUI"); root.addContent(gui); gui.setAttribute("windowWidth", Integer.toString(guiWindowWidth)); gui.setAttribute("windowHeight", Integer.toString(guiWindowHeight)); gui.setAttribute("windowPosX", Integer.toString(guiWindowPosX)); gui.setAttribute("windowPosY", Integer.toString(guiWindowPosY)); gui.setAttribute("isMaximized", guiIsMaximized ? "true" : "false"); gui.setAttribute("ControlPanelExpandSimulation", guiControlPanelExpandSimulation ? "true" : "false"); gui.setAttribute("ControlPanelShowFullViewPanel", guiControlPanelShowFullViewPanel ? "true" : "false"); gui.setAttribute("ControlPanelShowTextPanel", guiControlPanelShowTextPanel ? "true" : "false"); gui.setAttribute("ControlPanelShowProjectControl", guiControlPanelShowProjectControl ? "true" : "false"); gui.setAttribute("RunOperationIsLimited", guiRunOperationIsLimited ? "true" : "false"); gui.setAttribute("helpWindowWidth", Integer.toString(helpWindowWidth)); gui.setAttribute("helpWindowHeight", Integer.toString(helpWindowHeight)); gui.setAttribute("helpWindowPosX", Integer.toString(helpWindowPosX)); gui.setAttribute("helpWindowPosY", Integer.toString(helpWindowPosY)); gui.setAttribute("helpWindowIsMaximized", helpWindowIsMaximized ? "true" : "false"); Element seed = new Element("RandomSeed"); root.addContent(seed); seed.setAttribute("seedFromPreviousRun", Long.toString(Distribution.getSeed())); Element app= new Element("App"); root.addContent(app); app.setAttribute("lastSelectedFileDirectory", lastSelectedFileDirectory); app.setAttribute("checkForUpdatesAtStartup", checkForSinalgoUpdate ? "true" : "false"); app.setAttribute("updateCheckTimeStamp", Long.toString(timeStampOfLastUpdateCheck)); app.setAttribute("runCmdLineArgs", previousRunCmdLineArgs); Element genNodes = new Element("GenNodesDlg"); root.addContent(genNodes); genNodes.setAttribute("numNodes", Integer.toString(generateNodesDlgNumNodes)); //write the xml XMLOutputter outputter = new XMLOutputter(); Format f = Format.getPrettyFormat(); f.setIndent("\t"); outputter.setFormat(f); try { FileWriter fW = new FileWriter(file); outputter.output(doc, fW); } catch (IOException ex) { } } }
[ "fernandorodrigues.ufc@gmail.com@9623baf7-9890-4137-8563-edf4c73deeb0" ]
fernandorodrigues.ufc@gmail.com@9623baf7-9890-4137-8563-edf4c73deeb0
cc5ad6d0e1ff9484a781c2b7ab1f87603247b28a
d2556e39eec4774ec153c3d32a59195aa2706207
/RebateTesting/src/com/asrtu/pdfGen/RebateReconcLedgerPDF.java
46e1777124ed68540cb3cd3e03e630290d46a369
[]
no_license
dharam06/asrtu
6d53241b5eff898ed5acc3a47fae42a56f0a3fdb
5198cf54f5e333037d0e4639c4d0b37cc87ef675
refs/heads/master
2020-03-13T18:59:20.449929
2018-04-27T04:43:22
2018-04-27T04:43:22
131,245,650
0
0
null
null
null
null
UTF-8
Java
false
false
13,798
java
package com.asrtu.pdfGen; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Configurable; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; import com.asrtu.bean.RebateSearchCriteria; import com.asrtu.dao.InvoiceDao; import com.asrtu.dao.InvoiceDaoImpl; import com.asrtu.dao.RebateDaoImp; import com.asrtu.model.Invoice; import com.asrtu.model.RebateForm; import com.asrtu.model.StuTransaction; import com.asrtu.model.VendorTrans; import com.asrtu.service.InvoiceService; import com.asrtu.service.InvoiceServiceImpl; import com.asrtu.service.RebateService; import com.asrtu.service.RebateServiceImp; import com.asrtu.bean.InvoiceBean; import com.asrtu.bean.OpeningBalance; import com.asrtu.bean.RebateFormBean; import com.asrtu.bean.RebateInvoiceBean; import com.asrtu.bean.RebateReconSearchResult; import com.itextpdf.text.Chunk; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Element; import com.itextpdf.text.Paragraph; import com.itextpdf.text.Phrase; import com.itextpdf.text.TabSettings; import com.itextpdf.text.pdf.PdfPCell; import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfWriter; import com.itextpdf.text.Font; import com.itextpdf.text.PageSize; @Component @Configurable public class RebateReconcLedgerPDF { @Autowired private InvoiceService invoiceService; private static Font TIME_ROMAN = new Font(Font.FontFamily.TIMES_ROMAN, 12,Font.BOLD); private static Font TIME_ROMAN_SMALL = new Font(Font.FontFamily.TIMES_ROMAN, 10 ); public Document createPDF(String file, List<RebateReconSearchResult> rebateReconSearchResult, RebateSearchCriteria rebateSearchCriteria) { Document document = null; try { document = new Document(PageSize.A4.rotate()); PdfWriter.getInstance(document, new FileOutputStream(file)); document.open(); addMetaData(document); document.add( Chunk.NEWLINE ); document.add( Chunk.NEWLINE ); RebateReconSearchResult rb = rebateReconSearchResult.get(0); addTitlePage(document, rb); document.add( Chunk.NEWLINE ); document.add( Chunk.NEWLINE ); createTable(document, rebateReconSearchResult, rebateSearchCriteria); document.add( Chunk.NEWLINE ); document.add( Chunk.NEWLINE ); document.add( Chunk.NEWLINE ); document.add( Chunk.NEWLINE ); document.add( Chunk.NEWLINE ); document.add( Chunk.NEWLINE ); createFooter(document, rb); document.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (DocumentException e) { e.printStackTrace(); } return document; } private static void addMetaData(Document document) { document.addTitle("Statement PDF report"); document.addSubject("Statement PDF report"); document.addAuthor("ASRTU"); document.addCreator("ASRTU"); } private static void addTitlePage(Document document, RebateReconSearchResult rebateReconSearchResult) throws DocumentException { Paragraph preface = new Paragraph(); creteEmptyLine(preface, 1); preface.add(new Paragraph("ASSOCIATION OF STATE ROAD TRANSPORT UNDERTAKINGS", TIME_ROMAN)); creteEmptyLine(preface, 1); Paragraph p = new Paragraph(); p.add(new Chunk("ASRTU Bhawan",TIME_ROMAN_SMALL)); p.setTabSettings(new TabSettings(250f)); p.add(Chunk.TABBING); p.add(new Chunk("Phone : 011-43294294/200/299",TIME_ROMAN_SMALL)); preface.add(p); //preface.add(new Paragraph("Phone : 011-43294294/200/299",TIME_ROMAN_SMALL).setTabSettings(new TabSettings(10f))); creteEmptyLine(preface, 1); Paragraph p1 = new Paragraph(); p1.add(new Chunk("Plot No. 4-A, PSP Block",TIME_ROMAN_SMALL)); p1.setTabSettings(new TabSettings(280f)); p1.add(Chunk.TABBING); p1.add(new Chunk(" : 011-25361640/41",TIME_ROMAN_SMALL)); preface.add(p1); creteEmptyLine(preface, 1); Paragraph p2 = new Paragraph(); p2.add(new Chunk("Pocket-14, Sector-8, Dwarka,",TIME_ROMAN_SMALL)); p2.setTabSettings(new TabSettings(250f)); p2.add(Chunk.TABBING); p2.add(new Chunk("Fax : 011-43294242/241,25361642\n",TIME_ROMAN_SMALL)); preface.add(p2); Paragraph p3 = new Paragraph(); p3.add(new Chunk("New Delhi-110 077",TIME_ROMAN_SMALL)); p3.setTabSettings(new TabSettings(250f)); p3.add(Chunk.TABBING); p3.add(new Chunk("E-mail: asrtu@de12.vsnl.net.in\n",TIME_ROMAN_SMALL)); preface.add(p3); creteEmptyLine(preface, 1); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy"); Paragraph p4 = new Paragraph(); p4.add(new Chunk("ASRTU Service Tax No. AAAAA0233ASD005",TIME_ROMAN_SMALL)); p4.setTabSettings(new TabSettings(250f)); p4.add(Chunk.TABBING); p4.add(new Chunk("PAN No. AAAAA0233A"+ simpleDateFormat.format(new Date()),TIME_ROMAN_SMALL)); preface.add(p4); document.add(preface); } private static void creteEmptyLine(Paragraph paragraph, int number) { for (int i = 0; i < number; i++) { paragraph.add(new Paragraph("")); } } private static void createBottom(Document document, RebateFormBean rebateFormBean) throws DocumentException { Paragraph preface = new Paragraph(); Paragraph p9 = new Paragraph(); p9.add(new Paragraph("Amount received dated")); preface.add(p9); document.add(preface); } private static void createFooter(Document document, RebateReconSearchResult rebateReconSearchResult) throws DocumentException { Paragraph preface = new Paragraph(); Paragraph p11 = new Paragraph(); p11.add(new Chunk("Authorized Signatory",TIME_ROMAN_SMALL)); p11.setTabSettings(new TabSettings(250f)); p11.add(Chunk.TABBING); p11.add(new Chunk("Authorized Signatory",TIME_ROMAN_SMALL)); preface.add(p11); document.add(preface); } private void createTable(Document document, List<RebateReconSearchResult> rebateReconSearchResult, RebateSearchCriteria rebateSearchCriteria) throws DocumentException { PdfPTable table = new PdfPTable(10); table.setWidthPercentage(100); table.setSpacingBefore(0f); table.setSpacingAfter(0f); table.setWidths(new float[] { 1,3,3,4,3,3,4,3,3,3}); DecimalFormat df = new DecimalFormat("0.00"); String title = "Rebate Reconciliation Ledger:: "; if (null != rebateSearchCriteria.getFinanceYear()) { title = title + " Finance Year: " + rebateSearchCriteria.getFinanceYear(); } if (null != rebateSearchCriteria.getVendorName()) { title = title + " Vendor Name: " + rebateSearchCriteria.getVendorName(); } if (null != rebateSearchCriteria.getItemName()) { title = title + " Item Name: " + rebateSearchCriteria.getItemName(); } PdfPCell c1 = new PdfPCell(new Phrase(title, TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); c1.setColspan(10); table.addCell(c1); c1 = new PdfPCell(new Phrase("SNo.", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); c1.setRowspan(2); table.addCell(c1); c1 = new PdfPCell(new Phrase("STU Name", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); c1.setRowspan(2); table.addCell(c1); c1 = new PdfPCell(new Phrase("Opening Balance", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Nodal Officer's info", TIME_ROMAN_SMALL)); c1.setColspan(3); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Vendor's Information for the year", TIME_ROMAN_SMALL)); c1.setColspan(3); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Closing balance", TIME_ROMAN_SMALL)); c1.setRowspan(2); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Amount", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Quarter", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Amount", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Total", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Quarter", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Amount", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Total", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); Iterator<RebateReconSearchResult> itr = rebateReconSearchResult.iterator(); RebateReconSearchResult rb = null; for (int i=1; itr.hasNext(); i++){ rb = itr.next(); c1 = new PdfPCell(new Phrase(""+i, TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase(""+rb.getStuName(), TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase(""+df.format(rb.getOpeningBalance().getRebateBalance()), TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); String qtrList=""; String amtList=""; String totalList=""; Float amountTotal = 0f; Map<String, Float> qtrMap = new HashMap<String, Float>(); for(StuTransaction stuTransaction : rb.getStuTransactionList()){ if(qtrMap.containsKey(stuTransaction.getQuarter())){ Float temp = qtrMap.get(stuTransaction.getQuarter()); Float stuAmount = 0f; if(null != stuTransaction.getStuTotalRebate()){ stuAmount = stuTransaction.getStuTotalRebate(); } qtrMap.put(stuTransaction.getQuarter(), temp + stuAmount) ; } else{ qtrMap.put(stuTransaction.getQuarter(), stuTransaction.getStuTotalRebate()); } } for(String qtr : qtrMap.keySet()){ qtrList = qtrList + qtr + "\n"; amtList = amtList + df.format(qtrMap.get(qtr)) + "\n"; amountTotal = amountTotal + qtrMap.get(qtr); } c1 = new PdfPCell(new Phrase(qtrList, TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase(amtList, TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase(df.format(amountTotal )+ "", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); String vqtrList=""; String vamtList=""; String vtotalList=""; Float vamountTotal = 0f; for(VendorTrans VendorTrans : rb.getCurrentVendorTransList()){ vqtrList = vqtrList + VendorTrans.getQuarter() + "\n"; Float vendrTamt = 0f; if(null != VendorTrans.getVendorRebateAmount()){ vendrTamt = VendorTrans.getVendorRebateAmount(); } vamtList = vamtList + df.format(vendrTamt) + "\n"; if(VendorTrans.getVendorRebateAmount() !=null ){ vamountTotal = vamountTotal + VendorTrans.getVendorRebateAmount(); } } c1 = new PdfPCell(new Phrase(vqtrList, TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase(vamtList, TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase(df.format(vamountTotal) +"", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); String vpqtrList=""; String vpamtList=""; String vptotalList=""; Float vpamountTotal = 0f; c1 = new PdfPCell(new Phrase(df.format((rb.getOpeningBalance().getRebateBalance() + amountTotal - vamountTotal )) +"", TIME_ROMAN_SMALL)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); } document.add(table); } public static void main(String args[]){ System.out.println("Create PDF"); RebateSearchCriteria bankReportsBean = new RebateSearchCriteria(); // createPDF("statement", rebateFormBean); } private Float getAmountByPerForDays(Float amount, long days, Float percentage){ if(amount == null || percentage == null ) { return 0f; } else{ return days*amount*percentage/36000; } } private static String formatDate(Date date) { SimpleDateFormat sdf = new SimpleDateFormat("dd/M/yyyy"); String dateString = ""; if(null != date){ dateString = sdf.format(date); System.out.println("==========" + dateString); } return dateString; } }
[ "ADS@ADS-PC" ]
ADS@ADS-PC
50638bd94fb5083076dd5c17251dffe10411e256
ba5d701f1ffb43964b6f90db914508ffefae770e
/cloud-consumer-order80/src/main/java/com/atguigu/springcloud/alibaba/OrderMain80.java
036fd60f4223835992bf7fc09d1d925b7ce76075
[]
no_license
yaojianhua5186/cloud2021
cc99a783f40a62c63c5a719ecf9523131d956115
aa8f493da4d8410a303d3d626f7d398e106ab056
refs/heads/master
2023-02-22T02:44:04.696245
2021-01-24T04:35:16
2021-01-24T04:35:16
324,279,796
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package com.atguigu.springcloud.alibaba; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; @SpringBootApplication @EnableEurekaClient public class OrderMain80 { public static void main(String[] args) { SpringApplication.run(OrderMain80.class, args); } }
[ "358036541@qq.com" ]
358036541@qq.com
5dcd827f6d8a89e8250727771c1864d681aa6747
dc39bc4d3216ef4be994246a6e19cb39c39c219f
/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/page/BasePageQuery.java
b99d59d519dec7303a61cbb68f1b5e602fc06c28
[]
no_license
zhangzikuo/sso-auth-center
9abed273e1d401e497ac01f1aef50f7e6d5be00f
9544e3d58b8bb7a645df7b75cf88effb4a4bec82
refs/heads/master
2023-03-03T20:57:02.927070
2021-02-12T09:33:03
2021-02-12T09:33:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,348
java
package com.sso.common.model.page; import java.io.Serializable; /** * 分页数据 * * @author 程序员小强 */ public class BasePageQuery implements Serializable { private static final long serialVersionUID = 6467187852112192806L; /** * 当前页 */ private Integer page; /** * 页容量 */ private Integer pageSize; /** * 开始行 */ private Integer startRow; /** * 排序列名 */ private String sortName; /** * 排序的方向desc或者asc */ private String sortBy = "asc"; /** * 获取开始行 */ public Integer getStartRow() { if (null == page) { page = 1; } if (null == pageSize) { pageSize = 10; } this.startRow = pageSize * (page - 1); return startRow; } public Integer getPage() { return page; } public void setPage(Integer page) { this.page = page == null ? 1 : page; } public Integer getPageSize() { return pageSize; } public void setPageSize(Integer pageSize) { this.pageSize = pageSize == null ? 10 : pageSize; } public void setStartRow(Integer startRow) { this.startRow = startRow; } public String getSortName() { return sortName; } public void setSortName(String sortName) { this.sortName = sortName; } public String getSortBy() { return sortBy; } public void setSortBy(String sortBy) { this.sortBy = sortBy; } }
[ "" ]
6067aa69e88683c9773a40d219410c18e157c382
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/3/3_240d649f8ec81a46d236535515cdfb198d15b157/PageListTag/3_240d649f8ec81a46d236535515cdfb198d15b157_PageListTag_t.java
f07a6c10190d2b50a803f2c5361ea46fdb6c2f02
[]
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
10,536
java
/* * Weblounge: Web Content Management System * Copyright (c) 2003 - 2011 The Weblounge Team * http://entwinemedia.com/weblounge * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package ch.entwine.weblounge.taglib.content; import ch.entwine.weblounge.common.content.PageSearchResultItem; import ch.entwine.weblounge.common.content.Resource; import ch.entwine.weblounge.common.content.SearchQuery; import ch.entwine.weblounge.common.content.SearchResult; import ch.entwine.weblounge.common.content.SearchResultItem; import ch.entwine.weblounge.common.content.page.Composer; import ch.entwine.weblounge.common.content.page.Page; import ch.entwine.weblounge.common.content.page.Pagelet; import ch.entwine.weblounge.common.content.repository.ContentRepository; import ch.entwine.weblounge.common.content.repository.ContentRepositoryException; import ch.entwine.weblounge.common.content.repository.ContentRepositoryUnavailableException; import ch.entwine.weblounge.common.impl.content.SearchQueryImpl; import ch.entwine.weblounge.common.impl.content.page.ComposerImpl; import ch.entwine.weblounge.common.request.CacheTag; import ch.entwine.weblounge.common.request.WebloungeRequest; import ch.entwine.weblounge.common.site.Site; import ch.entwine.weblounge.common.url.WebUrl; import ch.entwine.weblounge.taglib.WebloungeTag; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import javax.servlet.jsp.JspException; /** * This tag is used to gather a list of pages satisfying certain criteria such * as the page type, search keywords etc. */ public class PageListTag extends WebloungeTag { /** Serial version UID */ private static final long serialVersionUID = -1825541321489778143L; /** Logging facility */ private static final Logger logger = LoggerFactory.getLogger(PageListTag.class.getName()); /** The list of keywords */ private List<String> subjects = null; /** The number of page headers to return */ private int count = 10; /** The page headers */ private SearchResult pages = null; /** The iteration index */ private int index = -1; /** The pagelet from the request */ private Pagelet pagelet = null; /** The current page */ private Page page = null; /** The current preview */ private Composer preview = null; /** The current page's url */ private WebUrl url = null; /** List of required headlines */ private List<String> requiredPagelets = null; /** * Creates a new page header list tag. */ public PageListTag() { requiredPagelets = new ArrayList<String>(); subjects = new ArrayList<String>(); reset(); } /** * Returns the current page. This method serves as a way for embedded tags * like the {@link PagePreviewTag} to get to their data. * * @return the page */ public Page getPage() { return page; } /** * Returns the current preview. This method serves as a way for embedded tags * like the {@link PagePreviewTag} to get to their data. * * @return the current page preview */ public Composer getPagePreview() { return preview; } /** * Returns the current page's url. This method serves as a way for embedded * tags like the {@link PagePreviewTag} to get to their data. * * @return the page's url */ public WebUrl getPageUrl() { return url; } /** * Sets the number of page headers to load. If this attribute is omitted, then * all headers are returned. * * @param count * the number of page headers */ public void setCount(String count) { if (count == null) throw new IllegalArgumentException("Count must be a positive integer"); try { this.count = Integer.parseInt(count); } catch (NumberFormatException e) { this.count = Integer.MAX_VALUE; } } /** * Sets the list of page keywords to look up. The keywords must consist of a * list of strings, separated by either ",", ";" or " ". * * @param value * the keywords */ public void setKeywords(String value) { if (value == null) throw new IllegalArgumentException("Keywords cannot be null"); StringTokenizer tok = new StringTokenizer(value, ",;"); while (tok.hasMoreTokens()) { subjects.add(tok.nextToken().trim()); } } /** * Indicates the required headlines. The headline element types need to be * passed in as comma separated strings, e. g. * * <pre> * text/title, repository/image * </pre> * * @param value * the headlines */ public void setRequireheadlines(String value) { StringTokenizer tok = new StringTokenizer(value, ",;"); while (tok.hasMoreTokens()) { String headline = tok.nextToken().trim(); String[] parts = headline.split("/"); if (parts.length != 2) throw new IllegalArgumentException("Required headlines '" + value + "' are malformed. Required is 'module1/pagelet1, module2/pagelet2, ..."); requiredPagelets.add(headline); } } /** * {@inheritDoc} * * @see javax.servlet.jsp.tagext.BodyTagSupport#doStartTag() */ public int doStartTag() throws JspException { index = 0; // Save the current pagelet so that we can restore it later pagelet = (Pagelet) request.getAttribute(WebloungeRequest.PAGELET); try { return (loadNextPage()) ? EVAL_BODY_INCLUDE : SKIP_BODY; } catch (ContentRepositoryUnavailableException e) { response.invalidate(); return SKIP_BODY; } catch (ContentRepositoryException e) { throw new JspException(e); } } /** * {@inheritDoc} * * @see javax.servlet.jsp.tagext.BodyTagSupport#doAfterBody() */ public int doAfterBody() throws JspException { index++; try { if (index < count && loadNextPage()) return EVAL_BODY_AGAIN; else return SKIP_BODY; } catch (ContentRepositoryUnavailableException e) { response.invalidate(); return SKIP_BODY; } catch (ContentRepositoryException e) { throw new JspException(e); } } /** * {@inheritDoc} * * @see ch.entwine.weblounge.taglib.WebloungeTag#doEndTag() */ public int doEndTag() throws JspException { pageContext.removeAttribute(PageListTagExtraInfo.PREVIEW); pageContext.removeAttribute(PageListTagExtraInfo.PREVIEW_PAGE); request.setAttribute(WebloungeRequest.PAGELET, pagelet); return super.doEndTag(); } /** * Loads the next page, puts it into the request and returns <code>true</code> * if a suitable page was found, false otherwise. * * @return <code>true</code> if a suitable page was found * @throws ContentRepositoryException * if loading the pages fails * @throws ContentRepositoryUnavailableException * if the repository is offline */ private boolean loadNextPage() throws ContentRepositoryException, ContentRepositoryUnavailableException { Site site = request.getSite(); // Check if headers have already been loaded if (pages == null) { ContentRepository repository = site.getContentRepository(); if (repository == null) { logger.debug("Unable to load content repository for site '{}'", site); throw new ContentRepositoryUnavailableException(); } // Specify which pages to load SearchQuery query = new SearchQueryImpl(site); query.withVersion(Resource.LIVE); // Add the keywords for (String subject : subjects) { query.withSubject(subject); } // Add the pagelets required on state for (String headline : requiredPagelets) { String[] parts = headline.split("/"); if (parts.length > 1) query.withPagelet(parts[0], parts[1]).inStage(); } // Order by date and limit the result set query.sortByPublishingDate(SearchQuery.Order.Descending); query.withLimit(count); // Finally Load the pages pages = repository.find(query); } boolean found = false; PageSearchResultItem item = null; Page page = null; WebUrl url = null; // Look for the next header while (!found && index < pages.getItems().length) { SearchResultItem candidateItem = pages.getItems()[index]; if (!(candidateItem instanceof PageSearchResultItem)) continue; item = (PageSearchResultItem) candidateItem; // Store the important properties url = item.getUrl(); page = item.getPage(); // TODO security check found = true; } // Set the headline in the request and add caching information if (found && page != null) { this.page = page; this.preview = new ComposerImpl("stage", page.getPreview()); this.url = url; pageContext.setAttribute(PageListTagExtraInfo.PREVIEW_PAGE, page); pageContext.setAttribute(PageListTagExtraInfo.PREVIEW, preview); response.addTag(CacheTag.Resource, page.getURI().getIdentifier()); if (url != null) response.addTag(CacheTag.Url, url.getPath()); } return found; } /** * {@inheritDoc} * * @see ch.entwine.weblounge.taglib.WebloungeTag#reset() */ @Override protected void reset() { super.reset(); count = 10; index = 0; page = null; pagelet = null; pages = null; preview = null; requiredPagelets.clear(); subjects.clear(); url = null; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8a857004f5a3dcb459d5e818ec9c160d597f6333
cf911da8310eff0f407712f91a9b89620569f6fb
/src/main/java/mx/devhive/rutamx/entities/TtrUsuarios.java
0516151dd852831af60d8fa21d8e8bcf9a4adb34
[]
no_license
devhiveMX/DescubriendoTuRuta-Web
8cc0aaf5de9be5f9ff71bbd456537d1ed5cae435
3bca1ea58795f1be7142f16bd83ff115644eac07
refs/heads/master
2016-09-06T20:07:10.336838
2014-11-03T05:16:05
2014-11-03T05:16:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,142
java
package mx.devhive.rutamx.entities; // Generated 29/10/2014 12:40:55 AM by Hibernate Tools 3.4.0.CR1 import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import static javax.persistence.GenerationType.IDENTITY; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * TtrUsuarios generated by hbm2java */ @Entity @Table(name = "ttr_usuarios", catalog = "rutadb") public class TtrUsuarios implements java.io.Serializable { private Integer usuarioId; private String nombre; private String clave; private String password; private int rolId; private Date creadoEl; private Date modificadoEl; private String modificadoPor; private Integer grupoId; public TtrUsuarios() { } public TtrUsuarios(int rolId) { this.rolId = rolId; } public TtrUsuarios(String nombre, String clave, String password, int rolId, Date creadoEl, Date modificadoEl, String modificadoPor, Integer grupoId) { this.nombre = nombre; this.clave = clave; this.password = password; this.rolId = rolId; this.creadoEl = creadoEl; this.modificadoEl = modificadoEl; this.modificadoPor = modificadoPor; this.grupoId = grupoId; } @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "usuario_id", unique = true, nullable = false) public Integer getUsuarioId() { return this.usuarioId; } public void setUsuarioId(Integer usuarioId) { this.usuarioId = usuarioId; } @Column(name = "nombre", length = 50) public String getNombre() { return this.nombre; } public void setNombre(String nombre) { this.nombre = nombre; } @Column(name = "clave", length = 30) public String getClave() { return this.clave; } public void setClave(String clave) { this.clave = clave; } @Column(name = "password", length = 30) public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } @Column(name = "rol_id", nullable = false) public int getRolId() { return this.rolId; } public void setRolId(int rolId) { this.rolId = rolId; } @Temporal(TemporalType.TIMESTAMP) @Column(name = "creado_el", length = 0) public Date getCreadoEl() { return this.creadoEl; } public void setCreadoEl(Date creadoEl) { this.creadoEl = creadoEl; } @Temporal(TemporalType.TIMESTAMP) @Column(name = "modificado_el", length = 0) public Date getModificadoEl() { return this.modificadoEl; } public void setModificadoEl(Date modificadoEl) { this.modificadoEl = modificadoEl; } @Column(name = "modificado_por", length = 50) public String getModificadoPor() { return this.modificadoPor; } public void setModificadoPor(String modificadoPor) { this.modificadoPor = modificadoPor; } @Column(name = "grupo_id") public Integer getGrupoId() { return this.grupoId; } public void setGrupoId(Integer grupoId) { this.grupoId = grupoId; } }
[ "vaio@vaio-PC" ]
vaio@vaio-PC
16763b39e2b3a9b02f25199637ae237d31d06171
6b015f51f51fd22d6e67f4bede57ae622198bfa3
/restful-web-services/src/main/java/com/sedat/rest/webservices/restfulwebservices/model/User.java
0599e959cd326d8c8b684b4edb46e9f9ceb1e5e6
[]
no_license
darkPainn/todoApp
9ee2b85ad87c68c0c2c79b11ac88c455573ec184
4bbb1ead7e952c9449d8a91b71ab5fb1ab9c70be
refs/heads/master
2023-01-12T23:32:16.682359
2019-11-27T08:29:48
2019-11-27T08:29:48
224,379,507
0
0
null
2023-01-07T12:12:39
2019-11-27T08:18:51
TypeScript
UTF-8
Java
false
false
701
java
package com.sedat.rest.webservices.restfulwebservices.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; //@Entity public class User { //@GeneratedValue private long id; private String username; private String password; public User() { } public User(String username, String password) { this.username = username; this.password = password; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public long getId() { return this.id; } }
[ "IROOM@adecco.com" ]
IROOM@adecco.com
4d978da077f8fee2d3990637c0fbd7daf12d99da
c76550ae6360a6a67fadc8a5f1bba62e6313739c
/Start/src/controler/Aplikacija.java
7dfdf5a78564145ac4343dd22028accad355ef48
[]
no_license
dulerad94/StartKonacno
4d0b481e4f2a1f7e936f334bb60331cb4acea92c
b8630cb3387c2ec5040f830ba5182c8084ab6250
refs/heads/master
2020-12-24T18:32:17.002487
2016-05-15T12:04:19
2016-05-15T12:04:19
58,859,272
0
0
null
null
null
null
UTF-8
Java
false
false
501
java
package controler; import model.Korisnici; import view.Konzola; import view.OsnovniProzor; public class Aplikacija { public static void main(String[] args) { // TODO Auto-generated method stub Korisnici korisnici=Korisnici.getInstanca(); Kontroler kontroler=Kontroler.getInstanca(); kontroler.setKorisnici(korisnici); Konzola konzola=new Konzola(kontroler); OsnovniProzor prozorce=new OsnovniProzor(kontroler); kontroler.setProzorce(prozorce); kontroler.setKonzola(konzola); } }
[ "student1@RCA003-02.rc.fon.bg.ac.yu" ]
student1@RCA003-02.rc.fon.bg.ac.yu
db83685ed0e654ad417f606af295cfa259f61be5
753db7bd5be3aaa7eaddcfe3a352d2be5765756d
/src/entity/Category.java
77d873fc4a5ebad674fa5c3e14f99ca70e8539f6
[]
no_license
atzhtianyu/Ledger
526a839bfe4a104a8a4b7bdbfe049d30fd2f0523
f94cec2c9f170a94daa88c34bc26cd9cf6f2d138
refs/heads/master
2023-07-06T10:34:41.860186
2021-07-26T09:20:34
2021-07-26T09:20:34
344,481,353
1
0
null
null
null
null
UTF-8
Java
false
false
487
java
package entity; public class Category { public int id; public String name; public int recordNumber; public int getRecordNumber() { return recordNumber; } 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 String toString() { return name; } }
[ "1420098499@qq.com" ]
1420098499@qq.com
fe8815d45c328790eff6fc737bc04b7ec34701ca
d5d340ed55099f596e7bc312f5f558b3daf2add2
/src/main/java/com/payxpert/connect2pay/constants/TransactionOperation.java
ec65b45aa922c2ad92029fea266f32848f796953
[ "Apache-2.0" ]
permissive
PayXpert/connect2pay-java-client
258ff2893eaff15810fa0a31a843f03429673239
784872c270b6e0c9a9f27c55cf848864c4c3c429
refs/heads/master
2022-11-22T01:38:33.229273
2021-02-26T13:06:35
2021-02-26T13:06:35
111,574,007
1
2
Apache-2.0
2022-11-16T01:48:32
2017-11-21T16:30:56
Java
UTF-8
Java
false
false
1,470
java
package com.payxpert.connect2pay.constants; /** * Types of operation done by a transaction. This is enforced on the payment page application and returned in the * payment status. * */ public enum TransactionOperation { /* Payment authorization */ AUTHORIZE, /* Pre-Auth capture */ CAPTURE, /* Payment (authorize + capture) */ SALE, /* Initial operation for asynchronous payment type */ SUBMISSION, /* Confirmation operation for asynchronous payment type */ COLLECTION, /* Transaction cancel */ CANCEL, /* Transaction refund */ REFUND, /* Transaction refund request */ REFUND_REQUEST, /* Transaction rebill */ REBILL, /* Contestation operation */ CHARGEBACK, /* Dispute by the customer */ DISPUTE, /* Request for information from the bank */ RETRIEVAL, /* Reversal operation (internal refund by the bank) */ REVERSAL, /* Fraud declaration (no fund movement) */ FRAUD, /* Chargeback cancellation by the bank */ REPRESENTMENT; public String valueToString() { return this.name().toLowerCase(); } public TransactionOperation fromString(String operation) { return valueOfFromString(operation); } public static TransactionOperation valueOfFromString(String operation) { if (operation != null) { for (TransactionOperation op : TransactionOperation.values()) { if (op.name().equalsIgnoreCase(operation)) { return op; } } } return null; } }
[ "jsh@payxpert.com" ]
jsh@payxpert.com
6d3c006d07af18a5f5fabc364694cd00fe989aff
93caab98ba5cb7208dbd8fb80081f927c84e68df
/JSONRPC/src/wf/bitcoin/javabitcoindrpcclient/BitcoinJSONRPCClient.java
ec643926dfee9f986fb68741bc8302816fbef854
[]
no_license
prudvikomaram/Java-Projects
7b63919f43ea080a5f45327597977fbfa69463f1
1e1091226bbd35aeda8a137e6996f5b66a9da43d
refs/heads/master
2020-10-01T08:13:32.066099
2016-05-04T17:44:55
2016-05-04T17:44:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
31,360
java
/* * BitcoindRpcClient-JSON-RPC-Client License * * Copyright (c) 2013, Mikhail Yevchenko. * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the * Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject * to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* * Repackaged with simple additions for easier maven usage by Alessandro Polverini */ package wf.bitcoin.javabitcoindrpcclient; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.nio.charset.Charset; import java.util.AbstractList; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; import wf.bitcoin.krotjson.Base64Coder; import wf.bitcoin.krotjson.JSON; import static wf.bitcoin.javabitcoindrpcclient.MapWrapper.*; /** * * @author Mikhail Yevchenko m.ṥῥẚɱ.ѓѐḿởύḙ at azazar.com Small modifications by * Alessandro Polverini polverini at gmail.com */ public class BitcoinJSONRPCClient implements BitcoindRpcClient { private static final Logger logger = Logger.getLogger(BitcoinJSONRPCClient.class.getCanonicalName()); public final URL rpcURL; private URL noAuthURL; private String authStr; public BitcoinJSONRPCClient(String rpcUrl) throws MalformedURLException { this(new URL(rpcUrl)); } public BitcoinJSONRPCClient(URL rpc) { this.rpcURL = rpc; try { noAuthURL = new URI(rpc.getProtocol(), null, rpc.getHost(), rpc.getPort(), rpc.getPath(), rpc.getQuery(), null).toURL(); } catch (MalformedURLException | URISyntaxException ex) { throw new IllegalArgumentException(rpc.toString(), ex); } authStr = rpc.getUserInfo() == null ? null : String.valueOf(Base64Coder.encode(rpc.getUserInfo().getBytes(Charset.forName("ISO8859-1")))); } public static final URL DEFAULT_JSONRPC_URL; public static final URL DEFAULT_JSONRPC_TESTNET_URL; static { String user = "user"; String password = "pass"; String host = "localhost"; String port = null; try { File f; File home = new File(System.getProperty("user.home")); f=new File("/Users/leijurv/Library/Application Support/Bitcoin/bitcoin.conf"); /*if ((f = new File(home, ".bitcoin" + File.separatorChar + "bitcoin.conf")).exists()) { } else if ((f = new File(home, "AppData" + File.separatorChar + "Roaming" + File.separatorChar + "Bitcoin" + File.separatorChar + "bitcoin.conf")).exists()) { } else { f = null; }*/ if (f != null) { logger.fine("Bitcoin configuration file found"); Properties p = new Properties(); try (FileInputStream i = new FileInputStream(f)) { p.load(i); } user = p.getProperty("rpcuser", user); password = p.getProperty("rpcpassword", password); host = p.getProperty("rpcconnect", host); port = p.getProperty("rpcport", port); System.out.println(user+","+password+","+host+","+port); } } catch (Exception ex) { logger.log(Level.SEVERE, null, ex); } try { DEFAULT_JSONRPC_URL = new URL("http://" + user + ':' + password + "@" + host + ":" + (port == null ? "8332" : port) + "/"); DEFAULT_JSONRPC_TESTNET_URL = new URL("http://" + user + ':' + password + "@" + host + ":" + (port == null ? "18332" : port) + "/"); } catch (MalformedURLException ex) { throw new RuntimeException(ex); } } public BitcoinJSONRPCClient(boolean testNet) { this(testNet ? DEFAULT_JSONRPC_TESTNET_URL : DEFAULT_JSONRPC_URL); } public BitcoinJSONRPCClient() { this(DEFAULT_JSONRPC_TESTNET_URL); } private HostnameVerifier hostnameVerifier = null; private SSLSocketFactory sslSocketFactory = null; public HostnameVerifier getHostnameVerifier() { return hostnameVerifier; } public void setHostnameVerifier(HostnameVerifier hostnameVerifier) { this.hostnameVerifier = hostnameVerifier; } public SSLSocketFactory getSslSocketFactory() { return sslSocketFactory; } public void setSslSocketFactory(SSLSocketFactory sslSocketFactory) { this.sslSocketFactory = sslSocketFactory; } public static final Charset QUERY_CHARSET = Charset.forName("ISO8859-1"); public byte[] prepareRequest(final String method, final Object... params) { return JSON.stringify(new LinkedHashMap() { { put("method", method); put("params", params); put("id", "1"); } }).getBytes(QUERY_CHARSET); } private static byte[] loadStream(InputStream in, boolean close) throws IOException { ByteArrayOutputStream o = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; for (;;) { int nr = in.read(buffer); if (nr == -1) break; if (nr == 0) throw new IOException("Read timed out"); o.write(buffer, 0, nr); } return o.toByteArray(); } public Object loadResponse(InputStream in, Object expectedID, boolean close) throws IOException, BitcoinRpcException { try { String r = new String(loadStream(in, close), QUERY_CHARSET); logger.log(Level.FINE, "Bitcoin JSON-RPC response:\n{0}", r); try { Map response = (Map) JSON.parse(r); if (!expectedID.equals(response.get("id"))) throw new RuntimeException("Wrong response ID (expected: " + String.valueOf(expectedID) + ", response: " + response.get("id") + ")"); if (response.get("error") != null) throw new BitcoinRpcException(JSON.stringify(response.get("error"))); return response.get("result"); } catch (ClassCastException ex) { throw new RuntimeException("Invalid server response format (data: \"" + r + "\")"); } } finally { if (close) in.close(); } } public Object query(String method, Object... o) throws BitcoinRpcException { HttpURLConnection conn; try { conn = (HttpURLConnection) noAuthURL.openConnection(); conn.setDoOutput(true); conn.setDoInput(true); if (conn instanceof HttpsURLConnection) { if (hostnameVerifier != null) ((HttpsURLConnection) conn).setHostnameVerifier(hostnameVerifier); if (sslSocketFactory != null) ((HttpsURLConnection) conn).setSSLSocketFactory(sslSocketFactory); } // conn.connect(); ((HttpURLConnection) conn).setRequestProperty("Authorization", "Basic " + authStr); byte[] r = prepareRequest(method, o); logger.log(Level.FINE, "Bitcoin JSON-RPC request:\n{0}", new String(r, QUERY_CHARSET)); conn.getOutputStream().write(r); conn.getOutputStream().close(); int responseCode = conn.getResponseCode(); if (responseCode != 200) throw new RuntimeException("RPC Query Failed (method: " + method + ", params: " + Arrays.deepToString(o) + ", response header: " + responseCode + " " + conn.getResponseMessage() + ", response: " + new String(loadStream(conn.getErrorStream(), true))); return loadResponse(conn.getInputStream(), "1", true); } catch (IOException ex) { throw new RuntimeException("RPC Query Failed (method: " + method + ", params: " + Arrays.deepToString(o) + ")", ex); } } @Override public String createRawTransaction(List<TxInput> inputs, List<TxOutput> outputs) throws BitcoinRpcException { List<Map> pInputs = new ArrayList<>(); for (final TxInput txInput : inputs) { pInputs.add(new LinkedHashMap() { { put("txid", txInput.txid()); put("vout", txInput.vout()); } }); } Map<String, Double> pOutputs = new LinkedHashMap(); Double oldValue; for (TxOutput txOutput : outputs) { if ((oldValue = pOutputs.put(txOutput.address(), txOutput.amount())) != null) pOutputs.put(txOutput.address(), BitcoinUtil.normalizeAmount(oldValue + txOutput.amount())); // throw new BitcoinRpcException("Duplicate output"); } return (String) query("createrawtransaction", pInputs, pOutputs); } @Override public String dumpPrivKey(String address) throws BitcoinRpcException { return (String) query("dumpprivkey", address); } @Override public String getAccount(String address) throws BitcoinRpcException { return (String) query("getaccount", address); } @Override public List<String> getAddressesByAccount(String account) throws BitcoinRpcException { return (List<String>) query("getaddressesbyaccount", account); } @Override public double getBalance() throws BitcoinRpcException { return ((Number) query("getbalance")).doubleValue(); } @Override public double getBalance(String account) throws BitcoinRpcException { return ((Number) query("getbalance", account)).doubleValue(); } @Override public double getBalance(String account, int minConf) throws BitcoinRpcException { return ((Number) query("getbalance", account, minConf)).doubleValue(); } private class BlockChainInfoMapWrapper extends MapWrapper implements BlockChainInfo { public BlockChainInfoMapWrapper(Map m) { super(m); } @Override public String chain() { return mapStr("chain"); } @Override public int blocks() { return mapInt("blocks"); } @Override public String bestBlockHash() { return mapStr("bestblockhash"); } @Override public double difficulty() { return mapDouble("difficulty"); } @Override public double verificationProgress() { return mapDouble("verificationprogress"); } @Override public String chainWork() { return mapStr("chainwork"); } } private class BlockMapWrapper extends MapWrapper implements Block { public BlockMapWrapper(Map m) { super(m); } @Override public String hash() { return mapStr("hash"); } @Override public int confirmations() { return mapInt("confirmations"); } @Override public int size() { return mapInt("size"); } @Override public int height() { return mapInt("height"); } @Override public int version() { return mapInt("version"); } @Override public String merkleRoot() { return mapStr("merkleroot"); } @Override public String chainwork() { return mapStr("chainwork"); } @Override public List<String> tx() { return (List<String>) m.get("tx"); } @Override public Date time() { return mapCTime("time"); } @Override public long nonce() { return mapLong("nonce"); } @Override public String bits() { return mapStr("bits"); } @Override public double difficulty() { return mapDouble("difficulty"); } @Override public String previousHash() { return mapStr("previousblockhash"); } @Override public String nextHash() { return mapStr("nextblockhash"); } @Override public Block previous() throws BitcoinRpcException { if (!m.containsKey("previousblockhash")) return null; return getBlock(previousHash()); } @Override public Block next() throws BitcoinRpcException { if (!m.containsKey("nextblockhash")) return null; return getBlock(nextHash()); } } @Override public Block getBlock(int height) throws BitcoinRpcException { String hash = (String) query("getblockhash", height); return getBlock(hash); } @Override public Block getBlock(String blockHash) throws BitcoinRpcException { return new BlockMapWrapper((Map) query("getblock", blockHash)); } @Override public String getBlockHash(int height) throws BitcoinRpcException { return (String) query("getblockhash", height); } @Override public BlockChainInfo getBlockChainInfo() throws BitcoinRpcException { return new BlockChainInfoMapWrapper((Map) query("getblockchaininfo")); } @Override public int getBlockCount() throws BitcoinRpcException { return ((Number) query("getblockcount")).intValue(); } @Override public String getNewAddress() throws BitcoinRpcException { return (String) query("getnewaddress"); } @Override public String getNewAddress(String account) throws BitcoinRpcException { return (String) query("getnewaddress", account); } @Override public List<String> getRawMemPool() throws BitcoinRpcException { return (List<String>) query("getrawmempool"); } @Override public String getBestBlockHash() throws BitcoinRpcException { return (String) query("getbestblockhash"); } @Override public String getRawTransactionHex(String txId) throws BitcoinRpcException { return (String) query("getrawtransaction", txId); } private class RawTransactionImpl extends MapWrapper implements RawTransaction { public RawTransactionImpl(Map<String, Object> tx) { super(tx); } @Override public String hex() { return mapStr("hex"); } @Override public String txId() { return mapStr("txid"); } @Override public int version() { return mapInt("version"); } @Override public long lockTime() { return mapLong("locktime"); } private class InImpl extends MapWrapper implements In { public InImpl(Map m) { super(m); } @Override public String txid() { return mapStr("txid"); } @Override public int vout() { return mapInt("vout"); } @Override public Map<String, Object> scriptSig() { return (Map) m.get("scriptSig"); } @Override public long sequence() { return mapLong("sequence"); } @Override public RawTransaction getTransaction() { try { return getRawTransaction(mapStr("txid")); } catch (BitcoinRpcException ex) { throw new RuntimeException(ex); } } @Override public Out getTransactionOutput() { return getTransaction().vOut().get(mapInt("vout")); } } @Override public List<In> vIn() { final List<Map<String, Object>> vIn = (List<Map<String, Object>>) m.get("vin"); return new AbstractList<In>() { @Override public In get(int index) { return new InImpl(vIn.get(index)); } @Override public int size() { return vIn.size(); } }; } private class OutImpl extends MapWrapper implements Out { public OutImpl(Map m) { super(m); } @Override public double value() { return mapDouble("value"); } @Override public int n() { return mapInt("n"); } private class ScriptPubKeyImpl extends MapWrapper implements ScriptPubKey { public ScriptPubKeyImpl(Map m) { super(m); } @Override public String asm() { return mapStr("asm"); } @Override public String hex() { return mapStr("hex"); } @Override public int reqSigs() { return mapInt("reqSigs"); } @Override public String type() { return mapStr(type()); } @Override public List<String> addresses() { return (List) m.get("addresses"); } } @Override public ScriptPubKey scriptPubKey() { return new ScriptPubKeyImpl((Map) m.get("scriptPubKey")); } @Override public TxInput toInput() { return new BasicTxInput(transaction().txId(), n()); } @Override public RawTransaction transaction() { return RawTransactionImpl.this; } } @Override public List<Out> vOut() { final List<Map<String, Object>> vOut = (List<Map<String, Object>>) m.get("vout"); return new AbstractList<Out>() { @Override public Out get(int index) { return new OutImpl(vOut.get(index)); } @Override public int size() { return vOut.size(); } }; } @Override public String blockHash() { return mapStr("blockhash"); } @Override public int confirmations() { return mapInt("confirmations"); } @Override public Date time() { return mapCTime("time"); } @Override public Date blocktime() { return mapCTime("blocktime"); } } @Override public RawTransaction getRawTransaction(String txId) throws BitcoinRpcException { return new RawTransactionImpl((Map) query("getrawtransaction", txId, 1)); } @Override public double getReceivedByAddress(String address) throws BitcoinRpcException { return ((Number) query("getreceivedbyaddress", address)).doubleValue(); } @Override public double getReceivedByAddress(String address, int minConf) throws BitcoinRpcException { return ((Number) query("getreceivedbyaddress", address, minConf)).doubleValue(); } @Override public void importPrivKey(String bitcoinPrivKey) throws BitcoinRpcException { query("importprivkey", bitcoinPrivKey); } @Override public void importPrivKey(String bitcoinPrivKey, String label) throws BitcoinRpcException { query("importprivkey", bitcoinPrivKey, label); } @Override public void importPrivKey(String bitcoinPrivKey, String label, boolean rescan) throws BitcoinRpcException { query("importprivkey", bitcoinPrivKey, label, rescan); } @Override public Map<String, Number> listAccounts() throws BitcoinRpcException { return (Map) query("listaccounts"); } @Override public Map<String, Number> listAccounts(int minConf) throws BitcoinRpcException { return (Map) query("listaccounts", minConf); } private static class ReceivedAddressListWrapper extends AbstractList<ReceivedAddress> { private final List<Map<String, Object>> wrappedList; public ReceivedAddressListWrapper(List<Map<String, Object>> wrappedList) { this.wrappedList = wrappedList; } @Override public ReceivedAddress get(int index) { final Map<String, Object> e = wrappedList.get(index); return new ReceivedAddress() { @Override public String address() { return (String) e.get("address"); } @Override public String account() { return (String) e.get("account"); } @Override public double amount() { return ((Number) e.get("amount")).doubleValue(); } @Override public int confirmations() { return ((Number) e.get("confirmations")).intValue(); } @Override public String toString() { return e.toString(); } }; } @Override public int size() { return wrappedList.size(); } } @Override public List<ReceivedAddress> listReceivedByAddress() throws BitcoinRpcException { return new ReceivedAddressListWrapper((List) query("listreceivedbyaddress")); } @Override public List<ReceivedAddress> listReceivedByAddress(int minConf) throws BitcoinRpcException { return new ReceivedAddressListWrapper((List) query("listreceivedbyaddress", minConf)); } @Override public List<ReceivedAddress> listReceivedByAddress(int minConf, boolean includeEmpty) throws BitcoinRpcException { return new ReceivedAddressListWrapper((List) query("listreceivedbyaddress", minConf, includeEmpty)); } private class TransactionListMapWrapper extends ListMapWrapper<Transaction> { public TransactionListMapWrapper(List<Map> list) { super(list); } @Override protected Transaction wrap(final Map m) { return new Transaction() { @Override public String account() { return mapStr(m, "account"); } @Override public String address() { return mapStr(m, "address"); } @Override public String category() { return mapStr(m, "category"); } @Override public double amount() { return mapDouble(m, "amount"); } @Override public double fee() { return mapDouble(m, "fee"); } @Override public int confirmations() { return mapInt(m, "confirmations"); } @Override public String blockHash() { return mapStr(m, "blockhash"); } @Override public int blockIndex() { return mapInt(m, "blockindex"); } @Override public Date blockTime() { return mapCTime(m, "blocktime"); } @Override public String txId() { return mapStr(m, "txid"); } @Override public Date time() { return mapCTime(m, "time"); } @Override public Date timeReceived() { return mapCTime(m, "timereceived"); } @Override public String comment() { return mapStr(m, "comment"); } @Override public String commentTo() { return mapStr(m, "to"); } private RawTransaction raw = null; @Override public RawTransaction raw() { if (raw == null) try { raw = getRawTransaction(txId()); } catch (BitcoinRpcException ex) { throw new RuntimeException(ex); } return raw; } @Override public String toString() { return m.toString(); } }; } } private class TransactionsSinceBlockImpl implements TransactionsSinceBlock { public final List<Transaction> transactions; public final String lastBlock; public TransactionsSinceBlockImpl(Map r) { this.transactions = new TransactionListMapWrapper((List) r.get("transactions")); this.lastBlock = (String) r.get("lastblock"); } @Override public List<Transaction> transactions() { return transactions; } @Override public String lastBlock() { return lastBlock; } } @Override public TransactionsSinceBlock listSinceBlock() throws BitcoinRpcException { return new TransactionsSinceBlockImpl((Map) query("listsinceblock")); } @Override public TransactionsSinceBlock listSinceBlock(String blockHash) throws BitcoinRpcException { return new TransactionsSinceBlockImpl((Map) query("listsinceblock", blockHash)); } @Override public TransactionsSinceBlock listSinceBlock(String blockHash, int targetConfirmations) throws BitcoinRpcException { return new TransactionsSinceBlockImpl((Map) query("listsinceblock", blockHash, targetConfirmations)); } @Override public List<Transaction> listTransactions() throws BitcoinRpcException { return new TransactionListMapWrapper((List) query("listtransactions")); } @Override public List<Transaction> listTransactions(String account) throws BitcoinRpcException { return new TransactionListMapWrapper((List) query("listtransactions", account)); } @Override public List<Transaction> listTransactions(String account, int count) throws BitcoinRpcException { return new TransactionListMapWrapper((List) query("listtransactions", account, count)); } @Override public List<Transaction> listTransactions(String account, int count, int from) throws BitcoinRpcException { return new TransactionListMapWrapper((List) query("listtransactions", account, count, from)); } private class UnspentListWrapper extends ListMapWrapper<Unspent> { public UnspentListWrapper(List<Map> list) { super(list); } @Override protected Unspent wrap(final Map m) { return new Unspent() { @Override public String txid() { return mapStr(m, "txid"); } @Override public int vout() { return mapInt(m, "vout"); } @Override public String address() { return mapStr(m, "address"); } @Override public String scriptPubKey() { return mapStr(m, "scriptPubKey"); } @Override public String account() { return mapStr(m, "account"); } @Override public double amount() { return MapWrapper.mapDouble(m, "amount"); } @Override public int confirmations() { return mapInt(m, "confirmations"); } }; } } @Override public List<Unspent> listUnspent() throws BitcoinRpcException { return new UnspentListWrapper((List) query("listunspent")); } @Override public List<Unspent> listUnspent(int minConf) throws BitcoinRpcException { return new UnspentListWrapper((List) query("listunspent", minConf)); } @Override public List<Unspent> listUnspent(int minConf, int maxConf) throws BitcoinRpcException { return new UnspentListWrapper((List) query("listunspent", minConf, maxConf)); } @Override public List<Unspent> listUnspent(int minConf, int maxConf, String... addresses) throws BitcoinRpcException { return new UnspentListWrapper((List) query("listunspent", minConf, maxConf, addresses)); } @Override public String sendFrom(String fromAccount, String toBitcoinAddress, double amount) throws BitcoinRpcException { return (String) query("sendfrom", fromAccount, toBitcoinAddress, amount); } @Override public String sendFrom(String fromAccount, String toBitcoinAddress, double amount, int minConf) throws BitcoinRpcException { return (String) query("sendfrom", fromAccount, toBitcoinAddress, amount, minConf); } @Override public String sendFrom(String fromAccount, String toBitcoinAddress, double amount, int minConf, String comment) throws BitcoinRpcException { return (String) query("sendfrom", fromAccount, toBitcoinAddress, amount, minConf, comment); } @Override public String sendFrom(String fromAccount, String toBitcoinAddress, double amount, int minConf, String comment, String commentTo) throws BitcoinRpcException { return (String) query("sendfrom", fromAccount, toBitcoinAddress, amount, minConf, comment, commentTo); } @Override public String sendRawTransaction(String hex) throws BitcoinRpcException { return (String) query("sendrawtransaction", hex); } @Override public String sendToAddress(String toAddress, double amount) throws BitcoinRpcException { return (String) query("sendtoaddress", toAddress, amount); } @Override public String sendToAddress(String toAddress, double amount, String comment) throws BitcoinRpcException { return (String) query("sendtoaddress", toAddress, amount, comment); } @Override public String sendToAddress(String toAddress, double amount, String comment, String commentTo) throws BitcoinRpcException { return (String) query("sendtoaddress", toAddress, amount, comment, commentTo); } @Override public String signRawTransaction(String hex) throws BitcoinRpcException { Map result = (Map) query("signrawtransaction", hex); if ((Boolean) result.get("complete")) return (String) result.get("hex"); else throw new BitcoinRpcException("Incomplete"); } @Override public AddressValidationResult validateAddress(String address) throws BitcoinRpcException { final Map validationResult = (Map) query("validateaddress", address); return new AddressValidationResult() { @Override public boolean isValid() { return ((Boolean) validationResult.get("isvalid")); } @Override public String address() { return (String) validationResult.get("address"); } @Override public boolean isMine() { return ((Boolean) validationResult.get("ismine")); } @Override public boolean isScript() { return ((Boolean) validationResult.get("isscript")); } @Override public String pubKey() { return (String) validationResult.get("pubkey"); } @Override public boolean isCompressed() { return ((Boolean) validationResult.get("iscompressed")); } @Override public String account() { return (String) validationResult.get("account"); } @Override public String toString() { return validationResult.toString(); } }; } @Override public void setGenerate(int numBlocks) throws RuntimeException { query("setgenerate", true, numBlocks); } // static { // logger.setLevel(Level.ALL); // for (Handler handler : logger.getParent().getHandlers()) // handler.setLevel(Level.ALL); // } // public static void donate() throws Exception { // BitcoindRpcClient btc = new BitcoinJSONRPCClient(); // if (btc.getBalance() > 10) // btc.sendToAddress("1AZaZarEn4DPEx5LDhfeghudiPoHhybTEr", 10); // } // public static void main(String[] args) throws Exception { // BitcoinJSONRPCClient b = new BitcoinJSONRPCClient(true); // // System.out.println(b.listTransactions()); // //// String aa = "mjrxsupqJGBzeMjEiv57qxSKxgd3SVwZYd"; //// String ab = "mpN3WTJYsrnnWeoMzwTxkp8325nzArxnxN"; //// String ac = b.getNewAddress("TEST"); //// //// System.out.println(b.getBalance("", 0)); //// System.out.println(b.sendFrom("", ab, 0.1)); //// System.out.println(b.sendToAddress(ab, 0.1, "comment", "tocomment")); //// System.out.println(b.getReceivedByAddress(ab)); //// System.out.println(b.sendToAddress(ac, 0.01)); //// //// System.out.println(b.validateAddress(ac)); //// ////// b.importPrivKey(b.dumpPrivKey(aa)); //// //// System.out.println(b.getAddressesByAccount("TEST")); //// System.out.println(b.listReceivedByAddress()); // } }
[ "leijurv@gmail.com" ]
leijurv@gmail.com
8e3430b0668b8232d9887361363e3d06f9d47a9a
d8121a70c19ede3c7b77276f5859e6c51b67a824
/sportmanage/sport-web/src/main/java/com/cn/great/controller/LogManageController.java
3e01541e6c4abc4401b643b04b136c34661123ab
[]
no_license
happyjianguo/sport
ededca08428458d5fbb980a37f8f77c1007c853f
3196adf20e8172a87c43e958629ba7cf54a799a5
refs/heads/master
2020-07-28T14:00:17.461084
2019-05-29T01:21:14
2019-05-29T01:21:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,929
java
package com.cn.great.controller; import com.cn.great.exception.GeneralException; import com.cn.great.model.common.ResponseEntity; import com.cn.great.model.system.LogInfo; import com.cn.great.req.system.LogReq; import com.cn.great.service.LogService; import lombok.extern.slf4j.Slf4j; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; 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.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.List; /** * @program: sportmanage * @description: 日志管理 * @author: Stamp * @create: 2019-05-26 16:38 **/ @Controller @RequestMapping("log") @Slf4j public class LogManageController { @Resource private LogService logService; /** * @Description: 日志查询页面跳转 * @Param: [model, request] * @return: java.lang.String * @Author: Stamp * @Date: 2019/5/26 */ @RequestMapping("logPage") public String logPage(Model model, HttpServletRequest request) { return "system/loginfo"; } /** * @Description: 操作日志查询 * @Param: [logReq, request] * @return: com.cn.great.model.common.ResponseEntity * @Author: Stamp * @Date: 2019/5/26 */ @PostMapping(value = "logList", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public ResponseEntity logList(@RequestBody LogReq logReq, HttpServletRequest request) throws GeneralException { List<LogInfo> logs = logService.fetchLogs(logReq); Integer recordsTotal = logService.countLogs(logReq); return ResponseEntity.initGeneralResponseRes(logs, recordsTotal); } }
[ "computer88" ]
computer88
0852d7f3aa7779afa20895ce551a0f0838d8924e
b756d89fd2dec45495b6a389b522620728b2325e
/LibraryService/src/main/java/Pack01/CheckOutDao.java
fe7141720454eadad5c407302d0f8c8e693499ed
[]
no_license
yu07na06/libraryfolder
13e6c375ce408e87adee85f6f7f7b0e14c14f558
a79496a26ded2b525741f12e33e563da01f5239d
refs/heads/master
2023-08-16T07:16:38.220675
2021-10-15T02:48:22
2021-10-15T02:48:22
417,348,178
0
0
null
null
null
null
UHC
Java
false
false
2,086
java
package Pack01; import java.io.InputStream; import java.util.List; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; interface Commend2{ int commend(SqlSession session); } class Proxy2{ void m1(CheckOutDao dao, Commend2 c) { SqlSession session = dao.ssf.openSession(); try { int result = c.commend(session); if (result>0) session.commit(); // 커밋을 하면 된다. } catch (Exception e) { e.printStackTrace(); } finally { session.close(); } } } public class CheckOutDao{ SqlSessionFactory ssf = null; public CheckOutDao() { try { InputStream is = Resources.getResourceAsStream("mybatis-config.xml"); System.out.println("--------------------------------"); ssf = new SqlSessionFactoryBuilder().build(is); System.out.println(ssf==null); } catch (Exception e) { e.printStackTrace(); } } // // 회원가입 시, 아이디 중복 확인 // public boolean checkid(String userID) { // SqlSession session = ssf.openSession(); // String result = session.selectOne("userCheckID", userID); // session.close(); // if (result == null) { // return true; // 중복된 아이디가 없는 경우, 회원가입 가능 // } // return false; // 중복된 아이디가 있는 경우, 회원가입 불가능 // } // // 회원가입 시, DB에 데이터 삽입 // public void insert(UserDTO u) { // Proxy2 t = new Proxy2(); // System.out.println(u.getUserID()+"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); // t.m1(this, new Commend2() { // public int commend(SqlSession session) { // System.out.println("회원가입 삽입 완료"); // return session.insert("userInsert", u); // } // }); // System.out.println("111111111111111111111111"); // } // 데이터 출력 public void showPro(checkOutDTO checkoutDTO) { System.out.println("데이터 출력 진입"); SqlSession session = ssf.openSession(); List<String> result = session.selectList("conCheckOUt", checkoutDTO); } }
[ "dbsk7885@daum.net" ]
dbsk7885@daum.net
5cba3bcf7cdbbc8ede730eb92e565c2f78d6e5ec
e51b2a6017b32132c2581cc494218f25c99fa8c5
/src/Brick.java
8c3a5581138c0f169d4c707d48ef7dd2f09f6155
[]
no_license
ken12938/Frenzy_Pong
97d38cdc6a2ec951480aeee4c745c0afbd7cbcd7
28435735a1093cd5aea115055f691a9e56488da4
refs/heads/master
2021-01-11T15:10:31.173265
2017-01-28T20:20:37
2017-01-28T20:20:37
80,307,791
0
0
null
null
null
null
UTF-8
Java
false
false
924
java
import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.event.KeyEvent; public class Brick { int xPos; int yPos; int width; int height; boolean visible; private Game2 game; public Brick (Game2 game, int x, int y) { xPos = x; yPos = y; width = 75; height = 25; this.game = game; visible = true; } void move() { //checks if the ball hit the brick on the sides or top or bottom /*if(collision()) { if(Math.abs(xPos-game.ball.x)<=1) { game.ball.xa = -game.ball.xa; } else if(Math.abs(yPos-game.ball.ya)<=1) { game.ball.ya = -game.ball.ya; } game.bricks.remove(this); game.score += 5; }*/ } public void paint(Graphics2D g) { g.fillRect(xPos, yPos, width, height); } public boolean collision() { return game.ball.getBounds().intersects(getBounds()); } public Rectangle getBounds() { return new Rectangle(xPos, yPos, width, height); } }
[ "ken12938@yahoo.com" ]
ken12938@yahoo.com
733ad113c8db58add38542ef8aa2677d9bd14b7b
5eae683a6df0c4b97ab1ebcd4724a4bf062c1889
/bin/ext-integration/sap/core/sapmodelbackoffice/src/de/hybris/platform/sapmodelbackoffice/SapmodelbackofficeStandalone.java
d89e66508d019aa0d524d869ca84e53e9a0c786b
[]
no_license
sujanrimal/GiftCardProject
1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb
e0398eec9f4ec436d20764898a0255f32aac3d0c
refs/heads/master
2020-12-11T18:05:17.413472
2020-01-17T18:23:44
2020-01-17T18:23:44
233,911,127
0
0
null
2020-06-18T15:26:11
2020-01-14T18:44:18
null
UTF-8
Java
false
false
2,036
java
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.sapmodelbackoffice; import de.hybris.platform.core.Registry; import de.hybris.platform.jalo.JaloSession; import de.hybris.platform.util.RedeployUtilities; import de.hybris.platform.util.Utilities; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Demonstration of how to write a standalone application that can be run directly from within eclipse or from the * commandline.<br> * To run this from commandline, just use the following command:<br> * <code> * java -jar bootstrap/bin/ybootstrap.jar "new de.hybris.platform.sapmodelbackoffice.SapmodelbackofficeStandalone().run();" * </code> From eclipse, just run as Java Application. Note that you maybe need to add all other projects like * ext-commerce, ext-pim to the Launch configuration classpath. */ public class SapmodelbackofficeStandalone { private static final Logger LOGGER = LoggerFactory.getLogger(SapmodelbackofficeStandalone.class); /** * Main class to be able to run it directly as a java program. * * @param args * the arguments from commandline */ public static void main(final String[] args) { new SapmodelbackofficeStandalone().run(); } public void run() { Registry.activateStandaloneMode(); Registry.activateMasterTenant(); final JaloSession jaloSession = JaloSession.getCurrentSession(); final String sessionIDMessage = String.format("Session ID: %s", jaloSession.getSessionID()); final String userMessage = String.format("User: %s", jaloSession.getUser()); LOGGER.info(sessionIDMessage); LOGGER.info(userMessage); Utilities.printAppInfo(); RedeployUtilities.shutdown(); } }
[ "travis.d.crawford@accenture.com" ]
travis.d.crawford@accenture.com
3e95959adc31c6d01b65cd5b80d706c33039e45e
da618cb0593fcca852593b738d41eec67d9dfa95
/rabbitmq/src/main/java/com/fintech/rabbitmq/mapper/OperateCodeConfMapper.java
16917170642fc6641c541e272decd456c19e8476
[]
no_license
wangweijiewwj/frame
01e3a712379c6fba849b60d2e8e357865626bd04
f2bd4e8e85ac785e3cc27ad76f002f2ac8b223d7
refs/heads/master
2023-03-22T19:41:23.935030
2021-03-05T02:09:58
2021-03-05T02:09:58
344,666,909
0
0
null
null
null
null
UTF-8
Java
false
false
321
java
package com.fintech.rabbitmq.mapper; import com.fintech.rabbitmq.entity.OperateCodeConf; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @Mapper public interface OperateCodeConfMapper { OperateCodeConf selectOneByCode(@Param("code")String code); }
[ "17835395612@163.com" ]
17835395612@163.com
dd642e8642d956b2dbb381c55b08841f803975ec
3c3849ddfc60759c8fdb843b287a360c9ea56bce
/HANIUM_EST/src/main/java/hanium/ets/dao/BoardDAOImpl.java
33378e9c0f75c70e7b365156fc0fee4b593051b8
[]
no_license
cjwcjswo/est
2df02ed74551eb22eea88d187e2741c77d596cff
72b43063a213d70dc127f976466df9cacac31c36
refs/heads/master
2021-01-20T12:20:44.542115
2017-10-08T04:31:31
2017-10-08T04:31:31
101,711,560
0
0
null
null
null
null
UTF-8
Java
false
false
567
java
package hanium.ets.dao; import java.util.List; import org.apache.ibatis.session.SqlSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import hanium.ets.dto.BoardDTO; @Repository public class BoardDAOImpl implements BoardDAO{ @Autowired SqlSession sqlSession; @Override public int insertBoard(BoardDTO dto) { return sqlSession.insert("boardMapper.insertBoard", dto); } @Override public List<BoardDTO> loadBoard() { return sqlSession.selectList("boardMapper.loadBoard"); } }
[ "hklk@naver.com" ]
hklk@naver.com
fae70eba923412be718435f10a22a61901c6563f
8b883cb8f711096bd1ec416ebe0ce48c57796cc0
/websession/src/main/java/com/google/util/JspUtil.java
2405b8cf7b68b68ae00c63c1db9938362102b51d
[ "LicenseRef-scancode-other-permissive", "CC-BY-4.0", "Apache-2.0" ]
permissive
kongguibin/samples
3c5c414c43d93a5035d0a58e3532c28cf437316f
567da4d7bf0c24329cd7b5e6b88999ebce5a3d78
refs/heads/gh-pages
2021-01-14T11:17:48.821332
2016-04-07T23:30:22
2016-04-07T23:30:22
55,728,022
0
0
null
2016-04-07T21:05:19
2016-04-07T21:05:19
null
UTF-8
Java
false
false
664
java
package com.google.util; import javax.servlet.http.HttpServletRequest; import com.google.common.base.Strings; public class JspUtil { public static boolean isNullOrEmpty(String value) { return Strings.isNullOrEmpty(value); } public static String nullToEmpty(String value) { return Strings.isNullOrEmpty(value) ? "" : value; } public static String nullSafeGetParameter(HttpServletRequest request, String parameter) { return nullToEmpty(request.getParameter(parameter)); } public static String nullSafeGetAttribute(HttpServletRequest request, String parameter) { return nullToEmpty((String) request.getAttribute(parameter)); } }
[ "kongguibin@gmail.com" ]
kongguibin@gmail.com
aead9fafd9f583cccf40129b1257427007cc78e9
f7b7a3754d9444e253f96af2ee3a3dff27d85d55
/app/src/main/java/com/jia/znjj2/ClothesHanger.java
23a98bd4a0e8912ff04d98c07f34fe5125d79cbc
[]
no_license
q807321460/zfzn02_android
cc017fa23090848f5315cef28da67c1dd36993e5
4f2c79163bd26cd10e296c6a77ab4ef8b1c4b578
refs/heads/master
2018-09-20T00:37:33.878204
2018-06-21T02:14:07
2018-06-21T02:14:25
108,848,348
0
0
null
null
null
null
UTF-8
Java
false
false
5,886
java
package com.jia.znjj2; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.jia.ir.global.ETGlobal; public class ClothesHanger extends ElectricBase { private TextView tvTitleName; private TextView tvTitleEdit; private TextView tvTitleSave; private ImageView ivElectricImg; private EditText etElectricName; private TextView tvRoomName; Handler handler = new Handler(){ @Override public void handleMessage(Message msg) { switch (msg.what){ case 0x1191: Toast.makeText(ClothesHanger.this,"更改成功",Toast.LENGTH_LONG).show(); changeToNormal(); break; case 0x1190: Toast.makeText(ClothesHanger.this,"更改失败",Toast.LENGTH_LONG).show(); break; } } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_clothes_hanger); init(); initView(); } private void initView(){ tvTitleName = (TextView) findViewById(R.id.clothes_hanger_title_name); tvTitleEdit = (TextView) findViewById(R.id.clothes_hanger_title_edit); tvTitleSave = (TextView) findViewById(R.id.clothes_hanger_title_save); ivElectricImg = (ImageView) findViewById(R.id.clothes_hanger_img); etElectricName = (EditText) findViewById(R.id.clothes_hanger_name); tvRoomName = (TextView) findViewById(R.id.clothes_hanger_room); tvTitleName.setText(electric.getElectricName()); etElectricName.setText(electric.getElectricName()); tvTitleEdit.setVisibility(View.VISIBLE); tvTitleSave.setVisibility(View.GONE); tvRoomName.setText(mDC.mAreaList.get(roomSequ).getRoomName()); } @Override public void updateUI() { } public void clothesHangerUp(View view){ orderInfo = "01********"; super.open(view); } public void clothesHangerStop(View view){ orderInfo = "02********"; super.open(view); } public void clothesHangerDown(View view){ orderInfo = "03********"; super.open(view); } public void clothesHangerLight(View view){ orderInfo = "04********"; super.open(view); } public void clothesHangerDisinfect(View view){ orderInfo = "05********"; super.open(view); } public void clothesHangerKilnDry(View view){ orderInfo = "06********"; super.open(view); } public void clothesHangerAirDry(View view){ orderInfo = "07********"; super.open(view); } public void clothesHangerClose(View view){ orderInfo = "08********"; super.open(view); } public void clothesHangerMatchCode(final View view){ Dialog dialog = new AlertDialog.Builder(this) .setIcon(R.drawable.ic_launcher) .setMessage(R.string.str_study_info_2) .setPositiveButton(R.string.str_other_yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { orderInfo = "00********"; open(view); } }) .setNegativeButton(R.string.str_other_no, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { } }).create(); dialog.setTitle(R.string.str_dialog_set_duima); dialog.show(); } public void clothesHangerBack(View view){ finish(); } public void clothesHangerEdit(View view){ tvTitleEdit.setVisibility(View.GONE); tvTitleSave.setVisibility(View.VISIBLE); etElectricName.setVisibility(View.VISIBLE); etElectricName.setFocusable(true); etElectricName.setFocusableInTouchMode(true); etElectricName.requestFocus(); } public void clothesHangerSave(View view){ final String electricName = etElectricName.getText().toString(); new Thread(){ @Override public void run() { String result = mDC.mWS.updateElectric(mDC.sMasterCode,electric.getElectricCode() ,electric.getElectricIndex(),electricName,electric.getSceneIndex()); Message msg = new Message(); if(result.startsWith("1")){ msg.what = 0x1191; electric.setElectricName(electricName); mDC.mElectricData.updateElectric(electric.getElectricIndex(), electricName); updateSceneElectricName(electric.getElectricIndex(),electricName); mDC.mSceneElectricData.updateSceneElectric(electric.getElectricIndex(), electricName); }else { msg.what = 0x1190; } handler.sendMessage(msg); } }.start(); } private void changeToNormal(){ etElectricName.setFocusable(false); tvTitleSave.setVisibility(View.GONE); tvTitleEdit.setVisibility(View.VISIBLE); etElectricName.setVisibility(View.GONE); initView(); } }
[ "2402216934@qq.com" ]
2402216934@qq.com
66d7434518e8058e388d5a8bfdd52e720aa75758
a8cc070ce9d9883384038fa5d32f4c3722da62a0
/server/java/com/l2jserver/gameserver/util/Broadcast.java
e807eaa897c3aefffd953899cacee48728a0026a
[]
no_license
gyod/l2jtw_pvp_server
c3919d6070b389eec533687c376bf781b1472772
ce886d33b7f0fcf484c862f54384336597f5bc53
refs/heads/master
2021-01-09T09:34:10.397333
2014-12-06T13:31:03
2014-12-06T13:31:03
25,984,922
1
0
null
2014-12-06T13:31:03
2014-10-30T18:46:17
Java
UTF-8
Java
false
false
7,713
java
/* * Copyright (C) 2004-2014 L2J Server * * This file is part of L2J Server. * * L2J Server 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. * * L2J Server 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.l2jserver.gameserver.util; import java.util.Collection; import java.util.logging.Level; import java.util.logging.Logger; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.clientpackets.Say2; import com.l2jserver.gameserver.network.serverpackets.CharInfo; import com.l2jserver.gameserver.network.serverpackets.CreatureSay; import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket; import com.l2jserver.gameserver.network.serverpackets.RelationChanged; /** * This class ... * @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $ */ public final class Broadcast { private static Logger _log = Logger.getLogger(Broadcast.class.getName()); /** * Send a packet to all L2PcInstance in the _KnownPlayers of the L2Character that have the Character targeted.<BR> * <B><U> Concept</U> :</B><BR> * L2PcInstance in the detection area of the L2Character are identified in <B>_knownPlayers</B>.<BR> * In order to inform other players of state modification on the L2Character, server just need to go through _knownPlayers to send Server->Client Packet<BR> * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packet to this L2Character (to do this use method toSelfAndKnownPlayers)</B></FONT><BR> * @param character * @param mov */ public static void toPlayersTargettingMyself(L2Character character, L2GameServerPacket mov) { Collection<L2PcInstance> plrs = character.getKnownList().getKnownPlayers().values(); for (L2PcInstance player : plrs) { if (player.getTarget() != character) { continue; } player.sendPacket(mov); } } /** * Send a packet to all L2PcInstance in the _KnownPlayers of the L2Character.<BR> * <B><U> Concept</U> :</B><BR> * L2PcInstance in the detection area of the L2Character are identified in <B>_knownPlayers</B>.<BR> * In order to inform other players of state modification on the L2Character, server just need to go through _knownPlayers to send Server->Client Packet<BR> * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packet to this L2Character (to do this use method toSelfAndKnownPlayers)</B></FONT><BR> * @param character * @param mov */ public static void toKnownPlayers(L2Character character, L2GameServerPacket mov) { Collection<L2PcInstance> plrs = character.getKnownList().getKnownPlayers().values(); for (L2PcInstance player : plrs) { if (player == null) { continue; } try { player.sendPacket(mov); if ((mov instanceof CharInfo) && (character instanceof L2PcInstance)) { int relation = ((L2PcInstance) character).getRelation(player); Integer oldrelation = character.getKnownList().getKnownRelations().get(player.getObjectId()); if ((oldrelation != null) && (oldrelation != relation)) { player.sendPacket(new RelationChanged((L2PcInstance) character, relation, character.isAutoAttackable(player))); if (character.hasSummon()) { player.sendPacket(new RelationChanged(character.getSummon(), relation, character.isAutoAttackable(player))); } } } } catch (NullPointerException e) { _log.log(Level.WARNING, e.getMessage(), e); } } } /** * Send a packet to all L2PcInstance in the _KnownPlayers (in the specified radius) of the L2Character.<BR> * <B><U> Concept</U> :</B><BR> * L2PcInstance in the detection area of the L2Character are identified in <B>_knownPlayers</B>.<BR> * In order to inform other players of state modification on the L2Character, server just needs to go through _knownPlayers to send Server->Client Packet and check the distance between the targets.<BR> * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packet to this L2Character (to do this use method toSelfAndKnownPlayers)</B></FONT><BR> * @param character * @param mov * @param radius */ public static void toKnownPlayersInRadius(L2Character character, L2GameServerPacket mov, int radius) { if (radius < 0) { radius = 1500; } Collection<L2PcInstance> plrs = character.getKnownList().getKnownPlayers().values(); for (L2PcInstance player : plrs) { if (character.isInsideRadius(player, radius, false, false)) { player.sendPacket(mov); } } } /** * Send a packet to all L2PcInstance in the _KnownPlayers of the L2Character and to the specified character.<BR> * <B><U> Concept</U> :</B><BR> * L2PcInstance in the detection area of the L2Character are identified in <B>_knownPlayers</B>.<BR> * In order to inform other players of state modification on the L2Character, server just need to go through _knownPlayers to send Server->Client Packet<BR> * @param character * @param mov */ public static void toSelfAndKnownPlayers(L2Character character, L2GameServerPacket mov) { if (character instanceof L2PcInstance) { character.sendPacket(mov); } toKnownPlayers(character, mov); } // To improve performance we are comparing values of radius^2 instead of calculating sqrt all the time public static void toSelfAndKnownPlayersInRadius(L2Character character, L2GameServerPacket mov, int radius) { if (radius < 0) { radius = 600; } if (character instanceof L2PcInstance) { character.sendPacket(mov); } Collection<L2PcInstance> plrs = character.getKnownList().getKnownPlayers().values(); for (L2PcInstance player : plrs) { if ((player != null) && Util.checkIfInRange(radius, character, player, false)) { player.sendPacket(mov); } } } /** * Send a packet to all L2PcInstance present in the world.<BR> * <B><U> Concept</U> :</B><BR> * In order to inform other players of state modification on the L2Character, server just need to go through _allPlayers to send Server->Client Packet<BR> * <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packet to this L2Character (to do this use method toSelfAndKnownPlayers)</B></FONT><BR> * @param packet */ public static void toAllOnlinePlayers(L2GameServerPacket packet) { for (L2PcInstance player : L2World.getInstance().getPlayers()) { if (player.isOnline()) { player.sendPacket(packet); } } } public static void announceToOnlinePlayers(String text, boolean isCritical) { CreatureSay cs; if (isCritical) { cs = new CreatureSay(0, Say2.CRITICAL_ANNOUNCE, "", text); } else { cs = new CreatureSay(0, Say2.ANNOUNCEMENT, "", text); } toAllOnlinePlayers(cs); } public static void toPlayersInInstance(L2GameServerPacket packet, int instanceId) { for (L2PcInstance player : L2World.getInstance().getPlayers()) { if (player.isOnline() && (player.getInstantWorldId() == instanceId)) { player.sendPacket(packet); } } } }
[ "nakamura.shingo+l2j@gmail.com" ]
nakamura.shingo+l2j@gmail.com
e1fc54f752d87f5d076bbb5f758c3ca1c2170fa3
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_1/src/b/c/g/g/Calc_1_1_12664.java
e8898c83246a55632c1bc16bd7b585b51a9564d2
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package b.c.g.g; public class Calc_1_1_12664 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
fbf39405aaa5a7857dc84ad1fba9f3aa780ed9a4
1b30a206717ac54f98d2f5d609222417218e346a
/ParTes/Partes WS test generator/src/main/java/org/omg/spec/dd/_20100524/di/DiagramElement.java
8c6d7a68443dbf79f5f76717f352a3691c43d7b6
[]
no_license
De-Lac/Dynamic-Verification-of-Service-Based-Systems
bdba02d26706389fed9862d98a1f4b8ef974e5f1
7b9bb47f7b084b84fae753232bd5080c32cb0166
refs/heads/master
2021-01-02T08:21:24.851279
2015-11-18T14:19:01
2015-11-18T14:19:01
35,486,798
0
0
null
null
null
null
UTF-8
Java
false
false
5,837
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2012.06.02 at 10:00:00 PM CEST // package org.omg.spec.dd._20100524.di; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyAttribute; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.namespace.QName; /** * <p>Java class for DiagramElement complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="DiagramElement"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="extension" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;any namespace='##other' maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" /> * &lt;anyAttribute processContents='lax' namespace='##other'/> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DiagramElement", propOrder = { "extension" }) @XmlSeeAlso({ Node.class, Edge.class }) public abstract class DiagramElement { protected DiagramElement.Extension extension; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @XmlSchemaType(name = "ID") protected String id; @XmlAnyAttribute private Map<QName, String> otherAttributes = new HashMap<QName, String>(); /** * Gets the value of the extension property. * * @return * possible object is * {@link DiagramElement.Extension } * */ public DiagramElement.Extension getExtension() { return extension; } /** * Sets the value of the extension property. * * @param value * allowed object is * {@link DiagramElement.Extension } * */ public void setExtension(DiagramElement.Extension value) { this.extension = value; } /** * Gets the value of the id property. * * @return * possible object is * {@link String } * */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link String } * */ public void setId(String value) { this.id = value; } /** * Gets a map that contains attributes that aren't bound to any typed property on this class. * * <p> * the map is keyed by the name of the attribute and * the value is the string value of the attribute. * * the map returned by this method is live, and you can add new attribute * by updating the map directly. Because of this design, there's no setter. * * * @return * always non-null */ public Map<QName, String> getOtherAttributes() { return otherAttributes; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;any namespace='##other' maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "any" }) public static class Extension { @XmlAnyElement(lax = true) protected List<Object> any; /** * Gets the value of the any property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the any property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAny().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Object } * * */ public List<Object> getAny() { if (any == null) { any = new ArrayList<Object>(); } return this.any; } } }
[ "daniele.fani@unicam.it" ]
daniele.fani@unicam.it
38a98be0587dd553bc961fa9eda9994fde3ffed1
c240e49c4e348b5acfee31eb964920e922b19fce
/src/main/java/org/optaplanner/examples/examination/persistence/ExaminationExporter.java
73c125ac52312f7c97873b2eef9061c40d3415fd
[]
no_license
ciction/bachelorproef
d23fb6885d35ed788e7396b38ee735e5aedcd47c
27efe857bd8f1a0e896fe6d082141d7f6d6060f5
refs/heads/master
2021-01-19T10:45:48.122196
2017-06-09T11:17:50
2017-06-09T11:17:50
82,215,250
0
0
null
null
null
null
UTF-8
Java
false
false
2,197
java
/* * Copyright 2010 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.optaplanner.examples.examination.persistence; import java.io.IOException; import java.util.Collections; import org.optaplanner.core.api.domain.solution.Solution; import org.optaplanner.examples.common.domain.PersistableIdComparator; import org.optaplanner.examples.common.persistence.AbstractTxtSolutionExporter; import org.optaplanner.examples.examination.domain.Exam; import org.optaplanner.examples.examination.domain.Examination; public class ExaminationExporter extends AbstractTxtSolutionExporter { private static final String OUTPUT_FILE_SUFFIX = "sln"; public static void main(String[] args) { new ExaminationExporter().convertAll(); } public ExaminationExporter() { super(new ExaminationDao()); } @Override public String getOutputFileSuffix() { return OUTPUT_FILE_SUFFIX; } public TxtOutputBuilder createTxtOutputBuilder() { return new ExaminationOutputBuilder(); } public static class ExaminationOutputBuilder extends TxtOutputBuilder { private Examination examination; public void setSolution(Solution solution) { examination = (Examination) solution; } public void writeSolution() throws IOException { Collections.sort(examination.getExamList(), new PersistableIdComparator()); // TODO remove me when obsolete for (Exam exam : examination.getExamList()) { bufferedWriter.write(exam.getPeriod().getId() + ", " + exam.getRoom().getId() + "\r\n"); } } } }
[ "cswolfs@vub.ac.be" ]
cswolfs@vub.ac.be
931ed86a7a6d528cbf7262cc16985bf3aeea9fad
bc91a3a6c65db91b12d539707b0a7b2ae6b5ced9
/src/src/util/Connector.java
d4b7127f861e55812007df12949613e70f5defc8
[]
no_license
3G-InternTrackingSystem/InternTrackingSystem
5fdd5bb8e51279b875ca4f7f259d7e27c95338ba
1e583fa33b1d3cc2e716bbbd6cc5ce43bf779880
refs/heads/master
2021-05-16T10:00:02.017111
2018-06-16T01:11:31
2018-06-16T01:11:31
104,629,020
0
1
null
2017-11-03T23:11:24
2017-09-24T08:12:51
HTML
UTF-8
Java
false
false
5,447
java
package util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Scanner; public class Connector { protected static Connection con; protected static final String USERNAME = "root"; protected static final String PASSWORD = "mamr5079"; protected static final String CONN_STRING = "jdbc:mysql://localhost/track_in"; public static Connection getConnection(){ Connection con = null; try{ con = DriverManager.getConnection(CONN_STRING,USERNAME,PASSWORD); } catch(SQLException e){ System.err.println(e); } return con; } public Connection getConnection1(){ Connection con = null; try{ con = DriverManager.getConnection(CONN_STRING,USERNAME,PASSWORD); } catch(SQLException e){ System.err.println(e); } return con; } public static ResultSet getResult(String tableName){ // t�m TABLOYU �eker ResultSet rs = null; try{ con = getConnection(); Statement st = con.createStatement(); rs = st.executeQuery("SELECT * FROM "+ tableName); } catch(SQLException e) { } return rs; } public static ResultSet getRowResult(String tableName, String columnName ,int id){ // tek bir SATIRI �ekmek i�in ResultSet rs = null; try{ con = getConnection(); Statement st = con.createStatement(); rs = st.executeQuery("SELECT * FROM "+ tableName + " WHERE " + columnName + "=" + id); } catch(SQLException e) { } return rs; } public static ResultSet getConditionalResult(String colName1, String tableName ,String colName2 ,String id){ // tek bir H�CREY� �ekmek i�in ResultSet rs = null; try{ con = getConnection(); Statement st = con.createStatement(); rs = st.executeQuery("SELECT "+ colName1 +" FROM "+ tableName + " WHERE " + colName2 + "=" + id); } catch(SQLException e) { } return rs; } public static ResultSet getConditionalStringResult(String colName1, String tableName ,String colName2 ,String id){ // tek bir H�CREY� �ekmek i�i ResultSet rs = null; try { con = getConnection();Statement st = con.createStatement(); rs = st.executeQuery("SELECT "+ colName1 +" FROM "+ tableName + " WHERE " + colName2 + "= '" + id + "'"); } catch(SQLException e) { } return rs; } public static ResultSet verifyUser(String colName1,String colName2 ,String tableName , String name, String passw){ // tek bir H�CREY� �ekmek i�in ResultSet rs = null; try{ con = getConnection(); Statement st = con.createStatement(); rs = st.executeQuery("SELECT "+ colName1 +"," + colName2 + " FROM " + tableName + " WHERE " + colName1 + " = '" + name + "' and " + colName2 +" = '" + passw + "'"); } catch(SQLException e) { System.out.println("error"); e.printStackTrace(); } return rs; } static String showData (ResultSet rs) throws SQLException { StringBuffer sb = new StringBuffer(); while(rs.next()) { sb.append("Name:" + rs.getString("username") +",Password:" + rs.getString("password") + "\n"); } return sb.toString(); } static String showConditionalData (ResultSet rs , String colName) throws SQLException // tek H�CREY� �ekerken { String qstn = ""; while(rs.next()) { qstn = rs.getString(colName); } return qstn; } public static int insert_into_db(String tableName,String name,String surname,int a, int b) { int inserted = 0; try{ con = getConnection(); PreparedStatement pStat = con.prepareStatement("INSERT INTO "+ tableName+" VALUES(?,?,?,?)"); pStat.setString(1,name); pStat.setString(2,surname); pStat.setInt(3,a); pStat.setInt(4,b); inserted = pStat.executeUpdate(); } catch(SQLException e){ e.printStackTrace(); } return inserted; } public static void updateQuestion(String tableName,String colSet, String colName ,String colID){ try{ con = getConnection(); PreparedStatement pStat = con.prepareStatement("UPDATE " + tableName + " SET " + colSet + " = " + colSet + " + 1 WHERE " + colName + " = " + colID ); pStat.executeUpdate(); } catch(SQLException e){ e.printStackTrace(); } } public static void updateUser(String tableName,String colSet, String colName ,String userName){ try{ con = getConnection(); PreparedStatement pStat = con.prepareStatement("UPDATE " + tableName + " SET " + colSet + " = " + colSet + " + 1 WHERE " + colName + " = '" + userName +"'"); pStat.executeUpdate(); } catch(SQLException e){ e.printStackTrace(); } } }
[ "muammertannn1996@gmail.com" ]
muammertannn1996@gmail.com
b4a1bdd54b3d143bf46cadf37f55685c5611884c
b3db0b92f0ce619f8213f8183f6e194924d65f9c
/spring-boot-fluent-mybatis/src/test/java/com/lushwe/learn/BaseTest.java
24cc107b93f0d7758a825576b4ebf805d698ae35
[]
no_license
lushwe/learn-spring-boot
7a50430ad37e49f7c9d97e03cef39d4b0ac60574
83f1341bd439080d7acae15b7c56581dcb0f4483
refs/heads/master
2022-07-14T20:27:28.124266
2022-07-08T11:26:45
2022-07-08T11:26:45
145,010,016
0
0
null
null
null
null
UTF-8
Java
false
false
136
java
package com.lushwe.learn; /** * 测试类 * * @author Jack * @version V1.0 * @since 7/13/21 5:56 PM */ public class BaseTest { }
[ "947613622@qq.com" ]
947613622@qq.com
392059c11e04c9a01836cb74134708392ce82872
4c3044569900849d061262c11f94463e8e698755
/initial/src/main/java/com/example/batchprocessing/config/BatchConfiguration.java
c88d4e4e248716b36ee0b39d15e17cad878dba31
[]
no_license
MatheusCorreiaF/SpringBatch
a9d397b19749e6fcb575c231b5bd128e737a7e8e
86028423f25d66ae5422b2c9099bd39295f82108
refs/heads/master
2023-07-27T21:37:09.162152
2021-08-31T02:52:25
2021-08-31T02:52:25
287,991,803
1
0
null
null
null
null
UTF-8
Java
false
false
3,124
java
package com.example.batchprocessing.config; import com.example.batchprocessing.model.Person; import com.example.batchprocessing.processor.PersonItemProcessor; import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; import org.springframework.batch.core.launch.support.RunIdIncrementer; import org.springframework.batch.item.database.BeanPropertyItemSqlParameterSourceProvider; import org.springframework.batch.item.database.JdbcBatchItemWriter; import org.springframework.batch.item.database.builder.JdbcBatchItemWriterBuilder; import org.springframework.batch.item.file.FlatFileItemReader; import org.springframework.batch.item.file.builder.FlatFileItemReaderBuilder; import org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; import javax.sql.DataSource; @Configuration @EnableBatchProcessing public class BatchConfiguration { @Autowired public JobBuilderFactory jobBuilderFactory; @Autowired public StepBuilderFactory stepBuilderFactory; @Bean public FlatFileItemReader<Person> reader() { return new FlatFileItemReaderBuilder<Person>() .name("personItemReader") .resource(new ClassPathResource("sample-data.csv")) .delimited() .names(new String[]{"firstName", "lastName"}) .fieldSetMapper(new BeanWrapperFieldSetMapper<Person>() {{ setTargetType(Person.class); }}) .build(); } @Bean public PersonItemProcessor processor() { return new PersonItemProcessor(); } @Bean public JdbcBatchItemWriter<Person> writer(DataSource dataSource) { return new JdbcBatchItemWriterBuilder<Person>() .itemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider<>()) .sql("INSERT INTO people (first_name, last_name) VALUES (:firstName, :lastName)") .dataSource(dataSource) .build(); } @Bean public Job importUserJob(JobCompletionNotificationListener listener, Step step1) { return jobBuilderFactory.get("importUserJob") .incrementer(new RunIdIncrementer()) .listener(listener) .flow(step1) .end() .build(); } @Bean public Step step1(JdbcBatchItemWriter<Person> writer) { return stepBuilderFactory.get("step1") .<Person, Person> chunk(10) .reader(reader()) .processor(processor()) .writer(writer) .build(); } }
[ "matheuscf.redfield@gmail.com" ]
matheuscf.redfield@gmail.com
3a120d06416d6705f614f2662cbc2d7e35ecae23
3e62b91c49a99263ffd069c3055e3c554419c1f2
/generics/LimitsOfInference.java
e24f676ba770e4a70211cdf57e6de319f75ccc3e
[]
no_license
rechade/TIJ
7acc692efba11ac5b80a6e259ed3b16a2d23a095
cdd7c0f968a0f339bee66cbc9e11b5c3f99141b5
refs/heads/master
2021-01-23T06:44:16.578186
2015-01-20T07:07:50
2015-01-20T07:07:50
28,683,727
0
0
null
null
null
null
UTF-8
Java
false
false
269
java
//: generics/LimitsOfInference.java import typeinfo.pets.*; import java.util.*; public class LimitsOfInference { static void f(Map<Person, List<? extends Pet>> petPeople) {} public static void main(String[] args) { // f(New.map()); // Does not compile } } ///:~
[ "swPf4JsBz3N1AgUuvgsk" ]
swPf4JsBz3N1AgUuvgsk
dbf7f1e4737d2f66a2ead5a966bd75a13778bff1
4be1c88485693f4c923aebaf08d383166b784daf
/src/main/java/ua/goit/services/OrderService.java
ce381faf477ad2153b3ec0418bb1f28aa420e217
[]
no_license
anna-chepiga/restaurant-taivas
8f809f9585b38169a2bf4541b7c5a35db6391fd4
1ae06f3b42f5b8f28db8aa255f3c90316498ce55
refs/heads/master
2021-01-13T11:08:54.652465
2017-01-24T10:57:08
2017-01-24T10:57:08
77,371,327
0
0
null
null
null
null
UTF-8
Java
false
false
2,493
java
package ua.goit.services; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; import ua.goit.dao.EmployeeDao; import ua.goit.dao.OrderDao; import ua.goit.domain.CookedDish; import ua.goit.domain.Employee; import ua.goit.domain.Orders; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; public class OrderService { private OrderDao orderDao; private EmployeeDao employeeDao; @Transactional public Set<Orders> getAllOrders() { return orderDao.getAll(); } @Transactional public Set<Orders> filterOrdersByDate(Date date) { if (date == null) throw new RuntimeException("Cannot use null date"); return orderDao.filterByDate(date); } @Transactional public Set<Orders> filterOrdersByWaiter(Long employeeId) { if (employeeId < 0) throw new RuntimeException("Cannot use null/empty name"); Employee employee = employeeDao.findById(employeeId); return orderDao.filterByWaiter(employee); } @Transactional public Set<Orders> filterByTableNumber(Integer tableNumber) { if (tableNumber <= 0) throw new RuntimeException("Table number cannot be zero or negative"); return orderDao.filterByTableNumber(tableNumber); } @Transactional public void addNewOrder(String waiterName, int tableNumber, Date date, List<CookedDish> dishes) { if (StringUtils.isEmpty(waiterName) || tableNumber <= 0 || date == null || dishes == null) throw new RuntimeException("Cannot use null values"); Employee waiter = employeeDao.findByName(waiterName); java.sql.Date orderDate = new java.sql.Date(date.getTime()); Orders order = new Orders(waiter, tableNumber, orderDate, dishes); orderDao.add(order); } @Transactional public Set<Integer> getAllTableNumbers() { List<Integer> allTableNumbers = orderDao.getAll() .stream() .map(Orders::getTableNumber) .collect(Collectors.toList()); return new HashSet<>(allTableNumbers); } @Transactional public Orders loadOrderById(long id) { return orderDao.loadById(id); } public void setOrderDao(OrderDao orderDao) { this.orderDao = orderDao; } public void setEmployeeDao(EmployeeDao employeeDao) { this.employeeDao = employeeDao; } }
[ "anna.chepiga@list.ru" ]
anna.chepiga@list.ru
89edfddd6ab008188e20bc967247f894ebaf583f
d60e287543a95a20350c2caeabafbec517cabe75
/NLPCCd/Hadoop/9020_2.java
3ef7552dfcd31118ccee43aa736ae595ba1474a3
[ "MIT" ]
permissive
sgholamian/log-aware-clone-detection
242067df2db6fd056f8d917cfbc143615c558b2c
9993cb081c420413c231d1807bfff342c39aa69a
refs/heads/main
2023-07-20T09:32:19.757643
2021-08-27T15:02:50
2021-08-27T15:02:50
337,837,827
0
0
null
null
null
null
UTF-8
Java
false
false
397
java
//,temp,sample_6344.java,2,9,temp,sample_1608.java,2,11 //,3 public class xxx { private boolean removeResourceFromCacheFileSystem(Path path) throws IOException { Path renamedPath = new Path(path.toString() + RENAMED_SUFFIX); if (fs.rename(path, renamedPath)) { return fs.delete(renamedPath, true); } else { log.info("we were not able to rename the directory to we will leave it intact"); } } };
[ "sgholami@uwaterloo.ca" ]
sgholami@uwaterloo.ca
85df493a2d6b0c96eaa1c63327c8d0b721f69c5a
3f3c51248f812750a702e3349bcb29653942a886
/spring-context/src/main/java/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.java
b295ff59f7ec8650f2c1084af7a94e46c6457477
[ "Apache-2.0" ]
permissive
sniper602/spring-framework-4.1
f17b05f36b640ab1beee38d75c3a8098e0168827
6628bade53173075024bd1104ce1f04743cd69c4
refs/heads/master
2020-09-12T06:56:36.349853
2018-11-24T02:53:14
2018-11-24T02:53:14
222,347,493
1
0
null
2019-11-18T02:31:24
2019-11-18T02:31:24
null
UTF-8
Java
false
false
15,896
java
/* * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.context.annotation; import java.util.LinkedHashSet; import java.util.Set; import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionDefaults; import org.springframework.beans.factory.support.BeanDefinitionReaderUtils; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.BeanNameGenerator; import org.springframework.core.env.Environment; import org.springframework.core.env.EnvironmentCapable; import org.springframework.core.env.StandardEnvironment; import org.springframework.core.io.ResourceLoader; import org.springframework.util.Assert; import org.springframework.util.PatternMatchUtils; /** * A bean definition scanner that detects bean candidates on the classpath, * registering corresponding bean definitions with a given registry ({@code BeanFactory} * or {@code ApplicationContext}). * * <p>Candidate classes are detected through configurable type filters. The * default filters include classes that are annotated with Spring's * {@link org.springframework.stereotype.Component @Component}, * {@link org.springframework.stereotype.Repository @Repository}, * {@link org.springframework.stereotype.Service @Service}, or * {@link org.springframework.stereotype.Controller @Controller} stereotype. * * <p>Also supports Java EE 6's {@link javax.annotation.ManagedBean} and * JSR-330's {@link javax.inject.Named} annotations, if available. * * @author Mark Fisher * @author Juergen Hoeller * @author Chris Beams * @since 2.5 * @see AnnotationConfigApplicationContext#scan * @see org.springframework.stereotype.Component * @see org.springframework.stereotype.Repository * @see org.springframework.stereotype.Service * @see org.springframework.stereotype.Controller */ public class ClassPathBeanDefinitionScanner extends ClassPathScanningCandidateComponentProvider { private final BeanDefinitionRegistry registry; private BeanDefinitionDefaults beanDefinitionDefaults = new BeanDefinitionDefaults(); private String[] autowireCandidatePatterns; private BeanNameGenerator beanNameGenerator = new AnnotationBeanNameGenerator(); private ScopeMetadataResolver scopeMetadataResolver = new AnnotationScopeMetadataResolver(); private boolean includeAnnotationConfig = true; /** * Create a new {@code ClassPathBeanDefinitionScanner} for the given bean factory. * @param registry the {@code BeanFactory} to load bean definitions into, in the form * of a {@code BeanDefinitionRegistry} */ public ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry) { this(registry, true); } /** * Create a new {@code ClassPathBeanDefinitionScanner} for the given bean factory. * <p>If the passed-in bean factory does not only implement the * {@code BeanDefinitionRegistry} interface but also the {@code ResourceLoader} * interface, it will be used as default {@code ResourceLoader} as well. This will * usually be the case for {@link org.springframework.context.ApplicationContext} * implementations. * <p>If given a plain {@code BeanDefinitionRegistry}, the default {@code ResourceLoader} * will be a {@link org.springframework.core.io.support.PathMatchingResourcePatternResolver}. * <p>If the the passed-in bean factory also implements {@link EnvironmentCapable} its * environment will be used by this reader. Otherwise, the reader will initialize and * use a {@link org.springframework.core.env.StandardEnvironment}. All * {@code ApplicationContext} implementations are {@code EnvironmentCapable}, while * normal {@code BeanFactory} implementations are not. * @param registry the {@code BeanFactory} to load bean definitions into, in the form * of a {@code BeanDefinitionRegistry} * @param useDefaultFilters whether to include the default filters for the * {@link org.springframework.stereotype.Component @Component}, * {@link org.springframework.stereotype.Repository @Repository}, * {@link org.springframework.stereotype.Service @Service}, and * {@link org.springframework.stereotype.Controller @Controller} stereotype * annotations. * @see #setResourceLoader * @see #setEnvironment */ public ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry, boolean useDefaultFilters) { this(registry, useDefaultFilters, getOrCreateEnvironment(registry)); } /** * Create a new {@code ClassPathBeanDefinitionScanner} for the given bean factory and * using the given {@link Environment} when evaluating bean definition profile metadata. * <p>If the passed-in bean factory does not only implement the {@code * BeanDefinitionRegistry} interface but also the {@link ResourceLoader} interface, it * will be used as default {@code ResourceLoader} as well. This will usually be the * case for {@link org.springframework.context.ApplicationContext} implementations. * <p>If given a plain {@code BeanDefinitionRegistry}, the default {@code ResourceLoader} * will be a {@link org.springframework.core.io.support.PathMatchingResourcePatternResolver}. * @param registry the {@code BeanFactory} to load bean definitions into, in the form * of a {@code BeanDefinitionRegistry} * @param useDefaultFilters whether to include the default filters for the * @param environment the Spring {@link Environment} to use when evaluating bean * definition profile metadata. * {@link org.springframework.stereotype.Component @Component}, * {@link org.springframework.stereotype.Repository @Repository}, * {@link org.springframework.stereotype.Service @Service}, and * {@link org.springframework.stereotype.Controller @Controller} stereotype * annotations. * @since 3.1 * @see #setResourceLoader */ public ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry, boolean useDefaultFilters, Environment environment) { super(useDefaultFilters, environment); Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); this.registry = registry; // Determine ResourceLoader to use. if (this.registry instanceof ResourceLoader) { setResourceLoader((ResourceLoader) this.registry); } } /** * Return the BeanDefinitionRegistry that this scanner operates on. */ public final BeanDefinitionRegistry getRegistry() { return this.registry; } /** * Set the defaults to use for detected beans. * @see BeanDefinitionDefaults */ public void setBeanDefinitionDefaults(BeanDefinitionDefaults beanDefinitionDefaults) { this.beanDefinitionDefaults = (beanDefinitionDefaults != null ? beanDefinitionDefaults : new BeanDefinitionDefaults()); } /** * Return the defaults to use for detected beans (never {@code null}). * @since 4.1 */ public BeanDefinitionDefaults getBeanDefinitionDefaults() { return this.beanDefinitionDefaults; } /** * Set the name-matching patterns for determining autowire candidates. * @param autowireCandidatePatterns the patterns to match against */ public void setAutowireCandidatePatterns(String... autowireCandidatePatterns) { this.autowireCandidatePatterns = autowireCandidatePatterns; } /** * Set the BeanNameGenerator to use for detected bean classes. * <p>Default is a {@link AnnotationBeanNameGenerator}. */ public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) { this.beanNameGenerator = (beanNameGenerator != null ? beanNameGenerator : new AnnotationBeanNameGenerator()); } /** * Set the ScopeMetadataResolver to use for detected bean classes. * Note that this will override any custom "scopedProxyMode" setting. * <p>The default is an {@link AnnotationScopeMetadataResolver}. * @see #setScopedProxyMode */ public void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver) { this.scopeMetadataResolver = (scopeMetadataResolver != null ? scopeMetadataResolver : new AnnotationScopeMetadataResolver()); } /** * Specify the proxy behavior for non-singleton scoped beans. * Note that this will override any custom "scopeMetadataResolver" setting. * <p>The default is {@link ScopedProxyMode#NO}. * @see #setScopeMetadataResolver */ public void setScopedProxyMode(ScopedProxyMode scopedProxyMode) { this.scopeMetadataResolver = new AnnotationScopeMetadataResolver(scopedProxyMode); } /** * Specify whether to register annotation config post-processors. * <p>The default is to register the post-processors. Turn this off * to be able to ignore the annotations or to process them differently. */ public void setIncludeAnnotationConfig(boolean includeAnnotationConfig) { this.includeAnnotationConfig = includeAnnotationConfig; } /** * Perform a scan within the specified base packages. * @param basePackages the packages to check for annotated classes * @return number of beans registered */ public int scan(String... basePackages) { int beanCountAtScanStart = this.registry.getBeanDefinitionCount(); doScan(basePackages); // Register annotation config processors, if necessary. if (this.includeAnnotationConfig) { AnnotationConfigUtils.registerAnnotationConfigProcessors(this.registry); } return (this.registry.getBeanDefinitionCount() - beanCountAtScanStart); } /** * 扫描所有basePackages下注解 * Perform a scan within the specified base packages, * returning the registered bean definitions. * <p>This method does <i>not</i> register an annotation config processor * but rather leaves this up to the caller. * @param basePackages the packages to check for annotated classes * @return set of beans registered if any for tooling registration purposes (never {@code null}) */ protected Set<BeanDefinitionHolder> doScan(String... basePackages) { Assert.notEmpty(basePackages, "At least one base package must be specified"); Set<BeanDefinitionHolder> beanDefinitions = new LinkedHashSet<BeanDefinitionHolder>(); for (String basePackage : basePackages) { Set<BeanDefinition> candidates = findCandidateComponents(basePackage); for (BeanDefinition candidate : candidates) { ScopeMetadata scopeMetadata = this.scopeMetadataResolver.resolveScopeMetadata(candidate); candidate.setScope(scopeMetadata.getScopeName()); String beanName = this.beanNameGenerator.generateBeanName(candidate, this.registry); if (candidate instanceof AbstractBeanDefinition) { postProcessBeanDefinition((AbstractBeanDefinition) candidate, beanName); } if (candidate instanceof AnnotatedBeanDefinition) { AnnotationConfigUtils.processCommonDefinitionAnnotations((AnnotatedBeanDefinition) candidate); } if (checkCandidate(beanName, candidate)) { BeanDefinitionHolder definitionHolder = new BeanDefinitionHolder(candidate, beanName); definitionHolder = AnnotationConfigUtils.applyScopedProxyMode(scopeMetadata, definitionHolder, this.registry); beanDefinitions.add(definitionHolder); registerBeanDefinition(definitionHolder, this.registry); } } } return beanDefinitions; } /** * Apply further settings to the given bean definition, * beyond the contents retrieved from scanning the component class. * @param beanDefinition the scanned bean definition * @param beanName the generated bean name for the given bean */ protected void postProcessBeanDefinition(AbstractBeanDefinition beanDefinition, String beanName) { beanDefinition.applyDefaults(this.beanDefinitionDefaults); if (this.autowireCandidatePatterns != null) { beanDefinition.setAutowireCandidate(PatternMatchUtils.simpleMatch(this.autowireCandidatePatterns, beanName)); } } /** * Register the specified bean with the given registry. * <p>Can be overridden in subclasses, e.g. to adapt the registration * process or to register further bean definitions for each scanned bean. * @param definitionHolder the bean definition plus bean name for the bean * @param registry the BeanDefinitionRegistry to register the bean with */ protected void registerBeanDefinition(BeanDefinitionHolder definitionHolder, BeanDefinitionRegistry registry) { BeanDefinitionReaderUtils.registerBeanDefinition(definitionHolder, registry); } /** * Check the given candidate's bean name, determining whether the corresponding * bean definition needs to be registered or conflicts with an existing definition. * @param beanName the suggested name for the bean * @param beanDefinition the corresponding bean definition * @return {@code true} if the bean can be registered as-is; * {@code false} if it should be skipped because there is an * existing, compatible bean definition for the specified name * @throws ConflictingBeanDefinitionException if an existing, incompatible * bean definition has been found for the specified name */ protected boolean checkCandidate(String beanName, BeanDefinition beanDefinition) throws IllegalStateException { if (!this.registry.containsBeanDefinition(beanName)) { return true; } BeanDefinition existingDef = this.registry.getBeanDefinition(beanName); BeanDefinition originatingDef = existingDef.getOriginatingBeanDefinition(); if (originatingDef != null) { existingDef = originatingDef; } if (isCompatible(beanDefinition, existingDef)) { return false; } throw new ConflictingBeanDefinitionException("Annotation-specified bean name '" + beanName + "' for bean class [" + beanDefinition.getBeanClassName() + "] conflicts with existing, " + "non-compatible bean definition of same name and class [" + existingDef.getBeanClassName() + "]"); } /** * Determine whether the given new bean definition is compatible with * the given existing bean definition. * <p>The default implementation considers them as compatible when the existing * bean definition comes from the same source or from a non-scanning source. * @param newDefinition the new bean definition, originated from scanning * @param existingDefinition the existing bean definition, potentially an * explicitly defined one or a previously generated one from scanning * @return whether the definitions are considered as compatible, with the * new definition to be skipped in favor of the existing definition */ protected boolean isCompatible(BeanDefinition newDefinition, BeanDefinition existingDefinition) { return (!(existingDefinition instanceof ScannedGenericBeanDefinition) || // explicitly registered overriding bean newDefinition.getSource().equals(existingDefinition.getSource()) || // scanned same file twice newDefinition.equals(existingDefinition)); // scanned equivalent class twice } /** * Get the Environment from the given registry if possible, otherwise return a new * StandardEnvironment. */ private static Environment getOrCreateEnvironment(BeanDefinitionRegistry registry) { Assert.notNull(registry, "BeanDefinitionRegistry must not be null"); if (registry instanceof EnvironmentCapable) { return ((EnvironmentCapable) registry).getEnvironment(); } return new StandardEnvironment(); } }
[ "yemuyu240@163.com" ]
yemuyu240@163.com
d42a497ea82401963952d4ecc643eab9ef0fcf93
b2afc10d503f6ee13f8f64950bee3a62b2bda72e
/JavaPractice/src/com/sparo/test/TestSort.java
ece95bd73c2869e9d0785f8788e9f8019ba83ca6
[ "Apache-2.0" ]
permissive
SparoJ/mathLogic
b6b08cce53d589578f1085b383d4da6634bc6d18
7463f6d5cf42c9c6ac8f8cb73224432f162b67f7
refs/heads/master
2021-07-12T11:24:20.845374
2020-08-18T02:33:35
2020-08-18T02:33:35
197,221,824
0
0
Apache-2.0
2020-08-18T01:56:18
2019-07-16T15:38:03
Java
UTF-8
Java
false
false
4,496
java
package com.sparo.test; import com.sparo.util.Utils; /** * description: * Created by sdh on 2020-07-23 */ public class TestSort { public static void main(String[] args) { // 手写快排测试 int[] arr = {3, 2, 1, 7 , 4, 3, 9, 10, 2 , 3, 1, 5, 0, 8}; // heapSort(arr); // quickSort(arr, 0, arr.length-1); dualPivotQuickSort(arr, 0, arr.length-1); Utils.printIntArray(arr); } public static void dualPivotQuickSort(int[] items, int start, int end) { if (start < end) { if (items[start] > items[end]) { swap(items, start, end); } int pivot1 = items[start], pivot2 = items[end]; int i = start, j = end, k = start + 1; OUT_LOOP: while (k < j) { if (items[k] < pivot1) { System.out.println("ii->" + i + "->kk->" + k); swap(items, ++i, k++); System.out.println("i->" + items[i] + "->k->" + items[k]); } else if (items[k] <= pivot2) { k++; } else { while (items[--j] > pivot2) { if (j <= k) { // 扫描终止 break OUT_LOOP; } } if (items[j] < pivot1) { swap(items, j, k); swap(items, ++i, k); } else { swap(items, j, k); } k++; } } swap(items, start, i); swap(items, end, j); dualPivotQuickSort(items, start, i - 1); dualPivotQuickSort(items, i + 1, j - 1); dualPivotQuickSort(items, j + 1, end); } } public int[] partition(int[] array,int left,int right){ int v = array[right]; //选择右边界为基准 int less = left - 1; // < v 部分的最后一个数 int more = right + 1; // > v 部分的第一个数 int cur = left; while(cur < more){ if(array[cur] < v){ swap(array,++less,cur++); }else if(array[cur] > v){ swap(array,--more,cur); }else{ cur++; } } return new int[]{less + 1,more - 1}; //返回的是 = v 区域的左右下标 } // private void swap(int[] arr, int i, int j) { // int temp = arr[i]; // arr[i] = arr[j]; // arr[j] = temp; // } private static void quickSort(int[] arr, int left, int right) { if(left>=right) return; int index = partion(arr, left, right); quickSort(arr, left, index-1); quickSort(arr, index+1, right); } private static int partion(int[] arr, int left, int right) { int pivotVal = arr[left]; while(left<right) { while(left<right && arr[right]>=pivotVal) { right--; } if(left<right) { arr[left] = arr[right]; left++; } while(left<right && arr[left]<=pivotVal) { left++; } if(left<right) { arr[right] = arr[left]; right--; } } arr[left] = pivotVal; return left; } private static void heapSort(int[] arr) { //heapify int lastIndex = arr.length-1; for(int i = (lastIndex-1)/2; i>=0; i--) { shiftDown(arr, i, lastIndex); } //sort while(lastIndex>=0) { swap(arr, 0, lastIndex); lastIndex--; //shiftDown shiftDown(arr, 0, lastIndex); } } private static void shiftDown(int[] arr, int shiftIndex, int endIndex) { int leftChildIndex = 2*shiftIndex+1; while(leftChildIndex<=endIndex) { if(leftChildIndex+1<=endIndex && arr[leftChildIndex]<arr[leftChildIndex+1]) { leftChildIndex++; } if(arr[shiftIndex]>=arr[leftChildIndex]) break; swap(arr, shiftIndex, leftChildIndex); shiftIndex = leftChildIndex; leftChildIndex = 2*leftChildIndex+1; } } private static void swap(int[] arr, int i, int j) { int temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } }
[ "sdhchn@gmail.com" ]
sdhchn@gmail.com
07be21cb574fd567683900b4f49371b85cf09b25
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/sonarqube/2018/12/EventComponentChangeDao.java
7b209d74f7c161966fb77c1204c462887e6a6c3e
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
1,921
java
/* * SonarQube * Copyright (C) 2009-2018 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.db.event; import java.util.List; import org.sonar.api.utils.System2; import org.sonar.db.Dao; import org.sonar.db.DbSession; import static org.sonar.db.DatabaseUtils.executeLargeInputs; public class EventComponentChangeDao implements Dao { private final System2 system2; public EventComponentChangeDao(System2 system2) { this.system2 = system2; } public List<EventComponentChangeDto> selectByEventUuid(DbSession dbSession, String eventUuid) { return getMapper(dbSession).selectByEventUuid(eventUuid); } public List<EventComponentChangeDto> selectByAnalysisUuids(DbSession dbSession, List<String> analyses) { return executeLargeInputs(analyses, getMapper(dbSession)::selectByAnalysisUuids); } public void insert(DbSession dbSession, EventComponentChangeDto dto, EventPurgeData eventPurgeData) { getMapper(dbSession) .insert(dto, eventPurgeData, system2.now()); } private static EventComponentChangeMapper getMapper(DbSession dbSession) { return dbSession.getMapper(EventComponentChangeMapper.class); } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
8744171f0a5e364767d917726ecd8477f94ca657
0c6389ad24bf720e6f5ff29ff13cbb849616538b
/app/src/main/java/com/niceweather/util/HttpCallbackListener.java
999b8fb58ce9599b7a9760f311b02466da3ba706
[ "Apache-2.0" ]
permissive
lb377463323/niceweather
060cd59262e30eea6a7f4ba73734cbe374b7b4f9
c8966076aebba6223324a1f082e4057dbbee99ee
refs/heads/master
2020-06-08T09:35:30.819261
2015-08-06T05:04:05
2015-08-06T05:04:05
40,100,613
0
0
null
null
null
null
UTF-8
Java
false
false
190
java
package com.niceweather.util; /** * Created by Administrator on 2015/8/4. */ public interface HttpCallbackListener { void onFinish(String response); void onError(Exception e); }
[ "377463323@qq.com" ]
377463323@qq.com
51e5aad6b710efde9e0102dbd4a9c79283980a88
b61c0384b67fb1a5c48630ba44a9e7e8ce410b59
/society-work/springboot/springboot-dataSources-master/src/main/java/com/deng/Application.java
7877122d99fc55befd0f897c29938d34affa5bc1
[]
no_license
zhihuihu/svn-old-project
2fc8a33eca8ac685151ef48e2249a7a3ad34cd72
13de6b664c1001155611bc22c181a2f3b5a20d30
refs/heads/master
2021-04-30T14:04:25.929881
2018-03-02T02:54:15
2018-03-02T02:54:15
121,209,439
0
0
null
null
null
null
UTF-8
Java
false
false
463
java
package com.deng; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import java.net.UnknownHostException; @SpringBootApplication @EnableAutoConfiguration public class Application { public static void main(String[] args) throws UnknownHostException { SpringApplication.run(Application.class, args); } }
[ "huzhihui_c@qq.com" ]
huzhihui_c@qq.com
0175144b9d89988a7407fcccee47c6d7b6ae04e8
552f9c5f59bf8ea607f996595f77d9321ca917ea
/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/osm/yang/mano/types/rev170208/config/file/ConfigFileBuilder.java
8052375c854c178d1beee749f61cb4cb52c15cf1
[]
no_license
openslice/io.openslice.sol005nbi.osm7
9bba3c8b830b300b58606fe56a0a47d2bf522ead
3f46220606181625f24d0d7ef5afaa1998f70d86
refs/heads/master
2021-08-26T07:41:16.213883
2020-06-15T15:51:07
2020-06-15T15:51:07
247,079,115
0
0
null
2021-08-02T17:21:09
2020-03-13T13:35:51
Java
UTF-8
Java
false
false
7,657
java
package org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.mano.types.rev170208.config.file; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableMap; import java.lang.Class; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.Augmentation; import org.opendaylight.yangtools.yang.binding.AugmentationHolder; import org.opendaylight.yangtools.yang.binding.CodeHelpers; import org.opendaylight.yangtools.yang.binding.DataObject; /** * Class that builds {@link ConfigFileBuilder} instances. * * @see ConfigFileBuilder * */ public class ConfigFileBuilder implements Builder<ConfigFile> { private String _dest; private String _source; private ConfigFileKey key; Map<Class<? extends Augmentation<ConfigFile>>, Augmentation<ConfigFile>> augmentation = Collections.emptyMap(); public ConfigFileBuilder() { } public ConfigFileBuilder(ConfigFile base) { this.key = base.key(); this._source = base.getSource(); this._dest = base.getDest(); if (base instanceof ConfigFileImpl) { ConfigFileImpl impl = (ConfigFileImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") Map<Class<? extends Augmentation<ConfigFile>>, Augmentation<ConfigFile>> aug =((AugmentationHolder<ConfigFile>) base).augmentations(); if (!aug.isEmpty()) { this.augmentation = new HashMap<>(aug); } } } public ConfigFileKey key() { return key; } public String getDest() { return _dest; } public String getSource() { return _source; } @SuppressWarnings("unchecked") public <E extends Augmentation<ConfigFile>> E augmentation(Class<E> augmentationType) { return (E) augmentation.get(CodeHelpers.nonNullValue(augmentationType, "augmentationType")); } public ConfigFileBuilder withKey(final ConfigFileKey key) { this.key = key; return this; } public ConfigFileBuilder setDest(final String value) { this._dest = value; return this; } public ConfigFileBuilder setSource(final String value) { this._source = value; return this; } public ConfigFileBuilder addAugmentation(Class<? extends Augmentation<ConfigFile>> augmentationType, Augmentation<ConfigFile> augmentationValue) { if (augmentationValue == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentationValue); return this; } public ConfigFileBuilder removeAugmentation(Class<? extends Augmentation<ConfigFile>> augmentationType) { if (this.augmentation instanceof HashMap) { this.augmentation.remove(augmentationType); } return this; } @Override public ConfigFile build() { return new ConfigFileImpl(this); } private static final class ConfigFileImpl implements ConfigFile { private final String _dest; private final String _source; private final ConfigFileKey key; private Map<Class<? extends Augmentation<ConfigFile>>, Augmentation<ConfigFile>> augmentation = Collections.emptyMap(); ConfigFileImpl(ConfigFileBuilder base) { if (base.key() != null) { this.key = base.key(); } else { this.key = new ConfigFileKey(base.getSource()); } this._source = key.getSource(); this._dest = base.getDest(); this.augmentation = ImmutableMap.copyOf(base.augmentation); } @Override public Class<ConfigFile> getImplementedInterface() { return ConfigFile.class; } @Override public ConfigFileKey key() { return key; } @Override public String getDest() { return _dest; } @Override public String getSource() { return _source; } @SuppressWarnings("unchecked") @Override public <E extends Augmentation<ConfigFile>> E augmentation(Class<E> augmentationType) { return (E) augmentation.get(CodeHelpers.nonNullValue(augmentationType, "augmentationType")); } private int hash = 0; private volatile boolean hashValid = false; @Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + Objects.hashCode(_dest); result = prime * result + Objects.hashCode(_source); result = prime * result + Objects.hashCode(augmentation); hash = result; hashValid = true; return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DataObject)) { return false; } if (!ConfigFile.class.equals(((DataObject)obj).getImplementedInterface())) { return false; } ConfigFile other = (ConfigFile)obj; if (!Objects.equals(_dest, other.getDest())) { return false; } if (!Objects.equals(_source, other.getSource())) { return false; } if (getClass() == obj.getClass()) { // Simple case: we are comparing against self ConfigFileImpl otherImpl = (ConfigFileImpl) obj; if (!Objects.equals(augmentation, otherImpl.augmentation)) { return false; } } else { // Hard case: compare our augments with presence there... for (Map.Entry<Class<? extends Augmentation<ConfigFile>>, Augmentation<ConfigFile>> e : augmentation.entrySet()) { if (!e.getValue().equals(other.augmentation(e.getKey()))) { return false; } } // .. and give the other one the chance to do the same if (!obj.equals(this)) { return false; } } return true; } @Override public String toString() { final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ConfigFile"); CodeHelpers.appendValue(helper, "_dest", _dest); CodeHelpers.appendValue(helper, "_source", _source); CodeHelpers.appendValue(helper, "augmentation", augmentation.values()); return helper.toString(); } } }
[ "ioannischatzis@gmail.com" ]
ioannischatzis@gmail.com
8354efffb5437b8d5aa87da566ec7af2d675d4df
9be51bdf56249515d29beeed615a945927e714a3
/ControleAgropecuario/src/model/Fazenda.java
ce6afca0ec33748420d0cfe653d33b19579946a1
[]
no_license
emiliavilar/FarmControl
41335c93619eb55598595ebfe79c20487fbb60a9
185f5f1ed8708fd9ddf399a8979d61610ac120bb
refs/heads/master
2020-05-19T18:07:24.637126
2013-11-20T03:23:27
2013-11-20T03:23:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
277
java
package model; import java.util.ArrayList; public class Fazenda { private ArrayList<Res> rezes; public Fazenda(){ this.rezes = new ArrayList<Res>(); } public void addRes(Res res){ rezes.add(res); } public void removeRes(Res res){ rezes.remove(res); } }
[ "emiliaanjos@gmail.com" ]
emiliaanjos@gmail.com
24a9d5609471c47470fb812c7f87b14fef9c6776
5fc850a5ce1751377e042676753adc73acf6e2b3
/src/pl/javapoz25/OOP2/MainOOP2.java
6a9f2c301798c4f5349bf2258b7a988ac451d529
[]
no_license
ddulba/OOP
d871b1f66184d90f040b215417ee78f8e3a280ad
667c939297b778931ac9d071b79976a6c5a42247
refs/heads/master
2022-09-23T09:29:29.001180
2020-05-23T12:15:39
2020-05-23T12:15:39
266,299,301
0
0
null
null
null
null
UTF-8
Java
false
false
858
java
package pl.javapoz25.OOP2; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class MainOOP2 { public static void main(String[] args) { List<Cat> cat = new ArrayList<>(); Cat cat1 = new Cat("Kitka"); Cat cat2 = new Cat("Filemon"); Cat cat3 = new Cat("Mruczek"); Cat cat4 = new Cat("Rudy"); Set<Cat> cats = new HashSet<>(); cats.add(cat1); cats.add(cat2); cats.add(cat3); cats.add(cat4); for (Cat newCats : cats) { newCats.makeSound(); // newCats.eatMouse(); } Dog dog1 = new Dog("Rico"); dog1.makeSound(); List<Animal> animals = new ArrayList<>(); for (Animal newAnimals : animals) { newAnimals.makeSound(); } } }
[ "darek.dulba@gmail.com" ]
darek.dulba@gmail.com
4cbbbddbcfe0a8449af05d56fd9ba796d5471c62
02ff8fc319a7d2db15d025bac9d033d682731bc6
/timecheat-core/src/main/java/be/cegeka/core/mijnpersoneelsdossier/pages/MijnPersoneelsDossierPriktijdenOverzichtPagina.java
22aa2ba2d3442a218f93cb82cb3dae5dc9db5c0c
[]
no_license
nielsjani/timecheat
389a2d1753c0ce0b393246f0da09aa456906de34
9c647bbb1fdcaf7601241c4bf6bf7e21f6f49a38
refs/heads/master
2021-01-19T03:24:45.212114
2016-07-22T14:04:19
2016-07-22T14:04:19
63,041,233
0
0
null
null
null
null
UTF-8
Java
false
false
1,152
java
package be.cegeka.core.mijnpersoneelsdossier.pages; import com.codeborne.selenide.SelenideElement; import java.util.List; import java.util.stream.Collectors; import static com.codeborne.selenide.Selenide.$; public class MijnPersoneelsDossierPriktijdenOverzichtPagina extends MijnPersoneelsDossierIngelogdPagina { @Override protected SelenideElement pageIdentifier() { return $("#DecOvRegTit"); } public List<Werkdag> getPriktijden() { return $("#TabDetail").$$("tr").stream() .map(this::mapRow) .filter(werkdag -> werkdag != null) .collect(Collectors.toList()); } private Werkdag mapRow(SelenideElement row) { String datum = row.$("#DecOvRegDatum").getText(); if(datum == null || datum.equals("") ||datum.equals("Weektotaal")){ return null; } String timeWorked = isFeestdag(row) ? "0:00" : row.$("#DecOvRegTotaal").getText(); return new Werkdag(datum, timeWorked); } private boolean isFeestdag(SelenideElement row) { return row.$("#DecOvRegType").getText().contains("Feestdag"); } }
[ "niels.jani@cegeka.be" ]
niels.jani@cegeka.be
a5664ba54ce092864e13d66a093338aab7d88360
b19b019bc8c35fc90dd481ebbc4f1642414d6e54
/src/com/Inheritance/AbstractDemo.java
9aa52b1ed06cb7c251a4a29b1a1659dcb95ae8d2
[]
no_license
rajjumani/JavaPractice-OOP-
a4fa2fa15dccb6ecbae06efc3d6ac4fb421e9be3
92a6f2c0aa252dd7482aa2565da8e9d4182e55e2
refs/heads/master
2020-06-03T19:35:34.372761
2019-06-13T06:32:52
2019-06-13T06:32:52
191,704,642
0
0
null
null
null
null
UTF-8
Java
false
false
785
java
package com.Inheritance; public abstract class AbstractDemo { public void test() { System.out.println("in test method.."); } public AbstractDemo() { System.out.println("in default constructor of demo class.."); } public abstract void sayHello(); public static void main(String[] args) { // TODO Auto-generated method stub AbstractDemo abstractDemo = new AbstractDemo() { @Override public void test() { // TODO Auto-generated method stub System.out.println("in virtual subclass test method.."); super.test(); } @Override public void sayHello() { // TODO Auto-generated method stub System.out.println("hello"); } }; abstractDemo.sayHello(); abstractDemo.test(); } }
[ "Raj Jumani@10.1.246.207" ]
Raj Jumani@10.1.246.207
bb84e14f05cd25a9e8cb2be93c40bf10ca941193
1a8874a11675ad306b11779300c49478a456cf03
/structure_of_java/oops/javadoc_tool/api_documentation/main_class/Student.java
a052110d7f327cf5c17fc6a96a0ee251af4d1db8
[]
no_license
riKHOKON/java_resources
050d11c02a2eb94befb576a72ce6b56e86b942b9
4eeee04b0e6b231d956339a954bdf1ef2b2f7efa
refs/heads/master
2020-05-27T22:40:26.008129
2019-05-27T09:03:00
2019-05-27T09:03:00
188,807,923
0
0
null
null
null
null
UTF-8
Java
false
false
295
java
package structure_of_java.oops.javadoc_tool.api_documentation.main_class; public class Student{ private String name; private int cl; public Student(String name,int c){ this.name=name; this.cl=c; } public String toString(){ return name+"\n"; } }
[ "0120.rashedul@gmail.com" ]
0120.rashedul@gmail.com
9bc29f487cc783381dc0f57262ec50623d73251b
c952204b4c733e409030937beabcf7f3b6606544
/festival-web/src/main/java/cn/bdqfork/web/route/annotation/RouteMapping.java
a432f6696e238104dfb4e46c5f49668046513e31
[ "Apache-2.0" ]
permissive
yangwn/festival
d4913f83ebdcea41f4e85671d083ad06cc9d51b4
093db2ce271b2f2bc061e1ddaa873a27c9d34e5d
refs/heads/master
2022-04-07T11:47:38.173958
2020-02-28T16:39:28
2020-02-28T16:39:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
548
java
package cn.bdqfork.web.route.annotation; import io.vertx.core.http.HttpMethod; import io.vertx.ext.web.handler.TimeoutHandler; import java.lang.annotation.*; /** * 用于将url请求映射到方法 * * @author bdq * @since 2020/1/21 */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD}) public @interface RouteMapping { String value() default ""; HttpMethod method() default HttpMethod.OPTIONS; long timeout() default TimeoutHandler.DEFAULT_TIMEOUT; }
[ "bdqsky@163.com" ]
bdqsky@163.com
ecfa13b69c70e7ac70279d01cd8423f613888b4f
16a0bab4b0b9da6af337b7d969d49c3234416286
/src/code/leetbook/bytedance/str/Multiply.java
615064702523ceadb20fac7c118ba0f7319f932c
[]
no_license
wtlife/leetcode
fe7e3fac96d8afb7d170cac1d557a4b8b6576d64
74c37216bcf83bf669237e312410a70b3e804034
refs/heads/master
2021-05-22T15:11:22.934080
2021-03-06T09:31:51
2021-03-06T09:31:51
252,976,174
0
0
null
null
null
null
UTF-8
Java
false
false
2,503
java
package code.leetbook.bytedance.str; import java.util.ArrayList; import java.util.List; /** * @Desc Multiply * @date 2020/9/10 */ public class Multiply { public String multiply(String num1, String num2) { if (num1.length() > num2.length()) { String tmp = num1; num1 = num2; num2 = tmp; } if (num1.equals("0") || num2.equals("0")) { return "0"; } int resLen = num1.length() + num2.length(); List<String> tmpList = new ArrayList<>(); int idx = 0; for (int i = num1.length() - 1; i >= 0; i--, idx++) { int cur = Character.getNumericValue(num1.charAt(i)); String multiplyTmp = multiplyCur(num2, cur); for (int j = 0; j < idx; j++) { multiplyTmp += "0"; } while (multiplyTmp.length() != resLen) { multiplyTmp = "0" + multiplyTmp; } tmpList.add(multiplyTmp); } String res = add(tmpList); return res; } private String multiplyCur(String num2, int factor) { String res = ""; int prefix = 0; for (int i = num2.length() - 1; i >= 0; i--) { int cur2 = Character.getNumericValue(num2.charAt(i)); int tmp = cur2 * factor; tmp += prefix; prefix = tmp / 10; res = tmp % 10 + res; } if (prefix > 0) { res = prefix + res; } return res; } private String add(List<String> tmpList) { String res = ""; int len = tmpList.get(0).length(); for (int i = 0; i < tmpList.size(); i++) { if (i == 0) { res = tmpList.get(i); continue; } String num1 = res; String num2 = tmpList.get(i); res = ""; int prefix = 0; for (int j = len - 1; j >= 0; j--) { int cur1 = Character.getNumericValue(num1.charAt(j)); int cur2 = Character.getNumericValue(num2.charAt(j)); int sum = cur1 + cur2 + prefix; prefix = sum / 10; res = sum % 10 + res; } if (prefix != 0) { res = prefix / 10 + res; } } int idx = 0; while (Character.getNumericValue(res.charAt(idx)) == 0) { idx++; } return res.substring(idx); } }
[ "wtlife@qq.com" ]
wtlife@qq.com
773dc51b8997bccd3d37d08d9d65c3881a84aa9c
8e2e404276f15870fc1c066ae91f145746d3efd6
/src/com/javaetime/web/tu/ctrl/TuController.java
1fef87b524565a85fb7a23617e81696e05f359c7
[]
no_license
wangpeng2313/fund
9b39ab390f51a96b13cb1b3ad97e0fe5a36083db
b2c404d736bf2deecc4657794518fdc9884400f5
refs/heads/master
2022-06-05T07:43:03.220764
2022-05-28T04:16:29
2022-05-28T04:16:29
67,618,041
2
2
null
null
null
null
UTF-8
Java
false
false
5,868
java
package com.javaetime.web.tu.ctrl; import java.awt.Font; import java.io.IOException; import java.io.OutputStream; import java.sql.SQLException; import java.util.List; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartUtilities; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.data.category.CategoryDataset; import org.jfree.data.category.DefaultCategoryDataset; import com.javaetime.web.tu.service.TuService; import com.javaetime.web.tu.service.TuServiceImpl; @SuppressWarnings("serial") public class TuController extends HttpServlet{ private TuService tuService=new TuServiceImpl(); @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { request.setCharacterEncoding("utf-8"); String method = request.getParameter("method"); if( "zhu".equals(method) ){ this.zhu(request, response); return; }else if( "bing".equals(method) ){ this.bing(request, response); return; } } catch (Exception e) { e.printStackTrace(); } } private void bing(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, ServletException, IOException { System.out.println("---------------------------进入bing()---------------------------"); System.out.println("开始饼状图"); Map<String,Object> map=tuService.queryBing(); request.setAttribute("map", map); request.getRequestDispatcher("views/tu/bing.jsp").forward(request, response); } private void zhu(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, IOException { System.out.println("---------------------------进入zhu()---------------------------"); System.out.println("开始柱状图"); response.setContentType("image/jpeg"); OutputStream out=response.getOutputStream(); CategoryDataset ds=getDateSet(request,response); JFreeChart chart=ChartFactory.createBarChart3D("财务预览图", "月份", "金额", ds, PlotOrientation.VERTICAL, true, false, false); CategoryPlot categoryplot = (CategoryPlot) chart.getPlot(); NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis();//数量范畴 CategoryAxis domainAxis = categoryplot.getDomainAxis();//种类范畴 /*------设置X轴坐标上的文字-----------*/ domainAxis.setTickLabelFont(new Font("sans-serif", Font.PLAIN, 11)); /*------设置X轴的标题文字------------*/ domainAxis.setLabelFont(new Font("宋体", Font.PLAIN, 12)); /*------设置Y轴坐标上的文字-----------*/ numberaxis.setTickLabelFont(new Font("sans-serif", Font.PLAIN, 12)); /*------设置Y轴的标题文字------------*/ numberaxis.setLabelFont(new Font("黑体", Font.PLAIN, 12)); /*------这句代码解决了底部汉字乱码的问题-----------*/ chart.getLegend().setItemFont(new Font("宋体", Font.PLAIN, 12)); /******* 这句代码解决了标题汉字乱码的问题 ********/ chart.getTitle().setFont(new Font("宋体", Font.PLAIN, 12)); try { ChartUtilities.writeChartAsJPEG(out, 0.5f, chart, 900, 600, null); } finally { try { out.close(); } catch (Exception ex) { ex.printStackTrace(); } } } private CategoryDataset getDateSet(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException { DefaultCategoryDataset ds=new DefaultCategoryDataset(); List<String[]> list=tuService.queryzhu(); String[] shouRu=list.get(0); String[] zhiChu=list.get(1); String[] yuSuan=list.get(2); int one_shouRu=Integer.parseInt(shouRu[0])+Integer.parseInt(shouRu[1])+Integer.parseInt(shouRu[2]); int two_shouRu=Integer.parseInt(shouRu[3])+Integer.parseInt(shouRu[4])+Integer.parseInt(shouRu[5]); int three_shouRu=Integer.parseInt(shouRu[6])+Integer.parseInt(shouRu[7])+Integer.parseInt(shouRu[8]); int four_shouRu=Integer.parseInt(shouRu[9])+Integer.parseInt(shouRu[10])+Integer.parseInt(shouRu[11]); int one_zhiChu=Integer.parseInt(zhiChu[0])+Integer.parseInt(zhiChu[1])+Integer.parseInt(zhiChu[2]); int two_zhiChu=Integer.parseInt(zhiChu[3])+Integer.parseInt(zhiChu[4])+Integer.parseInt(zhiChu[5]); int three_zhiChu=Integer.parseInt(zhiChu[6])+Integer.parseInt(zhiChu[7])+Integer.parseInt(zhiChu[8]); int four_zhiChu=Integer.parseInt(zhiChu[9])+Integer.parseInt(zhiChu[10])+Integer.parseInt(zhiChu[11]); int one_yuSuan=Integer.parseInt(yuSuan[0])+Integer.parseInt(yuSuan[1])+Integer.parseInt(yuSuan[2]); int two_yuSuan=Integer.parseInt(yuSuan[3])+Integer.parseInt(yuSuan[4])+Integer.parseInt(yuSuan[5]); int three_yuSuan=Integer.parseInt(yuSuan[6])+Integer.parseInt(yuSuan[7])+Integer.parseInt(yuSuan[8]); int four_yuSuan=Integer.parseInt(yuSuan[9])+Integer.parseInt(yuSuan[10])+Integer.parseInt(yuSuan[11]); ds.addValue(one_yuSuan, "预算", "第一季度"); ds.addValue(one_shouRu, "收入", "第一季度"); ds.addValue(one_zhiChu, "支出", "第一季度"); ds.addValue(two_yuSuan, "预算", "第二季度"); ds.addValue(two_shouRu, "收入", "第二季度"); ds.addValue(two_zhiChu, "支出", "第二季度"); ds.addValue(three_yuSuan, "预算", "第三季度"); ds.addValue(three_shouRu, "收入", "第三季度"); ds.addValue(three_zhiChu, "支出", "第三季度"); ds.addValue(four_yuSuan, "预算", "第四季度"); ds.addValue(four_shouRu, "收入", "第四季度"); ds.addValue(four_zhiChu, "支出", "第四季度"); return ds; } }
[ "wangpeng2313@126.com" ]
wangpeng2313@126.com
af20fb46f1a52107d71f1a5a7cf861c2ae9d4f8b
2612f336d667a087823234daf946f09b40d8ca3d
/plugins/InspectionGadgets/testsrc/com/siyeh/ig/imports/JavaLangImportInspectionTest.java
f7f0e494c84d1505cf251a9f63e3a79d6a7c2d8a
[ "Apache-2.0" ]
permissive
tnorbye/intellij-community
df7f181861fc5c551c02c73df3b00b70ab2dd589
f01cf262fc196bf4dbb99e20cd937dee3705a7b6
refs/heads/master
2021-04-06T06:57:57.974599
2018-03-13T17:37:00
2018-03-13T17:37:00
125,079,130
2
0
Apache-2.0
2018-03-13T16:09:41
2018-03-13T16:09:41
null
UTF-8
Java
false
false
1,539
java
/* * Copyright 2000-2014 JetBrains s.r.o. * * 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.siyeh.ig.imports; import com.intellij.codeInspection.InspectionProfileEntry; import com.siyeh.ig.LightInspectionTestCase; import junit.framework.TestCase; import org.jetbrains.annotations.Nullable; /** * @author Bas Leijdekkers */ public class JavaLangImportInspectionTest extends LightInspectionTestCase { public void testSamePackageConflict() { addEnvironmentClass("package a;" + "class String {}"); doTest("package a;" + "import java.lang.String;" + "class X {{" + " String s;" + "}}"); } public void testSimple() { doTest("package a;" + "/*Unnecessary import from package 'java.lang'*/import java.lang.String;/**/" + "class X {{" + " String s;" + "}}"); } @Nullable @Override protected InspectionProfileEntry getInspection() { return new JavaLangImportInspection(); } }
[ "basleijdekkers@gmail.com" ]
basleijdekkers@gmail.com
d669a85e9c764972a08958e8386a71f9d3099f84
952b94ec77025ac62767f06ae6ff0283932a6651
/board/src/main/java/board/board/controller/BoardController.java
ac8e79807d588ff63ddf8f9b89397138756cd8e8
[]
no_license
kolya4359/springboot
71985574b827f04444c747c61e9a7b1fc9deda1a
e85d59a3c902fcd407ce3aabd9289a77840f8c74
refs/heads/main
2023-08-10T19:29:56.349486
2021-09-14T20:02:00
2021-09-14T20:02:00
406,505,055
0
0
null
null
null
null
UTF-8
Java
false
false
1,857
java
package board.board.controller; import java.util.List; import org.apache.logging.log4j.Logger; import org.mybatis.logging.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import board.board.dto.BoardDto; import board.board.service.*; @Controller public class BoardController { @Autowired private BoardService boardService; @RequestMapping("/board/openBoardList.do") public ModelAndView openBoardList() throws Exception{ ModelAndView mv = new ModelAndView("/board/boardList"); List<BoardDto> list = boardService.selectBoardList(); mv.addObject("list", list); return mv; } @RequestMapping("/board/openBoardWrite.do") public String openBoardWrite() throws Exception{ return "/board/boardWrite"; } @RequestMapping("/board/insertBoard.do") public String insertBoard(BoardDto board) throws Exception{ boardService.insertBoard(board); return "redirect:/board/openBoardList.do"; } @RequestMapping("/board/openBoardDetail.do") public ModelAndView openBoardDetail(@RequestParam int boardIdx) throws Exception{ ModelAndView mv = new ModelAndView("/board/boardDetail"); BoardDto board = boardService.selectBoardDetail(boardIdx); mv.addObject("board", board); return mv; } @RequestMapping("/board/updateBoard.do") public String updateBoard(BoardDto board) throws Exception{ boardService.updateBoard(board); return "redirect:/board/openBoardList.do"; } @RequestMapping("/board/deleteBoard.do") public String deleteBoard(int boardIdx) throws Exception{ boardService.deleteBoard(boardIdx); return "redirect:/board/openBoardList.do"; } }
[ "kolya4359@gmail.com" ]
kolya4359@gmail.com
495848c7f4b7824ac6d6672f4b4b9f69f13d5d1a
3bb05d828c320a65a1092d28be02e5ed9704e8f2
/library/src/main/java/cn/carbs/wricheditor/library/spannables/LinkStyleSpan.java
ae48f35e823203b2dc5736c2141304da5d64f718
[ "Apache-2.0" ]
permissive
GuoEH/WRichEditor-Android
49a8fab3de9ef653c84f95245b0d6680c3db1d6c
1f33a91eeb14b98258f4855f1a92cc964a91d0dc
refs/heads/master
2022-12-05T12:18:32.535238
2020-08-20T02:38:19
2020-08-20T02:38:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,514
java
package cn.carbs.wricheditor.library.spannables; import android.os.Parcel; import android.text.TextPaint; import android.text.style.URLSpan; import cn.carbs.wricheditor.library.interfaces.IRichSpan; import cn.carbs.wricheditor.library.types.RichType; import cn.carbs.wricheditor.library.utils.HtmlUtil; public class LinkStyleSpan extends URLSpan implements IRichSpan { public static final int MASK_SHIFT = 3; public static final int MASK = 0x00000001 << MASK_SHIFT; private int linkColor; private boolean linkUnderline; private RichType type; private String url; public LinkStyleSpan(String url, int linkColor, boolean linkUnderline) { super(url); this.url = url; this.linkColor = linkColor; this.linkUnderline = linkUnderline; type = RichType.LINK; } public LinkStyleSpan(Parcel src) { super(src); this.linkColor = src.readInt(); this.linkUnderline = src.readInt() != 0; } @Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeInt(linkColor); dest.writeInt(linkUnderline ? 1 : 0); } @Override public void updateDrawState(TextPaint ds) { ds.setColor(linkColor != 0 ? linkColor : ds.linkColor); ds.setUnderlineText(linkUnderline); } @Override public RichType getRichType() { return type; } @Override public int getMask() { return MASK; } }
[ "yeah0126@yeah.net" ]
yeah0126@yeah.net
68259088d8a33b7dbd464bc4ae32b180eabf35ae
80deb11465406c5c24f0a2b47e5440b725788023
/src/ca/usask/cs/srlab/simclipse/ui/handler/SimClipseSettingsHandler.java
f41b80d3e788dd6907273b9fa163c4a77025eb2f
[]
no_license
suddin/ca.usask.cs.srlab.simClipse
bc69f912a4556df6d144445f168f18a91ca53592
4585768578024cbcd442c9b8e7e56562e5d48c57
refs/heads/master
2020-05-15T22:17:15.039292
2012-06-01T09:49:24
2012-06-01T09:49:24
3,069,644
0
1
null
null
null
null
UTF-8
Java
false
false
2,665
java
package ca.usask.cs.srlab.simclipse.ui.handler; import java.util.Iterator; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.handlers.HandlerUtil; import ca.usask.cs.srlab.simclipse.SimClipseLog; import ca.usask.cs.srlab.simclipse.SimClipsePlugin; import ca.usask.cs.srlab.simclipse.ui.DetectionSettingsDialog; import ca.usask.cs.srlab.simclipse.ui.view.navigator.INavigatorItem; import ca.usask.cs.srlab.simclipse.ui.view.project.ProjectViewItem; public class SimClipseSettingsHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { // Get the active window IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); if (window == null) return null; // Get the active page IWorkbenchPage page = window.getActivePage(); if (page == null){ SimClipsePlugin.beep(); return null; } // Open and SimClipse settings window try { ISelection selection = page.getSelection(); if (!(selection instanceof IStructuredSelection)) return null; Iterator<?> iter = ((IStructuredSelection) selection).iterator(); if (!iter.hasNext()) return null; Object elem = iter.next(); if (!(elem instanceof IJavaProject || elem instanceof ProjectViewItem || elem instanceof INavigatorItem )) return null; IProject project = null; if (elem instanceof INavigatorItem) { elem = ((INavigatorItem) elem).getProject(); } if (elem instanceof ProjectViewItem) { elem = ((ProjectViewItem)elem).getResource().getProject(); } if (elem instanceof IJavaProject) { elem = ((IJavaProject)elem).getProject(); } project = (IProject) ((IAdaptable) elem).getAdapter(IProject.class); if (project == null) return null; Shell shell = window.getShell(); // MessageDialog.openInformation( // shell, // "TODO", // "Open SimClipse Settings Page for project :" // + project.getName()); DetectionSettingsDialog dialog= new DetectionSettingsDialog(window, project); dialog.open(); } catch (Exception e) { SimClipseLog.logError("Failed to open the view", e); } return null; } }
[ "auni.ku@gmail.com" ]
auni.ku@gmail.com
99e295b9d9f07615100e3dd2b2fcf3c985233a71
a92e4545673c327e3f582df01b0dbfe7dae5782a
/src/Survivor.java
3707eeaefd5dc281f910a2b81d61dd25d90e83f9
[]
no_license
AJM10565/whatever
01fcdd2f7ef9da7fc618a308b3996e39f3ec23db
4e16673cb7f0b2385cef32df97a9246b2c399689
refs/heads/master
2020-05-04T18:54:50.754615
2019-04-03T21:17:53
2019-04-03T21:17:53
179,371,457
0
0
null
null
null
null
UTF-8
Java
false
false
1,912
java
public class Survivor { private String name; private int MaxHP; private int HP = Constants.DefaultHP; private int Damage = Constants.DefaultDamage; private boolean infected = false; private Group group; @Override public String toString() { String status=""; if (infected){ status = "Infected"; } else{ status = "Healthy"; } return name + ":"+ HP+"/"+MaxHP+" HP" + ", Damage=" + Damage +", "+ status ; } public Survivor(String name){ setName(name); MaxHP = HP; } public void setDamage(int damage) { this.Damage = damage; } public void setHP(int HP) { this.HP = HP; if (this.getHP()<=0 && this.infected){ System.out.println("Oh no!! " +this.getName() + " is now a Zombie. Watch Out Survivors!"); // Group oldGroup = this.group; Zombie.makeZombie(this); if (this.inGroup()){ this.group.removeSurvivor(this); } // System.out.println(oldGroup); } } public void setName(String name) { this.name = name; } public String getName() { return name; } public int getDamage() { return Damage; } public int getHP() { return HP; } public boolean isInfected() { return infected; } public void setInfected(boolean infected) { this.infected = infected; } public boolean inGroup(){ return this.group != null; } public Group getGroup() { return group; } public void setGroup(Group group) { this.group = group; } public void leaveGroup(){ setGroup(null); } public void takeDamage(int damagetaken){ setHP(this.HP-damagetaken); } }
[ "amiller17@luc.edu" ]
amiller17@luc.edu
bd1f9ddd50bc794a2bbaa8c1747130e8f33a2e4e
9b86f30d6e982a060f86025667108832c5d84fc4
/src/main/java/com/vaadin/testapp/repositories/UserRepository.java
0ac41b55af332f40c85e713983a0f1e8382ea238
[]
no_license
clinictest/testapp
fa7f22de9fb5c5895c503982175ee21c80529fce
a63cb1d505157376e82d223cc7ee3e5a2a4c0885
refs/heads/master
2023-03-09T02:03:25.124630
2021-03-02T12:21:15
2021-03-02T12:21:15
341,267,285
0
0
null
null
null
null
UTF-8
Java
false
false
258
java
package com.vaadin.testapp.repositories; import com.vaadin.testapp.models.User; import org.springframework.data.jpa.repository.JpaRepository; public interface UserRepository extends JpaRepository<User, Long> { User findByUsername(String username); }
[ "a.kviatkouski@softteco.com" ]
a.kviatkouski@softteco.com
3296153a18bdb8f0650c2a41ec59758519d0cb82
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/12/12_75839561ef26afd0951cdf0c5a6f38fb793c4563/ActorMerger/12_75839561ef26afd0951cdf0c5a6f38fb793c4563_ActorMerger_t.java
e39538073b56832a2fe3f5e4403a9907051d99fb
[]
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
19,362
java
/* * Copyright (c) 2010, IETR/INSA of Rennes * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the IETR/INSA of Rennes nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ package net.sf.orcc.tools.merger; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import net.sf.orcc.OrccException; import net.sf.orcc.ir.Action; import net.sf.orcc.ir.Actor; import net.sf.orcc.ir.Expression; import net.sf.orcc.ir.InstAssign; import net.sf.orcc.ir.InstLoad; import net.sf.orcc.ir.InstReturn; import net.sf.orcc.ir.InstStore; import net.sf.orcc.ir.IrFactory; import net.sf.orcc.ir.Node; import net.sf.orcc.ir.NodeBlock; import net.sf.orcc.ir.NodeWhile; import net.sf.orcc.ir.OpBinary; import net.sf.orcc.ir.Pattern; import net.sf.orcc.ir.Port; import net.sf.orcc.ir.Procedure; import net.sf.orcc.ir.Type; import net.sf.orcc.ir.TypeList; import net.sf.orcc.ir.Var; import net.sf.orcc.moc.MocFactory; import net.sf.orcc.moc.SDFMoC; import net.sf.orcc.network.Connection; import net.sf.orcc.network.Instance; import net.sf.orcc.network.Network; import net.sf.orcc.network.Vertex; import net.sf.orcc.network.transformations.INetworkTransformation; import org.eclipse.emf.ecore.util.EcoreUtil; import org.jgrapht.DirectedGraph; import org.jgrapht.graph.DirectedSubgraph; /** * This class defines a network transformation that merges SDF actors. * * * @author Matthieu Wipliez * @author Ghislain Roquier * */ public class ActorMerger implements INetworkTransformation { private static final String ACTION_NAME = "static_schedule"; private static final String SCHEDULER_NAME = "isSchedulable_" + ACTION_NAME; private Actor superActor; private DirectedGraph<Vertex, Connection> graph; private AbstractScheduler scheduler; private int index; private HashMap<Connection, Port> outputs; private HashMap<Connection, Port> inputs; private Set<Vertex> vertices; private Map<Port, Port> portsMap; private Map<Port, Var> inputToVarMap; private int depth; private Map<Port, Var> buffersMap; private void addBuffer(String name, int size, Type eltType) { IrFactory factory = IrFactory.eINSTANCE; Type type = factory.createTypeList(size, eltType); Var var = factory.createVar(0, type, name, true, true); superActor.getStateVars().add(var); } private void addCounter(String name) { IrFactory factory = IrFactory.eINSTANCE; Var varCount = factory.createVar(0, factory.createTypeInt(32), name, true, factory.createExprInt(0)); superActor.getStateVars().add(varCount); } private void copyProcedures() { for (Vertex vertex : vertices) { String id = vertex.getInstance().getId(); Actor actor = vertex.getInstance().getActor(); for (Procedure proc : new ArrayList<Procedure>(actor.getProcs())) { String name = proc.getName(); actor.getProcedure(name).setName(id + "_" + name); superActor.getProcs().add(proc); } } } private void copyStateVariables() { for (Vertex vertex : vertices) { String id = vertex.getInstance().getId(); Actor actor = vertex.getInstance().getActor(); for (Var var : new ArrayList<Var>(actor.getStateVars())) { String name = var.getName(); actor.getStateVar(name).setName(id + "_" + name); superActor.getStateVars().add(var); } } } /** * * @param ip * @param op * @return */ private Procedure createBody(Pattern ip, Pattern op) { IrFactory factory = IrFactory.eINSTANCE; Procedure procedure = factory.createProcedure(ACTION_NAME, 0, IrFactory.eINSTANCE.createTypeVoid()); // Add loop counter(s) int i = 0; do { // one loop var is required even if the schedule as a depth of 0 Var counter = factory.createVar(0, factory.createTypeInt(32), "idx_" + i, false, true); procedure.getLocals().add(counter); i++; } while (i < scheduler.getDepth()); Var tmp = factory.createVar(0, factory.createTypeInt(32), "tmp", false, true); procedure.getLocals().add(tmp); // Initialize read/write counters for (Var var : buffersMap.values()) { Var read = superActor.getStateVar(var.getName() + "_r"); Var write = superActor.getStateVar(var.getName() + "_w"); NodeBlock block = procedure.getLast(); if (read != null) { block.add(factory.createInstStore(read, factory.createExprInt(0))); } if (write != null) { block.add(factory.createInstStore(write, factory.createExprInt(0))); } } createCopiesFromInputs(procedure, ip); createStaticSchedule(procedure, scheduler.getSchedule(), procedure.getNodes()); createCopiesToOutputs(procedure, op); return procedure; } /** * copies the value of source into target * * @param procedure * @param source * @param target */ private void createCopies(Procedure procedure, Var source, Var target) { IrFactory factory = IrFactory.eINSTANCE; List<Node> nodes = procedure.getNodes(); Var loop = procedure.getLocal("idx_0"); NodeBlock block = procedure.getLast(nodes); block.add(factory.createInstAssign(loop, factory.createExprInt(0))); Expression condition = factory.createExprBinary( factory.createExprVar(loop), OpBinary.LT, factory.createExprInt(((TypeList) source.getType()).getSize()), factory.createTypeBool()); NodeWhile nodeWhile = factory.createNodeWhile(); nodeWhile.setJoinNode(factory.createNodeBlock()); nodeWhile.setCondition(condition); nodes.add(nodeWhile); Var tmpVar = procedure.getLocal("tmp"); List<Expression> indexes = new ArrayList<Expression>(); indexes.add(factory.createExprVar(loop)); InstLoad load = factory.createInstLoad(tmpVar, source, indexes); indexes = new ArrayList<Expression>(); indexes.add(factory.createExprVar(loop)); InstStore store = factory.createInstStore(0, target, indexes, factory.createExprVar(tmpVar)); NodeBlock childBlock = procedure.getLast(nodeWhile.getNodes()); childBlock.add(load); childBlock.add(store); // increment loop counter Expression expr = factory.createExprBinary( factory.createExprVar(loop), OpBinary.PLUS, factory.createExprInt(1), loop.getType()); InstAssign assign = factory.createInstAssign(loop, expr); childBlock.add(assign); } private void createCopiesFromInputs(Procedure procedure, Pattern ip) { for (Port port : superActor.getInputs()) { Var input = ip.getVariable(port); Var buffer = inputToVarMap.get(port); createCopies(procedure, input, buffer); } } private void createCopiesToOutputs(Procedure procedure, Pattern op) { for (Port port : superActor.getOutputs()) { Var output = op.getVariable(port); Var buffer = inputToVarMap.get(port); createCopies(procedure, buffer, output); } } /** * Creates a return instruction that uses the results of the hasTokens tests * previously created. Returns true right now. * * @param block * block to which return is to be added */ private void createInputCondition(NodeBlock block) { final IrFactory factory = IrFactory.eINSTANCE; InstReturn returnInstr = factory.createInstReturn(factory .createExprBool(true)); block.add(returnInstr); } /** * Creates the input pattern of the static action. * * @return ip */ private Pattern createInputPattern() { IrFactory factory = IrFactory.eINSTANCE; Pattern ip = factory.createPattern(); for (Port port : superActor.getInputs()) { int numTokens = port.getNumTokensConsumed(); Type type = factory.createTypeList(numTokens, EcoreUtil.copy(port.getType())); Var var = factory.createVar(0, type, port.getName(), false, true); ip.setNumTokens(port, numTokens); ip.setVariable(port, var); } return ip; } /** * Creates the output pattern of the static action. * * @return op */ private Pattern createOutputPattern() { IrFactory factory = IrFactory.eINSTANCE; Pattern op = factory.createPattern(); for (Port port : superActor.getOutputs()) { int numTokens = port.getNumTokensProduced(); Type type = factory.createTypeList(numTokens, EcoreUtil.copy(port.getType())); Var var = factory.createVar(0, type, port.getName(), false, true); op.setNumTokens(port, numTokens); op.setVariable(port, var); } return op; } /** * Creates input and output ports of the merged actor. * */ private void createPorts() { IrFactory factory = IrFactory.eINSTANCE; Pattern inputPattern = factory.createPattern(); Pattern outputPattern = factory.createPattern(); inputs = new HashMap<Connection, Port>(); outputs = new HashMap<Connection, Port>(); portsMap = new HashMap<Port, Port>(); int inIndex = 0; int outIndex = 0; for (Connection connection : graph.edgeSet()) { Vertex src = graph.getEdgeSource(connection); Vertex tgt = graph.getEdgeTarget(connection); if (!vertices.contains(src) && vertices.contains(tgt)) { Port tgtPort = connection.getTarget(); Port port = factory .createPort(EcoreUtil.copy(tgtPort.getType()), "input_" + inIndex++); int cns = scheduler.getRepetitionVector().get(tgt) * tgtPort.getNumTokensConsumed(); port.increaseTokenConsumption(cns); inputPattern.setNumTokens(port, cns); superActor.getInputs().add(port); inputs.put(connection, port); portsMap.put(port, tgtPort); } else if (vertices.contains(src) && !vertices.contains(tgt)) { Port srcPort = connection.getSource(); Port port = factory.createPort( EcoreUtil.copy(srcPort.getType()), "output_" + outIndex++); int prd = scheduler.getRepetitionVector().get(src) * srcPort.getNumTokensProduced(); port.increaseTokenProduction(prd); outputPattern.setNumTokens(port, prd); superActor.getOutputs().add(port); outputs.put(connection, port); portsMap.put(port, srcPort); } } SDFMoC sdfMoC = MocFactory.eINSTANCE.createSDFMoC(); sdfMoC.setInputPattern(inputPattern); sdfMoC.setOutputPattern(outputPattern); superActor.setMoC(sdfMoC); } /** * Turns actions of SDF actors into procedures * */ private void createProcedures() { IrFactory factory = IrFactory.eINSTANCE; for (Vertex vertex : scheduler.getSchedule().getActors()) { Instance instance = vertex.getInstance(); Iterator<Action> it = instance.getActor().getActions().iterator(); // at this stage, SDF actor should have only one action if (it.hasNext()) { Action action = it.next(); String name = instance.getId() + "_" + action.getName(); Procedure proc = factory.createProcedure(name, 0, factory.createTypeVoid()); Procedure body = action.getBody(); List<Node> nodes = body.getNodes(); proc.getLocals().addAll(body.getLocals()); proc.getNodes().addAll(nodes); proc.getLast(nodes).add(factory.createInstReturn()); superActor.getProcs().add(proc); new ChangeFifoArrayAccess(action.getInputPattern(), action.getOutputPattern(), buffersMap) .doSwitch(superActor); } } } /** * Creates the scheduler of the static action. * * @return the scheduler of the static action */ private Procedure createScheduler() { IrFactory factory = IrFactory.eINSTANCE; Procedure procedure = IrFactory.eINSTANCE.createProcedure( SCHEDULER_NAME, 0, IrFactory.eINSTANCE.createTypeBool()); NodeBlock block = factory.createNodeBlock(); procedure.getNodes().add(block); createInputCondition(block); return procedure; } /** * Create global list variables to replace the FIFOs. * */ private void createStateVariables() { buffersMap = new HashMap<Port, Var>(); inputToVarMap = new HashMap<Port, Var>(); int index = 0; // Create buffers for inputs for (Port port : superActor.getInputs()) { String name = "buffer_" + index++; int numTokens = port.getNumTokensConsumed(); addBuffer(name, numTokens, port.getType()); addCounter(name + "_r"); inputToVarMap.put(port, superActor.getStateVar(name)); buffersMap.put(portsMap.get(port), superActor.getStateVar(name)); } // Create buffers for outputs for (Port port : superActor.getOutputs()) { String name = "buffer_" + index++; int numTokens = port.getNumTokensProduced(); addBuffer(name, numTokens, port.getType()); addCounter(name + "_w"); inputToVarMap.put(port, superActor.getStateVar(name)); buffersMap.put(portsMap.get(port), superActor.getStateVar(name)); } // Create buffers for connections inside the sub-graph for (Map.Entry<Connection, Integer> entry : scheduler .getBufferCapacities().entrySet()) { String name = "buffer_" + index++; Connection conn = entry.getKey(); addBuffer(name, entry.getValue(), conn.getSource().getType()); addCounter(name + "_w"); addCounter(name + "_r"); buffersMap.put(conn.getSource(), superActor.getStateVar(name)); buffersMap.put(conn.getTarget(), superActor.getStateVar(name)); } } /** * Creates the static action for this actor. * */ private void createStaticAction() { IrFactory factory = IrFactory.eINSTANCE; Pattern ip = createInputPattern(); Pattern op = createOutputPattern(); Procedure scheduler = createScheduler(); Procedure body = createBody(ip, op); Action action = factory.createAction(factory.createTag(), ip, op, factory.createPattern(), scheduler, body); superActor.getActions().add(action); superActor.getActionsOutsideFsm().add(action); } /** * Create the static schedule of the action * * @param procedure * @param schedule * @param nodes */ private void createStaticSchedule(Procedure procedure, Schedule schedule, List<Node> nodes) { IrFactory factory = IrFactory.eINSTANCE; for (Iterand iterand : schedule.getIterands()) { if (iterand.isVertex()) { Instance instance = iterand.getVertex().getInstance(); Action action = instance.getActor().getActions().get(0); Procedure proc = superActor.getProcedure(instance.getId() + "_" + action.getName()); NodeBlock block = procedure.getLast(nodes); block.add(factory.createInstCall(0, null, proc, new ArrayList<Expression>())); } else { Schedule sched = iterand.getSchedule(); Var loopVar = procedure.getLocal("idx_" + depth); // init counter NodeBlock block = procedure.getLast(nodes); block.add(factory.createInstAssign(loopVar, factory.createExprInt(0))); // while loop Expression condition = factory.createExprBinary( factory.createExprVar(loopVar), OpBinary.LT, factory.createExprInt(sched.getIterationCount()), factory.createTypeBool()); NodeWhile nodeWhile = factory.createNodeWhile(); nodeWhile.setJoinNode(factory.createNodeBlock()); nodeWhile.setCondition(condition); nodes.add(nodeWhile); depth++; // recursion createStaticSchedule(procedure, sched, nodeWhile.getNodes()); depth--; // Increment current while loop variable Expression expr = factory.createExprBinary( factory.createExprVar(loopVar), OpBinary.PLUS, factory.createExprInt(1), loopVar.getType()); InstAssign assign = factory.createInstAssign(loopVar, expr); procedure.getLast(nodeWhile.getNodes()).add(assign); } } } /** * Creates the merged actor. * */ private void mergeActors() { superActor = IrFactory.eINSTANCE.createActor(); superActor.setName("SuperActor_" + index); createPorts(); copyStateVariables(); copyProcedures(); createStateVariables(); createProcedures(); createStaticAction(); } @Override public void transform(Network network) throws OrccException { graph = network.getGraph(); // make unique instance new UniqueInstantiator().transform(network); // static region detections StaticSubsetDetector detector = new StaticSubsetDetector(network); for (Set<Vertex> vertices : detector.staticRegionSets()) { this.vertices = vertices; DirectedGraph<Vertex, Connection> subgraph = new DirectedSubgraph<Vertex, Connection>( graph, vertices, null); // create the static schedule of vertices scheduler = new SASLoopScheduler(subgraph); scheduler.schedule(); // merge vertices inside a single actor mergeActors(); // update the graph Instance instance = new Instance("superActor_" + index, "SuperActor_" + index++); instance.setContents(superActor); Vertex mergeVertex = new Vertex(instance); graph.addVertex(mergeVertex); updateConnection(mergeVertex); graph.removeAllVertices(vertices); } } /** * * @param merge * @param vertices */ private void updateConnection(Vertex merge) { Set<Connection> connections = new HashSet<Connection>(graph.edgeSet()); for (Connection connection : connections) { Vertex src = graph.getEdgeSource(connection); Vertex tgt = graph.getEdgeTarget(connection); if (!vertices.contains(src) && vertices.contains(tgt)) { Connection newConn = new Connection(connection.getSource(), inputs.get(connection), connection.getAttributes()); graph.addEdge(graph.getEdgeSource(connection), merge, newConn); } if (vertices.contains(src) && !vertices.contains(tgt)) { Connection newConn = new Connection(outputs.get(connection), connection.getTarget(), connection.getAttributes()); graph.addEdge(merge, graph.getEdgeTarget(connection), newConn); } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
93ed09e98202d63f0d8fb1fab81e1f491d9f0179
f7e01381763ed236ceba32c34b973096b09dcb68
/src/com/andoid/aservice/db/BaseDatabase.java
8b515df4a070d72eabceb42bd8c5312ad5725b3d
[]
no_license
Zengyanyang/c
59751af934ba5ab947a56a146bee40704f67129a
beb68e513c574d58d94a18b912920f83245abf69
refs/heads/master
2021-01-01T17:37:27.169799
2015-04-19T18:14:57
2015-04-19T18:14:57
33,965,723
0
0
null
null
null
null
UTF-8
Java
false
false
784
java
package com.andoid.aservice.db; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; public abstract class BaseDatabase { protected String TABLE_NAME = null; public void Insert(SQLiteDatabase db, ContentValues values) { db.insert(TABLE_NAME, null, values); } public void Delete(SQLiteDatabase db, String whereClause, String[] whereArgs) { db.delete(TABLE_NAME, whereClause, whereArgs); } public void Update(SQLiteDatabase db, ContentValues values, String whereClause, String[] whereArgs) { db.update(TABLE_NAME, values, whereClause, whereArgs); } public Cursor Query(SQLiteDatabase db, String sql, String[] selectionArgs) { return db.rawQuery(sql, selectionArgs); } }
[ "zeng-yanyang@163.com" ]
zeng-yanyang@163.com
577f9a68954f0e68698321ac9f800a55d5aeab1e
a94503718e5b517e0d85227c75232b7a238ef24f
/src/main/java/net/dryuf/comp/gallery/mvp/CommonMultiGalleryPresenter.java
5e6f6dd57ab2a3de8cad9c942c6a3596ffef1e09
[]
no_license
kvr000/dryuf-old-comp
795c457e6131bb0b08f538290ff96f8043933c9f
ebb4a10b107159032dd49b956d439e1994fc320a
refs/heads/master
2023-03-02T20:44:19.336992
2022-04-04T21:51:59
2022-04-04T21:51:59
229,681,213
0
0
null
2023-02-22T02:52:16
2019-12-23T05:14:49
Java
UTF-8
Java
false
false
3,404
java
/* * Dryuf framework * * ---------------------------------------------------------------------------------- * * Copyright (C) 2000-2015 Zbyněk Vyškovský * * ---------------------------------------------------------------------------------- * * LICENSE: * * This file is part of Dryuf * * Dryuf is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 3 of the License, or (at your option) * any later version. * * Dryuf is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for * more details. * * You should have received a copy of the GNU Lesser General Public License * along with Dryuf; if not, write to the Free Software Foundation, Inc., 51 * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * @author 2000-2015 Zbyněk Vyškovský * @link mailto:kvr@matfyz.cz * @link http://kvr.matfyz.cz/software/java/dryuf/ * @link http://github.com/dryuf/ * @license http://www.gnu.org/licenses/lgpl.txt GNU Lesser General Public License v3 */ package net.dryuf.comp.gallery.mvp; import net.dryuf.core.Options; import net.dryuf.core.ReportException; import net.dryuf.comp.gallery.GalleryHandler; import net.dryuf.core.StringUtil; import net.dryuf.mvp.Presenter; public abstract class CommonMultiGalleryPresenter extends net.dryuf.mvp.ChildPresenter { public CommonMultiGalleryPresenter(Presenter parentPresenter, Options options) { super(parentPresenter, options); if ((store = (String) options.getOptionDefault("store", null)) == null) store = getRootPresenter().getCurrentPath(); } public boolean process() { String page; if ((page = this.getPathGallery()) == null) { return this.processNoGallery(); } else if (page.equals("")) { return false; } else { GalleryPresenter galleryPresenter = new GalleryPresenter(this, Options.NONE, this.openGalleryHandler(page)); galleryPresenter.injectRenderReference(new Runnable() { public void run() { renderGalleryReference(); } }); } return super.process(); } public boolean processNoGallery() { return this.processFinal(); } /** * Gets gallery path. * * @return null * if there was no path passed * @return "" * if redirect is required due to missing slash * @return path with slash at the end * if gallery was passed */ public String getPathGallery() { String page; if ((page = this.getRootPresenter().getPathElement()) != null) { if (this.getRootPresenter().needPathSlash(true) == null) return ""; if (StringUtil.matchText("^([a-zA-Z0-9][-0-9A-Za-z_]*)$", page) == null) throw new ReportException("wrong page"); return page+"/"; } return null; } /** * Opens gallery handler. * * @param page * the last element in path * * @return null * if there was no path passed * @return gallery handler * if found */ public abstract GalleryHandler openGalleryHandler(String page); public void renderGalleryReference() { } public void render() { super.render(); if (this.getLeadChild() == null) { this.renderGalleries(); } } public void renderGalleries() { } protected String store; }
[ "kvr@centrum.cz" ]
kvr@centrum.cz
09f16481e2308633c38c954ad22e13a7d8810178
aa32f73f2d0bd1eb92f2f8e6f4bc3bc3037eaf41
/wiremock-for-contract-docs/src/test/java/com/example/WiremockImportApplicationTests.java
cc3374735a7a27f9a9223b4fb925a0f87c3bad32
[ "Apache-2.0" ]
permissive
spring-cloud-samples/spring-cloud-contract-samples
68debf01675fe5d46e8fb73edf7dcfb8047a8fc7
17ee4fcae845e9c4e6b290beaf4b9d7e5d863448
refs/heads/main
2023-08-15T03:49:39.484722
2023-08-10T16:07:09
2023-08-10T16:07:09
73,282,380
382
341
Apache-2.0
2023-06-12T06:00:17
2016-11-09T12:30:56
Java
UTF-8
Java
false
false
1,784
java
/* * Copyright 2013-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.get; import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import static org.assertj.core.api.Assertions.assertThat; @SpringBootTest(properties = "app.baseUrl=http://localhost:6060", webEnvironment = WebEnvironment.NONE) @AutoConfigureWireMock(port = 6060) public class WiremockImportApplicationTests { @Autowired private Service service; @Test public void contextLoads() throws Exception { stubFor(get(urlEqualTo("/resource")).willReturn(aResponse() .withHeader("Content-Type", "text/plain").withBody("Hello World!"))); assertThat(this.service.go()).isEqualTo("Hello World!"); } }
[ "mgrzejszczak@vmware.com" ]
mgrzejszczak@vmware.com
1f04d0e24df307f54f5f3b21a23fc4abb195049d
f87b2048e85ae4287671ec22d5c3fc11e7c180e5
/crud_product_user/src/main/java/com/example/crud_product_user/config/SecurityConfiguaration.java
98419396b584933a66503a206b7f84ee3a7d8479
[]
no_license
T1907MQuyet/CodeSem4
e815710bf57ec667c896ad7367bcf132f3e72785
c94bdb0ec64aa0a7fd4e542557b63af9d17e02dd
refs/heads/master
2023-04-30T22:58:47.498558
2021-05-21T03:31:44
2021-05-21T03:31:44
348,548,204
0
0
null
null
null
null
UTF-8
Java
false
false
2,378
java
package com.example.crud_product_user.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.web.util.matcher.AntPathRequestMatcher; @Configuration @EnableWebSecurity public class SecurityConfiguaration extends WebSecurityConfigurerAdapter { @Autowired private UserDetailsService userDetailsService; @Bean public BCryptPasswordEncoder passwordEncoder1() { return new BCryptPasswordEncoder(); } @Bean public AuthenticationManager customAuthenticationManager()throws Exception { return authenticationManager(); } @Autowired public void configureGlobal(AuthenticationManagerBuilder auth)throws Exception { auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder1()); } @Override protected void configure(HttpSecurity http) throws Exception { // TODO Auto-generated method stub http.authorizeRequests().antMatchers( "/registration**","/web**","/webjars/**","/assets/**","/","/uploadingDir/**", "/js/**", "/css/**", "/img/**").permitAll() .anyRequest() .authenticated() .and() .formLogin() .loginPage("/login") .permitAll() .and() .logout() .invalidateHttpSession(true) .clearAuthentication(true) .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) .logoutSuccessUrl("/login?logout") .permitAll(); } }
[ "53265406+T1907MQuyet@users.noreply.github.com" ]
53265406+T1907MQuyet@users.noreply.github.com
e75a683fa437888d24a0f769ae38484df1fde87d
8df31fc96dd6e7893d53c7f43952fe53fb7a8aba
/Calculator/src/Main.java
042cea7a72c81999d1c60716d770720ad7110877
[]
no_license
anonymity-null/JavaCode
69dd771c35911aa252154c9c6b1d6e0f004125b7
3be81fd4c2932fb7836f8a1935b9c916ab8ce9e0
refs/heads/master
2022-12-10T02:01:45.596817
2020-09-22T12:06:44
2020-09-22T12:06:44
297,635,467
0
0
null
null
null
null
UTF-8
Java
false
false
97
java
public class Main { public static void main(String[] args) { new MyFrame(); } }
[ "renweilong@github.com" ]
renweilong@github.com
c5b6f68690247aa3ded434843a528bb7f14d469c
bf35ac9fc1aa10420d265c063a911f147c9cee99
/app/src/main/java/com/guochuang/mimedia/ui/adapter/PictureAdapter.java
52270a183a841013e59694b8186555c94e612961
[]
no_license
qqjq547/ksredpacket
766cc7e033f20cac0ef677f9d1b2abfb366be54c
afad59b54d82d1ff5baf4b1bbc6c9cf01ddf7d1f
refs/heads/master
2020-08-06T04:30:01.624426
2019-10-04T14:36:23
2019-10-04T14:36:23
212,830,429
0
0
null
null
null
null
UTF-8
Java
false
false
746
java
package com.guochuang.mimedia.ui.adapter; import android.support.annotation.Nullable; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; import com.sz.gcyh.KSHongBao.R; import com.guochuang.mimedia.tools.glide.GlideImgManager; import com.guochuang.mimedia.view.SquareImageView; import java.util.List; public class PictureAdapter extends BaseQuickAdapter<String,BaseViewHolder> { public PictureAdapter(@Nullable List<String> data) { super(R.layout.item_picture,data); } @Override protected void convert(BaseViewHolder helper, String item) { GlideImgManager.loadCornerImage(mContext,item,(SquareImageView) helper.getView(R.id.siv_image),5,true); } }
[ "qqjq6457547" ]
qqjq6457547
f5e30e51422b3b00e99976ab7dca4f05cc0ad9db
8aaa14e2841d7e3db752f04f9f4a0405a46ad511
/component_io/src/main/java/com/by/lizhiyoupin/app/io/entity/ShareType.java
7d92d74a3bb498dd34939033bb7fb4d5ebfa502c
[]
no_license
yibing0703/LZProject
960adacf3e04543ba2479fd23da7f06264720333
8a879c202fddc9bcdd79ef37e6868762d44fe84b
refs/heads/master
2022-04-11T12:54:08.875088
2020-03-16T10:55:39
2020-03-16T10:55:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
117
java
package com.by.lizhiyoupin.app.io.entity; public enum ShareType { QQ, WECHAT, MOMENTS, SINA, INTENT_MOMENTS; }
[ "w726759622@163.com" ]
w726759622@163.com
d214dc66d380984f2b9c4b7de9c8f0dd747c60e0
e48985fdf73f191445798e79ae2813e987cb150c
/src/test/_18_APPCDInfo.java
70c49121d393660ccc4d3c70218e7c3c1b214d08
[]
no_license
behappyleee/JavaTutorial
755212831fb2a79f614dbac3449118ab0b326633
83519e877fd8f236165ae0d672a0d5cbcce99366
refs/heads/master
2023-03-06T08:00:41.856955
2021-02-17T13:28:47
2021-02-17T13:28:47
339,708,368
0
0
null
null
null
null
UTF-8
Java
false
false
2,408
java
package test; public class _18_APPCDInfo extends _18_CDInfo implements _18_Lendable { private String borrower; private String checkOutDate; private String date; private int state; //상수(인터페이스 클래스) //int STATE_BORROWED = 1; //대출상태 //int STATE_NORMAL= 0; //반납상태 public _18_APPCDInfo () { } public _18_APPCDInfo (String registerNo, String title, String checkOutDate, String borrower) { super(registerNo, title); //부모 생성자에 매개변수 등록안되어있을시 에러발생함 this.checkOutDate = checkOutDate; this.borrower=borrower; this.state = _18_Lendable.STATE_NORMAL; // 반납상태(초기상태로 만듦) -normal로 만듦 System.out.println(" 등록번호 : "+ registerNo + "\n 제목 : " + title+ "\n 대출일 : "+ checkOutDate+"\n 대출자" + borrower ); } public void checkOut(String borrower, String date){ if(state == _18_Lendable.STATE_NORMAL){ this.checkOutDate=date; this.borrower=borrower; state=_18_Lendable.STATE_BORROWED; System.out.println(super.getTitle() + "대출 되었습니다"); System.out.println("대출자 : " + this.borrower); } else { System.out.println("현재 대출중 입니다."); } } public void checkIn(){ if( state ==_18_Lendable.STATE_BORROWED) { //if문에 =연산기호 하나만 씀 두개써야함 == System.out.println(super.getTitle() +" 반납 되었습니다."); state=_18_Lendable.STATE_NORMAL; } else { System.out.println("반납 되어있습니다."); } System.out.println("==========================="); } public void setBorrower(String borrower){ this.borrower=borrower; } public String getBorrower(){ return this.borrower; } public void setCheckOutDate(String checkOutDate){ this.checkOutDate=checkOutDate; } public String getCheckOutDate(){ return this.checkOutDate; } public void setDate(String date){ this.date=date; } public String getDate(){ return this.date; } public void setState(int state){ this.state=state; } public int getState(){ return this.state; } public void printInfo(){ System.out.println( ); } }
[ "dhfhfkwhdk@naver.com" ]
dhfhfkwhdk@naver.com
046a02f53546bb665bf3dc8ec1baac847645f59a
22907b20e3778f15906bd77c582f9d64b65e708f
/java_eclipse-plugin_sharpdev/org.emonic.debugger/src/org/emonic/debugger/webinterface/EmonicDebugfrontendSoap.java
140b34d27cdd246865a502c2bcfd4b028ef8156f
[]
no_license
liamzebedee/misc
8888ec8961d83668dc4b56f31ff4469761f83711
bf3455bfdd682a547727cd9d381fe8988b5ee22c
refs/heads/master
2016-09-05T09:29:49.294517
2014-09-24T00:16:31
2014-09-24T00:16:31
6,121,970
1
1
null
null
null
null
UTF-8
Java
false
false
3,095
java
/** * EmonicDebugfrontendSoap.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.emonic.debugger.webinterface; public interface EmonicDebugfrontendSoap extends java.rmi.Remote { /** * Start MDB */ public void startMdb(java.lang.String cmdLine) throws java.rmi.RemoteException; /** * Run application in MDB (not halting in Main) */ public void runApp(java.lang.String workDir) throws java.rmi.RemoteException; /** * Get next Event */ public org.emonic.debugger.webinterface.EventData getNextEvent() throws java.rmi.RemoteException; /** * MDB background command */ public void background() throws java.rmi.RemoteException; /** * MDB backtrace command */ public org.emonic.debugger.webinterface.BacktraceData backtrace(boolean execute) throws java.rmi.RemoteException; /** * MDB break command */ public int _break(java.lang.String file, int lineNumber) throws java.rmi.RemoteException; /** * MDB delete command */ public void delete(int breakpointNumber) throws java.rmi.RemoteException; /** * MDB disable command */ public void disable(int breakpointNumber) throws java.rmi.RemoteException; /** * MDB enable command */ public void enable(int breakpointNumber) throws java.rmi.RemoteException; /** * MDB finish command */ public void finish() throws java.rmi.RemoteException; /** * MDB frame command */ public void frame(int frameNumber) throws java.rmi.RemoteException; /** * MDB next command */ public void next() throws java.rmi.RemoteException; /** * MDB print command */ public org.emonic.debugger.webinterface.PrintData print(java.lang.String variableName) throws java.rmi.RemoteException; /** * MDB ptype command - fields only */ public java.lang.String ptypeFieldsOnly(java.lang.String className, boolean staticOnly) throws java.rmi.RemoteException; /** * MDB quit command */ public void quit() throws java.rmi.RemoteException; /** * MDB set X = Y command */ public void setVariable(java.lang.String variable, java.lang.String value) throws java.rmi.RemoteException; /** * MDB show threads command */ public org.emonic.debugger.webinterface.ThreadData getThreads(boolean execute) throws java.rmi.RemoteException; /** * MDB show locals command */ public java.lang.String getLocals() throws java.rmi.RemoteException; /** * MDB show parameters command */ public java.lang.String getParameters() throws java.rmi.RemoteException; /** * MDB step command */ public void step() throws java.rmi.RemoteException; /** * MDB stop command */ public void stop() throws java.rmi.RemoteException; /** * MDB thread command */ public void thread(int threadNumber) throws java.rmi.RemoteException; }
[ "liamzebedee@yahoo.com.au" ]
liamzebedee@yahoo.com.au
0a9520d5558062b5858c70c1520ee287378b212c
c75b0f8328a894bd1c7bab6a437d44eb6dd0f995
/huhupa-mall-parent/huhupa-mall-common/huhupa-mall-pojo/src/main/java/com/huhupa/pojo/TbTemplateExample.java
8c188f2d297ba4dc5a8f36b1ba4a9d9bded0162c
[]
no_license
a342108611/learn-architect
59fa2b7706e88f06f6bdd3c64bda393a3f684de7
7efd00d304610751ecc70cf0c1dfab6d3986e60a
refs/heads/develop
2020-04-24T21:40:31.001528
2019-02-27T09:02:52
2019-02-27T09:02:52
172,286,601
0
0
null
2019-02-27T01:55:21
2019-02-24T02:20:15
Java
UTF-8
Java
false
false
39,409
java
package com.huhupa.pojo; import java.util.ArrayList; import java.util.Date; import java.util.List; public class TbTemplateExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public TbTemplateExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andTemplateIdIsNull() { addCriterion("template_id is null"); return (Criteria) this; } public Criteria andTemplateIdIsNotNull() { addCriterion("template_id is not null"); return (Criteria) this; } public Criteria andTemplateIdEqualTo(Integer value) { addCriterion("template_id =", value, "templateId"); return (Criteria) this; } public Criteria andTemplateIdNotEqualTo(Integer value) { addCriterion("template_id <>", value, "templateId"); return (Criteria) this; } public Criteria andTemplateIdGreaterThan(Integer value) { addCriterion("template_id >", value, "templateId"); return (Criteria) this; } public Criteria andTemplateIdGreaterThanOrEqualTo(Integer value) { addCriterion("template_id >=", value, "templateId"); return (Criteria) this; } public Criteria andTemplateIdLessThan(Integer value) { addCriterion("template_id <", value, "templateId"); return (Criteria) this; } public Criteria andTemplateIdLessThanOrEqualTo(Integer value) { addCriterion("template_id <=", value, "templateId"); return (Criteria) this; } public Criteria andTemplateIdIn(List<Integer> values) { addCriterion("template_id in", values, "templateId"); return (Criteria) this; } public Criteria andTemplateIdNotIn(List<Integer> values) { addCriterion("template_id not in", values, "templateId"); return (Criteria) this; } public Criteria andTemplateIdBetween(Integer value1, Integer value2) { addCriterion("template_id between", value1, value2, "templateId"); return (Criteria) this; } public Criteria andTemplateIdNotBetween(Integer value1, Integer value2) { addCriterion("template_id not between", value1, value2, "templateId"); return (Criteria) this; } public Criteria andCategoryIdIsNull() { addCriterion("category_id is null"); return (Criteria) this; } public Criteria andCategoryIdIsNotNull() { addCriterion("category_id is not null"); return (Criteria) this; } public Criteria andCategoryIdEqualTo(Integer value) { addCriterion("category_id =", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdNotEqualTo(Integer value) { addCriterion("category_id <>", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdGreaterThan(Integer value) { addCriterion("category_id >", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdGreaterThanOrEqualTo(Integer value) { addCriterion("category_id >=", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdLessThan(Integer value) { addCriterion("category_id <", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdLessThanOrEqualTo(Integer value) { addCriterion("category_id <=", value, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdIn(List<Integer> values) { addCriterion("category_id in", values, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdNotIn(List<Integer> values) { addCriterion("category_id not in", values, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdBetween(Integer value1, Integer value2) { addCriterion("category_id between", value1, value2, "categoryId"); return (Criteria) this; } public Criteria andCategoryIdNotBetween(Integer value1, Integer value2) { addCriterion("category_id not between", value1, value2, "categoryId"); return (Criteria) this; } public Criteria andTemplateNameIsNull() { addCriterion("template_name is null"); return (Criteria) this; } public Criteria andTemplateNameIsNotNull() { addCriterion("template_name is not null"); return (Criteria) this; } public Criteria andTemplateNameEqualTo(String value) { addCriterion("template_name =", value, "templateName"); return (Criteria) this; } public Criteria andTemplateNameNotEqualTo(String value) { addCriterion("template_name <>", value, "templateName"); return (Criteria) this; } public Criteria andTemplateNameGreaterThan(String value) { addCriterion("template_name >", value, "templateName"); return (Criteria) this; } public Criteria andTemplateNameGreaterThanOrEqualTo(String value) { addCriterion("template_name >=", value, "templateName"); return (Criteria) this; } public Criteria andTemplateNameLessThan(String value) { addCriterion("template_name <", value, "templateName"); return (Criteria) this; } public Criteria andTemplateNameLessThanOrEqualTo(String value) { addCriterion("template_name <=", value, "templateName"); return (Criteria) this; } public Criteria andTemplateNameLike(String value) { addCriterion("template_name like", value, "templateName"); return (Criteria) this; } public Criteria andTemplateNameNotLike(String value) { addCriterion("template_name not like", value, "templateName"); return (Criteria) this; } public Criteria andTemplateNameIn(List<String> values) { addCriterion("template_name in", values, "templateName"); return (Criteria) this; } public Criteria andTemplateNameNotIn(List<String> values) { addCriterion("template_name not in", values, "templateName"); return (Criteria) this; } public Criteria andTemplateNameBetween(String value1, String value2) { addCriterion("template_name between", value1, value2, "templateName"); return (Criteria) this; } public Criteria andTemplateNameNotBetween(String value1, String value2) { addCriterion("template_name not between", value1, value2, "templateName"); return (Criteria) this; } public Criteria andBrandsIsNull() { addCriterion("brands is null"); return (Criteria) this; } public Criteria andBrandsIsNotNull() { addCriterion("brands is not null"); return (Criteria) this; } public Criteria andBrandsEqualTo(String value) { addCriterion("brands =", value, "brands"); return (Criteria) this; } public Criteria andBrandsNotEqualTo(String value) { addCriterion("brands <>", value, "brands"); return (Criteria) this; } public Criteria andBrandsGreaterThan(String value) { addCriterion("brands >", value, "brands"); return (Criteria) this; } public Criteria andBrandsGreaterThanOrEqualTo(String value) { addCriterion("brands >=", value, "brands"); return (Criteria) this; } public Criteria andBrandsLessThan(String value) { addCriterion("brands <", value, "brands"); return (Criteria) this; } public Criteria andBrandsLessThanOrEqualTo(String value) { addCriterion("brands <=", value, "brands"); return (Criteria) this; } public Criteria andBrandsLike(String value) { addCriterion("brands like", value, "brands"); return (Criteria) this; } public Criteria andBrandsNotLike(String value) { addCriterion("brands not like", value, "brands"); return (Criteria) this; } public Criteria andBrandsIn(List<String> values) { addCriterion("brands in", values, "brands"); return (Criteria) this; } public Criteria andBrandsNotIn(List<String> values) { addCriterion("brands not in", values, "brands"); return (Criteria) this; } public Criteria andBrandsBetween(String value1, String value2) { addCriterion("brands between", value1, value2, "brands"); return (Criteria) this; } public Criteria andBrandsNotBetween(String value1, String value2) { addCriterion("brands not between", value1, value2, "brands"); return (Criteria) this; } public Criteria andSpecsIsNull() { addCriterion("specs is null"); return (Criteria) this; } public Criteria andSpecsIsNotNull() { addCriterion("specs is not null"); return (Criteria) this; } public Criteria andSpecsEqualTo(String value) { addCriterion("specs =", value, "specs"); return (Criteria) this; } public Criteria andSpecsNotEqualTo(String value) { addCriterion("specs <>", value, "specs"); return (Criteria) this; } public Criteria andSpecsGreaterThan(String value) { addCriterion("specs >", value, "specs"); return (Criteria) this; } public Criteria andSpecsGreaterThanOrEqualTo(String value) { addCriterion("specs >=", value, "specs"); return (Criteria) this; } public Criteria andSpecsLessThan(String value) { addCriterion("specs <", value, "specs"); return (Criteria) this; } public Criteria andSpecsLessThanOrEqualTo(String value) { addCriterion("specs <=", value, "specs"); return (Criteria) this; } public Criteria andSpecsLike(String value) { addCriterion("specs like", value, "specs"); return (Criteria) this; } public Criteria andSpecsNotLike(String value) { addCriterion("specs not like", value, "specs"); return (Criteria) this; } public Criteria andSpecsIn(List<String> values) { addCriterion("specs in", values, "specs"); return (Criteria) this; } public Criteria andSpecsNotIn(List<String> values) { addCriterion("specs not in", values, "specs"); return (Criteria) this; } public Criteria andSpecsBetween(String value1, String value2) { addCriterion("specs between", value1, value2, "specs"); return (Criteria) this; } public Criteria andSpecsNotBetween(String value1, String value2) { addCriterion("specs not between", value1, value2, "specs"); return (Criteria) this; } public Criteria andAttributeIsNull() { addCriterion("attribute is null"); return (Criteria) this; } public Criteria andAttributeIsNotNull() { addCriterion("attribute is not null"); return (Criteria) this; } public Criteria andAttributeEqualTo(String value) { addCriterion("attribute =", value, "attribute"); return (Criteria) this; } public Criteria andAttributeNotEqualTo(String value) { addCriterion("attribute <>", value, "attribute"); return (Criteria) this; } public Criteria andAttributeGreaterThan(String value) { addCriterion("attribute >", value, "attribute"); return (Criteria) this; } public Criteria andAttributeGreaterThanOrEqualTo(String value) { addCriterion("attribute >=", value, "attribute"); return (Criteria) this; } public Criteria andAttributeLessThan(String value) { addCriterion("attribute <", value, "attribute"); return (Criteria) this; } public Criteria andAttributeLessThanOrEqualTo(String value) { addCriterion("attribute <=", value, "attribute"); return (Criteria) this; } public Criteria andAttributeLike(String value) { addCriterion("attribute like", value, "attribute"); return (Criteria) this; } public Criteria andAttributeNotLike(String value) { addCriterion("attribute not like", value, "attribute"); return (Criteria) this; } public Criteria andAttributeIn(List<String> values) { addCriterion("attribute in", values, "attribute"); return (Criteria) this; } public Criteria andAttributeNotIn(List<String> values) { addCriterion("attribute not in", values, "attribute"); return (Criteria) this; } public Criteria andAttributeBetween(String value1, String value2) { addCriterion("attribute between", value1, value2, "attribute"); return (Criteria) this; } public Criteria andAttributeNotBetween(String value1, String value2) { addCriterion("attribute not between", value1, value2, "attribute"); return (Criteria) this; } public Criteria andIsDeleteIsNull() { addCriterion("is_delete is null"); return (Criteria) this; } public Criteria andIsDeleteIsNotNull() { addCriterion("is_delete is not null"); return (Criteria) this; } public Criteria andIsDeleteEqualTo(String value) { addCriterion("is_delete =", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteNotEqualTo(String value) { addCriterion("is_delete <>", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteGreaterThan(String value) { addCriterion("is_delete >", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteGreaterThanOrEqualTo(String value) { addCriterion("is_delete >=", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteLessThan(String value) { addCriterion("is_delete <", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteLessThanOrEqualTo(String value) { addCriterion("is_delete <=", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteLike(String value) { addCriterion("is_delete like", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteNotLike(String value) { addCriterion("is_delete not like", value, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteIn(List<String> values) { addCriterion("is_delete in", values, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteNotIn(List<String> values) { addCriterion("is_delete not in", values, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteBetween(String value1, String value2) { addCriterion("is_delete between", value1, value2, "isDelete"); return (Criteria) this; } public Criteria andIsDeleteNotBetween(String value1, String value2) { addCriterion("is_delete not between", value1, value2, "isDelete"); return (Criteria) this; } public Criteria andStatusIsNull() { addCriterion("status is null"); return (Criteria) this; } public Criteria andStatusIsNotNull() { addCriterion("status is not null"); return (Criteria) this; } public Criteria andStatusEqualTo(String value) { addCriterion("status =", value, "status"); return (Criteria) this; } public Criteria andStatusNotEqualTo(String value) { addCriterion("status <>", value, "status"); return (Criteria) this; } public Criteria andStatusGreaterThan(String value) { addCriterion("status >", value, "status"); return (Criteria) this; } public Criteria andStatusGreaterThanOrEqualTo(String value) { addCriterion("status >=", value, "status"); return (Criteria) this; } public Criteria andStatusLessThan(String value) { addCriterion("status <", value, "status"); return (Criteria) this; } public Criteria andStatusLessThanOrEqualTo(String value) { addCriterion("status <=", value, "status"); return (Criteria) this; } public Criteria andStatusLike(String value) { addCriterion("status like", value, "status"); return (Criteria) this; } public Criteria andStatusNotLike(String value) { addCriterion("status not like", value, "status"); return (Criteria) this; } public Criteria andStatusIn(List<String> values) { addCriterion("status in", values, "status"); return (Criteria) this; } public Criteria andStatusNotIn(List<String> values) { addCriterion("status not in", values, "status"); return (Criteria) this; } public Criteria andStatusBetween(String value1, String value2) { addCriterion("status between", value1, value2, "status"); return (Criteria) this; } public Criteria andStatusNotBetween(String value1, String value2) { addCriterion("status not between", value1, value2, "status"); return (Criteria) this; } public Criteria andCreateIdIsNull() { addCriterion("create_id is null"); return (Criteria) this; } public Criteria andCreateIdIsNotNull() { addCriterion("create_id is not null"); return (Criteria) this; } public Criteria andCreateIdEqualTo(String value) { addCriterion("create_id =", value, "createId"); return (Criteria) this; } public Criteria andCreateIdNotEqualTo(String value) { addCriterion("create_id <>", value, "createId"); return (Criteria) this; } public Criteria andCreateIdGreaterThan(String value) { addCriterion("create_id >", value, "createId"); return (Criteria) this; } public Criteria andCreateIdGreaterThanOrEqualTo(String value) { addCriterion("create_id >=", value, "createId"); return (Criteria) this; } public Criteria andCreateIdLessThan(String value) { addCriterion("create_id <", value, "createId"); return (Criteria) this; } public Criteria andCreateIdLessThanOrEqualTo(String value) { addCriterion("create_id <=", value, "createId"); return (Criteria) this; } public Criteria andCreateIdLike(String value) { addCriterion("create_id like", value, "createId"); return (Criteria) this; } public Criteria andCreateIdNotLike(String value) { addCriterion("create_id not like", value, "createId"); return (Criteria) this; } public Criteria andCreateIdIn(List<String> values) { addCriterion("create_id in", values, "createId"); return (Criteria) this; } public Criteria andCreateIdNotIn(List<String> values) { addCriterion("create_id not in", values, "createId"); return (Criteria) this; } public Criteria andCreateIdBetween(String value1, String value2) { addCriterion("create_id between", value1, value2, "createId"); return (Criteria) this; } public Criteria andCreateIdNotBetween(String value1, String value2) { addCriterion("create_id not between", value1, value2, "createId"); return (Criteria) this; } public Criteria andCreateTimeIsNull() { addCriterion("create_time is null"); return (Criteria) this; } public Criteria andCreateTimeIsNotNull() { addCriterion("create_time is not null"); return (Criteria) this; } public Criteria andCreateTimeEqualTo(Date value) { addCriterion("create_time =", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeNotEqualTo(Date value) { addCriterion("create_time <>", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeGreaterThan(Date value) { addCriterion("create_time >", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { addCriterion("create_time >=", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeLessThan(Date value) { addCriterion("create_time <", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeLessThanOrEqualTo(Date value) { addCriterion("create_time <=", value, "createTime"); return (Criteria) this; } public Criteria andCreateTimeIn(List<Date> values) { addCriterion("create_time in", values, "createTime"); return (Criteria) this; } public Criteria andCreateTimeNotIn(List<Date> values) { addCriterion("create_time not in", values, "createTime"); return (Criteria) this; } public Criteria andCreateTimeBetween(Date value1, Date value2) { addCriterion("create_time between", value1, value2, "createTime"); return (Criteria) this; } public Criteria andCreateTimeNotBetween(Date value1, Date value2) { addCriterion("create_time not between", value1, value2, "createTime"); return (Criteria) this; } public Criteria andUpdateIdIsNull() { addCriterion("update_id is null"); return (Criteria) this; } public Criteria andUpdateIdIsNotNull() { addCriterion("update_id is not null"); return (Criteria) this; } public Criteria andUpdateIdEqualTo(String value) { addCriterion("update_id =", value, "updateId"); return (Criteria) this; } public Criteria andUpdateIdNotEqualTo(String value) { addCriterion("update_id <>", value, "updateId"); return (Criteria) this; } public Criteria andUpdateIdGreaterThan(String value) { addCriterion("update_id >", value, "updateId"); return (Criteria) this; } public Criteria andUpdateIdGreaterThanOrEqualTo(String value) { addCriterion("update_id >=", value, "updateId"); return (Criteria) this; } public Criteria andUpdateIdLessThan(String value) { addCriterion("update_id <", value, "updateId"); return (Criteria) this; } public Criteria andUpdateIdLessThanOrEqualTo(String value) { addCriterion("update_id <=", value, "updateId"); return (Criteria) this; } public Criteria andUpdateIdLike(String value) { addCriterion("update_id like", value, "updateId"); return (Criteria) this; } public Criteria andUpdateIdNotLike(String value) { addCriterion("update_id not like", value, "updateId"); return (Criteria) this; } public Criteria andUpdateIdIn(List<String> values) { addCriterion("update_id in", values, "updateId"); return (Criteria) this; } public Criteria andUpdateIdNotIn(List<String> values) { addCriterion("update_id not in", values, "updateId"); return (Criteria) this; } public Criteria andUpdateIdBetween(String value1, String value2) { addCriterion("update_id between", value1, value2, "updateId"); return (Criteria) this; } public Criteria andUpdateIdNotBetween(String value1, String value2) { addCriterion("update_id not between", value1, value2, "updateId"); return (Criteria) this; } public Criteria andUpdateTimeIsNull() { addCriterion("update_time is null"); return (Criteria) this; } public Criteria andUpdateTimeIsNotNull() { addCriterion("update_time is not null"); return (Criteria) this; } public Criteria andUpdateTimeEqualTo(Date value) { addCriterion("update_time =", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeNotEqualTo(Date value) { addCriterion("update_time <>", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeGreaterThan(Date value) { addCriterion("update_time >", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { addCriterion("update_time >=", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeLessThan(Date value) { addCriterion("update_time <", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { addCriterion("update_time <=", value, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeIn(List<Date> values) { addCriterion("update_time in", values, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeNotIn(List<Date> values) { addCriterion("update_time not in", values, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeBetween(Date value1, Date value2) { addCriterion("update_time between", value1, value2, "updateTime"); return (Criteria) this; } public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { addCriterion("update_time not between", value1, value2, "updateTime"); return (Criteria) this; } public Criteria andBak1IsNull() { addCriterion("bak1 is null"); return (Criteria) this; } public Criteria andBak1IsNotNull() { addCriterion("bak1 is not null"); return (Criteria) this; } public Criteria andBak1EqualTo(String value) { addCriterion("bak1 =", value, "bak1"); return (Criteria) this; } public Criteria andBak1NotEqualTo(String value) { addCriterion("bak1 <>", value, "bak1"); return (Criteria) this; } public Criteria andBak1GreaterThan(String value) { addCriterion("bak1 >", value, "bak1"); return (Criteria) this; } public Criteria andBak1GreaterThanOrEqualTo(String value) { addCriterion("bak1 >=", value, "bak1"); return (Criteria) this; } public Criteria andBak1LessThan(String value) { addCriterion("bak1 <", value, "bak1"); return (Criteria) this; } public Criteria andBak1LessThanOrEqualTo(String value) { addCriterion("bak1 <=", value, "bak1"); return (Criteria) this; } public Criteria andBak1Like(String value) { addCriterion("bak1 like", value, "bak1"); return (Criteria) this; } public Criteria andBak1NotLike(String value) { addCriterion("bak1 not like", value, "bak1"); return (Criteria) this; } public Criteria andBak1In(List<String> values) { addCriterion("bak1 in", values, "bak1"); return (Criteria) this; } public Criteria andBak1NotIn(List<String> values) { addCriterion("bak1 not in", values, "bak1"); return (Criteria) this; } public Criteria andBak1Between(String value1, String value2) { addCriterion("bak1 between", value1, value2, "bak1"); return (Criteria) this; } public Criteria andBak1NotBetween(String value1, String value2) { addCriterion("bak1 not between", value1, value2, "bak1"); return (Criteria) this; } public Criteria andBak2IsNull() { addCriterion("bak2 is null"); return (Criteria) this; } public Criteria andBak2IsNotNull() { addCriterion("bak2 is not null"); return (Criteria) this; } public Criteria andBak2EqualTo(String value) { addCriterion("bak2 =", value, "bak2"); return (Criteria) this; } public Criteria andBak2NotEqualTo(String value) { addCriterion("bak2 <>", value, "bak2"); return (Criteria) this; } public Criteria andBak2GreaterThan(String value) { addCriterion("bak2 >", value, "bak2"); return (Criteria) this; } public Criteria andBak2GreaterThanOrEqualTo(String value) { addCriterion("bak2 >=", value, "bak2"); return (Criteria) this; } public Criteria andBak2LessThan(String value) { addCriterion("bak2 <", value, "bak2"); return (Criteria) this; } public Criteria andBak2LessThanOrEqualTo(String value) { addCriterion("bak2 <=", value, "bak2"); return (Criteria) this; } public Criteria andBak2Like(String value) { addCriterion("bak2 like", value, "bak2"); return (Criteria) this; } public Criteria andBak2NotLike(String value) { addCriterion("bak2 not like", value, "bak2"); return (Criteria) this; } public Criteria andBak2In(List<String> values) { addCriterion("bak2 in", values, "bak2"); return (Criteria) this; } public Criteria andBak2NotIn(List<String> values) { addCriterion("bak2 not in", values, "bak2"); return (Criteria) this; } public Criteria andBak2Between(String value1, String value2) { addCriterion("bak2 between", value1, value2, "bak2"); return (Criteria) this; } public Criteria andBak2NotBetween(String value1, String value2) { addCriterion("bak2 not between", value1, value2, "bak2"); return (Criteria) this; } public Criteria andBak3IsNull() { addCriterion("bak3 is null"); return (Criteria) this; } public Criteria andBak3IsNotNull() { addCriterion("bak3 is not null"); return (Criteria) this; } public Criteria andBak3EqualTo(String value) { addCriterion("bak3 =", value, "bak3"); return (Criteria) this; } public Criteria andBak3NotEqualTo(String value) { addCriterion("bak3 <>", value, "bak3"); return (Criteria) this; } public Criteria andBak3GreaterThan(String value) { addCriterion("bak3 >", value, "bak3"); return (Criteria) this; } public Criteria andBak3GreaterThanOrEqualTo(String value) { addCriterion("bak3 >=", value, "bak3"); return (Criteria) this; } public Criteria andBak3LessThan(String value) { addCriterion("bak3 <", value, "bak3"); return (Criteria) this; } public Criteria andBak3LessThanOrEqualTo(String value) { addCriterion("bak3 <=", value, "bak3"); return (Criteria) this; } public Criteria andBak3Like(String value) { addCriterion("bak3 like", value, "bak3"); return (Criteria) this; } public Criteria andBak3NotLike(String value) { addCriterion("bak3 not like", value, "bak3"); return (Criteria) this; } public Criteria andBak3In(List<String> values) { addCriterion("bak3 in", values, "bak3"); return (Criteria) this; } public Criteria andBak3NotIn(List<String> values) { addCriterion("bak3 not in", values, "bak3"); return (Criteria) this; } public Criteria andBak3Between(String value1, String value2) { addCriterion("bak3 between", value1, value2, "bak3"); return (Criteria) this; } public Criteria andBak3NotBetween(String value1, String value2) { addCriterion("bak3 not between", value1, value2, "bak3"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "tmzyj2014@163.com" ]
tmzyj2014@163.com
8fd189cd177820b93f680988a05222086aa24e1b
65eaae2c5a4c434538f0903a6e7eb1fdd1f5c5fd
/vehicleCenter3/src/main/java/com/eshop/gateway/gb32960/pojo/FuelCellData.java
3383349c508348166ab8cf9923d587c1bf42900e
[]
no_license
asqwasqw12/vehicleCenter_back
10bfeb51f459dbcbf411ce62e2f2b27b2bfb7f94
0ee370b0d632400293fb91ca1125eec610951e46
refs/heads/master
2022-07-18T11:15:53.496603
2021-03-29T13:00:30
2021-03-29T13:00:30
245,202,112
0
0
null
2022-06-21T02:55:36
2020-03-05T15:39:32
Java
UTF-8
Java
false
false
5,408
java
package com.eshop.gateway.gb32960.pojo; import java.time.LocalDateTime; import java.time.ZonedDateTime; import java.util.Date; import java.util.List; public class FuelCellData { Long id; // private Long vehicleId; //车辆Id private String terminalPhone; // 终端手机号 private String vin; //车辆唯一识别码 //燃料电池电压 private Integer voltage; //燃料电池电流 private Integer current; //燃料消耗率 private Integer fuelConsumption; //燃料电池温度探针总数 private Integer temperatureProbeCount; //探针温度值集合 private String probeTemperature; //氢系统中最高温度 private Integer hydrogenSystemMaxTemperature; //氢系统中最高温度探针代号 private Short hydrogenSystemTemperatureProbeNum; //氢气最高浓度 private Integer hydrogenSystemMaxConcentration; //氢气最高浓度传感器代号 private Short hydrogenSystemConcentrationProbeNum; //氢气最高压力 private Integer hydrogenSystemMaxPressure; //氢气最高压力传感器代号 private Short hydrogenSystemPressureProbeNum; //高压DC/DC状态 private Short dcStatus; private Date createTime; //创建时间 //数据采集时间 private LocalDateTime sampleTime;//采样时间 //非数据库属性 //探针温度值集合 private List<Short> probeTemperatureList; public void setId(Long id) { this.id = id; } public Long getId() { return this.id; } public void setVehicleId(Long vehicleId) { this.vehicleId = vehicleId; } public Long getVehicleId() { return this.vehicleId; } public void setTerminalPhone(String terminalPhone) { this.terminalPhone = terminalPhone; } public String getTerminalPhone() { return this.terminalPhone; } public void setVin(String vin) { this.vin = vin; } public String getVin() { return this.vin; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public void setSampleTime(LocalDateTime sampleTime) { this.sampleTime = sampleTime; } public LocalDateTime getSampleTime() { return this.sampleTime; } public Integer getVoltage() { return voltage; } public void setVoltage(Integer voltage) { this.voltage = voltage; } public Integer getCurrent() { return current; } public void setCurrent(Integer current) { this.current = current; } public Integer getFuelConsumption() { return fuelConsumption; } public void setFuelConsumption(Integer fuelConsumption) { this.fuelConsumption = fuelConsumption; } public Integer getTemperatureProbeCount() { return temperatureProbeCount; } public void setTemperatureProbeCount(Integer temperatureProbeCount) { this.temperatureProbeCount = temperatureProbeCount; } public String getProbeTemperature() { return probeTemperature; } public void setProbeTemperature(String probeTemperature) { this.probeTemperature = probeTemperature; } public List<Short> getProbeTemperatureList() { return probeTemperatureList; } public void setProbeTemperatureList(List<Short> probeTemperatureList) { this.probeTemperatureList = probeTemperatureList; } public Integer getHydrogenSystemMaxTemperature() { return hydrogenSystemMaxTemperature; } public void setHydrogenSystemMaxTemperature(Integer hydrogenSystemMaxTemperature) { this.hydrogenSystemMaxTemperature = hydrogenSystemMaxTemperature; } public Short getHydrogenSystemTemperatureProbeNum() { return hydrogenSystemTemperatureProbeNum; } public void setHydrogenSystemTemperatureProbeNum(Short hydrogenSystemTemperatureProbeNum) { this.hydrogenSystemTemperatureProbeNum = hydrogenSystemTemperatureProbeNum; } public Integer getHydrogenSystemMaxConcentration() { return hydrogenSystemMaxConcentration; } public void setHydrogenSystemMaxConcentration(Integer hydrogenSystemMaxConcentration) { this.hydrogenSystemMaxConcentration = hydrogenSystemMaxConcentration; } public Short getHydrogenSystemConcentrationProbeNum() { return hydrogenSystemConcentrationProbeNum; } public void setHydrogenSystemConcentrationProbeNum(Short hydrogenSystemConcentrationProbeNum) { this.hydrogenSystemConcentrationProbeNum = hydrogenSystemConcentrationProbeNum; } public Integer getHydrogenSystemMaxPressure() { return hydrogenSystemMaxPressure; } public void setHydrogenSystemMaxPressure(Integer hydrogenSystemMaxPressure) { this.hydrogenSystemMaxPressure = hydrogenSystemMaxPressure; } public Short getHydrogenSystemPressureProbeNum() { return hydrogenSystemPressureProbeNum; } public void setHydrogenSystemPressureProbeNum(Short hydrogenSystemPressureProbeNum) { this.hydrogenSystemPressureProbeNum = hydrogenSystemPressureProbeNum; } public Short getDcStatus() { return dcStatus; } public void setDcStatus(Short dcStatus) { this.dcStatus = dcStatus; } }
[ "13787295142@163.com" ]
13787295142@163.com
2320332ace677c5a76494cd0910b759ec9db20c7
a15f8e4c24f061a73384a8a4e3fa6e01c2c06c4c
/twitter4j-core/src/main/java/twitter4j/internal/json/SimilarPlacesImpl.java
3fd1d5349c49f76f2edce18da4c69514781457ce
[ "Apache-2.0", "JSON" ]
permissive
Sanchay-Sethi/twitter4j
c443a8a1646845fff81f3d969056d92496047f95
c2b13065aab449c72c298ec28e77ba45db16cb0d
refs/heads/master
2020-08-11T20:44:39.280343
2013-11-21T03:31:18
2013-11-21T03:31:18
214,624,174
0
0
Apache-2.0
2019-10-12T10:03:14
2019-10-12T10:03:14
null
UTF-8
Java
false
false
2,097
java
/* * Copyright 2007 Yusuke Yamamoto * * 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 twitter4j.internal.json; import twitter4j.Place; import twitter4j.ResponseList; import twitter4j.SimilarPlaces; import twitter4j.TwitterException; import twitter4j.conf.Configuration; import twitter4j.internal.http.HttpResponse; import twitter4j.internal.org.json.JSONException; import twitter4j.internal.org.json.JSONObject; /** * @author Yusuke Yamamoto - yusuke at mac.com * @since Twitter4J 2.1.7 */ public class SimilarPlacesImpl extends ResponseListImpl<Place> implements SimilarPlaces { private static final long serialVersionUID = -7897806745732767803L; private final String token; SimilarPlacesImpl(ResponseList<Place> places, HttpResponse res, String token) { super(places.size(), res); this.addAll(places); this.token = token; } /** * {@inheritDoc} */ @Override public String getToken() { return token; } /*package*/ static SimilarPlaces createSimilarPlaces(HttpResponse res, Configuration conf) throws TwitterException { JSONObject json = null; try { json = res.asJSONObject(); JSONObject result = json.getJSONObject("result"); return new SimilarPlacesImpl(PlaceJSONImpl.createPlaceList(result.getJSONArray("places"), res, conf), res , result.getString("token")); } catch (JSONException jsone) { throw new TwitterException(jsone.getMessage() + ":" + json.toString(), jsone); } } }
[ "yusuke@mac.com" ]
yusuke@mac.com
f9be380abf1e37a32b26fedef5005e1e9ca18323
213b156ffb07b08325a1cfa5478f347342093a2e
/src/main/java/com/acme/order/OrderFactory.java
cca1688828b87e241b83ecb212e76d0916761227
[]
no_license
ppodkowinski/jm-tutorial2
8c2c36871df43e6f3cfd418e3bc8bf922368718e
90edc07ffafc948b2b19545349c649d5d41cda35
refs/heads/master
2020-12-13T12:52:28.106579
2015-07-08T07:03:09
2015-07-08T07:03:09
38,600,975
0
0
null
null
null
null
UTF-8
Java
false
false
116
java
package com.acme.order; public interface OrderFactory { PizzaOrder create(Customer customer, PizzaType type); }
[ "macprus@gmail.com" ]
macprus@gmail.com
5c046201496c0b2f9f244ee9d5ba930a07ab993e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/11/11_2f3748c234582725b7b3ee8e37eedf1d34cdfa0c/UnixPlatformHelper/11_2f3748c234582725b7b3ee8e37eedf1d34cdfa0c_UnixPlatformHelper_s.java
3683faa0bbe0281bf367b3f8e17193a1d23cfcdc
[]
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
5,849
java
/** * UnixPlatformHelper * 29.03.2012 * @author Philipp Haussleiter * */ package helper.unix; import helper.unix.parser.DetectPlatformPP; import helper.unix.parser.DetectDistributionVersionPP; import helper.unix.parser.DetectDistributionNamePP; import helper.unix.parser.ListPackagePP; import helper.PlatformHelper; import helper.SystemHelper; import helper.unix.parser.DetectHostPP; import helper.unix.parser.SearchPackagePP; import helper.unix.parser.UpdatePackagePP; import helper.unix.parser.UpgradePackagePP; import java.util.List; import models.AppPackage; import models.Distribution; import models.Host; import models.Platform; import play.Logger; /** * * @author philipp */ public class UnixPlatformHelper extends SystemHelper implements PlatformHelper { //private static UnixPlatformHelper instance = new UnixPlatformHelper(); private UnixPlatformHelper() { super(); } public static UnixPlatformHelper getInstance() { //return instance; return new UnixPlatformHelper(); } /** * First character: The possible value for the first character. The first character signifies the desired state, like we (or some user) is marking the package for installation u: Unknown (an unknown state) i: Install (marked for installation) r: Remove (marked for removal) p: Purge (marked for purging) h: Hold Second Character: The second character signifies the current state, whether it is installed or not. The possible values are n: Not- The package is not installed i: Inst – The package is successfully installed c: Cfg-files – Configuration files are present u: Unpacked- The package is stilled unpacked f: Failed-cfg- Failed to remove configuration files h: Half-inst- The package is only partially installed W: trig-aWait t: Trig-pend */ public List<AppPackage> listPackages() { ListPackagePP pp = new ListPackagePP(); pp.setDistribution(distribution); pp.setHost(host); runCommand(pp.getCommand(), pp); return pp.getPackages(); } public List<String> searchPackage(String query) { SearchPackagePP sp = new SearchPackagePP(distribution); runCommand(sp.getCommand(query), sp); return sp.getOutput(); } public boolean installPackage(String packageName) { throw new UnsupportedOperationException("Not supported yet."); } public boolean removePackage(String packageName) { throw new UnsupportedOperationException("Not supported yet."); } public void updateRepository() { throw new UnsupportedOperationException("Not supported yet."); } /** * cat /etc/issue -a, --all print all information, in the following order, except omit -p and -i if unknown: -s, --kernel-name print the kernel name -n, --nodename print the network node hostname -r, --kernel-release print the kernel release -v, --kernel-version print the kernel version -m, --machine print the machine hardware name -p, --processor print the processor type or "unknown" -i, --hardware-platform print the hardware platform or "unknown" -o, --operating-system print the operating system */ public Platform detectPlatform() { DetectPlatformPP dp = new DetectPlatformPP(this.distribution); runCommand(dp.getCommand(), dp); platform = dp.getPlatform(); platform.distribution = distribution.save(); Logger.info("Platform: " + platform); return platform.save(); } public Distribution dectectDistribution() { String command = "ls -a1 /etc/"; DetectDistributionNamePP ddn = new DetectDistributionNamePP(); runCommand(command, ddn); DetectDistributionVersionPP ddv = new DetectDistributionVersionPP(ddn.getName()); runCommand(ddv.getCommand(), ddv); distribution = Distribution.findOrCreateByNameAndVersion(ddn.getName(), ddv.getVersion()); Logger.info("Distribution: " + distribution); return distribution.save(); } public Host detectHost() { DetectHostPP dh = new DetectHostPP(host); String command = "hostname && " + "dnsdomainname"; runCommand(command, dh); host = dh.getHost(); Logger.info("Host: " + host); return host; } public List<String> updatedPackages() { UpdatePackagePP up = new UpdatePackagePP(this.distribution); runCommand(up.getCommand(), up); return up.getOutput(); } public List<String> upgradeDistribution() { UpgradePackagePP up = new UpgradePackagePP(this.distribution); runCommand(up.getCommand(), up); return up.getOutput(); } public void setHost(Host host) { this.host = host; platform = host.platform; distribution = host.getDistribution(); /** * thx to http://linuxcommando.blogspot.com/2008/10/how-to-disable-ssh-host-key-checking.html. */ sshCmdPrefix = " ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no " + host.user + "@" + host.ip; /** * thx to http://freeunixtips.com/2009/03/ssh-pw-prompt/ */ sshCheckPrefix = "ssh " + this.host.user + "@" + this.host.ip + " -qo PasswordAuthentication=no echo 0 || echo 1"; } public Host getHost() { host.platform = platform.save(); return host.save(); } public Distribution getDistribution() { return this.distribution; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
fd3d0eb33ad4caae30c5a3b127b7b61046557be2
94adcfc05863da01716046cb582ae7eaff4395c2
/src/main/java/com/andy/netty/server/Server.java
f007604ac9d0bbdbb8785ccf8e9750a7292f34bc
[]
no_license
lookskystar/mavenNettyChat
e78f915416e324158da20f21bac312d168834ec7
08685a26f1cd9c23c2caaa8bf5bd2a762c34ed55
refs/heads/master
2020-03-08T21:35:23.270383
2018-04-07T08:17:16
2018-04-07T08:17:16
128,409,693
0
0
null
null
null
null
UTF-8
Java
false
false
4,395
java
package com.andy.netty.server; import com.andy.netty.im.common.IMConfig; import com.andy.netty.im.common.IMMessage; import com.andy.netty.im.common.MsgPackDecode; import com.andy.netty.im.common.MsgPackEncode; import com.andy.netty.server.handler.ServerHandler; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.codec.LengthFieldBasedFrameDecoder; import io.netty.handler.codec.LengthFieldPrepender; import java.io.IOException; import java.util.Scanner; /** * 服务器程序Server * 接收客户端连接,如果没有客户端连接过,就保存ChannelHandlerConetext到Map中用于发送消息。然后判断消息接收方是否在线。 * 若在线就直接发送消息,没有在线就返回“对方不在线”。当然,可以将消息发送者和消息接收者ID设置为相同就能仅开一个客户端, * 自己和自己聊天(Echo Server) * * @author Andy * @create 2018-04-06-20:13 */ public class Server implements Runnable,IMConfig { ServerHandler serverHandler=new ServerHandler(); public static void main(String[] args) throws Exception { new Server().start(); } /** * MsgPackDecode和MsgPackEncode用于消息的编解码。 * 使用的是MessagePack(编码后字节流特小,编解码速度超快,同时几乎支持所有主流编程语言, * 详情见官网:http://msgpack.org/)。这样我们可以随意编写实体用于发送消息,他们的代码将在后面给出。 * LengthFieldBasedFrameDecoder和LengthFieldPrepender:因为TCP底层传输数据时是不了解上层业务的, * 所以传输消息的时候很容易造成粘包/半包的情况 * (一条完整的消息被拆开或者完整或者不完整的多条消息被合并到一起发送、接收), * 这两个工具就是Netty提供的消息编码工具,2表示消息长度(不是正真的长度为2,是2个字节)。 */ public void run() { EventLoopGroup bossGroup=new NioEventLoopGroup(); EventLoopGroup workerGroup =new NioEventLoopGroup(); try{ ServerBootstrap b=new ServerBootstrap(); b.group(bossGroup,workerGroup).channel(NioServerSocketChannel.class) .option(ChannelOption.SO_BACKLOG,1024) .childHandler(new ChannelInitializer<SocketChannel>(){ @Override public void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast("frameDecoder", new LengthFieldBasedFrameDecoder(65536, 0, 2, 0, 2)); ch.pipeline().addLast("msgpack decoder",new MsgPackDecode()); ch.pipeline().addLast("frameEncoder", new LengthFieldPrepender(2)); ch.pipeline().addLast("msgpack encoder",new MsgPackEncode()); ch.pipeline().addLast(serverHandler); } }); ChannelFuture f=b.bind(SERVER_PORT).sync(); f.channel().closeFuture().sync(); }catch ( Exception e){ e.printStackTrace(); }finally { workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); } } public void start() throws Exception{ new Thread(this).start(); runServerCMD(); } /** * 启动服务端控制台输入,可以给指定ID的客户推送消息(推送服务器就是这么来的) * @throws IOException */ private void runServerCMD() throws IOException{ //服务端主动推送消息 int toID=1; IMMessage message=new IMMessage( APP_IM, CLIENT_VERSION, SERVER_ID, TYPE_MSG_TEXT, toID, MSG_EMPTY); @SuppressWarnings("resource") Scanner scanner=new Scanner(System.in); do { message.setMsg(scanner.nextLine()); }while(serverHandler.sendMsg(message)); } }
[ "lookskystar@163.com" ]
lookskystar@163.com
5ca3ef04f276538c2eb092c953f3ef0bbb8c96c3
ef21d7fbcbcb55d579d9f8ac8bace10bae59bad6
/myappback/src/main/java/com/dena/controllers/LettreMotivationController.java
eb0336f94c4524333b62929613359bc66ceadda2
[]
no_license
LaghzaliTaha/supercv
45ae9475ebb5a6a59ff9384580e47e7891e593ec
e10d7424fa6f9575e0ea673eb365f270c5018cca
refs/heads/master
2021-01-11T05:48:08.968436
2016-10-23T19:19:06
2016-10-23T19:19:06
71,724,176
1
0
null
null
null
null
UTF-8
Java
false
false
2,451
java
package com.dena.controllers; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.dena.entities.LettreMotivation; import com.dena.service.ILettreMotivationService; @RestController @RequestMapping("/lettremotivation") public class LettreMotivationController { @Autowired private ILettreMotivationService lettreMotivationService ; @RequestMapping(value="/find/domaine/{domaine}",method=RequestMethod.GET) public List<LettreMotivation> findByDomaine(@PathVariable String domaine) { return lettreMotivationService.findByDomaine(domaine); } @RequestMapping(value="/find/typecontrat/{typecontrat}",method=RequestMethod.GET) public List<LettreMotivation> findByTypeContrat(@PathVariable String typecontrat) { return lettreMotivationService.findByTypeContrat(typecontrat); } @RequestMapping(value="/find/post/{post}",method=RequestMethod.GET) public List<LettreMotivation> findByPost(@PathVariable String post) { return lettreMotivationService.findByPost(post); } @RequestMapping(value="/find/nomentreprise/{id}",method=RequestMethod.GET) public List<LettreMotivation> findByNomEntreprise(@PathVariable String nomentreprise) { return lettreMotivationService.findByNomEntreprise(nomentreprise); } @RequestMapping(method=RequestMethod.POST) public LettreMotivation save(@RequestBody LettreMotivation lettreMotivation) { return lettreMotivationService.save(lettreMotivation); } @RequestMapping(method=RequestMethod.GET) public List<LettreMotivation> findAll() { return lettreMotivationService.findAll(); } @RequestMapping(value="/find/{id}",method=RequestMethod.GET) public LettreMotivation findById(@PathVariable long id) { return lettreMotivationService.findById(id); } @RequestMapping(value="/delete/{id}",method=RequestMethod.DELETE) public void delete(@PathVariable long id) { lettreMotivationService.delete(id); } @RequestMapping( value="/update/{id}",method=RequestMethod.PUT) public LettreMotivation update(@ PathVariable long id,@RequestBody LettreMotivation lettreMotivation) { return lettreMotivationService.update(id,lettreMotivation); } }
[ "laghzalitaha0@gmail.com" ]
laghzalitaha0@gmail.com
4dde22957293b3065e5159ab3fe94865d4fc33d3
12b9548baa733e73e682e8e71e0ff6e83e0deccc
/app/src/main/java/me/anjas/educationvee/adapters/JobsheetAdapter.java
c2852affe56f15cac9ea13a8a72cb3e72cceaa8a
[]
no_license
anjas29/EdVee
09529f86bb92f211f8a215fb40f3573df54516fc
f937e7c8061db39805f8ca9306a7d70ce41f6449
refs/heads/master
2021-01-21T19:01:53.555146
2017-07-31T12:41:51
2017-07-31T12:41:51
92,108,766
0
0
null
null
null
null
UTF-8
Java
false
false
1,863
java
package me.anjas.educationvee.adapters; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.ArrayList; import me.anjas.educationvee.R; import me.anjas.educationvee.objects.Jobsheet; /** * Created by anjas on 30/07/17. */ public class JobsheetAdapter extends RecyclerView.Adapter<JobsheetViewHolder> { private Context context; private ArrayList<Jobsheet> itemList; public JobsheetAdapter(Context context, ArrayList<Jobsheet> itemList) { super(); this.context = context; this.itemList = itemList; } @Override public JobsheetViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View layoutView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_jobsheet, null); JobsheetViewHolder view = new JobsheetViewHolder(layoutView); return view; } @Override public void onBindViewHolder(JobsheetViewHolder holder, int position) { holder.titleView.setText(itemList.get(position).getTitle()); holder.descriptionView.setText(itemList.get(position).getDescription()); switch (itemList.get(position).getStatus()){ case 0: holder.statusImage.setImageResource(R.drawable.gray_circle); break; case 1: holder.statusImage.setImageResource(R.drawable.blue_circle); break; case 2: holder.statusImage.setImageResource(R.drawable.green_circle); break; default: holder.statusImage.setImageResource(R.drawable.gray_circle); break; } } @Override public int getItemCount() { return itemList.size(); } }
[ "anjasmoro.adi29@gmail.com" ]
anjasmoro.adi29@gmail.com
ba362abd7058eb81fff75b18b727429e21ea6a1e
530e02cb5491d02d764c8f79c66b5b7722eb41c1
/AmapLibrary/src/main/java/com/map/library/service/utils/LocationStatusManager.java
13a382126fe3325fbd0943769480bee1f13c85bd
[]
no_license
wangzm05/YisinglePassenger
7ee30eebce3efb292b4f40719aaf2ea5e2900583
660c0690541747438afcd8bb9e0feb3e20201f26
refs/heads/master
2020-07-29T21:17:54.159885
2018-11-01T10:10:48
2018-11-01T10:10:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,604
java
package com.map.library.service.utils; import android.content.Context; import android.content.SharedPreferences; import com.amap.api.location.AMapLocation; import static android.content.Context.MODE_PRIVATE; /** * Created by liangchao_suxun on 17/1/16. * 在定位失败的情况下,用于判断当前定位错误是否是由于息屏导致的网络关闭引起的。 * 判断逻辑仅限于处理设备仅有wifi信号的情况下 */ public class LocationStatusManager { /** * 上一次的定位是否成功 */ private boolean mPriorSuccLocated = false; /** * 屏幕亮时可以定位 */ private boolean mPirorLocatableOnScreen = false; static class Holder { public static LocationStatusManager instance = new LocationStatusManager(); } public static LocationStatusManager getInstance() { return Holder.instance; } /** * 由于仅仅处理只有wifi连接的情况下,如果用户手机网络可连接,那么忽略。 * 定位成功时,重置为定位成功的状态 * * @param isScreenOn 当前屏幕是否为点亮状态 * @param isMobileable 是否有手机信号 */ public void onLocationSuccess(Context context, boolean isScreenOn, boolean isMobileable) { if (isMobileable) { return; } mPriorSuccLocated = true; if (isScreenOn) { mPirorLocatableOnScreen = true; saveStateInner(context, true); } } /** * reset到默认状态 * * @param context context */ public void resetToInit(Context context) { this.mPirorLocatableOnScreen = false; this.mPriorSuccLocated = false; saveStateInner(context, false); } /** * 由preference初始化。特别是在定位服务重启的时候会进行初始化 */ public void initStateFromPreference(Context context) { if (!isLocableOnScreenOn(context)) { return; } this.mPriorSuccLocated = true; this.mPirorLocatableOnScreen = true; } /** * 判断是否由屏幕关闭导致的定位失败。 * 只有在 网络可访问&&errorCode==4&&(priorLocated&&locatableOnScreen) && !isScreenOn 才认为是有息屏引起的定位失败 * 如果判断条件较为严格,请按需要适当修改 * * @param errorCode 定位错误码, 0=成功, 4=因为网络原因造成的失败 * @param isScreenOn 当前屏幕是否为点亮状态 */ public boolean isFailOnScreenOff(Context context, int errorCode, boolean isScreenOn, boolean isWifiable) { return !isWifiable && errorCode == AMapLocation.ERROR_CODE_FAILURE_CONNECTION && (mPriorSuccLocated && mPirorLocatableOnScreen) && !isScreenOn; } /** * 是否存在屏幕亮而且可以定位的情况的key */ private String IS_LOCABLE_KEY = "is_locable_key"; /** * IS_LOCABLE_KEY 的过期时间 */ private String LOCALBLE_KEY_EXPIRE_TIME_KEY = "localble_key_expire_time_key"; /** * 过期时间为10分钟 */ private static final long MINIMAL_EXPIRE_TIME = 30 * 60 * 1000; private static final String PREFER_NAME = LocationStatusManager.class.getSimpleName(); private static final long DEF_PRIOR_TIME_VAL = -1; /** * 如果isLocable,则存入正确的过期时间,否则存默认值 * * @param context context * @param isLocable isLocable */ public void saveStateInner(Context context, boolean isLocable) { SharedPreferences sharedPreferences = context.getSharedPreferences(PREFER_NAME, MODE_PRIVATE); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putBoolean(IS_LOCABLE_KEY, isLocable); editor.putLong(LOCALBLE_KEY_EXPIRE_TIME_KEY, isLocable ? System.currentTimeMillis() : DEF_PRIOR_TIME_VAL); editor.apply(); } /** * 从preference读取,判断是否存在网络状况ok,而且亮屏情况下,可以定位的情况 */ public boolean isLocableOnScreenOn(Context context) { SharedPreferences sharedPreferences = context.getSharedPreferences(PREFER_NAME, MODE_PRIVATE); boolean res = sharedPreferences.getBoolean(IS_LOCABLE_KEY, false); long priorTime = sharedPreferences.getLong(LOCALBLE_KEY_EXPIRE_TIME_KEY, DEF_PRIOR_TIME_VAL); if (System.currentTimeMillis() - priorTime > MINIMAL_EXPIRE_TIME) { saveStateInner(context, false); return false; } return res; } }
[ "j314815101@qq.com" ]
j314815101@qq.com
2211ba971a4144d6f9f9ec520b2e6a21aa61e312
9688be7aad325f771807a3bc5cfc83760d4e42a5
/comm/hybris/bin/custom/gift/giftstorefront/web/testsrc/com/hybris/gift/storefront/controllers/cms/ProductReferencesComponentControllerTest.java
fe664698f2180f7a6c73ce038d38504955e876c9
[]
no_license
GauravShukla2/super-winner
f76f391299b87843d05b5085662c92448daf4954
7f85794b0b8e595196d6c0bf37c7ac64d5e177e3
refs/heads/master
2021-01-10T17:24:41.352140
2016-02-25T17:34:53
2016-02-25T17:34:53
52,066,635
0
0
null
null
null
null
UTF-8
Java
false
false
7,058
java
/* * [y] hybris Platform * * Copyright (c) 2000-2014 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with hybris. * * */ package com.hybris.gift.storefront.controllers.cms; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.verify; import de.hybris.bootstrap.annotations.UnitTest; import de.hybris.platform.acceleratorcms.model.components.ProductReferencesComponentModel; import de.hybris.platform.acceleratorservices.data.RequestContextData; import de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController; import de.hybris.platform.catalog.enums.ProductReferenceTypeEnum; import de.hybris.platform.cms2.exceptions.CMSItemNotFoundException; import de.hybris.platform.cms2.servicelayer.services.impl.DefaultCMSComponentService; import de.hybris.platform.commercefacades.product.ProductFacade; import de.hybris.platform.commercefacades.product.data.ProductReferenceData; import de.hybris.platform.core.model.product.ProductModel; import com.hybris.gift.storefront.controllers.ControllerConstants; import java.util.Arrays; import java.util.Collections; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import junit.framework.Assert; import org.apache.commons.lang.StringUtils; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.springframework.ui.Model; /** * Unit test for {@link ProductReferencesComponentController} */ @UnitTest public class ProductReferencesComponentControllerTest { private static final String COMPONENT_UID = "componentUid"; private static final String TEST_COMPONENT_UID = "componentUID"; private static final String TEST_TYPE_CODE = "myTypeCode"; private static final String TEST_TYPE_VIEW = ControllerConstants.Views.Cms.ComponentPrefix + StringUtils.lowerCase(TEST_TYPE_CODE); private static final String TITLE = "title"; private static final String TITLE_VALUE = "Accessories"; private static final String PRODUCT_REFERENCES = "productReferences"; private static final String COMPONENT = "component"; @Mock private ProductReferencesComponentModel productReferencesComponentModel; @Mock private Model model; @Mock private DefaultCMSComponentService cmsComponentService; @Mock private ProductFacade productFacade; @Mock private HttpServletRequest request; @Mock private HttpServletResponse response; @Mock private ProductReferenceData productReferenceData; private final RequestContextData requestContextData = new RequestContextData(); private final List<ProductReferenceData> productReferenceDataList = Collections.singletonList(productReferenceData); @InjectMocks private final ProductReferencesComponentController productReferencesComponentController = new ProductReferencesComponentController() { @Override protected RequestContextData getRequestContextData(final HttpServletRequest request) { return requestContextData; } }; @Before public void setUp() { MockitoAnnotations.initMocks(this); } @Test public void testRenderComponent() throws Exception { given(productReferencesComponentModel.getMaximumNumberProducts()).willReturn(Integer.valueOf(1)); given(productReferencesComponentModel.getTitle()).willReturn(TITLE_VALUE); given(productReferencesComponentModel.getProductReferenceTypes()).willReturn( Arrays.asList(ProductReferenceTypeEnum.ACCESSORIES)); given(productReferencesComponentModel.getItemtype()).willReturn(TEST_TYPE_CODE); requestContextData.setProduct(new ProductModel()); given( productFacade.getProductReferencesForCode(Mockito.anyString(), Mockito.anyList(), Mockito.any(List.class), Mockito.<Integer> any())).willReturn(productReferenceDataList); final String viewName = productReferencesComponentController.handleComponent(request, response, model, productReferencesComponentModel); verify(model, Mockito.times(1)).addAttribute(TITLE, TITLE_VALUE); verify(model, Mockito.times(1)).addAttribute(PRODUCT_REFERENCES, productReferenceDataList); Assert.assertEquals(TEST_TYPE_VIEW, viewName); } @Test public void testRenderComponentUid() throws Exception { given(request.getAttribute(COMPONENT_UID)).willReturn(TEST_COMPONENT_UID); given(cmsComponentService.getAbstractCMSComponent(TEST_COMPONENT_UID)).willReturn(productReferencesComponentModel); given(productReferencesComponentModel.getMaximumNumberProducts()).willReturn(Integer.valueOf(1)); given(productReferencesComponentModel.getTitle()).willReturn(TITLE_VALUE); given(productReferencesComponentModel.getProductReferenceTypes()).willReturn( Arrays.asList(ProductReferenceTypeEnum.ACCESSORIES)); given(productReferencesComponentModel.getItemtype()).willReturn(TEST_TYPE_CODE); requestContextData.setProduct(new ProductModel()); given( productFacade.getProductReferencesForCode(Mockito.anyString(), Mockito.anyList(), Mockito.any(List.class), Mockito.<Integer> any())).willReturn(productReferenceDataList); final String viewName = productReferencesComponentController.handleGet(request, response, model); verify(model, Mockito.times(1)).addAttribute(COMPONENT, productReferencesComponentModel); verify(model, Mockito.times(1)).addAttribute(TITLE, TITLE_VALUE); verify(model, Mockito.times(1)).addAttribute(PRODUCT_REFERENCES, productReferenceDataList); Assert.assertEquals(TEST_TYPE_VIEW, viewName); } @Test(expected = AbstractPageController.HttpNotFoundException.class) public void testRenderComponentNotFound() throws Exception { given(request.getAttribute(COMPONENT_UID)).willReturn(null); given(request.getParameter(COMPONENT_UID)).willReturn(null); productReferencesComponentController.handleGet(request, response, model); } @Test(expected = AbstractPageController.HttpNotFoundException.class) public void testRenderComponentNotFound2() throws Exception { given(request.getAttribute(COMPONENT_UID)).willReturn(null); given(request.getParameter(COMPONENT_UID)).willReturn(TEST_COMPONENT_UID); given(cmsComponentService.getSimpleCMSComponent(TEST_COMPONENT_UID)).willReturn(null); productReferencesComponentController.handleGet(request, response, model); } @Test(expected = AbstractPageController.HttpNotFoundException.class) public void testRenderComponentNotFound3() throws Exception { given(request.getAttribute(COMPONENT_UID)).willReturn(TEST_COMPONENT_UID); given(cmsComponentService.getSimpleCMSComponent(TEST_COMPONENT_UID)).willReturn(null); given(cmsComponentService.getSimpleCMSComponent(TEST_COMPONENT_UID)).willThrow(new CMSItemNotFoundException("")); productReferencesComponentController.handleGet(request, response, model); } }
[ "gshukla2@sapient.com" ]
gshukla2@sapient.com
1905760a76de785214eba3d84dd4cae6d90f3a27
f2a5bfe3acbf4da3165ab9a144a790f2c60fb0f1
/app/src/main/java/com/example/dzulfikar/utsakb/presenter/MainActivityPresenter.java
32ff92085fff0c576c336b4992effe9668bdc278
[]
no_license
dzulf21/biodata
58290074c60cf516707184ca1bbf977eed94cdf9
216695a4c27cb29fdf9a41c9a505191b49834f35
refs/heads/master
2020-05-24T20:59:40.894995
2019-05-19T11:35:44
2019-05-19T11:35:44
187,466,242
0
0
null
null
null
null
UTF-8
Java
false
false
870
java
package com.example.dzulfikar.utsakb.presenter; import com.example.dzulfikar.utsakb.model.FriendModel; import com.example.dzulfikar.utsakb.view.FriendView; //Nama : Dzulfikar Miandro Akbar S //NIM : 10116358 //KLS : IF 8 //TGL : 8 Mei 2019 public class MainActivityPresenter implements FriendPresenter{ private FriendView friendView; private FriendModel friend = new FriendModel(); public MainActivityPresenter (FriendView friendView){ this.friendView = friendView; } @Override public void updateNamaFriend(String namaFriend) { friend.setNamaFriend(namaFriend); friendView.updateUserInfoTextView(friend.toString()); } @Override public void updateEmailFriend(String emailFriend) { friend.setEmailFriend(emailFriend); friendView.updateUserInfoTextView(friend.toString()); } }
[ "dzulfikarm21@gmail.com" ]
dzulfikarm21@gmail.com
b3f4ef1ebf8efde737bd2d4eebc1255e242ac351
693c8a6613c517d1c4b0c626c20afeb466007cbc
/src/main/java/cn/openadr/model/report/ReportSpecifier.java
ea4630976d5609e37f18af57cf5703b1d39719ed
[ "Apache-2.0" ]
permissive
jingrunx/openadr-dxp
6aec23c81016c4ddd6f2a50421ae9d0e1ac35c96
84f210c86bf7cbaf1d62f2b7d98ab4f888afb2d3
refs/heads/master
2021-08-15T20:30:54.797058
2020-12-06T11:39:14
2020-12-06T11:39:14
229,769,587
0
0
null
null
null
null
UTF-8
Java
false
false
1,611
java
package cn.openadr.model.report; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import org.joda.time.DateTime; import org.joda.time.Period; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import cn.openadr.domain.ReportType; import cn.openadr.jackson.EnumeratedSerializer; /** * 为报告数据准备的格式样式 */ // ReportSpecifierType @lombok.Getter @lombok.Setter @lombok.NoArgsConstructor public class ReportSpecifier implements Serializable { private static final long serialVersionUID = cn.openadr.Version.V1; /** * 要报告的rID清单 */ public final List<Integer> points = new ArrayList<>(); /** * 报告样式编号 */ public String reportSpecifierID; /** * 报告名称 */ /* cn.openadr.domain.ReportName */ public String reportName; /** * 报告类型 */ @JsonSerialize(using = EnumeratedSerializer.class) @JsonDeserialize(using = ReportType.Deserializer.class) public ReportType reportType; /** * 开始报告时间 */ public DateTime startDateTime; /** * 取消报告时间,超过此时间后不再发送报告,为空表示一直发送直到收到取消报送指令 */ public DateTime endDateTime; /** * 报告周期,每隔多长时间报告一次 * 如果与granularity相同或者为PT0S,则相当于每次报送实时数据,用LiveReport格式报送 * 否则按照HistoryReport格式报送 */ public Period backDuration; /** * 曲线数据之间的采样间隔(granularity) */ public Period period; }
[ "jingrunx@hotmail.com" ]
jingrunx@hotmail.com
2f23a0f7a8dcff037522eb5d91d304d19934135f
ee1690c5b2220c2c9d9165c445d8a9d661988ab2
/ClickMe/src/com/clickme/colors/Colors_adapter.java
3b7f1fd73f0e13c6a4db0bee293a8cd5b39168b3
[]
no_license
EfrenAL/Android
a83bd760b2156dbac0c1b73fa9e41cea7f169875
c1ff2a91ed04ab72ef35da9d8c375e80ea4c655d
refs/heads/master
2016-09-05T15:13:07.208007
2015-05-10T21:05:31
2015-05-10T21:05:31
30,434,923
0
0
null
null
null
null
UTF-8
Java
false
false
2,492
java
package com.clickme.colors; import java.util.ArrayList; import com.clickme.R; import com.clickme.contactos.Contacts_adapter.RecordHolder; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.LayerDrawable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; @SuppressLint("NewApi") public class Colors_adapter extends ArrayAdapter<String>{ int color_selected; Context context; ArrayList<String> colors = new ArrayList<String>(); //Id correspondiente al Layout del item del contacto int layoutResourceId; public Colors_adapter(Context context, int layoutResourceId, ArrayList<String> colors, int color_selected) { super(context, layoutResourceId,colors); this.colors = colors; this.context = context; this.layoutResourceId = layoutResourceId; this.color_selected = color_selected; } @Override public View getView(int position, View convertView, ViewGroup parent) { View row = convertView; RecordHolder holder = null; if (row == null) { LayoutInflater inflater = ((Activity) context).getLayoutInflater(); row = inflater.inflate(layoutResourceId, parent, false); holder = new RecordHolder(); holder.circle = (ImageButton) row.findViewById(R.id.b_circle); row.setTag(holder); } else { holder = (RecordHolder) row.getTag(); } /* if (holder.circle.getVisibility() == View.VISIBLE) { holder.circle.setVisibility(View.VISIBLE); }else{ holder.circle.setVisibility(View.INVISIBLE); } holder.circle.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(v.getVisibility() == View.INVISIBLE){ v.setVisibility(View.VISIBLE); }else{ v.setVisibility(View.INVISIBLE); } } });*/ if (position == color_selected) { holder.circle.setVisibility(View.VISIBLE); } String color_item = colors.get(position); GradientDrawable gradient = (GradientDrawable) this.context.getResources().getDrawable(R.drawable.circle_color); gradient.setColor(Color.parseColor(color_item)); row.setBackground(gradient); return row; } public static class RecordHolder { ImageButton circle; } }
[ "efrenalla@gmail.com" ]
efrenalla@gmail.com
8c11d327e39ccda212dbec029c6fce98ceeb253e
4218cf282963e98cd8c4751791bbaa45d58df922
/Hospital/src/Registration.java
5ec9e9262aa7ff8744761d387c36592d961addb0
[]
no_license
Shcherbakovaolia/Tinkoff
7a2b26f08379d8e2165ce01ac7359f4d208eb25b
06e13547a7d978b8cd349accde363862a42ee167
refs/heads/master
2021-01-08T06:03:41.838547
2020-04-09T14:06:34
2020-04-09T14:06:34
241,935,511
0
0
null
null
null
null
UTF-8
Java
false
false
3,254
java
//класс для регистрации пациента import java.util.*; //Класс, в котором находится регистрация public class Registration implements Comparable<Registration> { public String fullName; public boolean gender; public int isOld;//переменная для того чтобы указать, что пациент пенсионер или нет Calendar dateOfBirth; public Registration(String fullName, boolean gender, int day, int month, int year) { this.fullName = fullName; this.gender = gender; this.dateOfBirth = new GregorianCalendar(year, month, day); this.isOld = isOldMan();//устанавливаем статус пенсионера, для сортировки в очереди } //переопределяем метод .toString() для вывода информации о пациенте @Override public String toString() { String gender1 = (this.gender) ? "мужской" : "женский"; return ("ФИО: " + this.fullName + ", пол: " + gender1 + ", дата рождения: " + this.dateOfBirth.get(Calendar.DAY_OF_MONTH) + "." + this.dateOfBirth.get(Calendar.MONTH) + "." + this.dateOfBirth.get(Calendar.YEAR)); } // переопределяем компаратор для определения приоритета очереди @Override public int compareTo(Registration r1) { return Integer.compare(r1.isOld,this.isOld); } //проверка, является ли пациент пенсионером private int isOldMan() { int year = (this.gender)? 1955 : 1960; boolean check = (year-this.dateOfBirth.get(Calendar.YEAR)>=0); return (check)? 1:0; } } /* Scanner scanner = new Scanner(System.in); Scanner scanner1 = new Scanner(System.in); Scanner scanner2 = new Scanner(System.in); Registration patient1 = new Registration("Иванов Иван Иванович", "Мужчина", "12.03.2000"); Registration patient2 = new Registration("Петров Петр Петрович", "Мужчина", "27.01.1943"); Registration patient3 = new Registration("Сидорова Марина Васильевна", "Женщина", "06.10.1955"); Registration patient4 = new Registration("Сидоров Антон Викторович", "Мужчина", "20.07.1930"); Registration patient5 = new Registration("Иванова Наталья Олеговна", "Женщина", "04.02.2003"); Registration patient6 = new Registration("Петрова Екатерина Михайловна", "Женщина", "19.11.1998"); Registration patient7 = new Registration("Иванов Илья Андреевич", "Мужчина", "30.12.1994"); Registration patient8 = new Registration("Сидорова Валерия Максимовна", "Женщина", "21.08.1976"); Registration patient9 = new Registration("Петров Артем Николаевич", "Мужчина", "17.05.2003"); Registration patient10 = new Registration(scanner.next(), scanner1.next(), scanner2.next()); }*/
[ "schcerbakovaolia@yandex.ru" ]
schcerbakovaolia@yandex.ru
eca9f578862af724b78374cc97206c330b4e8a17
9e20645e45cc51e94c345108b7b8a2dd5d33193e
/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/gameserver/network/serverpackets/WareHouseWithdrawalList.java
4d67baed72c37f206a7131fba18b63992d7d2502
[]
no_license
Enryu99/L2jMobius-01-11
2da23f1c04dcf6e88b770f6dcbd25a80d9162461
4683916852a03573b2fe590842f6cac4cc8177b8
refs/heads/master
2023-09-01T22:09:52.702058
2021-11-02T17:37:29
2021-11-02T17:37:29
423,405,362
2
2
null
null
null
null
UTF-8
Java
false
false
1,867
java
/* * This file is part of the L2J Mobius project. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.l2jmobius.gameserver.network.serverpackets; import java.util.List; import org.l2jmobius.gameserver.model.actor.instance.ItemInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; public class WareHouseWithdrawalList extends ServerBasePacket { private final PlayerInstance _cha; private final int _money; public WareHouseWithdrawalList(PlayerInstance cha) { _cha = cha; _money = cha.getAdena(); } @Override public void writeImpl() { writeC(0x54); writeD(_money); final int count = _cha.getWarehouse().getSize(); writeH(count); final List<ItemInstance> items = _cha.getWarehouse().getItems(); for (int i = 0; i < count; ++i) { final ItemInstance temp = items.get(i); writeH(temp.getItem().getType1()); writeD(temp.getObjectId()); writeD(temp.getItemId()); writeD(temp.getCount()); writeH(temp.getItem().getType2()); writeH(100); writeD(400); writeH(temp.getEnchantLevel()); writeH(300); writeH(200); writeD(temp.getItemId()); } } }
[ "MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b" ]
MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b
e50168251eb27d03f3df883932dbd9c898ceb06c
5310421e26ec99060fd982065f572c7a45114f77
/src/main/java/wcl/pojo/UserInfo.java
af98bd50479cd5430fb435142f2eac88393e7959
[ "Apache-2.0" ]
permissive
YANG-sty/room
51a8c244a94a4fc9c9d75e14076945de7e7a2904
a1f98ab2ac85d9c7b5f27e79d685d48014b3f7fe
refs/heads/master
2023-05-31T17:18:33.106226
2021-06-22T08:53:12
2021-06-22T08:53:12
379,200,413
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
package wcl.pojo; public class UserInfo { private String userId; private String userPassword; private String userNickname; public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId == null ? null : userId.trim(); } public String getUserPassword() { return userPassword; } public void setUserPassword(String userPassword) { this.userPassword = userPassword == null ? null : userPassword.trim(); } public String getUserNickname() { return userNickname; } public void setUserNickname(String userNickname) { this.userNickname = userNickname == null ? null : userNickname.trim(); } }
[ "13849187852@163.com" ]
13849187852@163.com