blob_id
stringlengths 40
40
| __id__
int64 225
39,780B
| directory_id
stringlengths 40
40
| path
stringlengths 6
313
| content_id
stringlengths 40
40
| detected_licenses
list | license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| repo_url
stringlengths 25
151
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
70
| visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 7.28k
689M
⌀ | star_events_count
int64 0
131k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 23
values | gha_fork
bool 2
classes | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_updated_at
timestamp[ns] | gha_pushed_at
timestamp[ns] | gha_size
int64 0
40.4M
⌀ | gha_stargazers_count
int32 0
112k
⌀ | gha_forks_count
int32 0
39.4k
⌀ | gha_open_issues_count
int32 0
11k
⌀ | gha_language
stringlengths 1
21
⌀ | gha_archived
bool 2
classes | gha_disabled
bool 1
class | content
stringlengths 7
4.37M
| src_encoding
stringlengths 3
16
| language
stringclasses 1
value | length_bytes
int64 7
4.37M
| extension
stringclasses 24
values | filename
stringlengths 4
174
| language_id
stringclasses 1
value | entities
list | contaminating_dataset
stringclasses 0
values | malware_signatures
list | redacted_content
stringlengths 7
4.37M
| redacted_length_bytes
int64 7
4.37M
| alphanum_fraction
float32 0.25
0.94
| alpha_fraction
float32 0.25
0.94
| num_lines
int32 1
84k
| avg_line_length
float32 0.76
99.9
| std_line_length
float32 0
220
| max_line_length
int32 5
998
| is_vendor
bool 2
classes | is_generated
bool 1
class | max_hex_length
int32 0
319
| hex_fraction
float32 0
0.38
| max_unicode_length
int32 0
408
| unicode_fraction
float32 0
0.36
| max_base64_length
int32 0
506
| base64_fraction
float32 0
0.5
| avg_csv_sep_count
float32 0
4
| is_autogen_header
bool 1
class | is_empty_html
bool 1
class | shard
stringclasses 16
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a491c5e98b374827865ee0b784d205617699e239
| 16,346,645,589,091 |
53342b3920d57cb1c2f82ca790a6f760025f00f6
|
/src/main/java/com/acw/todoserver/controllers/TodoController.java
|
83a7887c0e6fb6f4beaee383a6213f50a0410d36
|
[] |
no_license
|
alex0acw/todo-server
|
https://github.com/alex0acw/todo-server
|
4929dd6e425c7eced54bbfa998d769486e00775e
|
53e0379931c82fad6bbedba35700e54e4782e3c4
|
refs/heads/master
| 2023-01-25T02:52:10.359000 | 2020-12-11T02:28:26 | 2020-12-11T02:28:26 | 320,410,915 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.acw.todoserver.controllers;
import com.acw.todoserver.entities.Tag;
import com.acw.todoserver.entities.Todo;
import com.acw.todoserver.service.TodoService;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/todos")
@ResponseBody
@CrossOrigin
public class TodoController {
private final TodoService todoService;
public TodoController(TodoService todoService) {
this.todoService = todoService;
}
@GetMapping
public List<Todo> getAllTodos() {
return todoService.getAll();
}
@DeleteMapping("/{id}")
public void deleteById(@PathVariable String id) {
todoService.deleteById(id);
}
@PutMapping("/{id}")
public Todo updateById(@PathVariable String id, @RequestBody Todo todo) {
return todoService.updateById(id, todo);
}
@PostMapping
public Todo createTag(@RequestBody Todo todo) {
return todoService.add(todo);
}
}
|
UTF-8
|
Java
| 988 |
java
|
TodoController.java
|
Java
|
[] | null |
[] |
package com.acw.todoserver.controllers;
import com.acw.todoserver.entities.Tag;
import com.acw.todoserver.entities.Todo;
import com.acw.todoserver.service.TodoService;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/todos")
@ResponseBody
@CrossOrigin
public class TodoController {
private final TodoService todoService;
public TodoController(TodoService todoService) {
this.todoService = todoService;
}
@GetMapping
public List<Todo> getAllTodos() {
return todoService.getAll();
}
@DeleteMapping("/{id}")
public void deleteById(@PathVariable String id) {
todoService.deleteById(id);
}
@PutMapping("/{id}")
public Todo updateById(@PathVariable String id, @RequestBody Todo todo) {
return todoService.updateById(id, todo);
}
@PostMapping
public Todo createTag(@RequestBody Todo todo) {
return todoService.add(todo);
}
}
| 988 | 0.704453 | 0.704453 | 44 | 21.454546 | 20.336325 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.318182 | false | false |
12
|
ccb78221cd3f63891a169c8a9238736b5650f14e
| 8,718,783,652,530 |
2e4bae5a2462b0a9047f0b80011645bac2e38ce8
|
/src/tuna.java
|
f6065709b88c3a13435bdeaddbad3ffa6113b305
|
[] |
no_license
|
Abdugafur111/aug_11
|
https://github.com/Abdugafur111/aug_11
|
1a7da1163e35ae0a1658572d740e627db44c53df
|
0dd1d7b073e63a4deece0e4136ecad7569616ee4
|
refs/heads/master
| 2023-07-07T16:19:17.738000 | 2021-08-12T01:01:14 | 2021-08-12T01:01:14 | 395,155,279 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public class tuna extends food {
public void eat(){
System.out.println("Great tuna test");
}
}
|
UTF-8
|
Java
| 111 |
java
|
tuna.java
|
Java
|
[] | null |
[] |
public class tuna extends food {
public void eat(){
System.out.println("Great tuna test");
}
}
| 111 | 0.612613 | 0.612613 | 5 | 21.200001 | 16.749926 | 46 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false |
12
|
2349f2ebc38f4a227532448e590ae867093bf284
| 8,718,783,649,320 |
e8d280bf27356ee9fc6b985537d6d50f83bebf54
|
/src/uk/co/markfrimston/mindMap/DiagramPanel.java
|
7e15949697b1271e82e56e5df2a16e829dd24b6d
|
[] |
no_license
|
Frimkron/mindmap
|
https://github.com/Frimkron/mindmap
|
e2006e0f3d5dd6ce7143126c79dd5f9f5d08f13c
|
205ccdbf817c3e73e965548fb89ff0d1446d9a6c
|
refs/heads/master
| 2021-01-13T14:05:04.391000 | 2009-01-27T23:09:31 | 2009-01-27T23:09:31 | 116,154 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package uk.co.markfrimston.mindMap;
import javax.swing.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
public class DiagramPanel extends JPanel implements MouseListener,
MouseMotionListener, KeyListener
{
public static final int NODE_RADIUS = 32;
private Diagram diagram;
private JFrame frame;
private Node nodeDragged = null;
private Node nodeJoinStart = null;
private int mouseX, mouseY;
public DiagramPanel(Diagram diagram, JFrame frame)
{
this.frame = frame;
this.diagram = diagram;
this.addMouseListener(this);
this.addMouseMotionListener(this);
this.setFocusable(true);
this.addKeyListener(this);
this.setPreferredSize(new Dimension(2000,2000));
}
public void setDiagram(Diagram diagram)
{
this.diagram = diagram;
}
public void paint(Graphics g)
{
g.setColor(Color.WHITE);
g.fillRect(0,0,this.getWidth(),this.getHeight());
g.setColor(Color.BLACK);
for(Join join : diagram.joins)
{
g.drawLine(join.start.x,join.start.y,join.end.x,join.end.y);
}
for(Node node : diagram.nodes)
{
g.setColor(Color.WHITE);
g.fillOval(node.x-NODE_RADIUS, node.y-NODE_RADIUS,
NODE_RADIUS*2, NODE_RADIUS*2);
g.setColor(Color.BLACK);
g.drawOval(node.x-NODE_RADIUS, node.y-NODE_RADIUS,
NODE_RADIUS*2, NODE_RADIUS*2);
int nameWidth = g.getFontMetrics().stringWidth(node.name);
g.drawString(node.name, node.x-nameWidth/2, node.y);
}
if(nodeJoinStart!=null)
{
//dragging join
g.drawLine(nodeJoinStart.x, nodeJoinStart.y, mouseX, mouseY);
}
}
public Node nearbyNode(int x, int y, double threshold)
{
double bestDist = -1;
Node bestNode = null;
for(Node node : diagram.nodes)
{
double dist = Math.sqrt(Math.pow(Math.abs(node.x-x),2)
+ Math.pow(Math.abs(node.y-y),2));
if(dist < threshold && (bestNode==null || dist<bestDist))
{
bestNode = node;
bestDist = dist;
}
}
return bestNode;
}
public void mouseClicked(MouseEvent arg0)
{
if(arg0.getButton()==MouseEvent.BUTTON1
&& arg0.getClickCount()==2)
{
Node nearbyNode = nearbyNode(mouseX,mouseY,NODE_RADIUS);
if(nearbyNode != null)
{
//show edit dialog
EditNodeDialog dialog = new EditNodeDialog(frame, "Edit Node",
nearbyNode.name, nearbyNode.data);
dialog.setVisible(true);
if(dialog.wasOkayed())
{
nearbyNode.name = dialog.getName();
nearbyNode.data = dialog.getValue();
}
}
else
{
EditNodeDialog dialog = new EditNodeDialog(frame, "Create New Node",
"New Node", "");
dialog.setVisible(true);
if(dialog.wasOkayed())
{
Node newNode = new Node();
newNode.name = dialog.getName();
newNode.data = dialog.getValue();
newNode.x = arg0.getX();
newNode.y = arg0.getY();
diagram.nodes.add(newNode);
this.repaint();
}
}
}
}
public void mouseEntered(MouseEvent arg0)
{
}
public void mouseExited(MouseEvent arg0)
{
}
public void mousePressed(MouseEvent arg0)
{
//System.out.println("Mouse pressed");
if(arg0.getButton()==MouseEvent.BUTTON3)
{
if(nodeDragged==null && nodeJoinStart==null)
{
Node nearbyNode = nearbyNode(arg0.getX(),arg0.getY(),NODE_RADIUS);
if(nearbyNode!=null)
{
//pick up node
//System.out.println("Picking up node");
nodeDragged = nearbyNode;
}
}
}
else if(arg0.getButton() == MouseEvent.BUTTON1)
{
if(nodeDragged==null && nodeJoinStart==null)
{
Node nearbyNode = nearbyNode(arg0.getX(),arg0.getY(),NODE_RADIUS);
if(nearbyNode!=null)
{
//start join
nodeJoinStart = nearbyNode;
}
}
}
}
public void mouseReleased(MouseEvent arg0)
{
if(arg0.getButton()==MouseEvent.BUTTON3)
{
if(nodeDragged!=null)
{
//drop node
//System.out.println("Dropping node");
nodeDragged = null;
}
}
else if(arg0.getButton() == MouseEvent.BUTTON1)
{
if(nodeJoinStart!=null)
{
//drop join
Node nearbyNode = nearbyNode(arg0.getX(),arg0.getY(),NODE_RADIUS);
if(nearbyNode!=null && nearbyNode!=nodeJoinStart)
{
//connected to other node
Join newJoin = new Join();
newJoin.start = nodeJoinStart;
newJoin.end = nearbyNode;
//check if join exists
Join existingJoin = null;
for(Join join : diagram.joins)
{
if(join.equals(newJoin))
{
existingJoin = join;
break;
}
}
if(existingJoin!=null)
{
//join exists - remove it
diagram.joins.remove(existingJoin);
}
else
{
//add it as new
diagram.joins.add(newJoin);
}
}
nodeJoinStart=null;
repaint();
}
}
}
public void mouseDragged(MouseEvent arg0)
{
mouseX = arg0.getX();
mouseY = arg0.getY();
if(nodeDragged!=null)
{
nodeDragged.x = arg0.getX();
nodeDragged.y = arg0.getY();
this.repaint();
}
if(nodeJoinStart!=null)
{
this.repaint();
}
}
public void mouseMoved(MouseEvent arg0)
{
mouseX = arg0.getX();
mouseY = arg0.getY();
}
public void keyPressed(KeyEvent arg0)
{
}
public void keyReleased(KeyEvent arg0)
{
if(arg0.getKeyCode()==KeyEvent.VK_DELETE)
{
//System.out.println("delete typed");
Node nearbyNode = nearbyNode(mouseX,mouseY,NODE_RADIUS);
if(nearbyNode!=null)
{
if(JOptionPane.showConfirmDialog(frame,"Are you sure you want delete \""+nearbyNode.name+"\"",
"Delete Node",JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)
== JOptionPane.YES_OPTION)
{
//remove node
diagram.nodes.remove(nearbyNode);
//remove joins
Iterator<Join> it = diagram.joins.iterator();
while(it.hasNext())
{
Join join = it.next();
if(join.start == nearbyNode
|| join.end == nearbyNode)
{
it.remove();
}
}
repaint();
}
}
}
}
public void keyTyped(KeyEvent arg0)
{
}
}
|
UTF-8
|
Java
| 5,935 |
java
|
DiagramPanel.java
|
Java
|
[
{
"context": "package uk.co.markfrimston.mindMap;\n\nimport javax.swing.*;\nimport java.util.",
"end": 26,
"score": 0.9608317613601685,
"start": 14,
"tag": "USERNAME",
"value": "markfrimston"
}
] | null |
[] |
package uk.co.markfrimston.mindMap;
import javax.swing.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
public class DiagramPanel extends JPanel implements MouseListener,
MouseMotionListener, KeyListener
{
public static final int NODE_RADIUS = 32;
private Diagram diagram;
private JFrame frame;
private Node nodeDragged = null;
private Node nodeJoinStart = null;
private int mouseX, mouseY;
public DiagramPanel(Diagram diagram, JFrame frame)
{
this.frame = frame;
this.diagram = diagram;
this.addMouseListener(this);
this.addMouseMotionListener(this);
this.setFocusable(true);
this.addKeyListener(this);
this.setPreferredSize(new Dimension(2000,2000));
}
public void setDiagram(Diagram diagram)
{
this.diagram = diagram;
}
public void paint(Graphics g)
{
g.setColor(Color.WHITE);
g.fillRect(0,0,this.getWidth(),this.getHeight());
g.setColor(Color.BLACK);
for(Join join : diagram.joins)
{
g.drawLine(join.start.x,join.start.y,join.end.x,join.end.y);
}
for(Node node : diagram.nodes)
{
g.setColor(Color.WHITE);
g.fillOval(node.x-NODE_RADIUS, node.y-NODE_RADIUS,
NODE_RADIUS*2, NODE_RADIUS*2);
g.setColor(Color.BLACK);
g.drawOval(node.x-NODE_RADIUS, node.y-NODE_RADIUS,
NODE_RADIUS*2, NODE_RADIUS*2);
int nameWidth = g.getFontMetrics().stringWidth(node.name);
g.drawString(node.name, node.x-nameWidth/2, node.y);
}
if(nodeJoinStart!=null)
{
//dragging join
g.drawLine(nodeJoinStart.x, nodeJoinStart.y, mouseX, mouseY);
}
}
public Node nearbyNode(int x, int y, double threshold)
{
double bestDist = -1;
Node bestNode = null;
for(Node node : diagram.nodes)
{
double dist = Math.sqrt(Math.pow(Math.abs(node.x-x),2)
+ Math.pow(Math.abs(node.y-y),2));
if(dist < threshold && (bestNode==null || dist<bestDist))
{
bestNode = node;
bestDist = dist;
}
}
return bestNode;
}
public void mouseClicked(MouseEvent arg0)
{
if(arg0.getButton()==MouseEvent.BUTTON1
&& arg0.getClickCount()==2)
{
Node nearbyNode = nearbyNode(mouseX,mouseY,NODE_RADIUS);
if(nearbyNode != null)
{
//show edit dialog
EditNodeDialog dialog = new EditNodeDialog(frame, "Edit Node",
nearbyNode.name, nearbyNode.data);
dialog.setVisible(true);
if(dialog.wasOkayed())
{
nearbyNode.name = dialog.getName();
nearbyNode.data = dialog.getValue();
}
}
else
{
EditNodeDialog dialog = new EditNodeDialog(frame, "Create New Node",
"New Node", "");
dialog.setVisible(true);
if(dialog.wasOkayed())
{
Node newNode = new Node();
newNode.name = dialog.getName();
newNode.data = dialog.getValue();
newNode.x = arg0.getX();
newNode.y = arg0.getY();
diagram.nodes.add(newNode);
this.repaint();
}
}
}
}
public void mouseEntered(MouseEvent arg0)
{
}
public void mouseExited(MouseEvent arg0)
{
}
public void mousePressed(MouseEvent arg0)
{
//System.out.println("Mouse pressed");
if(arg0.getButton()==MouseEvent.BUTTON3)
{
if(nodeDragged==null && nodeJoinStart==null)
{
Node nearbyNode = nearbyNode(arg0.getX(),arg0.getY(),NODE_RADIUS);
if(nearbyNode!=null)
{
//pick up node
//System.out.println("Picking up node");
nodeDragged = nearbyNode;
}
}
}
else if(arg0.getButton() == MouseEvent.BUTTON1)
{
if(nodeDragged==null && nodeJoinStart==null)
{
Node nearbyNode = nearbyNode(arg0.getX(),arg0.getY(),NODE_RADIUS);
if(nearbyNode!=null)
{
//start join
nodeJoinStart = nearbyNode;
}
}
}
}
public void mouseReleased(MouseEvent arg0)
{
if(arg0.getButton()==MouseEvent.BUTTON3)
{
if(nodeDragged!=null)
{
//drop node
//System.out.println("Dropping node");
nodeDragged = null;
}
}
else if(arg0.getButton() == MouseEvent.BUTTON1)
{
if(nodeJoinStart!=null)
{
//drop join
Node nearbyNode = nearbyNode(arg0.getX(),arg0.getY(),NODE_RADIUS);
if(nearbyNode!=null && nearbyNode!=nodeJoinStart)
{
//connected to other node
Join newJoin = new Join();
newJoin.start = nodeJoinStart;
newJoin.end = nearbyNode;
//check if join exists
Join existingJoin = null;
for(Join join : diagram.joins)
{
if(join.equals(newJoin))
{
existingJoin = join;
break;
}
}
if(existingJoin!=null)
{
//join exists - remove it
diagram.joins.remove(existingJoin);
}
else
{
//add it as new
diagram.joins.add(newJoin);
}
}
nodeJoinStart=null;
repaint();
}
}
}
public void mouseDragged(MouseEvent arg0)
{
mouseX = arg0.getX();
mouseY = arg0.getY();
if(nodeDragged!=null)
{
nodeDragged.x = arg0.getX();
nodeDragged.y = arg0.getY();
this.repaint();
}
if(nodeJoinStart!=null)
{
this.repaint();
}
}
public void mouseMoved(MouseEvent arg0)
{
mouseX = arg0.getX();
mouseY = arg0.getY();
}
public void keyPressed(KeyEvent arg0)
{
}
public void keyReleased(KeyEvent arg0)
{
if(arg0.getKeyCode()==KeyEvent.VK_DELETE)
{
//System.out.println("delete typed");
Node nearbyNode = nearbyNode(mouseX,mouseY,NODE_RADIUS);
if(nearbyNode!=null)
{
if(JOptionPane.showConfirmDialog(frame,"Are you sure you want delete \""+nearbyNode.name+"\"",
"Delete Node",JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)
== JOptionPane.YES_OPTION)
{
//remove node
diagram.nodes.remove(nearbyNode);
//remove joins
Iterator<Join> it = diagram.joins.iterator();
while(it.hasNext())
{
Join join = it.next();
if(join.start == nearbyNode
|| join.end == nearbyNode)
{
it.remove();
}
}
repaint();
}
}
}
}
public void keyTyped(KeyEvent arg0)
{
}
}
| 5,935 | 0.632182 | 0.622578 | 273 | 20.739927 | 19.300642 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.344322 | false | false |
12
|
a3ee1de7b09b3280c2a75cba625f3c643ba458fd
| 10,093,173,193,025 |
6d9acb2f80ca15ade609aaf863a280dd5d38acfa
|
/Server/TheFate/src/main/java/com/woodeck/fate/fatecard/ConquerorOfHolyLight.java
|
492c74cf67e16e05a6e384873afc804a64403abc
|
[] |
no_license
|
killuac/TheFate
|
https://github.com/killuac/TheFate
|
57fe9c1901fe135c6544c6bdd4a9bd47c53edd89
|
40022033a275275580cb13525ba30dc050646917
|
refs/heads/master
| 2021-03-12T22:13:55.582000 | 2015-03-31T10:03:18 | 2015-03-31T10:03:18 | 33,178,314 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/**
*
*/
package com.woodeck.fate.fatecard;
import com.woodeck.fate.card.RoleCard;
import com.woodeck.fate.game.Game;
import com.woodeck.fate.player.Player;
/**
* @author Killua
* 近卫军团全灭
*/
public class ConquerorOfHolyLight extends FateCard {
public ConquerorOfHolyLight(Integer cardId) {
super(cardId);
}
@Override
public boolean checkGameOver(Game game, Player deadPlayer) {
RoleCard deadRole = new RoleCard(deadPlayer.getRoleCardId());
Player neutralPlayer = game.getAliveNeutralPlayer(game.getTurnOwner());
if (deadRole.isSentinel() && null != neutralPlayer) {
for (Player player : game.getAlivePlayers()) {
if (player.getRoleCard().isSameWithRole(deadRole))
return false;
}
neutralPlayer.setIsVictory(true);
return true;
} else {
return super.checkGameOver(game, deadPlayer);
}
}
}
|
UTF-8
|
Java
| 856 |
java
|
ConquerorOfHolyLight.java
|
Java
|
[
{
"context": "rt com.woodeck.fate.player.Player;\n\n/**\n * @author Killua\n * 近卫军团全灭\n */\npublic class ConquerorOfHolyLight e",
"end": 183,
"score": 0.7409824132919312,
"start": 177,
"tag": "NAME",
"value": "Killua"
}
] | null |
[] |
/**
*
*/
package com.woodeck.fate.fatecard;
import com.woodeck.fate.card.RoleCard;
import com.woodeck.fate.game.Game;
import com.woodeck.fate.player.Player;
/**
* @author Killua
* 近卫军团全灭
*/
public class ConquerorOfHolyLight extends FateCard {
public ConquerorOfHolyLight(Integer cardId) {
super(cardId);
}
@Override
public boolean checkGameOver(Game game, Player deadPlayer) {
RoleCard deadRole = new RoleCard(deadPlayer.getRoleCardId());
Player neutralPlayer = game.getAliveNeutralPlayer(game.getTurnOwner());
if (deadRole.isSentinel() && null != neutralPlayer) {
for (Player player : game.getAlivePlayers()) {
if (player.getRoleCard().isSameWithRole(deadRole))
return false;
}
neutralPlayer.setIsVictory(true);
return true;
} else {
return super.checkGameOver(game, deadPlayer);
}
}
}
| 856 | 0.719194 | 0.719194 | 37 | 21.81081 | 22.565027 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.567568 | false | false |
12
|
f03f16faa6712debb60c4643ceec8897016770e0
| 27,410,481,333,931 |
90567f94faea74665704b4aea731722a3aa2639c
|
/src/main/java/com/sebastian_daschner/coffee/beans/entity/CoffeeBean.java
|
29b8b7ef1f6d661324923b30ff3cd85e6bd7d598
|
[
"Apache-2.0"
] |
permissive
|
jexp/favorite-coffee
|
https://github.com/jexp/favorite-coffee
|
7f55ac7d109faeb01732b54c7016608665690b71
|
5bcc289992f7cd9185db1afb68da06e02f6cee1f
|
refs/heads/main
| 2023-07-17T18:54:29.678000 | 2021-08-17T08:02:34 | 2021-08-17T08:02:34 | 395,672,244 | 0 | 0 |
Apache-2.0
| true | 2021-08-13T13:51:27 | 2021-08-13T13:51:27 | 2021-08-12T06:32:52 | 2021-08-12T06:32:49 | 25 | 0 | 0 | 0 | null | false | false |
package com.sebastian_daschner.coffee.beans.entity;
import com.sebastian_daschner.coffee.user.control.UserRatingTypeAdapter;
import com.sebastian_daschner.coffee.user.entity.UserRating;
import org.neo4j.ogm.annotation.*;
import org.neo4j.ogm.annotation.typeconversion.Convert;
import org.neo4j.ogm.id.UuidStrategy;
import org.neo4j.ogm.typeconversion.UuidStringConverter;
import javax.json.bind.annotation.JsonbTransient;
import javax.json.bind.annotation.JsonbTypeAdapter;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
@NodeEntity
public class CoffeeBean {
@Id
@GeneratedValue(strategy = UuidStrategy.class)
@Convert(UuidStringConverter.class)
@JsonbTransient
public UUID uuid;
@Required
public String name;
@Relationship("IS_FROM")
public Origin origin;
@Relationship("TASTES")
public Set<FlavorProfile> flavorProfiles = new HashSet<>();
@Relationship(value = "RATED", direction = "INCOMING")
@JsonbTypeAdapter(UserRatingTypeAdapter.class)
public UserRating userRating;
@Override
public String toString() {
return "CoffeeBean{" +
"name='" + name + '\'' +
", origin=" + origin +
", flavorProfiles=" + flavorProfiles +
", userRating=" + userRating +
'}';
}
}
|
UTF-8
|
Java
| 1,344 |
java
|
CoffeeBean.java
|
Java
|
[
{
"context": "bastian_daschner.coffee.beans.entity;\n\nimport com.sebastian_daschner.coffee.user.control.UserRatingTypeAdapte",
"end": 73,
"score": 0.8582026958465576,
"start": 64,
"tag": "USERNAME",
"value": "sebastian"
}
] | null |
[] |
package com.sebastian_daschner.coffee.beans.entity;
import com.sebastian_daschner.coffee.user.control.UserRatingTypeAdapter;
import com.sebastian_daschner.coffee.user.entity.UserRating;
import org.neo4j.ogm.annotation.*;
import org.neo4j.ogm.annotation.typeconversion.Convert;
import org.neo4j.ogm.id.UuidStrategy;
import org.neo4j.ogm.typeconversion.UuidStringConverter;
import javax.json.bind.annotation.JsonbTransient;
import javax.json.bind.annotation.JsonbTypeAdapter;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
@NodeEntity
public class CoffeeBean {
@Id
@GeneratedValue(strategy = UuidStrategy.class)
@Convert(UuidStringConverter.class)
@JsonbTransient
public UUID uuid;
@Required
public String name;
@Relationship("IS_FROM")
public Origin origin;
@Relationship("TASTES")
public Set<FlavorProfile> flavorProfiles = new HashSet<>();
@Relationship(value = "RATED", direction = "INCOMING")
@JsonbTypeAdapter(UserRatingTypeAdapter.class)
public UserRating userRating;
@Override
public String toString() {
return "CoffeeBean{" +
"name='" + name + '\'' +
", origin=" + origin +
", flavorProfiles=" + flavorProfiles +
", userRating=" + userRating +
'}';
}
}
| 1,344 | 0.69494 | 0.691964 | 47 | 27.595745 | 20.77607 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.468085 | false | false |
12
|
b1d9d4b65d94123399fda963212b255e6e5c4eff
| 7,894,149,948,506 |
f96269d67df0ce4cfdeecb70675b171a4b2971f4
|
/src/main/java/org/ojalgo/ann/ArtificialNeuralNetwork.java
|
e8b6928c88c59262768fbcad92198d4474d0d223
|
[
"MIT"
] |
permissive
|
optimatika/ojAlgo
|
https://github.com/optimatika/ojAlgo
|
74e0c1577f2ed9eb880becaf4c3ebc7c9c4ede5e
|
9fa88beb01598cc7930c37d6f0c8c8aab77ab686
|
refs/heads/develop
| 2023-08-31T06:44:40.310000 | 2023-08-26T17:29:00 | 2023-08-26T17:29:00 | 13,365,821 | 458 | 372 |
MIT
| false | 2023-08-03T20:30:39 | 2013-10-06T17:20:10 | 2023-07-25T10:28:34 | 2023-08-03T20:30:38 | 75,559 | 433 | 210 | 0 |
Java
| false | false |
/*
* Copyright 1997-2023 Optimatika
*
* 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 org.ojalgo.ann;
import static org.ojalgo.function.constant.PrimitiveMath.*;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;
import org.ojalgo.data.DataBatch;
import org.ojalgo.function.PrimitiveFunction;
import org.ojalgo.function.aggregator.Aggregator;
import org.ojalgo.function.constant.PrimitiveMath;
import org.ojalgo.function.special.MissingMath;
import org.ojalgo.matrix.store.MatrixStore;
import org.ojalgo.matrix.store.PhysicalStore;
import org.ojalgo.matrix.store.Primitive32Store;
import org.ojalgo.matrix.store.Primitive64Store;
import org.ojalgo.structure.Access1D;
import org.ojalgo.structure.Structure2D;
public final class ArtificialNeuralNetwork {
/**
* https://en.wikipedia.org/wiki/Activation_function
*
* @author apete
*/
public enum Activator {
/**
* (-,+)
*/
IDENTITY(ArtificialNeuralNetwork::doIdentity, arg -> ONE, true),
/**
* ReLU: [0,+)
*/
RELU(ArtificialNeuralNetwork::doReLU, arg -> arg > ZERO ? ONE : ZERO, true),
/**
* [0,1]
*/
SIGMOID(ArtificialNeuralNetwork::doSigmoid, arg -> arg * (ONE - arg), true),
/**
* [0,1] <br>
* Currently this can only be used in the final layer in combination with
* {@link ArtificialNeuralNetwork.Error#CROSS_ENTROPY}. All other usage will give incorrect network
* training.
*/
SOFTMAX(ArtificialNeuralNetwork::doSoftMax, arg -> ONE, false),
/**
* [-1,1]
*/
TANH(ArtificialNeuralNetwork::doTanh, arg -> ONE - arg * arg, true);
private final PrimitiveFunction.Unary myDerivativeInTermsOfOutput;
private final Consumer<PhysicalStore<Double>> myFunction;
private final boolean mySingleFolded;
Activator(final Consumer<PhysicalStore<Double>> function, final PrimitiveFunction.Unary derivativeInTermsOfOutput, final boolean singleFolded) {
myFunction = function;
myDerivativeInTermsOfOutput = derivativeInTermsOfOutput;
mySingleFolded = singleFolded;
}
void activate(final PhysicalStore<Double> output) {
myFunction.accept(output);
}
void activate(final PhysicalStore<Double> output, final double probabilityToKeep) {
if (ZERO >= probabilityToKeep || probabilityToKeep > ONE) {
throw new IllegalArgumentException();
}
myFunction.accept(output);
output.modifyAll(NodeDropper.of(probabilityToKeep));
}
PrimitiveFunction.Unary getDerivativeInTermsOfOutput() {
return myDerivativeInTermsOfOutput;
}
boolean isSingleFolded() {
return mySingleFolded;
}
}
public enum Error implements PrimitiveFunction.Binary {
/**
* Currently this can only be used in combination with {@link Activator#SOFTMAX} in the final layer.
* All other usage will give incorrect network training.
*/
CROSS_ENTROPY((target, current) -> -target * Math.log(current), (target, current) -> (current - target)),
/**
*
*/
HALF_SQUARED_DIFFERENCE((target, current) -> HALF * (target - current) * (target - current), (target, current) -> (current - target));
private final PrimitiveFunction.Binary myDerivative;
private final PrimitiveFunction.Binary myFunction;
Error(final PrimitiveFunction.Binary function, final PrimitiveFunction.Binary derivative) {
myFunction = function;
myDerivative = derivative;
}
public double invoke(final Access1D<?> target, final Access1D<?> current) {
int limit = MissingMath.toMinIntExact(target.count(), current.count());
double retVal = ZERO;
for (int i = 0; i < limit; i++) {
retVal += myFunction.invoke(target.doubleValue(i), current.doubleValue(i));
}
return retVal;
}
public double invoke(final double target, final double current) {
return myFunction.invoke(target, current);
}
PrimitiveFunction.Binary getDerivative() {
return myDerivative;
}
}
public static NetworkBuilder builder(final int numberOfNetworkInputNodes) {
return ArtificialNeuralNetwork.builder(Primitive64Store.FACTORY, numberOfNetworkInputNodes);
}
/**
* @deprecated Use {@link #builder(int)} instead
*/
@Deprecated
public static NetworkTrainer builder(final int numberOfInputNodes, final int... nodesPerCalculationLayer) {
return ArtificialNeuralNetwork.builder(Primitive64Store.FACTORY, numberOfInputNodes, nodesPerCalculationLayer);
}
public static NetworkBuilder builder(final PhysicalStore.Factory<Double, ?> factory, final int numberOfNetworkInputNodes) {
return new NetworkBuilder(factory, numberOfNetworkInputNodes);
}
/**
* @deprecated Use {@link #builder(org.ojalgo.matrix.store.PhysicalStore.Factory, int)} instead
*/
@Deprecated
public static NetworkTrainer builder(final PhysicalStore.Factory<Double, ?> factory, final int numberOfInputNodes, final int... nodesPerCalculationLayer) {
NetworkBuilder builder = ArtificialNeuralNetwork.builder(factory, numberOfInputNodes);
for (int i = 0; i < nodesPerCalculationLayer.length; i++) {
builder.layer(nodesPerCalculationLayer[i]);
}
return builder.get().newTrainer();
}
/**
* Read (reconstruct) an ANN from the specified input previously written by {@link #writeTo(DataOutput)}.
*/
public static ArtificialNeuralNetwork from(final DataInput input) throws IOException {
return FileFormat.read(null, input);
}
/**
* @see #from(DataInput)
*/
public static ArtificialNeuralNetwork from(final File file) {
return ArtificialNeuralNetwork.from(null, file);
}
/**
* @see #from(DataInput)
*/
public static ArtificialNeuralNetwork from(final Path path, final OpenOption... options) {
return ArtificialNeuralNetwork.from(null, path, options);
}
/**
* Read (reconstruct) an ANN from the specified input previously written by {@link #writeTo(DataOutput)}.
*/
public static ArtificialNeuralNetwork from(final PhysicalStore.Factory<Double, ?> factory, final DataInput input) throws IOException {
return FileFormat.read(factory, input);
}
/**
* @see #from(DataInput)
*/
public static ArtificialNeuralNetwork from(final PhysicalStore.Factory<Double, ?> factory, final File file) {
try (DataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(file)))) {
return ArtificialNeuralNetwork.from(factory, input);
} catch (IOException cause) {
throw new RuntimeException(cause);
}
}
/**
* @see #from(DataInput)
*/
public static ArtificialNeuralNetwork from(final PhysicalStore.Factory<Double, ?> factory, final Path path, final OpenOption... options) {
try (DataInputStream input = new DataInputStream(new BufferedInputStream(Files.newInputStream(path, options)))) {
return ArtificialNeuralNetwork.from(factory, input);
} catch (IOException cause) {
throw new RuntimeException(cause);
}
}
static void doIdentity(final PhysicalStore<Double> output) {
// no-op activator
}
static void doReLU(final PhysicalStore<Double> output) {
output.modifyAll(MAX.second(ZERO));
}
static void doSigmoid(final PhysicalStore<Double> output) {
output.modifyAll(LOGISTIC);
}
static void doSoftMax(final PhysicalStore<Double> output) {
output.modifyAll(EXP);
Primitive64Store totals = output.reduceRows(Aggregator.SUM).collect(Primitive64Store.FACTORY);
output.onRows(DIVIDE, totals).supplyTo(output);
}
static void doTanh(final PhysicalStore<Double> output) {
output.modifyAll(PrimitiveMath.TANH);
}
private transient TrainingConfiguration myConfiguration = null;
private final PhysicalStore.Factory<Double, ?> myFactory;
private final CalculationLayer[] myLayers;
ArtificialNeuralNetwork(final NetworkBuilder builder) {
super();
myFactory = builder.getFactory();
List<LayerTemplate> templates = builder.getLayers();
myLayers = new CalculationLayer[templates.size()];
for (int i = 0; i < myLayers.length; i++) {
LayerTemplate layerTemplate = templates.get(i);
myLayers[i] = new CalculationLayer(myFactory, layerTemplate.inputs, layerTemplate.outputs, layerTemplate.activator);
}
}
ArtificialNeuralNetwork(final PhysicalStore.Factory<Double, ?> factory, final int inputs, final int[] layers) {
super();
myFactory = factory;
myLayers = new CalculationLayer[layers.length];
int tmpIn = inputs;
int tmpOut = inputs;
for (int i = 0; i < layers.length; i++) {
tmpIn = tmpOut;
tmpOut = layers[i];
myLayers[i] = new CalculationLayer(factory, tmpIn, tmpOut, ArtificialNeuralNetwork.Activator.SIGMOID);
}
}
/**
* @return The number of calculation layers
*/
public int depth() {
return myLayers.length;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null || !(obj instanceof ArtificialNeuralNetwork)) {
return false;
}
ArtificialNeuralNetwork other = (ArtificialNeuralNetwork) obj;
if (!Arrays.equals(myLayers, other.myLayers)) {
return false;
}
return true;
}
public Activator getActivator(final int layer) {
return myLayers[layer].getActivator();
}
public double getBias(final int layer, final int output) {
return myLayers[layer].getBias(output);
}
public double getWeight(final int layer, final int input, final int output) {
return myLayers[layer].getWeight(input, output);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
return prime * result + Arrays.hashCode(myLayers);
}
/**
* With batch size 1
*
* @see #newInvoker(int)
*/
public NetworkInvoker newInvoker() {
return this.newInvoker(1);
}
/**
* If you create multiple invokers you can use them in different threads simutaneously - the invoker
* contains any/all invocation specific state.
*
* @param batchSize The batch size - the number of batched invocations
* @return The invoker
*/
public NetworkInvoker newInvoker(final int batchSize) {
return new NetworkInvoker(this, batchSize);
}
/**
* With batch size 1
*
* @see #newTrainer(int)
*/
public NetworkTrainer newTrainer() {
return this.newTrainer(1);
}
/**
* Only 1 trainer at the time.
*
* @param batchSize The batch size - the number of batched training examples
* @return The trainer
*/
public NetworkTrainer newTrainer(final int batchSize) {
NetworkTrainer trainer = new NetworkTrainer(this, batchSize);
if (this.getOutputActivator() == Activator.SOFTMAX) {
trainer.error(Error.CROSS_ENTROPY);
} else {
trainer.error(Error.HALF_SQUARED_DIFFERENCE);
}
return trainer;
}
public Structure2D[] structure() {
Structure2D[] retVal = new Structure2D[myLayers.length];
for (int l = 0; l < retVal.length; l++) {
retVal[l] = myLayers[l].getStructure();
}
return retVal;
}
@Override
public String toString() {
StringBuilder tmpBuilder = new StringBuilder();
tmpBuilder.append("ArtificialNeuralNetwork [Layers=");
for (CalculationLayer calculationLayer : myLayers) {
tmpBuilder.append("\n");
tmpBuilder.append(calculationLayer);
}
tmpBuilder.append("\n");
tmpBuilder.append("]");
return tmpBuilder.toString();
}
/**
* @return The max number of nodes in any layer
*/
public int width() {
int retVal = myLayers[0].countInputNodes();
for (CalculationLayer layer : myLayers) {
retVal = Math.max(retVal, layer.countOutputNodes());
}
return retVal;
}
/**
* Will write (save) the ANN to the specified output. Can then later be read back by using
* {@link #from(DataInput)}.
*/
public void writeTo(final DataOutput output) throws IOException {
int version = myFactory == Primitive32Store.FACTORY ? 2 : 1;
FileFormat.write(this, version, output);
}
/**
* @see #writeTo(DataOutput)
*/
public void writeTo(final File file) {
try (DataOutputStream output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)))) {
this.writeTo(output);
} catch (IOException cause) {
throw new RuntimeException(cause);
}
}
/**
* @see #writeTo(DataOutput)
*/
public void writeTo(final Path path, final OpenOption... options) {
try (DataOutputStream output = new DataOutputStream(new BufferedOutputStream(Files.newOutputStream(path, options)))) {
this.writeTo(output);
} catch (IOException cause) {
throw new RuntimeException(cause);
}
}
void adjust(final int layer, final PhysicalStore<Double> input, final PhysicalStore<Double> output, final PhysicalStore<Double> upstreamGradient,
final PhysicalStore<Double> downstreamGradient) {
myLayers[layer].adjust(input, output, upstreamGradient, downstreamGradient, -myConfiguration.learningRate,
myConfiguration.probabilityDidKeepInput(layer), myConfiguration.regularisation());
}
int countInputNodes() {
return myLayers[0].countInputNodes();
}
int countInputNodes(final int layer) {
return myLayers[layer].countInputNodes();
}
int countOutputNodes() {
return myLayers[myLayers.length - 1].countOutputNodes();
}
int countOutputNodes(final int layer) {
return myLayers[layer].countOutputNodes();
}
Activator getOutputActivator() {
return myLayers[myLayers.length - 1].getActivator();
}
List<MatrixStore<Double>> getWeights() {
final ArrayList<MatrixStore<Double>> retVal = new ArrayList<>();
for (int i = 0; i < myLayers.length; i++) {
retVal.add(myLayers[i].getLogicalWeights());
}
return retVal;
}
PhysicalStore<Double> invoke(final int layer, final PhysicalStore<Double> input, final PhysicalStore<Double> output) {
if (myConfiguration != null) {
return myLayers[layer].invoke(input, output, myConfiguration.probabilityWillKeepOutput(layer, this.depth()));
}
return myLayers[layer].invoke(input, output);
}
DataBatch newBatch(final int rows, final int columns) {
return DataBatch.from(myFactory, rows, columns);
}
PhysicalStore<Double> newStore(final int rows, final int columns) {
return myFactory.make(rows, columns);
}
void randomise() {
for (int l = 0; l < myLayers.length; l++) {
myLayers[l].randomise();
}
}
void scale(final int layer, final double factor) {
myLayers[layer].scale(factor);
}
void setActivator(final int layer, final Activator activator) {
myLayers[layer].setActivator(activator);
}
void setBias(final int layer, final int output, final double bias) {
myLayers[layer].setBias(output, bias);
}
void setConfiguration(final TrainingConfiguration configuration) {
if (myConfiguration != null && configuration == null) {
for (int l = 1, limit = this.depth(); l < limit; l++) {
this.scale(l, myConfiguration.probabilityDidKeepInput(l));
}
}
myConfiguration = configuration;
}
void setWeight(final int layer, final int input, final int output, final double weight) {
myLayers[layer].setWeight(input, output, weight);
}
}
|
UTF-8
|
Java
| 17,805 |
java
|
ArtificialNeuralNetwork.java
|
Java
|
[
{
"context": "/*\n * Copyright 1997-2023 Optimatika\n *\n * Permission is hereby granted, free of charg",
"end": 36,
"score": 0.9977421760559082,
"start": 26,
"tag": "NAME",
"value": "Optimatika"
},
{
"context": "org/wiki/Activation_function\n *\n * @author apete\n */\n public enum Activator {\n\n /**\n",
"end": 2056,
"score": 0.9988352656364441,
"start": 2051,
"tag": "USERNAME",
"value": "apete"
}
] | null |
[] |
/*
* Copyright 1997-2023 Optimatika
*
* 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 org.ojalgo.ann;
import static org.ojalgo.function.constant.PrimitiveMath.*;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;
import org.ojalgo.data.DataBatch;
import org.ojalgo.function.PrimitiveFunction;
import org.ojalgo.function.aggregator.Aggregator;
import org.ojalgo.function.constant.PrimitiveMath;
import org.ojalgo.function.special.MissingMath;
import org.ojalgo.matrix.store.MatrixStore;
import org.ojalgo.matrix.store.PhysicalStore;
import org.ojalgo.matrix.store.Primitive32Store;
import org.ojalgo.matrix.store.Primitive64Store;
import org.ojalgo.structure.Access1D;
import org.ojalgo.structure.Structure2D;
public final class ArtificialNeuralNetwork {
/**
* https://en.wikipedia.org/wiki/Activation_function
*
* @author apete
*/
public enum Activator {
/**
* (-,+)
*/
IDENTITY(ArtificialNeuralNetwork::doIdentity, arg -> ONE, true),
/**
* ReLU: [0,+)
*/
RELU(ArtificialNeuralNetwork::doReLU, arg -> arg > ZERO ? ONE : ZERO, true),
/**
* [0,1]
*/
SIGMOID(ArtificialNeuralNetwork::doSigmoid, arg -> arg * (ONE - arg), true),
/**
* [0,1] <br>
* Currently this can only be used in the final layer in combination with
* {@link ArtificialNeuralNetwork.Error#CROSS_ENTROPY}. All other usage will give incorrect network
* training.
*/
SOFTMAX(ArtificialNeuralNetwork::doSoftMax, arg -> ONE, false),
/**
* [-1,1]
*/
TANH(ArtificialNeuralNetwork::doTanh, arg -> ONE - arg * arg, true);
private final PrimitiveFunction.Unary myDerivativeInTermsOfOutput;
private final Consumer<PhysicalStore<Double>> myFunction;
private final boolean mySingleFolded;
Activator(final Consumer<PhysicalStore<Double>> function, final PrimitiveFunction.Unary derivativeInTermsOfOutput, final boolean singleFolded) {
myFunction = function;
myDerivativeInTermsOfOutput = derivativeInTermsOfOutput;
mySingleFolded = singleFolded;
}
void activate(final PhysicalStore<Double> output) {
myFunction.accept(output);
}
void activate(final PhysicalStore<Double> output, final double probabilityToKeep) {
if (ZERO >= probabilityToKeep || probabilityToKeep > ONE) {
throw new IllegalArgumentException();
}
myFunction.accept(output);
output.modifyAll(NodeDropper.of(probabilityToKeep));
}
PrimitiveFunction.Unary getDerivativeInTermsOfOutput() {
return myDerivativeInTermsOfOutput;
}
boolean isSingleFolded() {
return mySingleFolded;
}
}
public enum Error implements PrimitiveFunction.Binary {
/**
* Currently this can only be used in combination with {@link Activator#SOFTMAX} in the final layer.
* All other usage will give incorrect network training.
*/
CROSS_ENTROPY((target, current) -> -target * Math.log(current), (target, current) -> (current - target)),
/**
*
*/
HALF_SQUARED_DIFFERENCE((target, current) -> HALF * (target - current) * (target - current), (target, current) -> (current - target));
private final PrimitiveFunction.Binary myDerivative;
private final PrimitiveFunction.Binary myFunction;
Error(final PrimitiveFunction.Binary function, final PrimitiveFunction.Binary derivative) {
myFunction = function;
myDerivative = derivative;
}
public double invoke(final Access1D<?> target, final Access1D<?> current) {
int limit = MissingMath.toMinIntExact(target.count(), current.count());
double retVal = ZERO;
for (int i = 0; i < limit; i++) {
retVal += myFunction.invoke(target.doubleValue(i), current.doubleValue(i));
}
return retVal;
}
public double invoke(final double target, final double current) {
return myFunction.invoke(target, current);
}
PrimitiveFunction.Binary getDerivative() {
return myDerivative;
}
}
public static NetworkBuilder builder(final int numberOfNetworkInputNodes) {
return ArtificialNeuralNetwork.builder(Primitive64Store.FACTORY, numberOfNetworkInputNodes);
}
/**
* @deprecated Use {@link #builder(int)} instead
*/
@Deprecated
public static NetworkTrainer builder(final int numberOfInputNodes, final int... nodesPerCalculationLayer) {
return ArtificialNeuralNetwork.builder(Primitive64Store.FACTORY, numberOfInputNodes, nodesPerCalculationLayer);
}
public static NetworkBuilder builder(final PhysicalStore.Factory<Double, ?> factory, final int numberOfNetworkInputNodes) {
return new NetworkBuilder(factory, numberOfNetworkInputNodes);
}
/**
* @deprecated Use {@link #builder(org.ojalgo.matrix.store.PhysicalStore.Factory, int)} instead
*/
@Deprecated
public static NetworkTrainer builder(final PhysicalStore.Factory<Double, ?> factory, final int numberOfInputNodes, final int... nodesPerCalculationLayer) {
NetworkBuilder builder = ArtificialNeuralNetwork.builder(factory, numberOfInputNodes);
for (int i = 0; i < nodesPerCalculationLayer.length; i++) {
builder.layer(nodesPerCalculationLayer[i]);
}
return builder.get().newTrainer();
}
/**
* Read (reconstruct) an ANN from the specified input previously written by {@link #writeTo(DataOutput)}.
*/
public static ArtificialNeuralNetwork from(final DataInput input) throws IOException {
return FileFormat.read(null, input);
}
/**
* @see #from(DataInput)
*/
public static ArtificialNeuralNetwork from(final File file) {
return ArtificialNeuralNetwork.from(null, file);
}
/**
* @see #from(DataInput)
*/
public static ArtificialNeuralNetwork from(final Path path, final OpenOption... options) {
return ArtificialNeuralNetwork.from(null, path, options);
}
/**
* Read (reconstruct) an ANN from the specified input previously written by {@link #writeTo(DataOutput)}.
*/
public static ArtificialNeuralNetwork from(final PhysicalStore.Factory<Double, ?> factory, final DataInput input) throws IOException {
return FileFormat.read(factory, input);
}
/**
* @see #from(DataInput)
*/
public static ArtificialNeuralNetwork from(final PhysicalStore.Factory<Double, ?> factory, final File file) {
try (DataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(file)))) {
return ArtificialNeuralNetwork.from(factory, input);
} catch (IOException cause) {
throw new RuntimeException(cause);
}
}
/**
* @see #from(DataInput)
*/
public static ArtificialNeuralNetwork from(final PhysicalStore.Factory<Double, ?> factory, final Path path, final OpenOption... options) {
try (DataInputStream input = new DataInputStream(new BufferedInputStream(Files.newInputStream(path, options)))) {
return ArtificialNeuralNetwork.from(factory, input);
} catch (IOException cause) {
throw new RuntimeException(cause);
}
}
static void doIdentity(final PhysicalStore<Double> output) {
// no-op activator
}
static void doReLU(final PhysicalStore<Double> output) {
output.modifyAll(MAX.second(ZERO));
}
static void doSigmoid(final PhysicalStore<Double> output) {
output.modifyAll(LOGISTIC);
}
static void doSoftMax(final PhysicalStore<Double> output) {
output.modifyAll(EXP);
Primitive64Store totals = output.reduceRows(Aggregator.SUM).collect(Primitive64Store.FACTORY);
output.onRows(DIVIDE, totals).supplyTo(output);
}
static void doTanh(final PhysicalStore<Double> output) {
output.modifyAll(PrimitiveMath.TANH);
}
private transient TrainingConfiguration myConfiguration = null;
private final PhysicalStore.Factory<Double, ?> myFactory;
private final CalculationLayer[] myLayers;
ArtificialNeuralNetwork(final NetworkBuilder builder) {
super();
myFactory = builder.getFactory();
List<LayerTemplate> templates = builder.getLayers();
myLayers = new CalculationLayer[templates.size()];
for (int i = 0; i < myLayers.length; i++) {
LayerTemplate layerTemplate = templates.get(i);
myLayers[i] = new CalculationLayer(myFactory, layerTemplate.inputs, layerTemplate.outputs, layerTemplate.activator);
}
}
ArtificialNeuralNetwork(final PhysicalStore.Factory<Double, ?> factory, final int inputs, final int[] layers) {
super();
myFactory = factory;
myLayers = new CalculationLayer[layers.length];
int tmpIn = inputs;
int tmpOut = inputs;
for (int i = 0; i < layers.length; i++) {
tmpIn = tmpOut;
tmpOut = layers[i];
myLayers[i] = new CalculationLayer(factory, tmpIn, tmpOut, ArtificialNeuralNetwork.Activator.SIGMOID);
}
}
/**
* @return The number of calculation layers
*/
public int depth() {
return myLayers.length;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null || !(obj instanceof ArtificialNeuralNetwork)) {
return false;
}
ArtificialNeuralNetwork other = (ArtificialNeuralNetwork) obj;
if (!Arrays.equals(myLayers, other.myLayers)) {
return false;
}
return true;
}
public Activator getActivator(final int layer) {
return myLayers[layer].getActivator();
}
public double getBias(final int layer, final int output) {
return myLayers[layer].getBias(output);
}
public double getWeight(final int layer, final int input, final int output) {
return myLayers[layer].getWeight(input, output);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
return prime * result + Arrays.hashCode(myLayers);
}
/**
* With batch size 1
*
* @see #newInvoker(int)
*/
public NetworkInvoker newInvoker() {
return this.newInvoker(1);
}
/**
* If you create multiple invokers you can use them in different threads simutaneously - the invoker
* contains any/all invocation specific state.
*
* @param batchSize The batch size - the number of batched invocations
* @return The invoker
*/
public NetworkInvoker newInvoker(final int batchSize) {
return new NetworkInvoker(this, batchSize);
}
/**
* With batch size 1
*
* @see #newTrainer(int)
*/
public NetworkTrainer newTrainer() {
return this.newTrainer(1);
}
/**
* Only 1 trainer at the time.
*
* @param batchSize The batch size - the number of batched training examples
* @return The trainer
*/
public NetworkTrainer newTrainer(final int batchSize) {
NetworkTrainer trainer = new NetworkTrainer(this, batchSize);
if (this.getOutputActivator() == Activator.SOFTMAX) {
trainer.error(Error.CROSS_ENTROPY);
} else {
trainer.error(Error.HALF_SQUARED_DIFFERENCE);
}
return trainer;
}
public Structure2D[] structure() {
Structure2D[] retVal = new Structure2D[myLayers.length];
for (int l = 0; l < retVal.length; l++) {
retVal[l] = myLayers[l].getStructure();
}
return retVal;
}
@Override
public String toString() {
StringBuilder tmpBuilder = new StringBuilder();
tmpBuilder.append("ArtificialNeuralNetwork [Layers=");
for (CalculationLayer calculationLayer : myLayers) {
tmpBuilder.append("\n");
tmpBuilder.append(calculationLayer);
}
tmpBuilder.append("\n");
tmpBuilder.append("]");
return tmpBuilder.toString();
}
/**
* @return The max number of nodes in any layer
*/
public int width() {
int retVal = myLayers[0].countInputNodes();
for (CalculationLayer layer : myLayers) {
retVal = Math.max(retVal, layer.countOutputNodes());
}
return retVal;
}
/**
* Will write (save) the ANN to the specified output. Can then later be read back by using
* {@link #from(DataInput)}.
*/
public void writeTo(final DataOutput output) throws IOException {
int version = myFactory == Primitive32Store.FACTORY ? 2 : 1;
FileFormat.write(this, version, output);
}
/**
* @see #writeTo(DataOutput)
*/
public void writeTo(final File file) {
try (DataOutputStream output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)))) {
this.writeTo(output);
} catch (IOException cause) {
throw new RuntimeException(cause);
}
}
/**
* @see #writeTo(DataOutput)
*/
public void writeTo(final Path path, final OpenOption... options) {
try (DataOutputStream output = new DataOutputStream(new BufferedOutputStream(Files.newOutputStream(path, options)))) {
this.writeTo(output);
} catch (IOException cause) {
throw new RuntimeException(cause);
}
}
void adjust(final int layer, final PhysicalStore<Double> input, final PhysicalStore<Double> output, final PhysicalStore<Double> upstreamGradient,
final PhysicalStore<Double> downstreamGradient) {
myLayers[layer].adjust(input, output, upstreamGradient, downstreamGradient, -myConfiguration.learningRate,
myConfiguration.probabilityDidKeepInput(layer), myConfiguration.regularisation());
}
int countInputNodes() {
return myLayers[0].countInputNodes();
}
int countInputNodes(final int layer) {
return myLayers[layer].countInputNodes();
}
int countOutputNodes() {
return myLayers[myLayers.length - 1].countOutputNodes();
}
int countOutputNodes(final int layer) {
return myLayers[layer].countOutputNodes();
}
Activator getOutputActivator() {
return myLayers[myLayers.length - 1].getActivator();
}
List<MatrixStore<Double>> getWeights() {
final ArrayList<MatrixStore<Double>> retVal = new ArrayList<>();
for (int i = 0; i < myLayers.length; i++) {
retVal.add(myLayers[i].getLogicalWeights());
}
return retVal;
}
PhysicalStore<Double> invoke(final int layer, final PhysicalStore<Double> input, final PhysicalStore<Double> output) {
if (myConfiguration != null) {
return myLayers[layer].invoke(input, output, myConfiguration.probabilityWillKeepOutput(layer, this.depth()));
}
return myLayers[layer].invoke(input, output);
}
DataBatch newBatch(final int rows, final int columns) {
return DataBatch.from(myFactory, rows, columns);
}
PhysicalStore<Double> newStore(final int rows, final int columns) {
return myFactory.make(rows, columns);
}
void randomise() {
for (int l = 0; l < myLayers.length; l++) {
myLayers[l].randomise();
}
}
void scale(final int layer, final double factor) {
myLayers[layer].scale(factor);
}
void setActivator(final int layer, final Activator activator) {
myLayers[layer].setActivator(activator);
}
void setBias(final int layer, final int output, final double bias) {
myLayers[layer].setBias(output, bias);
}
void setConfiguration(final TrainingConfiguration configuration) {
if (myConfiguration != null && configuration == null) {
for (int l = 1, limit = this.depth(); l < limit; l++) {
this.scale(l, myConfiguration.probabilityDidKeepInput(l));
}
}
myConfiguration = configuration;
}
void setWeight(final int layer, final int input, final int output, final double weight) {
myLayers[layer].setWeight(input, output, weight);
}
}
| 17,805 | 0.649031 | 0.645774 | 518 | 33.372585 | 33.56815 | 159 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.581081 | false | false |
12
|
51483ea83585af7200c3568100c40f63c641febd
| 17,033,840,298,837 |
ea4f895028a9d021efb6c020160fcaea5650a959
|
/trabalho-dac/src/main/java/br/com/uff/domain/entity/dac/FotoProfessor.java
|
3fda508b5040ce59ec8ad77e13ad541453238bb0
|
[] |
no_license
|
LucasDFernandes/trabalho-dac
|
https://github.com/LucasDFernandes/trabalho-dac
|
b0768650f7aee4bae6c89d7eaaaebdc4aa42d699
|
96bdeb18130a7dd7d4da6493094fc0a86a2082fc
|
refs/heads/master
| 2019-07-01T21:34:14.901000 | 2017-12-20T03:20:50 | 2017-12-20T03:20:50 | 102,608,415 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.com.uff.domain.entity.dac;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import br.com.uff.domain.AbstractEntity;
@Entity(name = "FOTO_PROFESSOR")
public class FotoProfessor extends AbstractEntity {
private static final long serialVersionUID = 1L;
@OneToOne
@JoinColumn(name = "ID_PROFESSOR", nullable = false)
private Professor professor;
@Column(name = "URL_FOTO", nullable = false)
private String urlFoto;
public Professor getProfessor() {
return professor;
}
public void setProfessor(Professor professor) {
this.professor = professor;
}
public String getUrlFoto() {
return urlFoto;
}
public void setUrlFoto(String urlFoto) {
this.urlFoto = urlFoto;
}
}
|
UTF-8
|
Java
| 831 |
java
|
FotoProfessor.java
|
Java
|
[] | null |
[] |
package br.com.uff.domain.entity.dac;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import br.com.uff.domain.AbstractEntity;
@Entity(name = "FOTO_PROFESSOR")
public class FotoProfessor extends AbstractEntity {
private static final long serialVersionUID = 1L;
@OneToOne
@JoinColumn(name = "ID_PROFESSOR", nullable = false)
private Professor professor;
@Column(name = "URL_FOTO", nullable = false)
private String urlFoto;
public Professor getProfessor() {
return professor;
}
public void setProfessor(Professor professor) {
this.professor = professor;
}
public String getUrlFoto() {
return urlFoto;
}
public void setUrlFoto(String urlFoto) {
this.urlFoto = urlFoto;
}
}
| 831 | 0.723225 | 0.722022 | 38 | 19.868422 | 18.467854 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.973684 | false | false |
12
|
d2a024755479d1ba884787ff204955db128e01f5
| 17,669,495,460,041 |
694c483b0a0ffa304a4661d63d21653309fb9c4f
|
/src/main/java/com/siqueira/julio/springblog/data/dao/CommentDaoImpl.java
|
26b1200bc8b6c9818ba2cde101c01fd881490e19
|
[] |
no_license
|
cesarsicas/spring-blog
|
https://github.com/cesarsicas/spring-blog
|
60c2c40ce8abca8d83a2959ec5f20c3fdbb7e74c
|
1d4e8dad56b596cf1beae6d4b2d8508827cddba2
|
refs/heads/master
| 2020-05-30T00:44:02.490000 | 2019-06-25T17:29:10 | 2019-06-25T17:29:10 | 189,464,738 | 0 | 0 | null | false | 2019-06-25T17:17:39 | 2019-05-30T18:40:24 | 2019-06-17T12:48:59 | 2019-06-25T17:17:38 | 92 | 0 | 0 | 0 |
Java
| false | false |
package com.siqueira.julio.springblog.data.dao;
import com.siqueira.julio.springblog.data.entities.Comment;
import org.springframework.stereotype.Repository;
@Repository
public class CommentDaoImpl extends AbstractDao<Comment, Long> implements CommentDao {
}
|
UTF-8
|
Java
| 266 |
java
|
CommentDaoImpl.java
|
Java
|
[] | null |
[] |
package com.siqueira.julio.springblog.data.dao;
import com.siqueira.julio.springblog.data.entities.Comment;
import org.springframework.stereotype.Repository;
@Repository
public class CommentDaoImpl extends AbstractDao<Comment, Long> implements CommentDao {
}
| 266 | 0.823308 | 0.823308 | 9 | 28.555555 | 30.342896 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false |
12
|
9e2f187f7bf7e25850837bfcdbd95546fd9e9534
| 23,063,974,448,870 |
77e9e776fba44b5093fbae3a2ab45eb6ee5e503f
|
/ulohy/2_xhorva11/ija/ija2018/homework2/game/BoardField.java
|
da4b6debebdfb8b70e8861efbfb2aaa4be679235
|
[] |
no_license
|
jofroger/chess
|
https://github.com/jofroger/chess
|
8a2984eedb112f639a3b6ac376e976fe7dbc4ab3
|
7a3aee85af3efb85bb169a786c97c5870a43aff9
|
refs/heads/master
| 2022-01-10T21:21:10.602000 | 2019-05-14T22:29:32 | 2019-05-14T22:29:32 | 184,650,955 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ija.ija2018.homework2.game;
import ija.ija2018.homework2.common.Field;
import ija.ija2018.homework2.common.Figure;
import java.util.Arrays;
public class BoardField implements Field {
private Field up;
private Field rightUp;
private Field right;
private Field rightDown;
private Field down;
private Field leftDown;
private Field left;
private Field leftUp;
private int[] coordinates;
private Figure diskP;
public BoardField(int col, int row) {
coordinates = new int[2];
coordinates[0] = col;
coordinates[1] = row;
down = null;
left = null;
leftDown = null;
leftUp = null;
right = null;
rightDown = null;
rightUp = null;
up = null;
diskP = null;
}
public void addNextField(Field.Direction dirs, Field field) {
switch (dirs) {
case D:
down = field;
break;
case L:
left = field;
break;
case LD:
leftDown = field;
break;
case LU:
leftUp = field;
break;
case R:
right = field;
break;
case RD:
rightDown = field;
break;
case RU:
rightUp = field;
break;
case U:
up = field;
break;
default:
break;
}
}
public Field nextField(Field.Direction dirs) {
switch (dirs) {
case D:
return down;
case L:
return left;
case LD:
return leftDown;
case LU:
return leftUp;
case R:
return right;
case RD:
return rightDown;
case RU:
return rightUp;
case U:
return up;
default:
return null;
}
}
public int[] getCoordinates() {
return coordinates;
}
public boolean equals(BoardField obj) {
int[] otherCord = obj.getCoordinates();
if (Arrays.equals(otherCord, coordinates)) return true;
return false;
}
public int hashCode() {
return hashCode();
}
public boolean put(Figure disk) {
if (diskP == null) {
diskP = disk;
disk.setPosition(coordinates);
return true;
}
return false;
}
public boolean remove(Figure disk) {
if (diskP.equals(disk) && diskP != null) {
diskP = null;
return true;
}
return false;
}
public Figure get() {
if (diskP != null) {
return diskP;
}
return null;
}
public boolean isEmpty() {
return diskP == null;
}
}
|
UTF-8
|
Java
| 3,001 |
java
|
BoardField.java
|
Java
|
[] | null |
[] |
package ija.ija2018.homework2.game;
import ija.ija2018.homework2.common.Field;
import ija.ija2018.homework2.common.Figure;
import java.util.Arrays;
public class BoardField implements Field {
private Field up;
private Field rightUp;
private Field right;
private Field rightDown;
private Field down;
private Field leftDown;
private Field left;
private Field leftUp;
private int[] coordinates;
private Figure diskP;
public BoardField(int col, int row) {
coordinates = new int[2];
coordinates[0] = col;
coordinates[1] = row;
down = null;
left = null;
leftDown = null;
leftUp = null;
right = null;
rightDown = null;
rightUp = null;
up = null;
diskP = null;
}
public void addNextField(Field.Direction dirs, Field field) {
switch (dirs) {
case D:
down = field;
break;
case L:
left = field;
break;
case LD:
leftDown = field;
break;
case LU:
leftUp = field;
break;
case R:
right = field;
break;
case RD:
rightDown = field;
break;
case RU:
rightUp = field;
break;
case U:
up = field;
break;
default:
break;
}
}
public Field nextField(Field.Direction dirs) {
switch (dirs) {
case D:
return down;
case L:
return left;
case LD:
return leftDown;
case LU:
return leftUp;
case R:
return right;
case RD:
return rightDown;
case RU:
return rightUp;
case U:
return up;
default:
return null;
}
}
public int[] getCoordinates() {
return coordinates;
}
public boolean equals(BoardField obj) {
int[] otherCord = obj.getCoordinates();
if (Arrays.equals(otherCord, coordinates)) return true;
return false;
}
public int hashCode() {
return hashCode();
}
public boolean put(Figure disk) {
if (diskP == null) {
diskP = disk;
disk.setPosition(coordinates);
return true;
}
return false;
}
public boolean remove(Figure disk) {
if (diskP.equals(disk) && diskP != null) {
diskP = null;
return true;
}
return false;
}
public Figure get() {
if (diskP != null) {
return diskP;
}
return null;
}
public boolean isEmpty() {
return diskP == null;
}
}
| 3,001 | 0.463512 | 0.457514 | 137 | 20.905109 | 13.444062 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.510949 | false | false |
12
|
f63827b8cc032d5988854c90d38a72ceabb95eda
| 29,119,878,332,909 |
367dab2fb3369b4028143a30524d7b5539cac386
|
/GamesPortal/src/main/java/com/project/inz/model/UserRole.java
|
9497fff0b7a7186a03e277954e479f9cff5856d7
|
[] |
no_license
|
dprzywara/Angular
|
https://github.com/dprzywara/Angular
|
8076738b289354ae5608156b25a8c627e4f0a84f
|
e31db4ed71b49b344ff63dfbfbf11ae7fc03ebca
|
refs/heads/master
| 2021-01-10T13:03:13.493000 | 2016-01-15T09:38:57 | 2016-01-15T09:38:57 | 47,493,039 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.project.inz.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Entity
@Table(name = "user_roles", catalog = "quizgame")
//, uniqueConstraints = @UniqueConstraint(
// columnNames = { "role", "user_id" }))
@Setter @Getter @NoArgsConstructor
@AllArgsConstructor @ToString
public class UserRole implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "role_id", unique = true, nullable = false)
private Integer id;
// @ManyToOne(fetch = FetchType.EAGER)
// @JoinColumn(name = "user_id", nullable = false)
// private User user;
@Column(name = "role", nullable = false, length = 45)
private String role=UserProfileType.USER.getUserProfileType();
// @Column
// @ManyToMany(fetch=FetchType.EAGER,mappedBy = "roles")
// private List<User> users;
}
|
UTF-8
|
Java
| 1,244 |
java
|
UserRole.java
|
Java
|
[] | null |
[] |
package com.project.inz.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Entity
@Table(name = "user_roles", catalog = "quizgame")
//, uniqueConstraints = @UniqueConstraint(
// columnNames = { "role", "user_id" }))
@Setter @Getter @NoArgsConstructor
@AllArgsConstructor @ToString
public class UserRole implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "role_id", unique = true, nullable = false)
private Integer id;
// @ManyToOne(fetch = FetchType.EAGER)
// @JoinColumn(name = "user_id", nullable = false)
// private User user;
@Column(name = "role", nullable = false, length = 45)
private String role=UserProfileType.USER.getUserProfileType();
// @Column
// @ManyToMany(fetch=FetchType.EAGER,mappedBy = "roles")
// private List<User> users;
}
| 1,244 | 0.766881 | 0.764469 | 44 | 27.272728 | 19.505669 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.022727 | false | false |
12
|
1f6d4e3c9999cd6c0291366ca8fc6896b601a7f8
| 2,319,282,407,326 |
ce15e4ca5a54a872439e1edeaeac86959762d0b0
|
/src/main/java/edoardosella/WeatherAPI/RESTControllers/GETMappings/WeatherRoute/POJO/Input/Day.java
|
5749ebcd5194732a93dcba5cf7393f4eb4da6ba7
|
[] |
no_license
|
eddysella/WeatherAPI
|
https://github.com/eddysella/WeatherAPI
|
20534b2e59fb8edd0ca364e58eeab6f8cda3172f
|
2b4de174e727b5db8062a848df840900c22f94b0
|
refs/heads/master
| 2022-12-11T01:04:20.691000 | 2020-09-10T10:32:40 | 2020-09-10T10:32:40 | 290,164,126 | 0 | 0 | null | false | 2020-08-27T11:18:49 | 2020-08-25T08:52:01 | 2020-08-25T11:36:52 | 2020-08-27T11:18:49 | 194 | 0 | 0 | 0 |
Java
| false | false |
package edoardosella.WeatherAPI.RESTControllers.GETMappings.WeatherRoute.POJO.Input;
import com.fasterxml.jackson.annotation.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"Icon",
"IconPhrase",
"HasPrecipitation",
"PrecipitationType",
"PrecipitationIntensity",
"ShortPhrase",
"LongPhrase",
"PrecipitationProbability",
"ThunderstormProbability",
"RainProbability",
"SnowProbability",
"IceProbability",
"Wind",
"WindGust",
"TotalLiquid",
"Rain",
"Snow",
"Ice",
"HoursOfPrecipitation",
"HoursOfRain",
"HoursOfSnow",
"HoursOfIce",
"CloudCover"
})
public class Day implements Serializable {
private final static long serialVersionUID = -2310495539072701008L;
@JsonProperty("Icon")
private long icon;
@JsonProperty("IconPhrase")
private String iconPhrase;
@JsonProperty("HasPrecipitation")
private boolean hasPrecipitation;
@JsonProperty("PrecipitationType")
private String precipitationType;
@JsonProperty("PrecipitationIntensity")
private String precipitationIntensity;
@JsonProperty("ShortPhrase")
private String shortPhrase;
@JsonProperty("LongPhrase")
private String longPhrase;
@JsonProperty("PrecipitationProbability")
private long precipitationProbability;
@JsonProperty("ThunderstormProbability")
private long thunderstormProbability;
@JsonProperty("RainProbability")
private long rainProbability;
@JsonProperty("SnowProbability")
private long snowProbability;
@JsonProperty("IceProbability")
private long iceProbability;
@JsonProperty("Wind")
private Wind wind;
@JsonProperty("WindGust")
private WindGust windGust;
@JsonProperty("TotalLiquid")
private TotalLiquid totalLiquid;
@JsonProperty("Rain")
private Rain rain;
@JsonProperty("Snow")
private Snow snow;
@JsonProperty("Ice")
private Ice ice;
@JsonProperty("HoursOfPrecipitation")
private double hoursOfPrecipitation;
@JsonProperty("HoursOfRain")
private double hoursOfRain;
@JsonProperty("HoursOfSnow")
private long hoursOfSnow;
@JsonProperty("HoursOfIce")
private long hoursOfIce;
@JsonProperty("CloudCover")
private long cloudCover;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
/**
* No args constructor for use in serialization
*/
public Day() {
}
/**
* @param hoursOfPrecipitation
* @param precipitationProbability
* @param rain
* @param hoursOfSnow
* @param precipitationIntensity
* @param windGust
* @param thunderstormProbability
* @param icon
* @param longPhrase
* @param cloudCover
* @param iconPhrase
* @param ice
* @param snowProbability
* @param rainProbability
* @param hasPrecipitation
* @param precipitationType
* @param snow
* @param hoursOfRain
* @param totalLiquid
* @param shortPhrase
* @param iceProbability
* @param hoursOfIce
* @param wind
*/
public Day(long icon, String iconPhrase, boolean hasPrecipitation, String precipitationType, String precipitationIntensity, String shortPhrase, String longPhrase, long precipitationProbability, long thunderstormProbability, long rainProbability, long snowProbability, long iceProbability, Wind wind, WindGust windGust, TotalLiquid totalLiquid, Rain rain, Snow snow, Ice ice, double hoursOfPrecipitation, double hoursOfRain, long hoursOfSnow, long hoursOfIce, long cloudCover) {
super();
this.icon = icon;
this.iconPhrase = iconPhrase;
this.hasPrecipitation = hasPrecipitation;
this.precipitationType = precipitationType;
this.precipitationIntensity = precipitationIntensity;
this.shortPhrase = shortPhrase;
this.longPhrase = longPhrase;
this.precipitationProbability = precipitationProbability;
this.thunderstormProbability = thunderstormProbability;
this.rainProbability = rainProbability;
this.snowProbability = snowProbability;
this.iceProbability = iceProbability;
this.wind = wind;
this.windGust = windGust;
this.totalLiquid = totalLiquid;
this.rain = rain;
this.snow = snow;
this.ice = ice;
this.hoursOfPrecipitation = hoursOfPrecipitation;
this.hoursOfRain = hoursOfRain;
this.hoursOfSnow = hoursOfSnow;
this.hoursOfIce = hoursOfIce;
this.cloudCover = cloudCover;
}
@JsonProperty("Icon")
public long getIcon() {
return icon;
}
@JsonProperty("Icon")
public void setIcon(long icon) {
this.icon = icon;
}
public Day withIcon(long icon) {
this.icon = icon;
return this;
}
@JsonProperty("IconPhrase")
public String getIconPhrase() {
return iconPhrase;
}
@JsonProperty("IconPhrase")
public void setIconPhrase(String iconPhrase) {
this.iconPhrase = iconPhrase;
}
public Day withIconPhrase(String iconPhrase) {
this.iconPhrase = iconPhrase;
return this;
}
@JsonProperty("HasPrecipitation")
public boolean isHasPrecipitation() {
return hasPrecipitation;
}
@JsonProperty("HasPrecipitation")
public void setHasPrecipitation(boolean hasPrecipitation) {
this.hasPrecipitation = hasPrecipitation;
}
public Day withHasPrecipitation(boolean hasPrecipitation) {
this.hasPrecipitation = hasPrecipitation;
return this;
}
@JsonProperty("PrecipitationType")
public String getPrecipitationType() {
return precipitationType;
}
@JsonProperty("PrecipitationType")
public void setPrecipitationType(String precipitationType) {
this.precipitationType = precipitationType;
}
public Day withPrecipitationType(String precipitationType) {
this.precipitationType = precipitationType;
return this;
}
@JsonProperty("PrecipitationIntensity")
public String getPrecipitationIntensity() {
return precipitationIntensity;
}
@JsonProperty("PrecipitationIntensity")
public void setPrecipitationIntensity(String precipitationIntensity) {
this.precipitationIntensity = precipitationIntensity;
}
public Day withPrecipitationIntensity(String precipitationIntensity) {
this.precipitationIntensity = precipitationIntensity;
return this;
}
@JsonProperty("ShortPhrase")
public String getShortPhrase() {
return shortPhrase;
}
@JsonProperty("ShortPhrase")
public void setShortPhrase(String shortPhrase) {
this.shortPhrase = shortPhrase;
}
public Day withShortPhrase(String shortPhrase) {
this.shortPhrase = shortPhrase;
return this;
}
@JsonProperty("LongPhrase")
public String getLongPhrase() {
return longPhrase;
}
@JsonProperty("LongPhrase")
public void setLongPhrase(String longPhrase) {
this.longPhrase = longPhrase;
}
public Day withLongPhrase(String longPhrase) {
this.longPhrase = longPhrase;
return this;
}
@JsonProperty("PrecipitationProbability")
public long getPrecipitationProbability() {
return precipitationProbability;
}
@JsonProperty("PrecipitationProbability")
public void setPrecipitationProbability(long precipitationProbability) {
this.precipitationProbability = precipitationProbability;
}
public Day withPrecipitationProbability(long precipitationProbability) {
this.precipitationProbability = precipitationProbability;
return this;
}
@JsonProperty("ThunderstormProbability")
public long getThunderstormProbability() {
return thunderstormProbability;
}
@JsonProperty("ThunderstormProbability")
public void setThunderstormProbability(long thunderstormProbability) {
this.thunderstormProbability = thunderstormProbability;
}
public Day withThunderstormProbability(long thunderstormProbability) {
this.thunderstormProbability = thunderstormProbability;
return this;
}
@JsonProperty("RainProbability")
public long getRainProbability() {
return rainProbability;
}
@JsonProperty("RainProbability")
public void setRainProbability(long rainProbability) {
this.rainProbability = rainProbability;
}
public Day withRainProbability(long rainProbability) {
this.rainProbability = rainProbability;
return this;
}
@JsonProperty("SnowProbability")
public long getSnowProbability() {
return snowProbability;
}
@JsonProperty("SnowProbability")
public void setSnowProbability(long snowProbability) {
this.snowProbability = snowProbability;
}
public Day withSnowProbability(long snowProbability) {
this.snowProbability = snowProbability;
return this;
}
@JsonProperty("IceProbability")
public long getIceProbability() {
return iceProbability;
}
@JsonProperty("IceProbability")
public void setIceProbability(long iceProbability) {
this.iceProbability = iceProbability;
}
public Day withIceProbability(long iceProbability) {
this.iceProbability = iceProbability;
return this;
}
@JsonProperty("Wind")
public Wind getWind() {
return wind;
}
@JsonProperty("Wind")
public void setWind(Wind wind) {
this.wind = wind;
}
public Day withWind(Wind wind) {
this.wind = wind;
return this;
}
@JsonProperty("WindGust")
public WindGust getWindGust() {
return windGust;
}
@JsonProperty("WindGust")
public void setWindGust(WindGust windGust) {
this.windGust = windGust;
}
public Day withWindGust(WindGust windGust) {
this.windGust = windGust;
return this;
}
@JsonProperty("TotalLiquid")
public TotalLiquid getTotalLiquid() {
return totalLiquid;
}
@JsonProperty("TotalLiquid")
public void setTotalLiquid(TotalLiquid totalLiquid) {
this.totalLiquid = totalLiquid;
}
public Day withTotalLiquid(TotalLiquid totalLiquid) {
this.totalLiquid = totalLiquid;
return this;
}
@JsonProperty("Rain")
public Rain getRain() {
return rain;
}
@JsonProperty("Rain")
public void setRain(Rain rain) {
this.rain = rain;
}
public Day withRain(Rain rain) {
this.rain = rain;
return this;
}
@JsonProperty("Snow")
public Snow getSnow() {
return snow;
}
@JsonProperty("Snow")
public void setSnow(Snow snow) {
this.snow = snow;
}
public Day withSnow(Snow snow) {
this.snow = snow;
return this;
}
@JsonProperty("Ice")
public Ice getIce() {
return ice;
}
@JsonProperty("Ice")
public void setIce(Ice ice) {
this.ice = ice;
}
public Day withIce(Ice ice) {
this.ice = ice;
return this;
}
@JsonProperty("HoursOfPrecipitation")
public double getHoursOfPrecipitation() {
return hoursOfPrecipitation;
}
@JsonProperty("HoursOfPrecipitation")
public void setHoursOfPrecipitation(double hoursOfPrecipitation) {
this.hoursOfPrecipitation = hoursOfPrecipitation;
}
public Day withHoursOfPrecipitation(double hoursOfPrecipitation) {
this.hoursOfPrecipitation = hoursOfPrecipitation;
return this;
}
@JsonProperty("HoursOfRain")
public double getHoursOfRain() {
return hoursOfRain;
}
@JsonProperty("HoursOfRain")
public void setHoursOfRain(double hoursOfRain) {
this.hoursOfRain = hoursOfRain;
}
public Day withHoursOfRain(double hoursOfRain) {
this.hoursOfRain = hoursOfRain;
return this;
}
@JsonProperty("HoursOfSnow")
public long getHoursOfSnow() {
return hoursOfSnow;
}
@JsonProperty("HoursOfSnow")
public void setHoursOfSnow(long hoursOfSnow) {
this.hoursOfSnow = hoursOfSnow;
}
public Day withHoursOfSnow(long hoursOfSnow) {
this.hoursOfSnow = hoursOfSnow;
return this;
}
@JsonProperty("HoursOfIce")
public long getHoursOfIce() {
return hoursOfIce;
}
@JsonProperty("HoursOfIce")
public void setHoursOfIce(long hoursOfIce) {
this.hoursOfIce = hoursOfIce;
}
public Day withHoursOfIce(long hoursOfIce) {
this.hoursOfIce = hoursOfIce;
return this;
}
@JsonProperty("CloudCover")
public long getCloudCover() {
return cloudCover;
}
@JsonProperty("CloudCover")
public void setCloudCover(long cloudCover) {
this.cloudCover = cloudCover;
}
public Day withCloudCover(long cloudCover) {
this.cloudCover = cloudCover;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Day withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
}
|
UTF-8
|
Java
| 13,684 |
java
|
Day.java
|
Java
|
[] | null |
[] |
package edoardosella.WeatherAPI.RESTControllers.GETMappings.WeatherRoute.POJO.Input;
import com.fasterxml.jackson.annotation.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"Icon",
"IconPhrase",
"HasPrecipitation",
"PrecipitationType",
"PrecipitationIntensity",
"ShortPhrase",
"LongPhrase",
"PrecipitationProbability",
"ThunderstormProbability",
"RainProbability",
"SnowProbability",
"IceProbability",
"Wind",
"WindGust",
"TotalLiquid",
"Rain",
"Snow",
"Ice",
"HoursOfPrecipitation",
"HoursOfRain",
"HoursOfSnow",
"HoursOfIce",
"CloudCover"
})
public class Day implements Serializable {
private final static long serialVersionUID = -2310495539072701008L;
@JsonProperty("Icon")
private long icon;
@JsonProperty("IconPhrase")
private String iconPhrase;
@JsonProperty("HasPrecipitation")
private boolean hasPrecipitation;
@JsonProperty("PrecipitationType")
private String precipitationType;
@JsonProperty("PrecipitationIntensity")
private String precipitationIntensity;
@JsonProperty("ShortPhrase")
private String shortPhrase;
@JsonProperty("LongPhrase")
private String longPhrase;
@JsonProperty("PrecipitationProbability")
private long precipitationProbability;
@JsonProperty("ThunderstormProbability")
private long thunderstormProbability;
@JsonProperty("RainProbability")
private long rainProbability;
@JsonProperty("SnowProbability")
private long snowProbability;
@JsonProperty("IceProbability")
private long iceProbability;
@JsonProperty("Wind")
private Wind wind;
@JsonProperty("WindGust")
private WindGust windGust;
@JsonProperty("TotalLiquid")
private TotalLiquid totalLiquid;
@JsonProperty("Rain")
private Rain rain;
@JsonProperty("Snow")
private Snow snow;
@JsonProperty("Ice")
private Ice ice;
@JsonProperty("HoursOfPrecipitation")
private double hoursOfPrecipitation;
@JsonProperty("HoursOfRain")
private double hoursOfRain;
@JsonProperty("HoursOfSnow")
private long hoursOfSnow;
@JsonProperty("HoursOfIce")
private long hoursOfIce;
@JsonProperty("CloudCover")
private long cloudCover;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
/**
* No args constructor for use in serialization
*/
public Day() {
}
/**
* @param hoursOfPrecipitation
* @param precipitationProbability
* @param rain
* @param hoursOfSnow
* @param precipitationIntensity
* @param windGust
* @param thunderstormProbability
* @param icon
* @param longPhrase
* @param cloudCover
* @param iconPhrase
* @param ice
* @param snowProbability
* @param rainProbability
* @param hasPrecipitation
* @param precipitationType
* @param snow
* @param hoursOfRain
* @param totalLiquid
* @param shortPhrase
* @param iceProbability
* @param hoursOfIce
* @param wind
*/
public Day(long icon, String iconPhrase, boolean hasPrecipitation, String precipitationType, String precipitationIntensity, String shortPhrase, String longPhrase, long precipitationProbability, long thunderstormProbability, long rainProbability, long snowProbability, long iceProbability, Wind wind, WindGust windGust, TotalLiquid totalLiquid, Rain rain, Snow snow, Ice ice, double hoursOfPrecipitation, double hoursOfRain, long hoursOfSnow, long hoursOfIce, long cloudCover) {
super();
this.icon = icon;
this.iconPhrase = iconPhrase;
this.hasPrecipitation = hasPrecipitation;
this.precipitationType = precipitationType;
this.precipitationIntensity = precipitationIntensity;
this.shortPhrase = shortPhrase;
this.longPhrase = longPhrase;
this.precipitationProbability = precipitationProbability;
this.thunderstormProbability = thunderstormProbability;
this.rainProbability = rainProbability;
this.snowProbability = snowProbability;
this.iceProbability = iceProbability;
this.wind = wind;
this.windGust = windGust;
this.totalLiquid = totalLiquid;
this.rain = rain;
this.snow = snow;
this.ice = ice;
this.hoursOfPrecipitation = hoursOfPrecipitation;
this.hoursOfRain = hoursOfRain;
this.hoursOfSnow = hoursOfSnow;
this.hoursOfIce = hoursOfIce;
this.cloudCover = cloudCover;
}
@JsonProperty("Icon")
public long getIcon() {
return icon;
}
@JsonProperty("Icon")
public void setIcon(long icon) {
this.icon = icon;
}
public Day withIcon(long icon) {
this.icon = icon;
return this;
}
@JsonProperty("IconPhrase")
public String getIconPhrase() {
return iconPhrase;
}
@JsonProperty("IconPhrase")
public void setIconPhrase(String iconPhrase) {
this.iconPhrase = iconPhrase;
}
public Day withIconPhrase(String iconPhrase) {
this.iconPhrase = iconPhrase;
return this;
}
@JsonProperty("HasPrecipitation")
public boolean isHasPrecipitation() {
return hasPrecipitation;
}
@JsonProperty("HasPrecipitation")
public void setHasPrecipitation(boolean hasPrecipitation) {
this.hasPrecipitation = hasPrecipitation;
}
public Day withHasPrecipitation(boolean hasPrecipitation) {
this.hasPrecipitation = hasPrecipitation;
return this;
}
@JsonProperty("PrecipitationType")
public String getPrecipitationType() {
return precipitationType;
}
@JsonProperty("PrecipitationType")
public void setPrecipitationType(String precipitationType) {
this.precipitationType = precipitationType;
}
public Day withPrecipitationType(String precipitationType) {
this.precipitationType = precipitationType;
return this;
}
@JsonProperty("PrecipitationIntensity")
public String getPrecipitationIntensity() {
return precipitationIntensity;
}
@JsonProperty("PrecipitationIntensity")
public void setPrecipitationIntensity(String precipitationIntensity) {
this.precipitationIntensity = precipitationIntensity;
}
public Day withPrecipitationIntensity(String precipitationIntensity) {
this.precipitationIntensity = precipitationIntensity;
return this;
}
@JsonProperty("ShortPhrase")
public String getShortPhrase() {
return shortPhrase;
}
@JsonProperty("ShortPhrase")
public void setShortPhrase(String shortPhrase) {
this.shortPhrase = shortPhrase;
}
public Day withShortPhrase(String shortPhrase) {
this.shortPhrase = shortPhrase;
return this;
}
@JsonProperty("LongPhrase")
public String getLongPhrase() {
return longPhrase;
}
@JsonProperty("LongPhrase")
public void setLongPhrase(String longPhrase) {
this.longPhrase = longPhrase;
}
public Day withLongPhrase(String longPhrase) {
this.longPhrase = longPhrase;
return this;
}
@JsonProperty("PrecipitationProbability")
public long getPrecipitationProbability() {
return precipitationProbability;
}
@JsonProperty("PrecipitationProbability")
public void setPrecipitationProbability(long precipitationProbability) {
this.precipitationProbability = precipitationProbability;
}
public Day withPrecipitationProbability(long precipitationProbability) {
this.precipitationProbability = precipitationProbability;
return this;
}
@JsonProperty("ThunderstormProbability")
public long getThunderstormProbability() {
return thunderstormProbability;
}
@JsonProperty("ThunderstormProbability")
public void setThunderstormProbability(long thunderstormProbability) {
this.thunderstormProbability = thunderstormProbability;
}
public Day withThunderstormProbability(long thunderstormProbability) {
this.thunderstormProbability = thunderstormProbability;
return this;
}
@JsonProperty("RainProbability")
public long getRainProbability() {
return rainProbability;
}
@JsonProperty("RainProbability")
public void setRainProbability(long rainProbability) {
this.rainProbability = rainProbability;
}
public Day withRainProbability(long rainProbability) {
this.rainProbability = rainProbability;
return this;
}
@JsonProperty("SnowProbability")
public long getSnowProbability() {
return snowProbability;
}
@JsonProperty("SnowProbability")
public void setSnowProbability(long snowProbability) {
this.snowProbability = snowProbability;
}
public Day withSnowProbability(long snowProbability) {
this.snowProbability = snowProbability;
return this;
}
@JsonProperty("IceProbability")
public long getIceProbability() {
return iceProbability;
}
@JsonProperty("IceProbability")
public void setIceProbability(long iceProbability) {
this.iceProbability = iceProbability;
}
public Day withIceProbability(long iceProbability) {
this.iceProbability = iceProbability;
return this;
}
@JsonProperty("Wind")
public Wind getWind() {
return wind;
}
@JsonProperty("Wind")
public void setWind(Wind wind) {
this.wind = wind;
}
public Day withWind(Wind wind) {
this.wind = wind;
return this;
}
@JsonProperty("WindGust")
public WindGust getWindGust() {
return windGust;
}
@JsonProperty("WindGust")
public void setWindGust(WindGust windGust) {
this.windGust = windGust;
}
public Day withWindGust(WindGust windGust) {
this.windGust = windGust;
return this;
}
@JsonProperty("TotalLiquid")
public TotalLiquid getTotalLiquid() {
return totalLiquid;
}
@JsonProperty("TotalLiquid")
public void setTotalLiquid(TotalLiquid totalLiquid) {
this.totalLiquid = totalLiquid;
}
public Day withTotalLiquid(TotalLiquid totalLiquid) {
this.totalLiquid = totalLiquid;
return this;
}
@JsonProperty("Rain")
public Rain getRain() {
return rain;
}
@JsonProperty("Rain")
public void setRain(Rain rain) {
this.rain = rain;
}
public Day withRain(Rain rain) {
this.rain = rain;
return this;
}
@JsonProperty("Snow")
public Snow getSnow() {
return snow;
}
@JsonProperty("Snow")
public void setSnow(Snow snow) {
this.snow = snow;
}
public Day withSnow(Snow snow) {
this.snow = snow;
return this;
}
@JsonProperty("Ice")
public Ice getIce() {
return ice;
}
@JsonProperty("Ice")
public void setIce(Ice ice) {
this.ice = ice;
}
public Day withIce(Ice ice) {
this.ice = ice;
return this;
}
@JsonProperty("HoursOfPrecipitation")
public double getHoursOfPrecipitation() {
return hoursOfPrecipitation;
}
@JsonProperty("HoursOfPrecipitation")
public void setHoursOfPrecipitation(double hoursOfPrecipitation) {
this.hoursOfPrecipitation = hoursOfPrecipitation;
}
public Day withHoursOfPrecipitation(double hoursOfPrecipitation) {
this.hoursOfPrecipitation = hoursOfPrecipitation;
return this;
}
@JsonProperty("HoursOfRain")
public double getHoursOfRain() {
return hoursOfRain;
}
@JsonProperty("HoursOfRain")
public void setHoursOfRain(double hoursOfRain) {
this.hoursOfRain = hoursOfRain;
}
public Day withHoursOfRain(double hoursOfRain) {
this.hoursOfRain = hoursOfRain;
return this;
}
@JsonProperty("HoursOfSnow")
public long getHoursOfSnow() {
return hoursOfSnow;
}
@JsonProperty("HoursOfSnow")
public void setHoursOfSnow(long hoursOfSnow) {
this.hoursOfSnow = hoursOfSnow;
}
public Day withHoursOfSnow(long hoursOfSnow) {
this.hoursOfSnow = hoursOfSnow;
return this;
}
@JsonProperty("HoursOfIce")
public long getHoursOfIce() {
return hoursOfIce;
}
@JsonProperty("HoursOfIce")
public void setHoursOfIce(long hoursOfIce) {
this.hoursOfIce = hoursOfIce;
}
public Day withHoursOfIce(long hoursOfIce) {
this.hoursOfIce = hoursOfIce;
return this;
}
@JsonProperty("CloudCover")
public long getCloudCover() {
return cloudCover;
}
@JsonProperty("CloudCover")
public void setCloudCover(long cloudCover) {
this.cloudCover = cloudCover;
}
public Day withCloudCover(long cloudCover) {
this.cloudCover = cloudCover;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Day withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
}
| 13,684 | 0.668737 | 0.667349 | 505 | 26.097031 | 27.949751 | 481 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.39802 | false | false |
12
|
c3be9155649bcbc8300ccc19d3dd9cbe9b20e153
| 3,839,700,801,905 |
d40cfc233262d5e7c738ce29e606f1be70505d8b
|
/protsim/src/main/java/fi/utu/protproc/group3/simulator/NetworkImpl.java
|
f85e6f04586686cf4bea6c75c8596b89d2e99a07
|
[] |
no_license
|
mirkoschicchi/Protocol-processing-and-security-project
|
https://github.com/mirkoschicchi/Protocol-processing-and-security-project
|
a62aeb4963532d0c858ebd8e3002deb5b9cb3e64
|
559762039699ce6b2866cc59b6c600e0719d7a04
|
refs/heads/master
| 2022-12-29T08:16:47.967000 | 2020-01-04T11:55:02 | 2020-01-04T11:55:02 | 219,956,297 | 0 | 1 | null | false | 2022-12-14T20:43:19 | 2019-11-06T09:13:18 | 2020-01-04T11:55:09 | 2022-12-14T20:43:16 | 1,509 | 1 | 0 | 16 |
Java
| false | false |
package fi.utu.protproc.group3.simulator;
import fi.utu.protproc.group3.configuration.NetworkConfiguration;
import fi.utu.protproc.group3.utils.NetworkAddress;
import reactor.core.publisher.DirectProcessor;
import reactor.core.publisher.Flux;
import reactor.core.publisher.FluxSink;
import reactor.core.scheduler.Schedulers;
import java.util.*;
public class NetworkImpl implements Network {
private final int autonomousSystem;
private final FluxSink<byte[]> input;
private final Flux<byte[]> output;
private final List<EthernetInterface> interfaces = new ArrayList<>();
private final NetworkAddress networkAddress;
private final String networkName;
private volatile boolean isOnline;
NetworkImpl(SimulationBuilderContext context, NetworkConfiguration configuration) {
Objects.requireNonNull(context);
Objects.requireNonNull(configuration);
this.networkAddress = context.generator().networkAddress(configuration.getAddress());
this.networkName = context.generator().hostName(configuration.getName());
this.autonomousSystem = configuration.getAutonomousSystem();
var processor = DirectProcessor.<byte[]>create().serialize();
input = processor.sink(FluxSink.OverflowStrategy.DROP);
output = processor
.filter(p -> isOnline)
.publish()
.autoConnect(0)
.publishOn(Schedulers.elastic())
;
}
@Override
public boolean isOnline() {
return isOnline;
}
@Override
public void start() {
isOnline = true;
}
@Override
public void shutdown() {
isOnline = false;
}
@Override
public NetworkAddress getNetworkAddress() {
return networkAddress;
}
@Override
public void addDevice(EthernetInterface intf) {
Objects.requireNonNull(intf);
interfaces.add(intf);
}
@Override
public Collection<EthernetInterface> getDevices() {
return Collections.unmodifiableCollection(interfaces);
}
public String getNetworkName() {
return networkName;
}
@Override
public Flux<byte[]> getFlux() {
return output;
}
@Override
public void transmit(byte[] pdu) {
input.next(pdu);
}
@Override
public int getAutonomousSystem() {
return autonomousSystem;
}
@Override
public String toString() {
return networkName + " (" + networkAddress + ')';
}
}
|
UTF-8
|
Java
| 2,513 |
java
|
NetworkImpl.java
|
Java
|
[] | null |
[] |
package fi.utu.protproc.group3.simulator;
import fi.utu.protproc.group3.configuration.NetworkConfiguration;
import fi.utu.protproc.group3.utils.NetworkAddress;
import reactor.core.publisher.DirectProcessor;
import reactor.core.publisher.Flux;
import reactor.core.publisher.FluxSink;
import reactor.core.scheduler.Schedulers;
import java.util.*;
public class NetworkImpl implements Network {
private final int autonomousSystem;
private final FluxSink<byte[]> input;
private final Flux<byte[]> output;
private final List<EthernetInterface> interfaces = new ArrayList<>();
private final NetworkAddress networkAddress;
private final String networkName;
private volatile boolean isOnline;
NetworkImpl(SimulationBuilderContext context, NetworkConfiguration configuration) {
Objects.requireNonNull(context);
Objects.requireNonNull(configuration);
this.networkAddress = context.generator().networkAddress(configuration.getAddress());
this.networkName = context.generator().hostName(configuration.getName());
this.autonomousSystem = configuration.getAutonomousSystem();
var processor = DirectProcessor.<byte[]>create().serialize();
input = processor.sink(FluxSink.OverflowStrategy.DROP);
output = processor
.filter(p -> isOnline)
.publish()
.autoConnect(0)
.publishOn(Schedulers.elastic())
;
}
@Override
public boolean isOnline() {
return isOnline;
}
@Override
public void start() {
isOnline = true;
}
@Override
public void shutdown() {
isOnline = false;
}
@Override
public NetworkAddress getNetworkAddress() {
return networkAddress;
}
@Override
public void addDevice(EthernetInterface intf) {
Objects.requireNonNull(intf);
interfaces.add(intf);
}
@Override
public Collection<EthernetInterface> getDevices() {
return Collections.unmodifiableCollection(interfaces);
}
public String getNetworkName() {
return networkName;
}
@Override
public Flux<byte[]> getFlux() {
return output;
}
@Override
public void transmit(byte[] pdu) {
input.next(pdu);
}
@Override
public int getAutonomousSystem() {
return autonomousSystem;
}
@Override
public String toString() {
return networkName + " (" + networkAddress + ')';
}
}
| 2,513 | 0.666534 | 0.664942 | 94 | 25.734043 | 22.963049 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.382979 | false | false |
12
|
f76f348895c72518bd083e43f5a5c465eaf20293
| 17,076,790,034,985 |
8729c0c2c8c51e5f0b0547980d5baf9f9c0bdfef
|
/app/src/main/java/com/colorchen/utils/Imager.java
|
8b6b83c979be53d77fcdc6e033d822c0f27b007b
|
[] |
no_license
|
colorchenvip/LearnDemo
|
https://github.com/colorchenvip/LearnDemo
|
ac1c7b4abd40630e4235c6cf566e6e1f9b0b2454
|
0045af10d3422b835717318e8fdecc02c6f5b0f5
|
refs/heads/master
| 2020-09-20T22:10:47.226000 | 2018-01-15T09:18:14 | 2018-01-15T09:18:14 | 66,063,648 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.colorchen.utils;
import android.content.Context;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
/**
* loading img encapsulation.
*/
public class Imager {
public static void load(Context context, String url, ImageView view) {
Glide.with(context)
.load(url)
.into(view);
}
public static void load(Context context, int resourceId, ImageView view) {
Glide.with(context)
.load(resourceId)
.into(view);
}
}
|
UTF-8
|
Java
| 536 |
java
|
Imager.java
|
Java
|
[] | null |
[] |
package com.colorchen.utils;
import android.content.Context;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
/**
* loading img encapsulation.
*/
public class Imager {
public static void load(Context context, String url, ImageView view) {
Glide.with(context)
.load(url)
.into(view);
}
public static void load(Context context, int resourceId, ImageView view) {
Glide.with(context)
.load(resourceId)
.into(view);
}
}
| 536 | 0.617537 | 0.617537 | 25 | 20.440001 | 21.023949 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false |
12
|
bd9a122fc1c65a9097b7bfa283e3d5dc27fc6e30
| 21,251,498,236,305 |
46b5eeffab6379b6a40cb3d93e0beb205870762a
|
/app/src/main/java/io/arfirman1402/dev/githubsearchquery/controller/UserController.java
|
71f98c71a33039abf98392c97c85e3ffe80e9e8c
|
[] |
no_license
|
arfirman1402/GithubSearchQuery
|
https://github.com/arfirman1402/GithubSearchQuery
|
f7321e79319345562e79699d41576f77cd4e7b23
|
22f29f32378008b7f557a4c39f201823f6343872
|
refs/heads/master
| 2021-01-21T00:01:55.432000 | 2017-09-05T03:23:47 | 2017-09-05T03:23:47 | 101,857,809 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package io.arfirman1402.dev.githubsearchquery.controller;
import android.support.annotation.NonNull;
import android.util.Log;
import org.greenrobot.eventbus.EventBus;
import io.arfirman1402.dev.githubsearchquery.App;
import io.arfirman1402.dev.githubsearchquery.event.UserEvent;
import io.arfirman1402.dev.githubsearchquery.model.Result;
import io.arfirman1402.dev.githubsearchquery.model.User;
import io.arfirman1402.dev.githubsearchquery.util.IConstant;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Created by alodokter-it on 31/08/17 -- UserController.
*/
public class UserController {
private EventBus eventBus = App.getInstance().getEventBus();
private static final String TAG = "UserController";
public void searchUser(String userQuery, int pageNumber) {
Call<Result<User>> userSearchResult = App.getInstance().getGithubApi().getUserSearchResult(userQuery, pageNumber, IConstant.QUERY_PER_PAGE);
userSearchResult.enqueue(new Callback<Result<User>>() {
private UserEvent userEvent;
@Override
public void onResponse(@NonNull Call<Result<User>> call, @NonNull Response<Result<User>> response) {
if (response.code() == 200) {
userEvent = new UserEvent(true, response.message(), response.body());
} else {
userEvent = new UserEvent(false, response.message());
}
eventBus.post(userEvent);
}
@Override
public void onFailure(@NonNull Call<Result<User>> call, @NonNull Throwable t) {
Log.e(TAG, "onFailure: Has Some Failure", t);
userEvent = new UserEvent(false, t.getMessage());
eventBus.post(userEvent);
}
});
}
}
|
UTF-8
|
Java
| 1,837 |
java
|
UserController.java
|
Java
|
[
{
"context": "ack;\nimport retrofit2.Response;\n\n/**\n * Created by alodokter-it on 31/08/17 -- UserController.\n */\n\npublic class ",
"end": 567,
"score": 0.9995833039283752,
"start": 555,
"tag": "USERNAME",
"value": "alodokter-it"
}
] | null |
[] |
package io.arfirman1402.dev.githubsearchquery.controller;
import android.support.annotation.NonNull;
import android.util.Log;
import org.greenrobot.eventbus.EventBus;
import io.arfirman1402.dev.githubsearchquery.App;
import io.arfirman1402.dev.githubsearchquery.event.UserEvent;
import io.arfirman1402.dev.githubsearchquery.model.Result;
import io.arfirman1402.dev.githubsearchquery.model.User;
import io.arfirman1402.dev.githubsearchquery.util.IConstant;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Created by alodokter-it on 31/08/17 -- UserController.
*/
public class UserController {
private EventBus eventBus = App.getInstance().getEventBus();
private static final String TAG = "UserController";
public void searchUser(String userQuery, int pageNumber) {
Call<Result<User>> userSearchResult = App.getInstance().getGithubApi().getUserSearchResult(userQuery, pageNumber, IConstant.QUERY_PER_PAGE);
userSearchResult.enqueue(new Callback<Result<User>>() {
private UserEvent userEvent;
@Override
public void onResponse(@NonNull Call<Result<User>> call, @NonNull Response<Result<User>> response) {
if (response.code() == 200) {
userEvent = new UserEvent(true, response.message(), response.body());
} else {
userEvent = new UserEvent(false, response.message());
}
eventBus.post(userEvent);
}
@Override
public void onFailure(@NonNull Call<Result<User>> call, @NonNull Throwable t) {
Log.e(TAG, "onFailure: Has Some Failure", t);
userEvent = new UserEvent(false, t.getMessage());
eventBus.post(userEvent);
}
});
}
}
| 1,837 | 0.666848 | 0.647251 | 48 | 37.270832 | 32.517776 | 148 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.708333 | false | false |
12
|
54e2b42444fab7c9f17334312196e41b03d50459
| 13,623,636,325,656 |
a9b04ed23f993a5b2728a25ae6f0c16cad7fb965
|
/spring-boot-webapp/src/main/java/com/base/spring/utils/Test3.java
|
17f7b8b80f1175d454ce75f26a0fdeb92acc0cf7
|
[
"Apache-2.0"
] |
permissive
|
aillamsun/spring-boot
|
https://github.com/aillamsun/spring-boot
|
6c118d344ea15d884ef0ac81699fddd58d206a86
|
db5e00b1d3537affd390ecc1d09bf70f833b87dd
|
refs/heads/master
| 2021-06-07T20:35:31.223000 | 2016-10-19T09:27:41 | 2016-10-19T09:27:41 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.base.spring.utils;
/**
* Description : TODO()
* User: h819
* Date: 2016/7/18
* Time: 11:27
* To change this template use File | Settings | File Templates.
*/
public class Test3 {
public static void main(String[] args) {
Test3 t = new Test3();
String s1 ="http://s.capital-std.com/testcgi.exe?<SCRIPT>alert(“Cookie”+document.cookie)</SCRIPT>";
}
private String xss(String value) {
return "";
}
}
|
UTF-8
|
Java
| 460 |
java
|
Test3.java
|
Java
|
[
{
"context": "pring.utils;\n\n/**\n * Description : TODO()\n * User: h819\n * Date: 2016/7/18\n * Time: 11:27\n * To change th",
"end": 73,
"score": 0.9994372725486755,
"start": 69,
"tag": "USERNAME",
"value": "h819"
}
] | null |
[] |
package com.base.spring.utils;
/**
* Description : TODO()
* User: h819
* Date: 2016/7/18
* Time: 11:27
* To change this template use File | Settings | File Templates.
*/
public class Test3 {
public static void main(String[] args) {
Test3 t = new Test3();
String s1 ="http://s.capital-std.com/testcgi.exe?<SCRIPT>alert(“Cookie”+document.cookie)</SCRIPT>";
}
private String xss(String value) {
return "";
}
}
| 460 | 0.616228 | 0.576754 | 24 | 18 | 24.859606 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false |
12
|
98240fcb08963090131ecea7bad9128b26b67ec7
| 19,164,144,143,432 |
c32ae7bf598aacd537717c5ae3f666149afd39d1
|
/Spring web app/src/main/java/com/example/engine/repository/UserRepository.java
|
1baebf7fc0e210d2808473d3749b2619c7cb6108
|
[] |
no_license
|
Okololuga/Spring-Web-App
|
https://github.com/Okololuga/Spring-Web-App
|
010c1d68d7bee26d9a97c24183f7fd5ba2be06e0
|
47ad0e5c44ccf59ca460f39f2053e3e3c42e32fb
|
refs/heads/master
| 2023-05-09T14:21:03.453000 | 2020-08-03T11:44:53 | 2020-08-03T11:44:53 | 284,683,379 | 0 | 0 | null | false | 2021-06-04T22:13:11 | 2020-08-03T11:35:16 | 2020-08-03T11:44:56 | 2021-06-04T22:13:09 | 57 | 0 | 0 | 1 |
Java
| false | false |
package com.example.engine.repository;
import com.example.engine.entity.User;
import org.springframework.data.repository.CrudRepository;
import java.util.Optional;
public interface UserRepository extends CrudRepository<User, Long> {
Optional<User> findByEmail(String email);
}
|
UTF-8
|
Java
| 290 |
java
|
UserRepository.java
|
Java
|
[] | null |
[] |
package com.example.engine.repository;
import com.example.engine.entity.User;
import org.springframework.data.repository.CrudRepository;
import java.util.Optional;
public interface UserRepository extends CrudRepository<User, Long> {
Optional<User> findByEmail(String email);
}
| 290 | 0.796552 | 0.796552 | 9 | 30.444445 | 24.120583 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false |
12
|
952b018c85e4a86c816636f811349f05807e321d
| 33,663,953,725,695 |
d74785546dbfb52ae7388ca440d5bf58e1193193
|
/src/main/java/ru/aryukov/model/Menu/iItalain/Food.java
|
18ede0f90b478d2cfe60676dd8824a52572ded99
|
[] |
no_license
|
OlegAryukov/TestAboutPatterns
|
https://github.com/OlegAryukov/TestAboutPatterns
|
62d18880d18c0ef8d8f2719b6617ca3ef9c35a8c
|
3b355141b642dcac64bc80347b4f48f960b309e6
|
refs/heads/master
| 2021-01-11T05:36:05.496000 | 2016-10-26T05:28:21 | 2016-10-26T05:28:21 | 71,753,814 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ru.aryukov.model.Menu.iItalain;
/**
* Created by oaryukov on 14.10.2016.
*/
public enum Food {
SimplePizza
}
|
UTF-8
|
Java
| 124 |
java
|
Food.java
|
Java
|
[
{
"context": "ru.aryukov.model.Menu.iItalain;\n\n/**\n * Created by oaryukov on 14.10.2016.\n */\npublic enum Food {\n SimpleP",
"end": 67,
"score": 0.9994531869888306,
"start": 59,
"tag": "USERNAME",
"value": "oaryukov"
}
] | null |
[] |
package ru.aryukov.model.Menu.iItalain;
/**
* Created by oaryukov on 14.10.2016.
*/
public enum Food {
SimplePizza
}
| 124 | 0.685484 | 0.620968 | 8 | 14.5 | 14.899665 | 39 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | false | false |
12
|
fc8c9072a6c97bd66504a99183f41502286bd4ae
| 4,733,054,026,036 |
875b9772e6f9372d58942a1bd556c42a6de14643
|
/DiceRolling.java
|
82b1e17ab8d157eb59a1020e546146bf933e59c9
|
[] |
no_license
|
olegB999/problem_codeabbey
|
https://github.com/olegB999/problem_codeabbey
|
cc269810306b386ccc59c62c63da6c04c4518b35
|
8cb235d3ae8e8df18432c6f5aeed6d91f53734f8
|
refs/heads/main
| 2023-05-31T16:56:12.569000 | 2021-06-23T11:17:36 | 2021-06-23T11:17:36 | 379,564,766 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package probleme_codeabbey;
import java.util.Scanner;
public class DiceRolling {
// When programming board or role-playing games, many novice programmers experience troubles in converting random values to specific dice points. The goal of this task is to give a practice in simulation of dice rolling by the values coming from a random numbers generator.
//
// Suppose, we have generator which gives random values in range from 0 (inclusive) to 1 (not inclusive) - this could be encountered in languages like Basic, Java, Matlab etc.
//
// We want to convert these values with floating point to one of six integer numbers: from 1 to 6. This could be achieved by the following steps:
//
// Multiply random value by N which is the number of distinct values we want to get - in our case we multiply by 6 and so result would be floating point value in range from 0 (inclusive) to 6 (not inclusive)
// Now let us take the integer part of this result (calling function like floor or converting to int) - the value will become one of 0, 1, 2, 3, 4, 5 with equal probability.
// Since we need values from 1 to 6 let us simply add 1 to the result.
// Now you'll be given several numbers in the range [0 .. 1) (be sure, they are provided by random number generator) - and you are to convert them to dice points by applying the algorithm above.
//
// Input data will contain the amount of values to convert in the first line.
// Other lines will contain one value each, in form like 0.142857.
// Answer should contain numbers from 1 to 6 for each of input values, produced by the discussed algorithm.
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String results = "";
int cases = sc.nextInt();
for(int i=0; cases>i; i++) {
double nr = sc.nextDouble()*6;
int result = (int)Math.floor(nr)+1;
results+= result +" ";
}
System.out.println(results);
}
}
|
UTF-8
|
Java
| 1,943 |
java
|
DiceRolling.java
|
Java
|
[] | null |
[] |
package probleme_codeabbey;
import java.util.Scanner;
public class DiceRolling {
// When programming board or role-playing games, many novice programmers experience troubles in converting random values to specific dice points. The goal of this task is to give a practice in simulation of dice rolling by the values coming from a random numbers generator.
//
// Suppose, we have generator which gives random values in range from 0 (inclusive) to 1 (not inclusive) - this could be encountered in languages like Basic, Java, Matlab etc.
//
// We want to convert these values with floating point to one of six integer numbers: from 1 to 6. This could be achieved by the following steps:
//
// Multiply random value by N which is the number of distinct values we want to get - in our case we multiply by 6 and so result would be floating point value in range from 0 (inclusive) to 6 (not inclusive)
// Now let us take the integer part of this result (calling function like floor or converting to int) - the value will become one of 0, 1, 2, 3, 4, 5 with equal probability.
// Since we need values from 1 to 6 let us simply add 1 to the result.
// Now you'll be given several numbers in the range [0 .. 1) (be sure, they are provided by random number generator) - and you are to convert them to dice points by applying the algorithm above.
//
// Input data will contain the amount of values to convert in the first line.
// Other lines will contain one value each, in form like 0.142857.
// Answer should contain numbers from 1 to 6 for each of input values, produced by the discussed algorithm.
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String results = "";
int cases = sc.nextInt();
for(int i=0; cases>i; i++) {
double nr = sc.nextDouble()*6;
int result = (int)Math.floor(nr)+1;
results+= result +" ";
}
System.out.println(results);
}
}
| 1,943 | 0.72105 | 0.70561 | 33 | 56.878788 | 71.948112 | 274 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.121212 | false | false |
12
|
30a62c0989e519b5bcaaae41179b319a0a06d79a
| 39,067,022,553,512 |
763af026a2d00bf7cc42a3a4f772db71788e8a17
|
/src/com/company/arrays.java
|
2a806452552286d71cf0d2f133c87b2f67da7a22
|
[] |
no_license
|
sshilko/Learning-Java
|
https://github.com/sshilko/Learning-Java
|
4f4b8733993a6f27d6b1ff595f23e8fb00674740
|
607942b1cdfe5df2519afca2070a8ccc26c997a0
|
refs/heads/master
| 2022-01-07T12:08:08.258000 | 2019-05-31T19:03:44 | 2019-05-31T19:03:44 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.company;
public class arrays {
public static void main (String[]args){
int array1[] = new int[5];// 5 espacios vacios
int array2[] = {1,2,3,4,5,6}; //6 espacios pero con los valores
array1[1] = 100;
array1[2] = 500;
array1[3] = 10;
array1[4] = 200;
array1[0] = 1;
System.out.println("array1 en la posición 3: " + array1[3]);
System.out.println("array1 en la posición 2: " + array1[2]);
System.out.println("array1 en la posición 0: " + array1[0]);
array1[3] = 555;
System.out.println("array1 en la posición 3: " + array1[3]);
//----------------
System.out.println("---------------");
System.out.println("array2 en la posición 0: " + array2[0]);
System.out.println("array2 en la posición 3: " + array2[3]);
System.out.println("array2 en la posición 5: " + array2[5]);
array2[3] = 20;
System.out.println("Array2 en la posición 3: " + array2[3]);
//-----------------
System.out.println("---------------");
for(int i = 0; i< array1.length; i++) {
System.out.println("array1 en la posición " + i + ":" + array1[i]);
}
System.out.println("---------------");
for (int i = 0; i< array2.length; i++) {
System.out.println("array2 en la posición " + i + ":" + array2[i]);
}
}
}
|
UTF-8
|
Java
| 1,494 |
java
|
arrays.java
|
Java
|
[] | null |
[] |
package com.company;
public class arrays {
public static void main (String[]args){
int array1[] = new int[5];// 5 espacios vacios
int array2[] = {1,2,3,4,5,6}; //6 espacios pero con los valores
array1[1] = 100;
array1[2] = 500;
array1[3] = 10;
array1[4] = 200;
array1[0] = 1;
System.out.println("array1 en la posición 3: " + array1[3]);
System.out.println("array1 en la posición 2: " + array1[2]);
System.out.println("array1 en la posición 0: " + array1[0]);
array1[3] = 555;
System.out.println("array1 en la posición 3: " + array1[3]);
//----------------
System.out.println("---------------");
System.out.println("array2 en la posición 0: " + array2[0]);
System.out.println("array2 en la posición 3: " + array2[3]);
System.out.println("array2 en la posición 5: " + array2[5]);
array2[3] = 20;
System.out.println("Array2 en la posición 3: " + array2[3]);
//-----------------
System.out.println("---------------");
for(int i = 0; i< array1.length; i++) {
System.out.println("array1 en la posición " + i + ":" + array1[i]);
}
System.out.println("---------------");
for (int i = 0; i< array2.length; i++) {
System.out.println("array2 en la posición " + i + ":" + array2[i]);
}
}
}
| 1,494 | 0.481132 | 0.425876 | 50 | 28.66 | 26.678537 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.64 | false | false |
12
|
bdd636e8af87ee3db67efa606c2b7f6d9d9e8cc1
| 32,744,830,724,699 |
4e161d95f3291a22c7c4839b78c2525407faa91c
|
/exchange/src/main/java/cc/magickiat/crypto/exchange/binance/Binance.java
|
066b0725b6861bf9a52d20781ed4be1d96974b3f
|
[] |
no_license
|
magicalcyber/magic-crypto
|
https://github.com/magicalcyber/magic-crypto
|
e694db6a7feeb4feb356982e52ad9c90bf6f2d8f
|
b98f952893f50730b0f3989c7718410be137510a
|
refs/heads/master
| 2023-05-13T07:31:07.143000 | 2021-05-24T10:06:15 | 2021-05-24T10:06:15 | 370,306,599 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package cc.magickiat.crypto.exchange.binance;
import cc.magickiat.crypto.exchange.Exchange;
import cc.magickiat.crypto.exchange.binance.domain.event.BinanceCandlestickEvent;
import cc.magickiat.crypto.exchange.callback.BinanceWebSocketCandlestickCallback;
import cc.magickiat.crypto.websocket.BaseWebSocket;
import cc.magickiat.crypto.websocket.BaseWebSocketListener;
import lombok.extern.slf4j.Slf4j;
import okhttp3.WebSocket;
@Slf4j
public class Binance implements Exchange {
private BaseWebSocket baseWebSocket;
public Binance(BaseWebSocket baseWebSocket) {
this.baseWebSocket = baseWebSocket;
}
@Override
public WebSocket getWebSocketCandlestick() {
String url = "wss://stream.binance.com:9443/ws/btcbusd@kline_1m";
log.info("URL = " + url);
BinanceWebSocketCandlestickCallback callback = new BinanceWebSocketCandlestickCallback();
BaseWebSocketListener listener = new BaseWebSocketListener(callback, BinanceCandlestickEvent.class);
return baseWebSocket.createWebSocket(url, listener);
}
}
|
UTF-8
|
Java
| 1,071 |
java
|
Binance.java
|
Java
|
[] | null |
[] |
package cc.magickiat.crypto.exchange.binance;
import cc.magickiat.crypto.exchange.Exchange;
import cc.magickiat.crypto.exchange.binance.domain.event.BinanceCandlestickEvent;
import cc.magickiat.crypto.exchange.callback.BinanceWebSocketCandlestickCallback;
import cc.magickiat.crypto.websocket.BaseWebSocket;
import cc.magickiat.crypto.websocket.BaseWebSocketListener;
import lombok.extern.slf4j.Slf4j;
import okhttp3.WebSocket;
@Slf4j
public class Binance implements Exchange {
private BaseWebSocket baseWebSocket;
public Binance(BaseWebSocket baseWebSocket) {
this.baseWebSocket = baseWebSocket;
}
@Override
public WebSocket getWebSocketCandlestick() {
String url = "wss://stream.binance.com:9443/ws/btcbusd@kline_1m";
log.info("URL = " + url);
BinanceWebSocketCandlestickCallback callback = new BinanceWebSocketCandlestickCallback();
BaseWebSocketListener listener = new BaseWebSocketListener(callback, BinanceCandlestickEvent.class);
return baseWebSocket.createWebSocket(url, listener);
}
}
| 1,071 | 0.781513 | 0.773109 | 28 | 37.25 | 31.271421 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.607143 | false | false |
12
|
abbd42044c3dc1d2f473ea842a0eee8902a6e2fe
| 33,861,522,218,872 |
29135a2eb8d03619d0eaa9f97a3e449fbaff4165
|
/src/com/mateusborja/urionline/Iniciante/uri1050/uri1050.java
|
55e714fcb360d7753833d51bb0968eb2a42db7ab
|
[] |
no_license
|
mateusborja/urionline-java1
|
https://github.com/mateusborja/urionline-java1
|
1697cc7923a490c7a9c2482c18b72c5a59f7d0cc
|
81637de831bf8e6f5fad96834b910c49bffa32c7
|
refs/heads/master
| 2023-02-13T20:34:10.978000 | 2021-01-11T12:22:41 | 2021-01-11T12:22:41 | 305,580,571 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
*
* * Copyright (c) 2020. | All rights reserved
* * Mateus Borja // UX Designer • 3D Artist • Developer
* * www.mateusborja.life
*
*
*/
/*
DDD
Leia um número inteiro que representa um código de DDD para discagem interurbana.
Em seguida, informe à qual cidade o DDD pertence, considerando a tabela abaixo:
DDD
61 - Brasilia
71 - Salvador
11 - São Paulo
21 - Rio de Janeiro
32 - Juiz de Fora
19 - Campinas
27 - Vitoria
31 - Belo Horizonte
Se a entrada for qualquer outro DDD que não esteja presente na tabela acima, o programa
deverá informar:
DDD nao cadastrado
Entrada
A entrada consiste de um único valor inteiro.
Saída
Imprima o nome da cidade correspondente ao DDD existente na entrada. Imprima DDD
nao cadastrado caso não existir DDD correspondente ao número digitado.
*/
package com.mateusborja.urionline.Iniciante.uri1050;
import java.util.Scanner;
public class uri1050 {
public static void main(String[] args) {
int ddd = new Scanner(System.in).nextInt();
switch (ddd) {
case 61 -> System.out.println("Brasilia");
case 71 -> System.out.println("Salvador");
case 11 -> System.out.println("Sao Paulo");
case 21 -> System.out.println("Rio de Janeiro");
case 32 -> System.out.println("Juiz de Fora");
case 19 -> System.out.println("Campinas");
case 27 -> System.out.println("Vitoria");
case 31 -> System.out.println("Belo Horizonte");
default -> System.out.println("DDD nao cadastrado");
}
}
}
|
UTF-8
|
Java
| 1,581 |
java
|
uri1050.java
|
Java
|
[
{
"context": "* Copyright (c) 2020. | All rights reserved\n * * Mateus Borja // UX Designer • 3D Artist • Developer\n * * www.",
"end": 73,
"score": 0.9998953938484192,
"start": 61,
"tag": "NAME",
"value": "Mateus Borja"
}
] | null |
[] |
/*
*
* * Copyright (c) 2020. | All rights reserved
* * <NAME> // UX Designer • 3D Artist • Developer
* * www.mateusborja.life
*
*
*/
/*
DDD
Leia um número inteiro que representa um código de DDD para discagem interurbana.
Em seguida, informe à qual cidade o DDD pertence, considerando a tabela abaixo:
DDD
61 - Brasilia
71 - Salvador
11 - São Paulo
21 - Rio de Janeiro
32 - Juiz de Fora
19 - Campinas
27 - Vitoria
31 - Belo Horizonte
Se a entrada for qualquer outro DDD que não esteja presente na tabela acima, o programa
deverá informar:
DDD nao cadastrado
Entrada
A entrada consiste de um único valor inteiro.
Saída
Imprima o nome da cidade correspondente ao DDD existente na entrada. Imprima DDD
nao cadastrado caso não existir DDD correspondente ao número digitado.
*/
package com.mateusborja.urionline.Iniciante.uri1050;
import java.util.Scanner;
public class uri1050 {
public static void main(String[] args) {
int ddd = new Scanner(System.in).nextInt();
switch (ddd) {
case 61 -> System.out.println("Brasilia");
case 71 -> System.out.println("Salvador");
case 11 -> System.out.println("Sao Paulo");
case 21 -> System.out.println("Rio de Janeiro");
case 32 -> System.out.println("Juiz de Fora");
case 19 -> System.out.println("Campinas");
case 27 -> System.out.println("Vitoria");
case 31 -> System.out.println("Belo Horizonte");
default -> System.out.println("DDD nao cadastrado");
}
}
}
| 1,575 | 0.661136 | 0.632419 | 63 | 23.873016 | 26.65803 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.253968 | false | false |
12
|
75a072a0c754932157b96488f641c0d8b36ec1a2
| 33,861,522,217,837 |
14ed51275f1cdc5c6fc072415663d0842157b0ef
|
/spikes/web/spikeTomcatJSPServletUINav/src/com/nick/spike/servlet/WebUIStep.java
|
0b62d6902dc85369b9cea7b8a756cf89711da2be
|
[] |
no_license
|
jiangcongtao/hands-on
|
https://github.com/jiangcongtao/hands-on
|
1f02c32aae2f5b11f4d5d4b16c9ad701e67d8500
|
ff4f8d0ea32aec5f356cb027a91c5efd7a3290cd
|
refs/heads/master
| 2018-01-09T19:52:56.666000 | 2016-03-27T04:36:52 | 2016-03-27T04:36:52 | 54,354,644 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.nick.spike.servlet;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class WebUIStep {
public static WebUIStep createStep(int no, String title, String id) {
WebUIStep step = new WebUIStep();
step.setId(id);
step.setNo(no);
step.setTitle(title);
return step;
}
/**
* @return the no
*/
public int getNo() {
return no;
}
/**
* @param no
* the no to set
*/
public void setNo(int no) {
this.no = no;
}
/**
* @return the title
*/
public String getTitle() {
return title;
}
/**
* @param title
* the title to set
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id
* the id to set
*/
public void setId(String id) {
this.id = id;
}
private WebUIStep peviousStep;
/**
* @return the peviousStep
*/
public WebUIStep getPeviousStep() {
return peviousStep;
}
/**
* @param peviousStep the peviousStep to set
*/
public void setPeviousStep(WebUIStep peviousStep) {
this.peviousStep = peviousStep;
}
/**
* @return the nextStep
*/
public WebUIStep getNextStep() {
return nextStep;
}
/**
* @param nextStep the nextStep to set
*/
public void setNextStep(WebUIStep nextStep) {
this.nextStep = nextStep;
}
/**
* @return the view
*/
public String getView() {
return view==null?"":view;
}
/**
* @param view the view to set
*/
public void setView(String view) {
this.view = view;
}
public WebUIStep addStepAction(WebUIStepAction action){
for (WebUIStepAction a : stepActions) {
if (a.getActionName().equals(action.getActionName())){
return this;
}
}
stepActions.add(action);
return this;
}
public WebUIStepAction[] getStepActions(){
return stepActions.toArray(new WebUIStepAction[stepActions.size()]);
}
public WebUIStep execute(String action, HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException{
return null;
}
/**
* @return the wizardOrder
*/
public WebUIWizard getWizardOrder() {
return wizardOrder;
}
/**
* @param wizardOrder the wizardOrder to set
*/
public void setWizardOrder(WebUIWizard wizardOrder) {
this.wizardOrder = wizardOrder;
}
private WebUIWizard wizardOrder;
private WebUIStep nextStep;
private ArrayList<WebUIStepAction> stepActions= new ArrayList<WebUIStepAction>();
private String title;
private String id;
private int no;
private String view;
}
|
UTF-8
|
Java
| 2,678 |
java
|
WebUIStep.java
|
Java
|
[] | null |
[] |
package com.nick.spike.servlet;
import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class WebUIStep {
public static WebUIStep createStep(int no, String title, String id) {
WebUIStep step = new WebUIStep();
step.setId(id);
step.setNo(no);
step.setTitle(title);
return step;
}
/**
* @return the no
*/
public int getNo() {
return no;
}
/**
* @param no
* the no to set
*/
public void setNo(int no) {
this.no = no;
}
/**
* @return the title
*/
public String getTitle() {
return title;
}
/**
* @param title
* the title to set
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id
* the id to set
*/
public void setId(String id) {
this.id = id;
}
private WebUIStep peviousStep;
/**
* @return the peviousStep
*/
public WebUIStep getPeviousStep() {
return peviousStep;
}
/**
* @param peviousStep the peviousStep to set
*/
public void setPeviousStep(WebUIStep peviousStep) {
this.peviousStep = peviousStep;
}
/**
* @return the nextStep
*/
public WebUIStep getNextStep() {
return nextStep;
}
/**
* @param nextStep the nextStep to set
*/
public void setNextStep(WebUIStep nextStep) {
this.nextStep = nextStep;
}
/**
* @return the view
*/
public String getView() {
return view==null?"":view;
}
/**
* @param view the view to set
*/
public void setView(String view) {
this.view = view;
}
public WebUIStep addStepAction(WebUIStepAction action){
for (WebUIStepAction a : stepActions) {
if (a.getActionName().equals(action.getActionName())){
return this;
}
}
stepActions.add(action);
return this;
}
public WebUIStepAction[] getStepActions(){
return stepActions.toArray(new WebUIStepAction[stepActions.size()]);
}
public WebUIStep execute(String action, HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException{
return null;
}
/**
* @return the wizardOrder
*/
public WebUIWizard getWizardOrder() {
return wizardOrder;
}
/**
* @param wizardOrder the wizardOrder to set
*/
public void setWizardOrder(WebUIWizard wizardOrder) {
this.wizardOrder = wizardOrder;
}
private WebUIWizard wizardOrder;
private WebUIStep nextStep;
private ArrayList<WebUIStepAction> stepActions= new ArrayList<WebUIStepAction>();
private String title;
private String id;
private int no;
private String view;
}
| 2,678 | 0.672517 | 0.672517 | 150 | 16.853333 | 19.664312 | 135 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.34 | false | false |
12
|
46ced9bb623e6d7ef0f26f256140b32efd0aadd8
| 35,098,472,786,046 |
84cf6f0ac33d2338a1401e5d25962c6913ef7d77
|
/hallserver/src/main/java/com/guandan/hallserver/listen/RedisListenTask.java
|
e6f38b2098f10859ae52d721163d81f616b0df50
|
[] |
no_license
|
iwbnet/guandan-server
|
https://github.com/iwbnet/guandan-server
|
80ec0c9a3f82190606dca65bcb97355fe1799398
|
9bb50c57f07f29d6a31a487a12bcb72bfa8e3f50
|
refs/heads/main
| 2023-03-08T04:17:37.694000 | 2021-02-27T09:19:24 | 2021-02-27T09:19:24 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.guandan.hallserver.listen;
import com.guandan.core.TransferData;
import com.guandan.hallserver.GameServer;
import com.guandan.hallserver.config.HallConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
/**
* @Author: qixiangyang.121
* @Description:
* @Date: 18:34 2020/1/1
*/
@Component
@Slf4j
public class RedisListenTask {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private HallConfig hallConfig;
@Async
public void doMessageTask(Message message, byte[] bytes) {
//1.获取消息
TransferData transferData = (TransferData) this.redisTemplate.getDefaultSerializer().deserialize(message.getBody());
if (transferData.getData() != null) {
log.info(new String(transferData.getData()));
GameServer.send(Integer.valueOf(hallConfig.getReverseRoutes().get(transferData.getChannel())),
Integer.valueOf(transferData.getProtocol()),
transferData.getGameWebSocketSession().getSessionId(),
transferData.getData());
}
}
}
|
UTF-8
|
Java
| 1,368 |
java
|
RedisListenTask.java
|
Java
|
[
{
"context": "framework.stereotype.Component;\n\n\n\n/**\n * @Author: qixiangyang.121\n * @Description:\n * @Date: 18:34 2020/1/1\n */\n@Co",
"end": 521,
"score": 0.9977587461471558,
"start": 506,
"tag": "USERNAME",
"value": "qixiangyang.121"
}
] | null |
[] |
package com.guandan.hallserver.listen;
import com.guandan.core.TransferData;
import com.guandan.hallserver.GameServer;
import com.guandan.hallserver.config.HallConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
/**
* @Author: qixiangyang.121
* @Description:
* @Date: 18:34 2020/1/1
*/
@Component
@Slf4j
public class RedisListenTask {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private HallConfig hallConfig;
@Async
public void doMessageTask(Message message, byte[] bytes) {
//1.获取消息
TransferData transferData = (TransferData) this.redisTemplate.getDefaultSerializer().deserialize(message.getBody());
if (transferData.getData() != null) {
log.info(new String(transferData.getData()));
GameServer.send(Integer.valueOf(hallConfig.getReverseRoutes().get(transferData.getChannel())),
Integer.valueOf(transferData.getProtocol()),
transferData.getGameWebSocketSession().getSessionId(),
transferData.getData());
}
}
}
| 1,368 | 0.718382 | 0.705882 | 44 | 29.863636 | 29.302956 | 124 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.431818 | false | false |
12
|
82faf98920aef2f00690488846420f09a5aca1f7
| 34,514,357,238,861 |
3a545bae95cef0a97481dcf6418eaaeac131ee5c
|
/Android/Code/Projects/imooc_music_app/imooc_voice/src/main/java/com/imooc/imooc_voice/model/discory/RecommandFooterValue.java
|
624bc4062982273066edf51e642fa7913010e497
|
[
"Apache-2.0"
] |
permissive
|
Ztiany/programming-data
|
https://github.com/Ztiany/programming-data
|
4dea67a7d4e4b4dc9d2fa37d0e89e607a9d3de4d
|
3602d7ea4a447aa348cb49c5c1fda03482b36b89
|
refs/heads/master
| 2020-03-28T03:51:37.615000 | 2020-03-27T11:30:50 | 2020-03-27T11:30:50 | 147,676,462 | 7 | 6 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.imooc.imooc_voice.model.discory;
import com.imooc.imooc_voice.model.BaseModel;
public class RecommandFooterValue extends BaseModel {
public String info;
public String imageUrl;
}
|
UTF-8
|
Java
| 198 |
java
|
RecommandFooterValue.java
|
Java
|
[] | null |
[] |
package com.imooc.imooc_voice.model.discory;
import com.imooc.imooc_voice.model.BaseModel;
public class RecommandFooterValue extends BaseModel {
public String info;
public String imageUrl;
}
| 198 | 0.79798 | 0.79798 | 9 | 21 | 20.731083 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false |
12
|
6fb8325890942427280e6c76e0616b858075388a
| 8,641,474,268,641 |
1c2a811dca254b98c18e080f67d934d82e9e2959
|
/mtp-backend/src/main/java/ru/salenko/mtp/repository/BankRepository.java
|
7d0e30f40b2106d99f791d4e3bd94bd6170f4cb0
|
[] |
no_license
|
salenko-svetlana/money-transfer-points
|
https://github.com/salenko-svetlana/money-transfer-points
|
218d0e005da586d11b589d45df725b4d80e6cd6b
|
7bec05bd273cec77f9f868ef33c52d98c943b634
|
refs/heads/master
| 2020-04-02T14:11:53.359000 | 2018-11-18T18:22:33 | 2018-11-18T18:22:33 | 154,430,500 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ru.salenko.mtp.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import ru.salenko.mtp.entity.Bank;
import java.util.Optional;
/**
* Репозиторий для работы с сущностью Банк
*/
public interface BankRepository extends JpaRepository<Bank, Long> {
/**
* Поиск банка по коду
* @param code код для поиска
* @return банк, если найден, иначе пусто
*/
Optional<Bank> findBankByCode(final String code);
}
|
UTF-8
|
Java
| 546 |
java
|
BankRepository.java
|
Java
|
[] | null |
[] |
package ru.salenko.mtp.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import ru.salenko.mtp.entity.Bank;
import java.util.Optional;
/**
* Репозиторий для работы с сущностью Банк
*/
public interface BankRepository extends JpaRepository<Bank, Long> {
/**
* Поиск банка по коду
* @param code код для поиска
* @return банк, если найден, иначе пусто
*/
Optional<Bank> findBankByCode(final String code);
}
| 546 | 0.721739 | 0.721739 | 18 | 24.555555 | 22.14152 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false |
12
|
400d7e71f799fd8a8fdb34bc8dcab14c1e24e94e
| 34,746,285,477,107 |
a4f69f4c6ff9e6e80c836b1c1bd00a09311e0a92
|
/BoxAssistant/src/com/iii360/box/ximalaya/XimalayaAudio.java
|
3aa2940d97966b21ecc2dfc7cc5c651d42ab1244
|
[] |
no_license
|
longxing/SmallZhiDemo
|
https://github.com/longxing/SmallZhiDemo
|
857422d93b7f6e9db585e2d5cc47926367d3661a
|
024053b4c6e0a249eed0609c0fc4ce1c942cff62
|
refs/heads/master
| 2021-01-23T12:10:59.395000 | 2015-06-15T01:50:55 | 2015-06-15T01:50:55 | 37,367,744 | 1 | 8 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.iii360.box.ximalaya;
public class XimalayaAudio {
private int id;
private String title;
private String nickName;
private String AudioUrl32;
private String AudioUrl64;
private int page;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getAudioUrl32() {
return AudioUrl32;
}
public void setAudioUrl32(String audioUrl32) {
AudioUrl32 = audioUrl32;
}
public String getAudioUrl64() {
return AudioUrl64;
}
public void setAudioUrl64(String audioUrl64) {
AudioUrl64 = audioUrl64;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + id;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
XimalayaAudio other = (XimalayaAudio) obj;
if (id != other.id)
return false;
return true;
}
}
|
UTF-8
|
Java
| 1,317 |
java
|
XimalayaAudio.java
|
Java
|
[] | null |
[] |
package com.iii360.box.ximalaya;
public class XimalayaAudio {
private int id;
private String title;
private String nickName;
private String AudioUrl32;
private String AudioUrl64;
private int page;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getAudioUrl32() {
return AudioUrl32;
}
public void setAudioUrl32(String audioUrl32) {
AudioUrl32 = audioUrl32;
}
public String getAudioUrl64() {
return AudioUrl64;
}
public void setAudioUrl64(String audioUrl64) {
AudioUrl64 = audioUrl64;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + id;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
XimalayaAudio other = (XimalayaAudio) obj;
if (id != other.id)
return false;
return true;
}
}
| 1,317 | 0.678815 | 0.652999 | 81 | 15.259259 | 13.418963 | 47 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.493827 | false | false |
12
|
88a04cff0fbbfd10d08794e9dd68c5ab80d9a8fd
| 38,826,504,376,401 |
7fd79d60f782dec4fc586f49ea46d008b5f5f4fb
|
/src/main/java/net/oneandone/sushi/metadata/reflect/ReflectSchema.java
|
407089a63e76d7327266978800df518229520d7f
|
[
"Apache-2.0"
] |
permissive
|
mlhartme/metadata
|
https://github.com/mlhartme/metadata
|
b771c205bd6a77677cfefeae3d1f0cc4f7e52cca
|
2b935fbdb6af8c07073af9907cd2418457d682a9
|
refs/heads/master
| 2021-01-10T06:44:11.082000 | 2017-08-23T11:50:18 | 2017-08-23T11:50:18 | 52,075,399 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Copyright 1&1 Internet AG, https://github.com/1and1/
*
* 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 net.oneandone.sushi.metadata.reflect;
import net.oneandone.sushi.fs.World;
import net.oneandone.sushi.metadata.ComplexType;
import net.oneandone.sushi.metadata.Item;
import net.oneandone.sushi.metadata.Schema;
import net.oneandone.sushi.metadata.simpletypes.FileNodeType;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Collection;
public class ReflectSchema extends Schema {
public ReflectSchema() {
}
public ReflectSchema(World world) {
this();
add(new FileNodeType(this, world));
}
@Override
public void complex(ComplexType type) {
Class<?> fieldType;
Item<?> item;
for (Field field : type.getType().getDeclaredFields()) {
fieldType = field.getType();
field.setAccessible(true);
if (Modifier.isStatic(field.getModifiers())) {
item = null;
} else if (field.isSynthetic()) {
item = null; // e.g. this$0
} else if (fieldType.isArray()) {
item = new ArrayItem<Object>(field, type(fieldType.getComponentType()));
} else if (Collection.class.isAssignableFrom(fieldType)) {
item = new CollectionItem(field, type(Object.class));
} else {
item = new ValueItem<Object>(field, type(fieldType));
}
if (item != null) {
type.items().add(item);
}
}
}
}
|
UTF-8
|
Java
| 2,113 |
java
|
ReflectSchema.java
|
Java
|
[
{
"context": "\n * Copyright 1&1 Internet AG, https://github.com/1and1/\n *\n * Licensed under the Apache License, Version",
"end": 57,
"score": 0.999157190322876,
"start": 52,
"tag": "USERNAME",
"value": "1and1"
}
] | null |
[] |
/*
* Copyright 1&1 Internet AG, https://github.com/1and1/
*
* 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 net.oneandone.sushi.metadata.reflect;
import net.oneandone.sushi.fs.World;
import net.oneandone.sushi.metadata.ComplexType;
import net.oneandone.sushi.metadata.Item;
import net.oneandone.sushi.metadata.Schema;
import net.oneandone.sushi.metadata.simpletypes.FileNodeType;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Collection;
public class ReflectSchema extends Schema {
public ReflectSchema() {
}
public ReflectSchema(World world) {
this();
add(new FileNodeType(this, world));
}
@Override
public void complex(ComplexType type) {
Class<?> fieldType;
Item<?> item;
for (Field field : type.getType().getDeclaredFields()) {
fieldType = field.getType();
field.setAccessible(true);
if (Modifier.isStatic(field.getModifiers())) {
item = null;
} else if (field.isSynthetic()) {
item = null; // e.g. this$0
} else if (fieldType.isArray()) {
item = new ArrayItem<Object>(field, type(fieldType.getComponentType()));
} else if (Collection.class.isAssignableFrom(fieldType)) {
item = new CollectionItem(field, type(Object.class));
} else {
item = new ValueItem<Object>(field, type(fieldType));
}
if (item != null) {
type.items().add(item);
}
}
}
}
| 2,113 | 0.638429 | 0.634169 | 61 | 33.639343 | 24.3755 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.508197 | false | false |
12
|
1020f17ef85287cf80a895687e94ab40129ebc88
| 20,495,583,979,137 |
f3313178d3c10bcde4bb483ffce864043252afa3
|
/server/src/main/java/app/entities/OtherImagingEndoscopyDO.java
|
1528efddc73f8af75c430ac1dc9a8a60f4119823
|
[] |
no_license
|
javaC2RenXiangjie/CRF
|
https://github.com/javaC2RenXiangjie/CRF
|
a1df981e54f78d527484f4d987da5798bba56f28
|
e378de430348f826c36aadc00ee09f31cc16c33d
|
refs/heads/master
| 2020-03-20T12:07:50.347000 | 2018-04-07T15:36:18 | 2018-04-07T15:36:18 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package app.entities;
import javax.persistence.*;
import java.util.Date;
/**
* Created by Administrator on 2017/10/17 0017.
*/
@Entity(name = "medicine_liver_other_imaging_endoscopy")
public class OtherImagingEndoscopyDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@ManyToOne(fetch = FetchType.LAZY,cascade = {CascadeType.PERSIST,CascadeType.DETACH,CascadeType.REFRESH,CascadeType.MERGE})
@JoinColumn(name = "imaging_endoscopy_id")
private MedicineLiverImagingEndoscopyDO medicineLiverImagingEndoscopyDO;
private String item;
private Date itemDate;
private String result;
private int biliaryTract;
private int esophagealGastricVarices;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public MedicineLiverImagingEndoscopyDO getMedicineLiverImagingEndoscopyDO() {
return medicineLiverImagingEndoscopyDO;
}
public void setMedicineLiverImagingEndoscopyDO(MedicineLiverImagingEndoscopyDO medicineLiverImagingEndoscopyDO) {
this.medicineLiverImagingEndoscopyDO = medicineLiverImagingEndoscopyDO;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public Date getItemDate() {
return itemDate;
}
public void setItemDate(Date itemDate) {
this.itemDate = itemDate;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public int getBiliaryTract() {
return biliaryTract;
}
public void setBiliaryTract(int biliaryTract) {
this.biliaryTract = biliaryTract;
}
public int getEsophagealGastricVarices() {
return esophagealGastricVarices;
}
public void setEsophagealGastricVarices(int esophagealGastricVarices) {
this.esophagealGastricVarices = esophagealGastricVarices;
}
}
|
UTF-8
|
Java
| 2,010 |
java
|
OtherImagingEndoscopyDO.java
|
Java
|
[] | null |
[] |
package app.entities;
import javax.persistence.*;
import java.util.Date;
/**
* Created by Administrator on 2017/10/17 0017.
*/
@Entity(name = "medicine_liver_other_imaging_endoscopy")
public class OtherImagingEndoscopyDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@ManyToOne(fetch = FetchType.LAZY,cascade = {CascadeType.PERSIST,CascadeType.DETACH,CascadeType.REFRESH,CascadeType.MERGE})
@JoinColumn(name = "imaging_endoscopy_id")
private MedicineLiverImagingEndoscopyDO medicineLiverImagingEndoscopyDO;
private String item;
private Date itemDate;
private String result;
private int biliaryTract;
private int esophagealGastricVarices;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public MedicineLiverImagingEndoscopyDO getMedicineLiverImagingEndoscopyDO() {
return medicineLiverImagingEndoscopyDO;
}
public void setMedicineLiverImagingEndoscopyDO(MedicineLiverImagingEndoscopyDO medicineLiverImagingEndoscopyDO) {
this.medicineLiverImagingEndoscopyDO = medicineLiverImagingEndoscopyDO;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public Date getItemDate() {
return itemDate;
}
public void setItemDate(Date itemDate) {
this.itemDate = itemDate;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public int getBiliaryTract() {
return biliaryTract;
}
public void setBiliaryTract(int biliaryTract) {
this.biliaryTract = biliaryTract;
}
public int getEsophagealGastricVarices() {
return esophagealGastricVarices;
}
public void setEsophagealGastricVarices(int esophagealGastricVarices) {
this.esophagealGastricVarices = esophagealGastricVarices;
}
}
| 2,010 | 0.69801 | 0.69204 | 79 | 24.43038 | 26.690767 | 127 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.35443 | false | false |
12
|
85a5407eade211722dc2d61d45772c4b8c54be98
| 20,495,583,981,304 |
31fc4909a0dcbbe85fc8c066ffbcf3c11aa6028f
|
/MiCar/modules/Entities/test/src/micar/entities/test/entities/Item.java
|
96b14529c6c3535e36b5546cc3bd04d12ac21f02
|
[] |
no_license
|
bit-man/bit-tools
|
https://github.com/bit-man/bit-tools
|
95eb8f1d41961be549e88235af56e538fa6bc2f8
|
32f6f09f28272973e6e4e0fecb14cb26fd5d4ccd
|
refs/heads/master
| 2018-01-04T08:07:53.563000 | 2017-12-01T15:35:17 | 2017-12-01T15:35:17 | 38,217,584 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/**
*
*/
package micar.entities.test.entities;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* @author bit-man
*
*/
@Entity
@Table(name = "ITEM")
public class Item implements Serializable
{
@Id
@Column(name = "ID")
private int id;
@Column(name = "DESCRIPTION")
private String descripton;
public Item()
{
};
/**
* @param descripton
* the descripton to set
*/
public void setDescripton(String descripton)
{
this.descripton = descripton;
}
/**
* @return the descripton
*/
public String getDescripton()
{
return descripton;
}
/**
* @param id
* the id to set
*/
public void setId(int id)
{
this.id = id;
}
/**
* @return the id
*/
public int getId()
{
return id;
}
}
|
UTF-8
|
Java
| 994 |
java
|
Item.java
|
Java
|
[
{
"context": "d;\nimport javax.persistence.Table;\n\n/**\n * @author bit-man\n * \n */\n@Entity\n@Table(name = \"ITEM\")\npublic clas",
"end": 231,
"score": 0.9994800090789795,
"start": 224,
"tag": "USERNAME",
"value": "bit-man"
}
] | null |
[] |
/**
*
*/
package micar.entities.test.entities;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* @author bit-man
*
*/
@Entity
@Table(name = "ITEM")
public class Item implements Serializable
{
@Id
@Column(name = "ID")
private int id;
@Column(name = "DESCRIPTION")
private String descripton;
public Item()
{
};
/**
* @param descripton
* the descripton to set
*/
public void setDescripton(String descripton)
{
this.descripton = descripton;
}
/**
* @return the descripton
*/
public String getDescripton()
{
return descripton;
}
/**
* @param id
* the id to set
*/
public void setId(int id)
{
this.id = id;
}
/**
* @return the id
*/
public int getId()
{
return id;
}
}
| 994 | 0.54829 | 0.54829 | 65 | 14.292308 | 13.233667 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false |
12
|
510a7a9c177896f5ac71cd966137798d9ff93771
| 19,619,410,647,781 |
36e3233caccc1c08ff1946bcec50fae43fab8ac3
|
/algorithm-Environment/src/storeHouse/RequestStoreHouse.java
|
6af360b593ae5c1c9e6cab18487d96d29df9f784
|
[] |
no_license
|
FuzzyLP/MachineLearningPrototype
|
https://github.com/FuzzyLP/MachineLearningPrototype
|
070417a3f4c0c28edbf09c0664f9e425b6d4ecab
|
85d1cad6f3a2a696ceb4cbc3fc583668fa118416
|
refs/heads/master
| 2021-07-04T17:13:21.823000 | 2019-11-19T19:56:29 | 2019-11-19T19:56:29 | 186,667,916 | 0 | 0 | null | false | 2020-10-13T17:34:59 | 2019-05-14T17:19:07 | 2019-11-19T19:58:43 | 2020-10-13T17:34:58 | 6,958 | 0 | 0 | 1 |
Java
| false | false |
package storeHouse;
import java.util.Random;
import auxiliar.LocalUserInfo;
import filesAndPaths.ProgramFileInfo;
public class RequestStoreHouse {
private static int numberOfFunctions=10;
private static String requestParameter;
public RequestStoreHouse getSession() {
// TODO Auto-generated method stub
return new RequestStoreHouse();
}
public LocalUserInfo getLocalUserInfo() {
// TODO Auto-generated method stub
return new LocalUserInfo();
}
public ProgramFileInfo getProgramFileInfo() {
// TODO Auto-generated method stub
return new ProgramFileInfo();
}
public String getRequestParameter(String preddefined) {
// TODO Auto-generated method stub
if(requestParameter!=null)return requestParameter;
Random ran=new Random();
int i = (int)(ran.nextDouble()*numberOfFunctions);
requestParameter= "concept"+i;
requestParameter= "";
return requestParameter;
}
public void setnumberOfFunctions(int number) {
numberOfFunctions=number;
}
public Object getRequestParameter2(String preddefined) {
Random ran=new Random();
int i = (int)(ran.nextDouble()*numberOfFunctions);
requestParameter= "concept"+i;
return requestParameter;
}
}
|
UTF-8
|
Java
| 1,179 |
java
|
RequestStoreHouse.java
|
Java
|
[] | null |
[] |
package storeHouse;
import java.util.Random;
import auxiliar.LocalUserInfo;
import filesAndPaths.ProgramFileInfo;
public class RequestStoreHouse {
private static int numberOfFunctions=10;
private static String requestParameter;
public RequestStoreHouse getSession() {
// TODO Auto-generated method stub
return new RequestStoreHouse();
}
public LocalUserInfo getLocalUserInfo() {
// TODO Auto-generated method stub
return new LocalUserInfo();
}
public ProgramFileInfo getProgramFileInfo() {
// TODO Auto-generated method stub
return new ProgramFileInfo();
}
public String getRequestParameter(String preddefined) {
// TODO Auto-generated method stub
if(requestParameter!=null)return requestParameter;
Random ran=new Random();
int i = (int)(ran.nextDouble()*numberOfFunctions);
requestParameter= "concept"+i;
requestParameter= "";
return requestParameter;
}
public void setnumberOfFunctions(int number) {
numberOfFunctions=number;
}
public Object getRequestParameter2(String preddefined) {
Random ran=new Random();
int i = (int)(ran.nextDouble()*numberOfFunctions);
requestParameter= "concept"+i;
return requestParameter;
}
}
| 1,179 | 0.766751 | 0.764207 | 44 | 25.795454 | 18.171631 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.590909 | false | false |
12
|
cc81eb1d6ed64fce1ed303d8af2ce07a0c77211a
| 20,323,785,286,211 |
3b1b1ebb13ef2501ae35ab7bd51c87c381cbb559
|
/library/src/main/java/com/sksamuel/jqm4gwt/form/elements/JQMSelectFilterable.java
|
b9680bc2265ca9a22cadc188f13d3a3b1d376144
|
[
"Apache-2.0"
] |
permissive
|
bright-spark/jqm4gwt
|
https://github.com/bright-spark/jqm4gwt
|
5fb94425a0052b260a679754b42cb236bb2fe1b6
|
970651a851e1d10bea44fcf3f5cb917108ac9b04
|
refs/heads/master
| 2021-01-18T16:11:43.788000 | 2016-08-17T02:31:48 | 2016-08-17T02:31:48 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.sksamuel.jqm4gwt.form.elements;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.dom.client.Element;
import com.sksamuel.jqm4gwt.Empty;
import com.sksamuel.jqm4gwt.JQMCommon;
/**
* See <a href="http://demos.jquerymobile.com/1.4.5/selectmenu-custom-filter/">Filterable inside custom select</a>
* <br> See also <a href="https://github.com/jquery/jquery-mobile/blob/9cb1040f1da9309c30b70eccbbfb54a8ddf253aa/demos/selectmenu-custom-filter/index.php">Github Demos</a>
*
* @author SlavaP
*/
public class JQMSelectFilterable extends JQMSelect {
public static String CLEAR_BUTTON_TEXT = "-----";
private static final String SELECT_FILTERABLE_STYLENAME = "jqm4gwt-select-filterable";
private static final String FILTERABLE_SELECT = "filterable-select";
private static boolean jsServed;
private Element filterable;
private boolean showClearButton;
public JQMSelectFilterable() {
super();
addStyleName(SELECT_FILTERABLE_STYLENAME);
select.addStyleName(FILTERABLE_SELECT);
setNative(false);
}
@Override
public String getMenuStyleNames() {
String s = super.getMenuStyleNames();
// for CSS styling
String rslt = "ui-select-filterable";
if (!Empty.is(s)) rslt += " " + s;
return rslt;
}
/**
* There is a predefined ui-select-filterable CSS class, which is always added to menu dialog/popup.
* <br> You can style listview by defining rule .ui-selectmenu.ui-select-filterable .ui-selectmenu-list { ... }
* <br> For additional flexibility you can specify custom classes to be added together with ui-select-filterable
* @param menuStyleNames - space separated custom classes
*/
@Override
public void setMenuStyleNames(String menuStyleNames) {
super.setMenuStyleNames(menuStyleNames);
}
/* @Override
public Boolean doFiltering(Element elt, Integer index, String searchValue) {
// TODO: remove when this bug is fixed: https://github.com/jquery/jquery-mobile/issues/7677
String s = JQMCommon.getFilterText(elt);
if (s == null || s.isEmpty()) {
s = JQMCommon.getAttribute(elt, "data-option-index");
if (s != null && !s.isEmpty()) {
try {
int i = Integer.parseInt(s);
OptionElement opt = getOption(i);
if (opt != null) {
s = JQMCommon.getFilterText(opt);
if (s != null && !s.isEmpty()) {
JQMCommon.setFilterText(elt, s);
}
}
} catch (NumberFormatException ex) {
// nothing, can continue safely
}
}
}
return super.doFiltering(elt, index, searchValue);
} */
private void setFilterableElt(Element filterableElt) {
filterable = filterableElt;
if (filterable != null && JQMCommon.isFilterableReady(filterable)) {
JavaScriptObject origFilter = JQMCommon.getFilterCallback(filterable);
JQMCommon.bindFilterCallback(this, filterable, origFilter);
}
}
@Override
protected void onLoad() {
super.onLoad();
if (!jsServed) {
jsServed = true;
serveSelectsFilterable();
}
}
@Override
protected void onUnload() {
super.onUnload();
}
private static native boolean isPageSelectFilterableDialog(String pageId) /*-{
var isDialog = false;
var SEL = "." + @com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::FILTERABLE_SELECT;
$wnd.$(SEL).each(function() {
var id = $wnd.$(this).attr("id");
if (id) {
var s = id + "-dialog";
if (s === pageId) {
isDialog = true;
return false;
}
}
});
return isDialog;
}-*/;
private static native void serveSelectsFilterable() /*-{
if ($wnd.$ === undefined || $wnd.$ === null) return; // jQuery is not loaded
var SEL = "." + @com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::FILTERABLE_SELECT;
$wnd.$.mobile.document
// Upon creation of the select menu, we want to make use of the fact that the ID of the
// listview it generates starts with the ID of the select menu itself, plus the suffix "-menu".
// We retrieve the listview and insert a search input before it.
.on( "selectmenucreate", SEL, function( event ) {
var input,
selectmenu = $wnd.$( event.target ),
id = selectmenu.attr( "id" ),
listview = $wnd.$( "#" + id + "-menu" ),
form = listview.jqmData( "filter-form" );
var combo = @com.sksamuel.jqm4gwt.form.elements.JQMSelect::findCombo(Lcom/google/gwt/dom/client/Element;)
(event.target);
// We store the generated form in a variable attached to the popup so we avoid creating a
// second form/input field when the listview is destroyed/rebuilt during a refresh.
if ( !form ) {
input = $wnd.$( "<input data-type='search'></input>" );
form = $wnd.$( "<form style='padding-top: 1px;'></form>" ).append( input );
form.submit( function () { return false; } ); // fix for ENTER key press
input.textinput();
listview.before( form ).jqmData( "filter-form", form ) ;
form.jqmData( "listview", listview );
var isClear = combo.@com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::isShowClearButton()();
if (isClear === true) {
var clearText = @com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::CLEAR_BUTTON_TEXT;
var clearBtn = $wnd.$("<button class='ui-btn ui-mini' style='margin:0'>"
+ clearText + "</button>");
clearBtn.on('click', function() {
combo.@com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::closeAndClearValue()();
});
listview.before( clearBtn ).jqmData( "clear-button", clearBtn );
}
} else {
input = form.find( "input" );
}
// Instantiate a filterable widget on the newly created selectmenu widget and indicate that
// the generated input form element is to be used for the filtering.
selectmenu.filterable({
input: input,
children: "> option[data-placeholder != 'true'][value]"
})
// Rebuild the custom select menu's list items to reflect the results of the filtering
// done on the select menu.
.on( "filterablefilter", function() {
selectmenu.selectmenu( "refresh" );
});
combo.@com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::setFilterableElt(Lcom/google/gwt/dom/client/Element;)
(selectmenu[0]); // listview[0]
})
// The custom select list may show up as either a popup or a dialog, depending on how much
// vertical room there is on the screen. If it shows up as a dialog, then the form containing
// the filter input field must be transferred to the dialog so that the user can continue to
// use it for filtering list items.
.on( "pagecontainerbeforeshow", function( event, data ) {
var pageId = data.toPage && data.toPage.attr("id");
// We only handle the appearance of a dialog generated by a filterable selectmenu
var isDlg = @com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::isPageSelectFilterableDialog(Ljava/lang/String;)
(pageId);
if (!isDlg) return;
var dialog = data.toPage;
var listview = dialog.find( "ul" );
var form = listview.jqmData( "filter-form" );
var clearBtn = listview.jqmData( "clear-button" );
// Attach a reference to the listview as a data item to the dialog, because during the
// pagecontainerhide handler below the selectmenu widget will already have returned the
// listview to the popup, so we won't be able to find it inside the dialog with a selector.
dialog.jqmData( "listview", listview );
// Place the form before the listview in the dialog.
listview.before( form );
if (clearBtn) {
// 110% is a hack, we should just add 32px
clearBtn.css("margin", "0 -16px 0 -16px").css("width", "110%");
listview.before( clearBtn );
}
})
// After the dialog is closed, the form containing the filter input is returned to the popup.
.on( "pagecontainerhide", function( event, data ) {
var pageId = data.prevPage && data.prevPage.attr("id");
// We only handle the disappearance of a dialog generated by a filterable selectmenu
var isDlg = @com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::isPageSelectFilterableDialog(Ljava/lang/String;)
(pageId);
if (!isDlg) return;
var listview = data.prevPage.jqmData( "listview" );
var form = listview.jqmData( "filter-form" );
var clearBtn = listview.jqmData( "clear-button" );
// Put the form back in the popup. It goes ahead of the listview.
listview.before( form );
if (clearBtn) {
clearBtn.css("margin", "0").css("width", "100%");
listview.before( clearBtn );
}
});
}-*/;
public boolean isShowClearButton() {
return showClearButton;
}
/** Clear button will be shown on filtering dialog with text defined by CLEAR_BUTTON_TEXT field. */
public void setShowClearButton(boolean showClearButton) {
this.showClearButton = showClearButton;
}
protected void closeAndClearValue() {
this.close();
this.setValue(null, true/*fireEvents*/);
}
@Override
public void setValue(String value, boolean fireEvents) {
if (value == null) clearSearchInput();
super.setValue(value, fireEvents);
}
/** Clears entered text in search input on popup form. */
public void clearSearchInput() {
if (filterable != null && JQMCommon.isFilterableReady(filterable)) {
clearInput(filterable);
}
}
private static native void clearInput(Element filterable) /*-{
var fltr = $wnd.$(filterable);
var input = fltr.filterable("option", "input");
if (input) {
var t = $wnd.$(input);
if (t.val()) {
t.val("");
t.next(".ui-input-clear").addClass("ui-input-clear-hidden");
fltr.filterable("refresh");
}
}
}-*/;
}
|
UTF-8
|
Java
| 11,199 |
java
|
JQMSelectFilterable.java
|
Java
|
[
{
"context": "m-filter/index.php\">Github Demos</a>\n *\n * @author SlavaP\n */\npublic class JQMSelectFilterable extends JQMS",
"end": 524,
"score": 0.9578518867492676,
"start": 518,
"tag": "USERNAME",
"value": "SlavaP"
},
{
"context": "remove when this bug is fixed: https://github.com/jquery/jquery-mobile/issues/7677\n String s = JQMC",
"end": 2057,
"score": 0.9987884163856506,
"start": 2051,
"tag": "USERNAME",
"value": "jquery"
}
] | null |
[] |
package com.sksamuel.jqm4gwt.form.elements;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.dom.client.Element;
import com.sksamuel.jqm4gwt.Empty;
import com.sksamuel.jqm4gwt.JQMCommon;
/**
* See <a href="http://demos.jquerymobile.com/1.4.5/selectmenu-custom-filter/">Filterable inside custom select</a>
* <br> See also <a href="https://github.com/jquery/jquery-mobile/blob/9cb1040f1da9309c30b70eccbbfb54a8ddf253aa/demos/selectmenu-custom-filter/index.php">Github Demos</a>
*
* @author SlavaP
*/
public class JQMSelectFilterable extends JQMSelect {
public static String CLEAR_BUTTON_TEXT = "-----";
private static final String SELECT_FILTERABLE_STYLENAME = "jqm4gwt-select-filterable";
private static final String FILTERABLE_SELECT = "filterable-select";
private static boolean jsServed;
private Element filterable;
private boolean showClearButton;
public JQMSelectFilterable() {
super();
addStyleName(SELECT_FILTERABLE_STYLENAME);
select.addStyleName(FILTERABLE_SELECT);
setNative(false);
}
@Override
public String getMenuStyleNames() {
String s = super.getMenuStyleNames();
// for CSS styling
String rslt = "ui-select-filterable";
if (!Empty.is(s)) rslt += " " + s;
return rslt;
}
/**
* There is a predefined ui-select-filterable CSS class, which is always added to menu dialog/popup.
* <br> You can style listview by defining rule .ui-selectmenu.ui-select-filterable .ui-selectmenu-list { ... }
* <br> For additional flexibility you can specify custom classes to be added together with ui-select-filterable
* @param menuStyleNames - space separated custom classes
*/
@Override
public void setMenuStyleNames(String menuStyleNames) {
super.setMenuStyleNames(menuStyleNames);
}
/* @Override
public Boolean doFiltering(Element elt, Integer index, String searchValue) {
// TODO: remove when this bug is fixed: https://github.com/jquery/jquery-mobile/issues/7677
String s = JQMCommon.getFilterText(elt);
if (s == null || s.isEmpty()) {
s = JQMCommon.getAttribute(elt, "data-option-index");
if (s != null && !s.isEmpty()) {
try {
int i = Integer.parseInt(s);
OptionElement opt = getOption(i);
if (opt != null) {
s = JQMCommon.getFilterText(opt);
if (s != null && !s.isEmpty()) {
JQMCommon.setFilterText(elt, s);
}
}
} catch (NumberFormatException ex) {
// nothing, can continue safely
}
}
}
return super.doFiltering(elt, index, searchValue);
} */
private void setFilterableElt(Element filterableElt) {
filterable = filterableElt;
if (filterable != null && JQMCommon.isFilterableReady(filterable)) {
JavaScriptObject origFilter = JQMCommon.getFilterCallback(filterable);
JQMCommon.bindFilterCallback(this, filterable, origFilter);
}
}
@Override
protected void onLoad() {
super.onLoad();
if (!jsServed) {
jsServed = true;
serveSelectsFilterable();
}
}
@Override
protected void onUnload() {
super.onUnload();
}
private static native boolean isPageSelectFilterableDialog(String pageId) /*-{
var isDialog = false;
var SEL = "." + @com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::FILTERABLE_SELECT;
$wnd.$(SEL).each(function() {
var id = $wnd.$(this).attr("id");
if (id) {
var s = id + "-dialog";
if (s === pageId) {
isDialog = true;
return false;
}
}
});
return isDialog;
}-*/;
private static native void serveSelectsFilterable() /*-{
if ($wnd.$ === undefined || $wnd.$ === null) return; // jQuery is not loaded
var SEL = "." + @com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::FILTERABLE_SELECT;
$wnd.$.mobile.document
// Upon creation of the select menu, we want to make use of the fact that the ID of the
// listview it generates starts with the ID of the select menu itself, plus the suffix "-menu".
// We retrieve the listview and insert a search input before it.
.on( "selectmenucreate", SEL, function( event ) {
var input,
selectmenu = $wnd.$( event.target ),
id = selectmenu.attr( "id" ),
listview = $wnd.$( "#" + id + "-menu" ),
form = listview.jqmData( "filter-form" );
var combo = @com.sksamuel.jqm4gwt.form.elements.JQMSelect::findCombo(Lcom/google/gwt/dom/client/Element;)
(event.target);
// We store the generated form in a variable attached to the popup so we avoid creating a
// second form/input field when the listview is destroyed/rebuilt during a refresh.
if ( !form ) {
input = $wnd.$( "<input data-type='search'></input>" );
form = $wnd.$( "<form style='padding-top: 1px;'></form>" ).append( input );
form.submit( function () { return false; } ); // fix for ENTER key press
input.textinput();
listview.before( form ).jqmData( "filter-form", form ) ;
form.jqmData( "listview", listview );
var isClear = combo.@com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::isShowClearButton()();
if (isClear === true) {
var clearText = @com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::CLEAR_BUTTON_TEXT;
var clearBtn = $wnd.$("<button class='ui-btn ui-mini' style='margin:0'>"
+ clearText + "</button>");
clearBtn.on('click', function() {
combo.@com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::closeAndClearValue()();
});
listview.before( clearBtn ).jqmData( "clear-button", clearBtn );
}
} else {
input = form.find( "input" );
}
// Instantiate a filterable widget on the newly created selectmenu widget and indicate that
// the generated input form element is to be used for the filtering.
selectmenu.filterable({
input: input,
children: "> option[data-placeholder != 'true'][value]"
})
// Rebuild the custom select menu's list items to reflect the results of the filtering
// done on the select menu.
.on( "filterablefilter", function() {
selectmenu.selectmenu( "refresh" );
});
combo.@com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::setFilterableElt(Lcom/google/gwt/dom/client/Element;)
(selectmenu[0]); // listview[0]
})
// The custom select list may show up as either a popup or a dialog, depending on how much
// vertical room there is on the screen. If it shows up as a dialog, then the form containing
// the filter input field must be transferred to the dialog so that the user can continue to
// use it for filtering list items.
.on( "pagecontainerbeforeshow", function( event, data ) {
var pageId = data.toPage && data.toPage.attr("id");
// We only handle the appearance of a dialog generated by a filterable selectmenu
var isDlg = @com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::isPageSelectFilterableDialog(Ljava/lang/String;)
(pageId);
if (!isDlg) return;
var dialog = data.toPage;
var listview = dialog.find( "ul" );
var form = listview.jqmData( "filter-form" );
var clearBtn = listview.jqmData( "clear-button" );
// Attach a reference to the listview as a data item to the dialog, because during the
// pagecontainerhide handler below the selectmenu widget will already have returned the
// listview to the popup, so we won't be able to find it inside the dialog with a selector.
dialog.jqmData( "listview", listview );
// Place the form before the listview in the dialog.
listview.before( form );
if (clearBtn) {
// 110% is a hack, we should just add 32px
clearBtn.css("margin", "0 -16px 0 -16px").css("width", "110%");
listview.before( clearBtn );
}
})
// After the dialog is closed, the form containing the filter input is returned to the popup.
.on( "pagecontainerhide", function( event, data ) {
var pageId = data.prevPage && data.prevPage.attr("id");
// We only handle the disappearance of a dialog generated by a filterable selectmenu
var isDlg = @com.sksamuel.jqm4gwt.form.elements.JQMSelectFilterable::isPageSelectFilterableDialog(Ljava/lang/String;)
(pageId);
if (!isDlg) return;
var listview = data.prevPage.jqmData( "listview" );
var form = listview.jqmData( "filter-form" );
var clearBtn = listview.jqmData( "clear-button" );
// Put the form back in the popup. It goes ahead of the listview.
listview.before( form );
if (clearBtn) {
clearBtn.css("margin", "0").css("width", "100%");
listview.before( clearBtn );
}
});
}-*/;
public boolean isShowClearButton() {
return showClearButton;
}
/** Clear button will be shown on filtering dialog with text defined by CLEAR_BUTTON_TEXT field. */
public void setShowClearButton(boolean showClearButton) {
this.showClearButton = showClearButton;
}
protected void closeAndClearValue() {
this.close();
this.setValue(null, true/*fireEvents*/);
}
@Override
public void setValue(String value, boolean fireEvents) {
if (value == null) clearSearchInput();
super.setValue(value, fireEvents);
}
/** Clears entered text in search input on popup form. */
public void clearSearchInput() {
if (filterable != null && JQMCommon.isFilterableReady(filterable)) {
clearInput(filterable);
}
}
private static native void clearInput(Element filterable) /*-{
var fltr = $wnd.$(filterable);
var input = fltr.filterable("option", "input");
if (input) {
var t = $wnd.$(input);
if (t.val()) {
t.val("");
t.next(".ui-input-clear").addClass("ui-input-clear-hidden");
fltr.filterable("refresh");
}
}
}-*/;
}
| 11,199 | 0.580409 | 0.574873 | 257 | 42.575874 | 33.897465 | 170 | false | false | 0 | 0 | 0 | 0 | 69 | 0.006161 | 0.59144 | false | false |
12
|
d26d1fb9ebd42316d6e9206156659b0596f21ed0
| 15,075,335,255,521 |
7f3e21226ba9175a30a09e6b70e5502e5585fbe5
|
/src/td/entities/projectile/MachineGunProjectile.java
|
9d41f14b9a4f43cab53d70c069433f5a211dd8fc
|
[] |
no_license
|
UntitledStudio/Tower-Defence
|
https://github.com/UntitledStudio/Tower-Defence
|
ad88c564f6883746fc53edbd306a928b2f62f06b
|
f61c7e93b8c58103a580bf8e00030ea947fe6d72
|
refs/heads/master
| 2020-07-23T19:54:37.268000 | 2020-06-29T12:05:52 | 2020-06-29T12:05:52 | 73,801,193 | 2 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package td.entities.projectile;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import td.assets.ImageCache;
import td.entities.enemies.EnemyUnit;
import td.screens.PlayScreen;
import td.towers.Tower;
import td.util.Hitbox;
import td.util.Util;
public class MachineGunProjectile implements TowerProjectile {
private final Tower tower;
private final EnemyUnit target;
private Hitbox hitbox;
private double speed;
public MachineGunProjectile(Tower tower, EnemyUnit target, double speed) {
this.tower = tower;
this.target = target;
this.speed = speed;
this.hitbox = new Hitbox(tower.getBlock().getX(), tower.getBlock().getY(), ImageCache.MACHINE_GUN_PROJECTILE.getWidth(), ImageCache.MACHINE_GUN_PROJECTILE.getHeight());
hitbox.setX(hitbox.getX() + Util.centerValue(hitbox.getWidth(), tower.getBlock().getTexture().getWidth()));
hitbox.setY(hitbox.getY() + Util.centerValue(hitbox.getHeight(), tower.getBlock().getTexture().getHeight()));
}
@Override
public void tick() {
TowerProjectile.calculateProjectilePos(this);
if(Util.isWithinArea(getX(), getY(), target.getHitbox())) {
onHit();
}
}
@Override
public void render(Graphics2D g) {
//TowerProjectile.drawProjectile(g, this);
g.drawImage(getImage(), getX(), getY(), null);
}
@Override
public Tower getTower() {
return tower;
}
@Override
public EnemyUnit getTarget() {
return target;
}
@Override
public void setX(int x) {
hitbox.setX(x);
}
@Override
public int getX() {
return hitbox.getX();
}
@Override
public void setY(int y) {
hitbox.setY(y);
}
@Override
public int getY() {
return hitbox.getY();
}
@Override
public Hitbox getHitbox() {
return hitbox;
}
@Override
public double getSpeed() {
return speed;
}
@Override
public void setSpeed(double speed) {
this.speed = speed;
}
@Override
public void onHit() {
target.damage(tower.getDamage()); // todo: crit handling
remove();
}
@Override
public void remove() {
PlayScreen.instance.getProjectileManager().getProjectiles().remove(this);
}
@Override
public BufferedImage getImage() {
return ImageCache.MACHINE_GUN_PROJECTILE;
}
}
|
UTF-8
|
Java
| 2,475 |
java
|
MachineGunProjectile.java
|
Java
|
[] | null |
[] |
package td.entities.projectile;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import td.assets.ImageCache;
import td.entities.enemies.EnemyUnit;
import td.screens.PlayScreen;
import td.towers.Tower;
import td.util.Hitbox;
import td.util.Util;
public class MachineGunProjectile implements TowerProjectile {
private final Tower tower;
private final EnemyUnit target;
private Hitbox hitbox;
private double speed;
public MachineGunProjectile(Tower tower, EnemyUnit target, double speed) {
this.tower = tower;
this.target = target;
this.speed = speed;
this.hitbox = new Hitbox(tower.getBlock().getX(), tower.getBlock().getY(), ImageCache.MACHINE_GUN_PROJECTILE.getWidth(), ImageCache.MACHINE_GUN_PROJECTILE.getHeight());
hitbox.setX(hitbox.getX() + Util.centerValue(hitbox.getWidth(), tower.getBlock().getTexture().getWidth()));
hitbox.setY(hitbox.getY() + Util.centerValue(hitbox.getHeight(), tower.getBlock().getTexture().getHeight()));
}
@Override
public void tick() {
TowerProjectile.calculateProjectilePos(this);
if(Util.isWithinArea(getX(), getY(), target.getHitbox())) {
onHit();
}
}
@Override
public void render(Graphics2D g) {
//TowerProjectile.drawProjectile(g, this);
g.drawImage(getImage(), getX(), getY(), null);
}
@Override
public Tower getTower() {
return tower;
}
@Override
public EnemyUnit getTarget() {
return target;
}
@Override
public void setX(int x) {
hitbox.setX(x);
}
@Override
public int getX() {
return hitbox.getX();
}
@Override
public void setY(int y) {
hitbox.setY(y);
}
@Override
public int getY() {
return hitbox.getY();
}
@Override
public Hitbox getHitbox() {
return hitbox;
}
@Override
public double getSpeed() {
return speed;
}
@Override
public void setSpeed(double speed) {
this.speed = speed;
}
@Override
public void onHit() {
target.damage(tower.getDamage()); // todo: crit handling
remove();
}
@Override
public void remove() {
PlayScreen.instance.getProjectileManager().getProjectiles().remove(this);
}
@Override
public BufferedImage getImage() {
return ImageCache.MACHINE_GUN_PROJECTILE;
}
}
| 2,475 | 0.627071 | 0.626263 | 102 | 23.264706 | 26.810125 | 176 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.480392 | false | false |
12
|
cbd8a15ea0785b3421c7c4df1ccc4c3bc79b691e
| 18,708,877,588,278 |
b08779c2aef82970efe422aceefa8a4100cdf01b
|
/app/src/main/java/com/example/administrator/normalweather/service/entity/County.java
|
27d27d76afb432eb0d17443ccd6ee9a820638221
|
[] |
no_license
|
FantasySkyland/niWeather
|
https://github.com/FantasySkyland/niWeather
|
d1316b8f54d2d98f0ba2570384fc44708a72ce81
|
463564509f0e6ec6bc055e814e1ea43792677b6f
|
refs/heads/master
| 2020-05-29T08:44:07.115000 | 2018-01-18T02:42:29 | 2018-01-18T02:42:29 | 69,244,848 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.administrator.normalweather.service.entity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2016/9/10.
*/
public class County {
public List<String> getCountyNameList(String filePath, String cityID){
SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(filePath,null);
List<String> list = new ArrayList<>();
if (cityID == null){
Cursor cursor = sqLiteDatabase.query("County",null,null,null,null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("CountyName")));
}while (cursor.moveToNext());
}
}else {
Cursor cursor = sqLiteDatabase.query(
"County",null,"CityID = ?",new String[]{cityID},null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("CountyName")));
}while (cursor.moveToNext());
}
}
return list;
}
public List<String> getCountyIdList(String filePath, String cityID){
SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(filePath,null);
List<String> list = new ArrayList<>();
if (cityID == null){
Cursor cursor = sqLiteDatabase.query("County",null,null,null,null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("CountyID")));
}while (cursor.moveToNext());
}
}else{
Cursor cursor = sqLiteDatabase.query(
"County",null,"CityID = ?",new String[]{ cityID },null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("CountyID")));
}while (cursor.moveToNext());
}
}
return list;
}
public List<String> getWeatherIdList(String filePath, String cityID){
SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(filePath,null);
List<String> list = new ArrayList<>();
if (cityID == null){
Cursor cursor = sqLiteDatabase.query("County",null,null,null,null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("WeatherID")));
}while (cursor.moveToNext());
}
}else{
Cursor cursor = sqLiteDatabase.query(
"County",null,"CityID = ?",new String[]{cityID},null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("WeatherID")));
}while (cursor.moveToNext());
}
}
return list;
}
/**
* @param filePath
* @param countyName
* @return
* 根据县区名字查询天气ID
*/
public String getWeatherId(String filePath, String countyName){
SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(filePath,null);
String weatherID = new String();
Cursor cursor = sqLiteDatabase.query(
"County",null,"CountyName = ?",new String[]{countyName},null,null,null,null);
if (cursor.moveToFirst()){
do{
weatherID = cursor.getString(cursor.getColumnIndex("WeatherID"));
}while (cursor.moveToNext());
}
return weatherID;
}
}
|
UTF-8
|
Java
| 3,773 |
java
|
County.java
|
Java
|
[] | null |
[] |
package com.example.administrator.normalweather.service.entity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2016/9/10.
*/
public class County {
public List<String> getCountyNameList(String filePath, String cityID){
SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(filePath,null);
List<String> list = new ArrayList<>();
if (cityID == null){
Cursor cursor = sqLiteDatabase.query("County",null,null,null,null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("CountyName")));
}while (cursor.moveToNext());
}
}else {
Cursor cursor = sqLiteDatabase.query(
"County",null,"CityID = ?",new String[]{cityID},null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("CountyName")));
}while (cursor.moveToNext());
}
}
return list;
}
public List<String> getCountyIdList(String filePath, String cityID){
SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(filePath,null);
List<String> list = new ArrayList<>();
if (cityID == null){
Cursor cursor = sqLiteDatabase.query("County",null,null,null,null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("CountyID")));
}while (cursor.moveToNext());
}
}else{
Cursor cursor = sqLiteDatabase.query(
"County",null,"CityID = ?",new String[]{ cityID },null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("CountyID")));
}while (cursor.moveToNext());
}
}
return list;
}
public List<String> getWeatherIdList(String filePath, String cityID){
SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(filePath,null);
List<String> list = new ArrayList<>();
if (cityID == null){
Cursor cursor = sqLiteDatabase.query("County",null,null,null,null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("WeatherID")));
}while (cursor.moveToNext());
}
}else{
Cursor cursor = sqLiteDatabase.query(
"County",null,"CityID = ?",new String[]{cityID},null,null,null,null);
if (cursor.moveToFirst()){
do{
list.add(cursor.getString(cursor.getColumnIndex("WeatherID")));
}while (cursor.moveToNext());
}
}
return list;
}
/**
* @param filePath
* @param countyName
* @return
* 根据县区名字查询天气ID
*/
public String getWeatherId(String filePath, String countyName){
SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(filePath,null);
String weatherID = new String();
Cursor cursor = sqLiteDatabase.query(
"County",null,"CountyName = ?",new String[]{countyName},null,null,null,null);
if (cursor.moveToFirst()){
do{
weatherID = cursor.getString(cursor.getColumnIndex("WeatherID"));
}while (cursor.moveToNext());
}
return weatherID;
}
}
| 3,773 | 0.571809 | 0.569944 | 99 | 36.909092 | 29.947796 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.959596 | false | false |
12
|
a6b10fae95b4f707329c18cca910380365a3bee5
| 14,877,766,773,295 |
ee41c4be088c425dbe1942f1109430a99e0a6fdb
|
/src/main/java/cetc/liqixin/devopsAgent/BasicInfo/Regions.java
|
1c83579d70eb6a8b2b55f7bd26abb5573dfa2382
|
[] |
no_license
|
lqxandxl/devopsAgent
|
https://github.com/lqxandxl/devopsAgent
|
fc4fa7482f5fb8410e88f09bd86e49bae9afb6ff
|
b0b1da1211bd678d06853efe92c89a41488130a4
|
refs/heads/master
| 2020-05-07T05:41:33.475000 | 2019-10-09T04:20:14 | 2019-10-09T04:20:14 | 180,278,943 | 0 | 1 | null | false | 2020-10-13T12:46:43 | 2019-04-09T03:37:30 | 2019-10-09T04:20:23 | 2020-10-13T12:46:42 | 17,092 | 0 | 0 | 2 |
Java
| false | false |
package cetc.liqixin.devopsAgent.BasicInfo;
import java.util.List;
public class Regions {
public List<Region> regions;
}
|
UTF-8
|
Java
| 124 |
java
|
Regions.java
|
Java
|
[] | null |
[] |
package cetc.liqixin.devopsAgent.BasicInfo;
import java.util.List;
public class Regions {
public List<Region> regions;
}
| 124 | 0.782258 | 0.782258 | 7 | 16.714285 | 15.599582 | 43 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.571429 | false | false |
12
|
33e70abd52e69b7308bb7b9b14d86a1d37b37501
| 23,493,471,157,379 |
d24de9be4c3993d9dc726e9a3c74d9662c470226
|
/reverse/Rocketbank_All_3.12.4_source_from_JADX/sources/ru/rocketbank/core/manager/loader/FeedLoader$loadPage$2.java
|
23e7c0303eb1a659b637dd014ad98bd29b09ad21
|
[] |
no_license
|
MEJIOMAH17/rocketbank-api
|
https://github.com/MEJIOMAH17/rocketbank-api
|
b18808ee4a2fdddd8b3045cd16655b0d82e0b13b
|
fc4eb0cbb4a8f52277fdb09a3b26b4cceef6ff79
|
refs/heads/master
| 2022-07-17T20:24:29.721000 | 2019-07-26T18:55:21 | 2019-07-26T18:55:21 | 198,698,231 | 4 | 0 | null | false | 2022-06-20T22:43:15 | 2019-07-24T19:31:49 | 2020-04-04T12:47:18 | 2022-06-20T22:43:14 | 291,172 | 2 | 0 | 2 |
Smali
| false | false |
package ru.rocketbank.core.manager.loader;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.jvm.internal.Intrinsics;
import ru.rocketbank.core.network.model.NanoFeedResult;
import rx.functions.Action1;
/* compiled from: FeedLoader.kt */
final class FeedLoader$loadPage$2<T> implements Action1<NanoFeedResult> {
final /* synthetic */ FeedLoader this$0;
FeedLoader$loadPage$2(FeedLoader feedLoader) {
this.this$0 = feedLoader;
}
public final void call(NanoFeedResult nanoFeedResult) {
AtomicBoolean access$isLastReached$p = this.this$0.isLastReached;
FeedLoader feedLoader = this.this$0;
nanoFeedResult = nanoFeedResult.pagination;
Intrinsics.checkExpressionValueIsNotNull(nanoFeedResult, "result.pagination");
access$isLastReached$p.set(feedLoader.isLastReached(nanoFeedResult));
}
}
|
UTF-8
|
Java
| 870 |
java
|
FeedLoader$loadPage$2.java
|
Java
|
[] | null |
[] |
package ru.rocketbank.core.manager.loader;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.jvm.internal.Intrinsics;
import ru.rocketbank.core.network.model.NanoFeedResult;
import rx.functions.Action1;
/* compiled from: FeedLoader.kt */
final class FeedLoader$loadPage$2<T> implements Action1<NanoFeedResult> {
final /* synthetic */ FeedLoader this$0;
FeedLoader$loadPage$2(FeedLoader feedLoader) {
this.this$0 = feedLoader;
}
public final void call(NanoFeedResult nanoFeedResult) {
AtomicBoolean access$isLastReached$p = this.this$0.isLastReached;
FeedLoader feedLoader = this.this$0;
nanoFeedResult = nanoFeedResult.pagination;
Intrinsics.checkExpressionValueIsNotNull(nanoFeedResult, "result.pagination");
access$isLastReached$p.set(feedLoader.isLastReached(nanoFeedResult));
}
}
| 870 | 0.751724 | 0.742529 | 23 | 36.826088 | 27.154392 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.565217 | false | false |
12
|
8c4b30b19307a0cc87f8dc0ea4e5083fc3a4b6de
| 17,454,747,131,236 |
65b2112f820548faaeb98b9933aa47636416d777
|
/wymiennik_krew.java
|
e51c447674051ab415f4cca4c07b6738a01499a3
|
[
"MIT"
] |
permissive
|
marcinlecki/termodynamika
|
https://github.com/marcinlecki/termodynamika
|
82114de9916f61c0ab2de8bdff8ac24ad621fbe2
|
651694516609034761f49823207a59dec28ee942
|
refs/heads/master
| 2020-03-28T15:52:02.222000 | 2018-09-13T12:58:37 | 2018-09-13T12:58:37 | 148,633,315 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.util.Arrays;
import static java.lang.Math.*;
public class wymiennik_krew{
public static void main(String[] args){
//założone parametry termofizyczne krwi
double rho=1050.0; double c=3740.0;
//parametry termofizyczne wody w temp. 280K
double rho_w=1000.0; double c_w=4198.0;
//natężenie przepływu krwi
double V_k=5.0; // [l/min]
//temperatury krwi
double t_ki=37.0; double t_ko=25.0;
//temperatury wody
double t_wi=0.0; double t_wo=15.0;
//Współczynnik przenikania ciepła
double U=750.0;
//obliczenie strumienia masy krwi
double m_k=rho*konwersja.l_min_na_SI(V_k);
System.out.printf("Strumień masy krwi wynosi: %.4f [kg/s] \n", m_k);
//obliczenie róźnic temperatur strumieni cieczy
double deltaTk=t_ki-t_ko;
double deltaTw=t_wo-t_wi;
//Strumień ciepła przekazywany przez krew
double Qk=m_k*c*deltaTk;
System.out.printf("Strumień ciepła przekazywany przez krew: %.0f [W] \n", Qk);
//Strumień masy wody lodowej
double m_w=Qk/(c_w*deltaTw);
System.out.printf("Strumień masy wody lodowej: %.4f [W] \n", m_w);
//Natężenie przepływu wody lodowej
System.out.printf("Natężenie przepływu wody lodowej: %.4f [l/min] \n", konwersja.SI_na_l_min(m_w/rho_w));
//Pojemności cieplne strumieni
double C_k=m_k*c; double C_w=m_w*c_w;
System.out.printf("Pojemności cieplne strumienia wody: %.0f [W/K] i krwi: %.0f [W/K] \n", C_w, C_k);
//minimalna wartość pojemności cieplnej strumienia
double C_min=min(C_w, C_k);
System.out.printf("Minimalna wartość pojemności cieplnej strumienia: %.0f [W/K] \n", C_min);
//maksymalny osiągalny strumień ciepła
double Qmax=C_min*(t_ki-t_wi);
System.out.printf("Maksymalny osiągalny strumień ciepła: %.0f [W] \n", Qmax);
//parametry potrzebne do zastosowania metody e-NTU
double epsilon = Qk/Qmax;
double C_max=max(C_w, C_k);
double C_r=C_min/C_max;
//obliczenie NTU
double NTU=obliczenia.NTU_2nm(epsilon,C_r, 0.1);
System.out.printf("NTU: %.3f [-] \n", NTU);
//obliczenie powierzchni
double A = NTU*(C_min/U);
System.out.printf("Powierzchnia wymiany ciepła: %.3f [m^2] \n", A);
double V_w=2.00;
//tablica przechowująca wartości przepływów, dla których wykonany będzie wykres
double[] Vws=new double[41];
double[][] data=new double[2][41];
data[0]=Vws;
for(int i=0; i<=40; i=i+1){
Vws[i]=V_w;
V_w=V_w+0.1;
data[1][i]=oblicz_temp(V_w, V_k, rho, rho_w, c, c_w, A, U, t_wi, t_ki)[1];
}
String[] serie={"Temp. wylotowa krwi"};
String[] twyk={"Aplikacja", "t=f(V)", "V", "t"};
wykres wykres1 = new wykres(twyk[0], twyk[1], twyk[2], twyk[3], data, serie);
wykres1.zakres_y(23.0, 27.0);
wykres1.ustaw_markery(false);
wykres1.rysuj();
double[] wynik = oblicz_temp(V_w, V_k, rho, rho_w, c, c_w, A, U, t_wi, t_ki);
//System.out.printf("Temp. wylotowa wody: %.2f oC, temp. wylotowa krwi: %.2f oC, strumień ciepła: %.2f, NTU: %.4f. \n", wynik[0], wynik[1], wynik[2], wynik[3]);
}
static double[] oblicz_temp(double V_w, double V_k, double rho, double rhow, double c, double cw, double A, double U, double twi, double tki){
//obliczenie strumienia masy krwi
double m_k=rho*konwersja.l_min_na_SI(V_k);
double m_w=rhow*konwersja.l_min_na_SI(V_w);
double C_k=m_k*c; double C_w=m_w*cw;
double C_min=min(C_w, C_k);
double C_max=max(C_w, C_k);
double C_r=C_min/C_max;
//maksymalny osiągalny strumień ciepła
double Qmax=C_min*(tki-twi);
double NTU=(U*A)/C_min;
//System.out.printf("Sprawdzenie składowych: %.3f, %.3f, %.3f \n", U,A, C_min);
double epsilon=obliczenia.epsilon_NTU(C_r,NTU);
double Q=epsilon *Qmax;
double Twyl_w=twi+Q/C_w;
double Twyl_k=tki-Q/C_k;
return new double[] {Twyl_w, Twyl_k, Q, NTU};
}
}
class obliczenia{
static double NTU_2nm(double eps, double C_r, double NTU){
int k=1;
double NTU_p=NTU;
double NTU_k=NTU;
double xi=0.33;
do{
//System.out.println(k +":");
NTU_p=NTU_k;
//System.out.printf("NTU_p: %.3f \n", NTU_p);
NTU_k=pow((C_r*log(1.0-eps))/(exp(-C_r*pow(NTU_p,0.78))-1.0), 1.0/0.22);
NTU_k=NTU_k*xi+(1.0-xi)*NTU_p;
//System.out.printf("NTU_k: %.3f \n", NTU_k);
//System.out.println(100.0*(NTU_k-NTU_p)/NTU_p);
if(k>25) break;
k=k+1;
}while (Math.abs(100.0*((NTU_k-NTU_p)/NTU_p))>0.1);
return NTU_k;
}
static double epsilon_NTU(double C_r, double NTU){
return 1.0 - exp((1.0/C_r)*pow(NTU, 0.22)*(exp(-C_r*Math.pow(NTU,0.78))-1.0));
}
}
class konwersja{
static double l_min_na_SI(double litry){
return litry*(1.0e-3/60.0);
}
static double SI_na_l_min(double m3){
return m3*(1.0e3*60.0);
}
}
|
UTF-8
|
Java
| 4,588 |
java
|
wymiennik_krew.java
|
Java
|
[] | null |
[] |
import java.util.Arrays;
import static java.lang.Math.*;
public class wymiennik_krew{
public static void main(String[] args){
//założone parametry termofizyczne krwi
double rho=1050.0; double c=3740.0;
//parametry termofizyczne wody w temp. 280K
double rho_w=1000.0; double c_w=4198.0;
//natężenie przepływu krwi
double V_k=5.0; // [l/min]
//temperatury krwi
double t_ki=37.0; double t_ko=25.0;
//temperatury wody
double t_wi=0.0; double t_wo=15.0;
//Współczynnik przenikania ciepła
double U=750.0;
//obliczenie strumienia masy krwi
double m_k=rho*konwersja.l_min_na_SI(V_k);
System.out.printf("Strumień masy krwi wynosi: %.4f [kg/s] \n", m_k);
//obliczenie róźnic temperatur strumieni cieczy
double deltaTk=t_ki-t_ko;
double deltaTw=t_wo-t_wi;
//Strumień ciepła przekazywany przez krew
double Qk=m_k*c*deltaTk;
System.out.printf("Strumień ciepła przekazywany przez krew: %.0f [W] \n", Qk);
//Strumień masy wody lodowej
double m_w=Qk/(c_w*deltaTw);
System.out.printf("Strumień masy wody lodowej: %.4f [W] \n", m_w);
//Natężenie przepływu wody lodowej
System.out.printf("Natężenie przepływu wody lodowej: %.4f [l/min] \n", konwersja.SI_na_l_min(m_w/rho_w));
//Pojemności cieplne strumieni
double C_k=m_k*c; double C_w=m_w*c_w;
System.out.printf("Pojemności cieplne strumienia wody: %.0f [W/K] i krwi: %.0f [W/K] \n", C_w, C_k);
//minimalna wartość pojemności cieplnej strumienia
double C_min=min(C_w, C_k);
System.out.printf("Minimalna wartość pojemności cieplnej strumienia: %.0f [W/K] \n", C_min);
//maksymalny osiągalny strumień ciepła
double Qmax=C_min*(t_ki-t_wi);
System.out.printf("Maksymalny osiągalny strumień ciepła: %.0f [W] \n", Qmax);
//parametry potrzebne do zastosowania metody e-NTU
double epsilon = Qk/Qmax;
double C_max=max(C_w, C_k);
double C_r=C_min/C_max;
//obliczenie NTU
double NTU=obliczenia.NTU_2nm(epsilon,C_r, 0.1);
System.out.printf("NTU: %.3f [-] \n", NTU);
//obliczenie powierzchni
double A = NTU*(C_min/U);
System.out.printf("Powierzchnia wymiany ciepła: %.3f [m^2] \n", A);
double V_w=2.00;
//tablica przechowująca wartości przepływów, dla których wykonany będzie wykres
double[] Vws=new double[41];
double[][] data=new double[2][41];
data[0]=Vws;
for(int i=0; i<=40; i=i+1){
Vws[i]=V_w;
V_w=V_w+0.1;
data[1][i]=oblicz_temp(V_w, V_k, rho, rho_w, c, c_w, A, U, t_wi, t_ki)[1];
}
String[] serie={"Temp. wylotowa krwi"};
String[] twyk={"Aplikacja", "t=f(V)", "V", "t"};
wykres wykres1 = new wykres(twyk[0], twyk[1], twyk[2], twyk[3], data, serie);
wykres1.zakres_y(23.0, 27.0);
wykres1.ustaw_markery(false);
wykres1.rysuj();
double[] wynik = oblicz_temp(V_w, V_k, rho, rho_w, c, c_w, A, U, t_wi, t_ki);
//System.out.printf("Temp. wylotowa wody: %.2f oC, temp. wylotowa krwi: %.2f oC, strumień ciepła: %.2f, NTU: %.4f. \n", wynik[0], wynik[1], wynik[2], wynik[3]);
}
static double[] oblicz_temp(double V_w, double V_k, double rho, double rhow, double c, double cw, double A, double U, double twi, double tki){
//obliczenie strumienia masy krwi
double m_k=rho*konwersja.l_min_na_SI(V_k);
double m_w=rhow*konwersja.l_min_na_SI(V_w);
double C_k=m_k*c; double C_w=m_w*cw;
double C_min=min(C_w, C_k);
double C_max=max(C_w, C_k);
double C_r=C_min/C_max;
//maksymalny osiągalny strumień ciepła
double Qmax=C_min*(tki-twi);
double NTU=(U*A)/C_min;
//System.out.printf("Sprawdzenie składowych: %.3f, %.3f, %.3f \n", U,A, C_min);
double epsilon=obliczenia.epsilon_NTU(C_r,NTU);
double Q=epsilon *Qmax;
double Twyl_w=twi+Q/C_w;
double Twyl_k=tki-Q/C_k;
return new double[] {Twyl_w, Twyl_k, Q, NTU};
}
}
class obliczenia{
static double NTU_2nm(double eps, double C_r, double NTU){
int k=1;
double NTU_p=NTU;
double NTU_k=NTU;
double xi=0.33;
do{
//System.out.println(k +":");
NTU_p=NTU_k;
//System.out.printf("NTU_p: %.3f \n", NTU_p);
NTU_k=pow((C_r*log(1.0-eps))/(exp(-C_r*pow(NTU_p,0.78))-1.0), 1.0/0.22);
NTU_k=NTU_k*xi+(1.0-xi)*NTU_p;
//System.out.printf("NTU_k: %.3f \n", NTU_k);
//System.out.println(100.0*(NTU_k-NTU_p)/NTU_p);
if(k>25) break;
k=k+1;
}while (Math.abs(100.0*((NTU_k-NTU_p)/NTU_p))>0.1);
return NTU_k;
}
static double epsilon_NTU(double C_r, double NTU){
return 1.0 - exp((1.0/C_r)*pow(NTU, 0.22)*(exp(-C_r*Math.pow(NTU,0.78))-1.0));
}
}
class konwersja{
static double l_min_na_SI(double litry){
return litry*(1.0e-3/60.0);
}
static double SI_na_l_min(double m3){
return m3*(1.0e3*60.0);
}
}
| 4,588 | 0.652931 | 0.618554 | 141 | 30.198582 | 27.911516 | 160 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.404255 | false | false |
12
|
cef0b7def0731a12f42991228610da5eeec5a19e
| 17,454,747,132,486 |
0ae7357b956bcf7a3b9cb12c26f68b9f9dd2773d
|
/SDSO1/app/src/main/java/com/example/comnets/sdso1/MainActivity.java
|
78363a34dab10cd09e62e61c831c0a95ba1d0a6c
|
[] |
no_license
|
jibinpjohn/androidprojects
|
https://github.com/jibinpjohn/androidprojects
|
3655c19b0aa5810b91ab2f5b74f08b37b7383b7f
|
4b1b2c72383dc76a026a997b0aafc04634ba007e
|
refs/heads/master
| 2021-08-22T04:47:58.147000 | 2017-11-29T09:54:46 | 2017-11-29T09:54:46 | 112,456,544 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.comnets.sdso1;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import com.synnapps.carouselview.CarouselView;
import com.synnapps.carouselview.ImageListener;
public class MainActivity extends AppCompatActivity {
Button XMLButton, perfomanceButton;
EditText XMLText,perfomanceText;
CarouselView carouselView;
int[] sampleImages = {R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4, R.drawable.image5};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
carouselView = (CarouselView) findViewById(R.id.carouselView);
carouselView.setPageCount(sampleImages.length);
carouselView.setImageListener(imageListener);
XMLButton = (Button) findViewById(R.id.button2);
perfomanceButton= (Button) findViewById(R.id.button1);
XMLText = (EditText) findViewById(R.id.editText2);
perfomanceText = (EditText) findViewById(R.id.editText1);
}
ImageListener imageListener = new ImageListener() {
@Override
public void setImageForPosition(int position, ImageView imageView) {
imageView.setImageResource(sampleImages[position]);
}
};
public void onClickPerfomance(View view) {
setContentView(R.layout.graph);
Intent intentMain = new Intent(MainActivity.this ,
graphs.class);
MainActivity.this.startActivity(intentMain);
}
public void onClickXML(View view) {
setContentView(R.layout.configxml);
}
}
|
UTF-8
|
Java
| 1,883 |
java
|
MainActivity.java
|
Java
|
[] | null |
[] |
package com.example.comnets.sdso1;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import com.synnapps.carouselview.CarouselView;
import com.synnapps.carouselview.ImageListener;
public class MainActivity extends AppCompatActivity {
Button XMLButton, perfomanceButton;
EditText XMLText,perfomanceText;
CarouselView carouselView;
int[] sampleImages = {R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4, R.drawable.image5};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
carouselView = (CarouselView) findViewById(R.id.carouselView);
carouselView.setPageCount(sampleImages.length);
carouselView.setImageListener(imageListener);
XMLButton = (Button) findViewById(R.id.button2);
perfomanceButton= (Button) findViewById(R.id.button1);
XMLText = (EditText) findViewById(R.id.editText2);
perfomanceText = (EditText) findViewById(R.id.editText1);
}
ImageListener imageListener = new ImageListener() {
@Override
public void setImageForPosition(int position, ImageView imageView) {
imageView.setImageResource(sampleImages[position]);
}
};
public void onClickPerfomance(View view) {
setContentView(R.layout.graph);
Intent intentMain = new Intent(MainActivity.this ,
graphs.class);
MainActivity.this.startActivity(intentMain);
}
public void onClickXML(View view) {
setContentView(R.layout.configxml);
}
}
| 1,883 | 0.691981 | 0.686139 | 65 | 26.969231 | 26.759308 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.569231 | false | false |
12
|
ac070228ba069494f7782d42a34a5ee482c9ed00
| 32,469,952,826,751 |
638f3a829d4f0c212b5ddea98071952997b863b4
|
/fengyu-service-user/src/main/java/com/fengyu/service/user/work/dao/WorkDao.java
|
2796c1968b0a89625ea392282a124e75de0fffe9
|
[] |
no_license
|
guozheng93/fengyu
|
https://github.com/guozheng93/fengyu
|
4db2c228714b6fb6dde09e4deffacf1a3ca3b9e5
|
6c6b5735f5e7808a95d9b5f4e21a2746bf6fae53
|
refs/heads/master
| 2020-06-19T01:06:15.393000 | 2016-12-29T01:32:11 | 2016-12-29T01:32:11 | 74,929,632 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.fengyu.service.user.work.dao;
import com.fengyu.common.core.annotation.MyBatisDao;
import com.fengyu.common.core.dao.BaseDao;
import com.fengyu.facade.user.work.entity.po.WorkPO;
import com.fengyu.service.user.work.biz.WorkBiz;
/**
* @author admin
* @version V1.0
* @date 2016/12/17
*/
@MyBatisDao
public interface WorkDao extends BaseDao<WorkPO> {
}
|
UTF-8
|
Java
| 369 |
java
|
WorkDao.java
|
Java
|
[
{
"context": "gyu.service.user.work.biz.WorkBiz;\n\n/**\n * @author admin\n * @version V1.0\n * @date 2016/12/17\n */\n@MyBatis",
"end": 262,
"score": 0.9979327917098999,
"start": 257,
"tag": "USERNAME",
"value": "admin"
}
] | null |
[] |
package com.fengyu.service.user.work.dao;
import com.fengyu.common.core.annotation.MyBatisDao;
import com.fengyu.common.core.dao.BaseDao;
import com.fengyu.facade.user.work.entity.po.WorkPO;
import com.fengyu.service.user.work.biz.WorkBiz;
/**
* @author admin
* @version V1.0
* @date 2016/12/17
*/
@MyBatisDao
public interface WorkDao extends BaseDao<WorkPO> {
}
| 369 | 0.764228 | 0.737127 | 15 | 23.6 | 20.519258 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false |
12
|
b21e9dc8f17da1188dfb023f319252d6339ecf5f
| 8,005,819,104,669 |
c8fec9b8b5cbfe819c4721ee4a0fb3f324d017b1
|
/src/main/java/br/gov/rn/pm/sigp/repository/PostoRepository.java
|
5cf793fbe577315a1129d909b9bb0cf05208bc01
|
[
"MIT"
] |
permissive
|
isaacJose/SiGP
|
https://github.com/isaacJose/SiGP
|
9e81457b7b0931d4458fa673d4c5a014544dac81
|
6a8dc9d1a61fbad7fdb6c51daade7a692dec9f61
|
refs/heads/master
| 2020-03-16T19:40:52.478000 | 2018-05-09T19:17:20 | 2018-05-09T19:17:20 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.gov.rn.pm.sigp.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import br.gov.rn.pm.sigp.model.Posto;
@Repository("postoRepository")
public interface PostoRepository extends JpaRepository<Posto, Long> {
@Query(value = "SELECT * FROM Posto p", nativeQuery=true)
public List<Posto> findByUserId(@Param("userId") Long userId);
}
|
UTF-8
|
Java
| 563 |
java
|
PostoRepository.java
|
Java
|
[] | null |
[] |
package br.gov.rn.pm.sigp.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import br.gov.rn.pm.sigp.model.Posto;
@Repository("postoRepository")
public interface PostoRepository extends JpaRepository<Posto, Long> {
@Query(value = "SELECT * FROM Posto p", nativeQuery=true)
public List<Posto> findByUserId(@Param("userId") Long userId);
}
| 563 | 0.78508 | 0.78508 | 18 | 30.277779 | 26.280127 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.555556 | false | false |
12
|
00ac3d0004751715357887edbaa2716e7ed6ae86
| 8,057,358,717,656 |
19b5ab2a79905c7a10c4943002453d395ad62271
|
/src/main/java/com/amm/service/impl/MaintainRecordServiceImpl.java
|
4bae5bb428e5289baf1ddfed620fdbeb6203acc7
|
[] |
no_license
|
csw823197541/AMM_platform
|
https://github.com/csw823197541/AMM_platform
|
b1a59d76677d625700fd1db91a94545a11dc2b39
|
718c5c2ab6ea6f641b6dd4b73aaf00fe4d338aed
|
refs/heads/master
| 2020-04-12T03:57:40.980000 | 2018-07-16T06:12:42 | 2018-07-16T06:12:42 | 60,574,941 | 4 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.amm.service.impl;
import com.amm.entity.MachineEntity;
import com.amm.entity.MaintainRecordEntity;
import com.amm.entity.client.Maintainrecord;
import com.amm.exception.ObjectNotFoundException;
import com.amm.repository.MachTerminalRepository;
import com.amm.repository.MachineRepository;
import com.amm.repository.RefMachTerminalRepository;
import com.amm.repository.MaintainRecordRepository;
import com.amm.repository.TerminalRepository;
import com.amm.service.MaintainRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* Created by 杨思名 on 2016/11/17.
*/
@Component("maintainRecordService")
@Scope("prototype")
public class MaintainRecordServiceImpl implements MaintainRecordService {
@Autowired
protected MaintainRecordRepository maintainRecordRepository;
@Autowired
private MachineRepository machineRepository;
public MaintainRecordEntity create(MaintainRecordEntity machTerminalEntity) {
return maintainRecordRepository.save(machTerminalEntity);
}
public List<Maintainrecord> findAll(Boolean isBind) {
List<Maintainrecord> tempList=new ArrayList<Maintainrecord>();
List<MaintainRecordEntity> ListMaintainrecord=(List<MaintainRecordEntity>)maintainRecordRepository.findAll();
for(int i=0;i<ListMaintainrecord.size();i++){
MachineEntity machineEntity=machineRepository.findById(ListMaintainrecord.get(i).getMachId());
Maintainrecord maintainrecord=new Maintainrecord();
maintainrecord.setId(ListMaintainrecord.get(i).getId());
maintainrecord.setMachCode(machineEntity.getMachCode());
maintainrecord.setMachName(machineEntity.getMachName());
maintainrecord.setMaintainInfo(ListMaintainrecord.get(i).getMaintainInfo());
maintainrecord.setWorkingType(machineEntity.getWorkingType());
maintainrecord.setMachId(ListMaintainrecord.get(i).getMachId());
tempList.add(maintainrecord);
}
return tempList;
}
public MaintainRecordEntity findById(Integer id) {
return maintainRecordRepository.findByMachId(id);
}
public void delete(Integer id) {
maintainRecordRepository.delete(id);
}
@Transactional
public MaintainRecordEntity update(MaintainRecordEntity maintainRecord) {
MaintainRecordEntity saved= maintainRecordRepository.findById(maintainRecord.getId());
if(saved == null) {
throw new ObjectNotFoundException("用户不存在");
}
saved=maintainRecord.changeUpdateInfoToSave(saved);
saved=maintainRecordRepository.save(saved);
return saved;
}
}
|
UTF-8
|
Java
| 2,919 |
java
|
MaintainRecordServiceImpl.java
|
Java
|
[
{
"context": "ayList;\nimport java.util.List;\n\n/**\n * Created by 杨思名 on 2016/11/17.\n */\n@Component(\"maintainRecordServ",
"end": 803,
"score": 0.9980008602142334,
"start": 800,
"tag": "NAME",
"value": "杨思名"
}
] | null |
[] |
package com.amm.service.impl;
import com.amm.entity.MachineEntity;
import com.amm.entity.MaintainRecordEntity;
import com.amm.entity.client.Maintainrecord;
import com.amm.exception.ObjectNotFoundException;
import com.amm.repository.MachTerminalRepository;
import com.amm.repository.MachineRepository;
import com.amm.repository.RefMachTerminalRepository;
import com.amm.repository.MaintainRecordRepository;
import com.amm.repository.TerminalRepository;
import com.amm.service.MaintainRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* Created by 杨思名 on 2016/11/17.
*/
@Component("maintainRecordService")
@Scope("prototype")
public class MaintainRecordServiceImpl implements MaintainRecordService {
@Autowired
protected MaintainRecordRepository maintainRecordRepository;
@Autowired
private MachineRepository machineRepository;
public MaintainRecordEntity create(MaintainRecordEntity machTerminalEntity) {
return maintainRecordRepository.save(machTerminalEntity);
}
public List<Maintainrecord> findAll(Boolean isBind) {
List<Maintainrecord> tempList=new ArrayList<Maintainrecord>();
List<MaintainRecordEntity> ListMaintainrecord=(List<MaintainRecordEntity>)maintainRecordRepository.findAll();
for(int i=0;i<ListMaintainrecord.size();i++){
MachineEntity machineEntity=machineRepository.findById(ListMaintainrecord.get(i).getMachId());
Maintainrecord maintainrecord=new Maintainrecord();
maintainrecord.setId(ListMaintainrecord.get(i).getId());
maintainrecord.setMachCode(machineEntity.getMachCode());
maintainrecord.setMachName(machineEntity.getMachName());
maintainrecord.setMaintainInfo(ListMaintainrecord.get(i).getMaintainInfo());
maintainrecord.setWorkingType(machineEntity.getWorkingType());
maintainrecord.setMachId(ListMaintainrecord.get(i).getMachId());
tempList.add(maintainrecord);
}
return tempList;
}
public MaintainRecordEntity findById(Integer id) {
return maintainRecordRepository.findByMachId(id);
}
public void delete(Integer id) {
maintainRecordRepository.delete(id);
}
@Transactional
public MaintainRecordEntity update(MaintainRecordEntity maintainRecord) {
MaintainRecordEntity saved= maintainRecordRepository.findById(maintainRecord.getId());
if(saved == null) {
throw new ObjectNotFoundException("用户不存在");
}
saved=maintainRecord.changeUpdateInfoToSave(saved);
saved=maintainRecordRepository.save(saved);
return saved;
}
}
| 2,919 | 0.756459 | 0.753359 | 80 | 35.287498 | 30.025486 | 117 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5125 | false | false |
12
|
4f65b0973319da4532b1c233c4e8cd444d54106d
| 24,249,385,420,903 |
54d142b7307ca35f47c7b5c2a74efa4975d39151
|
/src/main/java/me/xiaoyuu/inwust/model/ProjectInfo.java
|
f5dc4a5bee334f6a01573f0c39068e9084bca5d3
|
[] |
no_license
|
xxcosmos/MyJinji
|
https://github.com/xxcosmos/MyJinji
|
6c06738becec65865d8f742b6460cd287e682c7c
|
4b3dd74b5075d94de5fe44a3e5a004416fc6de34
|
refs/heads/master
| 2020-05-09T13:22:14.372000 | 2019-05-05T13:55:05 | 2019-05-05T13:55:05 | 181,149,398 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package me.xiaoyuu.inwust.model;
import javax.persistence.*;
@Table(name = "project_info")
public class ProjectInfo {
/**
* id
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
private String image;
private String introduction;
private String field;
private String local;
@Column(name = "is_company")
private Boolean isCompany;
private String status;
/**
* 获取id
*
* @return id - id
*/
public Integer getId() {
return id;
}
/**
* 设置id
*
* @param id id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* @return image
*/
public String getImage() {
return image;
}
/**
* @param image
*/
public void setImage(String image) {
this.image = image;
}
/**
* @return introduction
*/
public String getIntroduction() {
return introduction;
}
/**
* @param introduction
*/
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
/**
* @return field
*/
public String getField() {
return field;
}
/**
* @param field
*/
public void setField(String field) {
this.field = field;
}
/**
* @return local
*/
public String getLocal() {
return local;
}
/**
* @param local
*/
public void setLocal(String local) {
this.local = local;
}
/**
* @return is_compny
*/
public Boolean getIsCompany() {
return isCompany;
}
/**
* @param isCompany
*/
public void setIsCompany(Boolean isCompany) {
this.isCompany = isCompany;
}
/**
* @return status
*/
public String getStatus() {
return status;
}
/**
* @param status
*/
public void setStatus(String status) {
this.status = status;
}
}
|
UTF-8
|
Java
| 2,263 |
java
|
ProjectInfo.java
|
Java
|
[] | null |
[] |
package me.xiaoyuu.inwust.model;
import javax.persistence.*;
@Table(name = "project_info")
public class ProjectInfo {
/**
* id
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
private String image;
private String introduction;
private String field;
private String local;
@Column(name = "is_company")
private Boolean isCompany;
private String status;
/**
* 获取id
*
* @return id - id
*/
public Integer getId() {
return id;
}
/**
* 设置id
*
* @param id id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* @return image
*/
public String getImage() {
return image;
}
/**
* @param image
*/
public void setImage(String image) {
this.image = image;
}
/**
* @return introduction
*/
public String getIntroduction() {
return introduction;
}
/**
* @param introduction
*/
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
/**
* @return field
*/
public String getField() {
return field;
}
/**
* @param field
*/
public void setField(String field) {
this.field = field;
}
/**
* @return local
*/
public String getLocal() {
return local;
}
/**
* @param local
*/
public void setLocal(String local) {
this.local = local;
}
/**
* @return is_compny
*/
public Boolean getIsCompany() {
return isCompany;
}
/**
* @param isCompany
*/
public void setIsCompany(Boolean isCompany) {
this.isCompany = isCompany;
}
/**
* @return status
*/
public String getStatus() {
return status;
}
/**
* @param status
*/
public void setStatus(String status) {
this.status = status;
}
}
| 2,263 | 0.510421 | 0.510421 | 144 | 14.666667 | 13.167722 | 55 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.180556 | false | false |
12
|
f613e672860d2b33748680b7ac06e615e9e5bbb6
| 3,599,182,598,506 |
84ed99df25cc4206cdcf43a577ad57146f0e1fd6
|
/app/src/main/java/com/miclis/btlogger/Model/BtDevice.java
|
2baf2a8cb4a999ff2d832d37d9620d8ccfa4a832
|
[] |
no_license
|
miclis/BTLogger
|
https://github.com/miclis/BTLogger
|
f562ab34e188a46d265c97cc920895f99839cfd2
|
6818b2d368e7c3580ca801f37a6fd41d52695a6b
|
refs/heads/master
| 2021-06-27T01:52:07.852000 | 2020-10-25T13:46:47 | 2020-10-25T13:46:47 | 158,289,788 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.miclis.btlogger.Model;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
import android.arch.persistence.room.TypeConverters;
import com.google.gson.annotations.SerializedName;
import java.util.Date;
@Entity(tableName = "devices_table")
public class BtDevice {
@PrimaryKey(autoGenerate = true)
@SerializedName("id")
private int id;
@SerializedName("instance")
private String instanceId;
@SerializedName("name")
private String name;
@SerializedName("address")
private String address;
@SerializedName("type")
private int type;
@SerializedName("rssi")
private Short rssi;
@SerializedName("timeIn")
@TypeConverters(TimeConverter.class)
private Date timeIn;
public BtDevice(String instanceId, String name, String address, int type, Short rssi) {
this.instanceId = instanceId;
this.name = name;
this.address = address;
this.type = type;
this.rssi = rssi;
this.timeIn = new Date();
}
public void setId(int id) {
this.id = id;
}
public int getId(){
return id;
}
public String getInstanceId() {
return instanceId;
}
public String getName() {
return name;
}
public String getAddress() {
return address;
}
public int getType() {
return type;
}
public Short getRssi() {
return rssi;
}
public Date getTimeIn() {
return timeIn;
}
public void setTimeIn(Date timeIn) { // Used in constructor
this.timeIn = timeIn;
}
}
|
UTF-8
|
Java
| 1,441 |
java
|
BtDevice.java
|
Java
|
[] | null |
[] |
package com.miclis.btlogger.Model;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
import android.arch.persistence.room.TypeConverters;
import com.google.gson.annotations.SerializedName;
import java.util.Date;
@Entity(tableName = "devices_table")
public class BtDevice {
@PrimaryKey(autoGenerate = true)
@SerializedName("id")
private int id;
@SerializedName("instance")
private String instanceId;
@SerializedName("name")
private String name;
@SerializedName("address")
private String address;
@SerializedName("type")
private int type;
@SerializedName("rssi")
private Short rssi;
@SerializedName("timeIn")
@TypeConverters(TimeConverter.class)
private Date timeIn;
public BtDevice(String instanceId, String name, String address, int type, Short rssi) {
this.instanceId = instanceId;
this.name = name;
this.address = address;
this.type = type;
this.rssi = rssi;
this.timeIn = new Date();
}
public void setId(int id) {
this.id = id;
}
public int getId(){
return id;
}
public String getInstanceId() {
return instanceId;
}
public String getName() {
return name;
}
public String getAddress() {
return address;
}
public int getType() {
return type;
}
public Short getRssi() {
return rssi;
}
public Date getTimeIn() {
return timeIn;
}
public void setTimeIn(Date timeIn) { // Used in constructor
this.timeIn = timeIn;
}
}
| 1,441 | 0.721027 | 0.721027 | 75 | 18.226667 | 16.795692 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.306667 | false | false |
12
|
64bfaa709f80fedc4b34bfa51e551bf5489d817b
| 25,709,674,235,623 |
3ac3db94eaea21c34db5051d015497b58b4144e3
|
/app/src/main/java/com/example/sangameswaran/test2/NameFragment.java
|
af228977dbcbb21a3b2203ca0ed5c2acaab3dfa8
|
[] |
no_license
|
SangameswaranRS/blackmath
|
https://github.com/SangameswaranRS/blackmath
|
bb4633f4adbbec13a24b2a05f505ab74bc7474d4
|
79bcedcae241f9a5ac0f887c81f5efa3818a1a4a
|
refs/heads/master
| 2021-01-20T10:18:43.911000 | 2017-05-05T06:17:32 | 2017-05-05T06:17:32 | 90,343,414 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.sangameswaran.test2;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.example.sangameswaran.test2.R;
import java.util.zip.Inflater;
import static java.lang.Math.pow;
/**
* Created by Sangameswaran on 24-09-2016.
*/
public class NameFragment extends Fragment implements View.OnClickListener {
EditText mEnteredValue;
Button bOne;
Button bTwo;
Button bThree;
Button bFour;
Button bFive;
TextView resDisp;
public NameFragment() {
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_name, container, false);
mEnteredValue = (EditText) view.findViewById(R.id.result);
bOne = (Button) view.findViewById(R.id.button1);
bTwo = (Button) view.findViewById(R.id.button2);
bThree = (Button) view.findViewById(R.id.button3);
bFour = (Button) view.findViewById(R.id.button4);
bFive = (Button) view.findViewById(R.id.button5);
resDisp = (TextView) view.findViewById(R.id.resultDisplay);
bOne.setOnClickListener((View.OnClickListener) this);
bTwo.setOnClickListener((View.OnClickListener) this);
bThree.setOnClickListener((View.OnClickListener) this);
bFour.setOnClickListener((View.OnClickListener) this);
bFive.setOnClickListener((View.OnClickListener) this);
return view;
}
public int invert(int a) {
if (a == 1) {
return 0;
} else {
return 1;
}
}
public int balance(int a) {
if (a > 1) {
return 1;
} else {
return 0;
}
}
public int bintogray(int bin) {
int a, b, result = 0, i = 0;
while (bin != 0) {
a = bin % 10;
bin = bin / 10;
b = bin % 10;
if ((a == 1 && invert(b) == 1) || (invert(a) == 1 && b == 1)) {
result = (int) (result + pow(10, i));
}
i++;
}
return result;
}
int binToDec(int data) {
int sum = 0, b = 1;
//int g0,g1,g2,g3;
int i, q, r;
i = 0;
while (data > 0) {
r = data % 10;
sum += r * b;
b *= 2;
//cout<<"o";
data /= 10;
}
return sum;
}
int decToBin(int data) {
int i = 0, j, fi;
int a[] = new int[10];
int b[] = new int[10];
while (data > 0) {
a[i] = data % 2;
data = data / 2;
i++;
}
fi = i;
int sum = 0, c = 1;
for (i = 0; i < fi; i++) {
sum += a[i] * c;
c *= 10;
}
return sum;
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.button1) {
String value = mEnteredValue.getText().toString();
if (value.equals("")) {
Toast.makeText(getContext(), "enter data", Toast.LENGTH_LONG).show();
} else {
int data = Integer.parseInt(value);
int result = bintogray(data);
resDisp.setText("BINARY TO GRAY CODE RESULT=" + result);
}
}
if (id == R.id.button2) {
/*to excess 3*/
String value = mEnteredValue.getText().toString();
if (value.equals("")) {
Toast.makeText(getContext(), "enter data", Toast.LENGTH_LONG).show();
} else {
int data = Integer.parseInt(value);
int a[] = new int[10];
int b[] = new int[10];
int i = 0;
i = binToDec(data);
i += 3;
i = decToBin(i);
resDisp.setText("BINARY TO EXCESS 3" + i);
}
}
if (id == R.id.button3) {
String value = mEnteredValue.getText().toString();
if (value.equals("")) {
Toast.makeText(getContext(), "enter data", Toast.LENGTH_LONG).show();
} else {
int data = Integer.parseInt(value);
int recieve = binToDec(data);
resDisp.setText("DECIMAL EQUIVALENT=" + recieve);
}
}
if (id == R.id.button4) {
String value = mEnteredValue.getText().toString();
if (value.equals("")) {
Toast.makeText(getContext(), "enter data", Toast.LENGTH_LONG).show();
} else {
int data = Integer.parseInt(value);
data = binToDec(data);
String s;
s = Integer.toHexString(data);
resDisp.setText("HEXADECIMAL EQUIVALENT:" + s);
}
}
if (id == R.id.button5) {
String value = mEnteredValue.getText().toString();
if (value.equals("")) {
Toast.makeText(getContext(), "enter data", Toast.LENGTH_LONG).show();
} else {
int data = Integer.parseInt(value);
data = binToDec(data);
String s;
s = Integer.toOctalString(data);
resDisp.setText("OCTAL EQUIVALENT:" + s);
}
}
}
}
|
UTF-8
|
Java
| 5,687 |
java
|
NameFragment.java
|
Java
|
[
{
"context": "port static java.lang.Math.pow;\n\n/**\n * Created by Sangameswaran on 24-09-2016.\n */\n\n\npublic class Nam",
"end": 498,
"score": 0.6032792329788208,
"start": 497,
"tag": "USERNAME",
"value": "S"
},
{
"context": "rt static java.lang.Math.pow;\n\n/**\n * Created by Sangameswaran on 24-09-2016.\n */\n\n\npublic class NameFragment ex",
"end": 510,
"score": 0.9409677386283875,
"start": 498,
"tag": "NAME",
"value": "angameswaran"
}
] | null |
[] |
package com.example.sangameswaran.test2;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.example.sangameswaran.test2.R;
import java.util.zip.Inflater;
import static java.lang.Math.pow;
/**
* Created by Sangameswaran on 24-09-2016.
*/
public class NameFragment extends Fragment implements View.OnClickListener {
EditText mEnteredValue;
Button bOne;
Button bTwo;
Button bThree;
Button bFour;
Button bFive;
TextView resDisp;
public NameFragment() {
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_name, container, false);
mEnteredValue = (EditText) view.findViewById(R.id.result);
bOne = (Button) view.findViewById(R.id.button1);
bTwo = (Button) view.findViewById(R.id.button2);
bThree = (Button) view.findViewById(R.id.button3);
bFour = (Button) view.findViewById(R.id.button4);
bFive = (Button) view.findViewById(R.id.button5);
resDisp = (TextView) view.findViewById(R.id.resultDisplay);
bOne.setOnClickListener((View.OnClickListener) this);
bTwo.setOnClickListener((View.OnClickListener) this);
bThree.setOnClickListener((View.OnClickListener) this);
bFour.setOnClickListener((View.OnClickListener) this);
bFive.setOnClickListener((View.OnClickListener) this);
return view;
}
public int invert(int a) {
if (a == 1) {
return 0;
} else {
return 1;
}
}
public int balance(int a) {
if (a > 1) {
return 1;
} else {
return 0;
}
}
public int bintogray(int bin) {
int a, b, result = 0, i = 0;
while (bin != 0) {
a = bin % 10;
bin = bin / 10;
b = bin % 10;
if ((a == 1 && invert(b) == 1) || (invert(a) == 1 && b == 1)) {
result = (int) (result + pow(10, i));
}
i++;
}
return result;
}
int binToDec(int data) {
int sum = 0, b = 1;
//int g0,g1,g2,g3;
int i, q, r;
i = 0;
while (data > 0) {
r = data % 10;
sum += r * b;
b *= 2;
//cout<<"o";
data /= 10;
}
return sum;
}
int decToBin(int data) {
int i = 0, j, fi;
int a[] = new int[10];
int b[] = new int[10];
while (data > 0) {
a[i] = data % 2;
data = data / 2;
i++;
}
fi = i;
int sum = 0, c = 1;
for (i = 0; i < fi; i++) {
sum += a[i] * c;
c *= 10;
}
return sum;
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.button1) {
String value = mEnteredValue.getText().toString();
if (value.equals("")) {
Toast.makeText(getContext(), "enter data", Toast.LENGTH_LONG).show();
} else {
int data = Integer.parseInt(value);
int result = bintogray(data);
resDisp.setText("BINARY TO GRAY CODE RESULT=" + result);
}
}
if (id == R.id.button2) {
/*to excess 3*/
String value = mEnteredValue.getText().toString();
if (value.equals("")) {
Toast.makeText(getContext(), "enter data", Toast.LENGTH_LONG).show();
} else {
int data = Integer.parseInt(value);
int a[] = new int[10];
int b[] = new int[10];
int i = 0;
i = binToDec(data);
i += 3;
i = decToBin(i);
resDisp.setText("BINARY TO EXCESS 3" + i);
}
}
if (id == R.id.button3) {
String value = mEnteredValue.getText().toString();
if (value.equals("")) {
Toast.makeText(getContext(), "enter data", Toast.LENGTH_LONG).show();
} else {
int data = Integer.parseInt(value);
int recieve = binToDec(data);
resDisp.setText("DECIMAL EQUIVALENT=" + recieve);
}
}
if (id == R.id.button4) {
String value = mEnteredValue.getText().toString();
if (value.equals("")) {
Toast.makeText(getContext(), "enter data", Toast.LENGTH_LONG).show();
} else {
int data = Integer.parseInt(value);
data = binToDec(data);
String s;
s = Integer.toHexString(data);
resDisp.setText("HEXADECIMAL EQUIVALENT:" + s);
}
}
if (id == R.id.button5) {
String value = mEnteredValue.getText().toString();
if (value.equals("")) {
Toast.makeText(getContext(), "enter data", Toast.LENGTH_LONG).show();
} else {
int data = Integer.parseInt(value);
data = binToDec(data);
String s;
s = Integer.toOctalString(data);
resDisp.setText("OCTAL EQUIVALENT:" + s);
}
}
}
}
| 5,687 | 0.503253 | 0.489889 | 216 | 25.328703 | 23.074924 | 123 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.615741 | false | false |
12
|
2597b67973f27bad19e1075a0ae13b6911202819
| 2,181,843,410,720 |
156038d937d4a4320b212a51880f4393c030dc73
|
/src/test/java/nl/mdekort/backup/cloudbackup/service/RunnerServiceTest.java
|
57a37f01b53fb4eda16d027bd7c3692eb7afe3c0
|
[] |
no_license
|
melvyndekort/cloudbackup
|
https://github.com/melvyndekort/cloudbackup
|
c173d9545332ebf8e79ab967ffa8aad9a6b09c35
|
2490f756aff173577275a45fc7583c5dc39847c7
|
refs/heads/master
| 2017-11-19T03:23:26.248000 | 2017-03-19T01:48:38 | 2017-03-19T01:48:38 | 94,762,007 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package nl.mdekort.backup.cloudbackup.service;
import nl.mdekort.backup.cloudbackup.config.CloudBackupProperties;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willDoNothing;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@RunWith(MockitoJUnitRunner.class)
public class RunnerServiceTest {
@Mock
private GlacierStorageService glacierStorageService;
@Mock
private CloudBackupProperties cloudBackupProperties;
@Mock
private DynamoDBService dynamoDBService;
@InjectMocks
private RunnerService sut;
@Rule
public TemporaryFolder testFolder = new TemporaryFolder();
@Captor
private ArgumentCaptor<String> captor;
private static final String VAULT = "vault";
private static final String EMPTY_FILE_CHECKSUM = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
@Test
public void shouldStoreFile() throws IOException {
File testFile = testFolder.newFile("test.txt");
String randomString = UUID.randomUUID().toString();
//given
given(cloudBackupProperties.getPath()).willReturn(testFolder.getRoot().toString());
given(cloudBackupProperties.getVault()).willReturn(VAULT);
given(glacierStorageService.uploadFile(VAULT, testFile.toPath())).willReturn(randomString);
willDoNothing().given(dynamoDBService).storeArchiveInfo(randomString, testFile.toString(), randomString);
//when
sut.execute();
//then
verify(glacierStorageService, times(1)).uploadFile(VAULT, testFile.toPath());
verify(dynamoDBService, times(1)).storeArchiveInfo(anyString(), anyString(), captor.capture());
assertThat(captor.getValue()).isEqualTo(EMPTY_FILE_CHECKSUM);
}
}
|
UTF-8
|
Java
| 2,293 |
java
|
RunnerServiceTest.java
|
Java
|
[] | null |
[] |
package nl.mdekort.backup.cloudbackup.service;
import nl.mdekort.backup.cloudbackup.config.CloudBackupProperties;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.willDoNothing;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@RunWith(MockitoJUnitRunner.class)
public class RunnerServiceTest {
@Mock
private GlacierStorageService glacierStorageService;
@Mock
private CloudBackupProperties cloudBackupProperties;
@Mock
private DynamoDBService dynamoDBService;
@InjectMocks
private RunnerService sut;
@Rule
public TemporaryFolder testFolder = new TemporaryFolder();
@Captor
private ArgumentCaptor<String> captor;
private static final String VAULT = "vault";
private static final String EMPTY_FILE_CHECKSUM = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
@Test
public void shouldStoreFile() throws IOException {
File testFile = testFolder.newFile("test.txt");
String randomString = UUID.randomUUID().toString();
//given
given(cloudBackupProperties.getPath()).willReturn(testFolder.getRoot().toString());
given(cloudBackupProperties.getVault()).willReturn(VAULT);
given(glacierStorageService.uploadFile(VAULT, testFile.toPath())).willReturn(randomString);
willDoNothing().given(dynamoDBService).storeArchiveInfo(randomString, testFile.toString(), randomString);
//when
sut.execute();
//then
verify(glacierStorageService, times(1)).uploadFile(VAULT, testFile.toPath());
verify(dynamoDBService, times(1)).storeArchiveInfo(anyString(), anyString(), captor.capture());
assertThat(captor.getValue()).isEqualTo(EMPTY_FILE_CHECKSUM);
}
}
| 2,293 | 0.755778 | 0.74444 | 72 | 30.847221 | 28.995047 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false |
12
|
fa1a2b22528ffe0c8a894334ad561e6e97db1452
| 26,293,789,800,698 |
a7208d6dddd2e66ecc1f74b6819892c0ef8f1c29
|
/src/main/java/com/tzc/biz/util/CategoryUtil.java
|
a97eec0ea8ab7fb5103ae9b93c4b75fe1680b11a
|
[] |
no_license
|
limengneu/tzc
|
https://github.com/limengneu/tzc
|
a9cb36003fb92e2e536d12cdf4ce1757757ae455
|
eb6289807344907fdeea6535b3d18941dd2bd90a
|
refs/heads/master
| 2020-07-25T17:47:34.761000 | 2012-10-19T09:22:58 | 2012-10-19T09:22:58 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/**
* @文件名称:CategoryUtil.java
* @类路径:com.tzc.biz.util
* @版权:Copyright (c)2012
* @作者:limeng
* @时间:Oct 16, 20123:19:47 PM
*/
package com.tzc.biz.util;
import java.util.HashMap;
import java.util.Map;
/**
* @描述:
* @作者:limeng
* @创建时间:Oct 16, 20123:19:47 PM
*/
public class CategoryUtil {
private static Map<String, String> categoryMap = new HashMap<String, String>();
static {
categoryMap.put("油罐车系列", "ygc");
categoryMap.put("洒水车系列", "ssc");
categoryMap.put("散装水泥车系列", "szsnc");
categoryMap.put("吸粪车系列", "xfc");
categoryMap.put("吸污车系列", "xwc");
categoryMap.put("垃圾车系列", "ljc");
categoryMap.put("随车起重运输车系列", "scqzc");
categoryMap.put("随车起重运输车", "scqzc");
categoryMap.put("高压清洗车系列", "gyqxc");
categoryMap.put("高压清洗车", "gyqxc");
categoryMap.put("高空作业车系列", "gkzyc");
categoryMap.put("高空作业车", "gkzyc");
categoryMap.put("清障车系列", "qzc");
categoryMap.put("防暴车系列", "fbc");
categoryMap.put("扫路车系列", "slc");
categoryMap.put("半挂车系列", "bgc");
categoryMap.put("教练车系列", "jlc");
categoryMap.put("化工液体运输车", "hgytysc");
categoryMap.put("粉粒物料运输车", "flwlysc");
categoryMap.put("自卸车系列", "zxc");
categoryMap.put("平板运输车", "pbysc");
categoryMap.put("厢式运输车", "xsysc");
categoryMap.put("仓栅式运输车", "csysc");
categoryMap.put("消防车系列", "xfc");
categoryMap.put("冷藏车系列", "ncc");
categoryMap.put("专用车配件", "zyc");
categoryMap.put("液化气储罐系列", "ycgc");
categoryMap.put("搅拌车系列", "jbc");
categoryMap.put("防爆车系列", "fbc");
}
public static String getCategoryValue(String key) {
return categoryMap.get(key);
}
}
|
UTF-8
|
Java
| 1,927 |
java
|
CategoryUtil.java
|
Java
|
[
{
"context": ":com.tzc.biz.util\n * @版权:Copyright (c)2012\n * @作者:limeng\n * @时间:Oct 16, 20123:19:47 PM\n */\npackage com.tzc",
"end": 94,
"score": 0.9996310472488403,
"start": 88,
"tag": "USERNAME",
"value": "limeng"
},
{
"context": "ashMap;\nimport java.util.Map;\n\n/**\n * @描述:\n * @作者:limeng\n * @创建时间:Oct 16, 20123:19:47 PM\n */\npublic class ",
"end": 230,
"score": 0.9996529221534729,
"start": 224,
"tag": "USERNAME",
"value": "limeng"
}
] | null |
[] |
/**
* @文件名称:CategoryUtil.java
* @类路径:com.tzc.biz.util
* @版权:Copyright (c)2012
* @作者:limeng
* @时间:Oct 16, 20123:19:47 PM
*/
package com.tzc.biz.util;
import java.util.HashMap;
import java.util.Map;
/**
* @描述:
* @作者:limeng
* @创建时间:Oct 16, 20123:19:47 PM
*/
public class CategoryUtil {
private static Map<String, String> categoryMap = new HashMap<String, String>();
static {
categoryMap.put("油罐车系列", "ygc");
categoryMap.put("洒水车系列", "ssc");
categoryMap.put("散装水泥车系列", "szsnc");
categoryMap.put("吸粪车系列", "xfc");
categoryMap.put("吸污车系列", "xwc");
categoryMap.put("垃圾车系列", "ljc");
categoryMap.put("随车起重运输车系列", "scqzc");
categoryMap.put("随车起重运输车", "scqzc");
categoryMap.put("高压清洗车系列", "gyqxc");
categoryMap.put("高压清洗车", "gyqxc");
categoryMap.put("高空作业车系列", "gkzyc");
categoryMap.put("高空作业车", "gkzyc");
categoryMap.put("清障车系列", "qzc");
categoryMap.put("防暴车系列", "fbc");
categoryMap.put("扫路车系列", "slc");
categoryMap.put("半挂车系列", "bgc");
categoryMap.put("教练车系列", "jlc");
categoryMap.put("化工液体运输车", "hgytysc");
categoryMap.put("粉粒物料运输车", "flwlysc");
categoryMap.put("自卸车系列", "zxc");
categoryMap.put("平板运输车", "pbysc");
categoryMap.put("厢式运输车", "xsysc");
categoryMap.put("仓栅式运输车", "csysc");
categoryMap.put("消防车系列", "xfc");
categoryMap.put("冷藏车系列", "ncc");
categoryMap.put("专用车配件", "zyc");
categoryMap.put("液化气储罐系列", "ycgc");
categoryMap.put("搅拌车系列", "jbc");
categoryMap.put("防爆车系列", "fbc");
}
public static String getCategoryValue(String key) {
return categoryMap.get(key);
}
}
| 1,927 | 0.653273 | 0.636423 | 56 | 26.553572 | 15.854156 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.357143 | false | false |
12
|
acb627f5801798286e997a935d085da0cb84a9ac
| 24,876,450,594,144 |
00fd1aca2678c43ac63e93245d0b7017233724dd
|
/app/src/main/java/com/viewpagersample/sei/viewpagersample/viewpager/third/viewholder/ThirdVHItemTwo.java
|
a7368fd6dddb9f94febcb2ec1fbe67a7b58c45ee
|
[] |
no_license
|
ggalage/ViewPagerSample
|
https://github.com/ggalage/ViewPagerSample
|
a047210aec5304a3418f15a620ba8594d21d0ae2
|
83c80776f29bc785dfc4a71edf600fc44374815e
|
refs/heads/master
| 2020-12-03T00:11:01.738000 | 2017-07-02T02:32:33 | 2017-07-02T02:32:33 | 95,997,355 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.viewpagersample.sei.viewpagersample.viewpager.third.viewholder;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;
import com.google.auto.factory.AutoFactory;
import com.viewpagersample.sei.viewpagersample.R;
import com.viewpagersample.sei.viewpagersample.viewpager.third.ThirdController;
import com.viewpagersample.sei.viewpagersample.viewpager.third.data.ThirdData;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by sei on 7/1/17.
*/
@AutoFactory(implementing = ThirdVHFactory.class)
public class ThirdVHItemTwo extends ThirdVH {
@BindView(R.id.third_controller_vh_item_two) TextView textView;
private ThirdController thirdController;
public ThirdVHItemTwo(ViewGroup parent, ThirdController thirdController) {
super(LayoutInflater.from(parent.getContext()).inflate(R.layout.third_vh_item_two, parent,
false));
this.thirdController = thirdController;
ButterKnife.bind(this, itemView);
}
@Override
public void bind(ThirdData data) {
if (data.text != null) {
textView.setText(data.text);
}
}
}
|
UTF-8
|
Java
| 1,187 |
java
|
ThirdVHItemTwo.java
|
Java
|
[
{
"context": "import butterknife.ButterKnife;\n\n/**\n * Created by sei on 7/1/17.\n */\n\n@AutoFactory(implementing = Third",
"end": 514,
"score": 0.9837777018547058,
"start": 511,
"tag": "USERNAME",
"value": "sei"
}
] | null |
[] |
package com.viewpagersample.sei.viewpagersample.viewpager.third.viewholder;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.TextView;
import com.google.auto.factory.AutoFactory;
import com.viewpagersample.sei.viewpagersample.R;
import com.viewpagersample.sei.viewpagersample.viewpager.third.ThirdController;
import com.viewpagersample.sei.viewpagersample.viewpager.third.data.ThirdData;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by sei on 7/1/17.
*/
@AutoFactory(implementing = ThirdVHFactory.class)
public class ThirdVHItemTwo extends ThirdVH {
@BindView(R.id.third_controller_vh_item_two) TextView textView;
private ThirdController thirdController;
public ThirdVHItemTwo(ViewGroup parent, ThirdController thirdController) {
super(LayoutInflater.from(parent.getContext()).inflate(R.layout.third_vh_item_two, parent,
false));
this.thirdController = thirdController;
ButterKnife.bind(this, itemView);
}
@Override
public void bind(ThirdData data) {
if (data.text != null) {
textView.setText(data.text);
}
}
}
| 1,187 | 0.747262 | 0.743892 | 38 | 30.236841 | 27.369244 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.526316 | false | false |
12
|
1115e89808024299f078b4fbdc59c8b45362eb70
| 22,909,355,583,544 |
92614242d041ceef6a5b2fe4caaa522142f91e9c
|
/app/src/main/java/mx/jovannypcg/shortener/links/LinksPresenter.java
|
25cea7e6fe08fe8a9263d640797058e7cdc33f6e
|
[] |
no_license
|
jovannypcg/shortener_android
|
https://github.com/jovannypcg/shortener_android
|
cc67e95918d447edc14e1d088f7e1f700d696ebd
|
4a7ee1a08c535ab7679f8bb12ab4265de1b2c4b0
|
refs/heads/master
| 2021-06-16T21:39:00.518000 | 2017-05-25T03:57:31 | 2017-05-25T03:57:31 | 92,224,362 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package mx.jovannypcg.shortener.links;
/**
* Provides the methods which contain the logic to handle LinksActivity.
*
* @author Jovanny Pablo Cruz Gomez
* Software Engineer
* jovannypcg@yahoo.com
*/
public interface LinksPresenter {
/** Handles the request to retrieve the bunch of short links from the api. */
void submitRequest();
/**
* Action to execute when an item in the list view is clicked.
*
* @param slug Slug contained in the list view (by position).
*/
void handleClickedSlug(String slug);
}
|
UTF-8
|
Java
| 566 |
java
|
LinksPresenter.java
|
Java
|
[
{
"context": " the logic to handle LinksActivity.\n *\n * @author Jovanny Pablo Cruz Gomez\n * Software Engineer\n * jovanny",
"end": 156,
"score": 0.9998852014541626,
"start": 132,
"tag": "NAME",
"value": "Jovanny Pablo Cruz Gomez"
},
{
"context": "uz Gomez\n * Software Engineer\n * jovannypcg@yahoo.com\n */\npublic interface LinksPresenter {\n /** Han",
"end": 219,
"score": 0.9999322891235352,
"start": 199,
"tag": "EMAIL",
"value": "jovannypcg@yahoo.com"
}
] | null |
[] |
package mx.jovannypcg.shortener.links;
/**
* Provides the methods which contain the logic to handle LinksActivity.
*
* @author <NAME>
* Software Engineer
* <EMAIL>
*/
public interface LinksPresenter {
/** Handles the request to retrieve the bunch of short links from the api. */
void submitRequest();
/**
* Action to execute when an item in the list view is clicked.
*
* @param slug Slug contained in the list view (by position).
*/
void handleClickedSlug(String slug);
}
| 535 | 0.669611 | 0.669611 | 20 | 27.299999 | 25.977106 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | false | false |
12
|
28af74bda32702427a004470596154577e03e52f
| 16,441,134,818,305 |
e7c4ecf70c7439e40484b9ff9ee450289fe16310
|
/farrago/src/net/sf/farrago/jdbc/engine/FarragoJdbcEnginePreparedStatement.java
|
19297e5f560fc65f39e4208d7d920b3c06961585
|
[
"GPL-1.0-or-later",
"Apache-2.0",
"GPL-2.0-only"
] |
permissive
|
jomedinas7/luciddb
|
https://github.com/jomedinas7/luciddb
|
51cf161301a1452a1248c7ec630952f7a6136404
|
55bfa3d5a8788c9d17c531fa367558f37f41b7ae
|
refs/heads/master
| 2023-08-10T16:14:38.585000 | 2021-09-14T01:42:54 | 2021-09-14T01:42:54 | 406,180,598 | 0 | 0 |
Apache-2.0
| true | 2021-09-14T01:16:37 | 2021-09-14T01:16:37 | 2020-05-13T14:18:33 | 2020-10-01T16:44:57 | 105,872 | 0 | 0 | 0 | null | false | false |
/*
// Licensed to DynamoBI Corporation (DynamoBI) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. DynamoBI licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
*/
package net.sf.farrago.jdbc.engine;
import java.io.*;
import java.math.*;
import java.net.*;
import java.sql.*;
import java.sql.Date;
import java.util.*;
import net.sf.farrago.session.*;
import org.eigenbase.jdbc4.*;
/**
* FarragoJdbcEnginePreparedStatement is an abstract base for Farrago
* implementations of {@link java.sql.PreparedStatement}. Subclasses define
* details of preparation for DDL, DML, and queries.
*
* @author John V. Sichi
* @version $Id$
*/
public abstract class FarragoJdbcEnginePreparedStatement
extends FarragoJdbcEngineStatement
implements PreparedStatement
{
//~ Static fields/initializers ---------------------------------------------
protected static final String ERRMSG_ALREADY_PREPARED =
"Statement already prepared";
//~ Instance fields --------------------------------------------------------
protected String sql;
//~ Constructors -----------------------------------------------------------
/**
* Creates a new FarragoJdbcEnginePreparedStatement object.
*
* @param connection the connection creating this statement
* @param stmtContext underlying FarragoSessionStmtContext
* @param sql the text of the SQL statement
*/
protected FarragoJdbcEnginePreparedStatement(
FarragoJdbcEngineConnection connection,
FarragoSessionStmtContext stmtContext,
String sql)
{
super(connection, stmtContext);
this.sql = sql;
}
//~ Methods ----------------------------------------------------------------
// implement PreparedStatement
public ResultSetMetaData getMetaData()
throws SQLException
{
throw new SQLException(ERRMSG_NOT_A_QUERY + sql);
}
// implement PreparedStatement
public ParameterMetaData getParameterMetaData()
throws SQLException
{
throw new SQLException(ERRMSG_NOT_A_QUERY + sql);
}
// implement PreparedStatement
public void clearParameters()
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setNull(
int parameterIndex,
int sqlType)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setBoolean(
int parameterIndex,
boolean x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setByte(
int parameterIndex,
byte x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setShort(
int parameterIndex,
short x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setInt(
int parameterIndex,
int x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setLong(
int parameterIndex,
long x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setFloat(
int parameterIndex,
float x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setDouble(
int parameterIndex,
double x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setBigDecimal(
int parameterIndex,
BigDecimal x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setString(
int parameterIndex,
String x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setBytes(
int parameterIndex,
byte [] x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setDate(
int parameterIndex,
Date x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setTime(
int parameterIndex,
Time x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setTimestamp(
int parameterIndex,
Timestamp x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setAsciiStream(
int parameterIndex,
InputStream x,
int length)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setUnicodeStream(
int parameterIndex,
InputStream x,
int length)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setBinaryStream(
int parameterIndex,
InputStream x,
int length)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setObject(
int parameterIndex,
Object x,
int targetSqlType,
int scale)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setObject(
int parameterIndex,
Object x,
int targetSqlType)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setObject(
int parameterIndex,
Object x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setCharacterStream(
int parameterIndex,
Reader reader,
int length)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setRef(
int i,
Ref x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setBlob(
int i,
Blob x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setClob(
int i,
Clob x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setArray(
int i,
Array x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setDate(
int parameterIndex,
Date x,
Calendar cal)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setTime(
int parameterIndex,
Time x,
Calendar cal)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setTimestamp(
int parameterIndex,
Timestamp x,
Calendar cal)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setNull(
int paramIndex,
int sqlType,
String typeName)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setURL(
int parameterIndex,
URL x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement Statement: disallow for PreparedStatements
public void addBatch()
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public void clearBatch()
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public void setEscapeProcessing(boolean enable)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public void addBatch(String sql)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public int [] executeBatch()
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public ResultSet executeQuery(String sql)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public boolean execute(String sql)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public boolean execute(
String sql,
int autoGeneratedKeys)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public boolean execute(
String sql,
int [] columnIndexes)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public boolean execute(
String sql,
String [] columnNames)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public int executeUpdate(String sql)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public int executeUpdate(
String sql,
int autoGeneratedKeys)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public int executeUpdate(
String sql,
int [] columnIndexes)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public int executeUpdate(
String sql,
String [] columnNames)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
//
// begin JDBC 4 methods
//
// implement PreparedStatement
public void setCharacterStream(int i, Reader reader)
throws SQLException
{
throw new UnsupportedOperationException("setCharacterStream");
}
// implement PreparedStatement
public void setCharacterStream(int i, Reader reader, long len)
throws SQLException
{
throw new UnsupportedOperationException("setCharacterStream");
}
// implement PreparedStatement
public void setNCharacterStream(int i, Reader reader)
throws SQLException
{
throw new UnsupportedOperationException("setNCharacterStream");
}
// implement PreparedStatement
public void setNCharacterStream(int i, Reader reader, long len)
throws SQLException
{
throw new UnsupportedOperationException("setNCharacterStream");
}
// implement PreparedStatement
public void setClob(int i, Reader reader)
throws SQLException
{
throw new UnsupportedOperationException("setClob");
}
// implement PreparedStatement
public void setClob(int i, Reader reader, long len)
throws SQLException
{
throw new UnsupportedOperationException("setClob");
}
// implement PreparedStatement
public void setNClob(int i, Reader reader)
throws SQLException
{
throw new UnsupportedOperationException("setNClob");
}
// implement PreparedStatement
public void setNClob(int i, NClob nclob)
throws SQLException
{
throw new UnsupportedOperationException("setNClob");
}
// implement PreparedStatement
public void setNClob(int i, Reader reader, long len)
throws SQLException
{
throw new UnsupportedOperationException("setNClob");
}
// implement PreparedStatement
public void setBlob(int i, InputStream inputStream)
throws SQLException
{
throw new UnsupportedOperationException("setBlob");
}
// implement PreparedStatement
public void setBlob(int i, InputStream inputStream, long len)
throws SQLException
{
throw new UnsupportedOperationException("setBlob");
}
// implement PreparedStatement
public void setBinaryStream(int i, InputStream inputStream)
throws SQLException
{
throw new UnsupportedOperationException("setBinaryStream");
}
// implement PreparedStatement
public void setBinaryStream(int i, InputStream inputStream, long len)
throws SQLException
{
throw new UnsupportedOperationException("setBinaryStream");
}
// implement PreparedStatement
public void setAsciiStream(int i, InputStream inputStream)
throws SQLException
{
throw new UnsupportedOperationException("setAsciiStream");
}
// implement PreparedStatement
public void setAsciiStream(int i, InputStream inputStream, long len)
throws SQLException
{
throw new UnsupportedOperationException("setAsciiStream");
}
// implement PreparedStatement
public void setSQLXML(int i, SQLXML sqlxml)
throws SQLException
{
throw new UnsupportedOperationException("setSQLXML");
}
// implement PreparedStatement
public void setNString(int i, String nstring)
throws SQLException
{
throw new UnsupportedOperationException("setNString");
}
// implement PreparedStatement
public void setRowId(int i, RowId rowid)
throws SQLException
{
throw new UnsupportedOperationException("setRowId");
}
//
// end JDBC 4 methods
//
}
// End FarragoJdbcEnginePreparedStatement.java
|
UTF-8
|
Java
| 15,807 |
java
|
FarragoJdbcEnginePreparedStatement.java
|
Java
|
[
{
"context": "eparation for DDL, DML, and queries.\n *\n * @author John V. Sichi\n * @version $Id$\n */\npublic abstract class Farrag",
"end": 1255,
"score": 0.9990936517715454,
"start": 1242,
"tag": "NAME",
"value": "John V. Sichi"
}
] | null |
[] |
/*
// Licensed to DynamoBI Corporation (DynamoBI) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. DynamoBI licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
*/
package net.sf.farrago.jdbc.engine;
import java.io.*;
import java.math.*;
import java.net.*;
import java.sql.*;
import java.sql.Date;
import java.util.*;
import net.sf.farrago.session.*;
import org.eigenbase.jdbc4.*;
/**
* FarragoJdbcEnginePreparedStatement is an abstract base for Farrago
* implementations of {@link java.sql.PreparedStatement}. Subclasses define
* details of preparation for DDL, DML, and queries.
*
* @author <NAME>
* @version $Id$
*/
public abstract class FarragoJdbcEnginePreparedStatement
extends FarragoJdbcEngineStatement
implements PreparedStatement
{
//~ Static fields/initializers ---------------------------------------------
protected static final String ERRMSG_ALREADY_PREPARED =
"Statement already prepared";
//~ Instance fields --------------------------------------------------------
protected String sql;
//~ Constructors -----------------------------------------------------------
/**
* Creates a new FarragoJdbcEnginePreparedStatement object.
*
* @param connection the connection creating this statement
* @param stmtContext underlying FarragoSessionStmtContext
* @param sql the text of the SQL statement
*/
protected FarragoJdbcEnginePreparedStatement(
FarragoJdbcEngineConnection connection,
FarragoSessionStmtContext stmtContext,
String sql)
{
super(connection, stmtContext);
this.sql = sql;
}
//~ Methods ----------------------------------------------------------------
// implement PreparedStatement
public ResultSetMetaData getMetaData()
throws SQLException
{
throw new SQLException(ERRMSG_NOT_A_QUERY + sql);
}
// implement PreparedStatement
public ParameterMetaData getParameterMetaData()
throws SQLException
{
throw new SQLException(ERRMSG_NOT_A_QUERY + sql);
}
// implement PreparedStatement
public void clearParameters()
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setNull(
int parameterIndex,
int sqlType)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setBoolean(
int parameterIndex,
boolean x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setByte(
int parameterIndex,
byte x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setShort(
int parameterIndex,
short x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setInt(
int parameterIndex,
int x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setLong(
int parameterIndex,
long x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setFloat(
int parameterIndex,
float x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setDouble(
int parameterIndex,
double x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setBigDecimal(
int parameterIndex,
BigDecimal x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setString(
int parameterIndex,
String x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setBytes(
int parameterIndex,
byte [] x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setDate(
int parameterIndex,
Date x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setTime(
int parameterIndex,
Time x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setTimestamp(
int parameterIndex,
Timestamp x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setAsciiStream(
int parameterIndex,
InputStream x,
int length)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setUnicodeStream(
int parameterIndex,
InputStream x,
int length)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setBinaryStream(
int parameterIndex,
InputStream x,
int length)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setObject(
int parameterIndex,
Object x,
int targetSqlType,
int scale)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setObject(
int parameterIndex,
Object x,
int targetSqlType)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setObject(
int parameterIndex,
Object x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setCharacterStream(
int parameterIndex,
Reader reader,
int length)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setRef(
int i,
Ref x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setBlob(
int i,
Blob x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setClob(
int i,
Clob x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setArray(
int i,
Array x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setDate(
int parameterIndex,
Date x,
Calendar cal)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setTime(
int parameterIndex,
Time x,
Calendar cal)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setTimestamp(
int parameterIndex,
Timestamp x,
Calendar cal)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setNull(
int paramIndex,
int sqlType,
String typeName)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement PreparedStatement
public void setURL(
int parameterIndex,
URL x)
throws SQLException
{
throw new UnsupportedOperationException();
}
// implement Statement: disallow for PreparedStatements
public void addBatch()
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public void clearBatch()
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public void setEscapeProcessing(boolean enable)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public void addBatch(String sql)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public int [] executeBatch()
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public ResultSet executeQuery(String sql)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public boolean execute(String sql)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public boolean execute(
String sql,
int autoGeneratedKeys)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public boolean execute(
String sql,
int [] columnIndexes)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public boolean execute(
String sql,
String [] columnNames)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public int executeUpdate(String sql)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public int executeUpdate(
String sql,
int autoGeneratedKeys)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public int executeUpdate(
String sql,
int [] columnIndexes)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
// implement Statement: disallow for PreparedStatements
public int executeUpdate(
String sql,
String [] columnNames)
throws SQLException
{
throw new SQLException(ERRMSG_ALREADY_PREPARED);
}
//
// begin JDBC 4 methods
//
// implement PreparedStatement
public void setCharacterStream(int i, Reader reader)
throws SQLException
{
throw new UnsupportedOperationException("setCharacterStream");
}
// implement PreparedStatement
public void setCharacterStream(int i, Reader reader, long len)
throws SQLException
{
throw new UnsupportedOperationException("setCharacterStream");
}
// implement PreparedStatement
public void setNCharacterStream(int i, Reader reader)
throws SQLException
{
throw new UnsupportedOperationException("setNCharacterStream");
}
// implement PreparedStatement
public void setNCharacterStream(int i, Reader reader, long len)
throws SQLException
{
throw new UnsupportedOperationException("setNCharacterStream");
}
// implement PreparedStatement
public void setClob(int i, Reader reader)
throws SQLException
{
throw new UnsupportedOperationException("setClob");
}
// implement PreparedStatement
public void setClob(int i, Reader reader, long len)
throws SQLException
{
throw new UnsupportedOperationException("setClob");
}
// implement PreparedStatement
public void setNClob(int i, Reader reader)
throws SQLException
{
throw new UnsupportedOperationException("setNClob");
}
// implement PreparedStatement
public void setNClob(int i, NClob nclob)
throws SQLException
{
throw new UnsupportedOperationException("setNClob");
}
// implement PreparedStatement
public void setNClob(int i, Reader reader, long len)
throws SQLException
{
throw new UnsupportedOperationException("setNClob");
}
// implement PreparedStatement
public void setBlob(int i, InputStream inputStream)
throws SQLException
{
throw new UnsupportedOperationException("setBlob");
}
// implement PreparedStatement
public void setBlob(int i, InputStream inputStream, long len)
throws SQLException
{
throw new UnsupportedOperationException("setBlob");
}
// implement PreparedStatement
public void setBinaryStream(int i, InputStream inputStream)
throws SQLException
{
throw new UnsupportedOperationException("setBinaryStream");
}
// implement PreparedStatement
public void setBinaryStream(int i, InputStream inputStream, long len)
throws SQLException
{
throw new UnsupportedOperationException("setBinaryStream");
}
// implement PreparedStatement
public void setAsciiStream(int i, InputStream inputStream)
throws SQLException
{
throw new UnsupportedOperationException("setAsciiStream");
}
// implement PreparedStatement
public void setAsciiStream(int i, InputStream inputStream, long len)
throws SQLException
{
throw new UnsupportedOperationException("setAsciiStream");
}
// implement PreparedStatement
public void setSQLXML(int i, SQLXML sqlxml)
throws SQLException
{
throw new UnsupportedOperationException("setSQLXML");
}
// implement PreparedStatement
public void setNString(int i, String nstring)
throws SQLException
{
throw new UnsupportedOperationException("setNString");
}
// implement PreparedStatement
public void setRowId(int i, RowId rowid)
throws SQLException
{
throw new UnsupportedOperationException("setRowId");
}
//
// end JDBC 4 methods
//
}
// End FarragoJdbcEnginePreparedStatement.java
| 15,800 | 0.646612 | 0.646169 | 625 | 24.291201 | 20.522963 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.256 | false | false |
12
|
366cedd6b2dd4ce4e218bb29853d55fcc8da037e
| 30,399,778,582,859 |
9195a1a3e7aa45a152d1a1ee991049d3791c393b
|
/2017/perpenanto_versions/Perpenanto(ServletAPI)/src/main/java/com/romanidze/perpenanto/models/AddressToUser.java
|
eefd89f465d6a37cdd8a7423ac0f6727f0f456b3
|
[] |
no_license
|
Roomanidzee/java_projects
|
https://github.com/Roomanidzee/java_projects
|
6b8eb032d69570db7e503cea8e8bc7ca970d58f3
|
1e1efaae18da99363a707921da2cef0d5fb72f71
|
refs/heads/master
| 2021-01-20T00:33:09.534000 | 2018-12-09T14:51:34 | 2018-12-09T14:51:34 | 89,147,861 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.romanidze.perpenanto.models;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Getter
@Setter
@AllArgsConstructor
@Builder
@EqualsAndHashCode
@ToString
public class AddressToUser {
private Long id;
private Long userId;
private String country;
private Integer postalCode;
private String city;
private String street;
private Integer homeNumber;
}
|
UTF-8
|
Java
| 498 |
java
|
AddressToUser.java
|
Java
|
[
{
"context": "package com.romanidze.perpenanto.models;\n\nimport lombok.AllArgsConstruc",
"end": 21,
"score": 0.6960833072662354,
"start": 17,
"tag": "USERNAME",
"value": "idze"
}
] | null |
[] |
package com.romanidze.perpenanto.models;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Getter
@Setter
@AllArgsConstructor
@Builder
@EqualsAndHashCode
@ToString
public class AddressToUser {
private Long id;
private Long userId;
private String country;
private Integer postalCode;
private String city;
private String street;
private Integer homeNumber;
}
| 498 | 0.781124 | 0.781124 | 26 | 18.153847 | 11.818149 | 40 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.538462 | false | false |
12
|
dfe333319d83c797670c2f62bb2e7066f98f8e33
| 26,250,840,131,383 |
0e738eaf784084b28aeb8917834ed9ba63728454
|
/Exam/src/main/java/com/richfit/caq/exam/util/UserCacheUtils.java
|
1ba1e07761d206a516e59494bbfa0110fc80db20
|
[] |
no_license
|
guowei1021/git-test
|
https://github.com/guowei1021/git-test
|
3cd33cbfffc767633d0a464dda1a07531a6cf915
|
78a683c868e1a5f12c37f24227e46afa02a1c5e2
|
refs/heads/master
| 2020-04-19T11:27:18.212000 | 2019-03-08T16:37:02 | 2019-03-08T16:37:02 | 168,167,748 | 0 | 0 | null | false | 2019-01-29T15:22:28 | 2019-01-29T14:24:56 | 2019-01-29T14:54:23 | 2019-01-29T15:22:27 | 0 | 0 | 0 | 0 |
Java
| false | null |
package com.richfit.caq.exam.util;
import com.richfit.caq.comm.exception.BusinessException;
/**
* 工具类:获取redis中缓存的用户数据
* @author XueMancang (If you want to change this class, please contact me first!)
*/
public class UserCacheUtils {
/**
* 获取当前登录人登录名
* @return
* @throws BusinessException
*/
public static String getUserLoginName() throws BusinessException {
/* String loginName = UserUtils.getLoginName();
if(loginName==null || loginName==""){
throw new BusinessException("已离线,请重新登陆!");
}
return "loginName";*/
return "tangl";
}
/**
* 获取当前登录人用户id
* @return
* @throws BusinessException
*/
public static String getUserId() throws BusinessException {
/* String UserId = UserUtils.getUser().getId();
if(UserId==null || UserId==""){
throw new BusinessException("已离线,请重新登陆!");
}
return UserId;*/
return "b1dfd5b5ef9a4cb4a269c4c753a08c71";
}
/**
* 获取当前登录人员工姓名
* @return
* @throws BusinessException
*/
public static String getUserEmployeeName() {
/* String employeeName = UserUtils.getEmployeeName();
return employeeName;*/
return "汤黎";
}
/**
* 获取当前登录人员工ucode
* @return
* @throws BusinessException
*/
public static String getUserEmployeeUcode() {
/* String employeeUcode = UserUtils.getEmployeeUcode();
return employeeUcode;*/
return "574146a9d4fc41b1a6f45ec20380d502";
}
}
|
UTF-8
|
Java
| 1,508 |
java
|
UserCacheUtils.java
|
Java
|
[
{
"context": "sException;\n\n/**\n * 工具类:获取redis中缓存的用户数据\n * @author XueMancang (If you want to change this class, pleas",
"end": 132,
"score": 0.6356096863746643,
"start": 131,
"tag": "NAME",
"value": "X"
},
{
"context": "xception;\n\n/**\n * 工具类:获取redis中缓存的用户数据\n * @author XueMancang (If you want to change this class, please con",
"end": 137,
"score": 0.6641552448272705,
"start": 132,
"tag": "USERNAME",
"value": "ueMan"
},
{
"context": "ion;\n\n/**\n * 工具类:获取redis中缓存的用户数据\n * @author XueMancang (If you want to change this class, please contact",
"end": 141,
"score": 0.6169768571853638,
"start": 137,
"tag": "NAME",
"value": "cang"
},
{
"context": "mployeeName();\n\t\treturn employeeName;*/\n\t\treturn \"汤黎\";\n\t}\n\t\n\t/**\n\t * 获取当前登录人员工ucode\n\t * @return\n\t * @t",
"end": 1095,
"score": 0.9158985614776611,
"start": 1093,
"tag": "NAME",
"value": "汤黎"
}
] | null |
[] |
package com.richfit.caq.exam.util;
import com.richfit.caq.comm.exception.BusinessException;
/**
* 工具类:获取redis中缓存的用户数据
* @author XueMancang (If you want to change this class, please contact me first!)
*/
public class UserCacheUtils {
/**
* 获取当前登录人登录名
* @return
* @throws BusinessException
*/
public static String getUserLoginName() throws BusinessException {
/* String loginName = UserUtils.getLoginName();
if(loginName==null || loginName==""){
throw new BusinessException("已离线,请重新登陆!");
}
return "loginName";*/
return "tangl";
}
/**
* 获取当前登录人用户id
* @return
* @throws BusinessException
*/
public static String getUserId() throws BusinessException {
/* String UserId = UserUtils.getUser().getId();
if(UserId==null || UserId==""){
throw new BusinessException("已离线,请重新登陆!");
}
return UserId;*/
return "b1dfd5b5ef9a4cb4a269c4c753a08c71";
}
/**
* 获取当前登录人员工姓名
* @return
* @throws BusinessException
*/
public static String getUserEmployeeName() {
/* String employeeName = UserUtils.getEmployeeName();
return employeeName;*/
return "汤黎";
}
/**
* 获取当前登录人员工ucode
* @return
* @throws BusinessException
*/
public static String getUserEmployeeUcode() {
/* String employeeUcode = UserUtils.getEmployeeUcode();
return employeeUcode;*/
return "574146a9d4fc41b1a6f45ec20380d502";
}
}
| 1,508 | 0.698085 | 0.669367 | 59 | 22.016949 | 20.557066 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.576271 | false | false |
12
|
967c7952664911ddb74d7f844c88959d26beef3b
| 18,502,719,157,875 |
d2dd8a0d7ce3bfd65ed80d6f969cb52196f734a9
|
/src/automail/Statistics.java
|
6883570197600151281b07d39ad295ab8ac85cb3
|
[] |
no_license
|
amriteshs/automail
|
https://github.com/amriteshs/automail
|
179f318fabbda2a1bfc254225bebc60c5156c80b
|
488d56e6109fd7304bc3a0e4128121989ec43c58
|
refs/heads/master
| 2022-11-11T12:17:56.893000 | 2020-06-28T03:06:13 | 2020-06-28T03:06:13 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package automail;
public class Statistics {
private static int packagesNormal = 0;
private static int packagesCaution = 0;
private static int weightNormal = 0;
private static int weightCaution = 0;
private static int timeWrap = 0;
private static int timeUnwrap = 0;
public static int packagesNormal() {
return packagesNormal;
}
public static void packagesNormalIncrement() {
packagesNormal++;
}
public static int packagesCaution() {
return packagesCaution;
}
public static void packagesCautionIncrement() {
packagesCaution++;
}
public static int weightNormal() {
return weightNormal;
}
public static void weightNormalIncrement(int weight) {
weightNormal += weight;
}
public static int weightCaution() {
return weightCaution;
}
public static void weightCautionIncrement(int weight) {
weightCaution += weight;
}
public static int timeWrap() {
return timeWrap;
}
public static void timeWrapIncrement() {
timeWrap += 2;
}
public static int timeUnwrap() {
return timeUnwrap;
}
public static void timeUnwrapIncrement() {
timeUnwrap++;
}
}
|
UTF-8
|
Java
| 1,270 |
java
|
Statistics.java
|
Java
|
[] | null |
[] |
package automail;
public class Statistics {
private static int packagesNormal = 0;
private static int packagesCaution = 0;
private static int weightNormal = 0;
private static int weightCaution = 0;
private static int timeWrap = 0;
private static int timeUnwrap = 0;
public static int packagesNormal() {
return packagesNormal;
}
public static void packagesNormalIncrement() {
packagesNormal++;
}
public static int packagesCaution() {
return packagesCaution;
}
public static void packagesCautionIncrement() {
packagesCaution++;
}
public static int weightNormal() {
return weightNormal;
}
public static void weightNormalIncrement(int weight) {
weightNormal += weight;
}
public static int weightCaution() {
return weightCaution;
}
public static void weightCautionIncrement(int weight) {
weightCaution += weight;
}
public static int timeWrap() {
return timeWrap;
}
public static void timeWrapIncrement() {
timeWrap += 2;
}
public static int timeUnwrap() {
return timeUnwrap;
}
public static void timeUnwrapIncrement() {
timeUnwrap++;
}
}
| 1,270 | 0.633858 | 0.628346 | 58 | 20.896551 | 17.370893 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.534483 | false | false |
12
|
fa5fab5ba9637af774715db4894f292f27b0fb9e
| 6,554,120,123,268 |
754ee0b90a87dfa34d06c98444ed7a08c2859df1
|
/src/main/java/bean/PessoasBean.java
|
ab42984b22363d271b158229843dd9601c5d8997
|
[] |
no_license
|
betolicks/AgendaPolitica
|
https://github.com/betolicks/AgendaPolitica
|
d6db52c0d287aa67e909d5ed72caefdb749ca95a
|
7f8da0f20de039e77deb9510a8eb459aaeecd747
|
refs/heads/master
| 2021-01-11T04:36:02.621000 | 2018-02-19T11:11:40 | 2018-02-19T11:11:40 | 71,110,102 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package bean;
import entidade.Pessoas;
import javax.faces.bean.ManagedBean;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.SessionScoped;
import org.hibernate.Session;
import org.hibernate.Transaction;
import util.*;
/********************************************************************************************************************
* @author Beto Licks
* Outubro / 2016
********************************************************************************************************************/
@ManagedBean
@SessionScoped
public class PessoasBean {
private Pessoas pessoas = new Pessoas();
private List<Pessoas> lstpessoas = new ArrayList<>();
private String tipoGrava;
//--------------------------------------------------------------------------------------------------------
//-> PREPARAÇÃO DOS CAMPOS PARA INCLUSÃO
//--------------------------------------------------------------------------------------------------------
public String preparaCampos(){
tipoGrava = "incluir";
limpaCampos();
return "formpessoas";
}
//--------------------------------------------------------------------------------------------------------
//-> DADOS PARA ALTERAÇÃO
//--------------------------------------------------------------------------------------------------------
public String dadosPessoa(Pessoas p){
tipoGrava = "alterar";
pessoas = p;
return "formpessoas";
}
//--------------------------------------------------------------------------------------------------------
//-> BOTÃO VOLTAR
//--------------------------------------------------------------------------------------------------------
public String voltaPessoas(){
return "pessoas";
}
//--------------------------------------------------------------------------------------------------------
//-> INICIAL
//--------------------------------------------------------------------------------------------------------
public PessoasBean(){
limpaCampos();
listaPessoas();
}
//--------------------------------------------------------------------------------------------------------
//-> LIMPA CAMPOS
//--------------------------------------------------------------------------------------------------------
private void limpaCampos(){
pessoas.setId(null);
pessoas.setNome(null);
pessoas.setTelefones(null);
pessoas.setEndereco(null);
pessoas.setApelido(null);
pessoas.setComplemento(null);
pessoas.setEmail(null);
pessoas.setBairro(null);
}
//--------------------------------------------------------------------------------------------------------
//-> LISTAGEM
//--------------------------------------------------------------------------------------------------------
private void listaPessoas(){
Session sessao = HibernateUtil.getSessionFactory().openSession();
try {
lstpessoas = sessao.createCriteria(Pessoas.class).list();
} catch (Exception e) {
System.out.println("* * * ERRO AO MONTAR PESQUISA: "+e.getMessage());
}
}
//--------------------------------------------------------------------------------------------------------
//-> EXLCUIR
//--------------------------------------------------------------------------------------------------------
public void excluiPessoa(Pessoas pes){
Session sessao = HibernateUtil.getSessionFactory().openSession();
try {
Transaction transacao = sessao.getTransaction();
transacao.begin();
sessao.delete(pes);
transacao.commit();
Funcoes.Mensagem("Regitro excluído com sucesso.");
limpaCampos();
listaPessoas();
} catch (Exception e) {
} finally {
sessao.close();
}
}
//--------------------------------------------------------------------------------------------------------
//-> GRAVA
//--------------------------------------------------------------------------------------------------------
public String salvaPessoa(){
Session sessao = HibernateUtil.getSessionFactory().openSession();
try {
Transaction transacao = sessao.getTransaction();
transacao.begin();
//-> VERIFICO O TIPO DE GRAVAÇÃO
if (tipoGrava.equals("incluir")){
sessao.save(pessoas);
Funcoes.Mensagem("Regitro incluído com sucesso.");
}
if (tipoGrava.equals("alterar")) {
sessao.update(pessoas);
Funcoes.Mensagem("Regitro alterado com sucesso.");
}
transacao.commit();
limpaCampos();
listaPessoas();
} catch (Exception e) {
System.out.println("* * * ERRO AO GRAVAR: "+e.getMessage());
} finally {
sessao.close();
}
return "pessoas";
}
public Pessoas getPessoas() {
return pessoas;
}
public void setPessoas(Pessoas pessoas) {
this.pessoas = pessoas;
}
public List<Pessoas> getLstpessoas() {
return lstpessoas;
}
public void setLstpessoas(List<Pessoas> lstpessoas) {
this.lstpessoas = lstpessoas;
}
}
|
UTF-8
|
Java
| 5,541 |
java
|
PessoasBean.java
|
Java
|
[
{
"context": "***************************************\n * @author Beto Licks\n * Outubro / 2016\n ******************************",
"end": 386,
"score": 0.9998356103897095,
"start": 376,
"tag": "NAME",
"value": "Beto Licks"
}
] | null |
[] |
package bean;
import entidade.Pessoas;
import javax.faces.bean.ManagedBean;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.SessionScoped;
import org.hibernate.Session;
import org.hibernate.Transaction;
import util.*;
/********************************************************************************************************************
* @author <NAME>
* Outubro / 2016
********************************************************************************************************************/
@ManagedBean
@SessionScoped
public class PessoasBean {
private Pessoas pessoas = new Pessoas();
private List<Pessoas> lstpessoas = new ArrayList<>();
private String tipoGrava;
//--------------------------------------------------------------------------------------------------------
//-> PREPARAÇÃO DOS CAMPOS PARA INCLUSÃO
//--------------------------------------------------------------------------------------------------------
public String preparaCampos(){
tipoGrava = "incluir";
limpaCampos();
return "formpessoas";
}
//--------------------------------------------------------------------------------------------------------
//-> DADOS PARA ALTERAÇÃO
//--------------------------------------------------------------------------------------------------------
public String dadosPessoa(Pessoas p){
tipoGrava = "alterar";
pessoas = p;
return "formpessoas";
}
//--------------------------------------------------------------------------------------------------------
//-> BOTÃO VOLTAR
//--------------------------------------------------------------------------------------------------------
public String voltaPessoas(){
return "pessoas";
}
//--------------------------------------------------------------------------------------------------------
//-> INICIAL
//--------------------------------------------------------------------------------------------------------
public PessoasBean(){
limpaCampos();
listaPessoas();
}
//--------------------------------------------------------------------------------------------------------
//-> LIMPA CAMPOS
//--------------------------------------------------------------------------------------------------------
private void limpaCampos(){
pessoas.setId(null);
pessoas.setNome(null);
pessoas.setTelefones(null);
pessoas.setEndereco(null);
pessoas.setApelido(null);
pessoas.setComplemento(null);
pessoas.setEmail(null);
pessoas.setBairro(null);
}
//--------------------------------------------------------------------------------------------------------
//-> LISTAGEM
//--------------------------------------------------------------------------------------------------------
private void listaPessoas(){
Session sessao = HibernateUtil.getSessionFactory().openSession();
try {
lstpessoas = sessao.createCriteria(Pessoas.class).list();
} catch (Exception e) {
System.out.println("* * * ERRO AO MONTAR PESQUISA: "+e.getMessage());
}
}
//--------------------------------------------------------------------------------------------------------
//-> EXLCUIR
//--------------------------------------------------------------------------------------------------------
public void excluiPessoa(Pessoas pes){
Session sessao = HibernateUtil.getSessionFactory().openSession();
try {
Transaction transacao = sessao.getTransaction();
transacao.begin();
sessao.delete(pes);
transacao.commit();
Funcoes.Mensagem("Regitro excluído com sucesso.");
limpaCampos();
listaPessoas();
} catch (Exception e) {
} finally {
sessao.close();
}
}
//--------------------------------------------------------------------------------------------------------
//-> GRAVA
//--------------------------------------------------------------------------------------------------------
public String salvaPessoa(){
Session sessao = HibernateUtil.getSessionFactory().openSession();
try {
Transaction transacao = sessao.getTransaction();
transacao.begin();
//-> VERIFICO O TIPO DE GRAVAÇÃO
if (tipoGrava.equals("incluir")){
sessao.save(pessoas);
Funcoes.Mensagem("Regitro incluído com sucesso.");
}
if (tipoGrava.equals("alterar")) {
sessao.update(pessoas);
Funcoes.Mensagem("Regitro alterado com sucesso.");
}
transacao.commit();
limpaCampos();
listaPessoas();
} catch (Exception e) {
System.out.println("* * * ERRO AO GRAVAR: "+e.getMessage());
} finally {
sessao.close();
}
return "pessoas";
}
public Pessoas getPessoas() {
return pessoas;
}
public void setPessoas(Pessoas pessoas) {
this.pessoas = pessoas;
}
public List<Pessoas> getLstpessoas() {
return lstpessoas;
}
public void setLstpessoas(List<Pessoas> lstpessoas) {
this.lstpessoas = lstpessoas;
}
}
| 5,537 | 0.356355 | 0.355632 | 153 | 35.156864 | 32.320721 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.379085 | false | false |
12
|
2cb43f258b385dbdab4ec47c1d036f26f8a17e29
| 15,848,429,361,798 |
63b59cc4e2f59533637f6121c140cef563ba51c6
|
/src/com/centennialcollege/comp228_lesson13/Program.java
|
a170ba5bb6ba6debe5a024f2787f9531a1c1d5ea
|
[] |
no_license
|
SyedKazmi5/COMP228-Lesson13
|
https://github.com/SyedKazmi5/COMP228-Lesson13
|
4fead36e3af2495a4963550715e31d155cb21d27
|
afb9a7e04e7b8d25b66c7276b84d43f010773c74
|
refs/heads/master
| 2021-01-10T15:03:49.455000 | 2015-12-09T00:06:54 | 2015-12-09T00:06:54 | 47,641,381 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.centennialcollege.comp228_lesson13;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Program {
public static void main(String[] args) {
// TODO Auto-generated method stub
//MyThread thread1 = new MyThread("1");
//MyThread thread2 = new MyThread("2");
MyRunnable myRunable1 = new MyRunnable("1");
MyRunnable myRunable2 = new MyRunnable("2");
ExecutorService executor = Executors.newFixedThreadPool(3);
executor.execute(myRunable1);
executor.execute(myRunable2);
//Thread thread1 = new Thread(myRunable1);
//Thread thread2 = new Thread(myRunable2);
//thread1.start(); //start secondary thread1
//thread2.start(); //start secondary thread1
//start main operation
for(int index=0; index<10; index++){
System.out.println("Main Count: " + index);
try {
Thread.sleep(1000); //wait for 1000 ms =1 second
if (index>5){
//thread1.interrupt();
}
} catch (InterruptedException exception) {
// TODO Auto-generated catch block
System.err.println("Thread Interrupted" + exception);
}
}
executor.shutdown();
}
}
|
UTF-8
|
Java
| 1,244 |
java
|
Program.java
|
Java
|
[] | null |
[] |
package com.centennialcollege.comp228_lesson13;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Program {
public static void main(String[] args) {
// TODO Auto-generated method stub
//MyThread thread1 = new MyThread("1");
//MyThread thread2 = new MyThread("2");
MyRunnable myRunable1 = new MyRunnable("1");
MyRunnable myRunable2 = new MyRunnable("2");
ExecutorService executor = Executors.newFixedThreadPool(3);
executor.execute(myRunable1);
executor.execute(myRunable2);
//Thread thread1 = new Thread(myRunable1);
//Thread thread2 = new Thread(myRunable2);
//thread1.start(); //start secondary thread1
//thread2.start(); //start secondary thread1
//start main operation
for(int index=0; index<10; index++){
System.out.println("Main Count: " + index);
try {
Thread.sleep(1000); //wait for 1000 ms =1 second
if (index>5){
//thread1.interrupt();
}
} catch (InterruptedException exception) {
// TODO Auto-generated catch block
System.err.println("Thread Interrupted" + exception);
}
}
executor.shutdown();
}
}
| 1,244 | 0.664791 | 0.634244 | 47 | 24.468084 | 20.241995 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.297872 | false | false |
12
|
b8389c394c29490e6d3175d169d1e4b799df4319
| 19,232,863,588,317 |
3277069ad7b426f18dc4769a281d7d5b84f48131
|
/common/src/main/java/com/navispeed/greg/common/StoredData.java
|
b90ce541304708f0fe4a7e7908b7365440aa80f1
|
[] |
no_license
|
mugbubule/citizen_android
|
https://github.com/mugbubule/citizen_android
|
2b3452776d456f1b59727eb0f8770322d14f1cd1
|
1b237ac5ba06c7e1fbb34c0de24df36d30e47205
|
refs/heads/master
| 2021-04-03T01:56:30.644000 | 2018-11-20T16:19:29 | 2018-11-20T16:19:29 | 124,834,857 | 0 | 0 | null | false | 2018-11-20T16:19:31 | 2018-03-12T04:46:52 | 2018-09-27T13:04:52 | 2018-11-20T16:19:30 | 8,192 | 0 | 0 | 0 |
Java
| false | null |
package com.navispeed.greg.common;
/* Created by jonas_e on 20/02/2018. */
import android.content.SharedPreferences;
import org.json.JSONObject;
import java.util.HashSet;
import java.util.Set;
public class StoredData {
private static StoredData instance = null;
private SharedPreferences sharedPreferences;
private String accessToken;
private String refreshToken;
private Set<String> notifications;
private Set<String> votedPolls = new HashSet<>();
private boolean logged;
public void setLogged(boolean logged) {
this.logged = logged;
}
public boolean getLogged() {
return this.logged;
}
private StoredData() {
}
public Set<String> getVotedPolls() {
return votedPolls;
}
public void addVotedPolls(String uuid) {
votedPolls.add(uuid);
}
/* public String votedPollsToString() {
StringBuilder store = new StringBuilder();
Object[] data = votedPolls.toArray();
for (int i = 0; i < votedPolls.size(); i++) {
store.append(data[i].toString());
store.append(",");
}
return store.toString();
}*/
public void init(SharedPreferences sharedPreferences) {
this.sharedPreferences = sharedPreferences;
accessToken = sharedPreferences.getString("accessToken", "placeholder if not initizalized");
refreshToken = sharedPreferences.getString("refreshToken", "placeholder if not initizalized");
APICaller.refreshTokenOnInit();
notifications = sharedPreferences.getStringSet("notifications", new HashSet<String>());
votedPolls = sharedPreferences.getStringSet("votedPolls", votedPolls);
}
public void close() {
sharedPreferences.edit().putString("accessToken", accessToken).apply();
sharedPreferences.edit().putString("refreshToken", refreshToken).apply();
sharedPreferences.edit().putStringSet("notifications", notifications).apply();
sharedPreferences.edit().putStringSet("votedPolls", votedPolls).apply();
}
public static synchronized StoredData getInstance() {
if(instance == null){
instance = new StoredData();
}
return instance;
}
public String getAccessToken() {
return accessToken;
}
public String getRefreshToken() {
return refreshToken;
}
public Set<String> getNotifications() {
if (notifications == null)
notifications = new HashSet<>();
return notifications;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
public void setNotifications(Set<String> notifications) {
this.notifications = notifications;
}
}
|
UTF-8
|
Java
| 2,866 |
java
|
StoredData.java
|
Java
|
[
{
"context": "package com.navispeed.greg.common;\n/* Created by jonas_e on 20/02/2018. */\n\nimport android.content.SharedP",
"end": 56,
"score": 0.9994910955429077,
"start": 49,
"tag": "USERNAME",
"value": "jonas_e"
}
] | null |
[] |
package com.navispeed.greg.common;
/* Created by jonas_e on 20/02/2018. */
import android.content.SharedPreferences;
import org.json.JSONObject;
import java.util.HashSet;
import java.util.Set;
public class StoredData {
private static StoredData instance = null;
private SharedPreferences sharedPreferences;
private String accessToken;
private String refreshToken;
private Set<String> notifications;
private Set<String> votedPolls = new HashSet<>();
private boolean logged;
public void setLogged(boolean logged) {
this.logged = logged;
}
public boolean getLogged() {
return this.logged;
}
private StoredData() {
}
public Set<String> getVotedPolls() {
return votedPolls;
}
public void addVotedPolls(String uuid) {
votedPolls.add(uuid);
}
/* public String votedPollsToString() {
StringBuilder store = new StringBuilder();
Object[] data = votedPolls.toArray();
for (int i = 0; i < votedPolls.size(); i++) {
store.append(data[i].toString());
store.append(",");
}
return store.toString();
}*/
public void init(SharedPreferences sharedPreferences) {
this.sharedPreferences = sharedPreferences;
accessToken = sharedPreferences.getString("accessToken", "placeholder if not initizalized");
refreshToken = sharedPreferences.getString("refreshToken", "placeholder if not initizalized");
APICaller.refreshTokenOnInit();
notifications = sharedPreferences.getStringSet("notifications", new HashSet<String>());
votedPolls = sharedPreferences.getStringSet("votedPolls", votedPolls);
}
public void close() {
sharedPreferences.edit().putString("accessToken", accessToken).apply();
sharedPreferences.edit().putString("refreshToken", refreshToken).apply();
sharedPreferences.edit().putStringSet("notifications", notifications).apply();
sharedPreferences.edit().putStringSet("votedPolls", votedPolls).apply();
}
public static synchronized StoredData getInstance() {
if(instance == null){
instance = new StoredData();
}
return instance;
}
public String getAccessToken() {
return accessToken;
}
public String getRefreshToken() {
return refreshToken;
}
public Set<String> getNotifications() {
if (notifications == null)
notifications = new HashSet<>();
return notifications;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
public void setNotifications(Set<String> notifications) {
this.notifications = notifications;
}
}
| 2,866 | 0.659107 | 0.655967 | 97 | 28.546392 | 25.657949 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.525773 | false | false |
12
|
fd7213b89425b7aa6b3270f9c315cf9afb4bac10
| 27,650,999,498,001 |
f3c9eba3c6e84602195643f2347f5aadede94675
|
/eRestaurant/src/main/java/com/softwarestudiogroup1/uts/eRestaurant/controllers/manager/StaffDAO.java
|
d79378c8c438bf419ac590fa3ae1ebc530b5093a
|
[] |
no_license
|
johnnycuongn/rRestaurant
|
https://github.com/johnnycuongn/rRestaurant
|
a413453a1faa3468f29d18b3fdd3fca8bc0a3788
|
78a2531df5f2c2380c262064234de45a05c62eb5
|
refs/heads/main
| 2023-05-03T17:58:21.849000 | 2021-05-24T08:33:44 | 2021-05-24T08:33:44 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.softwarestudiogroup1.uts.eRestaurant.controllers.manager;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class StaffDAO {
private int id;
private String telephone;
private String password;
private String email;
private String username;
private String firstName;
private String lastName;
private String description;
private double hourlyWage;
// private String dateOfBirth;
private String shiftType;
private ArrayList<StaffDAO> staff;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getDescription() {
return description;
}
public void setdescription(String description) {
this.description = description;
}
public double getHourlyWage(){
return hourlyWage;
}
public void setHourlyWage(double hourlyWage){
this.hourlyWage = hourlyWage;
}
// private final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
// public void setDate(String datesString) {
// setDate(datesString);
// }
// public Date getDateOfBirth() {
// try {
// return DATE_TIME_FORMAT.parse(dateOfBirth);
// } catch (ParseException e) {
// throw new IllegalArgumentException(e);
// }
// }
public String getShiftType(){
return shiftType;
}
public void setShiftType(String shiftType) {
this.shiftType = shiftType;
}
public void setStaff(ArrayList<StaffDAO> staff) {
this.staff = staff;
}
public ArrayList<StaffDAO> getStaff() {
return staff;
}
}
|
UTF-8
|
Java
| 2,705 |
java
|
StaffDAO.java
|
Java
|
[
{
"context": "\n\n public String getUsername() {\n return username;\n }\n\n public void setUsername(String userna",
"end": 1219,
"score": 0.9836336374282837,
"start": 1211,
"tag": "USERNAME",
"value": "username"
},
{
"context": "sername(String username) {\n this.username = username;\n }\n\n public String getFirstName() {\n ",
"end": 1307,
"score": 0.9836238622665405,
"start": 1299,
"tag": "USERNAME",
"value": "username"
}
] | null |
[] |
package com.softwarestudiogroup1.uts.eRestaurant.controllers.manager;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class StaffDAO {
private int id;
private String telephone;
private String password;
private String email;
private String username;
private String firstName;
private String lastName;
private String description;
private double hourlyWage;
// private String dateOfBirth;
private String shiftType;
private ArrayList<StaffDAO> staff;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getDescription() {
return description;
}
public void setdescription(String description) {
this.description = description;
}
public double getHourlyWage(){
return hourlyWage;
}
public void setHourlyWage(double hourlyWage){
this.hourlyWage = hourlyWage;
}
// private final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
// public void setDate(String datesString) {
// setDate(datesString);
// }
// public Date getDateOfBirth() {
// try {
// return DATE_TIME_FORMAT.parse(dateOfBirth);
// } catch (ParseException e) {
// throw new IllegalArgumentException(e);
// }
// }
public String getShiftType(){
return shiftType;
}
public void setShiftType(String shiftType) {
this.shiftType = shiftType;
}
public void setStaff(ArrayList<StaffDAO> staff) {
this.staff = staff;
}
public ArrayList<StaffDAO> getStaff() {
return staff;
}
}
| 2,705 | 0.627726 | 0.627357 | 126 | 20.476191 | 18.413122 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.349206 | false | false |
12
|
d4d20f774363fee07e4c9fe8a985bafb0b91e861
| 5,841,155,542,347 |
2dbb2fa06cf5b4ec79859d89f10661208f94bdf6
|
/carAdmin/src/main/java/com/xawl/car/controller/MaintainbusinessContorller.java
|
4e04e2de62be79bc68bcc6491feaed13aacdbac9
|
[] |
no_license
|
VinceLz/carAdmin
|
https://github.com/VinceLz/carAdmin
|
70f36ef045f5d5243ad450874370ef50b2419c1e
|
e8bdae01ac5b96589e3d20dd8b56aeb94619672b
|
refs/heads/master
| 2020-06-10T23:57:07.204000 | 2017-06-19T09:46:30 | 2017-06-19T09:47:53 | 75,837,862 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.xawl.car.controller;
import com.xawl.car.pojo.DbMaintainbusiness;
import com.xawl.car.service.MaintainbusinessService;
import com.xawl.car.utils.CarResult;
import com.xawl.car.utils.PageResult;
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.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
/**
* Created by Administrator on 2017/3/22.
*/
@RequestMapping("/maintainbusiness")
@Controller
public class MaintainbusinessContorller {
@Autowired
private MaintainbusinessService maintainbusinessService;
@RequestMapping("/getall.action")
@ResponseBody
public PageResult getAll(Integer page) {
PageResult result = maintainbusinessService.getAll(page);
return result;
}
@RequestMapping(value = "/add.action", method = RequestMethod.POST)
@ResponseBody
public CarResult addHome(DbMaintainbusiness dbMaintainbusiness) {
CarResult result = maintainbusinessService
.insertDbMaintainbusiness(dbMaintainbusiness);
return result;
}
@RequestMapping("/delete.action")
@ResponseBody
public CarResult deleteHome(Integer mbid, HttpServletRequest request) {
CarResult result = maintainbusinessService.deleteDbMaintainbusiness(
mbid, request);
return result;
}
@RequestMapping(value = "/update.action")
@ResponseBody
public CarResult updateHome(DbMaintainbusiness dbMaintainbusiness) {
CarResult result = maintainbusinessService
.updateDbMaintainbusiness(dbMaintainbusiness);
return result;
}
// @RequestMapping(value = "/updateMPass.action")
// @ResponseBody
// public CarResult updateMPass(Integer mbid) {
// CarResult result = maintainbusinessService.updateDbMaintainbusinessPassWord(mbid);
// return result;
// }
}
|
UTF-8
|
Java
| 1,985 |
java
|
MaintainbusinessContorller.java
|
Java
|
[] | null |
[] |
package com.xawl.car.controller;
import com.xawl.car.pojo.DbMaintainbusiness;
import com.xawl.car.service.MaintainbusinessService;
import com.xawl.car.utils.CarResult;
import com.xawl.car.utils.PageResult;
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.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
/**
* Created by Administrator on 2017/3/22.
*/
@RequestMapping("/maintainbusiness")
@Controller
public class MaintainbusinessContorller {
@Autowired
private MaintainbusinessService maintainbusinessService;
@RequestMapping("/getall.action")
@ResponseBody
public PageResult getAll(Integer page) {
PageResult result = maintainbusinessService.getAll(page);
return result;
}
@RequestMapping(value = "/add.action", method = RequestMethod.POST)
@ResponseBody
public CarResult addHome(DbMaintainbusiness dbMaintainbusiness) {
CarResult result = maintainbusinessService
.insertDbMaintainbusiness(dbMaintainbusiness);
return result;
}
@RequestMapping("/delete.action")
@ResponseBody
public CarResult deleteHome(Integer mbid, HttpServletRequest request) {
CarResult result = maintainbusinessService.deleteDbMaintainbusiness(
mbid, request);
return result;
}
@RequestMapping(value = "/update.action")
@ResponseBody
public CarResult updateHome(DbMaintainbusiness dbMaintainbusiness) {
CarResult result = maintainbusinessService
.updateDbMaintainbusiness(dbMaintainbusiness);
return result;
}
// @RequestMapping(value = "/updateMPass.action")
// @ResponseBody
// public CarResult updateMPass(Integer mbid) {
// CarResult result = maintainbusinessService.updateDbMaintainbusinessPassWord(mbid);
// return result;
// }
}
| 1,985 | 0.775315 | 0.771788 | 64 | 29.015625 | 24.614841 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.28125 | false | false |
12
|
8f0c2850fa05902ab362d1a9e17c25635ec00178
| 25,512,105,764,344 |
947fc9eef832e937f09f04f1abd82819cd4f97d3
|
/src/apk/com/bumptech/glide/load/a/d.java
|
2e61d2bb2e625926c145f80776c17eed353783b0
|
[] |
no_license
|
thistehneisen/cifra
|
https://github.com/thistehneisen/cifra
|
04f4ac1b230289f8262a0b9cf7448a1172d8f979
|
d46c6f4764c9d4f64e45c56fa42fddee9b44ff5a
|
refs/heads/master
| 2020-09-22T09:35:57.739000 | 2019-12-01T19:39:59 | 2019-12-01T19:39:59 | 225,136,583 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.bumptech.glide.load.a;
import com.bumptech.glide.j;
/* compiled from: DataFetcher */
public interface d<T> {
/* compiled from: DataFetcher */
public interface a<T> {
void a(Exception exc);
void a(T t);
}
Class<T> a();
void a(j jVar, a<? super T> aVar);
void b();
com.bumptech.glide.load.a c();
void cancel();
}
|
UTF-8
|
Java
| 380 |
java
|
d.java
|
Java
|
[] | null |
[] |
package com.bumptech.glide.load.a;
import com.bumptech.glide.j;
/* compiled from: DataFetcher */
public interface d<T> {
/* compiled from: DataFetcher */
public interface a<T> {
void a(Exception exc);
void a(T t);
}
Class<T> a();
void a(j jVar, a<? super T> aVar);
void b();
com.bumptech.glide.load.a c();
void cancel();
}
| 380 | 0.578947 | 0.578947 | 24 | 14.833333 | 14.354635 | 38 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.416667 | false | false |
12
|
44ba70c2e7cd4196873a5de50f00c4fcdf1d36d0
| 15,564,961,491,478 |
900d3ca59f963984c4fac936e8d912e6e489176b
|
/app/src/main/java/devicroft/tripcalculator/Trip.java
|
378db762b2b3df1c225daa14ffd39a222f88f950
|
[
"Apache-2.0"
] |
permissive
|
mewc/TripCalculator
|
https://github.com/mewc/TripCalculator
|
c5db60a1787721a83925394568939b8ce9466cda
|
0c7ef256a68f9b9e40894e0bd02a04601d0cc8f9
|
refs/heads/master
| 2021-06-18T17:49:01.790000 | 2017-03-08T00:24:19 | 2017-03-08T00:24:19 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package devicroft.tripcalculator;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
/**
* Created by m on 07-Mar-17.
*/
public class Trip {
double distance;
double efficiency;
double price;
public Trip(double d, double e, double p) {
super();
distance = d;
efficiency = e;
price = p;
}
public double getTripCost() {
//TODO incorporate locality
return round(getFuelUsage() * price, 2);
}
public double getFuelUsage(){
return efficiency * (distance / 100);
}
//stackoverflow.com/questions/2808535/round-a-double-to-2-decimal-places
private static double round(double value, int places) {
if (places < 0) throw new IllegalArgumentException();
BigDecimal bd = new BigDecimal(value);
bd = bd.setScale(places, RoundingMode.HALF_UP);
return bd.doubleValue();
}
}
|
UTF-8
|
Java
| 992 |
java
|
Trip.java
|
Java
|
[
{
"context": "ort java.text.DecimalFormat;\r\n\r\n/**\r\n * Created by m on 07-Mar-17.\r\n */\r\n\r\npublic class Trip {\r\n\r\n ",
"end": 154,
"score": 0.9931621551513672,
"start": 153,
"tag": "USERNAME",
"value": "m"
}
] | null |
[] |
package devicroft.tripcalculator;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
/**
* Created by m on 07-Mar-17.
*/
public class Trip {
double distance;
double efficiency;
double price;
public Trip(double d, double e, double p) {
super();
distance = d;
efficiency = e;
price = p;
}
public double getTripCost() {
//TODO incorporate locality
return round(getFuelUsage() * price, 2);
}
public double getFuelUsage(){
return efficiency * (distance / 100);
}
//stackoverflow.com/questions/2808535/round-a-double-to-2-decimal-places
private static double round(double value, int places) {
if (places < 0) throw new IllegalArgumentException();
BigDecimal bd = new BigDecimal(value);
bd = bd.setScale(places, RoundingMode.HALF_UP);
return bd.doubleValue();
}
}
| 992 | 0.604839 | 0.587702 | 44 | 20.545454 | 20.387669 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
12
|
6716a5eafb5592a64062725a486965c9a62da78c
| 489,626,287,821 |
1485bc08b897a4513437f98749b66c5be1699a9a
|
/src/main/java/controller/user/WordsRelatedC.java
|
c19b0d75499fa664e6b5c2261916c26800bfb45b
|
[] |
no_license
|
DuGun/blog
|
https://github.com/DuGun/blog
|
39ff7fc7d9f9b3b13d535dffda06d24293b353c3
|
38bfa941a3312023dd5445b96d830ac3226e97c6
|
refs/heads/master
| 2022-12-23T19:29:12.648000 | 2020-02-06T14:37:38 | 2020-02-06T14:37:38 | 203,352,156 | 0 | 0 | null | false | 2022-12-16T00:37:22 | 2019-08-20T10:18:37 | 2020-02-06T14:37:43 | 2022-12-16T00:37:19 | 67,180 | 0 | 0 | 16 |
Java
| false | false |
package controller.user;
import bean.Words;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.user.WordsRelated;
import util.ResponseBean;
import javax.annotation.Resource;
import java.util.List;
/**
* @author 脐橙
* @data 2019-09-05 20:30
* @Email 847033093@qq.com
*/
@Controller
@RequestMapping("user")
public class WordsRelatedC {
@Resource
WordsRelated wordsRelated;
@Resource
ResponseBean responseBean;
/**
* 用于获取一句话
*
* @return 一句话List
*/
@GetMapping(value = "words/show")
@ResponseBody
public ResponseBean showWords(){
List<Words> wordsList=wordsRelated.getWords();
responseBean.setData(wordsList);
responseBean.setCode(ResponseBean.HTTP_CODE_OK);
responseBean.setMsg(null);
return responseBean;
}
}
|
UTF-8
|
Java
| 1,038 |
java
|
WordsRelatedC.java
|
Java
|
[
{
"context": ".Resource;\nimport java.util.List;\n\n/**\n * @author 脐橙\n * @data 2019-09-05 20:30\n * @Email 847033093@qq.",
"end": 415,
"score": 0.993201494216919,
"start": 413,
"tag": "NAME",
"value": "脐橙"
},
{
"context": " * @author 脐橙\n * @data 2019-09-05 20:30\n * @Email 847033093@qq.com\n */\n@Controller\n@RequestMapping(\"user\")\npublic cl",
"end": 468,
"score": 0.9998339414596558,
"start": 452,
"tag": "EMAIL",
"value": "847033093@qq.com"
}
] | null |
[] |
package controller.user;
import bean.Words;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.user.WordsRelated;
import util.ResponseBean;
import javax.annotation.Resource;
import java.util.List;
/**
* @author 脐橙
* @data 2019-09-05 20:30
* @Email <EMAIL>
*/
@Controller
@RequestMapping("user")
public class WordsRelatedC {
@Resource
WordsRelated wordsRelated;
@Resource
ResponseBean responseBean;
/**
* 用于获取一句话
*
* @return 一句话List
*/
@GetMapping(value = "words/show")
@ResponseBody
public ResponseBean showWords(){
List<Words> wordsList=wordsRelated.getWords();
responseBean.setData(wordsList);
responseBean.setCode(ResponseBean.HTTP_CODE_OK);
responseBean.setMsg(null);
return responseBean;
}
}
| 1,029 | 0.715976 | 0.695266 | 48 | 20.125 | 18.484932 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.354167 | false | false |
12
|
832aecc6700f156b6e0eba1125d4da7cf86b7d6c
| 1,546,188,243,175 |
844f9d4fc4243db454c8196e523f38cc0d25f109
|
/src/main/java/network/NetworkTraceException.java
|
34f78d01aaaf923faae1efecec08dd037d3b522f
|
[
"MIT"
] |
permissive
|
alwian/bn-support-tool
|
https://github.com/alwian/bn-support-tool
|
8712122d12195c619e74b8d9160b7146ad6a4e43
|
c5a8f0ff9ab077cad99e1cb1d1e969d2410aff43
|
refs/heads/main
| 2023-05-09T00:47:08.956000 | 2021-05-27T15:58:09 | 2021-05-27T15:58:09 | 356,374,804 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package network;
/**
* Custom exception for errors in network tracing.
* @author Alex Anderson
*/
public class NetworkTraceException extends Exception {
/**
* Constructor for a NetworkTraceException.
* @param message The error that occurred.
*/
public NetworkTraceException(final String message) {
super(message);
}
}
|
UTF-8
|
Java
| 357 |
java
|
NetworkTraceException.java
|
Java
|
[
{
"context": "xception for errors in network tracing.\n * @author Alex Anderson\n */\npublic class NetworkTraceException extends Ex",
"end": 97,
"score": 0.9991351962089539,
"start": 84,
"tag": "NAME",
"value": "Alex Anderson"
}
] | null |
[] |
package network;
/**
* Custom exception for errors in network tracing.
* @author <NAME>
*/
public class NetworkTraceException extends Exception {
/**
* Constructor for a NetworkTraceException.
* @param message The error that occurred.
*/
public NetworkTraceException(final String message) {
super(message);
}
}
| 350 | 0.686275 | 0.686275 | 15 | 22.799999 | 20.948191 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | false | false |
12
|
7e99e7aeb484c0108e1fa06f8f0350443087b321
| 28,346,784,174,901 |
60836518ad643e827a5e9a235cb403b25b313075
|
/dapenbi-accounting/src/main/java/id/co/dapenbi/accounting/service/impl/transaksi/JurnalBiayaService.java
|
c88a7f79d63cef221c2bd8902242787b614d2c8c
|
[] |
no_license
|
arraisi/DapenbiAkunting
|
https://github.com/arraisi/DapenbiAkunting
|
0fc440e660e583db7878f3b861a75b24dc770d05
|
d3182bebee6471ed6c76bac07492dce14c8716c3
|
refs/heads/main
| 2022-12-19T00:39:57.432000 | 2020-10-01T22:52:30 | 2020-10-01T22:52:30 | 300,444,210 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package id.co.dapenbi.accounting.service.impl.transaksi;
import commons.ui.datatables.DataTablesRequest;
import commons.ui.datatables.DataTablesResponse;
import id.co.dapenbi.accounting.dao.transaksi.JurnalBiayaDao;
import id.co.dapenbi.accounting.dto.transaksi.JurnalBiayaDTO;
import id.co.dapenbi.accounting.entity.transaksi.Warkat;
import id.co.dapenbi.accounting.entity.transaksi.WarkatJurnal;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
public class JurnalBiayaService {
@Autowired
private JurnalBiayaDao dao;
public DataTablesResponse<JurnalBiayaDTO> datatables(DataTablesRequest<JurnalBiayaDTO> params, String search) {
List<JurnalBiayaDTO> data = dao.datatable(params, search);
Long rowCount = dao.datatable(params.getValue(), search);
return new DataTablesResponse<>(data, params.getDraw(), rowCount, rowCount);
}
public List<WarkatJurnal> findJurnalBiayaDebits() {
return dao.findJurnalBiayaDebits();
}
}
|
UTF-8
|
Java
| 1,117 |
java
|
JurnalBiayaService.java
|
Java
|
[] | null |
[] |
package id.co.dapenbi.accounting.service.impl.transaksi;
import commons.ui.datatables.DataTablesRequest;
import commons.ui.datatables.DataTablesResponse;
import id.co.dapenbi.accounting.dao.transaksi.JurnalBiayaDao;
import id.co.dapenbi.accounting.dto.transaksi.JurnalBiayaDTO;
import id.co.dapenbi.accounting.entity.transaksi.Warkat;
import id.co.dapenbi.accounting.entity.transaksi.WarkatJurnal;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
public class JurnalBiayaService {
@Autowired
private JurnalBiayaDao dao;
public DataTablesResponse<JurnalBiayaDTO> datatables(DataTablesRequest<JurnalBiayaDTO> params, String search) {
List<JurnalBiayaDTO> data = dao.datatable(params, search);
Long rowCount = dao.datatable(params.getValue(), search);
return new DataTablesResponse<>(data, params.getDraw(), rowCount, rowCount);
}
public List<WarkatJurnal> findJurnalBiayaDebits() {
return dao.findJurnalBiayaDebits();
}
}
| 1,117 | 0.785139 | 0.782453 | 32 | 33.90625 | 30.077358 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6875 | false | false |
12
|
10bc816d2f4b8d261d138b5519527850b6e5dddf
| 11,733,850,671,743 |
27b0b66f2326f6e05e8f320262a2907773b4f83a
|
/cloud-consumer-order80/src/main/java/com/jzxy/MyRule/MySelfRule.java
|
de27077060615be0322bfce1fe1cadac919be1a9
|
[] |
no_license
|
zchstart/springcloud2020
|
https://github.com/zchstart/springcloud2020
|
6f1f1b59ebf95910ee2de187ea56bfbda1a22f00
|
ca783239d637295ba274107a8f5a57a16c95d705
|
refs/heads/master
| 2023-02-17T10:33:20.022000 | 2021-01-20T13:53:23 | 2021-01-20T13:53:23 | 330,701,293 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.jzxy.MyRule;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Description
* @Author zch
* @Date 2021/1/9 21:08
*/
@Configuration
public class MySelfRule {
@Bean
public IRule myRule(){
// 定义为随机规则
return new RandomRule();
}
}
|
UTF-8
|
Java
| 438 |
java
|
MySelfRule.java
|
Java
|
[
{
"context": "ion.Configuration;\n\n/**\n * @Description\n * @Author zch\n * @Date 2021/1/9 21:08\n */\n@Configuration\npublic",
"end": 257,
"score": 0.9997153282165527,
"start": 254,
"tag": "USERNAME",
"value": "zch"
}
] | null |
[] |
package com.jzxy.MyRule;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Description
* @Author zch
* @Date 2021/1/9 21:08
*/
@Configuration
public class MySelfRule {
@Bean
public IRule myRule(){
// 定义为随机规则
return new RandomRule();
}
}
| 438 | 0.71934 | 0.695755 | 20 | 20.200001 | 17.072199 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3 | false | false |
12
|
aa4789235c925487c4d98a6396cedca3a4afaf71
| 695,784,705,103 |
8d4b2fef110061e53e199cba361891ac62c7a6b1
|
/com/google/android/gms/p031b/iy.java
|
b8456fb6c3f03dbdd5cb491e6fa5b03211544941
|
[] |
no_license
|
ksvprasad/AndroidManagerv1
|
https://github.com/ksvprasad/AndroidManagerv1
|
ee9c5f7d76408689026625836a83b7896851a57f
|
0c928186a4da3f4f7bda32bec27e403e11bcceca
|
refs/heads/master
| 2021-01-21T14:28:36.157000 | 2017-06-24T09:32:53 | 2017-06-24T09:32:53 | 95,287,099 | 0 | 1 | null | false | 2017-06-24T09:32:53 | 2017-06-24T09:05:21 | 2017-06-24T09:23:47 | 2017-06-24T09:32:53 | 0 | 0 | 1 | 0 |
Java
| null | null |
package com.google.android.gms.p031b;
public interface iy {
void mo1454a(int i);
void mo1457c();
}
|
UTF-8
|
Java
| 109 |
java
|
iy.java
|
Java
|
[] | null |
[] |
package com.google.android.gms.p031b;
public interface iy {
void mo1454a(int i);
void mo1457c();
}
| 109 | 0.678899 | 0.577982 | 7 | 14.571428 | 13.425531 | 37 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false |
12
|
6712c328edf50364f5fda415d6f6810f0627fd77
| 11,149,735,106,993 |
68e31b696e48fbe09da37d7efcdd7d61d0ccda43
|
/javacore/src/main/java/java8/lamada/grammer/StringDemo.java
|
9cec6a871537c1f8b29532a14e342e06783fe0fe
|
[] |
no_license
|
weiandedidi/javaStu
|
https://github.com/weiandedidi/javaStu
|
851b362f3dd222ec13f80c746110e8b96b12190c
|
9ea5be02c35708154c55d95e194965fc0928fc04
|
refs/heads/master
| 2023-07-19T20:01:31.605000 | 2023-07-17T03:41:45 | 2023-07-17T03:41:45 | 104,423,116 | 0 | 0 | null | false | 2023-08-29T07:49:32 | 2017-09-22T02:41:32 | 2021-11-05T08:59:13 | 2023-08-29T07:49:30 | 1,878 | 0 | 0 | 2 |
Java
| false | false |
package java8.lamada.grammer;
import com.google.common.collect.Lists;
import org.w3c.dom.stylesheets.LinkStyle;
import java.util.List;
import java.util.stream.Collectors;
/**
* 占位符测试
*
* @author maqidi
* @date 2022/8/15 10:59 AM
*/
public class StringDemo {
public static void main(String[] args) {
List<String> a = Lists.newArrayList("a", "b");
String collect = a.stream().collect(Collectors.joining(","));
System.out.println(collect);
for (int i = 0; i < 5; i++) {
System.out.println(String.format("0%d", i));
}
System.out.println(String.format("总订单件数: %d; 机器拣货数量: %d", 10, 5));
}
}
|
UTF-8
|
Java
| 694 |
java
|
StringDemo.java
|
Java
|
[
{
"context": "til.stream.Collectors;\n\n/**\n * 占位符测试\n *\n * @author maqidi\n * @date 2022/8/15 10:59 AM\n */\npublic class Stri",
"end": 207,
"score": 0.9996585249900818,
"start": 201,
"tag": "USERNAME",
"value": "maqidi"
}
] | null |
[] |
package java8.lamada.grammer;
import com.google.common.collect.Lists;
import org.w3c.dom.stylesheets.LinkStyle;
import java.util.List;
import java.util.stream.Collectors;
/**
* 占位符测试
*
* @author maqidi
* @date 2022/8/15 10:59 AM
*/
public class StringDemo {
public static void main(String[] args) {
List<String> a = Lists.newArrayList("a", "b");
String collect = a.stream().collect(Collectors.joining(","));
System.out.println(collect);
for (int i = 0; i < 5; i++) {
System.out.println(String.format("0%d", i));
}
System.out.println(String.format("总订单件数: %d; 机器拣货数量: %d", 10, 5));
}
}
| 694 | 0.617825 | 0.589124 | 26 | 24.461538 | 22.29217 | 74 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.692308 | false | false |
12
|
84f91708a003a8a4f6b61b334faddbda6fee0f46
| 695,784,713,793 |
ea344095ec704a74be8a97aace1cd38872863303
|
/workspace/PBP3/src/main/java/com/buckwa/web/controller/admin/UserController.java
|
f512b320e4b02f7859977b110c180124a4601809
|
[] |
no_license
|
buckwa/BaiwaFramework
|
https://github.com/buckwa/BaiwaFramework
|
bf63a690ddb5518bb9bafd03d4cde8f1898c041c
|
fd89a0d0424f15ad58cd18681fc9e56451f2547b
|
refs/heads/master
| 2021-01-24T10:40:47.852000 | 2018-09-13T06:56:12 | 2018-09-13T06:56:12 | 70,311,217 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.buckwa.web.controller.admin;
import java.io.InputStream;
import org.slf4j.Logger;import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import com.buckwa.domain.BuckWaUser;
import com.buckwa.domain.admin.User;
import com.buckwa.domain.common.BuckWaRequest;
import com.buckwa.domain.common.BuckWaResponse;
import com.buckwa.domain.validator.ChangePasswordValidator;
import com.buckwa.domain.validator.UserValidator;
import com.buckwa.service.intf.admin.AdminUserService;
import com.buckwa.service.intf.admin.UserService;
import com.buckwa.util.BeanUtils;
import com.buckwa.util.BuckWaConstants;
import com.buckwa.util.BuckWaUtils;
import com.buckwa.util.FileUtils;
import com.buckwa.util.school.SchoolUtil;
@Controller
@RequestMapping("/user")
@SessionAttributes(types = User.class)
public class UserController {
private static Logger logger = LoggerFactory.getLogger(UserController.class);
@Autowired
private AdminUserService userService;
@Autowired
private SchoolUtil schoolUtil;
@RequestMapping(value = "/register.htm", method = RequestMethod.GET)
public ModelAndView initRegister() {
logger.info(" Start ");
ModelAndView mav = new ModelAndView();
mav.addObject("user", new User());
mav.setViewName("register");
return mav;
}
@RequestMapping(value = "/register.htm", method = RequestMethod.POST)
public ModelAndView submitRegister(@ModelAttribute(value = "user") User user, BindingResult result) {
logger.info(" Start ");
logger.info(" # user: "+BeanUtils.getBeanString(user));
ModelAndView mav = new ModelAndView();
new UserValidator().validate(user, result);
if (result.hasErrors()) {
logger.info(" Validate Error");
mav.setViewName("register");
}else {
mav.setViewName("registerSuccess");
}
return mav;
}
@RequestMapping(value = "/userProfile.htm", method = RequestMethod.GET)
public ModelAndView viewUserProfile( ) {
logger.info(" Start ");
ModelAndView mav = new ModelAndView();
mav.setViewName("userProfile");
try{
String username = BuckWaUtils.getUserNameFromContext();
logger.info("viewUserProfile username :"+username);
BuckWaRequest request = new BuckWaRequest();
request.put("username", username);
String academicYear =schoolUtil.getCurrentAcademicYear();
request.put("academicYear",academicYear);
BuckWaResponse response = userService.getUserByUsername(request);
if(response.getStatus()==BuckWaConstants.SUCCESS){
User user = (User)response.getResObj("user");
mav.addObject("user", user);
}else {
mav.addObject("errorCode", response.getErrorCode());
}
}catch(Exception ex){
ex.printStackTrace();
}
return mav;
}
@RequestMapping(value = "/changePassword.htm", method = RequestMethod.GET)
public ModelAndView changePassword( ) {
logger.info(" Start ");
ModelAndView mav = new ModelAndView();
mav.setViewName("changePassword");
try{
String username = BuckWaUtils.getUserNameFromContext();
logger.info("viewUserProfile username :"+username);
BuckWaRequest request = new BuckWaRequest();
request.put("username", username);
String academicYear =schoolUtil.getCurrentAcademicYear();
request.put("academicYear",academicYear);
BuckWaResponse response = userService.getUserByUsername(request);
if(response.getStatus()==BuckWaConstants.SUCCESS){
User user = (User)response.getResObj("user");
mav.addObject("user", user);
}else {
logger.info(" Fail !!!! :"+response.getErrorCode()+" : "+response.getErrorDesc());
mav.addObject("errorCode", response.getErrorCode());
}
}catch(Exception ex){
ex.printStackTrace();
}
return mav;
}
@RequestMapping(value = "/changePassword.htm", method = RequestMethod.POST)
public ModelAndView changePasswordSubmit(@ModelAttribute(value = "user") User user, BindingResult result ) {
logger.info(" Start ");
ModelAndView mav = new ModelAndView();
mav.setViewName("changePassword");
try{
new ChangePasswordValidator().validate(user, result);
if (result.hasErrors()) {
logger.info(" Validate Error");
}else {
// Check current password
BuckWaUser userContext = (BuckWaUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
logger.info(" userContext password:"+userContext.getPassword()+" Screen Password:"+BuckWaUtils.encrypt(user.getCurrentPassword()));
if(userContext.getPassword().equals(BuckWaUtils.encrypt(user.getCurrentPassword()))){
BuckWaRequest request = new BuckWaRequest();
request.put("user", user);
BuckWaResponse response = userService.changePassword(request);
if(response.getStatus()==BuckWaConstants.SUCCESS){
mav.addObject("successCode", response.getSuccessCode());
}else {
logger.info(" Fail !!!! :"+response.getErrorCode()+" : "+response.getErrorDesc());
mav.addObject("errorCode", response.getErrorCode());
}
}else{
mav.addObject("errorCode", "E007");
throw new Exception();
}
mav.setViewName("changePasswordSuccess");
}
}catch(Exception ex){
ex.printStackTrace();
}
return mav;
}
}
|
UTF-8
|
Java
| 5,851 |
java
|
UserController.java
|
Java
|
[
{
"context": " = new BuckWaRequest();\n\t\t\trequest.put(\"username\", username);\t\n\t\t\tString academicYear =schoolUtil.getCurrentA",
"end": 3773,
"score": 0.9987766146659851,
"start": 3765,
"tag": "USERNAME",
"value": "username"
}
] | null |
[] |
package com.buckwa.web.controller.admin;
import java.io.InputStream;
import org.slf4j.Logger;import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import com.buckwa.domain.BuckWaUser;
import com.buckwa.domain.admin.User;
import com.buckwa.domain.common.BuckWaRequest;
import com.buckwa.domain.common.BuckWaResponse;
import com.buckwa.domain.validator.ChangePasswordValidator;
import com.buckwa.domain.validator.UserValidator;
import com.buckwa.service.intf.admin.AdminUserService;
import com.buckwa.service.intf.admin.UserService;
import com.buckwa.util.BeanUtils;
import com.buckwa.util.BuckWaConstants;
import com.buckwa.util.BuckWaUtils;
import com.buckwa.util.FileUtils;
import com.buckwa.util.school.SchoolUtil;
@Controller
@RequestMapping("/user")
@SessionAttributes(types = User.class)
public class UserController {
private static Logger logger = LoggerFactory.getLogger(UserController.class);
@Autowired
private AdminUserService userService;
@Autowired
private SchoolUtil schoolUtil;
@RequestMapping(value = "/register.htm", method = RequestMethod.GET)
public ModelAndView initRegister() {
logger.info(" Start ");
ModelAndView mav = new ModelAndView();
mav.addObject("user", new User());
mav.setViewName("register");
return mav;
}
@RequestMapping(value = "/register.htm", method = RequestMethod.POST)
public ModelAndView submitRegister(@ModelAttribute(value = "user") User user, BindingResult result) {
logger.info(" Start ");
logger.info(" # user: "+BeanUtils.getBeanString(user));
ModelAndView mav = new ModelAndView();
new UserValidator().validate(user, result);
if (result.hasErrors()) {
logger.info(" Validate Error");
mav.setViewName("register");
}else {
mav.setViewName("registerSuccess");
}
return mav;
}
@RequestMapping(value = "/userProfile.htm", method = RequestMethod.GET)
public ModelAndView viewUserProfile( ) {
logger.info(" Start ");
ModelAndView mav = new ModelAndView();
mav.setViewName("userProfile");
try{
String username = BuckWaUtils.getUserNameFromContext();
logger.info("viewUserProfile username :"+username);
BuckWaRequest request = new BuckWaRequest();
request.put("username", username);
String academicYear =schoolUtil.getCurrentAcademicYear();
request.put("academicYear",academicYear);
BuckWaResponse response = userService.getUserByUsername(request);
if(response.getStatus()==BuckWaConstants.SUCCESS){
User user = (User)response.getResObj("user");
mav.addObject("user", user);
}else {
mav.addObject("errorCode", response.getErrorCode());
}
}catch(Exception ex){
ex.printStackTrace();
}
return mav;
}
@RequestMapping(value = "/changePassword.htm", method = RequestMethod.GET)
public ModelAndView changePassword( ) {
logger.info(" Start ");
ModelAndView mav = new ModelAndView();
mav.setViewName("changePassword");
try{
String username = BuckWaUtils.getUserNameFromContext();
logger.info("viewUserProfile username :"+username);
BuckWaRequest request = new BuckWaRequest();
request.put("username", username);
String academicYear =schoolUtil.getCurrentAcademicYear();
request.put("academicYear",academicYear);
BuckWaResponse response = userService.getUserByUsername(request);
if(response.getStatus()==BuckWaConstants.SUCCESS){
User user = (User)response.getResObj("user");
mav.addObject("user", user);
}else {
logger.info(" Fail !!!! :"+response.getErrorCode()+" : "+response.getErrorDesc());
mav.addObject("errorCode", response.getErrorCode());
}
}catch(Exception ex){
ex.printStackTrace();
}
return mav;
}
@RequestMapping(value = "/changePassword.htm", method = RequestMethod.POST)
public ModelAndView changePasswordSubmit(@ModelAttribute(value = "user") User user, BindingResult result ) {
logger.info(" Start ");
ModelAndView mav = new ModelAndView();
mav.setViewName("changePassword");
try{
new ChangePasswordValidator().validate(user, result);
if (result.hasErrors()) {
logger.info(" Validate Error");
}else {
// Check current password
BuckWaUser userContext = (BuckWaUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
logger.info(" userContext password:"+userContext.getPassword()+" Screen Password:"+BuckWaUtils.encrypt(user.getCurrentPassword()));
if(userContext.getPassword().equals(BuckWaUtils.encrypt(user.getCurrentPassword()))){
BuckWaRequest request = new BuckWaRequest();
request.put("user", user);
BuckWaResponse response = userService.changePassword(request);
if(response.getStatus()==BuckWaConstants.SUCCESS){
mav.addObject("successCode", response.getSuccessCode());
}else {
logger.info(" Fail !!!! :"+response.getErrorCode()+" : "+response.getErrorDesc());
mav.addObject("errorCode", response.getErrorCode());
}
}else{
mav.addObject("errorCode", "E007");
throw new Exception();
}
mav.setViewName("changePasswordSuccess");
}
}catch(Exception ex){
ex.printStackTrace();
}
return mav;
}
}
| 5,851 | 0.72979 | 0.728935 | 162 | 35.117283 | 26.542625 | 136 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.172839 | false | false |
12
|
d009969b3ac46b5fd72fe5075cd70a8032def2c6
| 1,176,821,052,391 |
3e33ea74b627af388755ad878192a69532e6c053
|
/lcz-config/src/main/java/cn/lcz/config/kafka/beans/KafkaConsumerConfig.java
|
4d4884dc8f96cafac85f7c6745ca6c127abdcd99
|
[] |
no_license
|
liucz880415/lcz
|
https://github.com/liucz880415/lcz
|
94fcce3aacb396e13c4fa99b72325f12ebb4cb57
|
32650aac51ceac98caa7bb88038ce076bce30b43
|
refs/heads/master
| 2021-01-24T18:27:41.373000 | 2017-05-18T02:14:05 | 2017-05-18T02:14:05 | 84,424,619 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package cn.lcz.config.kafka.beans;
import java.util.Properties;
public class KafkaConsumerConfig {
private String bootstrapServers;
private Boolean autoCommit;
private Integer sessionTimeout;
private String keyDeserializer;
private String valueDeserializer;
public Properties getDefaultConsumerProperties() {
Properties properties = new Properties();
properties.put("bootstrap.servers", bootstrapServers);
properties.put("enable.auto.commit", false);
properties.put("session.timeout.ms", sessionTimeout);
properties.put("key.deserializer", keyDeserializer);
properties.put("value.deserializer", valueDeserializer);
return properties;
}
public Boolean getAutoCommit() {
return autoCommit;
}
public void setAutoCommit(Boolean autoCommit) {
this.autoCommit = autoCommit;
}
public String getKeyDeserializer() {
return keyDeserializer;
}
public void setKeyDeserializer(String keyDeserializer) {
this.keyDeserializer = keyDeserializer;
}
public String getValueDeserializer() {
return valueDeserializer;
}
public void setValueDeserializer(String valueDeserializer) {
this.valueDeserializer = valueDeserializer;
}
public String getBootstrapServers() {
return bootstrapServers;
}
public void setBootstrapServers(String bootstrapServers) {
this.bootstrapServers = bootstrapServers;
}
public Integer getSessionTimeout() {
return sessionTimeout;
}
public void setSessionTimeout(Integer sessionTimeout) {
this.sessionTimeout = sessionTimeout;
}
}
|
UTF-8
|
Java
| 1,697 |
java
|
KafkaConsumerConfig.java
|
Java
|
[] | null |
[] |
package cn.lcz.config.kafka.beans;
import java.util.Properties;
public class KafkaConsumerConfig {
private String bootstrapServers;
private Boolean autoCommit;
private Integer sessionTimeout;
private String keyDeserializer;
private String valueDeserializer;
public Properties getDefaultConsumerProperties() {
Properties properties = new Properties();
properties.put("bootstrap.servers", bootstrapServers);
properties.put("enable.auto.commit", false);
properties.put("session.timeout.ms", sessionTimeout);
properties.put("key.deserializer", keyDeserializer);
properties.put("value.deserializer", valueDeserializer);
return properties;
}
public Boolean getAutoCommit() {
return autoCommit;
}
public void setAutoCommit(Boolean autoCommit) {
this.autoCommit = autoCommit;
}
public String getKeyDeserializer() {
return keyDeserializer;
}
public void setKeyDeserializer(String keyDeserializer) {
this.keyDeserializer = keyDeserializer;
}
public String getValueDeserializer() {
return valueDeserializer;
}
public void setValueDeserializer(String valueDeserializer) {
this.valueDeserializer = valueDeserializer;
}
public String getBootstrapServers() {
return bootstrapServers;
}
public void setBootstrapServers(String bootstrapServers) {
this.bootstrapServers = bootstrapServers;
}
public Integer getSessionTimeout() {
return sessionTimeout;
}
public void setSessionTimeout(Integer sessionTimeout) {
this.sessionTimeout = sessionTimeout;
}
}
| 1,697 | 0.696523 | 0.696523 | 67 | 24.328358 | 22.714575 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.432836 | false | false |
12
|
4bea040baf5b45b62d30cba714dcd1a1e785bcdc
| 7,318,624,283,321 |
9b0b61c89ac858746147a6febb8e820108e7d930
|
/Phoenix/rest/phoenix/src/java/sg/edu/nus/iss/ft08/phoenix/user/RoleMemberDaoMySql.java
|
51348ad575ca829b616d2454bbd913e603a86148
|
[] |
no_license
|
maurzcitrus/Phoenix-Radio
|
https://github.com/maurzcitrus/Phoenix-Radio
|
b3cb3d9257b92c2e5c53d79ed9174e3653754c96
|
16d399b8436cbad9bd4ce291a7c120a340664194
|
refs/heads/master
| 2021-05-05T12:30:43.611000 | 2018-01-20T10:21:53 | 2018-01-20T10:21:53 | 118,232,081 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package sg.edu.nus.iss.ft08.phoenix.user;
import java.util.List;
import sg.edu.nus.iss.ft08.phoenix.model.RoleMember;
import sg.edu.nus.iss.ft08.phoenix.util.MySqlQuery;
/**
* Implements RolememberDao for MySQL database.
*
* @author phyo
*/
public class RoleMemberDaoMySql implements RoleMemberDao {
@Override
public List<RoleMember> findAll(String roleId) {
String sql
= "select\n"
+ " u.id as userId,\n"
+ " u.name as userName,\n"
+ " ur.role_id as roleId,\n"
+ " r.role_name as roleName\n"
+ "from\n"
+ " phoenix.user u\n"
+ "left join\n"
+ " phoenix.user_role ur \n"
+ " on u.id = ur.user_id\n"
+ "left join\n"
+ " phoenix.role r \n"
+ " on ur.role_id = r.role_id\n"
+ "where\n"
+ " ur.role_id = ? \n"
+ "order by\n"
+ " userId";
MySqlQuery query = new MySqlQuery(sql,
(s) -> {
s.setString(1, roleId);
},
(r) -> {
RoleMember m = new RoleMember();
m.setUserId(r.getString("userId"));
m.setUserName(r.getString("userName"));
m.setRoleId(r.getString("roleId"));
m.setRoleName(r.getString("roleName"));
return m;
});
return query.findAll();
}
}
|
UTF-8
|
Java
| 1,286 |
java
|
RoleMemberDaoMySql.java
|
Java
|
[
{
"context": "s RolememberDao for MySQL database.\n * \n * @author phyo\n */\npublic class RoleMemberDaoMySql implements Ro",
"end": 243,
"score": 0.9995855093002319,
"start": 239,
"tag": "USERNAME",
"value": "phyo"
},
{
"context": "ring(\"userId\"));\n m.setUserName(r.getString(\"userName\"));\n m.setRoleId(r.getString(\"roleId\"));\n ",
"end": 1133,
"score": 0.9983635544776917,
"start": 1125,
"tag": "USERNAME",
"value": "userName"
}
] | null |
[] |
package sg.edu.nus.iss.ft08.phoenix.user;
import java.util.List;
import sg.edu.nus.iss.ft08.phoenix.model.RoleMember;
import sg.edu.nus.iss.ft08.phoenix.util.MySqlQuery;
/**
* Implements RolememberDao for MySQL database.
*
* @author phyo
*/
public class RoleMemberDaoMySql implements RoleMemberDao {
@Override
public List<RoleMember> findAll(String roleId) {
String sql
= "select\n"
+ " u.id as userId,\n"
+ " u.name as userName,\n"
+ " ur.role_id as roleId,\n"
+ " r.role_name as roleName\n"
+ "from\n"
+ " phoenix.user u\n"
+ "left join\n"
+ " phoenix.user_role ur \n"
+ " on u.id = ur.user_id\n"
+ "left join\n"
+ " phoenix.role r \n"
+ " on ur.role_id = r.role_id\n"
+ "where\n"
+ " ur.role_id = ? \n"
+ "order by\n"
+ " userId";
MySqlQuery query = new MySqlQuery(sql,
(s) -> {
s.setString(1, roleId);
},
(r) -> {
RoleMember m = new RoleMember();
m.setUserId(r.getString("userId"));
m.setUserName(r.getString("userName"));
m.setRoleId(r.getString("roleId"));
m.setRoleName(r.getString("roleName"));
return m;
});
return query.findAll();
}
}
| 1,286 | 0.547434 | 0.541991 | 51 | 24.215687 | 16.882889 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.392157 | false | false |
12
|
a3804cd37ff168d6f1fce3953cb65d8a566678a4
| 24,343,874,646,274 |
5c78c61ded1b25c1157c2b170e742df0421e3538
|
/src/test/java/codetest/controller/LocationControllerTest.java
|
4da30b9673f5baa6236f9fa93412a3691bb3e9e5
|
[] |
no_license
|
ringoluo/us-location-finder
|
https://github.com/ringoluo/us-location-finder
|
cbb6b95e1814e8ef2ac94684ee7ae7548725c989
|
4a9970b7e4cd3ac58abc993b2cec2e2bc1398e13
|
refs/heads/master
| 2018-01-07T06:01:47.637000 | 2014-08-04T16:42:24 | 2014-08-04T16:42:24 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package codetest.controller;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import static org.mockito.Mockito.*;
import static org.mockito.Matchers.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import codetest.config.ApplicationConfiguration;
import codetest.exception.LocationSearchException;
import codetest.exception.ZipcodeNotFoundException;
import codetest.model.CurrentObservation;
import codetest.service.LocationSearchService;
/**
*
* @author luochun
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes = ApplicationConfiguration.class)
public class LocationControllerTest {
private static final String VIEW_NAME_RESULT = "result";
private static final String VIEW_NAME_INDEX = "index";
@Mock
LocationSearchService locationSearchService;
@InjectMocks
private LocationController locationController;
private MockMvc mockMvc;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.mockMvc = MockMvcBuilders.standaloneSetup(locationController)
.build();
}
@Test
public void redirectToSearchForm() throws Exception {
this.mockMvc.perform(get("/")).andExpect(status().isMovedTemporarily())
.andExpect(redirectedUrl("search"));
}
@Test
public void getSearchForm() throws Exception {
this.mockMvc.perform(get("/search")).andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_INDEX));
}
@Test
public void postValidZipcode() throws Exception {
CurrentObservation value = new CurrentObservation();
when(locationSearchService.searchByZipcode("12345")).thenReturn(value);
this.mockMvc
.perform(
post("/search").param("zipcode", "12345").contentType(
MediaType.APPLICATION_FORM_URLENCODED))
.andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_RESULT))
.andExpect(model().attributeHasNoErrors("searchQuery"))
.andExpect(model().attribute("city", value));
verify(locationSearchService).searchByZipcode("12345");
}
@Test
public void postInvalidZipcodeFormat() throws Exception {
CurrentObservation value = new CurrentObservation();
when(locationSearchService.searchByZipcode("123")).thenReturn(value);
this.mockMvc
.perform(
post("/search").param("zipcode", "123").contentType(
MediaType.APPLICATION_FORM_URLENCODED))
.andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_INDEX))
.andExpect(
model().attributeHasFieldErrors("searchQuery",
"zipcode"));
verify(locationSearchService, never()).searchByZipcode("123");
}
@Test
public void postNotFoundZipcode() throws Exception {
when(locationSearchService.searchByZipcode("11111")).thenThrow(
new ZipcodeNotFoundException("Zipcode not found."));
this.mockMvc
.perform(
post("/search").param("zipcode", "11111").contentType(
MediaType.APPLICATION_FORM_URLENCODED))
.andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_INDEX))
.andExpect(model().attributeHasNoErrors("searchQuery"))
.andExpect(model().attribute("error",
LocationController.ZIP_NOT_FOUND_MESSAGE));
verify(locationSearchService).searchByZipcode("11111");
}
@Test
public void postOtherExternalAPIError() throws Exception {
when(locationSearchService.searchByZipcode("11111")).thenThrow(
new LocationSearchException("errorcode", "errormessage"));
this.mockMvc
.perform(
post("/search").param("zipcode", "11111").contentType(
MediaType.APPLICATION_FORM_URLENCODED))
.andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_INDEX))
.andExpect(model().attributeHasNoErrors("searchQuery"))
.andExpect(
model().attribute("error",
LocationController.EXTERNAL_ERROR_MESSAGE));
verify(locationSearchService).searchByZipcode("11111");
}
@Test
public void postOtherInternalSystemError() throws Exception {
when(locationSearchService.searchByZipcode("11111")).thenThrow(
new RuntimeException("internal error"));
this.mockMvc
.perform(
post("/search").param("zipcode", "11111").contentType(
MediaType.APPLICATION_FORM_URLENCODED))
.andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_INDEX))
.andExpect(model().attributeHasNoErrors("searchQuery"))
.andExpect(
model().attribute("error",
LocationController.INTERNAL_ERROR_MESSAGE));
verify(locationSearchService).searchByZipcode("11111");
}
}
|
UTF-8
|
Java
| 5,989 |
java
|
LocationControllerTest.java
|
Java
|
[
{
"context": "service.LocationSearchService;\n\n/**\n * \n * @author luochun\n *\n */\n@RunWith(SpringJUnit4ClassRunner.class)\n@W",
"end": 1082,
"score": 0.9992498159408569,
"start": 1075,
"tag": "USERNAME",
"value": "luochun"
}
] | null |
[] |
package codetest.controller;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import static org.mockito.Mockito.*;
import static org.mockito.Matchers.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import codetest.config.ApplicationConfiguration;
import codetest.exception.LocationSearchException;
import codetest.exception.ZipcodeNotFoundException;
import codetest.model.CurrentObservation;
import codetest.service.LocationSearchService;
/**
*
* @author luochun
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes = ApplicationConfiguration.class)
public class LocationControllerTest {
private static final String VIEW_NAME_RESULT = "result";
private static final String VIEW_NAME_INDEX = "index";
@Mock
LocationSearchService locationSearchService;
@InjectMocks
private LocationController locationController;
private MockMvc mockMvc;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.mockMvc = MockMvcBuilders.standaloneSetup(locationController)
.build();
}
@Test
public void redirectToSearchForm() throws Exception {
this.mockMvc.perform(get("/")).andExpect(status().isMovedTemporarily())
.andExpect(redirectedUrl("search"));
}
@Test
public void getSearchForm() throws Exception {
this.mockMvc.perform(get("/search")).andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_INDEX));
}
@Test
public void postValidZipcode() throws Exception {
CurrentObservation value = new CurrentObservation();
when(locationSearchService.searchByZipcode("12345")).thenReturn(value);
this.mockMvc
.perform(
post("/search").param("zipcode", "12345").contentType(
MediaType.APPLICATION_FORM_URLENCODED))
.andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_RESULT))
.andExpect(model().attributeHasNoErrors("searchQuery"))
.andExpect(model().attribute("city", value));
verify(locationSearchService).searchByZipcode("12345");
}
@Test
public void postInvalidZipcodeFormat() throws Exception {
CurrentObservation value = new CurrentObservation();
when(locationSearchService.searchByZipcode("123")).thenReturn(value);
this.mockMvc
.perform(
post("/search").param("zipcode", "123").contentType(
MediaType.APPLICATION_FORM_URLENCODED))
.andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_INDEX))
.andExpect(
model().attributeHasFieldErrors("searchQuery",
"zipcode"));
verify(locationSearchService, never()).searchByZipcode("123");
}
@Test
public void postNotFoundZipcode() throws Exception {
when(locationSearchService.searchByZipcode("11111")).thenThrow(
new ZipcodeNotFoundException("Zipcode not found."));
this.mockMvc
.perform(
post("/search").param("zipcode", "11111").contentType(
MediaType.APPLICATION_FORM_URLENCODED))
.andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_INDEX))
.andExpect(model().attributeHasNoErrors("searchQuery"))
.andExpect(model().attribute("error",
LocationController.ZIP_NOT_FOUND_MESSAGE));
verify(locationSearchService).searchByZipcode("11111");
}
@Test
public void postOtherExternalAPIError() throws Exception {
when(locationSearchService.searchByZipcode("11111")).thenThrow(
new LocationSearchException("errorcode", "errormessage"));
this.mockMvc
.perform(
post("/search").param("zipcode", "11111").contentType(
MediaType.APPLICATION_FORM_URLENCODED))
.andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_INDEX))
.andExpect(model().attributeHasNoErrors("searchQuery"))
.andExpect(
model().attribute("error",
LocationController.EXTERNAL_ERROR_MESSAGE));
verify(locationSearchService).searchByZipcode("11111");
}
@Test
public void postOtherInternalSystemError() throws Exception {
when(locationSearchService.searchByZipcode("11111")).thenThrow(
new RuntimeException("internal error"));
this.mockMvc
.perform(
post("/search").param("zipcode", "11111").contentType(
MediaType.APPLICATION_FORM_URLENCODED))
.andExpect(status().isOk())
.andExpect(view().name(VIEW_NAME_INDEX))
.andExpect(model().attributeHasNoErrors("searchQuery"))
.andExpect(
model().attribute("error",
LocationController.INTERNAL_ERROR_MESSAGE));
verify(locationSearchService).searchByZipcode("11111");
}
}
| 5,989 | 0.630322 | 0.6183 | 163 | 35.742332 | 28.199028 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.368098 | false | false |
12
|
9e8a93a3a6e2e36e29d877ae32bdf53f9e602403
| 36,163,624,645,580 |
8eba09813e93afd1cb745e2c0be90b1b37db6129
|
/Coursework/app/src/main/java/coursework/coursework/ShowPreferences.java
|
574070a406b7ac58dbe34e405557c06e8cd9c3c2
|
[] |
no_license
|
NATHAN200/Mobile-and-Ubiquitous-Computing
|
https://github.com/NATHAN200/Mobile-and-Ubiquitous-Computing
|
e39047d627732b7524dcb0ee250c2f4c00ece237
|
a9495b1e3804a5287d8385440a219fc049563e63
|
HEAD
| 2016-09-05T17:35:38.709000 | 2014-12-19T19:55:42 | 2014-12-19T19:55:42 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package coursework.coursework;
import android.app.Activity;
import android.app.DialogFragment;
import android.app.FragmentManager;
import android.content.SharedPreferences;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
/**
* Created by Nicholas on 18/12/2014.
*/
public class ShowPreferences extends Activity implements View.OnClickListener {
EditText editFirstName; //Edit text to show and edit first name
EditText editSurname; //Edit text to show and edit surname
EditText editLocation; //Edit text to show and edit location
Button back; //button to take user back to main menu
Button save; //button to save current data of the edit text
SharedPreferences sharedPrefs; //The saved preferences
FragmentManager dialogmanager;
public void onCreate(Bundle bundle)
{
super.onCreate(bundle);
super.setContentView(R.layout.preferences);
//Find the edit texts from the layout
editFirstName = (EditText)findViewById(R.id.editFirstName);
editSurname = (EditText)findViewById(R.id.editSurname);
editLocation = (EditText)findViewById(R.id.editLocation);
back = (Button)findViewById(R.id.prefBack);
back.setOnClickListener(this);
save = (Button)findViewById(R.id.prefSave);
save.setOnClickListener(this);
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
dialogmanager = this.getFragmentManager();
load();
}
private void load()
{
//Load the saved strings form the share prefs and display them in the edit text
editFirstName.setText(sharedPrefs.getString("FirstName","John"));
editSurname.setText(sharedPrefs.getString("Surname","Smith"));
editLocation.setText(sharedPrefs.getString("Location","Glasgow"));
}
public void onClick(View v)
{
if(v instanceof Button)
{
//Button was click so play sound
MediaPlayer mp = MediaPlayer.create(getApplicationContext(), R.raw.buttonpress);
mp.start();
if(v==back)
{
//Go back to the main menu
finish();
}
if(v==save)
{
//save the data
save();
}
}
}
public void save()
{
//Saves the current values of the edit texts to the shared preferences
SharedPreferences.Editor editor = sharedPrefs.edit();
editor.putString("FirstName",editFirstName.getText().toString());
editor.putString("Surname",editSurname.getText().toString());
editor.putString("Location",editLocation.getText().toString());
editor.commit();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.back_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.back) {
finish();
}
if(id == R.id.mainAbout)
{
String message = "Edit each of the fields and then click save to save the data"+
"\nClick Back to return to the Main Menu";
DialogFragment dialog = AboutDialog.newInstance(message);
dialog.show(dialogmanager, "tag");
return true;
}
return super.onOptionsItemSelected(item);
}
}
|
UTF-8
|
Java
| 4,017 |
java
|
ShowPreferences.java
|
Java
|
[
{
"context": "import android.widget.EditText;\n\n/**\n * Created by Nicholas on 18/12/2014.\n */\npublic class ShowPreferences e",
"end": 450,
"score": 0.9997339844703674,
"start": 442,
"tag": "NAME",
"value": "Nicholas"
}
] | null |
[] |
package coursework.coursework;
import android.app.Activity;
import android.app.DialogFragment;
import android.app.FragmentManager;
import android.content.SharedPreferences;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
/**
* Created by Nicholas on 18/12/2014.
*/
public class ShowPreferences extends Activity implements View.OnClickListener {
EditText editFirstName; //Edit text to show and edit first name
EditText editSurname; //Edit text to show and edit surname
EditText editLocation; //Edit text to show and edit location
Button back; //button to take user back to main menu
Button save; //button to save current data of the edit text
SharedPreferences sharedPrefs; //The saved preferences
FragmentManager dialogmanager;
public void onCreate(Bundle bundle)
{
super.onCreate(bundle);
super.setContentView(R.layout.preferences);
//Find the edit texts from the layout
editFirstName = (EditText)findViewById(R.id.editFirstName);
editSurname = (EditText)findViewById(R.id.editSurname);
editLocation = (EditText)findViewById(R.id.editLocation);
back = (Button)findViewById(R.id.prefBack);
back.setOnClickListener(this);
save = (Button)findViewById(R.id.prefSave);
save.setOnClickListener(this);
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
dialogmanager = this.getFragmentManager();
load();
}
private void load()
{
//Load the saved strings form the share prefs and display them in the edit text
editFirstName.setText(sharedPrefs.getString("FirstName","John"));
editSurname.setText(sharedPrefs.getString("Surname","Smith"));
editLocation.setText(sharedPrefs.getString("Location","Glasgow"));
}
public void onClick(View v)
{
if(v instanceof Button)
{
//Button was click so play sound
MediaPlayer mp = MediaPlayer.create(getApplicationContext(), R.raw.buttonpress);
mp.start();
if(v==back)
{
//Go back to the main menu
finish();
}
if(v==save)
{
//save the data
save();
}
}
}
public void save()
{
//Saves the current values of the edit texts to the shared preferences
SharedPreferences.Editor editor = sharedPrefs.edit();
editor.putString("FirstName",editFirstName.getText().toString());
editor.putString("Surname",editSurname.getText().toString());
editor.putString("Location",editLocation.getText().toString());
editor.commit();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.back_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.back) {
finish();
}
if(id == R.id.mainAbout)
{
String message = "Edit each of the fields and then click save to save the data"+
"\nClick Back to return to the Main Menu";
DialogFragment dialog = AboutDialog.newInstance(message);
dialog.show(dialogmanager, "tag");
return true;
}
return super.onOptionsItemSelected(item);
}
}
| 4,017 | 0.647498 | 0.645507 | 114 | 34.236843 | 26.272961 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.561404 | false | false |
12
|
7051a60559c5113b2f2a56c2ddf2c7cd2d770789
| 34,754,875,384,489 |
b0e06c03baa0aa6d6aead643335647ca602b9854
|
/src/main/java/kuvaldis/algorithm/programcreek/EditDistance.java
|
5ce9658a4f828997f607f5cd5aa6589c312c8896
|
[] |
no_license
|
veronichaflasmahendryanna/Algorithm
|
https://github.com/veronichaflasmahendryanna/Algorithm
|
0ced2ce13c6c05736322b007988c3ed13c425052
|
32ac0b9116077c179c4d342a73f49d5caeb34624
|
refs/heads/master
| 2022-04-22T11:20:08.819000 | 2019-06-17T13:40:11 | 2019-06-17T13:40:11 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package kuvaldis.algorithm.programcreek;
import java.util.*;
/*
From Wiki:
In computer science, edit distance is a way of quantifying how dissimilar two strings (e.g., words) are to one another by counting the minimum number of operations required to transform one string into the other.
There are three operations permitted on a word: replace, delete, insert. For example, the edit distance between "a" and "b" is 1, the edit distance between "abc" and "def" is 3. This post analyzes how to calculate edit distance by using dynamic programming.
*/
public class EditDistance {
public int distance(final String a, final String b) {
// init memo
final int[][] memo = new int[a.length() + 1][];
for (int i = 0; i < memo.length; i++) {
memo[i] = new int[b.length() + 1];
}
for (int i = 1; i < memo.length; i++) {
final char aChar = a.charAt(i - 1);
for (int j = 1; j < memo[i].length; j++) {
final char bChar = b.charAt(j - 1);
final int step = aChar == bChar ? 0 : 1;
final int minPrev = Math.min(Math.min(memo[i - 1][j], memo[i][j - 1]), memo[i - 1][j - 1]);
memo[i][j] = minPrev + step;
}
}
return memo[a.length()][b.length()];
}
}
|
UTF-8
|
Java
| 1,316 |
java
|
EditDistance.java
|
Java
|
[] | null |
[] |
package kuvaldis.algorithm.programcreek;
import java.util.*;
/*
From Wiki:
In computer science, edit distance is a way of quantifying how dissimilar two strings (e.g., words) are to one another by counting the minimum number of operations required to transform one string into the other.
There are three operations permitted on a word: replace, delete, insert. For example, the edit distance between "a" and "b" is 1, the edit distance between "abc" and "def" is 3. This post analyzes how to calculate edit distance by using dynamic programming.
*/
public class EditDistance {
public int distance(final String a, final String b) {
// init memo
final int[][] memo = new int[a.length() + 1][];
for (int i = 0; i < memo.length; i++) {
memo[i] = new int[b.length() + 1];
}
for (int i = 1; i < memo.length; i++) {
final char aChar = a.charAt(i - 1);
for (int j = 1; j < memo[i].length; j++) {
final char bChar = b.charAt(j - 1);
final int step = aChar == bChar ? 0 : 1;
final int minPrev = Math.min(Math.min(memo[i - 1][j], memo[i][j - 1]), memo[i - 1][j - 1]);
memo[i][j] = minPrev + step;
}
}
return memo[a.length()][b.length()];
}
}
| 1,316 | 0.583587 | 0.572188 | 34 | 37.705883 | 55.626129 | 257 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.735294 | false | false |
12
|
2c578adb9657121d34c9a1272630f3e0f68ed9ef
| 3,547,643,053,255 |
161647e50f5374a973b7801fbfc1edc128780283
|
/anal/mobileAnal/src/com/cmcc/anal/common/util/SysInfo.java
|
0a0062d9805fd357321aaefddbe35006f536787b
|
[] |
no_license
|
chier/projects
|
https://github.com/chier/projects
|
86cc38c9d45923c68acfd443ca12d6eece932a4e
|
5943c845de46ff0c4f388b126b1a1e98d8b7bc60
|
refs/heads/master
| 2020-09-23T11:50:49.120000 | 2017-11-15T04:32:44 | 2017-11-15T04:32:44 | 67,032,433 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* 文件名: SysInfo.java
*
* 创建日期: 2008-11-27
*
* Copyright(C) 2008, by conntsing.
*
* 原始作者: <a href="mailto:sun128837@126.com" alt="changqing">conntsing</a>
*
*/
package com.cmcc.anal.common.util;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.text.ParseException;
import java.util.StringTokenizer;
/**
* 得到系统运行时的一些信息.
*
* @author <a href="mailto:chiersystem@gmail.com" alt="张占亮">张占亮</a>
*
* @version $Revision: 1.1 $
*
* @since 2008-11-27
*/
public class SysInfo {
/** JAVA版本1.3. */
public static final int JAVAVERSION_13 = 13;
public static final int JAVAVERSION_14 = 14;
private static final float JAVAVER_13 = (float) 1.3;
/**
* 返回文件路径分隔符,缺省为\.
*
* @return 文件路径分隔符
*/
public static String getFileSeparator() {
String sFileSeparator = "\\";
try {
sFileSeparator = System.getProperty("file.separator");
}
catch (SecurityException e) {
}
return sFileSeparator;
}
/**
* 得到换行符. 缺省为\r\n
*
* @return 换行符
*/
public static String getLineSeparator() {
String sLineSeparator = "\r\n";
try {
sLineSeparator = System.getProperty("line.separator");
}
catch (SecurityException e) {
}
return sLineSeparator;
}
/**
* 得到当前Java的版本
*
* @return 当前Java的版本
*/
public static int getJavaVersion() {
String sVersion;
int nVersion = JAVAVERSION_13;
try {
sVersion = System.getProperty("java.specification.version");
nVersion = (int) (10 * myparseFloat(sVersion, JAVAVER_13));
}
catch (SecurityException e) {
SystemUtil.errPrintLine("Error get Java Version");
}
return nVersion;
}
/**
* Java版本是否为1.4或以上.
*
* @return 是否为1.4或以上
*/
public static boolean isJavaVersion14() {
return getJavaVersion() >= JAVAVERSION_14;
}
/**
* 分析一个字符串得到float,如果错误,设置一个缺省值.
*
* @param str1
* String
* @param nDefault
* 缺省值
* @return float
*/
private static float myparseFloat(String str1, float nDefault) {
float result;
try {
result = ((null == str1) || (str1.length() == 0)) ? nDefault
: Float.parseFloat(str1);
}
catch (NumberFormatException e) {
result = nDefault;
}
return result;
}
/**
* 得到系统文件的编码.
*
* @return 系统文件的编码.
*/
public static String getSYSFileEncoding() {
return System.getProperty("file.encoding");
}
/**
* 获得当前运行操作系统的版本号
*
* @return 运行操作系统的版本号
*/
public static String getOSVersion() {
return System.getProperty("os.version");
}
/**
* 获得当前运行操作系统的名称
*
* @return 运行操作系统的名称
*/
public static String getOSName() {
return System.getProperty("os.name");
}
/**
* 获得当前运行的JVM的提供商
*
* @return 运行的JVM的提供商
*/
public static String getJVMVendor() {
return System.getProperty("java.vm.vendor");
}
/**
* 获得当前运行的JVM版本号
*
* @return 运行的JVM版本号
*/
public static String getJVMVersion() {
return System.getProperty("java.vm.version");
}
/**
* 获得CPU的个数
*
* @return CPU的个数
*/
public static int getCPUCount() {
return Runtime.getRuntime().availableProcessors();
}
/**
* 获得Java安装目录地址
*
* @return Java安装目录地址
*/
public static String getJavaHome() {
return System.getProperty("java.home");
}
/**
* 获得Java 虚拟机中的内存总量,以字节为单位。
*
* @return Java 虚拟机中的内存总量
*/
public static long getTotalMemory() {
return Runtime.getRuntime().totalMemory();
}
/**
* 获得Java 虚拟机试图使用的最大内存量,以字节为单位。
*
* @return Java 虚拟机试图使用的最大内存量
*/
public static long getMaxMemory() {
return Runtime.getRuntime().maxMemory();
}
/**
* 获得Java 虚拟机中的空闲内存量,以字节为单位。
*
* @return Java 虚拟机中的空闲内存量
*/
public static long getFreeMemory() {
return Runtime.getRuntime().freeMemory();
}
/**
* 获得网卡的Mac地址,只能获得第一块的。
*
* @return 网卡的Mac地址
*
* @throws IOException
*/
public final static String getMacAddress() throws IOException {
String os = SysInfo.getOSName();
try {
if (os.startsWith("Windows")) {
return windowsParseMacAddress(windowsRunIpConfigCommand());
}
else if (os.startsWith("Linux")) {
return linuxParseMacAddress(linuxRunIfConfigCommand());
}
else {
throw new IOException("unknown operating system: " + os);
}
}
catch (ParseException ex) {
ex.printStackTrace();
throw new IOException(ex.getMessage());
}
}
/* * Linux stuff */
private final static String linuxParseMacAddress(String ipConfigResponse)
throws ParseException {
String localHost = null;
try {
localHost = InetAddress.getLocalHost().getHostAddress();
}
catch (java.net.UnknownHostException ex) {
ex.printStackTrace();
throw new ParseException(ex.getMessage(), 0);
}
StringTokenizer tokenizer = new StringTokenizer(ipConfigResponse, "\n");
String lastMacAddress = null;
while (tokenizer.hasMoreTokens()) {
String line = tokenizer.nextToken().trim();
boolean containsLocalHost = line.indexOf(localHost) >= 0;
if (containsLocalHost && lastMacAddress != null) {
return lastMacAddress;
} // see if line contains MAC address
int macAddressPosition = line.indexOf("HWaddr");
if (macAddressPosition <= 0)
continue;
String macAddressCandidate = line.substring(macAddressPosition + 6)
.trim();
if (linuxIsMacAddress(macAddressCandidate)) {
lastMacAddress = macAddressCandidate;
return lastMacAddress;
}
}
ParseException ex = new ParseException("cannot read MAC address for "
+ localHost + " from [" + ipConfigResponse + "]", 0);
ex.printStackTrace();
throw ex;
}
private final static boolean linuxIsMacAddress(String macAddressCandidate) {
if (macAddressCandidate.length() != 17)
return false;
return true;
}
private final static String linuxRunIfConfigCommand() throws IOException {
Process p = Runtime.getRuntime().exec("ifconfig");
InputStream stdoutStream = new BufferedInputStream(p.getInputStream());
StringBuffer buffer = new StringBuffer();
for (;;) {
int c = stdoutStream.read();
if (c == -1)
break;
buffer.append((char) c);
}
String outputText = buffer.toString();
stdoutStream.close();
return outputText;
}
/* * Windows stuff */
private final static String windowsParseMacAddress(String ipConfigResponse)
throws ParseException {
String localHost = null;
try {
localHost = InetAddress.getLocalHost().getHostAddress();
}
catch (java.net.UnknownHostException ex) {
ex.printStackTrace();
throw new ParseException(ex.getMessage(), 0);
}
StringTokenizer tokenizer = new StringTokenizer(ipConfigResponse, "\n");
String lastMacAddress = null;
while (tokenizer.hasMoreTokens()) {
String line = tokenizer.nextToken().trim(); // see if line contains
// IP address
if (line.endsWith(localHost) && lastMacAddress != null) {
return lastMacAddress;
} // see if line contains MAC address
int macAddressPosition = line.indexOf(":");
if (macAddressPosition <= 0) {
continue;
}
String macAddressCandidate = line.substring(macAddressPosition + 1)
.trim();
if (windowsIsMacAddress(macAddressCandidate))// È¡µÃMACµØÖ·
{
lastMacAddress = macAddressCandidate;
return lastMacAddress;
}
}
ParseException ex = new ParseException("cannot read MAC address from ["
+ ipConfigResponse + "]", 0);
ex.printStackTrace();
throw ex;
}
private final static boolean windowsIsMacAddress(String macAddressCandidate) {
if (macAddressCandidate.length() != 17)
return false;
return true;
}
private final static String windowsRunIpConfigCommand() throws IOException {
Process p = Runtime.getRuntime().exec("ipconfig /all");
InputStream stdoutStream = new BufferedInputStream(p.getInputStream());
StringBuffer buffer = new StringBuffer();
for (;;) {
int c = stdoutStream.read();
if (c == -1)
break;
buffer.append((char) c);
}
String outputText = buffer.toString();
stdoutStream.close();
return outputText;
}
/* * Main */
public final static void main(String[] args) {
try {
System.out.println("Network infos:");
System.out.println("Operating System: " + SysInfo.getOSName());
System.out.println("IP/Localhost: "
+ InetAddress.getLocalHost().getHostAddress());
System.out.println("MAC Address: " + getMacAddress());
}
catch (Throwable t) {
t.printStackTrace();
}
}
}
|
UTF-8
|
Java
| 9,027 |
java
|
SysInfo.java
|
Java
|
[
{
"context": ") 2008, by conntsing.\n *\n * 原始作者: <a href=\"mailto:sun128837@126.com\" alt=\"changqing\">conntsing</a>\n *\n */\npackage com",
"end": 132,
"score": 0.9999287724494934,
"start": 115,
"tag": "EMAIL",
"value": "sun128837@126.com"
},
{
"context": "\n * 原始作者: <a href=\"mailto:sun128837@126.com\" alt=\"changqing\">conntsing</a>\n *\n */\npackage com.cmcc.anal.commo",
"end": 148,
"score": 0.9923405647277832,
"start": 139,
"tag": "USERNAME",
"value": "changqing"
},
{
"context": "a href=\"mailto:sun128837@126.com\" alt=\"changqing\">conntsing</a>\n *\n */\npackage com.cmcc.anal.common.util;\n\nim",
"end": 159,
"score": 0.9584123492240906,
"start": 150,
"tag": "USERNAME",
"value": "conntsing"
},
{
"context": "*\n * 得到系统运行时的一些信息.\n * \n * @author <a href=\"mailto:chiersystem@gmail.com\" alt=\"张占亮\">张占亮</a>\n *\n * @version $Revision: 1.1 ",
"end": 469,
"score": 0.9999231696128845,
"start": 448,
"tag": "EMAIL",
"value": "chiersystem@gmail.com"
},
{
"context": "uthor <a href=\"mailto:chiersystem@gmail.com\" alt=\"张占亮\">张占亮</a>\n *\n * @version $Revision: 1.1 $\n *\n * ",
"end": 477,
"score": 0.43349766731262207,
"start": 476,
"tag": "USERNAME",
"value": "张"
},
{
"context": "thor <a href=\"mailto:chiersystem@gmail.com\" alt=\"张占亮\">张占亮</a>\n *\n * @version $Revision: 1.1 $\n *\n * @s",
"end": 479,
"score": 0.69402676820755,
"start": 477,
"tag": "NAME",
"value": "占亮"
},
{
"context": " <a href=\"mailto:chiersystem@gmail.com\" alt=\"张占亮\">张占亮</a>\n *\n * @version $Revision: 1.1 $\n *\n * @since ",
"end": 484,
"score": 0.9203485250473022,
"start": 481,
"tag": "NAME",
"value": "张占亮"
}
] | null |
[] |
/*
* 文件名: SysInfo.java
*
* 创建日期: 2008-11-27
*
* Copyright(C) 2008, by conntsing.
*
* 原始作者: <a href="mailto:<EMAIL>" alt="changqing">conntsing</a>
*
*/
package com.cmcc.anal.common.util;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.text.ParseException;
import java.util.StringTokenizer;
/**
* 得到系统运行时的一些信息.
*
* @author <a href="mailto:<EMAIL>" alt="张占亮">张占亮</a>
*
* @version $Revision: 1.1 $
*
* @since 2008-11-27
*/
public class SysInfo {
/** JAVA版本1.3. */
public static final int JAVAVERSION_13 = 13;
public static final int JAVAVERSION_14 = 14;
private static final float JAVAVER_13 = (float) 1.3;
/**
* 返回文件路径分隔符,缺省为\.
*
* @return 文件路径分隔符
*/
public static String getFileSeparator() {
String sFileSeparator = "\\";
try {
sFileSeparator = System.getProperty("file.separator");
}
catch (SecurityException e) {
}
return sFileSeparator;
}
/**
* 得到换行符. 缺省为\r\n
*
* @return 换行符
*/
public static String getLineSeparator() {
String sLineSeparator = "\r\n";
try {
sLineSeparator = System.getProperty("line.separator");
}
catch (SecurityException e) {
}
return sLineSeparator;
}
/**
* 得到当前Java的版本
*
* @return 当前Java的版本
*/
public static int getJavaVersion() {
String sVersion;
int nVersion = JAVAVERSION_13;
try {
sVersion = System.getProperty("java.specification.version");
nVersion = (int) (10 * myparseFloat(sVersion, JAVAVER_13));
}
catch (SecurityException e) {
SystemUtil.errPrintLine("Error get Java Version");
}
return nVersion;
}
/**
* Java版本是否为1.4或以上.
*
* @return 是否为1.4或以上
*/
public static boolean isJavaVersion14() {
return getJavaVersion() >= JAVAVERSION_14;
}
/**
* 分析一个字符串得到float,如果错误,设置一个缺省值.
*
* @param str1
* String
* @param nDefault
* 缺省值
* @return float
*/
private static float myparseFloat(String str1, float nDefault) {
float result;
try {
result = ((null == str1) || (str1.length() == 0)) ? nDefault
: Float.parseFloat(str1);
}
catch (NumberFormatException e) {
result = nDefault;
}
return result;
}
/**
* 得到系统文件的编码.
*
* @return 系统文件的编码.
*/
public static String getSYSFileEncoding() {
return System.getProperty("file.encoding");
}
/**
* 获得当前运行操作系统的版本号
*
* @return 运行操作系统的版本号
*/
public static String getOSVersion() {
return System.getProperty("os.version");
}
/**
* 获得当前运行操作系统的名称
*
* @return 运行操作系统的名称
*/
public static String getOSName() {
return System.getProperty("os.name");
}
/**
* 获得当前运行的JVM的提供商
*
* @return 运行的JVM的提供商
*/
public static String getJVMVendor() {
return System.getProperty("java.vm.vendor");
}
/**
* 获得当前运行的JVM版本号
*
* @return 运行的JVM版本号
*/
public static String getJVMVersion() {
return System.getProperty("java.vm.version");
}
/**
* 获得CPU的个数
*
* @return CPU的个数
*/
public static int getCPUCount() {
return Runtime.getRuntime().availableProcessors();
}
/**
* 获得Java安装目录地址
*
* @return Java安装目录地址
*/
public static String getJavaHome() {
return System.getProperty("java.home");
}
/**
* 获得Java 虚拟机中的内存总量,以字节为单位。
*
* @return Java 虚拟机中的内存总量
*/
public static long getTotalMemory() {
return Runtime.getRuntime().totalMemory();
}
/**
* 获得Java 虚拟机试图使用的最大内存量,以字节为单位。
*
* @return Java 虚拟机试图使用的最大内存量
*/
public static long getMaxMemory() {
return Runtime.getRuntime().maxMemory();
}
/**
* 获得Java 虚拟机中的空闲内存量,以字节为单位。
*
* @return Java 虚拟机中的空闲内存量
*/
public static long getFreeMemory() {
return Runtime.getRuntime().freeMemory();
}
/**
* 获得网卡的Mac地址,只能获得第一块的。
*
* @return 网卡的Mac地址
*
* @throws IOException
*/
public final static String getMacAddress() throws IOException {
String os = SysInfo.getOSName();
try {
if (os.startsWith("Windows")) {
return windowsParseMacAddress(windowsRunIpConfigCommand());
}
else if (os.startsWith("Linux")) {
return linuxParseMacAddress(linuxRunIfConfigCommand());
}
else {
throw new IOException("unknown operating system: " + os);
}
}
catch (ParseException ex) {
ex.printStackTrace();
throw new IOException(ex.getMessage());
}
}
/* * Linux stuff */
private final static String linuxParseMacAddress(String ipConfigResponse)
throws ParseException {
String localHost = null;
try {
localHost = InetAddress.getLocalHost().getHostAddress();
}
catch (java.net.UnknownHostException ex) {
ex.printStackTrace();
throw new ParseException(ex.getMessage(), 0);
}
StringTokenizer tokenizer = new StringTokenizer(ipConfigResponse, "\n");
String lastMacAddress = null;
while (tokenizer.hasMoreTokens()) {
String line = tokenizer.nextToken().trim();
boolean containsLocalHost = line.indexOf(localHost) >= 0;
if (containsLocalHost && lastMacAddress != null) {
return lastMacAddress;
} // see if line contains MAC address
int macAddressPosition = line.indexOf("HWaddr");
if (macAddressPosition <= 0)
continue;
String macAddressCandidate = line.substring(macAddressPosition + 6)
.trim();
if (linuxIsMacAddress(macAddressCandidate)) {
lastMacAddress = macAddressCandidate;
return lastMacAddress;
}
}
ParseException ex = new ParseException("cannot read MAC address for "
+ localHost + " from [" + ipConfigResponse + "]", 0);
ex.printStackTrace();
throw ex;
}
private final static boolean linuxIsMacAddress(String macAddressCandidate) {
if (macAddressCandidate.length() != 17)
return false;
return true;
}
private final static String linuxRunIfConfigCommand() throws IOException {
Process p = Runtime.getRuntime().exec("ifconfig");
InputStream stdoutStream = new BufferedInputStream(p.getInputStream());
StringBuffer buffer = new StringBuffer();
for (;;) {
int c = stdoutStream.read();
if (c == -1)
break;
buffer.append((char) c);
}
String outputText = buffer.toString();
stdoutStream.close();
return outputText;
}
/* * Windows stuff */
private final static String windowsParseMacAddress(String ipConfigResponse)
throws ParseException {
String localHost = null;
try {
localHost = InetAddress.getLocalHost().getHostAddress();
}
catch (java.net.UnknownHostException ex) {
ex.printStackTrace();
throw new ParseException(ex.getMessage(), 0);
}
StringTokenizer tokenizer = new StringTokenizer(ipConfigResponse, "\n");
String lastMacAddress = null;
while (tokenizer.hasMoreTokens()) {
String line = tokenizer.nextToken().trim(); // see if line contains
// IP address
if (line.endsWith(localHost) && lastMacAddress != null) {
return lastMacAddress;
} // see if line contains MAC address
int macAddressPosition = line.indexOf(":");
if (macAddressPosition <= 0) {
continue;
}
String macAddressCandidate = line.substring(macAddressPosition + 1)
.trim();
if (windowsIsMacAddress(macAddressCandidate))// È¡µÃMACµØÖ·
{
lastMacAddress = macAddressCandidate;
return lastMacAddress;
}
}
ParseException ex = new ParseException("cannot read MAC address from ["
+ ipConfigResponse + "]", 0);
ex.printStackTrace();
throw ex;
}
private final static boolean windowsIsMacAddress(String macAddressCandidate) {
if (macAddressCandidate.length() != 17)
return false;
return true;
}
private final static String windowsRunIpConfigCommand() throws IOException {
Process p = Runtime.getRuntime().exec("ipconfig /all");
InputStream stdoutStream = new BufferedInputStream(p.getInputStream());
StringBuffer buffer = new StringBuffer();
for (;;) {
int c = stdoutStream.read();
if (c == -1)
break;
buffer.append((char) c);
}
String outputText = buffer.toString();
stdoutStream.close();
return outputText;
}
/* * Main */
public final static void main(String[] args) {
try {
System.out.println("Network infos:");
System.out.println("Operating System: " + SysInfo.getOSName());
System.out.println("IP/Localhost: "
+ InetAddress.getLocalHost().getHostAddress());
System.out.println("MAC Address: " + getMacAddress());
}
catch (Throwable t) {
t.printStackTrace();
}
}
}
| 9,003 | 0.672426 | 0.662827 | 364 | 21.895605 | 21.467587 | 106 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.903846 | false | false |
12
|
388b7001cf6581d64dab11bc5c5b9c9ed353eb50
| 29,025,389,053,757 |
fc4deded21471a383c2dca0f6de5b21540b0a1f3
|
/src/interfaces/Calculator.java
|
42bd623d0946cfa8129426fd00325c234465d114
|
[] |
no_license
|
oraculo-nl/JavaInterfacesDemo
|
https://github.com/oraculo-nl/JavaInterfacesDemo
|
59437ccbae3f25a819c5cfc1b4c873abd062a6ce
|
34e13dafdb136ed319e8588676f40210007912af
|
refs/heads/master
| 2023-08-18T04:23:28.038000 | 2021-09-16T07:19:17 | 2021-09-16T07:19:17 | 407,063,542 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package interfaces;
import java.util.ArrayList;
import java.util.List;
public class Calculator implements Freezable, Loggable {
private List<Operation> operations = new ArrayList<Operation>();
private boolean frozen = false;
// Implementation of Freezable.
public void freeze() {
frozen = true;
}
public void unfreeze() {
frozen = false;
}
// Implementation of Loggable.
public void logBrief() {
OUTPUT_STREAM.println("\nBrief log of operations:");
OUTPUT_STREAM.println("------------------------");
OUTPUT_STREAM.println("Number of operations: " + operations.size());
OUTPUT_STREAM.println();
}
public void logVerbose() {
OUTPUT_STREAM.println("\nVerbose log of operations:");
OUTPUT_STREAM.println("--------------------------");
for(Operation op: operations) {
OUTPUT_STREAM.println(op);
}
OUTPUT_STREAM.println();
}
// Functionality.
public void add(double num1, double num2) {
if (!frozen) {
operations.add(new Operation(num1, "+", num2));
System.out.printf("%.2f + %.2f = %.2f\n", num1, num2, num1+num2);
}
}
public void subtract(double num1, double num2) {
if (!frozen) {
operations.add(new Operation(num1, "-", num2));
System.out.printf("%.2f - %.2f = %.2f\n", num1, num2, num1-num2);
}
}
public void multiply(double num1, double num2) {
if (!frozen) {
operations.add(new Operation(num1, "*", num2));
System.out.printf("%.2f * %.2f = %.2f\n", num1, num2, num1*num2);
}
}
public void divide(double num1, double num2) {
if (!frozen) {
operations.add(new Operation(num1, "/", num2));
System.out.printf("%.2f / %.2f = %.2f\n", num1, num2, num1/num2);
}
}
// Nested class, for maximum encapsulation.
private class Operation {
public double operand1, operand2;
public String operator;
public Operation(double operand1, String operator, double operand2) {
this.operand1 = operand1;
this.operator = operator;
this.operand2 = operand2;
}
@Override
public String toString() {
return String.format("%.2f %s %.2f", operand1, operator, operand2);
}
}
}
|
UTF-8
|
Java
| 2,084 |
java
|
Calculator.java
|
Java
|
[] | null |
[] |
package interfaces;
import java.util.ArrayList;
import java.util.List;
public class Calculator implements Freezable, Loggable {
private List<Operation> operations = new ArrayList<Operation>();
private boolean frozen = false;
// Implementation of Freezable.
public void freeze() {
frozen = true;
}
public void unfreeze() {
frozen = false;
}
// Implementation of Loggable.
public void logBrief() {
OUTPUT_STREAM.println("\nBrief log of operations:");
OUTPUT_STREAM.println("------------------------");
OUTPUT_STREAM.println("Number of operations: " + operations.size());
OUTPUT_STREAM.println();
}
public void logVerbose() {
OUTPUT_STREAM.println("\nVerbose log of operations:");
OUTPUT_STREAM.println("--------------------------");
for(Operation op: operations) {
OUTPUT_STREAM.println(op);
}
OUTPUT_STREAM.println();
}
// Functionality.
public void add(double num1, double num2) {
if (!frozen) {
operations.add(new Operation(num1, "+", num2));
System.out.printf("%.2f + %.2f = %.2f\n", num1, num2, num1+num2);
}
}
public void subtract(double num1, double num2) {
if (!frozen) {
operations.add(new Operation(num1, "-", num2));
System.out.printf("%.2f - %.2f = %.2f\n", num1, num2, num1-num2);
}
}
public void multiply(double num1, double num2) {
if (!frozen) {
operations.add(new Operation(num1, "*", num2));
System.out.printf("%.2f * %.2f = %.2f\n", num1, num2, num1*num2);
}
}
public void divide(double num1, double num2) {
if (!frozen) {
operations.add(new Operation(num1, "/", num2));
System.out.printf("%.2f / %.2f = %.2f\n", num1, num2, num1/num2);
}
}
// Nested class, for maximum encapsulation.
private class Operation {
public double operand1, operand2;
public String operator;
public Operation(double operand1, String operator, double operand2) {
this.operand1 = operand1;
this.operator = operator;
this.operand2 = operand2;
}
@Override
public String toString() {
return String.format("%.2f %s %.2f", operand1, operator, operand2);
}
}
}
| 2,084 | 0.646353 | 0.619482 | 83 | 24.084337 | 22.831602 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.180723 | false | false |
12
|
f3d7be810d61c6902cb10ba1707d3c03479d52ba
| 38,156,489,463,656 |
600a64e9a72cc1128e249179f82f9d9649c41e8e
|
/app/src/main/java/com/example/the/instacopy/adapter/PhotoAdapter.java
|
98db9e1d6283944ac34634ae62678383a2068b7a
|
[] |
no_license
|
kikidy12/InstaCopy
|
https://github.com/kikidy12/InstaCopy
|
9009d66818814f44fdfb8404332d1658166b9bc3
|
f61b39518210aa6faef9c0a6a38e1716a69d66f7
|
refs/heads/master
| 2021-01-23T02:41:05.137000 | 2017-10-13T03:29:56 | 2017-10-13T03:29:56 | 102,442,856 | 0 | 1 | null | false | 2017-09-07T08:30:10 | 2017-09-05T06:27:41 | 2017-09-05T06:31:31 | 2017-09-07T08:30:10 | 699 | 0 | 0 | 1 |
Java
| null | null |
package com.example.the.instacopy.adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.example.the.instacopy.R;
import com.example.the.instacopy.data.NewsfeedData;
import java.util.List;
/**
* Created by the on 2017-09-05.
*/
public class PhotoAdapter extends ArrayAdapter<NewsfeedData>{
Context mContext;
List<NewsfeedData> mList;
LayoutInflater inf;
int[] dogs = {R.drawable.dog1, R.drawable.dog2, R.drawable.dog3};
public PhotoAdapter(Context context, List<NewsfeedData> list) {
super(context, R.layout.photo_list_item, list);
mContext = context;
mList = list;
inf = LayoutInflater.from(mContext);
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View row = convertView;
if ( row == null) {
row = inf.inflate(R.layout.photo_list_item, null);
}
// NewsfeedData data = mList.get(position);
ImageView photoImg = (ImageView) row.findViewById(R.id.photoImg);
photoImg.setImageResource(dogs[position%3]);
// Glide.with(mContext).load(data.getImageURL()).into(photoImg);
return row;
}
}
|
UTF-8
|
Java
| 1,487 |
java
|
PhotoAdapter.java
|
Java
|
[
{
"context": "edData;\n\nimport java.util.List;\n\n/**\n * Created by the on 2017-09-05.\n */\n\npublic class PhotoAdapter ext",
"end": 493,
"score": 0.9129220247268677,
"start": 490,
"tag": "USERNAME",
"value": "the"
}
] | null |
[] |
package com.example.the.instacopy.adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.example.the.instacopy.R;
import com.example.the.instacopy.data.NewsfeedData;
import java.util.List;
/**
* Created by the on 2017-09-05.
*/
public class PhotoAdapter extends ArrayAdapter<NewsfeedData>{
Context mContext;
List<NewsfeedData> mList;
LayoutInflater inf;
int[] dogs = {R.drawable.dog1, R.drawable.dog2, R.drawable.dog3};
public PhotoAdapter(Context context, List<NewsfeedData> list) {
super(context, R.layout.photo_list_item, list);
mContext = context;
mList = list;
inf = LayoutInflater.from(mContext);
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View row = convertView;
if ( row == null) {
row = inf.inflate(R.layout.photo_list_item, null);
}
// NewsfeedData data = mList.get(position);
ImageView photoImg = (ImageView) row.findViewById(R.id.photoImg);
photoImg.setImageResource(dogs[position%3]);
// Glide.with(mContext).load(data.getImageURL()).into(photoImg);
return row;
}
}
| 1,487 | 0.698722 | 0.690652 | 53 | 27.056604 | 24.019186 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.679245 | false | false |
12
|
6d05215f678f2eb4cd3eca58420249dcd961c022
| 19,859,928,813,529 |
8537003b78cd582397dcf01ba20572b208d0dc54
|
/src/test/nio/DoubleAcceptClient.java
|
1a0e0db020cc378e30be81c268b2807a71f33220
|
[] |
no_license
|
Parkil/Test
|
https://github.com/Parkil/Test
|
d70e874e8899264b1a170dfd7b240972d3151450
|
c08953ea3cbd4f8334d119c8b90f85f4676b2091
|
refs/heads/master
| 2020-04-12T08:42:52.654000 | 2019-09-18T08:30:46 | 2019-09-18T08:30:46 | 14,356,124 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package test.nio;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
/*
* DoubleAccept 클래스의 클라이언트
*/
public class DoubleAcceptClient {
public static void main(String[] args) throws Exception {
SocketChannel sc = SocketChannel.open();
sc.connect(new InetSocketAddress("127.0.0.1",6666));
sc.close();
}
}
|
UHC
|
Java
| 356 |
java
|
DoubleAcceptClient.java
|
Java
|
[
{
"context": "annel.open();\n\t\tsc.connect(new InetSocketAddress(\"127.0.0.1\",6666));\n\t\tsc.close();\n\t}\n}\n",
"end": 309,
"score": 0.9997755885124207,
"start": 300,
"tag": "IP_ADDRESS",
"value": "127.0.0.1"
}
] | null |
[] |
package test.nio;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
/*
* DoubleAccept 클래스의 클라이언트
*/
public class DoubleAcceptClient {
public static void main(String[] args) throws Exception {
SocketChannel sc = SocketChannel.open();
sc.connect(new InetSocketAddress("127.0.0.1",6666));
sc.close();
}
}
| 356 | 0.742604 | 0.713018 | 14 | 23.142857 | 19.755135 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.071429 | false | false |
12
|
7df022b30eebf33b21fdf2b220a4860f7944efaf
| 36,163,624,649,681 |
77c736adf46543fea853cf76dbd53fc6d9eafda4
|
/VeterinariaEPE/src/veterinariaepe/Cliente.java
|
ba759529509710bceedd0be7131e922456a51fbf
|
[] |
no_license
|
Daso/POO-2013-0-M2
|
https://github.com/Daso/POO-2013-0-M2
|
04ae2e5aaed045a19819cea704dc92bfd29318c5
|
8783fc5f75e2bcdb4a2928ee8700dfffa193129f
|
refs/heads/master
| 2016-08-13T01:08:28.025000 | 2013-04-02T02:37:29 | 2013-04-02T02:37:29 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package veterinariaepe;
import java.util.ArrayList;
public class Cliente {
ArrayList<Mascota> mascotas = new ArrayList<Mascota>();
public void agregarMascota(Mascota mascota){
mascotas.add(mascota);
}
public ArrayList mostrarMascotas(){
return mascotas;
}
}
|
UTF-8
|
Java
| 317 |
java
|
Cliente.java
|
Java
|
[] | null |
[] |
package veterinariaepe;
import java.util.ArrayList;
public class Cliente {
ArrayList<Mascota> mascotas = new ArrayList<Mascota>();
public void agregarMascota(Mascota mascota){
mascotas.add(mascota);
}
public ArrayList mostrarMascotas(){
return mascotas;
}
}
| 317 | 0.646688 | 0.646688 | 16 | 17.6875 | 17.810526 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3125 | false | false |
12
|
8ac0cd889a85dc355e1b408e67a4c389020928f3
| 36,378,373,003,455 |
59b9e11d12551e56ccabaf22a5a8581c000720c9
|
/src/main/java/creational/factoryMethod/AbsFactory.java
|
5f334c67175c41e3dc4edc1c46eb9e1096b146cc
|
[] |
no_license
|
symeonn/design-patterns
|
https://github.com/symeonn/design-patterns
|
c6300fdb654d42c20adfdc4fadab80acb8baefec
|
5a3925d7f1085f66739e14771a050850c0d63492
|
refs/heads/master
| 2020-04-18T07:16:34.889000 | 2019-03-04T19:22:42 | 2019-03-04T19:22:42 | 167,354,377 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package creational.factoryMethod;
/**
*
* @author Mariusz Lewandowski; byMario.pl
*/
public abstract class AbsFactory {
public IProduct createProduct() {
return createSpecificProduct();
}
public abstract IProduct createSpecificProduct();
}
|
UTF-8
|
Java
| 253 |
java
|
AbsFactory.java
|
Java
|
[
{
"context": "kage creational.factoryMethod;\n\n/**\n * \n * @author Mariusz Lewandowski; byMario.pl\n */\npublic abstract class AbsFactory ",
"end": 73,
"score": 0.9996381402015686,
"start": 54,
"tag": "NAME",
"value": "Mariusz Lewandowski"
}
] | null |
[] |
package creational.factoryMethod;
/**
*
* @author <NAME>; byMario.pl
*/
public abstract class AbsFactory {
public IProduct createProduct() {
return createSpecificProduct();
}
public abstract IProduct createSpecificProduct();
}
| 240 | 0.747036 | 0.747036 | 15 | 15.866667 | 18.275181 | 50 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false |
12
|
2ec43e5fbda3af42846c0cc4a47508ab15bbf1d6
| 37,563,783,970,930 |
fd3506f30a30da3a5fa48adbef935484c548739d
|
/cloud-common/src/main/java/cn/netinnet/cloudcommon/globol/ResultEnum.java
|
d146a294b4d1be1dca2d76a7647f741f8a8781db
|
[] |
no_license
|
yuyb-git/nin-workflow-cloud
|
https://github.com/yuyb-git/nin-workflow-cloud
|
f7579c591a10058f63321e691b15d78663026ad5
|
cbb8fd9711e4366f2841c1faf2c63c3cb6dc1cad
|
refs/heads/master
| 2023-04-14T03:16:55.994000 | 2021-04-29T07:33:34 | 2021-04-29T07:33:34 | 327,496,386 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package cn.netinnet.cloudcommon.globol;
/**
* @author ouyang.xl
* @version V1.0
* @Description: 返回信息的枚举,code和msg一一对应
* <p>
* 统一枚举各个页面返回信息
* 正确信息为正数,错误信息为负数,
* @Date 2017-11-30
**/
public enum ResultEnum {
/**
* 成功
*/
R_SUCC(200, "成功"),
R_AUTHENTICATION(401, "token not specified"),
R_TOKEN_EXPIRED(402, "token out of date"),
//通过refreshToken进行判断是否异地登录、refreshToken是否失效
R_REFRESH_TOKEN_FAILURE(405, "refreshToken failure"),
R_FORBIDDEN(403, "很抱歉,您没有操作的权限"),
R_PARAM(411, "参数异常"),
// 保存或更新失败
R_STU_OPER(412, "操作失败"),
R_FILE_ERR(413,"Excel模板错误"),
R_IS_NOT_XLS(414, "请选择Excel文件"),
R_OVER_STU_SIZE(415, "人数超过限制"),
R_UPLOAD_NULL(416, "文件不能为空"),
R_NOT_TEACH_CLASS(417,"没有教学班"),
R_GROUP_NOT_STUDENT(418, "小组下没有选手"),
R_REPEAT_SUBMIT(419, "重复提交!"),
R_EXIST_LOGIN(420, "该账号已存在!"),
R_IMPORT_CHECK(421, "导入校验失败!"),
R_SCHOOL_FORBIDDEN(422, "所属学校已被禁用,请联系管理员!"),
R_SCHOOL_NOT_EXSITS(423, "所属学校已不存在,请联系管理员!"),
R_USER_FORBIDDEN(424, "该用户已被禁用!"),
R_USER_NOT_EXIST(444, "用户不存在"),
R_USER_ERR(445,"用户名或密码错误"),
R_IP_NOT_SCOPE(448,"很抱歉,目前您没有访问的权限"),
/**
* 服务端错误
*/
R_INTERNAL_SERVER_ERROR(500, "未知错误"),
R_MISSED_REQUIRED_PARAM(301, "缺少必要参数"),
R_PARAM_NOT_MATCH(302, "查询结果无数据"),
/***
* E打头的只能给正保授权用
*/
E_SUCC(0, "成功"),
E_PARAM(-1, "参数错误"),
E_EXIST(-2, "已经存在"),
E_DEFAULT(-3, "其他错误"),
E_AUTH(-4, "认证错误"),
E_NOTEXIST(-5, "不存在"),
E_RANDCODE(-6, "验证码错误"),
E_OFFLINE(-7, "用户已离线"),
E_DOMAIN(-8, "域名错误"),
E_GEXIST(-9, "其他网已存在"),
E_TOOFAST(-10, "超出频率"),
E_TIMEOUT(-11, "超时"),
E_TOOMANYIP(-12, "超出设备数"),
E_SPANUSER(-13, "疑似垃圾用户"),
E_USERLOCK(-14, "登录锁定"),
E_UEXIST(-15, "绑定时,存在该绑定名称的用户"),
E_NEEDAUTH(-16, "需要验证码"),
E_SESSINVALID(-17, "session过期"),
E_INVALIDMID(-18, "非法的设备"),
E_INVALIDSID(-19, "sid失效");
/**
* 错误代码
*/
private int code;
/**
* 错误信息
*/
private String msg;
ResultEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
|
UTF-8
|
Java
| 3,034 |
java
|
ResultEnum.java
|
Java
|
[
{
"context": "ge cn.netinnet.cloudcommon.globol;\n\n/**\n * @author ouyang.xl\n * @version V1.0\n * @Description: 返回信息的枚举,code和ms",
"end": 65,
"score": 0.9975813627243042,
"start": 56,
"tag": "USERNAME",
"value": "ouyang.xl"
}
] | null |
[] |
package cn.netinnet.cloudcommon.globol;
/**
* @author ouyang.xl
* @version V1.0
* @Description: 返回信息的枚举,code和msg一一对应
* <p>
* 统一枚举各个页面返回信息
* 正确信息为正数,错误信息为负数,
* @Date 2017-11-30
**/
public enum ResultEnum {
/**
* 成功
*/
R_SUCC(200, "成功"),
R_AUTHENTICATION(401, "token not specified"),
R_TOKEN_EXPIRED(402, "token out of date"),
//通过refreshToken进行判断是否异地登录、refreshToken是否失效
R_REFRESH_TOKEN_FAILURE(405, "refreshToken failure"),
R_FORBIDDEN(403, "很抱歉,您没有操作的权限"),
R_PARAM(411, "参数异常"),
// 保存或更新失败
R_STU_OPER(412, "操作失败"),
R_FILE_ERR(413,"Excel模板错误"),
R_IS_NOT_XLS(414, "请选择Excel文件"),
R_OVER_STU_SIZE(415, "人数超过限制"),
R_UPLOAD_NULL(416, "文件不能为空"),
R_NOT_TEACH_CLASS(417,"没有教学班"),
R_GROUP_NOT_STUDENT(418, "小组下没有选手"),
R_REPEAT_SUBMIT(419, "重复提交!"),
R_EXIST_LOGIN(420, "该账号已存在!"),
R_IMPORT_CHECK(421, "导入校验失败!"),
R_SCHOOL_FORBIDDEN(422, "所属学校已被禁用,请联系管理员!"),
R_SCHOOL_NOT_EXSITS(423, "所属学校已不存在,请联系管理员!"),
R_USER_FORBIDDEN(424, "该用户已被禁用!"),
R_USER_NOT_EXIST(444, "用户不存在"),
R_USER_ERR(445,"用户名或密码错误"),
R_IP_NOT_SCOPE(448,"很抱歉,目前您没有访问的权限"),
/**
* 服务端错误
*/
R_INTERNAL_SERVER_ERROR(500, "未知错误"),
R_MISSED_REQUIRED_PARAM(301, "缺少必要参数"),
R_PARAM_NOT_MATCH(302, "查询结果无数据"),
/***
* E打头的只能给正保授权用
*/
E_SUCC(0, "成功"),
E_PARAM(-1, "参数错误"),
E_EXIST(-2, "已经存在"),
E_DEFAULT(-3, "其他错误"),
E_AUTH(-4, "认证错误"),
E_NOTEXIST(-5, "不存在"),
E_RANDCODE(-6, "验证码错误"),
E_OFFLINE(-7, "用户已离线"),
E_DOMAIN(-8, "域名错误"),
E_GEXIST(-9, "其他网已存在"),
E_TOOFAST(-10, "超出频率"),
E_TIMEOUT(-11, "超时"),
E_TOOMANYIP(-12, "超出设备数"),
E_SPANUSER(-13, "疑似垃圾用户"),
E_USERLOCK(-14, "登录锁定"),
E_UEXIST(-15, "绑定时,存在该绑定名称的用户"),
E_NEEDAUTH(-16, "需要验证码"),
E_SESSINVALID(-17, "session过期"),
E_INVALIDMID(-18, "非法的设备"),
E_INVALIDSID(-19, "sid失效");
/**
* 错误代码
*/
private int code;
/**
* 错误信息
*/
private String msg;
ResultEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
| 3,034 | 0.55678 | 0.508051 | 101 | 22.366337 | 14.260465 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.009901 | false | false |
12
|
53c539408d1a4233ea3ec3ea8f3bdff13fc30f69
| 34,333,968,595,163 |
7816bccacdee0feb92de7bb4a4eef19f750c584d
|
/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/SensorGyroRead.java
|
116cacd6f97939b132e8615d8fa0941fca81b3da
|
[
"BSD-3-Clause"
] |
permissive
|
FTCLittleLostRobot/ftc_app
|
https://github.com/FTCLittleLostRobot/ftc_app
|
fcc8d9ab18c5155323f413306e80bd6c0f712105
|
dff2047de1e4c693d7bb3cbdac65887e1fbfcd2f
|
refs/heads/master
| 2021-01-18T21:02:34.115000 | 2019-06-10T02:03:52 | 2019-06-10T02:03:52 | 87,003,689 | 3 | 0 | null | true | 2017-04-02T17:40:16 | 2017-04-02T17:40:16 | 2017-04-01T10:29:35 | 2017-03-25T23:34:41 | 363,769 | 0 | 0 | 0 | null | null | null |
/* Little Lost Robots
Core Devs: Danielle
*/
package org.firstinspires.ftc.teamcode;
import com.qualcomm.hardware.modernrobotics.ModernRoboticsI2cGyro;
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
@TeleOp(name = "Sensor: Read Gyro", group = "Sensor")
@Disabled
public class SensorGyroRead extends OpMode
{
public ModernRoboticsI2cGyro gyro = null;
public void init()
{
gyro = (ModernRoboticsI2cGyro)hardwareMap.gyroSensor.get("gyro");
gyro.calibrate();
gyro.resetZAxisIntegrator();
telemetry.addData("->" , "Ready");
telemetry.update();
}
public void loop()
{
telemetry.addData("Gyro Z Reading" , gyro.getIntegratedZValue());
telemetry.update();
}
}
|
UTF-8
|
Java
| 865 |
java
|
SensorGyroRead.java
|
Java
|
[
{
"context": "/* Little Lost Robots\n Core Devs: Danielle\n*/\n\npackage org.firstinspires.ftc.teamcode;\n\nimpo",
"end": 44,
"score": 0.9997626543045044,
"start": 36,
"tag": "NAME",
"value": "Danielle"
}
] | null |
[] |
/* Little Lost Robots
Core Devs: Danielle
*/
package org.firstinspires.ftc.teamcode;
import com.qualcomm.hardware.modernrobotics.ModernRoboticsI2cGyro;
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
@TeleOp(name = "Sensor: Read Gyro", group = "Sensor")
@Disabled
public class SensorGyroRead extends OpMode
{
public ModernRoboticsI2cGyro gyro = null;
public void init()
{
gyro = (ModernRoboticsI2cGyro)hardwareMap.gyroSensor.get("gyro");
gyro.calibrate();
gyro.resetZAxisIntegrator();
telemetry.addData("->" , "Ready");
telemetry.update();
}
public void loop()
{
telemetry.addData("Gyro Z Reading" , gyro.getIntegratedZValue());
telemetry.update();
}
}
| 865 | 0.699422 | 0.695954 | 33 | 25.212122 | 23.57934 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.484848 | false | false |
12
|
cbe67be4d08d2c8cfc510fecd008c09b3e5f6253
| 3,332,894,629,780 |
eacc33864cb905634c3c36bc1494935bb3dac4a7
|
/trunk/massivePhotoUploaderFacebook/src/com/facebook/api/ExampleClient.java
|
5d0f6d45c1f03f710e471e35997dc352baab91ed
|
[] |
no_license
|
BGCX067/facebookuploader-svn-to-git
|
https://github.com/BGCX067/facebookuploader-svn-to-git
|
2b3de6a28165d419046e0c1a3fb6e6f7e4fdc71b
|
b619703fce0683f5284744d5b0dcd9e45c871e3b
|
refs/heads/master
| 2016-09-01T08:54:06.446000 | 2015-12-28T14:35:40 | 2015-12-28T14:35:40 | 48,842,064 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
+---------------------------------------------------------------------------+
| Facebook Development Platform Java Client |
+---------------------------------------------------------------------------+
| Copyright (c) 2007-2008 Facebook, Inc. |
| All rights reserved. |
| |
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the following conditions |
| are met: |
| |
| 1. Redistributions of source code must retain the above copyright |
| notice, this list of conditions and the following disclaimer. |
| 2. Redistributions in binary form must reproduce the above copyright |
| notice, this list of conditions and the following disclaimer in the |
| documentation and/or other materials provided with the distribution. |
| |
| THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
+---------------------------------------------------------------------------+
| For help with this library, contact developers-help@facebook.com |
+---------------------------------------------------------------------------+
*/
package com.facebook.api;
import edu.stanford.ejalbert.BrowserLauncher;
import java.io.FileInputStream;
import java.util.Properties;
import org.w3c.dom.Document;
public class ExampleClient {
public static final String CONFIG_FILE = "G:/johannes/source/programming/workspace/javaMassiveFacebookUploader/src/com/facebook/api/settings.conf";
public static final String REPLACE_MESSAGE =
" Please enter both your API key and secret in the " + CONFIG_FILE +
" configuration file. Your API key and secret can be found at" +
" http://www.facebook.com/developers/apps.php";
/**
* Test main method:
* - get an auth token (doesn't require a web browser)
* - authenticate the auth token by logging in (requires login in a web browser)
* - get the IDs of the user's friends
*/
public static void main(String[] args) throws Exception {
FileInputStream fis = new FileInputStream(CONFIG_FILE);
Properties props = new Properties();
props.load(fis);
String api_key = props.getProperty("api_key");
String secret = props.getProperty("secret");
if ("<your_api_key>".equals(api_key) || "<your_secret>".equals(secret)) {
System.out.println( REPLACE_MESSAGE );
}
FacebookXmlRestClient client =
new FacebookXmlRestClient(props.getProperty("api_key"), props.getProperty("secret"));
String desktop = props.getProperty("desktop");
if (null != desktop && !"0".equals(desktop))
client.setIsDesktop(true);
// uncomment the line below to get details of each request and respnse
// printed to System.out.
// client.setDebug(true);
String auth = client.auth_createToken();
System.out.println("auth token: " + auth);
BrowserLauncher browserLauncher = new BrowserLauncher(null);
browserLauncher.openURLinBrowser(props.getProperty("login_url") + "&api_key=" +
props.getProperty("api_key") + "&auth_token=" + auth);
System.out.println("hit enter after you have logged into FB");
System.in.read();
// Thread.sleep(5000); // in ms
client.auth_getSession(auth);
Document d = client.friends_get();
FacebookXmlRestClient.printDom(d, " ");
}
}
|
UTF-8
|
Java
| 4,531 |
java
|
ExampleClient.java
|
Java
|
[
{
"context": "---------+\n | For help with this library, contact developers-help@facebook.com |\n +-----------------------------------",
"end": 2231,
"score": 0.999925434589386,
"start": 2203,
"tag": "EMAIL",
"value": "developers-help@facebook.com"
}
] | null |
[] |
/*
+---------------------------------------------------------------------------+
| Facebook Development Platform Java Client |
+---------------------------------------------------------------------------+
| Copyright (c) 2007-2008 Facebook, Inc. |
| All rights reserved. |
| |
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the following conditions |
| are met: |
| |
| 1. Redistributions of source code must retain the above copyright |
| notice, this list of conditions and the following disclaimer. |
| 2. Redistributions in binary form must reproduce the above copyright |
| notice, this list of conditions and the following disclaimer in the |
| documentation and/or other materials provided with the distribution. |
| |
| THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
+---------------------------------------------------------------------------+
| For help with this library, contact <EMAIL> |
+---------------------------------------------------------------------------+
*/
package com.facebook.api;
import edu.stanford.ejalbert.BrowserLauncher;
import java.io.FileInputStream;
import java.util.Properties;
import org.w3c.dom.Document;
public class ExampleClient {
public static final String CONFIG_FILE = "G:/johannes/source/programming/workspace/javaMassiveFacebookUploader/src/com/facebook/api/settings.conf";
public static final String REPLACE_MESSAGE =
" Please enter both your API key and secret in the " + CONFIG_FILE +
" configuration file. Your API key and secret can be found at" +
" http://www.facebook.com/developers/apps.php";
/**
* Test main method:
* - get an auth token (doesn't require a web browser)
* - authenticate the auth token by logging in (requires login in a web browser)
* - get the IDs of the user's friends
*/
public static void main(String[] args) throws Exception {
FileInputStream fis = new FileInputStream(CONFIG_FILE);
Properties props = new Properties();
props.load(fis);
String api_key = props.getProperty("api_key");
String secret = props.getProperty("secret");
if ("<your_api_key>".equals(api_key) || "<your_secret>".equals(secret)) {
System.out.println( REPLACE_MESSAGE );
}
FacebookXmlRestClient client =
new FacebookXmlRestClient(props.getProperty("api_key"), props.getProperty("secret"));
String desktop = props.getProperty("desktop");
if (null != desktop && !"0".equals(desktop))
client.setIsDesktop(true);
// uncomment the line below to get details of each request and respnse
// printed to System.out.
// client.setDebug(true);
String auth = client.auth_createToken();
System.out.println("auth token: " + auth);
BrowserLauncher browserLauncher = new BrowserLauncher(null);
browserLauncher.openURLinBrowser(props.getProperty("login_url") + "&api_key=" +
props.getProperty("api_key") + "&auth_token=" + auth);
System.out.println("hit enter after you have logged into FB");
System.in.read();
// Thread.sleep(5000); // in ms
client.auth_getSession(auth);
Document d = client.friends_get();
FacebookXmlRestClient.printDom(d, " ");
}
}
| 4,510 | 0.574928 | 0.571397 | 90 | 49.344444 | 32.489368 | 149 | false | false | 0 | 0 | 0 | 0 | 96 | 0.021187 | 1.166667 | false | false |
12
|
0779880fcc866a0220c7555314633d9bd2d09155
| 20,134,806,706,760 |
9b21fa7ff1f6234f6f8cbd6583c9c830ac8fcf61
|
/src/test/java/de/skuzzle/inject/async/internal/runnables/ExceptionHandlingRunnableTest.java
|
31b3cd5ec6adb3597c382fc6e8284a70943a52e3
|
[
"MIT"
] |
permissive
|
bgooren/guice-async-extension
|
https://github.com/bgooren/guice-async-extension
|
f964d4ef7ccd791617037a11eeeefd37fc3cc557
|
c6000aaacd4ac45644d830f6b91b568a582e2bdf
|
refs/heads/master
| 2020-07-08T05:29:49.302000 | 2019-08-21T07:14:09 | 2019-08-21T07:14:09 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package de.skuzzle.inject.async.internal.runnables;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import de.skuzzle.inject.async.ExceptionHandler;
@RunWith(MockitoJUnitRunner.class)
public class ExceptionHandlingRunnableTest {
@Mock
private Runnable wrapped;
@Mock
private ExceptionHandler handler;
@InjectMocks
private ExceptionHandlingRunnable subject;
@Test
public void testRunException() throws Exception {
final RuntimeException ex = new RuntimeException();
doThrow(ex).when(this.wrapped).run();
this.subject.run();
verify(this.handler).onException(ex);
}
@Test
public void testRunNoException() throws Exception {
this.subject.run();
verify(this.wrapped).run();
verifyZeroInteractions(this.handler);
}
}
|
UTF-8
|
Java
| 1,077 |
java
|
ExceptionHandlingRunnableTest.java
|
Java
|
[] | null |
[] |
package de.skuzzle.inject.async.internal.runnables;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import de.skuzzle.inject.async.ExceptionHandler;
@RunWith(MockitoJUnitRunner.class)
public class ExceptionHandlingRunnableTest {
@Mock
private Runnable wrapped;
@Mock
private ExceptionHandler handler;
@InjectMocks
private ExceptionHandlingRunnable subject;
@Test
public void testRunException() throws Exception {
final RuntimeException ex = new RuntimeException();
doThrow(ex).when(this.wrapped).run();
this.subject.run();
verify(this.handler).onException(ex);
}
@Test
public void testRunNoException() throws Exception {
this.subject.run();
verify(this.wrapped).run();
verifyZeroInteractions(this.handler);
}
}
| 1,077 | 0.736305 | 0.736305 | 39 | 26.615385 | 19.77776 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.512821 | false | false |
12
|
69ef28a2e015f2c322340a7b793aca17e2a3c69c
| 8,555,574,873,786 |
0408936df603960e9cbe09fcfe011cb38c9f723c
|
/src/com/cig/jfreetype/Bitmap.java
|
377c65946a6ac9bbd8ab80a64599c6d31fd9b106
|
[] |
no_license
|
gamingchris3/jfreetype
|
https://github.com/gamingchris3/jfreetype
|
f606364bb859e2a9e92e965a3fd1998b5cf300cc
|
f0dab28a254b7f563268d2f788a7e2ff9ceb4093
|
refs/heads/master
| 2016-09-05T20:10:24.334000 | 2014-11-30T17:11:31 | 2014-11-30T17:11:31 | 25,778,736 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.cig.jfreetype;
import java.nio.ByteBuffer;
public class Bitmap {
public Bitmap() {
}
public int width;
public int height;
public ByteBuffer pixels;
public int format;
}
|
UTF-8
|
Java
| 190 |
java
|
Bitmap.java
|
Java
|
[] | null |
[] |
package com.cig.jfreetype;
import java.nio.ByteBuffer;
public class Bitmap {
public Bitmap() {
}
public int width;
public int height;
public ByteBuffer pixels;
public int format;
}
| 190 | 0.736842 | 0.736842 | 14 | 12.642858 | 10.886474 | 27 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.857143 | false | false |
12
|
e6276cb64057f5d36849e9fde0bec387270d653b
| 32,942,399,194,114 |
8bea8b69442a3ae49aa6f624c89fbab51caab120
|
/src/main/java/toursite/service/CountryService.java
|
019c2cf19d3749f453ff9ba309ecb5e2b3946ede
|
[] |
no_license
|
vasyl-khomko/site-for-tour-operator
|
https://github.com/vasyl-khomko/site-for-tour-operator
|
6883c55f2b3b3a0f6eaa99fd956f72f8079756b3
|
430d9e4a7bc43c10ff6104605f1b144f1ef1609c
|
refs/heads/master
| 2021-01-10T02:07:46.285000 | 2015-11-06T20:03:12 | 2015-11-06T20:03:12 | 45,702,397 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package toursite.service;
import toursite.model.Country;
import java.util.List;
/**
* Created by Vasyl on 31.05.2015.
*/
public interface CountryService {
public void save(Country country);
public Country findById(int countryId);
public List<Country> findAll();
}
|
UTF-8
|
Java
| 281 |
java
|
CountryService.java
|
Java
|
[
{
"context": "ountry;\n\nimport java.util.List;\n\n/**\n * Created by Vasyl on 31.05.2015.\n */\npublic interface CountryServic",
"end": 106,
"score": 0.998635470867157,
"start": 101,
"tag": "NAME",
"value": "Vasyl"
}
] | null |
[] |
package toursite.service;
import toursite.model.Country;
import java.util.List;
/**
* Created by Vasyl on 31.05.2015.
*/
public interface CountryService {
public void save(Country country);
public Country findById(int countryId);
public List<Country> findAll();
}
| 281 | 0.725979 | 0.697509 | 14 | 19.071428 | 16.254513 | 43 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false |
12
|
3b7e6ec3d5c25628c732f6587613b5c418a0e719
| 25,005,299,617,717 |
9e2948e1518efda55dcfc7b8bd1f13829b419c29
|
/src/com/e1858/protocol/http/DownLoad.java
|
1b48353bd1b9b2867fcfa9e0ca20b8fc88ff0ebf
|
[] |
no_license
|
majiajia1989/JiaCapp
|
https://github.com/majiajia1989/JiaCapp
|
350b17873e3f33c506d67ac9f4e7be77845d0325
|
c94e71f8aee64b1545110928bdc0c917c9996cd2
|
refs/heads/master
| 2021-01-20T21:49:13.627000 | 2014-05-15T06:23:39 | 2014-05-15T06:23:39 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.e1858.protocol.http;
import com.google.gson.annotations.Expose;
public class DownLoad extends PacketRequest {
@Expose
private long id;
public DownLoad(){
setCmd(HttpDefine.DOWNLOAD);
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
}
|
UTF-8
|
Java
| 301 |
java
|
DownLoad.java
|
Java
|
[] | null |
[] |
package com.e1858.protocol.http;
import com.google.gson.annotations.Expose;
public class DownLoad extends PacketRequest {
@Expose
private long id;
public DownLoad(){
setCmd(HttpDefine.DOWNLOAD);
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
}
| 301 | 0.700997 | 0.687708 | 22 | 12.681818 | 14.454903 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false |
12
|
0a59250cf67ac215d95591222929d13421db4a39
| 24,524,263,260,357 |
136f236cc6d264be7e69433ff22799f54c70be5b
|
/src/robotNavigationSimulation_v1/events/AStarNode.java
|
098cadfa1d492f3fec3ed0341e10fa8c1c2ee768
|
[] |
no_license
|
JGPY/behavioral-programming
|
https://github.com/JGPY/behavioral-programming
|
5fb5603a1da80c618ff5753d18406f3bfd2f38b2
|
135f29eacd00ae275f1e64c6e701f0bbcc779518
|
refs/heads/master
| 2021-10-19T14:59:32.989000 | 2019-02-22T01:27:20 | 2019-02-22T01:27:20 | 162,385,873 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package robotNavigationSimulation_v1.events;
/**
* A*节点类
* @author L
*
*/
public class AStarNode extends Node {
private String value; //表示节点的值
private double FValue = 0; //F值
private double GValue = 0; //G值
private double HValue = 0; //H值
private boolean Reachable; //是否可到达(是否为障碍物)
private AStarNode PNode; //父节点
public AStarNode(int x, int y, String value, boolean reachable) {
super();
super.setX(x);
super.setY(y);
this.value = value;
Reachable = reachable;
}
public AStarNode() {
super();
}
@Override
public int getX() {
return super.getX();
}
@Override
public void setX(int x) {
super.setX(x);
}
@Override
public int getY() {
return super.getY();
}
@Override
public void setY(int y) {
super.setY(y);
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public double getFValue() {
return FValue;
}
public void setFValue(double fValue) {
FValue = fValue;
}
public double getGValue() {
return GValue;
}
public void setGValue(double gValue) {
GValue = gValue;
}
public double getHValue() {
return HValue;
}
public void setHValue(double hValue) {
HValue = hValue;
}
public boolean isReachable() {
return Reachable;
}
public void setReachable(boolean reachable) {
Reachable = reachable;
}
public AStarNode getPNode() {
return PNode;
}
public void setPNode(AStarNode pNode) {
PNode = pNode;
}
}
|
UTF-8
|
Java
| 1,777 |
java
|
AStarNode.java
|
Java
|
[
{
"context": "tionSimulation_v1.events;\n\n/**\n * A*节点类\n * @author L\n *\n */\npublic class AStarNode extends Node {\n\n ",
"end": 71,
"score": 0.5603359341621399,
"start": 70,
"tag": "USERNAME",
"value": "L"
}
] | null |
[] |
package robotNavigationSimulation_v1.events;
/**
* A*节点类
* @author L
*
*/
public class AStarNode extends Node {
private String value; //表示节点的值
private double FValue = 0; //F值
private double GValue = 0; //G值
private double HValue = 0; //H值
private boolean Reachable; //是否可到达(是否为障碍物)
private AStarNode PNode; //父节点
public AStarNode(int x, int y, String value, boolean reachable) {
super();
super.setX(x);
super.setY(y);
this.value = value;
Reachable = reachable;
}
public AStarNode() {
super();
}
@Override
public int getX() {
return super.getX();
}
@Override
public void setX(int x) {
super.setX(x);
}
@Override
public int getY() {
return super.getY();
}
@Override
public void setY(int y) {
super.setY(y);
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public double getFValue() {
return FValue;
}
public void setFValue(double fValue) {
FValue = fValue;
}
public double getGValue() {
return GValue;
}
public void setGValue(double gValue) {
GValue = gValue;
}
public double getHValue() {
return HValue;
}
public void setHValue(double hValue) {
HValue = hValue;
}
public boolean isReachable() {
return Reachable;
}
public void setReachable(boolean reachable) {
Reachable = reachable;
}
public AStarNode getPNode() {
return PNode;
}
public void setPNode(AStarNode pNode) {
PNode = pNode;
}
}
| 1,777 | 0.56595 | 0.563626 | 85 | 19.247059 | 15.020697 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.376471 | false | false |
12
|
80967c61b81520168da747dd0e9c0ea829af4538
| 19,370,302,520,202 |
cb18a00e98c733874ff7d43bd7474543d0f578ec
|
/src/main/java/pl/dinosaurus/dinosauruski/registration/student/StudentRegisterServiceImpl.java
|
dd2f3e84d6cccf0b13ffca5cd38648ee2a50de9b
|
[] |
no_license
|
Elton-John/Dinosauruski_app_v.2.0
|
https://github.com/Elton-John/Dinosauruski_app_v.2.0
|
eae4ef4f1ffcdaff561f05a16c25dd96346bd2ce
|
4387271fa322a5890dbeee50fe3010f50ef68624
|
refs/heads/master
| 2023-03-07T21:20:04.330000 | 2021-02-16T14:49:58 | 2021-02-16T14:49:58 | 335,223,801 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package pl.dinosaurus.dinosauruski.registration.student;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pl.dinosaurus.dinosauruski.email.EmailService;
import pl.dinosaurus.dinosauruski.model.User;
import pl.dinosaurus.dinosauruski.registration.RegisterService;
import pl.dinosaurus.dinosauruski.model.VerificationToken;
import pl.dinosaurus.dinosauruski.registration.VerificationTokenService;
import pl.dinosaurus.dinosauruski.student.StudentService;
@Service
@Transactional
@AllArgsConstructor
public class StudentRegisterServiceImpl implements RegisterService {
private final StudentService studentService;
private final VerificationTokenService tokenService;
private final EmailService emailService;
@Override
public User saveUserBeforeEmailVerification(User user) {
User saved = studentService.saveNewUser(user);
sendVerificationTokenByEmail(saved);
return saved;
}
@Override
public void sendVerificationTokenByEmail(User user) {
VerificationToken token = tokenService.createVerificationToken(user);
String confirmationUrl = "/register/student/confirm?token=" + token.getToken();
String message = "Cześć! " +"\r\n"
+ "Zapraszam na Dinosaurus! " + "\r\n"
+ "Utworzyłam dla Ciebie konto. Zalogujesz się używając swojego adresu e-mail" + "\r\n"
+ "Kliknij w poniższy link i ustaw swoje hasło" + "\r\n"
+ "http://localhost:8080" + confirmationUrl + "\r\n" +"\r\n"
+ " Z poważaniem" + "\r\n"
+ " Olga Kryukova i dinozawry.";
emailService.send(user.getEmail(), "Twoje konto na DinosauRUS już gotowe!", message);
}
@Override
public void updateUserAfterVerification(User user) {
user.setHasActivatedAccount(true);
studentService.update(user);
}
}
|
UTF-8
|
Java
| 1,982 |
java
|
StudentRegisterServiceImpl.java
|
Java
|
[
{
"context": " + \" Z poważaniem\" + \"\\r\\n\"\n + \" Olga Kryukova i dinozawry.\";\n emailService.send(user.get",
"end": 1696,
"score": 0.9998919367790222,
"start": 1683,
"tag": "NAME",
"value": "Olga Kryukova"
}
] | null |
[] |
package pl.dinosaurus.dinosauruski.registration.student;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pl.dinosaurus.dinosauruski.email.EmailService;
import pl.dinosaurus.dinosauruski.model.User;
import pl.dinosaurus.dinosauruski.registration.RegisterService;
import pl.dinosaurus.dinosauruski.model.VerificationToken;
import pl.dinosaurus.dinosauruski.registration.VerificationTokenService;
import pl.dinosaurus.dinosauruski.student.StudentService;
@Service
@Transactional
@AllArgsConstructor
public class StudentRegisterServiceImpl implements RegisterService {
private final StudentService studentService;
private final VerificationTokenService tokenService;
private final EmailService emailService;
@Override
public User saveUserBeforeEmailVerification(User user) {
User saved = studentService.saveNewUser(user);
sendVerificationTokenByEmail(saved);
return saved;
}
@Override
public void sendVerificationTokenByEmail(User user) {
VerificationToken token = tokenService.createVerificationToken(user);
String confirmationUrl = "/register/student/confirm?token=" + token.getToken();
String message = "Cześć! " +"\r\n"
+ "Zapraszam na Dinosaurus! " + "\r\n"
+ "Utworzyłam dla Ciebie konto. Zalogujesz się używając swojego adresu e-mail" + "\r\n"
+ "Kliknij w poniższy link i ustaw swoje hasło" + "\r\n"
+ "http://localhost:8080" + confirmationUrl + "\r\n" +"\r\n"
+ " Z poważaniem" + "\r\n"
+ " <NAME> i dinozawry.";
emailService.send(user.getEmail(), "Twoje konto na DinosauRUS już gotowe!", message);
}
@Override
public void updateUserAfterVerification(User user) {
user.setHasActivatedAccount(true);
studentService.update(user);
}
}
| 1,975 | 0.720081 | 0.718053 | 48 | 40.083332 | 28.148293 | 103 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
12
|
6af43b737e2d20d941927c95a898b8271b3117a3
| 31,997,506,384,484 |
90ade407bbfca23d8d8fb7608b968ee44d7cf8ac
|
/src/main/java/ml/bigbrains/withings/model/user/GetDeviceResponse.java
|
3e5ac98734d8c96d7ffc62a7de47d7583b11c92f
|
[
"MIT"
] |
permissive
|
igolyudov/withings-client
|
https://github.com/igolyudov/withings-client
|
157586f3c10b571a8a8a5d725fc3519f7efdd374
|
ecef93c861ca193c5036ff95e7118b69fea84d3a
|
refs/heads/main
| 2023-04-07T12:02:38.848000 | 2021-04-07T19:27:07 | 2021-04-07T19:27:07 | 354,967,789 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ml.bigbrains.withings.model.user;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.ToString;
import ml.bigbrains.withings.model.GenericResponse;
@Data
@ToString(callSuper = true)
public class GetDeviceResponse extends GenericResponse {
@JsonProperty("body")
private DeviceBody body;
}
|
UTF-8
|
Java
| 342 |
java
|
GetDeviceResponse.java
|
Java
|
[] | null |
[] |
package ml.bigbrains.withings.model.user;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.ToString;
import ml.bigbrains.withings.model.GenericResponse;
@Data
@ToString(callSuper = true)
public class GetDeviceResponse extends GenericResponse {
@JsonProperty("body")
private DeviceBody body;
}
| 342 | 0.804094 | 0.804094 | 13 | 25.307692 | 19.522707 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.461538 | false | false |
12
|
6f29be3e50486858bb1ab336ed68dbb8877300fd
| 31,997,506,384,565 |
37dc437ea42afe2269ee59fd82c317475512d14c
|
/src/test/java/de/hhu/propra/sharingplatform/faker/TimeFakerTest.java
|
449504029068ae149be1cabb167c3d6731411ee3
|
[] |
no_license
|
brokelyn/Webapplication-Share-And-Buy
|
https://github.com/brokelyn/Webapplication-Share-And-Buy
|
6f015d53867ff0e559d6f47ad2684159ae7fc7c8
|
ceadb36de7c04260ff73a6eaf0572877c9c28c44
|
refs/heads/master
| 2020-04-27T01:33:52.909000 | 2019-05-09T19:11:51 | 2019-05-09T19:11:51 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package de.hhu.propra.sharingplatform.faker;
import static org.junit.Assert.assertTrue;
import com.github.javafaker.Faker;
import java.time.LocalDateTime;
import java.util.Locale;
import java.util.Random;
import org.junit.Before;
import org.junit.Test;
public class TimeFakerTest {
private TimeFaker timeFaker;
private Faker faker;
@Before
public void initDataFaker() {
long seed = 1337;
Random rnd = new Random();
rnd.setSeed(seed);
faker = new Faker(Locale.ENGLISH, rnd);
timeFaker = new TimeFaker(faker);
}
@Test
public void rndTime() {
LocalDateTime time = timeFaker.rndTime();
LocalDateTime past = LocalDateTime.of(2000, 1, 1, 0, 0, 0);
assertTrue(time.isAfter(past));
}
@Test
public void rndTimeAfter() {
LocalDateTime time = timeFaker.rndTime();
LocalDateTime future = timeFaker.rndTimeAfter(time);
assertTrue(time.isBefore(future));
}
}
|
UTF-8
|
Java
| 986 |
java
|
TimeFakerTest.java
|
Java
|
[] | null |
[] |
package de.hhu.propra.sharingplatform.faker;
import static org.junit.Assert.assertTrue;
import com.github.javafaker.Faker;
import java.time.LocalDateTime;
import java.util.Locale;
import java.util.Random;
import org.junit.Before;
import org.junit.Test;
public class TimeFakerTest {
private TimeFaker timeFaker;
private Faker faker;
@Before
public void initDataFaker() {
long seed = 1337;
Random rnd = new Random();
rnd.setSeed(seed);
faker = new Faker(Locale.ENGLISH, rnd);
timeFaker = new TimeFaker(faker);
}
@Test
public void rndTime() {
LocalDateTime time = timeFaker.rndTime();
LocalDateTime past = LocalDateTime.of(2000, 1, 1, 0, 0, 0);
assertTrue(time.isAfter(past));
}
@Test
public void rndTimeAfter() {
LocalDateTime time = timeFaker.rndTime();
LocalDateTime future = timeFaker.rndTimeAfter(time);
assertTrue(time.isBefore(future));
}
}
| 986 | 0.662272 | 0.649087 | 42 | 22.5 | 18.819 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.642857 | false | false |
12
|
2079cff5959751f58aef59b1be1f8e40778234a7
| 6,090,263,670,274 |
f219b03922e17ab349b80d167899f1b21a9b9be1
|
/DS_TeamProject_C/SY_kkao+boj/boj/B_1697.java
|
5f974e8d5d614033f804a937ef9eaa2a45c4e45b
|
[] |
no_license
|
SoYoung210/acmicpc_note
|
https://github.com/SoYoung210/acmicpc_note
|
e7bf3ed0da546a1297b1e652b80671bb22c71fbe
|
08b636a44543ada239cca0fa1fe5a22b3539321a
|
refs/heads/Practice
| 2020-03-17T20:54:39.431000 | 2018-09-22T02:42:12 | 2018-09-22T02:42:12 | 133,934,521 | 3 | 1 | null | false | 2018-07-17T00:45:21 | 2018-05-18T09:38:35 | 2018-07-16T05:16:48 | 2018-07-17T00:45:21 | 3,295 | 3 | 0 | 6 |
Java
| false | null |
import java.util.LinkedList;
import java.util.Queue;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class B_1697 {
public static final int MAX = 1000000;
public static void main (String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] tmp = br.readLine().split(" ");
int start = Integer.parseInt(tmp[0]);
int target = Integer.parseInt(tmp[1]);
boolean[] visited = new boolean[MAX];
int[] dist = new int[MAX];
for(int i=0; i<=target;i++){
visited[i] = false;
dist[i] = 0;
}
Queue<Integer> q = new LinkedList<Integer>();
visited[start] = true;
q.offer(start);
while(!q.isEmpty()) {
int cur = q.peek();
q.poll();
if(cur+1 < MAX){
if(!visited[cur +1]) {
visited[cur+1] = true;
dist[cur+1] = dist[cur] + 1;
q.offer(cur+1);
}
}
if(cur-1 >=0) {
if(!visited[cur-1]) {
visited[cur-1] = true;
dist[cur-1] = dist[cur] +1;
q.offer(cur-1);
}
}
if(cur*2>=0 && cur*2 < MAX) {
if(!visited[cur*2]) {
visited[cur*2] = true;
dist[cur*2] = dist[cur] + 1;
q.offer(cur*2);
}
}
}
System.out.println(dist[target]);
}
}
|
UTF-8
|
Java
| 1,224 |
java
|
B_1697.java
|
Java
|
[] | null |
[] |
import java.util.LinkedList;
import java.util.Queue;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class B_1697 {
public static final int MAX = 1000000;
public static void main (String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] tmp = br.readLine().split(" ");
int start = Integer.parseInt(tmp[0]);
int target = Integer.parseInt(tmp[1]);
boolean[] visited = new boolean[MAX];
int[] dist = new int[MAX];
for(int i=0; i<=target;i++){
visited[i] = false;
dist[i] = 0;
}
Queue<Integer> q = new LinkedList<Integer>();
visited[start] = true;
q.offer(start);
while(!q.isEmpty()) {
int cur = q.peek();
q.poll();
if(cur+1 < MAX){
if(!visited[cur +1]) {
visited[cur+1] = true;
dist[cur+1] = dist[cur] + 1;
q.offer(cur+1);
}
}
if(cur-1 >=0) {
if(!visited[cur-1]) {
visited[cur-1] = true;
dist[cur-1] = dist[cur] +1;
q.offer(cur-1);
}
}
if(cur*2>=0 && cur*2 < MAX) {
if(!visited[cur*2]) {
visited[cur*2] = true;
dist[cur*2] = dist[cur] + 1;
q.offer(cur*2);
}
}
}
System.out.println(dist[target]);
}
}
| 1,224 | 0.583333 | 0.553922 | 56 | 20.875 | 16.295336 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.946429 | false | false |
12
|
6a5c07007d898442816b93e7c2a3960bb926d9bd
| 27,633,819,612,560 |
03183601bb13daa4a90e739a0a607547986016f8
|
/Scenariusz4/Scenariusz4/src/program/Program.java
|
e5f59159e5d3fa4c1281695808e7d75dbc523a42
|
[] |
no_license
|
lrutyna/PSI_Lukasz_Rutyna
|
https://github.com/lrutyna/PSI_Lukasz_Rutyna
|
48f4df0d0f19a3d8eb4147a76fa690106d678b64
|
8300201b83758b91c2d08f536639e5ee8b69b9bf
|
refs/heads/master
| 2021-05-08T08:34:08.458000 | 2018-01-16T20:13:33 | 2018-01-16T20:13:33 | 107,041,777 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package program;
public class Program {
private static Dane dane = new Dane();
public static void main(String a[]){
int x[][] = dane.getAT(); //dane treningowe
Siec siec = new Siec(35,x);
siec.training();
for(int i=0; i<20;i++){
System.out.print((char)(i+65) + ": ");
siec.testing(x[i]);
}
}
}
|
UTF-8
|
Java
| 394 |
java
|
Program.java
|
Java
|
[] | null |
[] |
package program;
public class Program {
private static Dane dane = new Dane();
public static void main(String a[]){
int x[][] = dane.getAT(); //dane treningowe
Siec siec = new Siec(35,x);
siec.training();
for(int i=0; i<20;i++){
System.out.print((char)(i+65) + ": ");
siec.testing(x[i]);
}
}
}
| 394 | 0.482233 | 0.464467 | 18 | 20.833334 | 17.346951 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.833333 | false | false |
12
|
2f00218307c5b70e5c08409a9e41ca1ab1cf860b
| 31,585,189,556,185 |
bf90d52163e841bc593d5d3bf476a90a2e44215f
|
/cde-core/src/pt/webdetails/cdf/dd/util/CorsUtil.java
|
cf1812bcc1101c4a05d30164b00bf287870ff2b1
|
[] |
no_license
|
carlosrusso/cde
|
https://github.com/carlosrusso/cde
|
34a9dc58940028712da44dc2ef254f6c730ca0ba
|
c659a0f01f3f158f740973bdd39d2648121218d3
|
refs/heads/master
| 2021-01-21T16:00:42.160000 | 2016-01-05T15:33:58 | 2016-01-05T15:33:58 | 15,607,401 | 1 | 1 | null | true | 2015-11-06T10:20:49 | 2014-01-03T10:51:43 | 2015-11-01T19:17:36 | 2015-11-06T10:20:48 | 78,572 | 1 | 1 | 0 |
JavaScript
| null | null |
/*!
* Copyright 2002 - 2015 Webdetails, a Pentaho company. All rights reserved.
*
* This software was developed by Webdetails and is provided under the terms
* of the Mozilla Public License, Version 2.0, or any later version. You may not use
* this file except in compliance with the license. If you need a copy of the license,
* please go to http://mozilla.org/MPL/2.0/. The Initial Developer is Webdetails.
*
* Software distributed under the Mozilla Public License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
* the license for the specific language governing your rights and limitations.
*/
package pt.webdetails.cdf.dd.util;
import pt.webdetails.cdf.dd.CdeConstants;
import pt.webdetails.cdf.dd.CdeEngine;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// TODO: Duplicated class from CDF, move to CPF
public class CorsUtil {
private static CorsUtil instance;
/**
*
* @return
*/
public static CorsUtil getInstance() {
if ( instance == null ) {
instance = new CorsUtil();
}
return instance;
}
/**
*
* @param request
* @param response
*/
public void setCorsHeaders( HttpServletRequest request, HttpServletResponse response ) {
final String allowCrossDomainResources = getAllowCrossDomainResources();
if ( allowCrossDomainResources != null && allowCrossDomainResources.equals( "true" ) ) {
String origin = request.getHeader( "ORIGIN" );
if ( origin != null ) {
response.setHeader( "Access-Control-Allow-Origin", origin );
response.setHeader( "Access-Control-Allow-Credentials", "true" );
}
}
}
/**
*
* @return
*/
protected String getAllowCrossDomainResources() {
return CdeEngine.getInstance().getEnvironment().getResourceLoader().getPluginSetting( CorsUtil.class,
CdeConstants.PLUGIN_SETTINGS_ALLOW_CROSS_DOMAIN_RESOURCES );
}
}
|
UTF-8
|
Java
| 1,984 |
java
|
CorsUtil.java
|
Java
|
[] | null |
[] |
/*!
* Copyright 2002 - 2015 Webdetails, a Pentaho company. All rights reserved.
*
* This software was developed by Webdetails and is provided under the terms
* of the Mozilla Public License, Version 2.0, or any later version. You may not use
* this file except in compliance with the license. If you need a copy of the license,
* please go to http://mozilla.org/MPL/2.0/. The Initial Developer is Webdetails.
*
* Software distributed under the Mozilla Public License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
* the license for the specific language governing your rights and limitations.
*/
package pt.webdetails.cdf.dd.util;
import pt.webdetails.cdf.dd.CdeConstants;
import pt.webdetails.cdf.dd.CdeEngine;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// TODO: Duplicated class from CDF, move to CPF
public class CorsUtil {
private static CorsUtil instance;
/**
*
* @return
*/
public static CorsUtil getInstance() {
if ( instance == null ) {
instance = new CorsUtil();
}
return instance;
}
/**
*
* @param request
* @param response
*/
public void setCorsHeaders( HttpServletRequest request, HttpServletResponse response ) {
final String allowCrossDomainResources = getAllowCrossDomainResources();
if ( allowCrossDomainResources != null && allowCrossDomainResources.equals( "true" ) ) {
String origin = request.getHeader( "ORIGIN" );
if ( origin != null ) {
response.setHeader( "Access-Control-Allow-Origin", origin );
response.setHeader( "Access-Control-Allow-Credentials", "true" );
}
}
}
/**
*
* @return
*/
protected String getAllowCrossDomainResources() {
return CdeEngine.getInstance().getEnvironment().getResourceLoader().getPluginSetting( CorsUtil.class,
CdeConstants.PLUGIN_SETTINGS_ALLOW_CROSS_DOMAIN_RESOURCES );
}
}
| 1,984 | 0.710685 | 0.704637 | 61 | 31.52459 | 32.290489 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.393443 | false | false |
12
|
512e85783ebf87f160db58af78730bbc8b021841
| 21,466,246,563,087 |
382350e3701117770add6ddf31bdab0d928d4007
|
/message-json/src/main/java/message/json/DateTransformer.java
|
70acea898a05985e6f9fb89ad95319fa6573da7c
|
[
"Apache-2.0"
] |
permissive
|
hong0220/cosmos-message
|
https://github.com/hong0220/cosmos-message
|
ce8123dc98e436e2531101b32be29dfec41f27a6
|
e6778ac5522bfbcbd7b4b29cf54ddcca9dc404cd
|
refs/heads/develop
| 2019-07-06T13:46:32.628000 | 2015-07-31T03:16:29 | 2015-07-31T03:16:29 | 41,426,234 | 1 | 0 | null | true | 2015-08-26T13:09:56 | 2015-08-26T13:09:56 | 2015-08-26T12:58:57 | 2015-08-06T05:50:37 | 848 | 0 | 0 | 0 | null | null | null |
package message.json;
import java.text.SimpleDateFormat;
public class DateTransformer implements Transformer {
SimpleDateFormat simpleDateFormatter;
public DateTransformer( String dateFormat ) {
simpleDateFormatter = new SimpleDateFormat( dateFormat );
}
public String transform(Object value) {
return simpleDateFormatter.format( value );
}
}
|
UTF-8
|
Java
| 385 |
java
|
DateTransformer.java
|
Java
|
[] | null |
[] |
package message.json;
import java.text.SimpleDateFormat;
public class DateTransformer implements Transformer {
SimpleDateFormat simpleDateFormatter;
public DateTransformer( String dateFormat ) {
simpleDateFormatter = new SimpleDateFormat( dateFormat );
}
public String transform(Object value) {
return simpleDateFormatter.format( value );
}
}
| 385 | 0.735065 | 0.735065 | 17 | 21.647058 | 23.32366 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.294118 | false | false |
12
|
1b846942eefee36646b5d8d772d0ab53889143ac
| 14,121,852,477,387 |
c4462b512e3378d1f1ca646144f34adf19e98397
|
/app/src/main/java/com/example/rxjavademo/WindowObservableSubscription.java
|
124d38c21793fbdb07b520eeb5efc58d2bd12cd9
|
[] |
no_license
|
unisysTechHub/RxJavaDemo
|
https://github.com/unisysTechHub/RxJavaDemo
|
d3f0c2dc620bd474ef6bc7336e1cefe7bae0235e
|
82843e755a22da350388c62a0a9bc22398f6d816
|
refs/heads/master
| 2020-07-28T21:29:49.049000 | 2019-09-19T12:09:30 | 2019-09-19T12:09:30 | 209,544,028 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.rxjavademo;
import android.util.Log;
import io.reactivex.Observable;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
public class WindowObservableSubscription implements Observer<Observable<Integer>> {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(Observable<Integer> integerObservable) {
Log.d("@Ramesh","Intermediate Observable ");
integerObservable.subscribe(new SequenceSubscriber());
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
}
|
UTF-8
|
Java
| 641 |
java
|
WindowObservableSubscription.java
|
Java
|
[
{
"context": "rvable<Integer> integerObservable) {\n Log.d(\"@Ramesh\",\"Intermediate Observable \");\n int",
"end": 417,
"score": 0.9926884174346924,
"start": 410,
"tag": "USERNAME",
"value": "@Ramesh"
}
] | null |
[] |
package com.example.rxjavademo;
import android.util.Log;
import io.reactivex.Observable;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
public class WindowObservableSubscription implements Observer<Observable<Integer>> {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(Observable<Integer> integerObservable) {
Log.d("@Ramesh","Intermediate Observable ");
integerObservable.subscribe(new SequenceSubscriber());
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
}
| 641 | 0.703588 | 0.703588 | 30 | 20.366667 | 23.340214 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.266667 | false | false |
12
|
2547445bb4cf1578c2e00ff53a3979bf3e89f15a
| 13,615,046,395,450 |
1cfdd368a6ecebc8129aa9e8c8505e88304285d2
|
/Micro/src/main/java/com/atai/micro/module/trment/model/SubTreatmentType.java
|
dbbb86a7e79b98ebefb429481433d2b306296ef4
|
[] |
no_license
|
eighti-atai/Micro
|
https://github.com/eighti-atai/Micro
|
bc38527c8320c205af2df0d744e5a59e8f6025ff
|
7512a37adb71f37762db30790d44793630e9c688
|
refs/heads/master
| 2023-01-07T14:53:25.819000 | 2019-08-14T05:01:55 | 2019-08-14T05:01:55 | 162,071,980 | 0 | 0 | null | false | 2022-12-30T04:23:08 | 2018-12-17T03:55:23 | 2019-08-14T05:02:11 | 2022-12-30T04:23:08 | 79,003 | 0 | 0 | 30 |
Java
| false | false |
package com.atai.micro.module.trment.model;
import java.sql.Blob;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.atai.micro.generic.interfaces.Model;
@Entity
@Table(name = "sub_treatment_type_tab")
public class SubTreatmentType implements Model<SubTreatmentTypeKey> {
@Id
private SubTreatmentTypeKey id;
@ManyToOne
@JoinColumn(name = "mtt_id", referencedColumnName = "mtt_id", insertable = false, updatable = false)
private MainTreatmentType mainTreatmentType;
@Column(name = "stt_name")
private String treatmentName;
@Column(name = "stt_amount")
private Double treatmentAmount;
private String objid;
public MainTreatmentType getMainTreatmentType() {
return mainTreatmentType;
}
public void setMainTreatmentType(MainTreatmentType mainTreatmentType) {
this.mainTreatmentType = mainTreatmentType;
}
public String getTreatmentName() {
return treatmentName;
}
public void setTreatmentName(String treatmentName) {
this.treatmentName = treatmentName;
}
public Double getTreatmentAmount() {
return treatmentAmount;
}
public void setTreatmentAmount(Double treatmentAmount) {
this.treatmentAmount = treatmentAmount;
}
public String getObjid() {
return objid;
}
public void setObjid(String objid) {
this.objid = objid;
}
public SubTreatmentTypeKey getId() {
// TODO Auto-generated method stub
return id;
}
public void setId(SubTreatmentTypeKey id) {
this.id = id;
}
}
|
UTF-8
|
Java
| 1,650 |
java
|
SubTreatmentType.java
|
Java
|
[] | null |
[] |
package com.atai.micro.module.trment.model;
import java.sql.Blob;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.atai.micro.generic.interfaces.Model;
@Entity
@Table(name = "sub_treatment_type_tab")
public class SubTreatmentType implements Model<SubTreatmentTypeKey> {
@Id
private SubTreatmentTypeKey id;
@ManyToOne
@JoinColumn(name = "mtt_id", referencedColumnName = "mtt_id", insertable = false, updatable = false)
private MainTreatmentType mainTreatmentType;
@Column(name = "stt_name")
private String treatmentName;
@Column(name = "stt_amount")
private Double treatmentAmount;
private String objid;
public MainTreatmentType getMainTreatmentType() {
return mainTreatmentType;
}
public void setMainTreatmentType(MainTreatmentType mainTreatmentType) {
this.mainTreatmentType = mainTreatmentType;
}
public String getTreatmentName() {
return treatmentName;
}
public void setTreatmentName(String treatmentName) {
this.treatmentName = treatmentName;
}
public Double getTreatmentAmount() {
return treatmentAmount;
}
public void setTreatmentAmount(Double treatmentAmount) {
this.treatmentAmount = treatmentAmount;
}
public String getObjid() {
return objid;
}
public void setObjid(String objid) {
this.objid = objid;
}
public SubTreatmentTypeKey getId() {
// TODO Auto-generated method stub
return id;
}
public void setId(SubTreatmentTypeKey id) {
this.id = id;
}
}
| 1,650 | 0.769091 | 0.769091 | 75 | 20.986666 | 21.25182 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.12 | false | false |
12
|
8eef77ced9ee1f9ce6f57b7703f1abe40eed2a5c
| 31,344,671,362,526 |
135bec354622330ea6bcf637ef52c7363fb97467
|
/src/Oracle/CarTurkCostructorMethod.java
|
09015eafcc02fc0a2f6502466099b58284ca0696
|
[] |
no_license
|
Orlando-Houston/Java
|
https://github.com/Orlando-Houston/Java
|
1b057b2e6447ba79e2173462139c6714c6743b4c
|
b6ccbf6c05d9cbec9580875be7c5edd6e42f0de9
|
refs/heads/master
| 2020-08-31T09:12:40.047000 | 2020-06-23T22:44:04 | 2020-06-23T22:44:04 | 238,321,900 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Oracle;
public class CarTurkCostructorMethod {
//fields ,properties
public String color;
public String model;
public double engine;
public int doors;
public CarTurkCostructorMethod(String color,String model){
this(color,model,0,0);
}
public CarTurkCostructorMethod(){//constructor overloading) default
//or
/*
this.color="dosn't have information";
this.model="dosn't have information";
this.engine=0;
this.doors=0;
*/
this("dosn't have information","dosn't have information",0,0);
//this diyerek asagidaki const cagrildi
//the following constructor was called saying this
}
//inside parantesis must fields
public CarTurkCostructorMethod(String color,String model,double engine,int doors){//constructor method
//I need to fill in the method
this.color=color;
this.model=model;
this.engine=engine;
this.doors=doors;
}
public void showInfos(){
System.out.println ("Cars color:"+this.color);
System.out.println (this.model);
System.out.println (this.engine);
System.out.println (this.doors);
}
}
|
UTF-8
|
Java
| 1,222 |
java
|
CarTurkCostructorMethod.java
|
Java
|
[] | null |
[] |
package Oracle;
public class CarTurkCostructorMethod {
//fields ,properties
public String color;
public String model;
public double engine;
public int doors;
public CarTurkCostructorMethod(String color,String model){
this(color,model,0,0);
}
public CarTurkCostructorMethod(){//constructor overloading) default
//or
/*
this.color="dosn't have information";
this.model="dosn't have information";
this.engine=0;
this.doors=0;
*/
this("dosn't have information","dosn't have information",0,0);
//this diyerek asagidaki const cagrildi
//the following constructor was called saying this
}
//inside parantesis must fields
public CarTurkCostructorMethod(String color,String model,double engine,int doors){//constructor method
//I need to fill in the method
this.color=color;
this.model=model;
this.engine=engine;
this.doors=doors;
}
public void showInfos(){
System.out.println ("Cars color:"+this.color);
System.out.println (this.model);
System.out.println (this.engine);
System.out.println (this.doors);
}
}
| 1,222 | 0.63748 | 0.63257 | 45 | 26.155556 | 23.237858 | 106 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false |
12
|
b4adfda45ab52cbf50d6ba9616a6d7d62ca112a2
| 3,530,463,169,856 |
078a4f9415d16da0ae244905de0b02553cc9d189
|
/src/main/java/intcode/assembler/AnnotatedOperation.java
|
6a09868983121cd857c50a2841dfb5a79d9fda2c
|
[] |
no_license
|
krka/adventofcode2019
|
https://github.com/krka/adventofcode2019
|
685d9d378150709aa3155cca1c4530af0c8af033
|
61c6e489039ebd5b11c695326d987743c4576f3d
|
refs/heads/master
| 2023-04-28T12:55:29.204000 | 2022-12-23T06:53:48 | 2022-12-23T06:53:48 | 225,612,733 | 0 | 0 | null | false | 2023-04-14T17:58:37 | 2019-12-03T12:19:19 | 2021-12-24T14:13:52 | 2023-04-14T17:58:36 | 884 | 0 | 0 | 2 |
Java
| false | false |
package intcode.assembler;
import util.Util;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
public class AnnotatedOperation {
private final String ops;
private final String description;
private final List<BigInteger> intcode;
private String label;
private int address;
public AnnotatedOperation(String ops, String description, Integer... values) {
this.ops = ops;
this.description = description;
this.intcode = Util.toBigInt(Arrays.asList(values));
}
public AnnotatedOperation(String ops, String description, BigInteger... values) {
this.ops = ops;
this.description = description;
this.intcode = Arrays.asList(values);
}
public static AnnotatedOperation variable(String description, BigInteger value) {
return new AnnotatedOperation("memory", description, value);
}
public List<BigInteger> getIntCode() {
return intcode;
}
public int size() {
return intcode.size();
}
public void setLabel(String label) {
this.label = label;
}
public void setAddress(int address) {
this.address = address;
}
@Override
public String toString() {
String label = this.label == null ? "" : this.label;
return String.format(Locale.ROOT, "%15s%6d: %20s -- %-50s -- %s", label, address, Util.toString(intcode), ops, description);
}
}
|
UTF-8
|
Java
| 1,373 |
java
|
AnnotatedOperation.java
|
Java
|
[] | null |
[] |
package intcode.assembler;
import util.Util;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
public class AnnotatedOperation {
private final String ops;
private final String description;
private final List<BigInteger> intcode;
private String label;
private int address;
public AnnotatedOperation(String ops, String description, Integer... values) {
this.ops = ops;
this.description = description;
this.intcode = Util.toBigInt(Arrays.asList(values));
}
public AnnotatedOperation(String ops, String description, BigInteger... values) {
this.ops = ops;
this.description = description;
this.intcode = Arrays.asList(values);
}
public static AnnotatedOperation variable(String description, BigInteger value) {
return new AnnotatedOperation("memory", description, value);
}
public List<BigInteger> getIntCode() {
return intcode;
}
public int size() {
return intcode.size();
}
public void setLabel(String label) {
this.label = label;
}
public void setAddress(int address) {
this.address = address;
}
@Override
public String toString() {
String label = this.label == null ? "" : this.label;
return String.format(Locale.ROOT, "%15s%6d: %20s -- %-50s -- %s", label, address, Util.toString(intcode), ops, description);
}
}
| 1,373 | 0.703569 | 0.69847 | 55 | 23.963636 | 26.146416 | 128 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.672727 | false | false |
12
|
1fa18d164dc398fdcf4b693317898741d3fdc8ee
| 19,731,079,760,010 |
b5ac8820f337acce5034c74887f6c38f553a20dd
|
/Instagual/src/main/java/Instagual/Editar_perfil.java
|
2c4d7d6fa343908751b09b0dd3227814e1a93b1f
|
[] |
no_license
|
AlejandroFrGU/MDS2-Instagual
|
https://github.com/AlejandroFrGU/MDS2-Instagual
|
00c521c26dba3609e3288ef8c9a956d8d16288c7
|
0226881009328e65eda352945ecb91863ddc2494
|
refs/heads/master
| 2021-10-27T07:17:38.156000 | 2020-02-13T17:23:15 | 2020-02-13T17:23:15 | 240,315,492 | 0 | 0 | null | false | 2021-04-19T14:54:30 | 2020-02-13T17:06:40 | 2020-02-13T17:23:18 | 2021-04-19T14:54:29 | 12,934 | 0 | 0 | 1 |
CSS
| false | false |
package Instagual;
import ual.mds2.app.MyUI;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import com.vaadin.navigator.View;
import com.vaadin.server.ExternalResource;
import com.vaadin.server.Resource;
import com.vaadin.server.Sizeable.Unit;
import com.vaadin.ui.Component;
import com.vaadin.ui.Image;
import com.vaadin.ui.Notification;
import com.vaadin.ui.ProgressBar;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.Upload;
import com.vaadin.ui.Upload.Receiver;
import instagualbdorm.BD_Principal;
import ual.mds2.Instagual.Editar_perfil_ventana;
public class Editar_perfil extends Editar_perfil_ventana implements View{
//private Button _guardarCambiosB;
public Ver_perfil_de_usuario_vista_perfil_propio _ver_perfil_de_usuario_vista_perfil_propio;
public Registrado_con_exitoELIMINAR _registrado_con_exito;
instagualbdorm.Usuario_Registrado userP = null;
iUsuario_registrado iRegistrado = new BD_Principal();
public Editar_perfil() {
if(((MyUI)UI.getCurrent()).getUserType() == 0) {//NO ESTA CONTENIDA
this.setWidth(400,Unit.PIXELS);
this.setHeight(720,Unit.PIXELS);
}
textFieldNombre.setMaxLength(9);
textFieldApellido.setMaxLength(9);
textFieldNombreUsuario.setMaxLength(9);
userP = ((MyUI)UI.getCurrent()).getUsuario();
textFieldImagen.setValue(userP.getFotoPerfil());
imagenPerfil.setSource(new ExternalResource(userP.getFotoPerfil()));
if(userP.getNombre() == null & userP.getApellido()== null) {
textFieldNombre.setValue("");
textFieldApellido.setValue("");
}else {
textFieldNombre.setValue(userP.getNombre());
textFieldApellido.setValue(userP.getApellido());
}
if(((MyUI)UI.getCurrent()).getUsuario().getActivo())
textFieldCodigo.setVisible(false);
if(userP.getNombreUsuario()==null) {
textFieldNombreUsuario.setValue("");
}else {
textFieldNombreUsuario.setValue(userP.getNombreUsuario());
}
buttonGuardarCambios.addClickListener(
event-> EditarPerfil()
);
}
public void EditarPerfil() {
String[] datos = new String[5];
datos[0] = textFieldImagen.getValue();
datos[1] = textFieldNombre.getValue();;
datos[2] = textFieldApellido.getValue();
datos[3] = textFieldNombreUsuario.getValue();
datos[4] = textFieldCodigo.getValue();
//NO ESTA ACTIVO
if(!((MyUI)UI.getCurrent()).getUsuario().getActivo()) {
//ACTIVACION
if(datos[1] .equals("") || datos[2].equals("")|| datos[3].equals("")||datos[4].equals("")) {//FALTAN CAMPOS POR RELLENAR
Notification.show("Faltan campos importantes por rellenar.\n Importantes: Nombre, apellido, nombreUsuario, codigo", Notification.Type.WARNING_MESSAGE);
}else {
if(!textFieldImagen.getValue().equals("") ) {//IMAGEN CORRECTA?
if(textFieldImagen.getValue().contains(".jpg") || textFieldImagen.getValue().contains(".png")||textFieldImagen.getValue().contains(".gif")) {
//si
if(((MyUI)UI.getCurrent()).getUsuario().getCodigo().equals(textFieldCodigo.getValue())) {
if(iRegistrado.Editar_perfil(userP.getORMID(), datos, true)){//PERFIL EDITADO CON EXITO
Notification.show("Código correcto y perfil actualizado!", Notification.Type.WARNING_MESSAGE);
}
}else {//ERROR AL EDITAR PERFIL
Notification.show("Código incorrecto.", Notification.Type.WARNING_MESSAGE);
}
}
}else {//no
Notification.show("El formato de imagen no es correcto!", Notification.Type.WARNING_MESSAGE);//no
}
((MyUI) UI.getCurrent()).setUsuario(null);
((MyUI) UI.getCurrent()).setUserType(0);
((MyUI)UI.getCurrent()).getNavigator1().navigateTo("IniciarSesion");
}
}//ESTA ACTIVO E INICIADO
else if(((MyUI)UI.getCurrent()).getUsuario().getActivo()){
//FALTAN CAMPOS POR RELLENAR
if(datos[1] .equals("") || datos[2].equals("")|| datos[3].equals("")) {
Notification.show("Faltan campos importantes por rellenar.\n Importantes: Nombre, apellido, nombreUsuario, codigo", Notification.Type.WARNING_MESSAGE);
//((MyUI)UI.getCurrent()).getNavigator1().navigateTo("Entrar");
}//TODOS LOS CAMPOS RELLENOS
else {
if(!textFieldImagen.getValue().equals("") ) {//IMAGEN CORRECTA?
if(textFieldImagen.getValue().contains(".jpg") || textFieldImagen.getValue().contains(".png")||textFieldImagen.getValue().contains(".gif")) {
//si
if(iRegistrado.Editar_perfil(userP.getORMID(), datos, true)){//PERFIL EDITADO CON EXITO
Notification.show("Información actualizada", Notification.Type.WARNING_MESSAGE);
((MyUI)UI.getCurrent()).updateUser();
((MyUI)UI.getCurrent()).getNavigator2().navigateTo("VerPerfilPropio");
}else {//ERROR AL EDITAR PERFIL
Notification.show("Hubo un error y no se actualizo la información.\nEs posible que ya exista un usuario con ese nombre.", Notification.Type.WARNING_MESSAGE);
}
}
}else {//no
Notification.show("El formato de imagen no es correcto!", Notification.Type.WARNING_MESSAGE);//no
}
}
}
}
}
|
UTF-8
|
Java
| 5,121 |
java
|
Editar_perfil.java
|
Java
|
[] | null |
[] |
package Instagual;
import ual.mds2.app.MyUI;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import com.vaadin.navigator.View;
import com.vaadin.server.ExternalResource;
import com.vaadin.server.Resource;
import com.vaadin.server.Sizeable.Unit;
import com.vaadin.ui.Component;
import com.vaadin.ui.Image;
import com.vaadin.ui.Notification;
import com.vaadin.ui.ProgressBar;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.Upload;
import com.vaadin.ui.Upload.Receiver;
import instagualbdorm.BD_Principal;
import ual.mds2.Instagual.Editar_perfil_ventana;
public class Editar_perfil extends Editar_perfil_ventana implements View{
//private Button _guardarCambiosB;
public Ver_perfil_de_usuario_vista_perfil_propio _ver_perfil_de_usuario_vista_perfil_propio;
public Registrado_con_exitoELIMINAR _registrado_con_exito;
instagualbdorm.Usuario_Registrado userP = null;
iUsuario_registrado iRegistrado = new BD_Principal();
public Editar_perfil() {
if(((MyUI)UI.getCurrent()).getUserType() == 0) {//NO ESTA CONTENIDA
this.setWidth(400,Unit.PIXELS);
this.setHeight(720,Unit.PIXELS);
}
textFieldNombre.setMaxLength(9);
textFieldApellido.setMaxLength(9);
textFieldNombreUsuario.setMaxLength(9);
userP = ((MyUI)UI.getCurrent()).getUsuario();
textFieldImagen.setValue(userP.getFotoPerfil());
imagenPerfil.setSource(new ExternalResource(userP.getFotoPerfil()));
if(userP.getNombre() == null & userP.getApellido()== null) {
textFieldNombre.setValue("");
textFieldApellido.setValue("");
}else {
textFieldNombre.setValue(userP.getNombre());
textFieldApellido.setValue(userP.getApellido());
}
if(((MyUI)UI.getCurrent()).getUsuario().getActivo())
textFieldCodigo.setVisible(false);
if(userP.getNombreUsuario()==null) {
textFieldNombreUsuario.setValue("");
}else {
textFieldNombreUsuario.setValue(userP.getNombreUsuario());
}
buttonGuardarCambios.addClickListener(
event-> EditarPerfil()
);
}
public void EditarPerfil() {
String[] datos = new String[5];
datos[0] = textFieldImagen.getValue();
datos[1] = textFieldNombre.getValue();;
datos[2] = textFieldApellido.getValue();
datos[3] = textFieldNombreUsuario.getValue();
datos[4] = textFieldCodigo.getValue();
//NO ESTA ACTIVO
if(!((MyUI)UI.getCurrent()).getUsuario().getActivo()) {
//ACTIVACION
if(datos[1] .equals("") || datos[2].equals("")|| datos[3].equals("")||datos[4].equals("")) {//FALTAN CAMPOS POR RELLENAR
Notification.show("Faltan campos importantes por rellenar.\n Importantes: Nombre, apellido, nombreUsuario, codigo", Notification.Type.WARNING_MESSAGE);
}else {
if(!textFieldImagen.getValue().equals("") ) {//IMAGEN CORRECTA?
if(textFieldImagen.getValue().contains(".jpg") || textFieldImagen.getValue().contains(".png")||textFieldImagen.getValue().contains(".gif")) {
//si
if(((MyUI)UI.getCurrent()).getUsuario().getCodigo().equals(textFieldCodigo.getValue())) {
if(iRegistrado.Editar_perfil(userP.getORMID(), datos, true)){//PERFIL EDITADO CON EXITO
Notification.show("Código correcto y perfil actualizado!", Notification.Type.WARNING_MESSAGE);
}
}else {//ERROR AL EDITAR PERFIL
Notification.show("Código incorrecto.", Notification.Type.WARNING_MESSAGE);
}
}
}else {//no
Notification.show("El formato de imagen no es correcto!", Notification.Type.WARNING_MESSAGE);//no
}
((MyUI) UI.getCurrent()).setUsuario(null);
((MyUI) UI.getCurrent()).setUserType(0);
((MyUI)UI.getCurrent()).getNavigator1().navigateTo("IniciarSesion");
}
}//ESTA ACTIVO E INICIADO
else if(((MyUI)UI.getCurrent()).getUsuario().getActivo()){
//FALTAN CAMPOS POR RELLENAR
if(datos[1] .equals("") || datos[2].equals("")|| datos[3].equals("")) {
Notification.show("Faltan campos importantes por rellenar.\n Importantes: Nombre, apellido, nombreUsuario, codigo", Notification.Type.WARNING_MESSAGE);
//((MyUI)UI.getCurrent()).getNavigator1().navigateTo("Entrar");
}//TODOS LOS CAMPOS RELLENOS
else {
if(!textFieldImagen.getValue().equals("") ) {//IMAGEN CORRECTA?
if(textFieldImagen.getValue().contains(".jpg") || textFieldImagen.getValue().contains(".png")||textFieldImagen.getValue().contains(".gif")) {
//si
if(iRegistrado.Editar_perfil(userP.getORMID(), datos, true)){//PERFIL EDITADO CON EXITO
Notification.show("Información actualizada", Notification.Type.WARNING_MESSAGE);
((MyUI)UI.getCurrent()).updateUser();
((MyUI)UI.getCurrent()).getNavigator2().navigateTo("VerPerfilPropio");
}else {//ERROR AL EDITAR PERFIL
Notification.show("Hubo un error y no se actualizo la información.\nEs posible que ya exista un usuario con ese nombre.", Notification.Type.WARNING_MESSAGE);
}
}
}else {//no
Notification.show("El formato de imagen no es correcto!", Notification.Type.WARNING_MESSAGE);//no
}
}
}
}
}
| 5,121 | 0.708814 | 0.703146 | 136 | 36.632355 | 35.92963 | 164 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.242647 | false | false |
12
|
da0da4641b8e6cd620d0b7d5b80c53743a043809
| 17,523,466,614,443 |
9525016b2de8be9375b63c306685ee6a57d89c7d
|
/src/sudoku_for_Csharp/generator.java
|
2862f3f4c4f98c19012f3e1dd1f221d55bf83d97
|
[] |
no_license
|
cookieminions/Sudoku-Java-
|
https://github.com/cookieminions/Sudoku-Java-
|
5223111dd764e435fa447cd2e5af8f7524b60a3d
|
43321fc5fc55d66a359855319e96fe217d8e5f12
|
refs/heads/master
| 2021-06-30T13:35:47.389000 | 2017-09-20T14:10:17 | 2017-09-20T14:10:17 | 104,221,554 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package sudoku_for_Csharp;
import java.util.ArrayList;
import java.util.Random;
public class generator {
static final int SIZE = 9;
int[][] board;
int[][] resboard;
boolean flag = false;
public generator() {
board = new int[SIZE][SIZE];
resboard = new int[SIZE][SIZE];
for(int i=0;i<SIZE;i++){
for(int j=0;j<SIZE;j++)
board[i][j] = 0;
}
board[0][0] = 7;
}
public void generateN(int N){
generateOne();
for(int t=0;t<N;t++){
int[][] tmp = new int[SIZE][SIZE];
assign(resboard, tmp);
change(tmp);
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
System.out.print(tmp[i][j] + " ");
}
System.out.println();
}
System.out.println();
}
}
public void generateOne(){
generate(1);
flag = false;
}
private void generate(int num){
if(flag)
return;
if(num==SIZE*SIZE){
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
resboard[i][j] = board[i][j];
System.out.print(board[i][j] + " ");
}
System.out.println();
}
flag = true;
return;
}
int x = num/9, y = num%9;
if(board[x][y]==0){
int i = 0;
Random r = new Random();
while(i<9){
ArrayList<Integer> mylist = new ArrayList<Integer>(9);
int m = r.nextInt(9)+1;
while(mylist.contains(m)) m = r.nextInt(9)+1;
mylist.add(m);
i++;
//System.out.println(x + " " + y + " " + m);
if(isValid(board, x, y, m)){
board[x][y] = m;
generate(num+1);
}
}
board[x][y] = 0;
}else{
generate(num+1);
}
}
private boolean isValid(int[][] board, int row, int col, int c){
for(int i=0;i<9;i++){
if(board[i][col]!=0 && board[i][col]==c) return false;
if(board[row][i]!=0 && board[row][i]==c) return false;
int cube1 = 3*(row/3)+i/3, cube2 = 3*(col/3)+i%3;
if(board[cube1][cube2]!=0 && board[cube1][cube2]==c) return false;
}
return true;
}
public void change(int[][] board) {
Random random = new Random();
int rowtime = random.nextInt(10)+5;
int coltime = random.nextInt(10)+5;
int numtime = random.nextInt(15)+10;
for(int i=0;i<numtime;i++){
int x = random.nextInt(9)+1;
int y = random.nextInt(9)+1;
if(x!=y&&x!=7&&y!=7)
swapnum(board, x, y);
else
--i;
}
for(int i=0;i<rowtime;i++){
int base = 3*random.nextInt(3);
int x = base + random.nextInt(3);
int y = base + random.nextInt(3);
if(x!=y&&x!=0&&y!=0)
swaprow(board, x, y);
}
for(int i=0;i<coltime;i++){
int base = 3*random.nextInt(3);
int x = base + random.nextInt(3);
int y = base + random.nextInt(3);
if(x!=y&&x!=0&&y!=0)
swapcol(board, x, y);
}
}
public void swapnum(int[][] board,int i,int j){
for(int x=0;x<9;x++){
for(int y=0;y<9;y++){
board[x][y] = (board[x][y]==i)?j:(board[x][y]==j)?i:board[x][y];
}
}
}
public void swaprow(int[][] board,int i,int j){
int[] tmp = new int[9];
tmp = board[i];
board[i] = board[j];
board[j] = tmp;
}
public void swapcol(int[][] board,int i,int j){
int tmp = 0;
for(int x=0;x<9;x++){
tmp = board[x][i];
board[x][i] = board[x][j];
board[x][j] = tmp;
}
}
public void assign(int[][] raw,int[][] a){
for(int i=0;i<SIZE;i++){
for(int j=0;j<SIZE;j++){
a[i][j] = raw[i][j];
}
}
}
public static void main(String[] args){
generator g = new generator();
g.generateN(1000);
}
}
|
UTF-8
|
Java
| 3,509 |
java
|
generator.java
|
Java
|
[] | null |
[] |
package sudoku_for_Csharp;
import java.util.ArrayList;
import java.util.Random;
public class generator {
static final int SIZE = 9;
int[][] board;
int[][] resboard;
boolean flag = false;
public generator() {
board = new int[SIZE][SIZE];
resboard = new int[SIZE][SIZE];
for(int i=0;i<SIZE;i++){
for(int j=0;j<SIZE;j++)
board[i][j] = 0;
}
board[0][0] = 7;
}
public void generateN(int N){
generateOne();
for(int t=0;t<N;t++){
int[][] tmp = new int[SIZE][SIZE];
assign(resboard, tmp);
change(tmp);
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
System.out.print(tmp[i][j] + " ");
}
System.out.println();
}
System.out.println();
}
}
public void generateOne(){
generate(1);
flag = false;
}
private void generate(int num){
if(flag)
return;
if(num==SIZE*SIZE){
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
resboard[i][j] = board[i][j];
System.out.print(board[i][j] + " ");
}
System.out.println();
}
flag = true;
return;
}
int x = num/9, y = num%9;
if(board[x][y]==0){
int i = 0;
Random r = new Random();
while(i<9){
ArrayList<Integer> mylist = new ArrayList<Integer>(9);
int m = r.nextInt(9)+1;
while(mylist.contains(m)) m = r.nextInt(9)+1;
mylist.add(m);
i++;
//System.out.println(x + " " + y + " " + m);
if(isValid(board, x, y, m)){
board[x][y] = m;
generate(num+1);
}
}
board[x][y] = 0;
}else{
generate(num+1);
}
}
private boolean isValid(int[][] board, int row, int col, int c){
for(int i=0;i<9;i++){
if(board[i][col]!=0 && board[i][col]==c) return false;
if(board[row][i]!=0 && board[row][i]==c) return false;
int cube1 = 3*(row/3)+i/3, cube2 = 3*(col/3)+i%3;
if(board[cube1][cube2]!=0 && board[cube1][cube2]==c) return false;
}
return true;
}
public void change(int[][] board) {
Random random = new Random();
int rowtime = random.nextInt(10)+5;
int coltime = random.nextInt(10)+5;
int numtime = random.nextInt(15)+10;
for(int i=0;i<numtime;i++){
int x = random.nextInt(9)+1;
int y = random.nextInt(9)+1;
if(x!=y&&x!=7&&y!=7)
swapnum(board, x, y);
else
--i;
}
for(int i=0;i<rowtime;i++){
int base = 3*random.nextInt(3);
int x = base + random.nextInt(3);
int y = base + random.nextInt(3);
if(x!=y&&x!=0&&y!=0)
swaprow(board, x, y);
}
for(int i=0;i<coltime;i++){
int base = 3*random.nextInt(3);
int x = base + random.nextInt(3);
int y = base + random.nextInt(3);
if(x!=y&&x!=0&&y!=0)
swapcol(board, x, y);
}
}
public void swapnum(int[][] board,int i,int j){
for(int x=0;x<9;x++){
for(int y=0;y<9;y++){
board[x][y] = (board[x][y]==i)?j:(board[x][y]==j)?i:board[x][y];
}
}
}
public void swaprow(int[][] board,int i,int j){
int[] tmp = new int[9];
tmp = board[i];
board[i] = board[j];
board[j] = tmp;
}
public void swapcol(int[][] board,int i,int j){
int tmp = 0;
for(int x=0;x<9;x++){
tmp = board[x][i];
board[x][i] = board[x][j];
board[x][j] = tmp;
}
}
public void assign(int[][] raw,int[][] a){
for(int i=0;i<SIZE;i++){
for(int j=0;j<SIZE;j++){
a[i][j] = raw[i][j];
}
}
}
public static void main(String[] args){
generator g = new generator();
g.generateN(1000);
}
}
| 3,509 | 0.514962 | 0.488743 | 153 | 21.934641 | 16.339804 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.901961 | false | false |
12
|
7933293772aea038407284d60b14fa38ca8396fc
| 8,426,725,871,855 |
b2d685eb8fd36cd895c4ff28ba6b343211239f4e
|
/src/main/java/fr/ign/cogit/cartagen/core/defaultschema/road/RoadStrokeDefault.java
|
50bf72e6817d93a53693d1435007099f69e4b8b5
|
[] |
no_license
|
GeOxygene/cartagen-core
|
https://github.com/GeOxygene/cartagen-core
|
71a7501cc6d714a529ebab42593b4c5c0e939512
|
0595ff4083dfe612379a80fb58bde1e7339224d5
|
refs/heads/master
| 2022-07-27T10:58:29.547000 | 2021-06-08T17:44:48 | 2021-06-08T17:44:48 | 375,074,549 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*******************************************************************************
* This software is released under the licence CeCILL
*
* see Licence_CeCILL-C_fr.html see Licence_CeCILL-C_en.html
*
* see <a href="http://www.cecill.info/">http://www.cecill.info/a>
*
* @copyright IGN
******************************************************************************/
package fr.ign.cogit.cartagen.core.defaultschema.road;
import java.util.ArrayList;
import fr.ign.cogit.cartagen.core.defaultschema.GeneObjLinDefault;
import fr.ign.cogit.cartagen.core.genericschema.road.IRoadStroke;
import fr.ign.cogit.cartagen.spatialanalysis.network.roads.RoadStroke;
import fr.ign.cogit.geoxygene.api.spatial.coordgeom.ILineString;
import fr.ign.cogit.geoxygene.schemageo.api.support.reseau.ArcReseau;
public class RoadStrokeDefault extends GeneObjLinDefault implements IRoadStroke {
private ILineString geomStroke;
private RoadStroke stroke;
public RoadStrokeDefault(ILineString geom, RoadStroke stroke) {
super();
this.setGeom(geom);
this.geomStroke = geom;
this.stroke = stroke;
}
@Override
public ILineString getGeomStroke() {
return geomStroke;
}
@Override
public ArrayList<ArcReseau> getFeatures() {
return stroke.getFeatures();
}
@Override
public RoadStroke getRoadStroke() {
return stroke;
}
}
|
UTF-8
|
Java
| 1,359 |
java
|
RoadStrokeDefault.java
|
Java
|
[] | null |
[] |
/*******************************************************************************
* This software is released under the licence CeCILL
*
* see Licence_CeCILL-C_fr.html see Licence_CeCILL-C_en.html
*
* see <a href="http://www.cecill.info/">http://www.cecill.info/a>
*
* @copyright IGN
******************************************************************************/
package fr.ign.cogit.cartagen.core.defaultschema.road;
import java.util.ArrayList;
import fr.ign.cogit.cartagen.core.defaultschema.GeneObjLinDefault;
import fr.ign.cogit.cartagen.core.genericschema.road.IRoadStroke;
import fr.ign.cogit.cartagen.spatialanalysis.network.roads.RoadStroke;
import fr.ign.cogit.geoxygene.api.spatial.coordgeom.ILineString;
import fr.ign.cogit.geoxygene.schemageo.api.support.reseau.ArcReseau;
public class RoadStrokeDefault extends GeneObjLinDefault implements IRoadStroke {
private ILineString geomStroke;
private RoadStroke stroke;
public RoadStrokeDefault(ILineString geom, RoadStroke stroke) {
super();
this.setGeom(geom);
this.geomStroke = geom;
this.stroke = stroke;
}
@Override
public ILineString getGeomStroke() {
return geomStroke;
}
@Override
public ArrayList<ArcReseau> getFeatures() {
return stroke.getFeatures();
}
@Override
public RoadStroke getRoadStroke() {
return stroke;
}
}
| 1,359 | 0.664459 | 0.664459 | 47 | 27.914894 | 27.287149 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.361702 | false | false |
12
|
2dd0739508ca24f2d8db525e85679406e6e9f95c
| 21,775,484,239,232 |
0fe0d38cd279a27472263c457ba40a98ab94910e
|
/java/br/com/square/tnp/enumerations/StatusTerminal.java
|
d9f237fa11f8f2aed9ee64162de4df27bfa5ffa0
|
[] |
no_license
|
diegoParente23/TNP-System
|
https://github.com/diegoParente23/TNP-System
|
1c79c579123613e8b5b7c31a1a0859e370ce82b3
|
3ab7d2f4394c1f36b189968e163c4472222a41d7
|
refs/heads/master
| 2018-09-03T13:51:03.043000 | 2015-09-03T01:16:20 | 2015-09-03T01:16:20 | 39,742,493 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.com.square.tnp.enumerations;
public enum StatusTerminal implements Enums {
DISPONIVEL,
BLOQUEADO
}
|
UTF-8
|
Java
| 113 |
java
|
StatusTerminal.java
|
Java
|
[] | null |
[] |
package br.com.square.tnp.enumerations;
public enum StatusTerminal implements Enums {
DISPONIVEL,
BLOQUEADO
}
| 113 | 0.80531 | 0.80531 | 6 | 17.833334 | 17.714558 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false |
12
|
0de384bc7dbe4bc10711d8b34e003772d9f94ff3
| 2,499,671,005,588 |
465b61b8c279b4481735a95fd6c0ca74a0066259
|
/invoice-generator/logic-ejb/src/main/java/pl/invoicegenerator/logic/model/InvoiceRequest.java
|
9df5053df19bbb72a5c15bb3d2bcb49a09e7954e
|
[] |
no_license
|
adrianDyj/Umowmecz-Java-EE
|
https://github.com/adrianDyj/Umowmecz-Java-EE
|
32ad924324a49d8a32f88a281fecba56baad4384
|
6c8ce7c3497da41b3f1262906b8b4e368854f579
|
refs/heads/master
| 2018-11-04T23:11:29.453000 | 2018-10-22T20:40:00 | 2018-10-22T20:40:00 | 146,122,087 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package pl.invoicegenerator.logic.model;
import pl.invoicegenerator.commons.model.enums.DocumentType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.math.BigDecimal;
import java.util.Date;
@XmlRootElement(name = "InvoiceRequest")
public class InvoiceRequest {
private DocumentType documentType;
private Date dateOfCreation;
private Date saleDate;
private String bankAccountNumber;
private String nameOfService;
private int unitPrice;
private int numberOfGoods;
@XmlElement(name = "DocumentType", required = true)
public DocumentType getDocumentType() {
return documentType;
}
public void setDocumentType(DocumentType documentType) {
this.documentType = documentType;
}
@XmlElement(name = "DateOfCreation", required = true)
public Date getDateOfCreation() {
return dateOfCreation;
}
public void setDateOfCreation(Date dateOfCreation) {
this.dateOfCreation = dateOfCreation;
}
@XmlElement(name = "SaleDate", required = true)
public Date getSaleDate() {
return saleDate;
}
public void setSaleDate(Date saleDate) {
this.saleDate = saleDate;
}
@XmlElement(name = "BankAccountNumber", required = true)
public String getBankAccountNumber() {
return bankAccountNumber;
}
public void setBankAccountNumber(String bankAccountNumber) {
this.bankAccountNumber = bankAccountNumber;
}
@XmlElement(name = "NameOfService", required = true)
public String getNameOfService() {
return nameOfService;
}
public void setNameOfService(String nameOfService) {
this.nameOfService = nameOfService;
}
@XmlElement(name = "UnitPrice", required = true)
public int getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(int unitPrice) {
this.unitPrice = unitPrice;
}
@XmlElement(name = "NumberOfGoods", required = true)
public int getNumberOfGoods() {
return numberOfGoods;
}
public void setNumberOfGoods(int numberOfGoods) {
this.numberOfGoods = numberOfGoods;
}
}
|
UTF-8
|
Java
| 2,204 |
java
|
InvoiceRequest.java
|
Java
|
[] | null |
[] |
package pl.invoicegenerator.logic.model;
import pl.invoicegenerator.commons.model.enums.DocumentType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.math.BigDecimal;
import java.util.Date;
@XmlRootElement(name = "InvoiceRequest")
public class InvoiceRequest {
private DocumentType documentType;
private Date dateOfCreation;
private Date saleDate;
private String bankAccountNumber;
private String nameOfService;
private int unitPrice;
private int numberOfGoods;
@XmlElement(name = "DocumentType", required = true)
public DocumentType getDocumentType() {
return documentType;
}
public void setDocumentType(DocumentType documentType) {
this.documentType = documentType;
}
@XmlElement(name = "DateOfCreation", required = true)
public Date getDateOfCreation() {
return dateOfCreation;
}
public void setDateOfCreation(Date dateOfCreation) {
this.dateOfCreation = dateOfCreation;
}
@XmlElement(name = "SaleDate", required = true)
public Date getSaleDate() {
return saleDate;
}
public void setSaleDate(Date saleDate) {
this.saleDate = saleDate;
}
@XmlElement(name = "BankAccountNumber", required = true)
public String getBankAccountNumber() {
return bankAccountNumber;
}
public void setBankAccountNumber(String bankAccountNumber) {
this.bankAccountNumber = bankAccountNumber;
}
@XmlElement(name = "NameOfService", required = true)
public String getNameOfService() {
return nameOfService;
}
public void setNameOfService(String nameOfService) {
this.nameOfService = nameOfService;
}
@XmlElement(name = "UnitPrice", required = true)
public int getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(int unitPrice) {
this.unitPrice = unitPrice;
}
@XmlElement(name = "NumberOfGoods", required = true)
public int getNumberOfGoods() {
return numberOfGoods;
}
public void setNumberOfGoods(int numberOfGoods) {
this.numberOfGoods = numberOfGoods;
}
}
| 2,204 | 0.69147 | 0.69147 | 89 | 23.764046 | 21.24074 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.382022 | false | false |
12
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.