id
stringlengths 36
36
| meta
stringlengths 429
697
| url
stringlengths 27
109
| tokens
int64 137
584
| domain_prefix
stringlengths 16
106
| score
float64 0.16
0.3
| code_content
stringlengths 960
1.25k
|
|---|---|---|---|---|---|---|
5e8be436-60cb-45e1-a578-c62c67c3c62a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-06 17:11:38", "repo_name": "alghubari2017/Myvegetable2", "sub_path": "/src/main/java/com/alghubari/myfv/modle/Product.java", "file_name": "Product.java", "file_ext": "java", "file_size_in_byte": 1073, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "7b60c864cb2cb5880258d8ac05f4017e9bc826f0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/alghubari2017/Myvegetable2
| 250
|
FILENAME: Product.java
| 0.252384
|
package com.alghubari.myfv.modle;
public class Product {
private String productName1;
private String productUnite1;
private int productPrice1;
// private int photoUrl1;
public Product(String productName1, String productUnite1, int productPrice1) {
this.productName1 = productName1;
this.productUnite1 = productUnite1;
this.productPrice1 = productPrice1;
}
public Product() {
}
public Product(String productName1) {
this.productName1 = productName1;
}
public String getProductName1() {
return productName1;
}
public void setProductName1(String productName1) {
this.productName1 = productName1;
}
public String getProductUnite1() {
return productUnite1;
}
public void setProductUnite1(String productUnite1) {
this.productUnite1 = productUnite1;
}
public int getProductPrice1() {
return productPrice1;
}
public void setProductPrice1(int productPrice1) {
this.productPrice1 = productPrice1;
}
}
|
af9c8bbe-d5f0-4062-ad77-4930407bebe6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-10-18T15:01:58", "repo_name": "mohammadmoustafa/MongoDB-Driver-for-Java", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1160, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "e29019a2fd3f647d6958a355d4c6258aba8b3c30", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mohammadmoustafa/MongoDB-Driver-for-Java
| 269
|
FILENAME: README.md
| 0.216012
|
# MongoDB Driver for Java
This driver was created as a means to simplify the use of MongoDB within a Java project.
## Current Version
The current version of the driver supports MongoDB **v3.5**
## Installation
### Maven
Add the following to your `pom.xml`:
```
<dependencies>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.5.0</version>
</dependency>
</dependencies>
```
**Note:** Make sure you use the version of MongoDB that works with this driver. You can find the Mongo dependencies [here.](https://mongodb.github.io/mongo-java-driver/)
### Gradle
Add the following to your gradle dependencies:
```
dependencies {
compile 'org.mongodb:mongo-java-driver:3.5.0'
}
```
**Note:** Make sure you use the version of MongoDB that works with this driver. You can find the Mongo dependencies [here.](https://mongodb.github.io/mongo-java-driver/)
### Not using Maven or Gradle?
You can download an uber jar for use with your project. Download the jar and include it in your projects build path.
### Adding the Driver
Include the provided jar file in your projects build path.
|
48950ccc-7718-42f2-9ad8-2a3b1072774d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-07 14:15:44", "repo_name": "gaoyan0723/px-submission-tool", "sub_path": "/src/main/java/uk/ac/ebi/pride/gui/form/SummaryDescriptor.java", "file_name": "SummaryDescriptor.java", "file_ext": "java", "file_size_in_byte": 1099, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "a8aebdc79bdc51d706d020bcca348254e5ff21e0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gaoyan0723/px-submission-tool
| 234
|
FILENAME: SummaryDescriptor.java
| 0.281406
|
package uk.ac.ebi.pride.gui.form;
import uk.ac.ebi.pride.App;
import uk.ac.ebi.pride.gui.form.comp.ContextAwareNavigationPanelDescriptor;
import uk.ac.ebi.pride.gui.navigation.Navigator;
import javax.help.HelpBroker;
import javax.swing.*;
/**
* SummaryDescriptor
*
* @author Rui Wang
* @version $Id$
*/
public class SummaryDescriptor extends ContextAwareNavigationPanelDescriptor {
public SummaryDescriptor(String id, String title, String desc) {
super(id, title, desc, new SummaryForm());
}
/**
* Method to be performed to show help document
* Override this method to add help functionality
*/
@Override
public void getHelp() {
HelpBroker hb = appContext.getMainHelpBroker();
hb.showID("help.submission.summary", "javax.help.SecondaryWindow", "main");
}
@Override
public void displayingPanel() {
Navigator navigator = ((App) App.getInstance()).getNavigator();
JButton nextButton = navigator.getNextButton();
nextButton.setText(appContext.getProperty("summary.submit.button.title"));
}
}
|
7c36adb6-d0c6-4e05-9b3e-13006ef9ee7e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-16 15:49:37", "repo_name": "santosh-suresh/jCIS", "sub_path": "/src/main/java/com/jifflenow/cis/models/ErrorMessage.java", "file_name": "ErrorMessage.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "3a0ed2bc9ed3d4ac6a0e49ff548c7608aca92ab2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/santosh-suresh/jCIS
| 210
|
FILENAME: ErrorMessage.java
| 0.212069
|
package com.jifflenow.cis.models;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;
public class ErrorMessage {
private int status;
private String message;
private Map<String, String> errors = new HashMap<String, String>();
public ErrorMessage() {
super();
}
public ErrorMessage(int status, String message) {
this();
this.status = status;
this.message = message;
}
public void addErrorMessage(String key, String message) {
errors.put(key, message);
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Map<String, String> getErrors() {
return errors;
}
public void setErrors(Map<String, String> errors) {
this.errors = errors;
}
}
|
d745f53d-903e-4db4-9421-97927ec82431
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-09-01 14:16:26", "repo_name": "ihmcrobotics/ihmc-open-robotics-software", "sub_path": "/ihmc-parameter-tuner/src/main/java/us/ihmc/parameterTuner/guiElements/GuiElement.java", "file_name": "GuiElement.java", "file_ext": "java", "file_size_in_byte": 1100, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "7c714ae8f67942ada3218da26b06cfe767906bee", "star_events_count": 227, "fork_events_count": 91, "src_encoding": "UTF-8"}
|
https://github.com/ihmcrobotics/ihmc-open-robotics-software
| 247
|
FILENAME: GuiElement.java
| 0.286169
|
package us.ihmc.parameterTuner.guiElements;
public abstract class GuiElement
{
public static final String SEPERATOR = ":";
private final String name;
private final GuiRegistry parent;
private final String uniqueName;
public GuiElement(String name, GuiRegistry parent)
{
this(name, parent, createUniqueName(name, parent));
}
public GuiElement(String name, GuiRegistry parent, String uniqueName)
{
if (name.contains(SEPERATOR))
{
throw new RuntimeException("Name " + name + " should never contain " + SEPERATOR);
}
this.name = name;
this.parent = parent;
this.uniqueName = uniqueName;
}
public String getName()
{
return name;
}
public String getUniqueName()
{
return uniqueName;
}
public GuiRegistry getParent()
{
return parent;
}
public static String createUniqueName(String name, GuiRegistry parent)
{
if (parent == null)
{
return name;
}
else
{
return parent.getUniqueName() + SEPERATOR + name;
}
}
}
|
090207d5-b743-4099-99a2-009255bb72e3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-16 09:56:14", "repo_name": "nathajagdish/All-in-one", "sub_path": "/app/src/main/java/com/example/playstore/Local_Nepal.java", "file_name": "Local_Nepal.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "bb8bb411fbc77e6c6755043850d347fa8cdadd26", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nathajagdish/All-in-one
| 244
|
FILENAME: Local_Nepal.java
| 0.214691
|
package com.example.playstore;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class Local_Nepal extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_local__nepal);
}
public void daraj(View view) {
Intent intent = new Intent(Local_Nepal.this,
NEPdaraj.class);
startActivity(intent);
}
public void sastodeal(View view) {
Intent intent = new Intent(Local_Nepal.this,
Nepsastodeal.class);
startActivity(intent);
}
public void nepbay(View view) {
Intent intent = new Intent(Local_Nepal.this,
Nepnepbay.class);
startActivity(intent);
}
public void socheko(View view) {
Intent intent = new Intent(Local_Nepal.this,
Nepsocheko.class);
startActivity(intent);
}
public void hamrobazar(View view) {
Intent intent = new Intent(Local_Nepal.this,
Nephamrobazar.class);
startActivity(intent);
}
}
|
b09a82a7-479e-478e-9893-2a3e7ef81a1f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-03-17T10:32:07", "repo_name": "ArtyCake/Fit-Your-Fat", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1137, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "e06b02164f2e2f801d5df96c23e7fca51f0e27fd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ArtyCake/Fit-Your-Fat
| 251
|
FILENAME: README.md
| 0.290981
|
# Fit Your Fat
[Play Market](https://play.google.com/store/apps/details?id=com.artycake.fityourfat) | [Demo video](https://youtu.be/A8gNM5Ku5Ew)
A simple and convenient timer for your workouts.
### Main features
- A timer for interval training, running in the background
- Notifications about changing exercises with sounds, voice and vibration
- Pause the timer on an incoming call
- Unlimited training and exercises
- No advertising and in-app purchases, do train and do not be distracted by anything
---
Aplication was created for demonstration purposes.
### Libraries used in this project
- [Realm](https://realm.io/docs/java/latest/) for storing forecasts
- [Butterknife](http://jakewharton.github.io/butterknife/) for views binding
- [CircleProgress](https://github.com/lzyzsd/CircleProgress) for main timer interface
### Features realised in this project
- Background service that makes all calculation and send broadcasts to update UI
- Fragments with fragmentManager and viewPager
- Notification with buttons
- Playing sounds, vibrations and textToSpeach
- BroadcastReceiver for incomming calls to pause and resume timer
|
a367454e-be91-4c25-adc5-b5bb064b237a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-28 07:08:01", "repo_name": "liubo0501/myspring", "sub_path": "/SpringWebsocket/src/main/java/com/netposa/springsocket/WebSocketService.java", "file_name": "WebSocketService.java", "file_ext": "java", "file_size_in_byte": 1133, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "22b79dac0c0c9e60440c15f91e22e3714d91a78b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/liubo0501/myspring
| 246
|
FILENAME: WebSocketService.java
| 0.279042
|
package com.netposa.springsocket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.util.HtmlUtils;
@Service
public class WebSocketService {
@Autowired
private SimpMessagingTemplate template;
@Autowired
SocketSessionRegistry webAgentSessionRegistry;
/**
* 广播
* 发给所有在线用户
*
* @param msg
*/
public void sendMsg(String msg) {
template.convertAndSend("/topic/greetings", new Greeting("Hello, " + HtmlUtils.htmlEscape(msg) + "!"));
}
/**
* 发送给指定用户
* @param users
* @param msg
*/
public void send2Users(String user, String msg) {
// users.forEach(userName -> {
// template.convertAndSendToUser(userName, "/topic/greetings", msg);
// });
template.convertAndSendToUser(webAgentSessionRegistry.getSessionIds(user).stream().findFirst().get(), "/topic/greetings",new Greeting("Hello, " + HtmlUtils.htmlEscape(msg) + "!"));
}
}
|
c4f67c32-b2c3-4f75-9f93-9ee1802e3e7a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-11-02 10:18:01", "repo_name": "siriusbetta/SeaBattle", "sub_path": "/src/com/seabattle/Water.java", "file_name": "Water.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "7dcb6b6ac18110242eaa3d99b650bc5bc12718d8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/siriusbetta/SeaBattle
| 300
|
FILENAME: Water.java
| 0.287768
|
package com.seabattle;
public class Water{
//private Ship ship;
//if dangerWater is 0 the field is clear, 1 connects with ship and -1 is busy by ship
private int dangerWater;
int x;
int y;
public Water(int x, int y) {
this.x = x;
this.y = y;
setDangerWater(0);
}
public int getDangerWater() {
return dangerWater;
}
public void setDangerWater(int dangerWater) {
this.dangerWater = dangerWater;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + dangerWater;
result = prime * result + x;
result = prime * result + y;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Water other = (Water) obj;
if (dangerWater != other.dangerWater)
return false;
if (x != other.x)
return false;
if (y != other.y)
return false;
return true;
}
public String toString(){
return String.valueOf(x) + String.valueOf(y) ;
}
}
|
c786724d-5836-46a3-b25c-536ee30f46cc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-03 00:45:34", "repo_name": "lshstyle/my-react", "sub_path": "/react-server/src/main/java/com/example/wechat/controller/GoodsController.java", "file_name": "GoodsController.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "65097847e378c25c090b5a5ccb3e5e5b4cb39bae", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lshstyle/my-react
| 220
|
FILENAME: GoodsController.java
| 0.225417
|
package com.example.wechat.controller;
import com.example.react.util.HttpStatus;
import com.example.react.util.Result;
import com.example.wechat.entity.Image;
import com.example.wechat.service.FloorService;
import com.example.wechat.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/goods")
public class GoodsController {
@Autowired
private GoodsService goodsService;
@GetMapping("/category")
public Result<List> list() {
List<Image> list = goodsService.category();
return new Result<List>(list, HttpStatus.SEARCH);
}
@GetMapping("/search")
public Result<List> search() {
List<Image> list = goodsService.search();
return new Result<List>(list, HttpStatus.SEARCH);
}
@GetMapping("/detail")
public Result<Image> detail() {
Image img = goodsService.detail();
return new Result<Image>(img, HttpStatus.SEARCH);
}
}
|
8d8911ad-37b6-44c1-af7a-c848f1836faa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-06 16:06:27", "repo_name": "rajagopal-nallapu/ParkingSystem", "sub_path": "/src/com/parkingsystem/Token.java", "file_name": "Token.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "635fe36eeb1a3cd58ebeb8a4d34356d9ac07f5a9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rajagopal-nallapu/ParkingSystem
| 230
|
FILENAME: Token.java
| 0.287768
|
package com.parkingsystem;
import java.util.Date;
public class Token {
private String tokenNumber;
private Slot slotInformation;
private Car carInformation;
private Date tokenDate;
private long checkoutTime;
public Token(String tokenNumber, Slot slotInformation, Car carInformation)
{
this.tokenNumber = tokenNumber;
this.slotInformation = slotInformation;
this.carInformation = carInformation;
this.tokenDate = new Date();
}
public String getTokenNumber() {
return tokenNumber;
}
public void setTokenNumber(String tokenNumber) {
this.tokenNumber = tokenNumber;
}
public Slot getSlotInformation() {
return slotInformation;
}
public void setSlotInformation(Slot slotInformation) {
this.slotInformation = slotInformation;
}
public Car getCarInformation() {
return carInformation;
}
public void setCarInformation(Car carInformation) {
this.carInformation = carInformation;
}
public Token updateCheckoutTime(){
this.checkoutTime = System.currentTimeMillis();
return this;
}
}
|
bf10027b-9a87-405f-992e-a5f17b2a8c4b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-13 18:49:43", "repo_name": "guhama/dataConv", "sub_path": "/src/main/java/com/premierinc/informatics/dataconv/DataConversionStatus.java", "file_name": "DataConversionStatus.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "d1d4f53c0c7c089057b30513e0aff66c22c41a54", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/guhama/dataConv
| 244
|
FILENAME: DataConversionStatus.java
| 0.280616
|
package com.premierinc.informatics.dataconv;
/**
* The Enum DataConversionStatus.
*
* @author ypatil
*/
public enum DataConversionStatus {
QMR_BLOCK("QB"), AE_PENDING("AP"), QMR_RUN("QR"), QMR_COMPLETE("QC");
private String statusCode;
/**
* Instantiates a new data conversion status.
*
* @param str the str
*/
private DataConversionStatus(String str) {
statusCode = str;
}
/**
* @see java.lang.Enum#toString()
*/
@Override
public String toString() {
return this.getValue();
}
/**
* Gets the value.
*
* @return the value
*/
public String getValue() {
return statusCode;
}
/**
* Parses the.
*
* @param status the status
* @return the data conversion status
*/
public static DataConversionStatus parse(String status) {
for (DataConversionStatus stat : DataConversionStatus.values()) {
if (stat.getValue().equalsIgnoreCase(status)) {
return stat;
}
}
return null;
}
}
|
d5d4a52a-351e-4952-9bc7-2838c36f45e3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-29 20:08:35", "repo_name": "breno-cn/message-board", "sub_path": "/src/main/java/com/forum/board/controller/BoardController.java", "file_name": "BoardController.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "e9af4882ccd3b7ed2ba921cdc18ad222f49e126f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/breno-cn/message-board
| 176
|
FILENAME: BoardController.java
| 0.239349
|
package com.forum.board.controller;
import com.forum.board.service.BoardService;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/board")
public class BoardController {
private final BoardService boardService;
public BoardController(BoardService boardService) {
this.boardService = boardService;
}
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getAllBoards() {
return ResponseEntity.ok(boardService.findAllBoards());
}
@GetMapping(value = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getBoardById(@PathVariable Long id) {
return ResponseEntity.ok(boardService.findBoardById(id));
}
}
|
d46cf161-fe25-4315-a184-f4d5b37d7543
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-12 06:15:20", "repo_name": "yanbospark/world", "sub_path": "/world/src/main/java/com/world/controller/back/LoginCtrl.java", "file_name": "LoginCtrl.java", "file_ext": "java", "file_size_in_byte": 1103, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "1f4ed40b74b3050acd06abf4d376a63a5169a27b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yanbospark/world
| 216
|
FILENAME: LoginCtrl.java
| 0.242206
|
package com.world.controller.back;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
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.RequestParam;
@Controller
public class LoginCtrl {
@RequestMapping(value="/user/login",method=RequestMethod.POST)
public String doLogin(@RequestParam("name") String name,@RequestParam("password") String password,HttpServletRequest request,HttpSession session){
String basepath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
request.getServletContext().setAttribute("basepath", basepath);
System.out.println(name+" = "+password);
if("yanbo".equals(name)&&"ddn123".equals(password)){
session.setAttribute("username", name);
return "redirect:/index";
}else{
return "redirect:/login";
}
}
public LoginCtrl() {
System.out.println("<><><><><><>终于。。。。。");
}
}
|
f0bcc8f4-1921-411d-b2a0-c99609d99595
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-12 13:57:04", "repo_name": "devdoott/CampusChat", "sub_path": "/app/src/main/java/com/buyhatke/chat_application_admin/Admin.java", "file_name": "Admin.java", "file_ext": "java", "file_size_in_byte": 1159, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "c41fb6bcef5a9032f273e8dd7b6f52c6b77828bf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/devdoott/CampusChat
| 229
|
FILENAME: Admin.java
| 0.239349
|
package com.buyhatke.chat_application_admin;
import android.content.Context;
import android.content.Intent;
import com.google.firebase.storage.StorageReference;
public class Admin{
private String fullName;
private String id;
private String packageName;
public String getEmail() {
return email;
}
private String email;
public Admin() {}
public String getId() {
return id;
}
public Admin(String packageName, String fullName, String email,String id) {
this.fullName = fullName;
this.id=id;
this.packageName=packageName;
this.email=email;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof User)) {
return false;
}
User c = (User) o;
System.out.println("Equals.................."+this.id);
System.out.println("Equals.................."+c.getId());
return id.equals(c.getId());
}
public String getFullName() {
return fullName;
}
public String getPackageName() {
return packageName;
}
}
|
ff9085ed-a2fa-4539-8da8-798342a44bd3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-10-21 10:03:28", "repo_name": "marcoslop/bitbucket-plugin", "sub_path": "/src/main/java/com/cloudbees/jenkins/plugins/BitBucketTrigger.java", "file_name": "BitBucketTrigger.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "ef0ab0e3a05007c1be9169b3c597fc677a8fafa4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/marcoslop/bitbucket-plugin
| 242
|
FILENAME: BitBucketTrigger.java
| 0.245085
|
package com.cloudbees.jenkins.plugins;
import hudson.Extension;
import hudson.model.AbstractProject;
import hudson.model.Item;
import hudson.plugins.git.GitStatus;
import hudson.triggers.Trigger;
import hudson.triggers.TriggerDescriptor;
import jenkins.model.Jenkins;
import org.eclipse.jgit.transport.URIish;
import org.kohsuke.stapler.DataBoundConstructor;
/**
* @author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
*/
public class BitBucketTrigger extends Trigger<AbstractProject> {
@DataBoundConstructor
public BitBucketTrigger() {
}
public void onPost(AbstractProject<?,?> job, String user) {
BitBucketPushCause cause = new BitBucketPushCause(user);
job.scheduleBuild(cause);
}
@Extension
public static class DescriptorImpl extends TriggerDescriptor {
@Override
public boolean isApplicable(Item item) {
return item instanceof AbstractProject;
}
@Override
public String getDisplayName() {
return "Build when a change is pushed to BitBucket";
}
}
}
|
519cb174-7532-4137-9913-d2a525773d93
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-17 03:37:05", "repo_name": "BetterSora/Algorithm", "sub_path": "/src/main/java/cn/java/jdkproxy/JDKDynamicProxyClient.java", "file_name": "JDKDynamicProxyClient.java", "file_ext": "java", "file_size_in_byte": 1144, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "c23c29c8754167db3534de1ad8ecfecfd52052f8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/BetterSora/Algorithm
| 220
|
FILENAME: JDKDynamicProxyClient.java
| 0.26588
|
package cn.java.jdkproxy;
import sun.misc.ProxyGenerator;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
public class JDKDynamicProxyClient {
public static void main(String[] args) {
InvocationHandler handler = new SubjectProxyHandler(ConcreteSubject.class);
// 运行时动态生存代理类
ISubject proxy = (ISubject) Proxy.newProxyInstance(JDKDynamicProxyClient.class.getClassLoader(),
new Class[]{ISubject.class}, handler);
proxy.action();
proxy.doSomething();
// 获取代理类的字节码文件
byte[] classFile = ProxyGenerator.generateProxyClass("$Proxy0", ConcreteSubject.class.getInterfaces());
try {
FileOutputStream fos = new FileOutputStream("/Users/qinzhen/Desktop/proxy.class");
fos.write(classFile, 0, classFile.length);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
07b3855d-55db-4db6-9693-d8d1f8dd9429
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-09 10:22:45", "repo_name": "qndc/Crowdfunding", "sub_path": "/Atcrowdfunding-potal-impl/src/main/java/com/atguigu/atcrowdfunding/potal/service/impl/MemberServiceImpl.java", "file_name": "MemberServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "d942742c6084497371b48e39e675e469f2f4c9cc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/qndc/Crowdfunding
| 257
|
FILENAME: MemberServiceImpl.java
| 0.292595
|
package com.atguigu.atcrowdfunding.potal.service.impl;
import com.atguigu.atcrowdfunding.bean.Member;
import com.atguigu.atcrowdfunding.potal.dao.MemberMapper;
import com.atguigu.atcrowdfunding.potal.service.MemberService;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MemberServiceImpl implements MemberService
{
@Autowired
private MemberMapper memberMapper;
public Member queryMemberlogin(Map<String, Object> paramMap)
{
return this.memberMapper.queryMebmerlogin(paramMap);
}
public void updateMember(Member member) {
this.memberMapper.updateByPrimaryKey(member);
}
public Member queryMemberByMid(Integer memberid)
{
Member member = this.memberMapper.selectByPrimaryKey(memberid);
return member;
}
public void insertMember(Member member)
{
this.memberMapper.insert(member);
}
public Member selectMemberByTel(String tel)
{
return this.memberMapper.selectByTel(tel);
}
public Member selectMemberByLoginacct(String loginacct)
{
return this.memberMapper.selectByLoginacct(loginacct);
}
}
|
992b82d2-9efd-4ab8-806f-7eaf3193e8b4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-09-24T14:51:15", "repo_name": "abaydar/tech_networking_client", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1157, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "dda6f661a4580732a58a866e9711ce186be24516", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/abaydar/tech_networking_client
| 253
|
FILENAME: README.md
| 0.247987
|
# Welcome to Tech Networking!
This app was designed for anyone new to the tech field and looking to connect with other techies!
## Installation
To install this to your local computer, fork and clone this repository. Once you are in the "tech_networking_client" directory, run `npm install` to load all dependencies. This application is dependent on a Rails API for the backend, so be sure to follow the installation instructions here as well:
https://github.com/abaydar/tech_networking_api
## Usage
Once you are in this directory, you can type `npm start` in your terminal. Once the application is open in your browser, you can sign up by clicking the "login" button and registering with either your email or google account. Once you are logged in, you can check out the "About" page and get started!
## A Contributor's Guide
For pull requests, please visit: https://github.com/abaydar/tech_networking_client/pulls.
For bug reports, please visit: https://github.com/abaydar/tech_networking_client/issues
## License
This application is available as open source under the terms in the MIT License, found here: https://opensource.org/licenses/MIT
|
fe3c564b-378e-4fc4-a3df-ea8869d7adc7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-12 12:28:38", "repo_name": "fgyLian/myblog", "sub_path": "/src/main/java/com/fgy/myblog/service/impl/UserInfoServiceImpl.java", "file_name": "UserInfoServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1221, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "fb0abbe39e814e800ae4e4b53bdc644bf1172b52", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fgyLian/myblog
| 242
|
FILENAME: UserInfoServiceImpl.java
| 0.275909
|
package com.fgy.myblog.service.impl;
import com.fgy.myblog.bean.UserInfo;
import com.fgy.myblog.dao.UserInfoMapper;
import com.fgy.myblog.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class UserInfoServiceImpl implements UserInfoService {
@Autowired
UserInfoMapper userInfoMapper;
@Override
public List<UserInfo> selecetAll(UserInfo user) {
return userInfoMapper.selectAll(user);
}
@Override
public UserInfo selectById(Integer id) {
return userInfoMapper.selectByPrimaryKey(id);
}
@Override
public UserInfo isLogin(UserInfo user) {
return userInfoMapper.isLogin(user);
}
@Override
public int getUserCount() {
return userInfoMapper.getUserCount();
}
@Override
public int deleteById(Integer id) {
return userInfoMapper.deleteById(id);
}
@Override
public int update(UserInfo user) {
return userInfoMapper.updateByPrimaryKeySelective(user);
}
@Override
public int add(UserInfo user) {
return userInfoMapper.insertSelective(user);
}
}
|
abb516b7-2404-46a8-87bb-b817a3b58652
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-19 20:20:50", "repo_name": "firsachi/softtouch", "sub_path": "/softtouch/src/main/java/ua/kiev/softtouch/validations/CpmpanyValidator.java", "file_name": "CpmpanyValidator.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "19a2966e25a99b6985acd14634d9dd5bc571accb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/firsachi/softtouch
| 202
|
FILENAME: CpmpanyValidator.java
| 0.289372
|
package ua.kiev.softtouch.validations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;
import ua.kiev.softtouch.models.CompanyModel;
import ua.kiev.softtouch.services.CompanyService;
@Component
public class CpmpanyValidator implements Validator{
@Autowired
private CompanyService companyService;
@Override
public boolean supports(Class<?> clazz) {
return CompanyModel.class.equals(clazz);
}
@Override
public void validate(Object model, Errors errors) {
ValidationUtils.rejectIfEmpty(errors, "comanyname", "error.null");
CompanyModel companyModel = (CompanyModel) model;
String companyname = companyModel.getComanyname();
if( companyname != null && !companyService.isSubdivisionName(companyname)) {
errors.rejectValue("comanyname", "error.ismatches");
}
}
}
|
22ff3a24-1533-4f37-b055-3324cf1ea231
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-13 08:53:05", "repo_name": "katrinpuik/ToDoWebApplication", "sub_path": "/src/main/java/servlets/DoneServlet.java", "file_name": "DoneServlet.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "eaa4093b8b0670b915d115f82e3ac668e615ffb6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/katrinpuik/ToDoWebApplication
| 180
|
FILENAME: DoneServlet.java
| 0.29584
|
package servlets;
import com.mysql.jdbc.StringUtils;
import service.TodoService;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.util.logging.Logger;
import static java.lang.Integer.parseInt;
@WebServlet(name = "servlets.DoneServlet", urlPatterns = {"/done"}, loadOnStartup = 1)
public class DoneServlet extends HttpServlet {
private static Logger logger = Logger.getLogger(UpdateServlet.class.getName());
private TodoService service = new TodoService();
protected void doPut(HttpServletRequest request, HttpServletResponse response) {
String id = request.getParameter("id");
if (StringUtils.isNullOrEmpty(id)) {
logger.warning("Id is missing");
} else {
LocalDate dateNow = java.time.LocalDate.now();
service.updateStatus(parseInt(id), dateNow.toString());
}
}
}
|
911ca00b-44c8-48c7-85b1-fc2b8c4420e0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-02 02:46:59", "repo_name": "r17171709/AndroidCommonLibrary", "sub_path": "/app/src/main/java/com/renyu/androidcommonlibrary/activity/SVGActivity.java", "file_name": "SVGActivity.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "bb3d27719554ac97043dfea6aeb0b75af2313f40", "star_events_count": 31, "fork_events_count": 17, "src_encoding": "UTF-8"}
|
https://github.com/r17171709/AndroidCommonLibrary
| 221
|
FILENAME: SVGActivity.java
| 0.217338
|
package com.renyu.androidcommonlibrary.activity;
import android.graphics.Color;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
import com.renyu.androidcommonlibrary.R;
import com.renyu.commonlibrary.baseact.BaseActivity;
/**
* Created by Administrator on 2017/9/7.
*/
public class SVGActivity extends BaseActivity {
AppCompatImageView iv_svg;
@Override
public void initParams() {
iv_svg = findViewById(R.id.iv_svg);
VectorDrawableCompat a = VectorDrawableCompat.create(getResources(), R.drawable.ic_white_bottom_arrow, getTheme());
a.setTint(Color.RED);
iv_svg.setImageDrawable(a);
}
@Override
public int initViews() {
return R.layout.activity_svg;
}
@Override
public void loadData() {
}
@Override
public int setStatusBarColor() {
return Color.BLACK;
}
@Override
public int setStatusBarTranslucent() {
return 0;
}
}
|
97f46701-b703-47ce-ac3c-db76de9bbd3c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-14 07:57:43", "repo_name": "yoooooona/yuna", "sub_path": "/swing/src/component/JFileChooserTest1.java", "file_name": "JFileChooserTest1.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "3cea6dea9c5f32a0df29a34b0805db4239632f64", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yoooooona/yuna
| 258
|
FILENAME: JFileChooserTest1.java
| 0.277473
|
package component;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
public class JFileChooserTest1 extends JFrame {
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
JFileChooserTest1 frame = new JFileChooserTest1();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public JFileChooserTest1() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
JFileChooser file=new JFileChooser();
contentPane.add(file, BorderLayout.CENTER);
}
}
|
c3b751c4-c39b-4f01-bfff-624158f4ecf0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-19 10:20:35", "repo_name": "mutukulasureshkumar/BMSAssistance", "sub_path": "/src/main/java/com/java/chatbot/repository/Repository.java", "file_name": "Repository.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "84c0ffc4e7131788f9cff0c88a076c067a323b7e", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/mutukulasureshkumar/BMSAssistance
| 199
|
FILENAME: Repository.java
| 0.261331
|
package com.java.chatbot.repository;
import com.java.chatbot.model.Movies;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.HashMap;
@Configuration
public class Repository {
private static HashMap<String, Movies> database = new HashMap<String, Movies>();
private static ArrayList<Movies> moviesList = new ArrayList<>();
public void set(String chatId, Movies movies){
database.put(chatId, movies);
}
public Movies get(String chatId){
if(database.get(chatId) == null)
return new Movies();
return database.get(chatId);
}
public String getAll(){
StringBuffer stringBuffer = new StringBuffer();
database.forEach((k,v) -> stringBuffer.append(k +" --> "+ v.toString()+".\n"));
return stringBuffer.toString();
}
public void addMovie(Movies movie){
moviesList.add(movie);
}
public void removeMovie(Movies movie){
moviesList.remove(movie);
}
public ArrayList<Movies> getMovies(){
return moviesList;
}
}
|
d81e6ade-9c0d-49e1-80c9-0d8aec51ce44
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-23 07:05:46", "repo_name": "feixiaoan/SSM-maven-", "sub_path": "/ssm/ssm_utils/src/main/java/com/xiaofei/ssm/utils/DateUtils.java", "file_name": "DateUtils.java", "file_ext": "java", "file_size_in_byte": 1143, "line_count": 40, "lang": "zh", "doc_type": "code", "blob_id": "6aad35fbaed7f8008bdb295c4c845380dafbec22", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/feixiaoan/SSM-maven-
| 273
|
FILENAME: DateUtils.java
| 0.275909
|
package com.xiaofei.ssm.utils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* <Description> <br>
* 进行日期转换
* @author 小飞<br>
* @version 1.0<br>
* @createDate 2019/05/31<br>
* @see com.xiaofei.ssm.utils <br>
*/
public class DateUtils {
/**
* 把日期转换为字符串
* @param date 传进来的日期
* @param patt 转换的日期格式
* @return 返回转换后的字符串日期
*/
public static String DateToString(Date date,String patt) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(patt);
String format = simpleDateFormat.format(date);
return format;
}
/**
* 把字符串转换为日期
* @param date 传入的字符日期
* @param patt 转换的格式
* @return 返回转换后的日期
* @throws ParseException
*/
public static Date StringTiDate(String date, String patt) throws ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(patt);
Date parse = simpleDateFormat.parse(date);
return parse;
}
}
|
d2d989f0-c2ea-4136-a136-36a0966cb680
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-01-16T07:18:53", "repo_name": "sampwing/ansible-digitalocean-security", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1001, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "0504e48134033705cecfa8ef012121f8afad6da9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sampwing/ansible-digitalocean-security
| 248
|
FILENAME: README.md
| 0.183594
|
setting up ufw : http://docs.ansible.com/ansible/ufw_module.html
vagrant up --provider virtualbox
vagrant destroy
check http://jamesdacosta.com/first-steps-with-vagrant-ansible-and-aws/ for next steps and do it with digitial ocean
-- kicked off digital ocean deploy w/
ansible-playbook private/ansible/droplet.yml --private-key ~/.ssh/id_rsa -i private/ansible/hosts
-- had to pip install some python stuff to use digital_ocean stuff
ansible==2.0.0.2
dopy==0.3.5
six==1.10.0
-- able to create and destroy droplets
-- use a vars.yml file to hold names of instances and instance types
--start
ansible-playbook create.yml
--stop
ansible-playbook destroy.yml
-- hosts list is empty -- need to use digital ocean's dns to add the instances to some dns
-- and then use that hosts file to perform some other playbook
-- really would like to be able to provision new instances and install on them at the same time instead of needing two passes
-- into to dynamic inventory needs more reading
|
68498625-c9ac-48cb-b795-d3584f38dfbd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-19 16:15:59", "repo_name": "AleTid5/UTN_PAII_TP3", "sub_path": "/app/src/main/java/src/Activities/ui/account/AccountFragment.java", "file_name": "AccountFragment.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "9422e0fe6eefc1654698fa40631e536121be4d3c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AleTid5/UTN_PAII_TP3
| 161
|
FILENAME: AccountFragment.java
| 0.216012
|
package src.Activities.ui.account;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import com.example.tp3_pa_grupo_3.R;
public class AccountFragment extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
AccountViewModel accountViewModel = new ViewModelProvider(this).get(AccountViewModel.class);
View root = inflater.inflate(R.layout.fragment_account, container, false);
accountViewModel.fillUserInfo(
root.findViewById(R.id.input_name),
root.findViewById(R.id.input_email),
root.findViewById(R.id.input_total_parkings),
root.findViewById(R.id.input_total_time)
);
return root;
}
}
|
70fb55e6-8e7b-4473-a1dd-9d89b61b4b86
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-19 23:55:31", "repo_name": "ThePlay3r/FancyChangeAnimation", "sub_path": "/src/main/java/me/pljr/fancychangeanimation/FancyChangeAnimation.java", "file_name": "FancyChangeAnimation.java", "file_ext": "java", "file_size_in_byte": 1063, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "87d547a492ef6653e4899fbd67e2ac17689d1b10", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ThePlay3r/FancyChangeAnimation
| 207
|
FILENAME: FancyChangeAnimation.java
| 0.252384
|
package me.pljr.fancychangeanimation;
import me.pljr.fancychangeanimation.listeners.FoodLevelChangeListener;
import me.pljr.fancychangeanimation.listeners.PlayerExpChangeListener;
import org.bukkit.plugin.java.JavaPlugin;
public final class FancyChangeAnimation extends JavaPlugin {
private static FancyChangeAnimation instance;
private static int speed;
@Override
public void onEnable() {
instance = this;
setupConfig();
loadListeners();
}
private void setupConfig(){
saveDefaultConfig();
speed = getConfig().getInt("speed");
}
private void loadListeners(){
getServer().getPluginManager().registerEvents(new PlayerExpChangeListener(), this);
getServer().getPluginManager().registerEvents(new FoodLevelChangeListener(), this);
}
public static int getSpeed() {
return speed;
}
public static FancyChangeAnimation getInstance() {
return instance;
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
|
8300a33a-9728-464c-89c1-0b3eba803608
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-17 15:26:11", "repo_name": "Samir009/Upasarga", "sub_path": "/app/src/main/java/com/samir/upasarga/activities/SwipeToRefresh.java", "file_name": "SwipeToRefresh.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "b3f82d095a2a4cec6eb0e1af41dcdffdfd55eb33", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Samir009/Upasarga
| 167
|
FILENAME: SwipeToRefresh.java
| 0.258326
|
package com.samir.upasarga.activities;
import androidx.appcompat.app.AppCompatActivity;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.os.Bundle;
import android.widget.TextView;
import com.samir.upasarga.R;
public class SwipeToRefresh extends AppCompatActivity {
SwipeRefreshLayout swipeRefreshLayout;
TextView textView;
int num = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_swipe_to_refresh);
swipeRefreshLayout = findViewById(R.id.refreshLayout);
textView = findViewById(R.id.swipeCount);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
num ++;
textView.setText(String.valueOf(num));
swipeRefreshLayout.setRefreshing(false);
}
});
}
}
|
42720e9a-4692-41fa-b12c-ba6b4638c6eb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-08 03:48:20", "repo_name": "345618264/ssm1", "sub_path": "/my-ssm/src/main/java/com/mytest/controller/DeptController.java", "file_name": "DeptController.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "72639ac9217240233b6b1b734ca9512f4e6992ec", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/345618264/ssm1
| 244
|
FILENAME: DeptController.java
| 0.23793
|
package com.mytest.controller;
import com.mytest.entity.Dept;
import com.mytest.service.DeptService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import java.util.List;
/**
* (Dept)表控制层
*
* @author makejava
* @since 2019-07-03 12:05:07
*/
@Controller
@RequestMapping("/dept")
public class DeptController {
/**
* 服务对象
*/
@Resource
private DeptService deptService;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("/selectDeptOne")
public String selectDeptOne(Integer id, Model model) {
model.addAttribute("depts", this.deptService.queryById(id));
return "deptList";
}
@GetMapping("/selectDeptAll")
public List<Dept> selectDeptAll() {
return this.deptService.queryDeptAll();
}
}
|
e7a2d9c6-fd46-44a1-b869-6df7505fbaf3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-12 03:06:04", "repo_name": "omarabdeddaim/Management_Application", "sub_path": "/promotion.java", "file_name": "promotion.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "e9755c48554ae3547dab2ff60d1d721a666eabee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/omarabdeddaim/Management_Application
| 208
|
FILENAME: promotion.java
| 0.250913
|
package gestion_ressources_humains;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Date;
public class promotion {
private float date;
private ArrayList<Employées> Employees;
//constructeur
public promotion(float date) {
this.date= date;//la date cité l'hors du jour
this.Employees = new ArrayList<>();
}
//getters and setters
public float getdate() {
return date;
}
public void setDate(float date) {
this.date = date;
}
public ArrayList<Employées> getEmployees() {
return Employees;
}
public void setEmployees(ArrayList<Employées> Employees) {
this.Employees = Employees;
}
//affichage
@Override
public String toString() {
return "promotion{" + "date=" + date + ", Employees=" + Employees + '}';
}
}
|
289f7734-f880-4560-b0cf-34f15cf708ed
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-02-25T02:34:51", "repo_name": "ASBausch/ww-exercise", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1050, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "21c58af4f38397074676b30bd75c172a955ef104", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ASBausch/ww-exercise
| 240
|
FILENAME: README.md
| 0.252384
|
NPM install required
I built the site using Node / Express / Angular. To get things running:
* Clone the following repo into a new directory: https://github.com/ASBausch/ww-exercise
* From within the directory run 'npm install'
* Once install is complete, run 'npm start'
* Visit http://localhost:3000 to view the site.
Base requirements:
1. Sticky header stays at the top as user scrolls.
2. Content is centered horizontally and vertically.
3. On mobile content stacks and remains centered.
4-5. Accordion collapsed on initial load, opens downward and closes open items.
6. Employees drawn from 4 on desktop, 3 on tablet, 2 on mobile.
7. On click groups of 4 employees are drawn, button disappears when the end of the array is reached.
A grid was not implemented to avoid extra weight in the css and markup, native css flexbox was used for positioning.
This posed some challenges and a grid may have been an equally effective system.
Tested on latest versions of Safari, Chrome and Firefox.
Technology used, Sass, Gulp, Node, Angular, Express
|
7ab95d72-97b0-4d0c-9829-71f9bed50a28
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-08 00:40:19", "repo_name": "George-Poulos/Minimal-Average-Distance", "sub_path": "/src/City.java", "file_name": "City.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "302ae4070430c93d79f497eca98250a8f8e757cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/George-Poulos/Minimal-Average-Distance
| 246
|
FILENAME: City.java
| 0.267408
|
/**
* Created by : George Poulos
* Class : CS342 HW1 ---- Fall 2016
* Author Code Number : 655P
*
* This file holds the class that defines City, this class holds
* an Integer variable that holds the city index, a String that
* holds the name of the city, and another string that holds the
* name of the state that city belongs to.
* Strictly used for reading from a csv file.
*
*/
public class City {
private int city;
private String cityName;
private String State;
public City (int city, String cityName, String State){
this.city = city;
this.cityName = cityName;
this.State = State;
}
/**
* Getters
* @return
*/
public String toString(){
return "The city : " + this.city + ", "+this.cityName + " in the state : " + this.State;
}
public int getCity (){
return this.city;
}
public String getCityName(){
return this.cityName;
}
public String getState(){
return this.State;
}
}
|
f12c71f2-dcbd-4f6e-9755-7aa258525876
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-19 15:18:35", "repo_name": "mingletxt/webflux", "sub_path": "/src/main/java/com/mingle/webflux/demo/Test.java", "file_name": "Test.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "7024b83963b066a963cfee4c553868b4a18d6267", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mingletxt/webflux
| 216
|
FILENAME: Test.java
| 0.282988
|
package com.mingle.webflux.demo;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Date;
import java.util.Optional;
import java.util.Random;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;
import reactor.test.StepVerifier;
import reactor.test.publisher.TestPublisher;
/**
* Created by mingle. Time 2019-04-23 18:21 Desc 文件描述
*/
public class Test {
public static void main(String[] args) {
StepVerifier.create(Flux.just("a", "b"))
.expectNext("a")
.expectNext("b")
.verifyComplete();
final TestPublisher<String> testPublisher = TestPublisher.create();
testPublisher.next("a");
testPublisher.next("b");
testPublisher.complete();
StepVerifier.create(testPublisher)
.expectNext("a")
.expectNext("b")
.expectComplete();
}
}
|
5366ecfb-3078-4aad-9cf9-1e8d70e97371
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-15 10:59:47", "repo_name": "Tom-The-Geek/BulkBlockEdit", "sub_path": "/src/main/java/me/geek/tom/BulkBlockChange/actions/TaskManager.java", "file_name": "TaskManager.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "1e80eb2b0d33e489aec385a0f5dc4b0983bcbfab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Tom-The-Geek/BulkBlockEdit
| 200
|
FILENAME: TaskManager.java
| 0.250913
|
package me.geek.tom.BulkBlockChange.actions;
// import org.bukkit.ChatColor;
import com.google.common.collect.Lists;
import me.geek.tom.BulkBlockChange.BulkBlockChange;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.List;
public class TaskManager extends BukkitRunnable {
private Server server;
private List<TaskRunnable> runnableList;
public TaskManager(Server server) {
super();
this.server = server;
runnableList = Lists.newArrayList();
}
public void queueOperation(TaskRunnable taskRunnable) {
runnableList.add(taskRunnable);
taskRunnable.runTask(BulkBlockChange.plugin);
}
public void run() {
// server.broadcastMessage(ChatColor.LIGHT_PURPLE + "Running operations...");
}
public void taskDone(TaskRunnable runnable) {
server.broadcastMessage(ChatColor.LIGHT_PURPLE + "Task complete!");
runnableList.remove(runnable);
}
}
|
f468cf8f-44b6-4ae4-a16a-8a4567b00b3f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-04-10 04:01:22", "repo_name": "kousun12/flopsfever", "sub_path": "/src/com/illinois/ncsa/Settings.java", "file_name": "Settings.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "6037c81e7a1d4d052689789dffec2f5642d304f4", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kousun12/flopsfever
| 183
|
FILENAME: Settings.java
| 0.255344
|
package com.illinois.ncsa;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import framework.FileIO;
public class Settings {
public static boolean soundEnabled = true;
public static void load(FileIO files) {
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(
files.readFile(".ffever")));
soundEnabled = Boolean.parseBoolean(in.readLine());
} catch (IOException e) {
// :( It's ok we have defaults
}
}
public static void save(FileIO files) {
BufferedWriter out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(
files.writeFile(".ffever")));
out.write(Boolean.toString(soundEnabled));
out.write("\n");
} catch (IOException e) {
}
}
}
|
91fe3bfb-a4a5-4d71-a68e-80f6732c1244
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-26 09:03:33", "repo_name": "ValentinStoyanov/mongoDBcloudtest", "sub_path": "/src/main/java/com/model/Coordinate.java", "file_name": "Coordinate.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "09b9a61d7bf57ba71363029e7e7c1757549cf8a4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ValentinStoyanov/mongoDBcloudtest
| 210
|
FILENAME: Coordinate.java
| 0.220007
|
package com.model;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection = "coordinates")
public class Coordinate {
public Coordinate(String latitude, String longitude, String altitude, String time) {
super();
this.latitude = latitude;
this.longitude = longitude;
this.altitude = altitude;
this.time = time;
}
private String id;
private String latitude;
private String longitude;
private String altitude;
private String time;
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getAltitude() {
return altitude;
}
public void setAltitude(String altitude) {
this.altitude = altitude;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
}
|
a85b8f42-c066-49bf-b3d8-bc0d529b5318
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-06 16:28:14", "repo_name": "ck2860/Java-Projects", "sub_path": "/homework-22-ck2860/src/Session/EchoClient.java", "file_name": "EchoClient.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "753990f4009e6ed79b7167d4ea262658c13c30c3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ck2860/Java-Projects
| 188
|
FILENAME: EchoClient.java
| 0.273574
|
package Session;
import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
public class EchoClient {
public static void main(String[] args) throws IOException {
// InetAddress local = InetAddress.getLocalHost();
//// System.out.println(local.getHostAddress());
//// System.out.println(local.getHostName());
//
// Socket socket = new Socket (local.getHostAddress(), 33075);
InetAddress local = InetAddress.getLocalHost();
Socket socket = new Socket (local.getHostAddress(), 33075);
PrintWriter pw = new PrintWriter(socket.getOutputStream());
pw.println("Hello, Server!");
pw.flush(); // need this to send the data
InputStream ir = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(ir);
BufferedReader br = new BufferedReader(isr);
String message = br.readLine();
System.out.println(message);
socket.close();
}
}
|
82814fcf-c600-44de-b69e-e2cd327a4f95
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-07 14:48:35", "repo_name": "namtv1997/Vdt", "sub_path": "/VPDT1/app/src/main/java/com/vpdt/vpdt/model/Noinhan.java", "file_name": "Noinhan.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "2ebd6986ea3c13a77cd1179b5a60cc4087864255", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/namtv1997/Vdt
| 239
|
FILENAME: Noinhan.java
| 0.228156
|
package com.vpdt.vpdt.model;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Noinhan implements Parcelable {
@SerializedName("mthu")
@Expose
private String mthu;
protected Noinhan(Parcel in) {
mthu = in.readString();
}
public static final Creator<Noinhan> CREATOR = new Creator<Noinhan>() {
@Override
public Noinhan createFromParcel(Parcel in) {
return new Noinhan(in);
}
@Override
public Noinhan[] newArray(int size) {
return new Noinhan[size];
}
};
public String getMthu() {
return mthu;
}
public void setMthu(String mthu) {
this.mthu = mthu;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mthu);
}
}
|
da9857ca-e528-4cdd-95d5-6e83556ebb25
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-12 16:47:53", "repo_name": "falka164/MountApp", "sub_path": "/src/FileManager.java", "file_name": "FileManager.java", "file_ext": "java", "file_size_in_byte": 1234, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "0e7820fa1cf62b920879a83a2a843318a97e94d6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/falka164/MountApp
| 229
|
FILENAME: FileManager.java
| 0.29584
|
import java.io.*;
import java.util.LinkedList;
import java.util.List;
public class FileManager {
public void readFile(String filePath) throws IOException {
//FileReader odczyt pliku znak po znaku, dlatego opakowany w strumień BufferedReader
FileReader fileReader = new FileReader(filePath);
//BufferedReader - odczyt pliku linia po linii, udostępnia readLine
BufferedReader bufferedReader = new BufferedReader(fileReader);
try {
String textLine = bufferedReader.readLine();
do {
System.out.println(textLine);
textLine = bufferedReader.readLine();
} while (textLine != null);
} finally {
bufferedReader.close();
}
}
public void writeFile(String filePath, List<String> mountList)
throws IOException {
FileWriter fileWriter = new FileWriter(filePath, true);
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
try {
for (String line : mountList) {
bufferedWriter.write(line);
bufferedWriter.newLine();
}
} finally {
bufferedWriter.close();
}
}
}
|
1f776551-22b8-4a12-8209-2dca305a6cae
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-16 03:45:01", "repo_name": "FPhoenixCorneaE/Ignorance", "sub_path": "/ALiYunOSS/src/main/java/com/alibaba/sdk/android/common/auth/PlainTextAKSKCredentialProvider.java", "file_name": "PlainTextAKSKCredentialProvider.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "5af0b4548b4dae15a94735e529d3d9c0c7529bae", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/FPhoenixCorneaE/Ignorance
| 223
|
FILENAME: PlainTextAKSKCredentialProvider.java
| 0.212069
|
package com.alibaba.sdk.android.common.auth;
import com.alibaba.sdk.android.common.auth.CredentialProvider;
/**
* Created by zhouzhuo on 11/4/15.
*/
public class PlainTextAKSKCredentialProvider extends CredentialProvider {
private String accessKeyId;
private String accessKeySecret;
/**
* 用阿里云提供的AccessKeyId, AccessKeySecret构造一个凭证提供器
*
* @param accessKeyId
* @param accessKeySecret
*/
public PlainTextAKSKCredentialProvider(String accessKeyId, String accessKeySecret) {
this.accessKeyId = accessKeyId.trim();
this.accessKeySecret = accessKeySecret.trim();
}
public String getAccessKeyId() {
return accessKeyId;
}
public void setAccessKeyId(String accessKeyId) {
this.accessKeyId = accessKeyId;
}
public String getAccessKeySecret() {
return accessKeySecret;
}
public void setAccessKeySecret(String accessKeySecret) {
this.accessKeySecret = accessKeySecret;
}
}
|
16f98f1b-0078-48b3-89de-52599f429c0a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-13 11:14:27", "repo_name": "zinoviy23/SimpleDB4Java", "sub_path": "/res/Executor.java", "file_name": "Executor.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "40edc3c7e5f8cfa2402a474d36901c003221d260", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zinoviy23/SimpleDB4Java
| 196
|
FILENAME: Executor.java
| 0.261331
|
package db;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class Executor {
private final Connection connection;
public Executor(Connection connection) {
this.connection = connection;
}
public int executeUpdate(String query) {
try (Statement statement = connection.createStatement()) {
return statement.executeUpdate(query);
} catch (SQLException e) {
e.printStackTrace();
return -1;
}
}
public <T> T executeQuery(String query, ResultHandler<T> handler) {
try (Statement statement = connection.createStatement()) {
statement.execute(query);
try (ResultSet set = statement.getResultSet()) {
return handler.handle(set);
}
} catch (SQLException e) {
e.printStackTrace();
return null;
}
}
public void close() {
try {
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
|
93d6890e-8299-4688-95f1-2397dac96f2a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-06-02 06:53:45", "repo_name": "rlnsy/bollhorst-game-of-life", "sub_path": "/res/AudioPlayer.java", "file_name": "AudioPlayer.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "c2a8673fff5a3fd7f0cdc7accb4b771a897096f0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rlnsy/bollhorst-game-of-life
| 199
|
FILENAME: AudioPlayer.java
| 0.282196
|
package res;
import java.io.*;
import java.net.URL;
import javax.sound.sampled.*;
import javax.swing.*;
public class AudioPlayer {
private final String SOUND_DIR = "sounds/";
/*
* pre: none
* post: creates a temporary player and uses it to play clip "name"
*/
public static void playClip(String name) {
new AudioPlayer().play(name);
}
/*
* pre: name corresponds to a file present in the resource directory
* post: starts a new audio stream playing the sound file defined as name
*/
private void play(String fileName) {
try {
URL path = getClass().getResource(SOUND_DIR + fileName);
AudioInputStream stream = AudioSystem.getAudioInputStream(path);
Clip clip = AudioSystem.getClip();
clip.open(stream);
clip.start();
}
catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) {}
}
}
|
a918ddc3-f8ae-49cb-9c59-284ce0b7d307
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-10 06:29:54", "repo_name": "edkins/pantheist", "sub_path": "/src/main/java/io/pantheist/api/flatdir/model/ListFileItemImpl.java", "file_name": "ListFileItemImpl.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "a9063546d40792e960ff41fd697e6031b9eedfed", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/edkins/pantheist
| 225
|
FILENAME: ListFileItemImpl.java
| 0.249447
|
package io.pantheist.api.flatdir.model;
import javax.inject.Inject;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.inject.assistedinject.Assisted;
import io.pantheist.common.util.OtherPreconditions;
final class ListFileItemImpl implements ListFileItem
{
private final String url;
private final String fileName;
private final String kindUrl;
@Inject
private ListFileItemImpl(
@Assisted("url") @JsonProperty("url") final String url,
@Assisted("fileName") @JsonProperty("fileName") final String fileName,
@Assisted("kindUrl") @JsonProperty("kindUrl") final String kindUrl)
{
this.url = OtherPreconditions.checkNotNullOrEmpty(url);
this.fileName = OtherPreconditions.checkNotNullOrEmpty(fileName);
this.kindUrl = OtherPreconditions.checkNotNullOrEmpty(kindUrl);
}
@Override
public String url()
{
return url;
}
@Override
public String fileName()
{
return fileName;
}
@Override
public String kindUrl()
{
return kindUrl;
}
}
|
9b94d565-a893-4a8e-acfe-9f4c9a6f0e0c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2011-12-09 03:17:08", "repo_name": "XingCloud/JavaSDK", "sub_path": "/src/com/xingcloud/framework/integration/http/protocol/StatusServiceProtocol.java", "file_name": "StatusServiceProtocol.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "b7a22ecceee0e285fdabb387a428c2298fe08631", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/XingCloud/JavaSDK
| 220
|
FILENAME: StatusServiceProtocol.java
| 0.26971
|
package com.xingcloud.framework.integration.http.protocol;
import java.io.IOException;
import com.xingcloud.framework.context.stream.input.JSONInputStream;
import com.xingcloud.framework.integration.http.stream.input.HTTPInputStream;
import com.xingcloud.framework.service.request.ServiceRequest;
/**
* 状态协议服务类
*
*/
public class StatusServiceProtocol extends RESTServiceProtocol{
public static final String NAME = "STATUS";
public String getName(){
return NAME;
}
/**
* 获取请求
*/
public ServiceRequest getRequest() throws IOException{
HTTPInputStream is = new HTTPInputStream(this.httpServletRequest);
isRequestGZipped = is.isUnGZipRequired();
ServiceRequest serviceRequest = new ServiceRequest(new JSONInputStream(is));
serviceRequest.setService("status");
//根据uri判断是否使用admin模块的status接口
if(getUri().equalsIgnoreCase("/status/admin"))
serviceRequest.setMethod("admin");
else serviceRequest.setMethod("status");
serviceRequest.setParameters(serviceRequest.getInputStream().getParameters());
return serviceRequest;
}
}
|
da5e1583-c832-426c-ab0e-2dd8ff7a5322
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-14 15:18:07", "repo_name": "tanlocle0495/MODEL-MVP", "sub_path": "/app/src/main/java/efood/com/mvp/Views/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 969, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "16433a92de2044bd6fb9529a51f00d6f698a8be9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tanlocle0495/MODEL-MVP
| 183
|
FILENAME: MainActivity.java
| 0.264358
|
package efood.com.mvp.Views;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import efood.com.mvp.Persenter.CouterPersenter;
import efood.com.mvp.R;
public class MainActivity extends AppCompatActivity implements CounterView {
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button = (Button) findViewById(R.id.BtnCount);
final CouterPersenter couterPersenter = new CouterPersenter();
couterPersenter.setView(this);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
couterPersenter.DoInBackGroud();
}
});
}
@Override
public void setCounterText(String text) {
button.setText(text);
}
}
|
955547d5-034d-4a0d-84dd-8dbcb366b456
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-08 07:19:50", "repo_name": "AbhishekXenatix/jinkinsDemo", "sub_path": "/jenkinsDemo/src/test/java/stepDef/Stepj.java", "file_name": "Stepj.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "bd9a898f99a55e2bb127cb205f87937573c2a6de", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AbhishekXenatix/jinkinsDemo
| 220
|
FILENAME: Stepj.java
| 0.271252
|
package stepDef;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
//import io.cucumber.java.en.Given;
//import io.cucumber.java.en.Then;
public class Stepj {
WebDriver driver;
@Given("user launch browser")
public void user_launch_browser() {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Avyaan\\Downloads\\selenium\\New folder\\chromedriver_win32\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);
}
@Then("open google")
public void open_google() {
driver.get("https://www.google.com/");
}
}
|
f25ed1c4-3b4b-4e16-96e1-70c1ba4cb14d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-22 12:05:30", "repo_name": "divyanshuguptaososofficial/AndroidAgeCalculator", "sub_path": "/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1008, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "c1c2b20db5fd7da14f21ad043b45a6c4f1fe7f08", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/divyanshuguptaososofficial/AndroidAgeCalculator
| 170
|
FILENAME: MainActivity.java
| 0.267408
|
package com.example.ages;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.DatePicker;
import android.widget.TextView;
import android.view.*;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void calculate(View view)
{
DatePicker dob= (DatePicker)findViewById(R.id.date1);
DatePicker current_date = (DatePicker)findViewById(R.id.date);
int day=dob.getDayOfMonth();
int month=dob.getMonth();
int year=dob.getYear();
int day2=current_date.getDayOfMonth();
int month2=current_date.getMonth();
int year2=current_date.getYear();
Intent intent=new Intent(MainActivity.this,ResultActivity.class);
startActivity(intent);
}
}
|
6f4fe577-e162-435b-a00f-9ab44b6dc42c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-27 01:56:26", "repo_name": "MorphiaOrg/morphia", "sub_path": "/core/src/main/java/dev/morphia/mapping/lifecycle/UntypedEntityListenerAdapter.java", "file_name": "UntypedEntityListenerAdapter.java", "file_ext": "java", "file_size_in_byte": 1265, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "bcf5b57b44cdc67f7ea5af113ff2551cde1a6950", "star_events_count": 434, "fork_events_count": 140, "src_encoding": "UTF-8"}
|
https://github.com/MorphiaOrg/morphia
| 243
|
FILENAME: UntypedEntityListenerAdapter.java
| 0.290981
|
package dev.morphia.mapping.lifecycle;
import java.lang.reflect.Method;
import java.util.List;
import dev.morphia.Datastore;
import dev.morphia.EntityListener;
import dev.morphia.annotations.EntityListeners;
import dev.morphia.annotations.internal.MorphiaInternal;
import org.bson.Document;
/**
* This class wraps the legacy {@link EntityListeners#value()} values with no fixed API to the more formalized {@link EntityListener}
* interface.
*
* @hidden
* @since 2.4.0
* @morphia.internal
*/
@MorphiaInternal
public class UntypedEntityListenerAdapter extends EntityListenerAdapter {
public UntypedEntityListenerAdapter(Class<?> type) {
super(type);
}
void invoke(Class<?> annotation, Object entity, Document document, Datastore datastore) {
List<Method> list = getMethods().get(annotation);
if (list != null) {
list.forEach(method -> {
try {
method.invoke(getListener(), collectArgs(method, entity, document, datastore));
} catch (IllegalArgumentException | ReflectiveOperationException e) {
throw new RuntimeException(e);
}
});
}
}
}
|
99402281-dcf3-4afd-a6bd-877ae4601d99
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-09 03:27:25", "repo_name": "Kushima/microservices-tutorial", "sub_path": "/recarga-e-pagamento/src/main/java/org/edu/kushima/service/RecPagService.java", "file_name": "RecPagService.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "f4dd454c6fc81081eb9d1ef1837a7bbbc4f36671", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Kushima/microservices-tutorial
| 220
|
FILENAME: RecPagService.java
| 0.224055
|
package org.edu.kushima.service;
import java.net.InetAddress;
import java.net.UnknownHostException;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import org.wildfly.swarm.spi.runtime.annotations.ConfigurationValue;
@ApplicationScoped
public class RecPagService {
@Inject
@ConfigurationValue("url.pagamento")
String urlPagamento;
@Inject
@ConfigurationValue("url.recarga")
String urlRecarga;
public String getRecPag(String id) {
StringBuilder sb = new StringBuilder();
try {
return sb.append("Service Recarga & Pagamento: ").append(id)
.append(" URL Pagamento: [").append(urlPagamento).append("]")
.append(" URL Recarga: [").append(urlRecarga).append("]")
.append(" Host: ").append(InetAddress.getLocalHost().getHostName()).toString();
} catch (UnknownHostException e) {
return sb.append("Erro ao recuperar Recarga & Pagamento. Erro: [").append(e.getMessage()).append("]").toString();
}
}
}
|
5eeb5b4c-3895-415f-86b5-a76fa2727cd2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-20 16:53:04", "repo_name": "puffershy/puffer-spider", "sub_path": "/src/main/java/com/puffer/spider/crawler/AmazonCrawler.java", "file_name": "AmazonCrawler.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "2197128099dcc3cf0ce54b585b67a66e0fce0d8e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/puffershy/puffer-spider
| 223
|
FILENAME: AmazonCrawler.java
| 0.214691
|
package com.puffer.spider.crawler;
import com.puffer.spider.common.constants.Constants;
import com.puffer.spider.entity.AmazonItem;
import com.puffer.spider.processor.AmazonItemPiperline;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.downloader.HttpClientDownloader;
import javax.annotation.Resource;
/**
* 亚马逊爬虫
*
* @author puffer
* @date 2019年10月14日 23:27:37
* @since
*/
@Component
public class AmazonCrawler {
@Resource
private AmazonItemPiperline amazonItemPiperline;
@Resource
private BaseCrawler baseCrawler;
public void amazonCrawler(String url){
HttpClientDownloader httpClientDownloader = new HttpClientDownloader();
// httpClientDownloader.setProxyProvider(SimpleProxyProvider.from(new Proxy("",)));
baseCrawler.crawler(
amazonItemPiperline,
httpClientDownloader,
url,
Constants.THREADNUM,
AmazonItem.class
);
}
}
|
9b8b0e7d-12ab-4ae0-8cf1-3607272ae79a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2012-09-30T13:23:57", "repo_name": "opyate/typesafe-stack-cookbook", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1020, "line_count": 46, "lang": "en", "doc_type": "text", "blob_id": "afc212b9d8ee87ae1d19691fd4ec43102c9f770d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/opyate/typesafe-stack-cookbook
| 229
|
FILENAME: README.md
| 0.256832
|
Description
===========
Installs the Typesafe Stack.
Requirements
============
Platform
--------
* Ubuntu/Debian/Amazon
* No others--pull requests welcome.
Recipes
=======
default
-------
Include the default recipe in a run list, to get `typesafe_stack`.
Usage
=====
Simply include the `typesafe_stack` recipe where ever you would like the Typesafe Stack installed.
License and Author
==================
Author:: Juan M. Uys (<opyate@gmail.com>)
Copyright:: 2008-2012, Opscode, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
|
5d084454-580c-4f11-bcdd-5fc2db1a8d45
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-10 02:17:21", "repo_name": "nimeifu/project2", "sub_path": "/src/com/company/Employee.java", "file_name": "Employee.java", "file_ext": "java", "file_size_in_byte": 966, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "ed41f69222f7a304346b40f68496f7070ae07c83", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nimeifu/project2
| 189
|
FILENAME: Employee.java
| 0.258326
|
package com.company;
public abstract class Employee {
public static int EmployeeID=0;
private int employeeID;
private String FirstName;
private String Compensation;
private double salary;
public Employee(String Compensation,String FirstName,double AnnualOrHourly)
{
this.Compensation=Compensation;
this.FirstName=FirstName;
this.salary=AnnualOrHourly;
employeeID = EmployeeID;
EmployeeID++;
getEmployeeID();
}
public double getSalary() {
return salary;
}
public int getEmployeeID()
{
return employeeID;
}
public String getFirstName()
{
return FirstName;
}
public String getCompensation()
{
return Compensation;
}
public abstract double calculateSalary();
public String toString()
{
return getFirstName()+" "+getEmployeeID()+" "+getCompensation()+" "+calculateSalary();
}
}
|
76ec181a-9b92-4b78-8fb9-3e15dd28cc17
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-05 02:27:57", "repo_name": "wang-shun/transaction", "sub_path": "/foreground/listed/src/main/java/com/sinochem/crude/trade/listed/model/vo/DictionaryVO.java", "file_name": "DictionaryVO.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "b5c3e93983eb6064a14069a1f203d15d01fcc188", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/wang-shun/transaction
| 263
|
FILENAME: DictionaryVO.java
| 0.226784
|
package com.sinochem.crude.trade.listed.model.vo;
import java.io.Serializable;
/**
* 瀛楀吀鐨刅O
* @author Yichen Zhao
* date: 20180301
*/
public class DictionaryVO implements Serializable {
/**
* 编号
*/
private Integer code;
/**
* 中文
*/
private String zhName;
/**
* 英文
*/
private String enName;
public DictionaryVO() {
}
public DictionaryVO(Integer code, String zhName, String enName) {
this.code = code;
this.zhName = zhName;
this.enName = enName;
}
/** getters and setters */
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getZhName() {
return zhName;
}
public void setZhName(String zhName) {
this.zhName = zhName;
}
public String getEnName() {
return enName;
}
public void setEnName(String enName) {
this.enName = enName;
}
}
|
3d042f74-ca23-4425-995f-e078323c2cde
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-28 10:51:20", "repo_name": "practice-mix/springmvc-multi-servlet-path", "sub_path": "/src/main/java/com/practice/springmvc/multi_servlet_path/foo/FooHelloController.java", "file_name": "FooHelloController.java", "file_ext": "java", "file_size_in_byte": 1029, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "c8420e3a4417b60a548faf424bb6e1f4e28251fa", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/practice-mix/springmvc-multi-servlet-path
| 191
|
FILENAME: FooHelloController.java
| 0.249447
|
package com.practice.springmvc.multi_servlet_path.foo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.WebRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
@RestController
public class FooHelloController {
private final FooHelloService helloService;
public FooHelloController(FooHelloService helloService) {
this.helloService = helloService;
}
@RequestMapping("/hello")
public Map<String, String> hello(HttpServletRequest request, WebRequest webRequest) {
String contextPath = request.getContextPath();
String servletPath = request.getServletPath();
Map<String, String> map = new HashMap<>();
map.put("greeting", helloService.hello(this.getClass().getSimpleName()));
map.put("contextPath", contextPath);
map.put("servletPath", servletPath);
return map;
}
}
|
c3728248-b1aa-468b-994c-bf91f368f2fa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-07 14:37:57", "repo_name": "tbatty7/async-rest-service", "sub_path": "/src/test/java/com/example/asyncrestservice/ReflectiveVisitorTest.java", "file_name": "ReflectiveVisitorTest.java", "file_ext": "java", "file_size_in_byte": 1062, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "a6633689331162efad465ec53460324cf707a5de", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tbatty7/async-rest-service
| 237
|
FILENAME: ReflectiveVisitorTest.java
| 0.295027
|
package com.example.asyncrestservice;
import com.example.asyncrestservice.reflective.visitor.pattern.*;
import org.junit.Test;
public class ReflectiveVisitorTest {
@Test
public void testIt() {
Element[] list = {new This(), new That(), new TheOther()};
UpVisitor up = new UpVisitor();
DownVisitor down = new DownVisitor();
for (Element element : list) {
element.accept(up);
}
for (Element element : list) {
element.accept(down);
}
}
@Test
public void testThisWithUpVisitor() {
This aThis = new This();
UpVisitor upVisitor = new UpVisitor();
aThis.accept(upVisitor);
}
@Test
public void testThatWithUpVisitor() {
That that = new That();
UpVisitor upVisitor = new UpVisitor();
that.accept(upVisitor);
}
@Test
public void testTheOtherWithUpVisitor() {
TheOther theOther = new TheOther();
UpVisitor upVisitor = new UpVisitor();
theOther.accept(upVisitor);
}
}
|
5d0fc82d-5df4-4493-a4bf-1cf7f2bc919b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-09 08:47:32", "repo_name": "zhuanee/classroom_booking", "sub_path": "/src/main/java/com/network/booking/controller/TestController.java", "file_name": "TestController.java", "file_ext": "java", "file_size_in_byte": 1089, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "b5ea37bd59614480ac6cb3a5b3c3e84ff51c22c1", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zhuanee/classroom_booking
| 255
|
FILENAME: TestController.java
| 0.255344
|
package com.network.booking.controller;
import com.network.booking.entities.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.*;
@RestController
public class TestController {
@GetMapping("/user")
public User getUser() {
return new User( "倪升武", 1);
}
@GetMapping("/list")
public List<User> getUserList() {
List<User> userList = new ArrayList<>();
User user1 = new User( "倪升武", 1);
User user2 = new User( "达人课", 1);
userList.add(user1);
userList.add(user2);
return userList;
}
@GetMapping("/map")
public Map<String, Object> getMap() {
Map<String, Object> map = new HashMap<>();
User user = new User("倪升武", 1);
map.put("作者信息", user);
map.put("博客地址", "http://blog.itcodai.com");
map.put("CSDN地址", "http://blog.csdn.net/eson_15");
map.put("粉丝数量", 4153);
return map;
}
}
|
d390f3c5-22d9-4d58-a46a-765536677d7a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-05 14:54:27", "repo_name": "irfancoder/MyCurtin", "sub_path": "/app/src/main/java/com/irfan/draft1/Maps/Coordinates.java", "file_name": "Coordinates.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "2c2284ab140728743a2c99bcaba34dc08770d147", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/irfancoder/MyCurtin
| 213
|
FILENAME: Coordinates.java
| 0.23092
|
package com.irfan.draft1.Maps;
import java.io.Serializable;
/**
* Created by irfan on 27/07/2017.
*/
public class Coordinates implements Serializable {
private Double latitude, longitude;
private float bearing;
private int speed;
public Coordinates() {
}
public Coordinates(Double latitude, Double longitude, float bearing, int speed) {
this.latitude = latitude;
this.longitude = longitude;
this.bearing = bearing;
this.speed = speed;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public float getBearing() {
return bearing;
}
public int getSpeed() {
return speed;
}
public void setSpeed(int speed) {
this.speed = speed;
}
}
|
b0f0bf41-f62e-45c7-8b2d-1e1c4b18063d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-01 09:36:17", "repo_name": "hanschristian2710/CritterMaps", "sub_path": "/src/Lion.java", "file_name": "Lion.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "f8b962f72bd18f85bd439be4386c206bfe7c84e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hanschristian2710/CritterMaps
| 249
|
FILENAME: Lion.java
| 0.277473
|
import java.awt.Color;
public class Lion extends Critter {
private int steps;
private int[] movesDir = { NORTH, SOUTH, EAST, WEST };
private int counter;
private int thenMove;
public Lion(int steps) {
super();
this.steps = steps;
counter = steps;
}
public int getSteps() {
return steps;
}
public int fight(String opponent) {
return PAPER; // Lion always return paper
}
public Color getColor() {
return Color.YELLOW; // Lion has yellow color
}
public int getMove(CritterInfo info) {
// moves the given number of steps in a random direction
// then choose a new random direction and repeat
if (counter == steps) { // if counter has equaled the number of
// steps in the given direction, it will
// choose a new random direction
thenMove = movesDir[rand.nextInt(movesDir.length)];
counter = 1;
return thenMove;
} else {
counter++;
return thenMove;
}
}
public String toString() {
return "L"; // displays lion as L
}
}
|
d3e77f41-430d-45f6-84fe-5a4f53b6d60c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-13 07:44:26", "repo_name": "zhangyu84848245/butterfly", "sub_path": "/src/main/java/org/fantasy/bean/registry/RecoverableServiceRegistry.java", "file_name": "RecoverableServiceRegistry.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "fa73a30f9ed87d2fbcc321499a62fabdbac3150b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zhangyu84848245/butterfly
| 214
|
FILENAME: RecoverableServiceRegistry.java
| 0.275909
|
package org.fantasy.bean.registry;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.fantasy.service.AbstractService;
/**
* 暂时没实现
* @author fantasy
*
*/
public abstract class RecoverableServiceRegistry extends AbstractService implements ServiceRegistry {
// private Configuration conf;
private final ConcurrentMap<RegistryKey, List<RegistryValue>> backupMap = new ConcurrentHashMap<RegistryKey, List<RegistryValue>>();
public RecoverableServiceRegistry(/** Configuration conf */) {
// this.conf = conf;
}
public void addRegistry(RegistryKey key, RegistryValue value) {
if(key == null)
throw new IllegalArgumentException("Registry key is null");
List<RegistryValue> list = backupMap.get(key);
if(list == null)
list = new ArrayList<RegistryValue>();
if(value != null)
list.add(value);
backupMap.put(key, list);
}
// public boolean removeRegistry
}
|
b15e2bb7-f75c-4120-b3f2-cc06a31b4080
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-25 03:28:15", "repo_name": "yangtie34/projects", "sub_path": "/jinghua/DM/src/com/jhkj/mosdc/permission/po/TsJsCdzy.java", "file_name": "TsJsCdzy.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "1f2463105335200adba099ea46e3a68367fdcd58", "star_events_count": 1, "fork_events_count": 4, "src_encoding": "UTF-8"}
|
https://github.com/yangtie34/projects
| 320
|
FILENAME: TsJsCdzy.java
| 0.240775
|
package com.jhkj.mosdc.permission.po;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* 角色 菜单资源表
*
* @author evan
*
*/
@Entity
@Table(name = "TS_JS_CDZY")
public class TsJsCdzy implements java.io.Serializable {
private static final long serialVersionUID = -2284656840129336950L;
/**
* id
*/
private Long id;
/**
* 菜单资源id
*/
private Long cdzyId;
/**
* 角色ID
*/
private Long jsId;
@Id
@Column(name = "ID", unique = true, nullable = false, precision = 16, scale = 0)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Column(name = "CDZY_ID", precision = 16, scale = 0)
public Long getCdzyId() {
return cdzyId;
}
public void setCdzyId(Long cdzyId) {
this.cdzyId = cdzyId;
}
@Column(name = "JS_ID", precision = 16, scale = 0)
public Long getJsId() {
return jsId;
}
public void setJsId(Long jsId) {
this.jsId = jsId;
}
}
|
c96625ba-ea3b-4bd7-a99f-8b49de67e15d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-12 13:06:35", "repo_name": "linkaicheng/S2S4H4_book_shop", "sub_path": "/book_shop_v1.1/src/com/change/mall/adminuser/dao/AdminUserDao.java", "file_name": "AdminUserDao.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "585eb759542dd67a8ad3221dbc5c7695ca11a533", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/linkaicheng/S2S4H4_book_shop
| 205
|
FILENAME: AdminUserDao.java
| 0.283781
|
package com.change.mall.adminuser.dao;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import com.change.mall.adminuser.vo.AdminUser;
public class AdminUserDao {
private SessionFactory sessionFactory;
// Dao完成登录的代码
public SessionFactory getSessionFactory() {
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
private Session getSession() {
return sessionFactory.getCurrentSession();
}
public AdminUser login(AdminUser adminUser) {
String hql = "from AdminUser where username = ? and password = ?";
Query query = getSession().createQuery(hql).setString(0, adminUser.getUsername()).setString(1,
adminUser.getPassword());
List<AdminUser> list = query.list();
if (list != null && list.size() > 0) {
return list.get(0);
}
return null;
}
}
|
303e71b3-a4e1-4408-8578-9046bbdbc336
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-17 13:41:10", "repo_name": "akarchevskiy/datakernel", "sub_path": "/boot-triggers/src/main/java/io/datakernel/trigger/Trigger.java", "file_name": "Trigger.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "a84643c0654ab4c1ef59785c9e1c6081572302f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/akarchevskiy/datakernel
| 215
|
FILENAME: Trigger.java
| 0.253861
|
package io.datakernel.trigger;
import java.util.function.Supplier;
public final class Trigger {
private final Severity severity;
private final String component;
private final String name;
private final Supplier<TriggerResult> triggerFunction;
Trigger(Severity severity, String component, String name,
Supplier<TriggerResult> triggerFunction) {
this.severity = severity;
this.component = component;
this.name = name;
this.triggerFunction = triggerFunction;
}
public static Trigger of(Severity severity, String component, String name,
Supplier<TriggerResult> triggerFunction) {
return new Trigger(severity, component, name, triggerFunction);
}
public Severity getSeverity() {
return severity;
}
public String getComponent() {
return component;
}
public String getName() {
return name;
}
public Supplier<TriggerResult> getTriggerFunction() {
return triggerFunction;
}
@Override
public String toString() {
return severity + " : " + component + " : " + name;
}
}
|
2a4436a7-9138-4bff-8b71-e83c9d3324cc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-21 14:13:21", "repo_name": "hardenikhil/Selenium_Nikhil", "sub_path": "/src/practicedemo/Disabledevmode.java", "file_name": "Disabledevmode.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "f96ca46bf8bf8ec6a42cddeb7f59b2096417ae04", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hardenikhil/Selenium_Nikhil
| 223
|
FILENAME: Disabledevmode.java
| 0.214691
|
package practicedemo;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.testng.annotations.AfterTest;
public class Disabledevmode {
public WebDriver driver;
String url= "http://www.globalsqa.com/";
String b="webdriver.chrome.driver";
String p="C:\\Users\\nikhil\\chromedriver.exe";
@Test
public void f() {
driver.findElement(By.xpath(".//*[@id='menu-item-1513']/a")).click();
}
@BeforeTest
public void beforeTest() {
System.setProperty("b", "p");
driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get(url);
ChromeOptions options=new ChromeOptions();
options.addArguments("--disable-extensions");
WebDriver driver=new ChromeDriver(options);
}
@AfterTest
public void afterTest() {
driver.quit();
}
}
|
e09b43bc-51b3-4ba3-a32b-8c95dc6cf9f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-12-02 16:49:37", "repo_name": "KeyMove/RedisPipe", "sub_path": "/src/com/github/KeyMove/Tools/JSTools.java", "file_name": "JSTools.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "952d73802671477756343acd7ac53ddb16df1636", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/KeyMove/RedisPipe
| 211
|
FILENAME: JSTools.java
| 0.278257
|
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.github.KeyMove.Tools;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
/**
*
* @author KeyMove
*/
public class JSTools {
static ScriptEngine engine;
public static ScriptEngine getInstance(){
//((Invocable)engine).invokeFunction(name, args)
if(engine==null){
engine = new ScriptEngineManager().getEngineByName("js");
try{
ScriptContext context = engine.getContext();
for (String s : new String[] { "load", "loadWithNewGlobal", "exit", "quit" })
context.removeAttribute(s, context.getAttributesScope(s));
}
catch (Exception e) {
System.out.print(e);
}
}
return engine;
}
}
|
2e891da2-af1f-4a17-b0ea-5e0773ea92cd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2013-11-29T17:28:25", "repo_name": "bsilvia/BSOS", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1032, "line_count": 15, "lang": "en", "doc_type": "text", "blob_id": "8491697618447525b0a502171087e48765f34ae3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bsilvia/BSOS
| 271
|
FILENAME: README.md
| 0.23231
|
BSOS
============
A Browser-based virtual Operating System for Operating Systems CMSC 422L111
View the latest submission of the project <a href="http://bsilvia.github.com/BSOS">here</a>.
<a href="http://labouseur.com/courses/os/iProject1.pdf">iProject1</a> - First set of enhancements to code base. Due 9/19.
<a href="http://labouseur.com/courses/os/iProject2.pdf">iProject2</a> - Improve on functionality of iProject1 along with the ability to load and execute user programs in memory. Due 10/10.
<a href="http://labouseur.com/courses/os/iProject3.pdf">iProject3</a> - Improve on functionality of iProject2 along with the ability to execute multiple user programs at the same time using round robin scheduling. Due 11/7.
<a href="http://labouseur.com/courses/os/iProject4-final.pdf">iProject4</a> - Improve on functionality of iProject3 along with a local file system and swapped virtual memory so the user can execute more processes than there are memory partitions along with two more scheduling algorithms. Due 12/05.
|
2b84180a-037c-458e-bfee-fca5b4b14de4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-23 15:19:07", "repo_name": "one1on/sgj-scraper", "sub_path": "/src/main/java/de/one1on/sgjscraper/model/Comment.java", "file_name": "Comment.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "7126c0c809feb0c2df97b15e7f19188c1f3b1b78", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/one1on/sgj-scraper
| 230
|
FILENAME: Comment.java
| 0.225417
|
package de.one1on.sgjscraper.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.ToString;
import org.joda.time.DateTime;
@Data
@ToString(of = {"id", "timestamp", "votes"})
public class Comment {
@SerializedName("id")
@Expose
private int id;
@SerializedName("image")
@Expose
private String image;
@SerializedName("imageA")
@Expose
private String imageA;
@SerializedName("text")
@Expose
private String text;
@SerializedName("timestamp")
@Expose
private DateTime timestamp;
@SerializedName("votes")
@Expose
private Votes votes;
@SerializedName("author")
@Expose
private Author author;
@SerializedName("status")
@Expose
private int status;
@SerializedName("pinned")
@Expose
private boolean pinned;
@SerializedName("report")
@Expose
private int report;
@SerializedName("additional_information")
@Expose
private String additionalInformation;
}
|
f4d2616b-fd38-4d24-91e2-405dbf97c2aa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-27 04:54:04", "repo_name": "luxious1993/login_management_service_demo", "sub_path": "/src/main/java/com/luxious/lmsd/violation/login/CurrentEmployeeValidator.java", "file_name": "CurrentEmployeeValidator.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "1e88910725e44700076c8df53bd10796c7c384f8", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/luxious1993/login_management_service_demo
| 194
|
FILENAME: CurrentEmployeeValidator.java
| 0.250913
|
package com.luxious.lmsd.violation.login;
import com.luxious.lmsd.dao.EmployeeDao;
import com.luxious.lmsd.model.datastore.Employee;
import com.luxious.lmsd.model.service.LoginValidationResult;
import com.luxious.lmsd.model.service.LoginViolationType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class CurrentEmployeeValidator implements LoginValidator {
@Autowired
EmployeeDao employeeDao;
@Override
public LoginValidationResult validate(String employeeLogin) {
System.out.println(employeeLogin);
List<Employee> employeeList = employeeDao.getEmployeeByEmployeeLogin(employeeLogin);
System.out.println(employeeList.size());
if (employeeList.isEmpty()) {
return LoginValidationResult.validResult();
} else {
return LoginValidationResult.withViolationResult(LoginViolationType.CURRENT_EMPLOYEE);
}
}
}
|
ec95cfbe-ab66-4ebf-bd08-177051d0da56
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-12-18 16:03:54", "repo_name": "corymintz/mongosocket", "sub_path": "/src/mongosocket/examples/SimpleClientExample.java", "file_name": "SimpleClientExample.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "0b11dc5968eeb08fb28bf5f3f349e00f84c77959", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/corymintz/mongosocket
| 190
|
FILENAME: SimpleClientExample.java
| 0.235108
|
package mongosocket.examples;
import com.mongodb.MongoNamespace;
import mongosocket.MongoSocket;
import mongosocket.MongoSocketClient;
import mongosocket.MongoSocketConnectFailedException;
import java.io.IOException;
import java.io.OutputStream;
public class SimpleClientExample {
public static void main(String[] args) throws MongoSocketConnectFailedException, IOException {
java.util.logging.LogManager.getLogManager().reset();
MongoSocketClient client = new MongoSocketClient(new MongoNamespace("test.test"));
for(int i = 0; i < 25; i++) {
Runnable task = () -> {
try {
MongoSocket socket = client.connect(60, 60);
OutputStream stream = socket.getOutputStream();
stream.write("Hello, World.".getBytes());
stream.close();
} catch (MongoSocketConnectFailedException | IOException e) {}
};
new Thread(task).start();
}
}
}
|
1357df53-3cbd-42cb-9424-2ff94ddcc1e4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-02-18 23:30:53", "repo_name": "howard123/Rest-Json-Acct", "sub_path": "/gs-rest-service/src/main/java/RestfulServ/Account.java", "file_name": "Account.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "82234956eea9a9f285ffff3c87829c22f4d4429e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/howard123/Rest-Json-Acct
| 222
|
FILENAME: Account.java
| 0.289372
|
package RestfulServ;
import hibernate.AccountFinding;
import java.util.ArrayList;
import java.util.List;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Account {
@RequestMapping("/account")
public com.jack.obj.Account account(@RequestParam(value="emp_id", defaultValue= "2" ) long emp_num){
//Query database for the account number and routing number
//long emp_num = 1;
List<com.jack.obj.Account> acts = new ArrayList<com.jack.obj.Account>();
AccountFinding af = new AccountFinding();
af.init();
List<hibernate.Account> accts = af.acctFetching(emp_num);
for (hibernate.Account b : accts ){
acts.add(new com.jack.obj.Account(b.getAcct_num(),b.getRoute_num()));
}
return acts.get(0);
}
}
|
01b54f3a-4a4e-477e-90d1-2e65b9be9a81
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-04 10:04:06", "repo_name": "sival19/Mystudies", "sub_path": "/CourseSystem2/src/com/company/Course.java", "file_name": "Course.java", "file_ext": "java", "file_size_in_byte": 1038, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "1c8fb3ad57c055a46c03b401a22f04d869b10c25", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sival19/Mystudies
| 213
|
FILENAME: Course.java
| 0.262842
|
package com.company;
public class Course {
public String name;
public Student[] participants;
public int studentCount = 0;
public void enroll(Student std) {
participants[studentCount] = std;
studentCount++;
}
public void remove(Student std)
{
for (int i = 0; i < studentCount; i++)
{
if(participants[i].id == std.id)
{
studentCount--;
if (i == studentCount)
{
participants[i]=null;
}
else
{
for (int j = i+1 ; j<=studentCount; j++)
{
participants[j-1]=participants[j];
}
}
}
}
}
public Student[] getParticipants()
{
Student[] stds = new Student[studentCount];
for(int i = 0 ; i< studentCount; i++)
{
stds[i]=participants[i];
}
return stds;
}
}
|
49e45d05-8f09-45fd-a779-44c4c41a5e41
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-08 00:09:07", "repo_name": "spencerSunLingWei/Java_start_up", "sub_path": "/FileCharCopyTest.java", "file_name": "FileCharCopyTest.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "b9d519e27b861a2637e7dc7dc5e09c81296c3796", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/spencerSunLingWei/Java_start_up
| 191
|
FILENAME: FileCharCopyTest.java
| 0.271252
|
package com.stage1.part4.task2;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class FileCharCopyTest {
public static void main(String[] args) {
FileReader fr = null;
FileWriter fw = null;
try {
fr = new FileReader("/Users/spencersun/Desktop/a.txt");
fw = new FileWriter("/Users/spencersun/Desktop/b.txt");
int res = 0;
while((res = fr.read()) != -1){
fw.write(res);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if(null != fw) {
try {
fw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if(null != fr) {
try {
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
|
f7d2a2d4-2525-4e8e-8c4d-b49b9cb00f80
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-16 20:52:21", "repo_name": "PolkovnikMedved/pdb-examen", "sub_path": "/src/main/java/be/solodoukhin/dao/SQLOrderDAO.java", "file_name": "SQLOrderDAO.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "dfc078981a5740041a80822c57f2662d0ed044f6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/PolkovnikMedved/pdb-examen
| 228
|
FILENAME: SQLOrderDAO.java
| 0.258326
|
package be.solodoukhin.dao;
import be.solodoukhin.model.Order;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
/**
* @author SOLODOUKHIN VIKTOR
* <p>
* date 16/06/18
*/
public abstract class SQLOrderDAO implements IOrderDAO {
private static final Logger logger = LoggerFactory.getLogger(SQLOrderDAO.class);
private final SQLDAOFactory factory;
public SQLOrderDAO(SQLDAOFactory factory) {
this.factory = factory;
}
@Override
public Order getById(Integer id) {
return null;
}
@Override
public List<Order> getAll(String regularExpression) {
return null;
}
@Override
public Integer insert(Order object) throws Exception {
return null;
}
@Override
public boolean delete(Order object) throws Exception {
return false;
}
@Override
public boolean update(Order object) throws Exception {
return false;
}
}
|
703ecd49-09ce-4f92-8cf8-1aa516d2b04e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-23 19:12:49", "repo_name": "PaulinaBinas/tachoactivecms", "sub_path": "/src/main/java/com/binas/tachographcms/service/impl/AdminServiceImpl.java", "file_name": "AdminServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "ace6fa011eac08af6a497cad46cc972e91f08650", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/PaulinaBinas/tachoactivecms
| 231
|
FILENAME: AdminServiceImpl.java
| 0.262842
|
package com.binas.tachographcms.service.impl;
import com.binas.tachographcms.model.entity.Admin;
import com.binas.tachographcms.repository.AdminRepository;
import com.binas.tachographcms.service.AdminService;
import javassist.NotFoundException;
import org.springframework.stereotype.Service;
import javax.security.auth.login.AccountNotFoundException;
import java.util.List;
import java.util.Optional;
@Service
public class AdminServiceImpl implements AdminService {
private AdminRepository adminRepository;
public AdminServiceImpl(AdminRepository adminRepository) {
this.adminRepository = adminRepository;
}
@Override
public Optional<Admin> getAdmin(String username, String password) {
return this.adminRepository.getAdminByUsernameAndPassword(username, password);
}
@Override
public void changePassword(String newPassword) {
this.adminRepository.getFirstByUsername("admin").ifPresentOrElse(admin -> {
admin.setPassword(newPassword);
this.adminRepository.save(admin);
}, () -> {throw new IllegalStateException();});
}
@Override
public Optional<Admin> getAdmin() {
return this.adminRepository.getAdminById(1L);
}
}
|
b9c5aa74-7e0d-4cea-89cc-a3115b1a4e8a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-05 13:05:02", "repo_name": "Haamseongho/checkApp", "sub_path": "/app/src/main/java/project/checkapp/haams/checkapp/front_end/LoginActivity.java", "file_name": "LoginActivity.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "6a53ecf1a558fa87c79a0edd1bec508fe0561177", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Haamseongho/checkApp
| 178
|
FILENAME: LoginActivity.java
| 0.216012
|
package project.checkapp.haams.checkapp.front_end;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import project.checkapp.haams.checkapp.R;
public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
private Button btnGenLogin;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
initViews();
}
private void initViews() {
btnGenLogin = (Button) findViewById(R.id.btn_login_general);
btnGenLogin.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_login_general:
startActivity(new Intent(LoginActivity.this, HomeActivity.class));
finish();
break;
}
}
}
|
e770bb5f-703b-4165-92d2-27115ddbbc5f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-07-28T14:13:25", "repo_name": "chuanjiangma/Notes", "sub_path": "/03.debug/00.windows-vs/Remote-Debug-with-VS-Remote-Debugger.md", "file_name": "Remote-Debug-with-VS-Remote-Debugger.md", "file_ext": "md", "file_size_in_byte": 1027, "line_count": 17, "lang": "en", "doc_type": "text", "blob_id": "35c0bdcaaa8a02e1c7d67b9c4aae87d5ae22a07d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/chuanjiangma/Notes
| 239
|
FILENAME: Remote-Debug-with-VS-Remote-Debugger.md
| 0.261331
|
# Remote Debug with VS Remote Debugger
[toc]
## Preparations
Referring to [official document](https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging?view=vs-2019), download the remote debug tool and install it to the target remote machine. On the first time start remote debugger, it will ask for configurations, just follow the document.
## Setup the way to look up symbols
Defaultly, visual studio will look up symbols local, which will perform better. But still support configure to look up symbols on remote machine. Actually it is very simple, just keep a same .pdb file on local machine, and set the symbols look up directory in the debug->symbols config panel of the solution.
## Reference
- [Remote debug setting from official site](https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging?view=vs-2019)
- may help and waite to confirm: [solve symbols not found and breaks not hit local](https://stackoverflow.com/questions/151966/why-are-no-symbols-loaded-when-remote-debugging)
|
e0cd9885-1664-40ab-b643-142cf0f6c9e3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-21 01:51:24", "repo_name": "YuDongZhang/SQLearn", "sub_path": "/app/src/main/java/com/example/sqlearn/DBHelper.java", "file_name": "DBHelper.java", "file_ext": "java", "file_size_in_byte": 1204, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "bfc483447d8094988c8f861ef6b50e43ef59e0ae", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/YuDongZhang/SQLearn
| 261
|
FILENAME: DBHelper.java
| 0.290981
|
package com.example.sqlearn;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
/**
* Created by pateo on 18-9-19.
*/
public class DBHelper extends SQLiteOpenHelper {
// 数据库文件名
public static final String DB_NAME = "my_database.db";
// 数据库表名
public static final String TABLE_NAME = "t_person";
// 数据库版本号
public static final int DB_VERSION = 1;
public static final String NAME = "name";
public static final String AGE = "age";
public DBHelper(Context context) {
super(context, DB_NAME, null, DB_VERSION);
}
// 当数据库文件创建时,执行初始化操作,并且只执行一次
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
//建表
String sql = "create table " +
TABLE_NAME+
"(_id integer primary key autoincrement, "+
NAME + " varchar,"+
AGE + " varchar"
+ ")";
sqLiteDatabase.execSQL(sql);
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
}
}
|
5ed5331d-cb9d-491c-a9e0-a32506a85689
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-20 00:11:49", "repo_name": "sridevi123-design/WebDriverMaven", "sub_path": "/src/test/java/webdriverMaven/LoginTest.java", "file_name": "LoginTest.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "85a93eadd726d479e036343f57958999f5cfccc3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sridevi123-design/WebDriverMaven
| 217
|
FILENAME: LoginTest.java
| 0.249447
|
package webdriverMaven;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;
//import io.github.bonigarcia.wdm.ChromeDriverManager;
//import org.openqa.selenium.chrome.ChromeDriverInfo;
public class LoginTest {
//ChromeDriverManager.getInstance().setup();
public static WebDriver driver;
@BeforeSuite
public void setup() {
//ChromeDriverManager.getInstance().setup();
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Sridevi\\Documents\\seleniumTutorials\\sleniumRCjar\\chromedriver.exe");
driver=new ChromeDriver();
}
@Test
public void doLogin() {
driver.get("http://gmail.com");
driver.findElement(By.id("identifierId")).sendKeys("sridevigk2@gmail.com");
driver.findElement(By.xpath("//*[@id=\"identifierNext\"]/span")).click();
}
@AfterSuite
public void tearDown() {
driver.quit();
}
}
|
ae28e6fa-be68-4124-bff8-cf26a751801b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-08 19:05:49", "repo_name": "jasons157/cowboywiki", "sub_path": "/src/main/java/personal/jasonevans/cowboywiki/entity/Role.java", "file_name": "Role.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "4dca3c12bfca826bd67cd5e4f79eda2b4a96a2ce", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jasons157/cowboywiki
| 234
|
FILENAME: Role.java
| 0.246533
|
package personal.jasonevans.cowboywiki.entity;
import javax.persistence.*;
/**
* A POJO class that maps to the "role"
* table in the cowboy_project schema.
*
* Every NEW role type is set to autoincrement that id,
* so all numbers map to a role type.
*/
@Entity
@Table(name = "role")
public class Role {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "name")
private String name;
public Role(){}
public Role(Long id, String name) {
this.id = id;
this.name = name;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "Role{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
}
|
9832fb89-a6f6-45c2-9d21-12f6ab366772
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-02 09:35:02", "repo_name": "alexwu59/smart", "sub_path": "/src/main/java/com/ws/test/HelloServlet.java", "file_name": "HelloServlet.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "30355255631328649a0a69a75b28a4b5296d1475", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/alexwu59/smart
| 171
|
FILENAME: HelloServlet.java
| 0.236516
|
package com.ws.test;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by shuaiwu on 2016/3/27.
*/
@WebServlet("/hello")
public class HelloServlet extends HttpServlet {
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
doGet(request,response);
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String s = df.format(new Date());
request.setAttribute("time",s);
request.getRequestDispatcher("/hello.jsp").forward(request,response);
}
}
|
cc944b28-a9da-41cf-b537-f880d2ce206e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-28 23:31:17", "repo_name": "Edd002/Desenvolvimento-Web-Back-end-workspace", "sub_path": "/Lab03Listener/src/AlertaListener.java", "file_name": "AlertaListener.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "9dd913d46d5b836f533903f2fc17264ae83fe898", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Edd002/Desenvolvimento-Web-Back-end-workspace
| 214
|
FILENAME: AlertaListener.java
| 0.247987
|
import java.util.concurrent.atomic.AtomicInteger;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
public class AlertaListener implements HttpSessionListener, ServletContextListener {
final private static AtomicInteger contadorSessoes = new AtomicInteger(0);
public static int getContadorSessoes() {
return contadorSessoes.get();
}
public AlertaListener() {
}
@Override
public void sessionCreated(HttpSessionEvent se) {
HttpSession session = se.getSession();
session.setAttribute("cores", 0);
contadorSessoes.incrementAndGet();
}
@Override
public void sessionDestroyed(HttpSessionEvent se) {
if(contadorSessoes.get() > 0)
contadorSessoes.decrementAndGet();
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
}
@Override
public void contextInitialized(ServletContextEvent sce) {
}
}
|
384bf1ff-8c27-4645-93fa-35a81b9bcbb0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-29 09:53:15", "repo_name": "kkamdooong/acas", "sub_path": "/src/main/java/com/kkamdooong/acas/controller/AcasController.java", "file_name": "AcasController.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "e83df57b8fc54d453d7161b4dc769177fecc68e1", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kkamdooong/acas
| 203
|
FILENAME: AcasController.java
| 0.262842
|
package com.kkamdooong.acas.controller;
import com.kkamdooong.acas.model.AutoCompleteItem;
import com.kkamdooong.acas.service.AcasService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.net.URI;
import java.util.List;
@RestController
@RequestMapping("/api/v1")
public class AcasController {
private final AcasService service;
@Autowired
public AcasController(AcasService service) {
this.service = service;
}
@GetMapping("/items")
public List<AutoCompleteItem> getItems(@RequestParam String keyword) {
return service.getItems(keyword.toLowerCase());
}
@PostMapping("/items")
public ResponseEntity addItems(@RequestBody List<AutoCompleteItem> items) {
List<AutoCompleteItem> addedItems = service.addItems(items);
return ResponseEntity.created(URI.create("/api/v1/items")).body(addedItems);
}
}
|
e5996b19-9ba0-415b-8db5-34c9de067b9b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-02 10:56:13", "repo_name": "892031083/mplayer1", "sub_path": "/app/src/main/java/com/example/mplayer1/music/beaninfo/ScreenBroadcastReceiver.java", "file_name": "ScreenBroadcastReceiver.java", "file_ext": "java", "file_size_in_byte": 1261, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "d2eb32c05fc9cf09da942567ae479dba81df1dd1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/892031083/mplayer1
| 260
|
FILENAME: ScreenBroadcastReceiver.java
| 0.23793
|
package com.example.mplayer1.music.beaninfo;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.example.mplayer1.AppManager;
import com.example.mplayer1.music.LockScreenMusicAvtivity;
import com.example.mplayer1.music.MsplayActivity;
import com.example.mplayer1.music.ServiceToutil;
/**
* @author master
* @date 2018/1/23
*/
public class ScreenBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_SCREEN_OFF)) {
if (!LockScreenMusicAvtivity.isStart&& ServiceToutil.getInstance().getMediaPlayer().isPlaying()) {
//服务已经创建 并且 正在播放
Intent intent1 = new Intent(context, LockScreenMusicAvtivity.class);
intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
AppManager.getContext().startActivity(intent1);
}
} else if (action.equals(Intent.ACTION_SCREEN_ON)) {
}else if(action.equals(Intent.ACTION_USER_PRESENT)){
// LogUtil.e("开屏");
}
}
}
|
7ec46082-92d9-490d-bc97-5bc7ec7d7a0c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-03 03:42:58", "repo_name": "unisung/mvc", "sub_path": "/MVCTest01/src/controller/MyController.java", "file_name": "MyController.java", "file_ext": "java", "file_size_in_byte": 1041, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "9a44765a4def498ef9cde7da7d13c780cc7f4744", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/unisung/mvc
| 180
|
FILENAME: MyController.java
| 0.282196
|
package controller;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import action.HelloAction;
@WebServlet("/MyController")
public class MyController extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HelloAction action = new HelloAction();
try {
//action클래스의 인스턴스에 작업을 하도록 분기 처리
//이동할 페이지
String viewPage = action.execute(request, response);
RequestDispatcher dispatcher
= request.getRequestDispatcher(viewPage);//이동할 페이지 처리
//페이지 이동
dispatcher.forward(request, response);
}catch(Exception e) {}
}
}
|
081c65d5-d1e8-4f32-a61b-710baeeade61
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-06-21 14:26:22", "repo_name": "zz3599/Triplanner308", "sub_path": "/src/java/com/triplanner/model/DB.java", "file_name": "DB.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "526cdbe8117f77d3dd48f6521052df69a393755b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zz3599/Triplanner308
| 238
|
FILENAME: DB.java
| 0.278257
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.triplanner.model;
/**
*
* @author brook
*/
import java.sql.*;
public class DB {
//private static String url = "jdbc:mysql://TriPlanner308.db.10332557.hostedresource.com:3306/TriPlanner308?zeroDateTimeBehavior=convertToNull";
//private static String username = "TriPlanner308";
//private static String password = "qwerAsdf!1";
private static String url = "jdbc:mysql://localhost:3306/TriPlanner308";
private static String username = "root";
private static String password = "root";
static {
try {
Class.forName("com.mysql.jdbc.Driver"); // You don't need to load it on every single opened connection.
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
public static Connection getConnection() throws SQLException {
return DriverManager.getConnection(url, username, password);
}
}
|
4e723746-d333-42d6-b05d-d4fd0a743288
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-11 13:46:25", "repo_name": "xingling1122/CasualNotes", "sub_path": "/app/src/main/java/com/xl/projectno/utils/InputSoftUtils.java", "file_name": "InputSoftUtils.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "ab3191a1624082d26ea7d5e3045aadc253e8a220", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/xingling1122/CasualNotes
| 183
|
FILENAME: InputSoftUtils.java
| 0.240775
|
package com.xl.projectno.utils;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
/**
* Created by Administrator on 2017/3/23.
*/
public class InputSoftUtils {
public static void closeInputSoft(TextView textView) {
InputMethodManager imm = (InputMethodManager) textView
.getContext().getSystemService(
Context.INPUT_METHOD_SERVICE);
if (imm.isActive()) {
imm.hideSoftInputFromWindow(
textView.getApplicationWindowToken(), 0);
}
}
public static void openInputSoft(TextView textView) {
InputMethodManager imm = (InputMethodManager) textView
.getContext().getSystemService(
Context.INPUT_METHOD_SERVICE);
if (!imm.isActive()) {
imm.toggleSoftInputFromWindow(
textView.getApplicationWindowToken(), 0,0);
}
}
}
|
94c2708c-4220-4023-8c45-48274cf0a409
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-07 17:11:43", "repo_name": "Atracks/Autocopmpleter", "sub_path": "/src/main/java/ru/bravery_and_stupidity/skbwordpadspring/system_tools/Toolkit.java", "file_name": "Toolkit.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "330470055a49883d9dcd00c8bf6de2fb5d72d746", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Atracks/Autocopmpleter
| 214
|
FILENAME: Toolkit.java
| 0.286968
|
package ru.bravery_and_stupidity.skbwordpadspring.system_tools;
import ru.sugarbaron_bicycles.library.exceptions.CriticalOperationFailed;
import ru.sugarbaron_bicycles.library.exceptions.NeedFixCode;
public final class Toolkit {
public static void requireNotNull(Object referenceToCheck) {
if(null == referenceToCheck){
throwNeedFixCode("unexpected null value");
}
return;
}
public static void requireNotEmpty(String stringToCheck) {
if(stringToCheck.isEmpty() ) {
throwNeedFixCode("unexpected empty string");
}
return;
}
public static void throwNeedFixCode(String message) {
NeedFixCode needFixCode = new NeedFixCode(message);
Logger.exception(needFixCode);
throw needFixCode;
}
public static void throwCriticalOperationFailed(String message) {
CriticalOperationFailed criticalOperationFailed = new CriticalOperationFailed(message);
Logger.exception(criticalOperationFailed);
throw criticalOperationFailed;
}
}
|
dda04410-3b85-48d7-9dcd-7658b58cad57
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-08 14:38:25", "repo_name": "UncleSniper/uake", "sub_path": "/src/org/unclesniper/uake/syntax/ShortLiteral.java", "file_name": "ShortLiteral.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "533c88dde758947b0784d107ef0cb0bc87a5cca0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/UncleSniper/uake
| 258
|
FILENAME: ShortLiteral.java
| 0.288569
|
package org.unclesniper.uake.syntax;
import org.unclesniper.uake.Location;
import org.unclesniper.uake.CompilationContext;
import org.unclesniper.uake.LiteralExceedsRangeException;
public class ShortLiteral extends Expression {
private final String specifier;
private final short value;
public ShortLiteral(Location location, String specifier) {
super(location);
this.specifier = specifier;
try {
if(specifier.charAt(0) != '0')
value = Short.parseShort(specifier);
else if(specifier.length() > 2 && (specifier.charAt(1) == 'x' || specifier.charAt(1) == 'X'))
value = Short.parseShort(specifier, 16);
else
value = Short.parseShort(specifier, 8);
}
catch(NumberFormatException nfe) {
throw new LiteralExceedsRangeException(location, LiteralExceedsRangeException.Type.SHORT, specifier);
}
}
public String getSpecifier() {
return specifier;
}
public short getValue() {
return value;
}
public void createElements(CompilationContext cctx) {}
public void bindTypes(CompilationContext cctx) {}
}
|
c958614d-7695-47c0-8c53-97d2727b4076
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-03 08:03:30", "repo_name": "daydreamer1988/CommonApplication", "sub_path": "/app/src/main/java/common/com/activity/BaseActivity.java", "file_name": "BaseActivity.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "ae195232ca48a47291a2d8adc8392e2383da7d6b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/daydreamer1988/CommonApplication
| 246
|
FILENAME: BaseActivity.java
| 0.27513
|
package common.com.activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import common.com.MyApplication;
import common.com.custom.PgDialog;
import common.com.globle.Appconstants;
/**
* Created by Austin on 2016/10/28.
*/
public class BaseActivity extends AppCompatActivity implements Appconstants {
private PgDialog pgDialog;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
((MyApplication) getApplication()).addActity(this);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
@Override
protected void onStop() {
super.onStop();
MyApplication.getInstance().getRequestQueue().cancelAll(this.getClass().getSimpleName());
}
public void dismissDialog() {
if (pgDialog != null && pgDialog.isShowing()) {
pgDialog.dismiss();
}
}
public void showPgDialog(String text) {
if (pgDialog == null) {
pgDialog = new PgDialog(this, text, false);
}else{
pgDialog.myshow();
}
}
}
|
3bdce40e-3691-4a06-82cf-094ea0c10471
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-18 03:14:36", "repo_name": "xiaoaojianghu007/fastdex", "sub_path": "/sample/app/src/main/java/com/example/fertilizercrm/common/httpclient/expand/FilterInputStream.java", "file_name": "FilterInputStream.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "1e0b1a7bfa0d5a4f67c5a7b0e1e4379862d6b7ba", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/xiaoaojianghu007/fastdex
| 224
|
FILENAME: FilterInputStream.java
| 0.250913
|
package com.example.fertilizercrm.common.httpclient.expand;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* filter stream
* @author tong
*
*/
public class FilterInputStream extends InputStream {
protected volatile InputStream in; //将要被装饰的字节输入流
private OutputStream out;
protected FilterInputStream(InputStream in,OutputStream out) { //通过构造方法传入此被装饰的流
this.in = in;
this.out = out;
}
@Override
public int read() throws IOException {
int result = in.read();
out.write(result);
return result;
}
@Override
public void close() throws IOException {
in.close();
}
@Override
public int available() throws IOException {
return in.available();
}
@Override
public void mark(int readlimit) {
in.mark(readlimit);
}
@Override
public boolean markSupported() {
return in.markSupported();
}
@Override
public long skip(long byteCount) throws IOException {
return in.skip(byteCount);
}
}
|
210c089c-2286-4a26-b8ce-56f15f79895b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-09-22 07:37:05", "repo_name": "KingsleyYau/LiveClient", "sub_path": "/android/QNLiveShow_Anchor/liveshowApp/src/main/java/com/qpidnetwork/anchor/framework/services/KillNotificationsService.java", "file_name": "KillNotificationsService.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "2195bb19c2ad1bc1809fe05561fe06863b25148d", "star_events_count": 27, "fork_events_count": 14, "src_encoding": "UTF-8"}
|
https://github.com/KingsleyYau/LiveClient
| 208
|
FILENAME: KillNotificationsService.java
| 0.236516
|
package com.qpidnetwork.anchor.framework.services;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
/**
* APP被杀清除通知栏服务
*/
public class KillNotificationsService extends Service {
public class KillBinder extends Binder {
public final Service service;
public KillBinder(Service service) {
this.service = service;
}
}
private final IBinder mBinder = new KillBinder(this);
@Override
public IBinder onBind(Intent intent) {
return mBinder;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return Service.START_STICKY;
}
@Override
public void onCreate() {
}
@Override
public void onTaskRemoved(Intent rootIntent) {
NotificationManager notifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notifyManager.cancelAll();
}
}
|
ef93aef2-a48d-46a2-8157-2f783acd928a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-25 03:56:58", "repo_name": "Justis-Lamanna/fallapalooza-v3", "sub_path": "/src/main/java/de/fallapalooza/streamapi/annotation/processor/OffsetCellDefinitionWrapper.java", "file_name": "OffsetCellDefinitionWrapper.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "cd4049bdbbd1bc0779e8af96c6c8d3040f893bab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Justis-Lamanna/fallapalooza-v3
| 209
|
FILENAME: OffsetCellDefinitionWrapper.java
| 0.284576
|
package de.fallapalooza.streamapi.annotation.processor;
import com.google.api.services.sheets.v4.model.ValueRange;
import de.fallapalooza.streamapi.annotation.model.Point;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@RequiredArgsConstructor
@Getter
public class OffsetCellDefinitionWrapper<T> implements CellDefinition<T> {
private final CellDefinition<T> wrapped;
private final Point offset;
@Override
public CellDefinition<?> getDefinitionForField(String name) {
return new OffsetCellDefinitionWrapper<>(wrapped.getDefinitionForField(name), offset);
}
@Override
public Set<String> getFields() {
return wrapped.getFields();
}
@Override
public List<String> resolveCell(Point origin) {
return wrapped.resolveCell(origin.add(offset));
}
@Override
public T convertValue(Iterator<ValueRange> values) {
return wrapped.convertValue(values);
}
}
|
9f7d35fb-c08e-4da6-a806-9d5b88288e29
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-15 17:44:17", "repo_name": "Zap123/SimpleReport", "sub_path": "/src/com/zap123/DataSources/SQliteDatabase.java", "file_name": "SQliteDatabase.java", "file_ext": "java", "file_size_in_byte": 1019, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "85506bdde5df0a2eba97b1bf2e2611180fc5d57b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Zap123/SimpleReport
| 255
|
FILENAME: SQliteDatabase.java
| 0.278257
|
package com.zap123.DataSources;
import com.dieselpoint.norm.Database;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import java.sql.SQLException;
/**
* Created by luca on 13/11/15.
* Extends Norm.Database to support SQLite
*/
public class SQliteDatabase extends Database {
String path;
public SQliteDatabase(String path) {
super();
this.path = path;
}
@Override
protected DataSource getDataSource() throws SQLException {
HikariConfig config = new HikariConfig();
config.setPoolName("AuthMeSQLitePool");
config.setDriverClassName("org.sqlite.JDBC");
config.setJdbcUrl("jdbc:sqlite:" + path);
config.setConnectionTestQuery("SELECT 1");
config.setMaxLifetime(60000); // 60 Sec
config.setIdleTimeout(45000); // 45 Sec
config.setMaximumPoolSize(50); // 50 Connections (including idle connections)
return new HikariDataSource(config);
}
}
|
3dba8019-c82f-4c9a-af99-f5be9a71d526
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-30 16:26:09", "repo_name": "JulesSauvinet/simplyeventmanager", "sub_path": "/src/main/java/fr/univlyon1/sem/utils/json/JsonArray.java", "file_name": "JsonArray.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "453bf055b422fa5eeebcc26332959c46a9fcdb4d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/JulesSauvinet/simplyeventmanager
| 226
|
FILENAME: JsonArray.java
| 0.276691
|
package fr.univlyon1.sem.utils.json;
import java.util.ArrayList;
import java.util.List;
/**
* Created by jordan on 21/10/15.
*/
public class JsonArray extends JsonValue {
List<JsonValue> values;
JsonArray(Object values[]) {
this.values = new ArrayList<>(values.length);
for (Object value : values) {
add(value);
}
}
/**
* Ajoute un élément
* @param o
*/
public JsonArray add(Object o) {
if (o instanceof JsonValue) {
this.values.add((JsonValue) o);
} else {
this.values.add(new JsonPrimitive(o));
}
return this;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[");
boolean first = true;
for (JsonValue value : values) {
if (!first) builder.append(",");
first = false;
builder.append(value);
}
builder.append("]");
return builder.toString();
}
}
|
04c86430-1cd3-4661-8d13-4b67c7a7b1c9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-09-30T02:53:10", "repo_name": "gconnect/rentme-app", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1053, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "62cd55f2153ab4d919c798dd1eea1425f5d757a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gconnect/rentme-app
| 271
|
FILENAME: README.md
| 0.194368
|
# RentMe Cross-Platform Mobile Application
RentMe is a solution that will enable individuals/users to rent an item for a given fee as would be required by the item owner. Payment can either be paid through card transfers using Flutterwave or airtime using Reloadly depending on the accepted payment option of the owner of the item.
## App Showcase

## Current Stage
This is the MVP of the RentMe solution. The application is still under development. Currently the mobile app is a webview representation of the [RentMe web solution](https://adoring-allen-0032c2.netlify.app/)
## Testing and Installation
You can get the installable [apk here](https://github.com/gconnect/rentme-app/blob/master/app-debug.apk)
## Project/ Development Setup
- Install android studio
- Install flutter and dart plugin
- Clone the application to your local machine/ workspace
## TODOs
- Build the app following the design and using the provided APIs.
|
bc41533f-a5b0-4a4a-b304-9c57c068ac41
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-26 19:14:40", "repo_name": "marcalperapoch/concurrency-test", "sub_path": "/concurrency-test-extension/src/main/java/com/perapoch/concurrencytest/Tester.java", "file_name": "Tester.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "5f3266d6686fc8a3a974d251bebf1b57191b27b0", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/marcalperapoch/concurrency-test
| 197
|
FILENAME: Tester.java
| 0.285372
|
package com.perapoch.concurrencytest;
import java.util.concurrent.CountDownLatch;
import java.util.function.IntConsumer;
public class Tester implements Runnable {
private final IntConsumer action;
private final CountDownLatch startLatch;
private final CountDownLatch stopLatch;
private final int timesToCallAction;
Tester(final IntConsumer action,
final CountDownLatch startLatch,
final CountDownLatch stopLatch,
final int timesToCallAction) {
this.action = action;
this.startLatch = startLatch;
this.stopLatch = stopLatch;
this.timesToCallAction = timesToCallAction;
}
@Override
public void run() {
try {
startLatch.await();
for (int i = 0; i < timesToCallAction; ++i) {
action.accept(i);
}
stopLatch.countDown();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
|
47b070cd-a8f6-4d73-963f-c44d1de85a87
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-12 17:32:38", "repo_name": "codeaudit/traceprov", "sub_path": "/src/main/java/eu/trentorise/opendata/traceprov/TraceProvConfig.java", "file_name": "TraceProvConfig.java", "file_ext": "java", "file_size_in_byte": 401, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "18de0613505198bbd1329c03d8a1d45b64df8913", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/codeaudit/traceprov
| 229
|
FILENAME: TraceProvConfig.java
| 0.267408
|
/*
* Copyright 2015 Trento Rise (trentorise.eu)
*
* 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 eu.trentorise.opendata.traceprov;
import eu.trentorise.opendata.commons.OdtConfig;
/**
*
* @author David Leoni
*/
public final class TraceProvConfig extends OdtConfig {
private static final TraceProvConfig INSTANCE = new TraceProvConfig();
private TraceProvConfig(){
super();
}
public static TraceProvConfig of() {
return INSTANCE;
}
}
|
fcb8495d-0253-44e8-a9b9-8791352f028a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-19 17:37:33", "repo_name": "R4K0/TheIronGiant", "sub_path": "/Java/src/milosz/Employee.java", "file_name": "Employee.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "01122712e32a92b48e5a9f909e2dcbaa62fbe0da", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/R4K0/TheIronGiant
| 265
|
FILENAME: Employee.java
| 0.262842
|
package milosz;
public class Employee {
private String PPS;
private String FirstName;
private String SecondName;
private boolean Manager = false;
public Employee(String pPS, String firstName, String secondName) {
super();
PPS = pPS;
FirstName = firstName;
SecondName = secondName;
}
public Employee(String pPS, String firstName, String secondName, boolean manager) {
super();
PPS = pPS;
FirstName = firstName;
SecondName = secondName;
Manager = manager;
}
public String getPPS() {
return PPS;
}
public void setPPS(String pPS) {
PPS = pPS;
}
public String getFirstName() {
return FirstName;
}
public void setFirstName(String firstName) {
FirstName = firstName;
}
public String getSecondName() {
return SecondName;
}
public void setSecondName(String secondName) {
SecondName = secondName;
}
public boolean isManager() {
return Manager;
}
public void setManager(boolean manager) {
Manager = manager;
}
public void makeActive() {
IronGiant.setUser( this );
}
}
|
57bfe354-c048-4945-8f4d-7d4dac082812
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-19 01:59:58", "repo_name": "vinispasov/BeerTag", "sub_path": "/BeerTagAndroid/app/src/main/java/com/beertag/views/beerdetails/AddTagDialog.java", "file_name": "AddTagDialog.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "f4bdfa545f05d5981699be7d12217d2a67d1d784", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/vinispasov/BeerTag
| 191
|
FILENAME: AddTagDialog.java
| 0.23231
|
package com.beertag.views.beerdetails;
import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.beertag.R;
import butterknife.BindView;
import butterknife.ButterKnife;
public class AddTagDialog extends AlertDialog {
@BindView(R.id.et_new_beer_tag_for_add)
EditText mEnteredTag;
@BindView(R.id.btn_answer_add)
Button mPositiveDialogButton;
@BindView(R.id.btn_answer_cancel)
Button mNegativeDialogButton;
public AddTagDialog(Context context) {
super(context);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LayoutInflater inflater = LayoutInflater.from(this.getContext());
View dialogView = inflater.inflate(R.layout.beer_add_tag_dialog, null);
setContentView(dialogView);
ButterKnife.bind(this);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.