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
|
|---|---|---|---|---|---|---|
c78ab1ed-61f9-42b2-9410-d72f314e0145
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-26 08:40:28", "repo_name": "andreasdan/Ships-and-Sails", "sub_path": "/src/main/java/com/kea/shipsandsails/communication/SocketClient.java", "file_name": "SocketClient.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "73cde771a6e698d91f39a463fb4c0e10ed621717", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/andreasdan/Ships-and-Sails
| 230
|
FILENAME: SocketClient.java
| 0.246533
|
/**
* @Author Daniel Blom
* A Socket client for sending and requesting data
*/
package com.kea.shipsandsails.communication;
import java.io.*;
import java.net.Socket;
public class SocketClient implements ISocketClient {
private Socket socket;
private PrintWriter out;
private DataInputStream in;
protected Socket getSocket() { return this.socket; }
public SocketClient(Socket socket) {
this.socket = socket;
try {
out = new PrintWriter(socket.getOutputStream());
in = new DataInputStream(socket.getInputStream());
}
catch (IOException ioEx) {
System.out.println(ioEx.getMessage());
}
}
@Override
public synchronized String sendMessageAndWait(String message) {
String result = null;
out.println(message);
try {
result = in.readUTF();
}
catch (IOException ioEx) {
System.out.println(ioEx.getMessage());
}
return result;
}
@Override
public synchronized void sendMessage(String message) {
out.println(message);
}
@Override
public boolean isConnected() {
return socket.isConnected();
}
}
|
df620a6e-e51e-4190-8466-6ddb205e5b19
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-10-31 06:55:21", "repo_name": "dengjiaping/hn-apos", "sub_path": "/apos/ti-moible-framework/src/main/java/me/andpay/timobileframework/mvc/action/ActionTypeListener.java", "file_name": "ActionTypeListener.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "89e867aa54649025713c95deb9daf42ec11a7ebb", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/dengjiaping/hn-apos
| 221
|
FILENAME: ActionTypeListener.java
| 0.255344
|
package me.andpay.timobileframework.mvc.action;
import com.google.inject.TypeLiteral;
import com.google.inject.spi.InjectionListener;
import com.google.inject.spi.TypeEncounter;
import com.google.inject.spi.TypeListener;
/**
* 用来监听action的存在
*
* @author tinyliu
*
*/
public class ActionTypeListener implements TypeListener {
@SuppressWarnings({ "unchecked", "rawtypes" })
public <I> void hear(TypeLiteral<I> type, TypeEncounter<I> encounter) {
if (type.getRawType().isAnnotationPresent(ActionMapping.class)) {
encounter.register(new InjectionListener() {
public void afterInjection(Object injectee) {
ActionMapping mapping = injectee.getClass().getAnnotation(
ActionMapping.class);
if (mapping == null || mapping.domain() == null
|| mapping.domain().equals("")) {
throw new RuntimeException(
"the action mapping must be define");
}
ActionMappingHandler.registerMappings(mapping.domain(),
(Action) injectee);
}
});
}
}
}
|
88148ad3-7d94-4e1a-b22c-e1dc4b02f073
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-05-22 05:09:37", "repo_name": "youzi-td/edata", "sub_path": "/src/main/java/com/ruochu/edata/read/validator/impl/SelectionValidator.java", "file_name": "SelectionValidator.java", "file_ext": "java", "file_size_in_byte": 973, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "53c328fa951438577f9d7006cea12dd1290071b2", "star_events_count": 6, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/youzi-td/edata
| 222
|
FILENAME: SelectionValidator.java
| 0.262842
|
package com.ruochu.edata.read.validator.impl;
import com.ruochu.edata.constant.Constants;
import com.ruochu.edata.read.validator.IRuleValidator;
import com.ruochu.edata.xml.Rule;
import com.ruochu.edata.util.EmptyChecker;
import java.util.*;
/**
* 单选
*
* @author RanPengCheng
* @date 2019/7/14 18:06
*/
public class SelectionValidator implements IRuleValidator {
private final Map<String, Set<String>> selectionsMap = new HashMap<>();
@Override
public boolean validate(String value, Rule rule) {
if (EmptyChecker.isEmpty(value)){
return true;
}
String selectionsStr = rule.getValues();
Set<String> selectionSet = selectionsMap.get(selectionsStr);
if (null == selectionSet){
selectionSet = new HashSet<>(Arrays.asList(selectionsStr.split(Constants.SEPARATOR)));
selectionsMap.put(selectionsStr, selectionSet);
}
return selectionSet.contains(value);
}
}
|
454b0c26-736c-469e-8af9-ef41d5524c00
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-27 06:50:21", "repo_name": "nefulinda/springboot-2018", "sub_path": "/src/main/java/com/nefu/myspringboot/service/MachineService.java", "file_name": "MachineService.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "23f018217238f05736e1ef14dbc690d4fea77378", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nefulinda/springboot-2018
| 190
|
FILENAME: MachineService.java
| 0.242206
|
package com.nefu.myspringboot.service;
import com.nefu.myspringboot.entity.Machine;
import com.nefu.myspringboot.mapper.MachineMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional
@Slf4j
public class MachineService {
@Autowired
private MachineMapper machineMapper;
public Machine selectMachine(long id) {
return machineMapper.selectById(id);
}
public void updateMachine(Machine machine) {
machineMapper.updateById(machine);
}
public void addMachine(Machine machine) {
machineMapper.insert(machine);
}
public void deleteMachine(Machine machine) {
machineMapper.updateById(machine);
}
public List<Machine> machineList() {
return machineMapper.listMachine();
}
}
|
55e46ea1-5256-48be-b482-74586dc823aa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-27 09:07:03", "repo_name": "wugongzhiren/clocle-release1", "sub_path": "/app/src/main/java/com/bean/Clocle_help_coment.java", "file_name": "Clocle_help_coment.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "021593e63f7e6f25514807fd2a2c00fcb7ad537e", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wugongzhiren/clocle-release1
| 254
|
FILENAME: Clocle_help_coment.java
| 0.243642
|
package com.bean;
import com.clocle.huxiang.clocle.Bmob_UserBean;
/**
* Created by Administrator on 2016/9/19.
*/
public class Clocle_help_coment {
private String coment;//评论内容
private Bmob_UserBean commentUser;//评论者
private String clocle_help_id;
public Clocle_help_coment(String coment,Bmob_UserBean user,String clocle_help_id){
this.coment=coment;
this.commentUser=user;
this.clocle_help_id=clocle_help_id;
}
public String getClocle_help_id() {
return clocle_help_id;
}
public void setClocle_help_id(String clocle_help_id) {
this.clocle_help_id = clocle_help_id;
}
public String getComent() {
return coment;
}
public void setComent(String coment) {
this.coment = coment;
}
public Bmob_UserBean getCommentUser() {
return commentUser;
}
public void setCommentUser(Bmob_UserBean commentUser) {
this.commentUser = commentUser;
}
}
|
12d6c388-8d6b-4151-81b4-be29205dc16b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-08 06:26:34", "repo_name": "QianJinGuo/soul-apm", "sub_path": "/apm-collector/collector-agent-jetty/collector-agent-jetty-provider/src/main/java/com.furioussoulk.collector.agent.jetty/reader/KeyWithStringValueJsonReader.java", "file_name": "KeyWithStringValueJsonReader.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "72bcd983c40b2053bcae6e1c140f99b200885f95", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/QianJinGuo/soul-apm
| 182
|
FILENAME: KeyWithStringValueJsonReader.java
| 0.236516
|
package com.furioussoulk.collector.agent.jetty.reader;
import com.furioussoulk.network.proto.KeyWithStringValue;
import com.google.gson.stream.JsonReader;
import java.io.IOException;
public class KeyWithStringValueJsonReader implements StreamJsonReader<KeyWithStringValue> {
private static final String KEY = "k";
private static final String VALUE = "v";
@Override public KeyWithStringValue read(JsonReader reader) throws IOException {
KeyWithStringValue.Builder builder = KeyWithStringValue.newBuilder();
reader.beginObject();
while (reader.hasNext()) {
switch (reader.nextName()) {
case KEY:
builder.setKey(reader.nextString());
break;
case VALUE:
builder.setValue(reader.nextString());
break;
default:
reader.skipValue();
break;
}
}
reader.endObject();
return builder.build();
}
}
|
83b1ba56-95f7-4f4b-8d9b-65be85b8cd3b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-17 10:12:00", "repo_name": "gaomianyang/Graduation-project-back", "sub_path": "/src/main/java/com/example/sqltest/bean/ActIdGroupBean.java", "file_name": "ActIdGroupBean.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "7742f3962a305366f6a34c11046cc528bf8038c6", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/gaomianyang/Graduation-project-back
| 277
|
FILENAME: ActIdGroupBean.java
| 0.281406
|
package com.example.sqltest.bean;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* generated by Generate POJOs.groovy
* <p>Date: Tue Mar 12 11:22:34 GMT+08:00 2019.</p>
*
* @author T016
*/
@Entity
@Table ( name ="act_id_group" )
public class ActIdGroupBean implements Serializable {
@Id
@Column(name = "ID_" )
private String id;
@Column(name = "REV_" )
private Long rev;
@Column(name = "NAME_" )
private String groupName;
@Column(name = "TYPE_" )
private String type;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public Long getRev() {
return this.rev;
}
public void setRev(Long rev) {
this.rev = rev;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
}
|
b9619703-1bae-4218-abf2-9498bdc5b5b5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-21 09:09:21", "repo_name": "vikramvi/CrunchTests", "sub_path": "/src/main/java/steps/NotificationPopupSteps.java", "file_name": "NotificationPopupSteps.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "85d6c88bc2915fade63d10c683faa6f5bd5a5f70", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/vikramvi/CrunchTests
| 194
|
FILENAME: NotificationPopupSteps.java
| 0.259826
|
package steps;
import net.thucydides.core.annotations.Step;
import net.thucydides.core.steps.ScenarioSteps;
import pages.NotificationPopupPage;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
public class NotificationPopupSteps extends ScenarioSteps {
private NotificationPopupPage popupPage;
@Step("Should see Notification PopUp")
public NotificationPopupSteps shouldSeeNotificationPopup() {
popupPage.popupWindow.waitUntilVisible();
assertThat("Should see notification popup", popupPage.popupWindow.isCurrentlyVisible(), is (true));
return this;
}
@Step("Press Allow")
public NotificationPopupSteps pressAllow() {
popupPage.clickOnElement(popupPage.popupAllow);
return this;
}
@Step("Press Don`t Allow")
public NotificationPopupSteps pressDontAllow() {
popupPage.clickOnElement(popupPage.popupDeny);
return this;
}
}
|
08116c0d-fc21-41f8-a4db-dede06930b7b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-17 03:02:23", "repo_name": "JiaDingCN/vsftpdGUI", "sub_path": "/src/main/java/sample/Controller.java", "file_name": "Controller.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "c3871e8454764899a9b3f7e1afbf4cbf30fe1a80", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/JiaDingCN/vsftpdGUI
| 191
|
FILENAME: Controller.java
| 0.245085
|
package sample;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class Controller {
public String passwd = null;
@FXML
public Button okButton;
@FXML
public PasswordField passwordTextField;
@FXML
public Button submitButton;
@FXML
public Text tipText;
public void exit(MouseEvent mouseEvent) {
Stage stage = (Stage) okButton.getScene().getWindow();
stage.close();
}
public void submitClicked(MouseEvent mouseEvent) throws Exception {
passwd = passwordTextField.getText();
tipText.setVisible(true);
Stage stage = (Stage) submitButton.getScene().getWindow();
stage.close();
MainPanel mainPanel = new MainPanel(passwd);
mainPanel.start(new Stage());
}
}
|
c0d901e0-fe19-4c3c-90d4-edd39bdc805c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-11 01:36:50", "repo_name": "igormicael/uni7-reposicao", "sub_path": "/ejb/src/main/java/br/com/im/ComprasMDB.java", "file_name": "ComprasMDB.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "7188634567dc25c4503c8e6bc6b8f85b5907e4f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/igormicael/uni7-reposicao
| 235
|
FILENAME: ComprasMDB.java
| 0.240775
|
package br.com.im;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.EJB;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destinationLoookup", propertyValue = "jms/queue/pQueue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/queue/pQueue") })
public class ComprasMDB implements MessageListener {
@EJB
private Reposicao reposicao;
@Override
public void onMessage(Message message) {
if (message instanceof TextMessage) {
TextMessage tMsg = (TextMessage) message;
System.out.println("\nPedido Recebido:");
try {
String pedido = tMsg.getText();
reposicao.teste(pedido);
} catch (JMSException e) {
e.printStackTrace();
}
}
}
}
|
25e3e3be-6ae0-4cf9-ade5-e178ac764f86
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-03-03 08:37:05", "repo_name": "accessun/LargeSort", "sub_path": "/src/io/github/accessun/largesort/model/Record.java", "file_name": "Record.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "3a5180437e48ceec90555371cd66d9b5f438a32d", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/accessun/LargeSort
| 227
|
FILENAME: Record.java
| 0.267408
|
package io.github.accessun.largesort.model;
public class Record implements Comparable<Record> {
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Record() {
}
public Record(String name, int age) {
super();
this.name = name;
this.age = age;
}
@Override
public String toString() {
return name + "\t" + age;
}
@Override
public int compareTo(Record o) {
return this.name.compareTo(o.name);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + age;
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
}
|
f4fbea0f-7a5f-493e-b484-7b95070cf597
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-01 17:41:25", "repo_name": "olegbezk/ArchitectureAndDesignPrinciples", "sub_path": "/src/main/java/com/udemy/training/service/locator/Cache.java", "file_name": "Cache.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "ae50a561305ffd575fb7bb809c0b55c1e3be2952", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/olegbezk/ArchitectureAndDesignPrinciples
| 169
|
FILENAME: Cache.java
| 0.285372
|
package com.udemy.training.service.locator;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class Cache {
private List<Service> services;
public Cache() {
this.services = new ArrayList<>();
}
public Service getService(String jndi) {
return services.stream()
.filter(service -> jndi.equals(service.getName()))
.collect(Collectors.collectingAndThen(
Collectors.toList(),
list -> {
if (list.size() != 1) {
System.out.println(MessageFormat.format("Service {0} is not in cache.", jndi));
return null;
}
return list.get(0);
}
));
}
public void addService(Service service) {
services.add(service);
}
}
|
9a226deb-2a56-42dd-a0c8-e5aca50793ab
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-06 20:55:22", "repo_name": "luiss99/CasosAcad", "sub_path": "/CasosAcad-web/src/main/java/ManagedBean/TipoRequisitoMB.java", "file_name": "TipoRequisitoMB.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "ade8ee752404edd487883108a20bba39d0748efd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/luiss99/CasosAcad
| 224
|
FILENAME: TipoRequisitoMB.java
| 0.242206
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ManagedBean;
import Entidades.TipoRequisito;
import javax.inject.Named;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import SessionBeans.TipoRequisitoFacade;
import java.util.List;
import javax.ejb.EJB;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
*
* @author Kira Luis
*/
@Named(value = "tipoRequisitoMB")
@RequestScoped
@Path("tiporequisito")
public class TipoRequisitoMB {
@EJB
TipoRequisitoFacade tipoRequisitoFacade;
@GET
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public List<TipoRequisito> findAll() {
return tipoRequisitoFacade.findAll();
}
public TipoRequisitoMB() {
}
}
|
a767f848-148c-448e-8c0c-02899487325b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-12 12:08:35", "repo_name": "gs-vtiwari/serenity-web-todomvc-journey", "sub_path": "/src/main/java/net/serenitybdd/demos/todos/tasks/AddATodoItem.java", "file_name": "AddATodoItem.java", "file_ext": "java", "file_size_in_byte": 972, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "e79846da3d54a8df582b06e1728779174da22c97", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gs-vtiwari/serenity-web-todomvc-journey
| 231
|
FILENAME: AddATodoItem.java
| 0.290176
|
package net.serenitybdd.demos.todos.tasks;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Task;
import net.serenitybdd.screenplay.actions.Enter;
import net.thucydides.core.annotations.Step;
import static net.serenitybdd.demos.todos.user_interface.ToDoList.WHAT_NEEDS_TO_BE_DONE;
import static net.serenitybdd.screenplay.Tasks.instrumented;
import static org.openqa.selenium.Keys.RETURN;
public class AddATodoItem implements Task {
private final String thingToDo;
@Step("{0} adds a todo item called #thingToDo")
public <T extends Actor> void performAs(T theActor) {
theActor.attemptsTo(
Enter.theValue(thingToDo)
.into(WHAT_NEEDS_TO_BE_DONE)
.thenHit(RETURN)
);
}
public static AddATodoItem called(String thingToDo) {
return instrumented(AddATodoItem.class, thingToDo);
}
public AddATodoItem(String thingToDo) { this.thingToDo = thingToDo; }
}
|
8c292e43-c704-4087-bfb0-eb03beb0a673
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-30 23:45:18", "repo_name": "DimitrisGan/eBayDIT", "sub_path": "/src/main/java/com/ted/eBayDIT/ui/model/response/ErrorMessages.java", "file_name": "ErrorMessages.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "25c73381851c0aa2f7c75ba931f2739248e967fe", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/DimitrisGan/eBayDIT
| 195
|
FILENAME: ErrorMessages.java
| 0.214691
|
package com.ted.eBayDIT.ui.model.response;
// Source: http://appsdeveloperblog.com/exception-handling-restful-web-service/
public enum ErrorMessages {
MISSING_REQUIRED_FIELD("Missing required field! Please give all the required fields"),
RECORD_ALREADY_EXISTS("Record already exists!"),
NO_RECORD_FOUND("Record with provided id is not found"),
AUTHENTICATION_FAILED("Authentication failed!"),
COULD_NOT_UPDATE_RECORD("Could not update record!"),
COULD_NOT_DELETE_RECORD("Could not delete record!"),
INTERNAL_SERVER_ERROR("Internal server error!");
private String errorMessage;
ErrorMessages(String errorMessage) {
this.errorMessage = errorMessage;
}
/**
* @return the errorMessage
*/
public String getErrorMessage() {
return errorMessage;
}
/**
* @param errorMessage the errorMessage to set
*/
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
}
|
f7a46b19-e0be-4cec-b66e-06369a69a2fa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-24 19:31:53", "repo_name": "Gladislao/AndroidBasic", "sub_path": "/Lesson2/app/src/main/java/com/example/gcuzcano/lesson2/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f7c465b9c429b3d8b87c84844e9b154892149a99", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Gladislao/AndroidBasic
| 187
|
FILENAME: MainActivity.java
| 0.259826
|
package com.example.gcuzcano.lesson2;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
public class MainActivity extends AppCompatActivity {
private static final int maxValue = 10;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
LinearLayout layout = (LinearLayout) findViewById(R.id.main_activity);
View.OnClickListener onClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, BActivity.class);
startActivity(intent);
}
};
for (int i = 0; i < maxValue; i++) {
ImageView image = new ImageView(this);
image.setImageResource(R.drawable.ghost);
image.setOnClickListener(onClick);
layout.addView(image);
}
}
}
|
9b56b452-39a0-4dcf-acbe-0eccb98ddfde
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-10 06:12:42", "repo_name": "Anchorer/Lib_dayi", "sub_path": "/DayiLib/src/main/java/im/dayi/app/library/media/OnPlayListener.java", "file_name": "OnPlayListener.java", "file_ext": "java", "file_size_in_byte": 1124, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "3618ea0962b1211d3bf82f455f8d9656f7bac6f1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Anchorer/Lib_dayi
| 210
|
FILENAME: OnPlayListener.java
| 0.226784
|
package im.dayi.app.library.media;
import android.media.MediaPlayer;
/**
* 监听各种播放事件
*/
public abstract class OnPlayListener implements MediaPlayer.OnPreparedListener, MediaPlayer.OnCompletionListener, MediaPlayer.OnErrorListener {
@Override
abstract public void onPrepared(MediaPlayer mediaPlayer);
@Override
abstract public void onCompletion(MediaPlayer mp);
@Override
public boolean onError(MediaPlayer mediaPlayer, int what, int extra) {
String toastMsg = "";
switch (extra) {
case MediaPlayer.MEDIA_ERROR_IO:
toastMsg = "文件或网络出错";
break;
case MediaPlayer.MEDIA_ERROR_MALFORMED:
toastMsg = "无法解析音频流";
break;
case MediaPlayer.MEDIA_ERROR_UNSUPPORTED:
toastMsg = "不支持该音频流";
break;
case MediaPlayer.MEDIA_ERROR_TIMED_OUT:
toastMsg = "请求超时,请稍后再试";
break;
}
mediaPlayer.reset();
return true;
}
}
|
849dd445-120d-4cb1-8a53-dd99ee156883
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-05 13:40:09", "repo_name": "zhushenyang/liuyjy-parent", "sub_path": "/liuyjy-api/liuyjy-api-mybatis-plus/src/main/java/com/example/controller/DataInpuController.java", "file_name": "DataInpuController.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "3a00b735532cd7aca62faceffab362fe80c4d939", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zhushenyang/liuyjy-parent
| 228
|
FILENAME: DataInpuController.java
| 0.205615
|
package com.example.controller;
import com.example.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Auther: liuyjy
* @Date: 2018/12/24 21:08
* @Description: 切换库
*/
@Slf4j
@RestController
public class DataInpuController {
@Autowired
private TestService testService;
@RequestMapping("test")
public String test1() {
log.info("=========DB_MASTER========="+testService.getTest1());
log.info("=========DB_SLAVE1========="+testService.getTest2());
log.info("=========DB_MASTER========="+testService.getTest1());
log.info("=========DB_SLAVE1========="+testService.getTest2());
log.info("=========DB_MASTER========="+testService.getTest1());
log.info("=========DB_SLAVE1========="+testService.getTest2());
return "s";
}
}
|
5e72b163-8c89-4b7e-a8c8-5d2f5cba29a8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-18 03:07:30", "repo_name": "hanlizhihao/update-system", "sub_path": "/update-main/src/main/java/com/thinking/update/main/common/enums/AppRunningStateEnum.java", "file_name": "AppRunningStateEnum.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "98cbfa37d3da18380c521ab317fb86f4d19aad9a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hanlizhihao/update-system
| 233
|
FILENAME: AppRunningStateEnum.java
| 0.282196
|
package com.thinking.update.main.common.enums;
import com.thinking.update.main.common.exception.BDException;
/**
* @author Administrator
*/
public enum AppRunningStateEnum {
/**
* 终端运行状态0-正常,1-异常
*/
NORMAL(0, "正常"),
ABNORMAL(1, "异常");
private int value;
private String name;
AppRunningStateEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static String getNameByValue(int value) {
for (AppRunningStateEnum stateEnum: AppRunningStateEnum.values()) {
if (stateEnum.getValue() == value) {
return stateEnum.getName();
}
}
throw new BDException("没有与Value相匹配的终端运行状态枚举");
}
}
|
da7ee9dc-251f-445b-aca1-1b58cf1ece1a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-07-07 12:39:44", "repo_name": "singgel/RPC-SkillTree", "sub_path": "/grpc-api/src/main/java/com/hks/grpc/service/HelloRequestJava.java", "file_name": "HelloRequestJava.java", "file_ext": "java", "file_size_in_byte": 1004, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "2169f12b994dc6ac9407818b4f38ee0a94721b11", "star_events_count": 22, "fork_events_count": 7, "src_encoding": "UTF-8"}
|
https://github.com/singgel/RPC-SkillTree
| 220
|
FILENAME: HelloRequestJava.java
| 0.249447
|
package com.hks.grpc.service;
public class HelloRequestJava {
private String name;
private int age;
private double profit_rate;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public double getProfit_rate() {
return profit_rate;
}
public void setProfit_rate(double profit_rate) {
this.profit_rate = profit_rate;
}
public HelloRequestJava(String name, int age, double profit_rate) {
this.name = name;
this.age = age;
this.profit_rate = profit_rate;
}
public HelloRequestJava() {
}
@Override
public String toString() {
return "HelloRequestJava{" +
"name='" + name + '\'' +
", age=" + age +
", profit_rate=" + profit_rate +
'}';
}
}
|
2ab17b0b-6c54-44c5-976d-0c85ba791aa7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-27 03:36:24", "repo_name": "artisan323/MyCode", "sub_path": "/TestJUC/src/com/artisan/juc/TestAtomicReference.java", "file_name": "TestAtomicReference.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "2361555ed996843c469b0c462bc0c5965689ffd4", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/artisan323/MyCode
| 261
|
FILENAME: TestAtomicReference.java
| 0.279828
|
package com.artisan.juc;
import java.util.concurrent.atomic.AtomicReference;
class User{
private String name;
private int age;
public User() {
}
public User(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return "User{" +
"name='" + name + '\'' +
", age=" + age +
'}';
}
}
/**
* @author wannengqingnian
*/
public class TestAtomicReference {
public static void main(String[] args) {
User u1 = new User("lihzi", 45);
User u2 = new User("zhangweiwei", 45);
AtomicReference<User> atomicReference = new AtomicReference<User> ();
atomicReference.set(u1);
atomicReference.compareAndSet(u1, u2);
System.out.println(atomicReference.get().toString());
}
}
|
52724a70-0bdf-4352-9de1-53b449f40c10
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-15 07:44:19", "repo_name": "weizhongxin-cpu/tedu-springcloud-test", "sub_path": "/sp04-orderservice/src/main/java/cn/tedu/sp04/order/feign/ItemClientFB.java", "file_name": "ItemClientFB.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 38, "lang": "zh", "doc_type": "code", "blob_id": "15e36a6acc9f385ff08a74f0974d66880d23020a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/weizhongxin-cpu/tedu-springcloud-test
| 294
|
FILENAME: ItemClientFB.java
| 0.264358
|
package cn.tedu.sp04.order.feign;
import cn.tedu.sp01.pojo.Item;
import cn.tedu.web.util.JsonResult;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
/**
* Administrator
* 2020/12/30 - 18:42
*/
@Component
public class ItemClientFB implements ItemClient {
@Override
public JsonResult<List<Item>> getItems(String orderId) {
// 模拟有缓存数据
// 有缓存返回缓存数据
if (Math.random() < 0.5) {
ArrayList<Item> list = new ArrayList<>();
list.add(new Item(1, "缓存商品1", 4));
list.add(new Item(2, "缓存商品2", 1));
list.add(new Item(3, "缓存商品3", 5));
list.add(new Item(4, "缓存商品4", 3));
list.add(new Item(5, "缓存商品5", 8));
return JsonResult.ok().data(list);
}
// 没有缓存返回错误提示
return JsonResult.err().msg("获取订单商品列表失败!");
}
@Override
public JsonResult<?> decreaseNumber(List<Item> items) {
return JsonResult.err().msg("减少商品库存失败!");
}
}
|
3d1c266f-54e8-441f-984f-273cd08fcd34
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-01T03:24:06", "repo_name": "helpfulengineering/project-mechanical-volunteer", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1026, "line_count": 17, "lang": "en", "doc_type": "text", "blob_id": "aef68301d16a2ef752bc34fae858a3e66ed04cba", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/helpfulengineering/project-mechanical-volunteer
| 211
|
FILENAME: README.md
| 0.235108
|
# Mechanical Volunteer - Crowdsourcing for Helpful Engineering
The aim of this project is to provide a crowdsourcing platform for Helpful Engineering related projects to take advantage of our large volunteer community to perform tasks that are difficult to automate. Currently our platform is built on [Pybossa](https://pybossa.com)
## Project structure
The project contains the following file/folder structure:
* backend: Definition of the Pybossa instance along with any backend processes that are needed to support Pybossa including custom pybossa plugins [readme](backend/readme.md)
* projects: An area to store [Pybossa projects](https://docs.pybossa.com/build/intro/) that are created to capture crowdsourced feedback or data. [readme](projects/readme.md)
## Contributing
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Any contributions MUST be filled via a pull request.
|
11c2ee6f-aec7-4a05-b069-3dd0d5bd3de5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-08-04 15:40:48", "repo_name": "andyglick/javATE", "sub_path": "/guidate/guidate-zk/src/main/java/it/amattioli/guidate/converters/EnumConverter.java", "file_name": "EnumConverter.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ef4367486ccd2aefd886d60147e7d6f494c13f2d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/andyglick/javATE
| 232
|
FILENAME: EnumConverter.java
| 0.255344
|
package it.amattioli.guidate.converters;
import it.amattioli.dominate.Described;
import it.amattioli.dominate.LocalDescribed;
import org.zkoss.util.Locales;
import org.zkoss.util.resource.Labels;
import org.zkoss.zk.ui.Component;
import org.zkoss.zkplus.databind.TypeConverter;
public class EnumConverter implements TypeConverter {
public Object coerceToBean(Object val, Component comp) {
// Should not be used
throw new UnsupportedOperationException();
}
public Object coerceToUi(Object val, Component comp) {
if (val == null) {
return "";
} else {
if (val instanceof LocalDescribed) {
return ((LocalDescribed)val).getDescription(Locales.getCurrent());
}
if (val instanceof Described) {
return ((Described)val).getDescription();
}
String result = Labels.getLabel(val.getClass().getName()+"."+val.toString());
if (result == null || "".equals(result)) {
result = val.toString();
}
return result;
}
}
}
|
1b69f61e-15ae-4175-8bea-ef9885937ac1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2022-10-20T21:39:06", "repo_name": "adaptdk/usa-documentation", "sub_path": "/contributions/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1021, "line_count": 41, "lang": "en", "doc_type": "text", "blob_id": "f5b31d4f32007ef2548a4fe4015155fdb3a13ef9", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/adaptdk/usa-documentation
| 230
|
FILENAME: README.md
| 0.256832
|
# Why
Our work is supported by, and it is possible thanks to a lot of base software.
Most of that infrastructure software are different pieces of open source
software projects, which in most of the cases are not directly funded in any
way.
This may lead to problems in sustainability, that will later affect us directly.
# Where
Here a list of software that is crucial in the work we do:
- [Lando](https://github.com/lando/lando)
- Drupal
- Drupal Core
- Drupal contributed extensions
# How
Help on open source projects is welcomed in most ways.
Here some examples on how to do it:
- Add code change to advance the project.
- Help triaging issue queues for the project.
- Donate to the organization behind the project or their developers.
# What we are doing
- Drupal
- [Drupal Association Classic Supporting Partner](https://www.drupal.org/association/supporters/partners).
# What else can we do
## Tentative options
### Lando
Become a [github sponsor for lando](https://github.com/sponsors/lando).
|
602d5783-ca52-4a9f-9bc3-8e706821f3f4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-20 01:33:54", "repo_name": "Sachin-dua/sd100", "sub_path": "/CollectionsApps/src/com/tcs/PropertiesEx.java", "file_name": "PropertiesEx.java", "file_ext": "java", "file_size_in_byte": 992, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "80365d0e98ca590eb7274ada707d61fce3a739ef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Sachin-dua/sd100
| 208
|
FILENAME: PropertiesEx.java
| 0.295027
|
package com.tcs;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.SortedSet;
public class PropertiesEx
{
public static void main(String[] args) throws IOException
{
//load the properties file
FileInputStream inputStream = new FileInputStream("abc.properties");
Properties properties = new Properties();
properties.load(inputStream);
//read the data from properties files
System.out.println(properties.getProperty("id")); //657575
System.out.println(properties.getProperty("username")); //testuser
System.out.println(properties.getProperty("password")); //login
System.out.println(properties.getProperty("port")); //8080
}
}
class Sync
{
public static void main(String[] args)
{
List<String> list = Collections.synchronizedList(new ArrayList<String>());
}
}
|
bedabc14-370a-4cd3-9464-5a974966d670
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-15 00:21:13", "repo_name": "tcarlSwing/epics-skill-session", "sub_path": "/Treasure.java", "file_name": "Treasure.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "b223579168ad6e949b765fa95d9820b5beb86891", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tcarlSwing/epics-skill-session
| 232
|
FILENAME: Treasure.java
| 0.240775
|
import java.util.Scanner;
public class Treasure extends GameStage implements playable
{
public Treasure()
{
super("Hooray! You found the treasure!.");
hasEscaped = true;
}
public void run()
{
super.run();
while(!hasEscaped)
{
String userIn = sc.nextLine();
if (userIn.equals("E") || userIn.equals("W"))
{
//System.out.println("You walk along the river and haven't escaped yet. Try again. " + playable.inputPrompt);
}
else if (userIn.equals("N"))
{
System.out.println("That's the way you came from. Try again. " + playable.inputPrompt);
}
else if (userIn.equals("S"))
{
System.out.println("You find a log to cross over and escape from the river. Now onto the next stage.");
hasEscaped = true;
}
else
{
System.out.println("Invalid input. Try again. " + playable.inputPrompt);
}
}
sc.close();
}
}
|
48b373a1-5316-43d3-a74a-e6059e15962c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-04-23 22:10:26", "repo_name": "bgreeneaka/ds-systems", "sub_path": "/src/java/session/comment/CommentFacade.java", "file_name": "CommentFacade.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "f1d0324da44937cf67a6498c5d1969f0febfe3c1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bgreeneaka/ds-systems
| 222
|
FILENAME: CommentFacade.java
| 0.29584
|
/**
* Brian Greene - 11042141 Eoghan Griffin - 10091157 Bartosz Kaminiecki -
* 11060204
*/
package session.comment;
import entity.Comment;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import session.AbstractFacade;
/**
*
* @author chromodynamics
*/
@Stateless
public class CommentFacade extends AbstractFacade<Comment> implements CommentFacadeLocal {
@PersistenceContext(unitName = "ShopWebApplicationPU")
private EntityManager em;
public CommentFacade() {
super(Comment.class);
}
@Override
protected EntityManager getEntityManager() {
return em;
}
@Override
public void addComment(Comment comment) {
em.persist(comment);
}
@Override
public List<Comment> getCommentsByProductId(int productId) {
return em.createNamedQuery("Comment.findByProductId").setParameter("productId", productId).getResultList();
}
}
|
4451c42f-b30c-498b-80f6-28591b99d4ea
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-04 12:42:06", "repo_name": "chnyQAQ/app-worker", "sub_path": "/src/main/java/com/dah/cem/app/sc/worker/workers/netty/ConnectionListener.java", "file_name": "ConnectionListener.java", "file_ext": "java", "file_size_in_byte": 1033, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "cdcd6d7edc01b48905ab527a6352a421bf8350d9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/chnyQAQ/app-worker
| 195
|
FILENAME: ConnectionListener.java
| 0.239349
|
package com.dah.cem.app.sc.worker.workers.netty;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.EventLoop;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.TimeUnit;
@Slf4j
public class ConnectionListener implements ChannelFutureListener {
private NettyClient client;
public ConnectionListener(NettyClient client) {
this.client = client;
}
@Override
public void operationComplete(ChannelFuture channelFuture) throws Exception {
if (!channelFuture.isSuccess()) {
log.warn("连接失败,即将重新尝试连接");
final EventLoop loop = channelFuture.channel().eventLoop();
loop.schedule(new Runnable() {
public void run() {
client.createBootstrap(new Bootstrap(), loop);
}
}, 1, TimeUnit.MILLISECONDS);
} else {
log.info("连接成功");
}
}
}
|
2560b9aa-7d51-4537-b4db-19dbd5262fd3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-23 02:59:05", "repo_name": "wrdx2/springbootdirdemo", "sub_path": "/src/main/java/com/wrdao/springboot/sys/vo/SysRolePermissionVo.java", "file_name": "SysRolePermissionVo.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "9614dcf689349e1d5afb22f346bfe2ab1f2df216", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wrdx2/springbootdirdemo
| 225
|
FILENAME: SysRolePermissionVo.java
| 0.212069
|
package com.wrdao.springboot.sys.vo;
import com.wrdao.springboot.common.vo.BaseVo;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "Sys_role_permission_tr")
public class SysRolePermissionVo extends BaseVo {
@Id
@Column(columnDefinition ="char(32)")
private String srptId;
@Column(columnDefinition ="char(32)")
private String roleId;
@Column(columnDefinition ="char(32)")
private String permissionId;
public String getSrptId() {
return srptId;
}
public void setSrptId(String srptId) {
this.srptId = srptId;
}
public String getRoleId() {
return roleId;
}
public void setRoleId(String roleId) {
this.roleId = roleId;
}
public String getPermissionId() {
return permissionId;
}
public void setPermissionId(String permissionId) {
this.permissionId = permissionId;
}
}
|
e2e882f3-e48a-42ec-8ed2-76b3c1aca661
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-30 14:18:42", "repo_name": "ikernits/iklib", "sub_path": "/iklib-common/src/test/java/org/ikernits/lib/common/io/daemon/IoStreamSourceReadFailedImpl.java", "file_name": "IoStreamSourceReadFailedImpl.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "fde732ee0697bef481359626dbbbdd8e570cee4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ikernits/iklib
| 197
|
FILENAME: IoStreamSourceReadFailedImpl.java
| 0.23092
|
package org.ikernits.lib.common.io.daemon;
import org.ikernits.lib.common.io.IoStreamSource;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
public class IoStreamSourceReadFailedImpl implements IoStreamSource {
PipedInputStream pipedInputStream = new PipedInputStream();
PipedOutputStream pipedOutputStream = new PipedOutputStream();
@Override
public InputStream getInputStream() {
return new InputStream() {
@Override
public int read() throws IOException {
throw new IOException("Read failed");
}
};
}
@Override
public OutputStream getOutputStream() {
return pipedOutputStream;
}
public IoStreamSourceReadFailedImpl() {
try {
pipedInputStream.connect(pipedOutputStream);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
|
5364ff2c-e9d4-4d1f-a6e2-cb4e104096b6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-11 14:20:22", "repo_name": "whtome/project.code", "sub_path": "/java-chat-room/client/src/MultiClient/WriteToServerThread.java", "file_name": "WriteToServerThread.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "02892dca52558db13751f2e9b6ab7aa29c5d4090", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/whtome/project.code
| 178
|
FILENAME: WriteToServerThread.java
| 0.273574
|
package MultiClient;
import java.io.IOException;
import java.io.PrintStream;
import java.net.Socket;
import java.util.Scanner;
public class WriteToServerThread extends Thread {
private final Socket client;
public WriteToServerThread(Socket client) {
this.client = client;
}
@Override
public void run() {
try {
Scanner scanner = new Scanner(System.in);
PrintStream printStream = new PrintStream(this.client.getOutputStream());
while(true) {
System.out.print("请输入> ");
String message = scanner.nextLine();
printStream.println(message);
if (message.equals("quit")) {
break;
}
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
this.client.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
|
2241ad95-33e6-4fdf-8d34-0d57e011fb7b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-06-19T11:47:08", "repo_name": "bmurr/appengine-devserver-patches", "sub_path": "/file_watcher_patch/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 987, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "76f23d46ffeab7e2ab6ee04d8afa12ad4bf1490e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bmurr/appengine-devserver-patches
| 245
|
FILENAME: README.md
| 0.235108
|
Uses watchdog (https://github.com/gorakhargosh/watchdog) to watch for file system events.
The default mtime_file_watcher was very resource intensive, causing my Macbook's fan to spin like a jet engine even when it should be idle.
Watchdog uses the native MacOS FSEvents to detect file changes, which is more efficient.
Related articles:
- https://medium.com/lumapps-engineering/appengine-on-macos-is-a-cpu-hog-heres-how-to-solve-this-problem-with-another-python-native-9f2a6dc5c960
### To use
- Apply the patch file_watcher.patch to `APPENGINE_ROOT/google/appengine/tools/devappserver2/file_watcher.py`
The command will look like `patch "$(gcloud info --format="value(installation.sdk_root)")/platform/google_appengine/google/appengine/tools/devappserver2/file_watcher.py" < file_watcher.patch`.
- Place watchdog_file_watcher.py in `APPENGINE_ROOT/google/appengine/tools/devappserver2/`
### Caveats:
- Little to no testing done.
- Changes in symlinked files are not tracked?
|
c3aea218-a25b-4e35-a389-2bc5932b43a1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-24 05:04:03", "repo_name": "kasunsk/grpc-spring-boot-starter", "sub_path": "/grpc-spring-boot-starter-demo/src/main/java/org/lognet/springboot/grpc/demo/InvoiceService.java", "file_name": "InvoiceService.java", "file_ext": "java", "file_size_in_byte": 968, "line_count": 24, "lang": "en", "doc_type": "code", "blob_id": "a3591e949dfce1040df653b90cdbba21d14a33df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kasunsk/grpc-spring-boot-starter
| 195
|
FILENAME: InvoiceService.java
| 0.233706
|
package org.lognet.springboot.grpc.demo;
import io.grpc.examples.InvoiceGrpc;
import io.grpc.examples.InvoiceOuterClass;
import io.grpc.stub.StreamObserver;
import org.lognet.springboot.grpc.GRpcService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@GRpcService(interceptors = LogInterceptor.class)
public class InvoiceService extends InvoiceGrpc.InvoiceImplBase {
private Logger log = LoggerFactory.getLogger(GreeterService.class);
@Override
public void issueInvoice(InvoiceOuterClass.InvoiceRequest request, StreamObserver<InvoiceOuterClass.InvoiceResponse> responseObserver) {
String message = "Saved " + request.getInvoiceid();
final InvoiceOuterClass.InvoiceResponse.Builder invoiceBuilder = InvoiceOuterClass.InvoiceResponse.newBuilder().setInvoicename("Test invoice");
responseObserver.onNext(invoiceBuilder.build());
responseObserver.onCompleted();
log.info("Returning " + message);
}
}
|
5c90a3fd-305f-4e47-990b-9fec6a28f334
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-23 01:31:57", "repo_name": "hack-feng/maple", "sub_path": "/src/main/java/com/maple/demo/controller/CrawlerController.java", "file_name": "CrawlerController.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "54085753c530f189e2ae880a49ea13c085aea9f1", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hack-feng/maple
| 268
|
FILENAME: CrawlerController.java
| 0.247987
|
package com.maple.demo.controller;
import com.maple.demo.bean.MapleCrawler;
import com.maple.demo.utils.CSDNCrawlerUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* CSDN爬虫工具
* @author Feng
*
*/
@RestController
@RequestMapping("/crawler")
public class CrawlerController {
/**
* 获取我的博客的列表
* @param about
* @param num
* @param readNum
* @return
*/
@PostMapping(value = "/start")
public List<MapleCrawler> start(String about, Integer num, Integer readNum) {
List<MapleCrawler> result = new ArrayList<>();
result = CSDNCrawlerUtils.csdn_crawler("123", 1, 1);
return result;
}
@PostMapping(value = "/getCsdnByAbout")
public List<MapleCrawler> getCsdnByAbout(String about, Integer num, Integer readNum){
List<MapleCrawler> result = new ArrayList<>();
result = CSDNCrawlerUtils.csdn_about(about, num, readNum);
return result;
}
}
|
e6feb6fd-5ebc-4f92-bfb7-891bf92b3c53
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-09T20:01:50", "repo_name": "seung-hyun0/searchScore", "sub_path": "/src/com/java/self/command/upDateInfoOk.java", "file_name": "upDateInfoOk.java", "file_ext": "java", "file_size_in_byte": 1248, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "49b02a36b8de08f19c35eba76950c4daefa2876b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/seung-hyun0/searchScore
| 260
|
FILENAME: upDateInfoOk.java
| 0.286968
|
package com.java.self.command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.java.command.CommandAction;
import com.java.member.dao.MemberDao;
import com.java.member.dto.MemberDto;
public class upDateInfoOk implements CommandAction{
@Override
public String proRequest(HttpServletRequest request, HttpServletResponse response) throws Throwable {
request.setCharacterEncoding("utf-8");
MemberDto memberDto = new MemberDto();
memberDto.setNum(Integer.parseInt(request.getParameter("num")));
memberDto.setId(request.getParameter("id"));
memberDto.setPwd(request.getParameter("pwd"));
memberDto.setName(request.getParameter("name"));
memberDto.setStu_number(request.getParameter("stu_number"));
memberDto.setZipcode(request.getParameter("zipcode"));
memberDto.setAddress(request.getParameter("address"));
memberDto.setJob(request.getParameter("job"));
logger.info(logMsg +"수정된 정보: " + memberDto.toString());
int check = MemberDao.getInstance().updateOk(memberDto);
logger.info(logMsg +"제대로 수정이 되었으면 1, 아니면 0 :"+ check);
request.setAttribute("check", check);
return "/WEB-INF/view/member/updateOk.jsp";
}
}
|
18d2e342-d49f-4ec3-9489-875dcfd48e0a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-27 13:40:14", "repo_name": "OmegaStudios/OmegaMinestom", "sub_path": "/src/main/java/net/minestom/server/network/packet/server/multiversion/v1_17/impl/V1_17TabCompletePacket.java", "file_name": "V1_17TabCompletePacket.java", "file_ext": "java", "file_size_in_byte": 1224, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "1b9368f10650823ca27ffcf1ac258441dafe55ba", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/OmegaStudios/OmegaMinestom
| 259
|
FILENAME: V1_17TabCompletePacket.java
| 0.272799
|
package net.minestom.server.network.packet.server.multiversion.v1_17.impl;
import net.minestom.server.network.packet.server.ServerPacket;
import net.minestom.server.network.packet.server.multiversion.VersionedPacket;
import net.minestom.server.network.packet.server.multiversion.v1_17.V1_17ServerPacketIdentifier;
import net.minestom.server.network.packet.server.play.TabCompletePacket;
import net.minestom.server.utils.binary.BinaryWriter;
public class V1_17TabCompletePacket implements VersionedPacket {
@Override
public void writePacket(BinaryWriter writer, ServerPacket packet) {
TabCompletePacket packet_ = (TabCompletePacket) packet;
writer.writeVarInt(packet_.transactionId);
writer.writeVarInt(packet_.start);
writer.writeVarInt(packet_.length);
writer.writeVarInt(packet_.matches.length);
for (TabCompletePacket.Match match : packet_.matches) {
writer.writeSizedString(match.match);
writer.writeBoolean(match.hasTooltip);
if (match.hasTooltip)
writer.writeComponent(match.tooltip);
}
}
@Override
public int getId() {
return V1_17ServerPacketIdentifier.TAB_COMPLETE;
}
}
|
9a1c6d2e-60e2-4b9e-9021-5b5fd7c0fcce
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-06-21 08:35:32", "repo_name": "LA-/castlewood-server-alpha-1.1", "sub_path": "/src/com/castlewood/actor/services/network/message/out/OpenChatboxWindowMessage.java", "file_name": "OpenChatboxWindowMessage.java", "file_ext": "java", "file_size_in_byte": 971, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "40727a4deb29037399b59d78a24c8858577c095b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/LA-/castlewood-server-alpha-1.1
| 235
|
FILENAME: OpenChatboxWindowMessage.java
| 0.290981
|
package com.castlewood.actor.services.network.message.out;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import com.castlewood.actor.services.network.message.NetworkMessage;
/**
* This shows a window over the chatbox area.
*
* @author William Nguyen <L__A> <larevxpk@gmail.com>
*
*/
public class OpenChatboxWindowMessage extends NetworkMessage
{
/**
* The window id to open.
*/
private final int window;
/**
* A {@link OpenChatboxWindowMessage} displays an interface over the chatbox
* area.
*
* @param window
* The interface id.
*/
public OpenChatboxWindowMessage(final int window)
{
this.window = window;
}
@Override
public ByteBuf encode()
{
return Unpooled.buffer(3).writeByte(164).writeShort(this.window);
}
@Override
public void decode(final ByteBuf buffer)
{
throw new UnsupportedOperationException(this.getClass()
.getCanonicalName() + " is an outbound network message.");
}
}
|
f0b8a20e-7f05-4a5b-8506-8529aed3db0e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-01-24 00:10:17", "repo_name": "tterrag1098/ModTweaker2", "sub_path": "/src/main/java/modtweaker/commands/EntityMappingLogger.java", "file_name": "EntityMappingLogger.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "dd12808c1a281fa8c27b58c36c6a47058455a2c8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tterrag1098/ModTweaker2
| 226
|
FILENAME: EntityMappingLogger.java
| 0.247987
|
package modtweaker.commands;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import net.minecraft.entity.EntityList;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.LexiconCategory;
import minetweaker.MineTweakerAPI;
import minetweaker.MineTweakerImplementationAPI;
import minetweaker.api.player.IPlayer;
import minetweaker.api.server.ICommandFunction;
public class EntityMappingLogger implements ICommandFunction{
@Override
public void execute(String[] arguments, IPlayer player) {
Set<String> keys=EntityList.stringToClassMapping.keySet();
System.out.println("Mob Keys: " + keys.size());
for (String key : keys) {
System.out.println("Mob Key " + key);
MineTweakerAPI.logCommand(key);
}
if (player != null) {
player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir"));
}
}
}
|
ce5e9e8b-29f6-4c01-b32f-797bc436c570
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-10-13T02:48:11", "repo_name": "Omac092627/Omac092627.github.io", "sub_path": "/301/threeohone.md", "file_name": "threeohone.md", "file_ext": "md", "file_size_in_byte": 1032, "line_count": 61, "lang": "en", "doc_type": "text", "blob_id": "71578d0c473718e5ba8fe1b7344d35c31cc7990b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Omac092627/Omac092627.github.io
| 377
|
FILENAME: threeohone.md
| 0.220007
|
# CODE 301 READING NOTES
**TABLE OF CONTENTS:**
**HOME**
[Home](../index.md)
**CLASS 201 READING NOTES**
[201 notes](../201/twoohone.html)
**CLASS 401 READING NOTES**
[401 notes](../401/fourohone.html)
**CLASS 401 Javascript READING NOTES**
[401JS notes](../401JS/fourohoneJS.html)
**301 NOTES**
[Base, Layout, Modules, Theme](../301/class-01.md)
[Intro to JQUERY](../301/class-02.md)
[Flexbox and Templating](../301/class-03.md)
[CSS-Grid](../301/class-04.md)
[Deployed Heroku(followed-prompt)](../301/class-05.md)
[NodeJs:explained](../301/class-06.md)
[Web Services & API's](../301/class-07.md)
[SQL/Structured-Query-Language](../301/class-08.md)
[Refactoring-Functional-Programming](../301/class-09.md)
[Call Stack](../301/class-10.md)
[Ejs Templating](../301/class-11.md)
[Ejs Partials](../301/class-12.md)
[CRUD: CREATE READ UPDATE DELETE / REST: POST GET PUT/PATCH DELETE](../301/class-13.md)
[Database Nomalization](../301/class-14.md)
[Gender Bias in Silicon Valley](../301/class-15.md)
|
d15c2f33-a110-4ef6-a9e0-410f46fb35be
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-27 06:53:32", "repo_name": "ecjante/TwitchGames", "sub_path": "/app/src/main/java/com/enrico/twitchgames/topgames/TopGamesUiManager.java", "file_name": "TopGamesUiManager.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "40d179a2c342c7f882dca9949f8c36c8d5477bd9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ecjante/TwitchGames
| 219
|
FILENAME: TopGamesUiManager.java
| 0.239349
|
package com.enrico.twitchgames.topgames;
import android.support.v7.widget.Toolbar;
import android.view.View;
import com.enrico.twitchgames.R;
import com.enrico.twitchgames.di.ScreenScope;
import com.enrico.twitchgames.lifecycle.ScreenLifecycleTask;
import com.enrico.twitchgames.util.ButterknifeUtils;
import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* Created by enrico.
*
* UiManager for the Twitch top games view. Binds the views with ButterKnife and set the toolbar title
*/
@ScreenScope
public class TopGamesUiManager extends ScreenLifecycleTask {
@BindView(R.id.toolbar) Toolbar toolbar;
private Unbinder unbinder;
@Inject
TopGamesUiManager() {
}
@Override
public void onEnterScope(View view) {
unbinder = ButterKnife.bind(this, view);
toolbar.setTitle(R.string.screen_title_top_games);
}
@Override
public void onExitScope() {
ButterknifeUtils.unbind(unbinder);
}
}
|
e9ebd9ff-4c66-4423-bd76-e0995c69f0e6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-16 08:58:16", "repo_name": "lxb89/DailyStudyDemos", "sub_path": "/app/src/main/java/angqin/myapplication/enum_study/base/BaseFragment.java", "file_name": "BaseFragment.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "2b9738c8e37c802bf3704d1249693bea0137259f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lxb89/DailyStudyDemos
| 234
|
FILENAME: BaseFragment.java
| 0.268941
|
package angqin.myapplication.enum_study.base;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import angqin.myapplication.enum_study.EnumInstanceActivity;
/**
* Created by ${lixuebin} on 2018/7/11.
* 邮箱:2072301410@qq.com
* TIP:
*/
public abstract class BaseFragment extends Fragment {
private EnumInstanceActivity enumInstanceActivity;
private View view;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
enumInstanceActivity = (EnumInstanceActivity) getActivity();
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
view = initView(inflater, container);
findView(view);
initData();
return view;
}
protected abstract void initData();
protected abstract void findView(View view);
public abstract View initView(LayoutInflater inflater, ViewGroup container);
}
|
eda32312-a0aa-4837-bdb3-20519cf7aa46
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-01 17:07:40", "repo_name": "hoangnguyen96/test-booking", "sub_path": "/src/main/java/com/spring/booking/more/FileUploader.java", "file_name": "FileUploader.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "d81f92eee3304372aa1b5fdc2bc269745aed2fa8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hoangnguyen96/test-booking
| 197
|
FILENAME: FileUploader.java
| 0.272799
|
package com.spring.booking.more;
import org.springframework.web.multipart.MultipartFile;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
public class FileUploader {
public static String uploadFile(MultipartFile file, String path){
try {
byte[] bytes = file.getBytes();
// Creating the directory to store file
// Assume uploaded file location on web server is D:\file-upload
String pathName = path;
File dir = new File(pathName);
if (!dir.exists()) {
dir.mkdirs();
}
// Create the file on server
String fileSource = dir.getAbsolutePath() + File.separator + file.getOriginalFilename();
File serverFile = new File(fileSource);
BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(serverFile));
stream.write(bytes);
stream.close();
return file.getOriginalFilename();
} catch (Exception e) {
return "Error when uploading file";
}
}
}
|
5ed80b5f-94fa-4c8f-8a0a-496bb80e8de8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-12-12T21:27:53", "repo_name": "tamtr89/Amazon-like-storefront", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1240, "line_count": 61, "lang": "en", "doc_type": "text", "blob_id": "e21d4016dba4f83267faf7c735fe492622f49994", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tamtr89/Amazon-like-storefront
| 358
|
FILENAME: README.md
| 0.285372
|
# Amazon-like-storefront
<h3>Overview</h3>
Amazon-like storefront with the MySQL skills you learned this unit. The app will take in orders from customers and deplete stock from the store's inventory.
<br>
<br>
<hr>
### Demo:
<h1>Manager View</h1>
<img src="images/managerview.PNG" width="680px">
***Click for
[![Manager View]](https://youtu.be/foAwiWnfRnQ)
<hr>
<h1>Customer View</h1>
***Click for
[![Customer View]](https://youtu.be/jscFTkR7lCU)
<h3>Customer Purchase</h3>
<p>The first should ask them the ID of the product they would like to buy.
<p>The second message should ask how many units of the product they would like to buy
<img src="images/customerView.PNG" width="680px">
<br>
<h5>Insufficient quantity</h5>
<img src="images/notenoughstock.PNG" width="680px">
<hr>
<h3>Build with:</h3>
<ul>
<li>Javascript
<li>Node.js (https://nodejs.org/en) - Framework used
<li>MySQL WorkBench (https://www.mysql.com/products/workbench/)
<li>JSON (http://www.json.org) - Data format used
* [mySQL](https://www.npmjs.com/package/mysql)
* [Inquirer](https://www.npmjs.com/package/inquirer)
* [Table](https://www.npmjs.com/package/cli-table)
* [Chalk](https://www.npmjs.com/package/chalk)
|
6bee001b-76ee-4014-8c30-9adcaaa2506f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-16 06:41:17", "repo_name": "EvgeniyBulovackiy/MyAccessDB", "sub_path": "/src/main/java/models/SignalKinds.java", "file_name": "SignalKinds.java", "file_ext": "java", "file_size_in_byte": 1244, "line_count": 68, "lang": "en", "doc_type": "code", "blob_id": "9790db476eec08849e52fb202814f2a45763d9ba", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/EvgeniyBulovackiy/MyAccessDB
| 300
|
FILENAME: SignalKinds.java
| 0.290176
|
package models;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Objects;
@Entity
@Table(name = "[Виды сигналов]")
public class SignalKinds {
@Id
@Column(name="Счетчик")
private String count;
@Column(name="Вид")
private String kind;
@Column(name="Примечание")
private String note;
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
public String getKind() {
return kind;
}
public void setKind(String kind) {
this.kind = kind;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
@Override
public String toString() {
return kind;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SignalKinds that = (SignalKinds) o;
return Objects.equals(count, that.count) &&
Objects.equals(kind, that.kind) &&
Objects.equals(note, that.note);
}
@Override
public int hashCode() {
return Objects.hash(count, kind, note);
}
}
|
ba935e05-437b-4b64-b47b-00544161ad37
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-24 02:52:21", "repo_name": "lishunyi123/books", "sub_path": "/src/main/java/com/lishunyi/books/controller/BookCategoryController.java", "file_name": "BookCategoryController.java", "file_ext": "java", "file_size_in_byte": 1134, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "86342e8fd6da4f2a9c2de6eed12f153522434043", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lishunyi123/books
| 243
|
FILENAME: BookCategoryController.java
| 0.242206
|
package com.lishunyi.books.controller;
import cn.hutool.core.bean.BeanUtil;
import com.lishunyi.base.http.Response;
import com.lishunyi.books.dto.BookCategoryDTO;
import com.lishunyi.books.entity.BookCategory;
import com.lishunyi.books.service.BookCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author 李顺仪
* @version 1.0
* @since 2021/3/15 16:31
**/
@RestController
@RequestMapping("/v1/book-category")
public class BookCategoryController {
@Autowired
private BookCategoryService bookCategoryService;
@GetMapping("/{channel}")
public Response<List<BookCategory>> findBookCategoryListByChannel(@PathVariable(value = "channel") Boolean channel) {
return Response.success(bookCategoryService.findBookCategoryListByChannel(channel));
}
@PostMapping("/")
public Boolean create(@RequestBody BookCategoryDTO dto) {
BookCategory bookCategory = BeanUtil.copyProperties(dto, BookCategory.class);
return bookCategoryService.saveBookCategory(bookCategory);
}
}
|
55c3c8ab-3e8a-4812-942c-fa9f6249413f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-25 16:40:58", "repo_name": "nn12011999/To_Do", "sub_path": "/local2.0/src/main/java/com/example/demo/WebController.java", "file_name": "WebController.java", "file_ext": "java", "file_size_in_byte": 1224, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "9941c1fd54d729f1561dc8c7cf30399f8847e7c5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nn12011999/To_Do
| 259
|
FILENAME: WebController.java
| 0.267408
|
package com.example.demo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@Controller
public class WebController {
List<Todo> todoList = new CopyOnWriteArrayList<>();
@GetMapping("/listTodo")
public String index(Model model, @RequestParam(value = "limit", required = false) Integer limit) {
model.addAttribute("todoList", limit != null ? todoList.subList(0, limit) : todoList);
return "listTodo";
}
@GetMapping("/addTodo")
public String addTodo(Model model) {
model.addAttribute("todo", new Todo());
return "addTodo";
}
@PostMapping("/addTodo")
public String addTodo(@ModelAttribute Todo todo) {
todo = new Todo(todo.getTitle(),todo.getDetail());
todoList.add(todo);
return "success";
}
@DeleteMapping("/addTodo")
public String Delete(@RequestParam(value = "id") String id)
{
todoList.removeIf( temp -> id.equals("id"));
return "success";
}
@GetMapping("/")
public String index()
{
return "index";
}
}
|
5c59584c-916f-405c-a335-3781ec33a7c9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-16T22:44:05", "repo_name": "cloudflare/cloudflare-docs", "sub_path": "/content/stream/examples/android.md", "file_name": "android.md", "file_ext": "md", "file_size_in_byte": 1098, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "c01cc64077ee648bccaea128ba6203b14e912669", "star_events_count": 2276, "fork_events_count": 2810, "src_encoding": "UTF-8"}
|
https://github.com/cloudflare/cloudflare-docs
| 286
|
FILENAME: android.md
| 0.216012
|
---
type: example
summary: Example of video playback on Android using ExoPlayer
tags:
- Playback
pcx_content_type: configuration
title: Android (ExoPlayer)
weight: 3
layout: example
meta:
description: View an example of video playback on Android using ExoPlayer.
---
{{<render file="_prereqs.md">}}
{{<render file="_android_playback_code_snippet.md">}}
### Download and run an example app
1. Download [this example app](https://github.com/googlecodelabs/exoplayer-intro.git) from the official Android developer docs, following [this guide](https://developer.android.com/codelabs/exoplayer-intro#4).
2. Open and run the [exoplayer-codelab-04 example app](https://github.com/googlecodelabs/exoplayer-intro/tree/main/exoplayer-codelab-04) using [Android Studio](https://developer.android.com/studio).
3. Replace the `media_url_dash` URL on [this line](https://github.com/googlecodelabs/exoplayer-intro/blob/main/exoplayer-codelab-04/src/main/res/values/strings.xml#L21) with the DASH manifest URL for your video.
For more, see [read the docs](/stream/viewing-videos/using-own-player/ios/).
|
66248b71-6217-41d1-9257-9e26a44761a8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-10 08:36:44", "repo_name": "no8night/TimePickerView", "sub_path": "/app/src/main/java/com/nonight/timepickerview/activity/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "dd626b151aa2749b5c942cdc8b52d9a5c3e5a719", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/no8night/TimePickerView
| 222
|
FILENAME: MainActivity.java
| 0.281406
|
package com.nonight.timepickerview.activity;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import com.nonight.timepickerview.R;
import com.nonight.timepickview.entity.DateStyle;
import com.nonight.timepickview.utils.DateUtils;
import com.nonight.timepickview.view.TimePickerView;
import java.util.Date;
public class MainActivity extends Activity {
TimePickerView timePickerView;
TextView show_tv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
timePickerView = (TimePickerView) findViewById(R.id.timep);
show_tv = (TextView) findViewById(R.id.show_tv);
show_tv.setText(DateUtils.DateToString(timePickerView.getDate(), DateStyle.MM_DD_HH_MM_SS_CN));
timePickerView.setOnValueChangeListener(new TimePickerView.OnValueChangeListener() {
@Override
public void onChange(Date date) {
show_tv.setText(DateUtils.DateToString(date, DateStyle.MM_DD_HH_MM_SS_CN));
}
});
}
}
|
e7bb484f-88ca-4dbd-af9c-605ff85d53c8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-04-18T12:21:33", "repo_name": "42ways/the-beauty-of-git", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1210, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "d59c2ad74dbd34d8987c074241681bf5f2e3ffd2", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/42ways/the-beauty-of-git
| 301
|
FILENAME: README.md
| 0.221351
|
# The beauty of git
Short presentation about the concepts and internals of git, e.g. object types, trees, content-addressable etc.
To run the presentation, it has to be served from a web server, since the shell transcripts are loaded
from seperate files via the reveal-sampler plugin (using ajax calls).
Of course you can just view the
[Presentation on our Website](https://42ways.de/presentations/the-beauty-of-git/index.html).
## Setup of demo
The subdir `demo` contains a setup script `setup-demo.sh` that can be used to create the demo git
repositories `demo/repo` and `demo/repo2`, the shell fragments `demo/transcript*/*.shell` and
the the presentation images `demo/img*/*.png`.
## Dependencies
* revealjs (https://github.com/hakimel/reveal.js) with included highlight.js and notes plugins
* revealjs-plugin reveal-sampler (https://github.com/ldionne/reveal-sampler)
* revealjs-plugin revealjs-explicit-link (https://gitlab.com/xuhdev/revealjs-explicit-link)
* revealjs-plugin plugin-revealjs-mouse-pointer (https://github.com/caiofcm/plugin-revealjs-mouse-pointer)
* revealjs-plugin revealjs-menu (https://github.com/denehyg/reveal.js-menu)
* git-draw (https://github.com/sensorflo/git-draw/wiki)
|
e0005268-8dae-4480-87e4-eeefb74996c3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-28 09:24:24", "repo_name": "fmleing/manyThread", "sub_path": "/src/main/CyclicBarrierDemo.java", "file_name": "CyclicBarrierDemo.java", "file_ext": "java", "file_size_in_byte": 1003, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "d925ec081e1a29b2581c1797c4944f76802683d7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fmleing/manyThread
| 197
|
FILENAME: CyclicBarrierDemo.java
| 0.279042
|
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class CyclicBarrierDemo {
static CyclicBarrier cyclicBarrier = new CyclicBarrier(6, CyclicBarrierDemo::printDown);
public static void main(String[] args) {
ExecutorService executorService = Executors.newFixedThreadPool(6);
for (int i = 0; i < 6; i++) {
executorService.submit(CyclicBarrierDemo::printOther);
}
executorService.shutdown();
}
public static void printDown(){
System.out.println("执行完成");
}
public static void printOther() {
System.out.println(Thread.currentThread()+"线程执行");
try {
cyclicBarrier.await();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (BrokenBarrierException e) {
e.printStackTrace();
}
}
}
|
cfe7efc0-9003-41e1-b43d-659839748917
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-02 07:56:33", "repo_name": "danielcsiki/bloc-admin", "sub_path": "/util-admin/src/main/java/ro/sci/commands/validators/UserFormValidator.java", "file_name": "UserFormValidator.java", "file_ext": "java", "file_size_in_byte": 1103, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "f6cd69515cb25b991100bc31dd9cda4075582fab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/danielcsiki/bloc-admin
| 241
|
FILENAME: UserFormValidator.java
| 0.290981
|
/**
*
*/
package ro.sci.commands.validators;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
import ro.sci.commands.UserForm;
/**
* @author yellow
*
*/
@Component
public class UserFormValidator implements Validator {
/*
* (non-Javadoc)
*
* @see org.springframework.validation.Validator#supports(java.lang.Class)
*/
@Override
public boolean supports(Class<?> aClass) {
return UserForm.class.equals(aClass);
}
/*
* (non-Javadoc)
*
* @see org.springframework.validation.Validator#validate(java.lang.Object,
* org.springframework.validation.Errors)
*/
@Override
public void validate(Object target, Errors errors) {
UserForm userForm = (UserForm) target;
if (!userForm.getPasswordText().equals(userForm.getPasswordTextConf())) {
errors.rejectValue("passwordText", "PasswordsDontMatch.userForm.passwordText", "Passwords Don't Match");
errors.rejectValue("passwordTextConf", "PasswordsDontMatch.userForm.passwordTextConf",
"Passwords Don't Match");
}
}
}
|
5cb06ddd-9419-4a83-9cb1-61e33e15c007
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-04 06:32:55", "repo_name": "Chauhan-Hemant/Campus-Recruitment-System", "sub_path": "/Campus Recruitment System/src/Desktop/View_Jobs.java", "file_name": "View_Jobs.java", "file_ext": "java", "file_size_in_byte": 1228, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "28a940faa288cae14ffdcf24bdba4805b2da51ed", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Chauhan-Hemant/Campus-Recruitment-System
| 236
|
FILENAME: View_Jobs.java
| 0.289372
|
package Desktop;
public class View_Jobs {
private String company_name,job_title,job_description,job_requirement,key_responsibilities,salary_range;
private int criteria;
public View_Jobs(String Company_Name, String Job_Title, String Job_Description, String Job_Requirement, String Key_Responsibilities, String Salary_Range, int Criteria){
this.company_name = Company_Name;
this.job_title = Job_Title;
this.job_description = Job_Description;
this.job_requirement = Job_Requirement;
this.key_responsibilities = Key_Responsibilities;
this.salary_range = Salary_Range;
this.criteria = Criteria;
}
public String getCompanyName(){
return company_name;
}
public String getJobTitle(){
return job_title;
}
public String getJobDescription(){
return job_description;
}
public String getJobRequirement(){
return job_requirement;
}
public String getKeyResponsibilities(){
return key_responsibilities;
}
public String getSalaryRange(){
return salary_range;
}
public int getCriteria(){
return criteria;
}
}
|
664b47d0-c5b3-4032-b81d-14d4f0f76e08
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-24 03:10:33", "repo_name": "g1rjeevan/Programming-eclipse", "sub_path": "/hibernate_demo/src/com/om/hib/dto/PersonDTO.java", "file_name": "PersonDTO.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "985bca922f01b586860f8960d21216d5ec0671f4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/g1rjeevan/Programming-eclipse
| 234
|
FILENAME: PersonDTO.java
| 0.259826
|
package com.om.hib.dto;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "person_table")
public class PersonDTO implements Serializable {
// pk
@Id
@Column(name = "p_id")
private int pid;
@Column(name = "p_name")
private String name;
@Column(name = "p_gender")
private char gender;
@Column(name = "p_bg")
private String bloodGroup;// generate set and get
public PersonDTO() {
}
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public char getGender() {
return gender;
}
public void setGender(char gender) {
this.gender = gender;
}
public String getBloodGroup() {
return bloodGroup;
}
public void setBloodGroup(String bloodGroup) {
this.bloodGroup = bloodGroup;
}
}
|
cb91347a-55de-4210-be09-88fcd14a671c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-03 16:40:07", "repo_name": "danishm026/ResumeManager", "sub_path": "/web-application/src/main/java/com/arc/controllers/LoginController.java", "file_name": "LoginController.java", "file_ext": "java", "file_size_in_byte": 1127, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "3dd7d492243296a31e9044f90561e782e4bbce57", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/danishm026/ResumeManager
| 213
|
FILENAME: LoginController.java
| 0.268941
|
package com.arc.controllers;
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;
import org.springframework.web.servlet.ModelAndView;
import com.arc.business.login.UserLogin;
import com.arc.util.hash.Hashes;
@Controller
public class LoginController {
@RequestMapping(value="/login", method=RequestMethod.POST)
public ModelAndView login(@RequestParam("rollNumber") String rollNumber, @RequestParam("password") String password, HttpSession session) {
ModelAndView model = null;
rollNumber = rollNumber.trim();
password = password.trim();
String passwordHash = Hashes.getSHA1(password.getBytes());
boolean success = UserLogin.login(rollNumber, passwordHash);
if(success) {
model = new ModelAndView("redirect:/PersonalDetailsController");
session.setAttribute("rollNumber", rollNumber);
}
else {
model = new ModelAndView("redirect:/home.jsp");
}
return model;
}
}
|
ea6fedfa-962a-46e1-b12f-6aecce5a978d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-11 06:09:35", "repo_name": "xha123/testForsrs", "sub_path": "/app/src/main/java/com/yaoyao/testall/app/Myapp.java", "file_name": "Myapp.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "342bc901a0f8656e2b659d1d40bdcc2ff6775132", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/xha123/testForsrs
| 284
|
FILENAME: Myapp.java
| 0.285372
|
package com.yaoyao.testall.app;
import android.app.Application;
import android.content.Context;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Administrator on 2017/5/8.
*/
public class Myapp extends Application {
private static Map<String, Object> hashMap = null;
private static Object object = null;
public static Context context;
public static int CID = 0;
public static String APPKEY = "1c369c73b3efc";
public static String APPSECRET = "1eebb5f4806a89391ac56dfcd051830b";
public static String USERID_KEY = "userid";
public static String PASSWORD_KEY = "password";
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
setHashMap(new HashMap<String, Object>());
}
public static Map<String, Object> getHashMap()
{
return hashMap;
}
public static void setHashMap(Map<String, Object> map) {
hashMap = map;
}
public static Context getAppContext() {
return context;
}
public static Object getObject() {
return object;
}
public static void setObject(Object object) {
Myapp.object = object;
}
}
|
71f725fd-cb66-4c24-821e-ff8dcfe29f58
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2019-07-19T21:00:52", "repo_name": "kellybirr/c-auth", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1223, "line_count": 14, "lang": "en", "doc_type": "text", "blob_id": "133dca04ee76a2a93f57e10840a69f8ba9e301b8", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kellybirr/c-auth
| 268
|
FILENAME: README.md
| 0.272799
|
# C-Auth
This is my proposed "C-Auth" API Authentication Framework
C-Auth is heavily based on the core principals of *OAuth v2* for the authentication and authorization of API call between services and micro-services in homogeneous or heterogeneous systems.
The fundamental difference is that C-Auth issues and validates client and server TLS certificates instead of "tokens". The certificates that are issued are used for both the authentication/authorization of API calls as well as the facilitation of TLS handshake and encryption so you can easily encrypt the traffic end-to-end within your service mesh.
At this time, C-Auth does not attempt to be a user identity framework. A C-Auth equivalent of *Open-ID Connect* is out of scope today.
This repository will contain both the a server implementation in C# (.Net Core 2.2) as well as client implementations (initially only C#) and sample code. I'll eventually also have "ready to deploy" Docker containers for this project.
**CREDITS**
Significant portions of the core certificate issuing code in this project are based on the [AzureIoTDPSCertificates](https://github.com/rwatjen/AzureIoTDPSCertificates) project by [Rasmus W](https://github.com/rwatjen).
|
e33a5ca7-f646-4a76-9e5a-5fd036c59307
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-07 13:05:51", "repo_name": "st49617/INPIA_CV1", "sub_path": "/cv2/cv2_spring/src/main/java/cz/branda/npia/cv2/Application.java", "file_name": "Application.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "207a97c4fc8dfda4cc1b8c6c4675be91da6c24ad", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/st49617/INPIA_CV1
| 191
|
FILENAME: Application.java
| 0.268941
|
package cz.branda.npia.cv2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.List;
@Component
public class Application {
@Autowired
List<MessageService> mailService;
MessageService sender;
public Application() {
}
public static void main(String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("cz.branda.npia.cv2");
Application app = context.getBean(Application.class);
app.proccessMesage("message");
}
public void proccessMesage(String message) {
// for (MessageService emailService : mailService) {
// emailService.sendMessage(message);
// }
sender.sendMessage(message);
}
@PostConstruct
public void endMessage() {
System.out.println(" - Konec - ");
}
}
|
a9f0884a-090c-4755-8595-c60687474c7c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-24 10:23:43", "repo_name": "leminaselman/student-management", "sub_path": "/app/src/main/java/com/gtappdevelopers/gfgroomdatabase/StudentView.java", "file_name": "StudentView.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "81db0b860cc31ff8130a88d50d2b25b8a88a14c5", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/leminaselman/student-management
| 200
|
FILENAME: StudentView.java
| 0.267408
|
package com.gtappdevelopers.gfgroomdatabase;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import com.gtappdevelopers.gfgroomdatabase.StudentModal;
import com.gtappdevelopers.gfgroomdatabase.StudentRepository;
import java.util.List;
public class StudentView extends AndroidViewModel {
private StudentRepository repository;
private LiveData<List<StudentModal>> allStudents;
public StudentView(@NonNull Application application) {
super(application);
repository = new StudentRepository(application);
allStudents = repository.getAllStudents();
}
public void insert(StudentModal model) {
repository.insert(model);
}
public void update(StudentModal model) {
repository.update(model);
}
public void delete(StudentModal model) {
repository.delete(model);
}
public void deleteAllStudents() {
repository.deleteAllStudents();
}
public LiveData<List<StudentModal>> getAllStudents() {
return allStudents;
}
}
|
40efadc2-6946-4b0f-a37c-41f3273aa378
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-28 03:21:25", "repo_name": "laolinmao/sale_delivery_android", "sub_path": "/base/src/main/java/com/histudio/base/http/subscribers/LoadingSubscriber.java", "file_name": "LoadingSubscriber.java", "file_ext": "java", "file_size_in_byte": 1253, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "fda76c68dc9daec6ace80d6bd1d3b608941e37e3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/laolinmao/sale_delivery_android
| 287
|
FILENAME: LoadingSubscriber.java
| 0.283781
|
package com.histudio.base.http.subscribers;
import io.reactivex.disposables.Disposable;
/**
* 用于在Http请求开始时,自动显示一个loadingview
* 调用者自己对请求数据进行处理
* Created by ljh on 16/3/10.
*/
public class LoadingSubscriber<T> extends BaseSubscriber<T> {
private SubscriberOnNextListener mSubscriberOnNextListener;
public LoadingSubscriber(SubscriberOnNextListener mSubscriberOnNextListener) {
this.mSubscriberOnNextListener = mSubscriberOnNextListener;
}
/**
* 订阅开始时调用
* 显示ProgressDialog
*/
@Override
public void onSubscribe(Disposable d) {
super.onSubscribe(d);
showLoadingView();
}
/**
* 对错误进行统一处理
* 隐藏ProgressDialog
*/
@Override
public void onError(Throwable e) {
super.onError(e);
dismissLoadingView();
}
/**
* 将onNext方法中的返回结果交给Activity或Fragment自己处理
*
* @param t 创建Subscriber时的泛型类型
*/
@Override
public void onNext(T t) {
super.onNext(t);
if (mSubscriberOnNextListener != null) {
mSubscriberOnNextListener.onNext(t);
}
}
}
|
bd5c11df-43ca-4898-89b8-9d6d6adefbd1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-28 11:29:28", "repo_name": "Akesh/serverless-app", "sub_path": "/aws-core/src/main/java/com/payu/dynamo/DynamoDBClient.java", "file_name": "DynamoDBClient.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "b9508bb5f05c699145602ebdf930b55fb8056834", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Akesh/serverless-app
| 254
|
FILENAME: DynamoDBClient.java
| 0.256832
|
package com.payu.dynamo;
import com.amazonaws.AmazonClientException;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.regions.Region;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
import com.amazonaws.services.dynamodbv2.document.DynamoDB;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
* Created by akesh.patil on 14-03-2017.
*/
@Configuration
public class DynamoDBClient {
@Value("${aws.region}")
private String awsRegion;
public AmazonDynamoDBClient createDynamoDbClient() {
AWSCredentials credentials = null;
try {
credentials = new DefaultAWSCredentialsProviderChain().getCredentials();
Region region = Region.getRegion(Regions.fromName(awsRegion));
AmazonDynamoDBClient dynamoDBClient = new AmazonDynamoDBClient(credentials);
dynamoDBClient.setRegion(region);
return dynamoDBClient;
} catch (Exception e) {
throw new AmazonClientException("Unable to load AWS credentials ", e);
}
}
}
|
02c2ea0a-913d-43cd-ac5a-0b9a2586907b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-12 14:29:38", "repo_name": "cornflower10/IEPSC", "sub_path": "/app/src/main/java/cn/cornflower/com/huan/ui/activity/TestActivity.java", "file_name": "TestActivity.java", "file_ext": "java", "file_size_in_byte": 1238, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "2d5b144d49ded1d805b9073502012322c4e59ab7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cornflower10/IEPSC
| 240
|
FILENAME: TestActivity.java
| 0.23231
|
package cn.cornflower.com.huan.ui.activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.facebook.drawee.view.SimpleDraweeView;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import butterknife.ButterKnife;
import butterknife.InjectView;
import cn.cornflower.com.huan.R;
public class TestActivity extends AppCompatActivity {
@InjectView(R.id.sv)
SimpleDraweeView sv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
ButterKnife.inject(this);
sv.setImageBitmap(getLoacalBitmap("/storage/emulated/0/BarcodeScanner/Barcodes/zhaiyingshi.png"));
}
/**
* 加载本地图片
* @param url
* @return
*/
public static Bitmap getLoacalBitmap(String url) {
try {
FileInputStream fis = new FileInputStream(url);
return BitmapFactory.decodeStream(fis); ///把流转化为Bitmap图片
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
}
}
}
|
f223528d-3fe7-46a5-baef-83f838799b62
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-06-07T16:19:28", "repo_name": "PereAL7/AssemblyGame", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1227, "line_count": 20, "lang": "en", "doc_type": "text", "blob_id": "66f111c5974f6d7d69c0554721ba2d90d10549cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/PereAL7/AssemblyGame
| 258
|
FILENAME: README.md
| 0.220007
|
# AssemblyGame
First of all, I'm not the only creator of this. Mateo Javier Ramón Román is the cocreator besides me.
Basically this is a game developed in Motorola 68K's assembly language as a university project.
This was an assigment to test our skills dealing with I/O operations using assembly and our hability to
adapt to the hardware and programming limitations of an older CPU.
# Development and inspirations
This project was fully developed using Easy68K, a program which emulates a Motorola 68K processor.
Both The Legend of Zelda and The Binding of Isaac were clear inspirations when the game development started as
their moving and fighting mechanics were relativelly easy to translate and adapt to an efficient "character controller".
# Execution
In order to start this game you must use the Easy68K emulator and execute the MAIN.X68 file.
# Future
Right now neither me nor my partner have decided to continue further development despite the knowledge of som possible upgrades
# Thanks
I want to end this README thanking our teacher Antoni Burguera. He gave us (the students) a really good template to start this project and inspired us by showing examples of what can be done with enough wit a determination.
|
deacf108-600f-4f12-9cf5-a208d67917c8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-08-05T14:42:11", "repo_name": "Franciskadtt/hello-django", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1095, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "ee99c6b162bee3f2c4f994afe71acfca0d33f1d5", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Franciskadtt/hello-django
| 264
|
FILENAME: README.md
| 0.20947
|
# Code Institute - To Do application
This is a solution to the a challenge from the [Code Institute](https://codeinstitute.net/) Full-Stack Module to create a basic to do application with Django.
## Overview
### Links
- [Repo](https://github.com/Franciskadtt/hello-django)
- [Live site](https://the-django-todo-app.herokuapp.com/)
### Built with
- HMTL
- Python
- SQLite
### What I learned
- I learned how to perform create, read, update, and delete calls (CRUD calls) to a database in the context of a Django application.
- How to create an HTML-based user interfaces to demonstrate these CRUD calls in action.
- Using one of dependencies that come with Django.
- How to set up an admin profile, authentication and authorization.
- Deploying to Heroku.
- Using git: add, commit and push to a repository on Github.
### Features
- To add new tasks to do.
- To toggle, edit or delete task to do.
- An administrator view to add, toggle, edit and delete tasks to do from an admin dashboard.
## Acknowledgements
- All content was provided by [Code Institute](https://codeinstitute.net/)
|
7a9d50d5-bc5d-4961-809c-314125dc8a3c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-24 15:42:49", "repo_name": "QuelessQuest/US", "sub_path": "/src/main/java/com/barrypress/us/object/Deck.java", "file_name": "Deck.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "dcbeb62ff13dc7002a9050e4b049544e97f8405c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/QuelessQuest/US
| 264
|
FILENAME: Deck.java
| 0.268941
|
package com.barrypress.us.object;
import com.barrypress.us.db.Derby;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
public class Deck {
protected Integer type;
protected List<Integer> draw;
protected List<Integer> discard;
protected Derby db;
public Deck() {}
public Deck(Derby db) {
this.db = db;
}
public void setup(Integer gameID, Integer type) {
this.type = type;
this.draw = new ArrayList<>();
this.discard = new ArrayList<>();
}
public void discard(Integer id) {
discard.add(id);
}
public void reshuffle() {
draw.addAll(discard);
Collections.shuffle(draw, new Random(System.nanoTime()));
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public List<Integer> getDraw() {
return draw;
}
public void setDraw(List<Integer> draw) {
this.draw = draw;
}
public List<Integer> getDiscard() {
return discard;
}
public void setDiscard(List<Integer> discard) {
this.discard = discard;
}
}
|
14414c0a-2f94-403c-8d1c-5cf7677e2b44
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-26 16:17:53", "repo_name": "vgtstptlk/microservices-course", "sub_path": "/NedFlanders/src/main/java/RunNed.java", "file_name": "RunNed.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "b7b706dbc0078acf6deadb6a0d3204975690bbec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/vgtstptlk/microservices-course
| 217
|
FILENAME: RunNed.java
| 0.240775
|
import my.experiments.services.MyPetSOAPService;
import my.experiments.services.MyPetSOAPServiceService;
public class RunNed {
public static void main(String[] args) throws InterruptedException {
MyPetSOAPServiceService ms = new MyPetSOAPServiceService();
MyPetSOAPService client = ms.getMyPetSOAPServicePort();
ClientView clientView = new ClientView(client);
clientView.start();
Thread.sleep(100);
ClientController clientController = new ClientController(clientView, client);
clientController.start();
while (true) {
System.out.println("-------------------------------------");
System.out.println("hunger: " + clientView.hunger);
System.out.println("face: " + clientView.face);
System.out.println("mood: " + clientView.mood);
System.out.println("health: " + clientView.health);
System.out.println("thirst: " + clientView.thirst);
System.out.println("-------------------------------------");
Thread.sleep(1000);
}
}
}
|
860f8a86-4ed9-4e95-8e02-3b7017686792
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-30 17:04:12", "repo_name": "kenzhaoyihui/javase_L", "sub_path": "/springboot_demo/src/main/java/springboot_jpa/service/Impl/AccountServiceImpl.java", "file_name": "AccountServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "f7cdc04742041bcba4c8b2c0adc6307a9f658926", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kenzhaoyihui/javase_L
| 221
|
FILENAME: AccountServiceImpl.java
| 0.282988
|
package springboot_jpa.service.Impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import springboot_jpa.dao.AccountDao;
import springboot_jpa.entity.Account;
import springboot_jpa.service.AccountService;
import java.util.List;
@Service
public class AccountServiceImpl implements AccountService {
@Autowired
AccountDao accountDao;
@Override
public List<Account> findAll() {
//return null;
return accountDao.findAll();
}
@Override
public Account insertAccount(Account account) {
//return null;
return accountDao.save(account);
}
@Override
public Account update(Account account) {
//return null;
return accountDao.save(account);
}
@Override
public Account delete(Integer id) {
//return null;
Account account = accountDao.findById(id).get();
accountDao.delete(account);
return account;
}
@Override
public Account findById(Integer id) {
//return null;
return accountDao.findById(id).get();
}
}
|
8c1ba7a8-b01d-4f73-891c-1ff7dec259fc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-04 16:10:27", "repo_name": "itcolombia/gws-integraciones", "sub_path": "/gws-solicitudes-salidas-dto/src/main/java/com/gws/integraciones/solicitudes/salidas/dto/SolicitudLineaDto.java", "file_name": "SolicitudLineaDto.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "832416db5bd753df225e28214f112fe748c4b976", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/itcolombia/gws-integraciones
| 285
|
FILENAME: SolicitudLineaDto.java
| 0.262842
|
package com.gws.integraciones.solicitudes.salidas.dto;
import java.math.BigDecimal;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.gws.integraciones.core.dto.EntityDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SolicitudLineaDto extends EntityDto<Integer> {
private Integer id;
@NotNull
private Integer idSolicitud;
private int lineNum;
private int subLineNum;
@NotNull
@Size(max = 20)
private String itemCode;
@NotNull
@Size(max = 400)
private String dscription;
private int quantity;
private Integer quantityAsignada;
private Integer quantityNoAsignada;
@NotNull
@Size(max = 32)
private String whsCode;
@NotNull
@Size(max = 40)
private String predistribucion;
@JsonIgnore
@NotNull
@Size(max = 32)
private String filler;
@JsonIgnore
@NotNull
private BigDecimal valorUnit;
private BigDecimal icoGws;
private BigDecimal icoCliente;
// @Size(max = 20)
// private String statusLinea;
}
|
5f1b27d3-7be2-4c07-b35b-09f4bee3e47d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-05-16T21:31:00", "repo_name": "arunkumar198857/JavaFX_Practice", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1129, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "225036570894aea9032744bfb25cf393c9ea2348", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/arunkumar198857/JavaFX_Practice
| 284
|
FILENAME: README.md
| 0.267408
|
# JavaFX_Practice
In this repository, I have uploaded the final contents of the project. This is a practice project in which i implemented all the
JavaFX topics as i learnt them. The java version used in this project is Java 12.0.1.
Along with this i have also made a sample Login Class which fetches the user input and
validates it using MySQL database. I achieved this using JDBC.
I've covered the following topics in this practice project:
1. Creating a basic window.
2. Handling user events.
3. Anonymous Inner Classes and Lambda Expressions.
4. Switching Scenes.
5. Creating Alert Boxes.
6. Communication Between Windows.
7. Closing Program Properly.
8. Embedding Layouts.
9. GridPane.
10. Extract and Validate Input.
11. CheckBox.
12. ChoiceBox(Drop Down Menu).
13. Listening for Selection Changes.
14. ComboBox.
15. ListView.
16. TreeView.
17. Introduction to TableView.
18. Sample Table View
19. Editing Tables
20. Adding and Deleting TableView Rows
21. Making Menus.
22. Handling Menu Clicks.
23. CheckMenuItem.
24. RadioMenuItem.
25. Properties.
26. Binding Properties.
27. Connection with MySQL database using JDBC.
|
4bcfc398-3af9-4ddd-8417-c4bd765a65b4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-20 22:11:24", "repo_name": "cano112/neo4jlab", "sub_path": "/src/main/java/pl/edu/agh/wiet/neo4jlab/model/results/CompanyRelationshipAggregate.java", "file_name": "CompanyRelationshipAggregate.java", "file_ext": "java", "file_size_in_byte": 1103, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "a51fd83e8f948e3c7187f157e8a4803f643a035b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cano112/neo4jlab
| 212
|
FILENAME: CompanyRelationshipAggregate.java
| 0.262842
|
package pl.edu.agh.wiet.neo4jlab.model.results;
import pl.edu.agh.wiet.neo4jlab.model.relationships.CustomerRelationship;
import pl.edu.agh.wiet.neo4jlab.model.relationships.StockItemRelationship;
import pl.edu.agh.wiet.neo4jlab.model.relationships.WorkerRelationship;
import java.util.List;
public class CompanyRelationshipAggregate {
private final List<WorkerRelationship> workers;
private final List<CustomerRelationship> customers;
private final List<StockItemRelationship> products;
public CompanyRelationshipAggregate(List<WorkerRelationship> workers,
List<CustomerRelationship> customers,
List<StockItemRelationship> products) {
this.workers = workers;
this.customers = customers;
this.products = products;
}
public List<WorkerRelationship> getWorkers() {
return workers;
}
public List<CustomerRelationship> getCustomers() {
return customers;
}
public List<StockItemRelationship> getProducts() {
return products;
}
}
|
f2069c8f-127c-4aca-a914-82dec2c1cb27
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-24 11:45:20", "repo_name": "851822132/starter-test", "sub_path": "/jdbc-starter/src/main/java/com/ysh/jdbcstarter/JdbcAutoConfigrution.java", "file_name": "JdbcAutoConfigrution.java", "file_ext": "java", "file_size_in_byte": 1228, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "d057ad574274f3aac69aa3634d5afb13c77a2f48", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/851822132/starter-test
| 223
|
FILENAME: JdbcAutoConfigrution.java
| 0.217338
|
package com.ysh.jdbcstarter;
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//import org.springframework.jdbc.core.JdbcTemplate;
import javax.sql.DataSource;
/**
* @author ysh
*/
@Configuration
@ConditionalOnProperty(prefix = "myDataSource", value = "enabled", havingValue = "true")
@EnableConfigurationProperties(JdbcProerties.class)
public class JdbcAutoConfigrution {
@Bean
public DataSource dataSource(JdbcProerties jdbcProerties){
System.out.println("初始化一个druid连接池");
DruidDataSource dataSource = new DruidDataSource();
dataSource.setUrl(jdbcProerties.getUrl());
dataSource.setUsername(jdbcProerties.getUsername());
dataSource.setPassword(jdbcProerties.getPassword());
dataSource.setDriverClassName(jdbcProerties.getDriverClassName());
return dataSource;
}
// @Bean
// public JdbcTemplate jdbcTemplate(){
// return new JdbcTemplate();
// }
}
|
ec8307e5-95e5-4b26-acef-98a900a35121
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-10 18:01:57", "repo_name": "gamb77/am-store", "sub_path": "/am-application/src/main/java/org/hopto/gamb/components/AMMainWindow.java", "file_name": "AMMainWindow.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "fc4bc766b30a34ea309a3a73abf0d2fa999da88a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gamb77/am-store
| 214
|
FILENAME: AMMainWindow.java
| 0.271252
|
package org.hopto.gamb.components;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import org.hopto.gamb.AMUIApplication;
/**
* Main window over the application
*
* @author jani
*/
public class AMMainWindow extends Window {
private AMTitleComponent title;
private AMMainComponent main;
public AMMainWindow() {
super(AMUIApplication.APPLICATION_TITLE);
}
public void initComponents() {
title = new AMTitleComponent();
main = new AMMainComponent();
//Set main layout
VerticalLayout mainLayout = new VerticalLayout();
mainLayout.setSizeFull();
mainLayout.setMargin(true);
//Toplevel component
title.initComponent();
mainLayout.addComponent(title);
mainLayout.setExpandRatio(title, 5f);
//Main component
main.initComponent();
mainLayout.addComponent(main);
mainLayout.setExpandRatio(main, 20f);
setContent(mainLayout);
}
}
|
ad115cd1-3ce4-4f8e-93f2-a12ea07d348d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-08-12 14:36:17", "repo_name": "lujian0571/weixin-java-tools", "sub_path": "/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/WxMpXmlOutPayCallback.java", "file_name": "WxMpXmlOutPayCallback.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "1fd4cd696e92c60097b6b0b3d79a7dde45f1babb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lujian0571/weixin-java-tools
| 261
|
FILENAME: WxMpXmlOutPayCallback.java
| 0.242206
|
package me.chanjar.weixin.mp.bean;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
import me.chanjar.weixin.mp.util.xml.XStreamTransformer;
/**
* @author lujian
* @date 15/7/9.
*/
@XStreamAlias("xml")
public class WxMpXmlOutPayCallback {
@XStreamAlias("return_code")
@XStreamConverter(value=XStreamCDataConverter.class)
private String returnCode = "SUCCESS";
@XStreamAlias("return_msg")
@XStreamConverter(value=XStreamCDataConverter.class)
private String returnMsg = "OK";
public String getReturnCode() {
return returnCode;
}
public void setReturnCode(String returnCode) {
this.returnCode = returnCode;
}
public String getReturnMsg() {
return returnMsg;
}
public void setReturnMsg(String returnMsg) {
this.returnMsg = returnMsg;
}
public String toXml() {
return XStreamTransformer.toXml((Class) this.getClass(), this);
}
}
|
0013eb98-79b4-4f91-9dd6-da3e8dce1c67
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-03 02:16:41", "repo_name": "jaypanchal07/Project-Brain", "sub_path": "/jay panchal(Project Brain)/app/src/main/java/com/example/instaappandroidprojectprojectbrain/Model/Profile1.java", "file_name": "Profile1.java", "file_ext": "java", "file_size_in_byte": 1076, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "886be819a15722f095c55b89f977907414666c9c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jaypanchal07/Project-Brain
| 213
|
FILENAME: Profile1.java
| 0.217338
|
package com.example.instaappandroidprojectprojectbrain.Model;
import java.util.ArrayList;
public class Profile1 {
private String email;
private String username;
private String name;
private ArrayList<String> Following;
public Profile1(){
}
public Profile1(String email, String username, String name){
this.email = email;
this.username = username;
this.name = name;
this.Following = new ArrayList<> ();
}
public ArrayList<String> getFollowing() {
return Following;
}
public void setFollowing(ArrayList<String> following) {
Following = following;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
|
1544e9af-a450-40ba-84cd-62bbf34e22d0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-26 01:08:50", "repo_name": "vinohsueh/i9-defence-parent", "sub_path": "/i9-defence-parent/i9-defence-microservice-observer/src/main/java/i9/defence/platform/microservice/observer/pool/ActiveMQConsumerTask.java", "file_name": "ActiveMQConsumerTask.java", "file_ext": "java", "file_size_in_byte": 1087, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "091e251fc86aa740d9c03fdec78234e2df5bbbf0", "star_events_count": 1, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/vinohsueh/i9-defence-parent
| 214
|
FILENAME: ActiveMQConsumerTask.java
| 0.261331
|
package i9.defence.platform.microservice.observer.pool;
import i9.defence.platform.microservice.observer.util.SpringBeanService;
import i9.defence.platform.service.UpStreamOriginService;
import java.util.TimerTask;
import javax.jms.TextMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ActiveMQConsumerTask extends TimerTask {
@Override
public void run() {
UpStreamOriginService upStreamOriginService = SpringBeanService.getBean(UpStreamOriginService.class);
try {
upStreamOriginService.saveUpStreamOrigin(textMessage.getText());
logger.info("save up stream decode success, data : " + textMessage.getText());
} catch (Exception e) {
logger.error("save up stream decode error, ex : ", e);
}
}
private static final Logger logger = LoggerFactory.getLogger(ActiveMQConsumerTask.class);
private final TextMessage textMessage;
public ActiveMQConsumerTask(TextMessage textMessage) {
this.textMessage = textMessage;
}
}
|
e78ae35b-d53e-4afa-859f-97eddd4ca6cc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-28 03:40:57", "repo_name": "Nuttapus/nongcharon", "sub_path": "/app/src/main/java/com/example/taochiz/sharelo/SelectActivity.java", "file_name": "SelectActivity.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "e544bb26d56adb61c1ec8d44d1525eae9898c36e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Nuttapus/nongcharon
| 179
|
FILENAME: SelectActivity.java
| 0.206894
|
package com.example.taochiz.sharelo;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class SelectActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().hide();
setContentView(R.layout.activity_select);
Button bR = (Button)findViewById(R.id.btnSearch);
bR.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(SelectActivity.this, SearchActivity.class));
}
});
Button bW = (Button)findViewById(R.id.btnWrite);
bW.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(SelectActivity.this, WriteActivity.class));
}
});
}
}
|
527e798f-6309-48ac-a29c-2d2aa2b99222
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-28 20:44:07", "repo_name": "hs750/JavaPublishSubscribe", "sub_path": "/src/main/java/com/github/hs750/pubsub/SubscriptionManager.java", "file_name": "SubscriptionManager.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "192bf3d70cf75e6244b3527d50ad934e6e8e91d3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hs750/JavaPublishSubscribe
| 257
|
FILENAME: SubscriptionManager.java
| 0.282988
|
package com.github.hs750.pubsub;
import java.util.HashSet;
import java.util.Set;
/**
* Manages the {@link Subscriber}s of a particular type.
*
* @param <T> The type of data being subscribed to by managed {@link Subscriber}s.
*/
final class SubscriptionManager<T> {
private Set<Subscriber<T>> subscribers = new HashSet<>();
/**
* Add a {@link Subscriber} to be managed.
*
* @param subscriber The {@link Subscriber} to manage.
*/
void addSubscriber(Subscriber<T> subscriber) {
subscribers.add(subscriber);
}
/**
* Send data to all managed {@link Subscriber}s. Don't send data back to the publisher unless
* {@link Publisher#isPublishLoopbackAllowed()} is true.
*
* @param data The data being published.
* @param sender The {@link Publisher} that sent the data.
*/
void broadcastData(T data, Publisher sender) {
for (Subscriber<T> subscriber : subscribers) {
if (sender == subscriber) {
if (sender.isPublishLoopbackAllowed()) {
subscriber.receive(data);
}
} else {
subscriber.receive(data);
}
}
}
}
|
0da8ae43-15dd-429e-bd93-952a3ca1bab3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-13 06:29:32", "repo_name": "Zhangqingling1/GreenDao", "sub_path": "/app/src/main/java/com/aqinga/greendao/GreenDaoManger.java", "file_name": "GreenDaoManger.java", "file_ext": "java", "file_size_in_byte": 1145, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "ace7d45a212fcb1bdf955781e064cb462ac3af31", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Zhangqingling1/GreenDao
| 283
|
FILENAME: GreenDaoManger.java
| 0.282196
|
package com.aqinga.greendao;
import com.aqinga.greendaodemo.greendao.gen.DaoMaster;
import com.aqinga.greendaodemo.greendao.gen.DaoSession;
/**
* Created by
* 张庆龄
* 1506A
* Administrator
* 2017/10/1311:21
*/
public class GreenDaoManger {
private static GreenDaoManger mInstance;
private static GreenDaoManger manger;
private static DaoMaster daoMaster;
private static DaoSession daoSession;
public GreenDaoManger() {
//创建数据库
DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(MyApp.getContext(), "zhangqingling.db", null);
daoMaster = new DaoMaster(helper.getWritableDatabase());
daoSession = daoMaster.newSession();
}
public static GreenDaoManger getInstance() {
if (mInstance==null){
mInstance = new GreenDaoManger();
}
return mInstance;
}
public DaoMaster getDaoMaster() {
return daoMaster;
}
public DaoSession getDaoSession() {
return daoSession;
}
public DaoSession getNewSession(){
daoSession = daoMaster.newSession();
return daoSession;
}
}
|
42267caa-6cb2-4dfb-9483-13605ce77869
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-22 13:24:39", "repo_name": "fanlingzhi1234/Xingyi-Tech", "sub_path": "/workplace/spring-mvc-demo/src/main/java/com/example/springmvcdemo/Message.java", "file_name": "Message.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "dfea86e446e5b4e44e2f7c92df2dc26e2a6412e9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fanlingzhi1234/Xingyi-Tech
| 242
|
FILENAME: Message.java
| 0.23231
|
package com.example.springmvcdemo;
import java.util.ArrayList;
import java.util.List;
public class Message {
private String content;
private String sender;
private List<String> receiver;
public Message(){
}
public Message(String content, String sender, List<String> receiver) {
this.content = content;
this.sender = sender;
this.receiver = receiver;
}
public Message(String content, String sender) {
this.content = content;
this.sender = sender;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getSender() {
return sender;
}
public void setSender(String sender) {
this.sender = sender;
}
public List<String> getReceiver() {
return receiver;
}
public void setReceiver(List<String> receiver) {
this.receiver = receiver;
}
@Override
public String toString() {
return "Message{" +
"content='" + content + '\'' +
", sender='" + sender + '\'' +
", receiver=" + receiver +
'}';
}
}
|
c98c3bd2-45b9-49ed-a290-2c6cb030f8b6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-15 19:32:32", "repo_name": "google-code/basic-web-layouts", "sub_path": "/JPE/WEB-INF/src/com/joelaws/prototype/client/meeting/ActionInfo.java", "file_name": "ActionInfo.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "791e617513c3431f56ec4c6eb6fe65c9b71840ef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/google-code/basic-web-layouts
| 228
|
FILENAME: ActionInfo.java
| 0.252384
|
package com.joelaws.prototype.client.meeting;
import java.io.Serializable;
public class ActionInfo implements Serializable {
private static final long serialVersionUID = 1L;
private String question;
private String[] choices;
private MeetingType type;
public ActionInfo() {
}
public ActionInfo(String question, String[] choices, MeetingType type) {
this.question = question;
this.choices = choices;
this.type = type;
}
public String getQuestion() {
return question;
}
public String[] getChoices() {
return choices;
}
public MeetingType getType() {
return type;
}
public void setType(MeetingType type) {
this.type = type;
}
public void setQuestion(String question) {
this.question = question;
}
public void setChoices(String[] choices) {
this.choices = choices;
}
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append(question);
builder.append("=");
for (String choice : choices) {
builder.append(choice);
builder.append(":");
}
return builder.toString();
}
}
|
ad61192b-e0c9-427e-b368-118a849b7ae8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-10 20:40:19", "repo_name": "danirg15/javascript-text-processor", "sub_path": "/src/clases/sintacticAnalizer/TerminalSymbol.java", "file_name": "TerminalSymbol.java", "file_ext": "java", "file_size_in_byte": 1026, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "4204060cf9fc7ce5b06e2d007f3d50e701281f10", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/danirg15/javascript-text-processor
| 232
|
FILENAME: TerminalSymbol.java
| 0.295027
|
package sintacticAnalizer;
import lexicalAnalizer.Token;
import semanticAnalizer.Attribute;
public class TerminalSymbol implements GrammaticalSymbol {
private Token token;
private Attribute attribute;
public TerminalSymbol(Token token){
this.token = token;
this.attribute = new Attribute();
}
public Token getToken() {
return token;
}
public Attribute getAttribute() {
return attribute;
}
// public void setAttribute(Attribute attribute) {
// this.attribute = attribute;
// }
public boolean equals(Object o){
if((o instanceof TerminalSymbol) &&
this.token.equals(((TerminalSymbol)o).getToken())){
return true;
}
return false;
}
public boolean match(Object o){
if((o instanceof TerminalSymbol) &&
this.token.match(((TerminalSymbol)o).getToken())){
return true;
}
return false;
}
@Override
public String toString() {
if(token.getAttr() == null) {
return token.getType().name();
}
return token.getType().name() +"("+ token.getAttr()+")";
}
}
|
4d425688-9274-4a5f-86ea-01b196915689
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-06 06:40:34", "repo_name": "zdb17173/vertx", "sub_path": "/core/src/main/java/org/fran/vertx/core/streams/StreamsServerTest.java", "file_name": "StreamsServerTest.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "c2f8dcbc7e41a0e889b1d538924d51960d1dce39", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zdb17173/vertx
| 234
|
FILENAME: StreamsServerTest.java
| 0.256832
|
package org.fran.vertx.core.streams;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
import io.vertx.core.Vertx;
import io.vertx.core.net.NetServer;
import io.vertx.core.net.NetServerOptions;
/**
* Created by fran on 2017/10/6.
*/
public class StreamsServerTest extends AbstractVerticle{
public void start(Future<Void> startFuture) throws Exception {
NetServer server = vertx.createNetServer(
new NetServerOptions()
.setPort(1234)
.setHost("localhost")
);
server.connectHandler(sock -> {
sock.setWriteQueueMaxSize(10);
sock.handler(buffer -> {
sock.write(buffer);
if (sock.writeQueueFull()) {
System.out.println("writeQueueFull");
sock.pause();
sock.drainHandler(done -> {
System.out.println("resume");
sock.resume();
});
}
});
}).listen();
}
public static void main(String[] args){
Vertx.vertx().deployVerticle(StreamsServerTest.class.getName());
}
}
|
1a40950c-c46e-4751-b5ef-676d9a4909fc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-04 09:46:47", "repo_name": "bookwed/yuegou", "sub_path": "/yuegou-util/src/main/java/com/wei/util/upload/UploadDto.java", "file_name": "UploadDto.java", "file_ext": "java", "file_size_in_byte": 1267, "line_count": 73, "lang": "en", "doc_type": "code", "blob_id": "de2248d5117244c2172868d6e9d0696d133da13d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bookwed/yuegou
| 290
|
FILENAME: UploadDto.java
| 0.233706
|
package com.wei.util.upload;
;
/**
* Description
* Author ed
* Created 2017-08-03 14:10
*/
public class UploadDto {
/**
* 文件大小
*/
private Long fileSize;
/**
* 真实文件名
*/
private String fileName;
/**
* 随机文件名
*/
private String uuidName;
/**
* 文件路径
*/
private String filePath;
public UploadDto() {
}
public UploadDto(Long fileSize, String fileName, String uuidName, String filePath) {
this.fileSize = fileSize;
this.fileName = fileName;
this.uuidName = uuidName;
this.filePath = filePath;
}
public Long getFileSize() {
return fileSize;
}
public void setFileSize(Long fileSize) {
this.fileSize = fileSize;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getUuidName() {
return uuidName;
}
public void setUuidName(String uuidName) {
this.uuidName = uuidName;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
}
|
0bc5f037-2564-42a3-be60-5f0f0f6264fe
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-01-18 12:45:20", "repo_name": "A5H73Y/Carz", "sub_path": "/src/main/java/io/github/a5h73y/carz/utility/PlayerUtils.java", "file_name": "PlayerUtils.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "aff3298af4887f1264cbe0577ccf8069af984a29", "star_events_count": 11, "fork_events_count": 8, "src_encoding": "UTF-8"}
|
https://github.com/A5H73Y/Carz
| 270
|
FILENAME: PlayerUtils.java
| 0.282988
|
package io.github.a5h73y.carz.utility;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
/**
* Player related utility methods.
*/
public class PlayerUtils {
/**
* Get the Material in the player's hand.
*
* @param player target player
* @return {@link Material}
*/
public static Material getMaterialInPlayersHand(Player player) {
return player.getInventory().getItemInMainHand().getType();
}
/**
* Transfer ItemStack from Player's main hand to target Player.
*
* @param from from Player
* @param to to Player
*/
public static void transferItemStackToDifferentPlayer(Player from, Player to) {
ItemStack itemStack = from.getInventory().getItemInMainHand().clone();
to.getInventory().addItem(itemStack);
from.getInventory().getItemInMainHand().setAmount(0);
}
/**
* Reduce the number of item in hand by 1.
*
* @param player target player
*/
public static void reduceItemStackInPlayersHand(Player player) {
player.getInventory().getItemInMainHand().setAmount(
player.getInventory().getItemInMainHand().getAmount() - 1);
}
}
|
05bb0c66-53dd-4c13-8383-226ea335e805
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-06 16:05:31", "repo_name": "marinjurisich/CovidPortal", "sub_path": "/src/main/java/ekrani/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "1fdb80ea6d294d0b07a01b3af61ff5dc74ca5672", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/marinjurisich/CovidPortal
| 216
|
FILENAME: Main.java
| 0.250913
|
package main.java.ekrani;
import hr.java.covidportal.model.Simptom;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
* Main klasa JavaFX-a
*/
public class Main extends Application {
private static Stage mainStage;
@Override
public void start(Stage primaryStage) throws Exception{
mainStage = primaryStage;
Parent root = FXMLLoader.load(getClass().getClassLoader().getResource("pocetniEkran.fxml"));
primaryStage.setTitle("CovidPortal");
primaryStage.setScene(new Scene(root, 768, 432));
primaryStage.show();
}
public static Stage getMainStage() {
return mainStage;
}
public static void setMainStage(Stage newStage) {
mainStage = newStage;
}
public static void setNewScene(Scene scene) {
mainStage.setScene(scene);
}
public static void main(String[] args) {
launch(args);
}
}
|
5ec95e80-6d10-44c4-9beb-ca1cf1969618
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-02 21:05:03", "repo_name": "jashangunike/Selenium-with-Java-basic", "sub_path": "/SeleniumJava/src/SeleniumTutorial/parentChild.java", "file_name": "parentChild.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "cbb3ffa2bb6095c8a93158b37eb99db93f959392", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jashangunike/Selenium-with-Java-basic
| 207
|
FILENAME: parentChild.java
| 0.243642
|
package SeleniumTutorial;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.Iterator;
import java.util.Set;
public class parentChild {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "H:\\software\\Selenium & Java & Components\\drivers\\geckodriver\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("https://register.rediff.com/commonreg/index.php");
driver.findElement(By.xpath("/html/body/div/form/table/tbody/tr[20]/td[2]/a[1]")).click();
System.out.println(driver.getTitle());
Set <String> ids = driver.getWindowHandles();
Iterator<String> it = ids.iterator();
String parentId = it.next();
String childID = it.next();
driver.switchTo().window(childID);
System.out.println(driver.getTitle());
}
}
|
f854e117-4789-4c80-b904-2a404327104a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-17 02:46:44", "repo_name": "ThalliumDZN/StardewValley-1.16.5", "sub_path": "/src/main/java/com/thallium/sdvm/blocks/selling_block/SellingBlockGui.java", "file_name": "SellingBlockGui.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "d1f0de458cd9d224a968c1003527ddd31c2e08ba", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/ThalliumDZN/StardewValley-1.16.5
| 248
|
FILENAME: SellingBlockGui.java
| 0.294215
|
package com.thallium.sdvm.blocks.selling_block;
import com.thallium.sdvm.registry.ModScreens;
import io.github.cottonmc.cotton.gui.SyncedGuiDescription;
import io.github.cottonmc.cotton.gui.widget.WGridPanel;
import io.github.cottonmc.cotton.gui.widget.WItemSlot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.screen.ScreenHandlerContext;
import net.minecraft.screen.ScreenHandlerType;
public class SellingBlockGui extends SyncedGuiDescription
{
private static final int INVENTORY_SIZE = 1;
public SellingBlockGui(int syncId, PlayerInventory inventory, ScreenHandlerContext context)
{
super(ModScreens.SELL_BLOCK, syncId, inventory, getBlockInventory(context, 1), getBlockPropertyDelegate(context));
WGridPanel root = new WGridPanel();
setRootPanel(root);
root.setSize(300, 200);
WItemSlot itemSlot = WItemSlot.of(blockInventory, 0);
root.add(itemSlot, 4, 1);
root.add(this.createPlayerInventoryPanel(), 0, 3);
root.validate(this);
}
}
|
1b8ed55b-fade-475e-90a6-61105893b38b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-08-13T15:23:47", "repo_name": "ampize/docs", "sub_path": "/content/docs/components/jwplayer.md", "file_name": "jwplayer.md", "file_ext": "md", "file_size_in_byte": 1034, "line_count": 34, "lang": "en", "doc_type": "text", "blob_id": "efd8528c9008e3693b0bc8c34a7be876646cca27", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ampize/docs
| 316
|
FILENAME: jwplayer.md
| 0.23092
|
---
$title@: JW Player
$category: Media
$order: 345
components:
- jwplayer
isDraft: 0
$date: 2014-03-17
$dates:
published: 2014-03-17
description: >
Displays a cloud-hosted JW Player.
href: /docs/components/jwplayer
---
<p>The JW Player component displays a cloud-hosted JW Player.</p>
<amp-jwplayer data-playlist-id="482jsTAr"
data-player-id="uoIbMPm3"
layout="responsive"
width="16"
height="9">
</amp-jwplayer>
<h2 class="mt4 mb4">Settings</h2>
<h3 class="mb3 mt3">Mode</h3>
- Media
- Playlist
<h3 class="mb3 mt3">Player ID</h3>
The JW Platform player id. This is an 8-digit alphanumeric sequence that can be found in the Players section in your JW Player Dashboard.
<h3 class="mb3 mt3">Media ID</h3>
The JW Platform media id. This is an 8-digit alphanumeric sequence that can be found in the Content section in your JW Player Dashboard.
<h3 class="mb3 mt3">Sharing</h3>
The JW Platform playlist id. This is an 8-digit alphanumeric sequence that can be found in the Playlists section in your JW Player Dashboard.
|
64a708d7-c3c3-4fa1-b60a-13495e94b62b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-08-05 10:05:45", "repo_name": "ChenYiXiao/CEClient", "sub_path": "/CEClient/src/cewedo/others/Global.java", "file_name": "Global.java", "file_ext": "java", "file_size_in_byte": 1242, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "0b33b1485a62e0c1b97b9f461385c7965107d128", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "GB18030"}
|
https://github.com/ChenYiXiao/CEClient
| 294
|
FILENAME: Global.java
| 0.293404
|
package cewedo.others;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
/**全局变量类,该类存放一些全局变量
* @author CYX
*
*/
public class Global {
private static String mSkinName="";
private static String mSkinPackageName="" ;
private static List<Activity> mCurrentAcitivities=new ArrayList<Activity>();
/**
* @return the skinName
*/
public static String getSkinName() {
return mSkinName;
}
/**
* @param skinName the skinName to set
*/
public static void setSkinName(String skinName) {
mSkinName = skinName;
}
/**
* @return the skinPackageName
*/
public static String getSkinPackageName() {
return mSkinPackageName;
}
/**
* @param skinPackageName the skinPackageName to set
*/
public static void setSkinPackageName(String skinPackageName) {
mSkinPackageName = skinPackageName;
}
/**
* @return the currentAcitivities
*/
public static List<Activity> getCurrentAcitivities() {
return mCurrentAcitivities;
}
/**
* @param currentAcitivities the currentAcitivities to set
*/
public static void setCurrentAcitivities(List<Activity> currentAcitivities) {
mCurrentAcitivities = currentAcitivities;
}
}
|
5ad793fd-6c5a-4384-8ee6-6865107eaf7f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-03-17 13:49:57", "repo_name": "bndly/bndly-commons", "sub_path": "/html/src/main/java/org/bndly/common/html/Tag.java", "file_name": "Tag.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "d628bbe955288bb2e2bec48070a7dc5fa5b8739a", "star_events_count": 1, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/bndly/bndly-commons
| 296
|
FILENAME: Tag.java
| 0.285372
|
package org.bndly.common.html;
/*-
* #%L
* HTML
* %%
* Copyright (C) 2013 - 2020 Cybercon GmbH
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
/**
*
* A HTML tag may contain further content. It is closed by a separate closing
* tag. For example <foo></foo>.
*
* @author cybercon <bndly@cybercon.de>
*/
public final class Tag extends AbstractTag implements ContentContainer {
private List<Content> content;
public Tag(ContentContainer parent) {
super(parent);
}
@Override
public final List<Content> getContent() {
return content;
}
public final void setContent(List<Content> content) {
this.content = content;
}
}
|
27ab63a8-7aad-4b4a-8f07-5559eebacfac
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-19 16:27:44", "repo_name": "Archer6621/TestPlugin", "sub_path": "/src/main/java/com/aquanova_mp/Homes/NameID.java", "file_name": "NameID.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "c3fd0d7204f044dd7c09fce122c516e37af6d024", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/Archer6621/TestPlugin
| 244
|
FILENAME: NameID.java
| 0.261331
|
package com.aquanova_mp.Homes;
import org.bukkit.entity.Player;
import java.util.Objects;
/**
* Created by Archer on 30-Mar-16.
*/
public class NameID {
private String name;
private String id;
public NameID(String name, String id){
this.name = name;
this.id = id;
}
public NameID(Player player){
this.name = player.getName();
this.id = player.getUniqueId().toString();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof NameID)) return false;
NameID nameID = (NameID) o;
return Objects.equals(name, nameID.name) &&
Objects.equals(id, nameID.id);
}
@Override
public int hashCode() {
return Objects.hash(name, id);
}
}
|
48ca6036-630e-4e3f-b2a3-1774ca46e88a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2010-05-17 14:23:55", "repo_name": "ngothachlam/devlead-tool", "sub_path": "/src/com/jonas/agile/devleadtool/gui/component/table/editor/CheckBoxTableCellEditor.java", "file_name": "CheckBoxTableCellEditor.java", "file_ext": "java", "file_size_in_byte": 1224, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "43c57e8c99b4c0c060b61d4bd2394caa9a29ec99", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ngothachlam/devlead-tool
| 244
|
FILENAME: CheckBoxTableCellEditor.java
| 0.289372
|
package com.jonas.agile.devleadtool.gui.component.table.editor;
import java.awt.Component;
import javax.swing.DefaultCellEditor;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import org.apache.log4j.Logger;
import com.jonas.common.logging.MyLogger;
public class CheckBoxTableCellEditor extends DefaultCellEditor implements MyEditor {
private int rowEdited;
private int colEdited;
private final JCheckBox box;
private Logger log = MyLogger.getLogger(CheckBoxTableCellEditor.class);
public CheckBoxTableCellEditor(JCheckBox box) {
super(box);
this.box = box;
this.box.setHorizontalAlignment(SwingConstants.CENTER);
}
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col) {
rowEdited = row;
colEdited = col;
return super.getTableCellEditorComponent(table, value, isSelected, row, col);
}
public Object getValue() {
return box.getText();
}
public int getRowEdited() {
return rowEdited;
}
public int getColEdited() {
return colEdited;
}
}
|
cbd30f47-8bf7-4286-b93a-7f771f26acd0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-20 17:30:06", "repo_name": "LukeKan/middleware-akka", "sub_path": "/src/main/java/com/polimi/mailing_network/client/ClientActor.java", "file_name": "ClientActor.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "df7a0dbb2623811aa2711459b7272db27c2a6c9f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/LukeKan/middleware-akka
| 250
|
FILENAME: ClientActor.java
| 0.267408
|
package com.polimi.mailing_network.client;
import akka.actor.AbstractActor;
import akka.actor.ActorSelection;
import akka.actor.Props;
import com.polimi.mailing.GetMessage;
import com.polimi.mailing.PutMessage;
import com.polimi.mailing_network.DefaultMessage;
import com.polimi.mailing_network.ServerMessage;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ClientActor extends AbstractActor {
private final String clientLog= "[ClientActor]: ";;
@Override
public Receive createReceive() {
return receiveBuilder()
.match(ServerMessage.class, this::onServerMessage)
.match(DefaultMessage.class, this::onDefault)
.build();
}
public void onServerMessage(ServerMessage msg) {
System.out.println(clientLog+msg.getName());
}
public void onDefault(DefaultMessage defaultMessage){
String serverAddr = "akka://server@127.0.0.1:2552/user/server-actor";
ActorSelection server = context().actorSelection(serverAddr);
server.tell(defaultMessage, this.getSelf());
}
static Props props() {
return Props.create(ClientActor.class);
}
}
|
c3892139-c78d-4902-84bd-cfc3e8606497
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-03-02 08:38:43", "repo_name": "bodii/test-code", "sub_path": "/java/java_core_technology_first_volume/chapter12/dialog/DialogFrame.java", "file_name": "DialogFrame.java", "file_ext": "java", "file_size_in_byte": 1091, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "560af3ce7028a8a1e8225da1099dd1b5171b08ec", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/bodii/test-code
| 220
|
FILENAME: DialogFrame.java
| 0.290176
|
package dialog;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
/**
* A frame with a menu whose File->Abot action show a dialog.
*/
public class DialogFrame extends JFrame {
private static final int DEFAULT_WIDTH = 300;
private static final int DEFAULT_HEIGHT = 200;
private AboutDialog dialog;
public DialogFrame() {
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu fileMenu = new JMenu("File");
menuBar.add(fileMenu);
JMenuItem aboutItem = new JMenuItem("About");
aboutItem.addActionListener(
event -> {
if (dialog == null)
dialog = new AboutDialog(DialogFrame.this);
dialog.setVisible(true);
}
);
fileMenu.add(aboutItem);
JMenuItem exitItem = new JMenuItem("Exit");
exitItem.addActionListener(
event -> System.exit(0)
);
fileMenu.add(exitItem);
}
}
|
92fd8c85-5f82-4c2c-ad05-6971c080d1fc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-04 08:14:31", "repo_name": "Catfeeds/myWorkspace", "sub_path": "/hljcommonlibrary/src/main/java/com/hunliji/hljcommonlibrary/models/realm/PostAnswerBody.java", "file_name": "PostAnswerBody.java", "file_ext": "java", "file_size_in_byte": 1129, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "25b7d1e1eacf2b3291a7f34d8766c60b36650db0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Catfeeds/myWorkspace
| 246
|
FILENAME: PostAnswerBody.java
| 0.242206
|
package com.hunliji.hljcommonlibrary.models.realm;
import com.google.gson.annotations.SerializedName;
import io.realm.RealmObject;
import io.realm.annotations.RealmClass;
/**
* Created by Suncloud on 2016/8/31.
*/
@RealmClass
public class PostAnswerBody extends RealmObject {
@SerializedName("answer_id")
private Long answerId;
@SerializedName("question_id")
private Long questionId;
private String content;
private Long userId;
public PostAnswerBody(){}
public PostAnswerBody(long userId,long questionId,String content) {
this.questionId = questionId;
this.userId=userId;
this.content = content;
}
public Long getAnswerId() {
return answerId;
}
public void setAnswerId(Long answerId) {
this.answerId = answerId;
}
public void setQuestionId(Long questionId) {
this.questionId = questionId;
}
public void setContent(String content) {
this.content = content;
}
public String getContent() {
return content;
}
public Long getQuestionId() {
return questionId;
}
}
|
7982b2a2-b1b7-4c5c-a6aa-406c730eeeb0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-26 19:18:22", "repo_name": "michael-sandy-walker/walker_productions2", "sub_path": "/HabitabberV2/src/result/SourceElement.java", "file_name": "SourceElement.java", "file_ext": "java", "file_size_in_byte": 1225, "line_count": 73, "lang": "en", "doc_type": "code", "blob_id": "9b7da390be43062b6bf6719a7f7e9ca5d08d4cd3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/michael-sandy-walker/walker_productions2
| 314
|
FILENAME: SourceElement.java
| 0.278257
|
package result;
import java.util.LinkedHashMap;
import java.util.Map;
public class SourceElement {
private String url;
private String title;
private String alt;
private Map<String, String> otherAttributes = new LinkedHashMap<>();
public SourceElement() {
}
public SourceElement(String url, String title, String alt) {
this.url = url;
this.title = title;
this.alt = alt;
}
/**
* @return the url
*/
public String getUrl() {
return url;
}
/**
* @param url the url to set
*/
public void setUrl(String url) {
this.url = url;
}
/**
* @return the title
*/
public String getTitle() {
return title;
}
/**
* @param title the title to set
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return the alt
*/
public String getAlt() {
return alt;
}
/**
* @param alt the alt to set
*/
public void setAlt(String alt) {
this.alt = alt;
}
/**
* @return the otherAttributes
*/
public Map<String, String> getOtherAttributes() {
return otherAttributes;
}
/**
* @param otherAttributes the otherAttributes to set
*/
public void setOtherAttributes(Map<String, String> otherAttributes) {
this.otherAttributes = otherAttributes;
}
}
|
d4df1818-a21d-449d-9cc8-2be5384f1e22
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-23 06:28:36", "repo_name": "timea12345/AnimalAdoption", "sub_path": "/src/main/java/com/sda/animal_adoption/service/DonationService.java", "file_name": "DonationService.java", "file_ext": "java", "file_size_in_byte": 1030, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "c06e9eb7d694c46c39087eba8b6a5f6a1cbf5324", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/timea12345/AnimalAdoption
| 194
|
FILENAME: DonationService.java
| 0.253861
|
package com.sda.animal_adoption.service;
import com.sda.animal_adoption.dao.donation.DonationRepository;
import com.sda.animal_adoption.model.Contract;
import com.sda.animal_adoption.model.Donation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class DonationService {
private DonationRepository donationRepository;
@Autowired
public DonationService(DonationRepository donationRepository) {
this.donationRepository = donationRepository;
}
public void save(Donation donation) {
donationRepository.save(donation);
}
public void delete(Integer id) {
donationRepository.delete(findById(id));
}
public Donation findById(Integer id) {
return donationRepository.findById(id)
.orElseThrow(() -> new NullPointerException("Donation not found!"));
}
public List<Donation> findAll() {
return donationRepository.findAll();
}
}
|
8d9308fe-744a-4c6b-9950-a4e11023feb5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-24 07:00:55", "repo_name": "stefashkaa/MusicShop", "sub_path": "/src/main/java/music_shop/dao/DAO.java", "file_name": "DAO.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "1abb06f75b047175a231fe0368d5d19f3a73462a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/stefashkaa/MusicShop
| 197
|
FILENAME: DAO.java
| 0.239349
|
package music_shop.dao;
import java.sql.Connection;
import java.util.Properties;
public abstract class DAO {
protected String driver = null;
protected String url = null;
protected Properties properties = null;
public DAO(String driver) {
this.driver = driver;
}
protected void registerDriverManager() {
try {
Class.forName(driver).newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
public abstract void setURL(String host, String database, int port);
public abstract Connection getConnection();
public void connect(String login, String password) {
registerDriverManager();
properties = new Properties();
properties.setProperty("password", password);
properties.setProperty("user", login);
properties.setProperty("useUnicode", "true");
properties.setProperty("characterEncoding", "utf8");
}
}
|
eb2250cf-2312-440b-8df6-5aa1d22e8b9a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-11 13:41:55", "repo_name": "lw9391/blockchain_repo", "sub_path": "/src/main/java/blockchain/serialization/TransactionSerializer.java", "file_name": "TransactionSerializer.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "9f71ff45cfbddad80937172700cf998bcc66d241", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lw9391/blockchain_repo
| 200
|
FILENAME: TransactionSerializer.java
| 0.255344
|
package blockchain.serialization;
import blockchain.core.SignedTransaction;
import blockchain.encryption.EncryptionUtils;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import java.lang.reflect.Type;
public class TransactionSerializer implements JsonSerializer<SignedTransaction> {
@Override
public JsonElement serialize(SignedTransaction src, Type typeOfSrc, JsonSerializationContext context) {
JsonObject transactionJson = new JsonObject();
transactionJson.addProperty("sender", src.getTransaction().getSender());
transactionJson.addProperty("receiver", src.getTransaction().getReceiver());
transactionJson.addProperty("amount", src.getTransaction().getAmount());
transactionJson.addProperty("Timestamp", src.getTimestamp());
String publicKey = EncryptionUtils.encodeIntoHex(src.getPublicKey());
String signature = EncryptionUtils.encodeIntoHex(src.getSignature());
transactionJson.addProperty("Signature", signature);
transactionJson.addProperty("PublicKey", publicKey);
return transactionJson;
}
}
|
7b924776-0579-4b7d-bb03-966ae210bec2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-23 20:16:42", "repo_name": "Bobberclobber/old-repos", "sub_path": "/dungeons-v2/src/character_actions/ShootAction.java", "file_name": "ShootAction.java", "file_ext": "java", "file_size_in_byte": 1040, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "5110c380f01554bc6dca42bbdae58489355ba171", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Bobberclobber/old-repos
| 261
|
FILENAME: ShootAction.java
| 0.264358
|
package se.liu.ida.josfa969.dungeonsv2.character_actions;
import se.liu.ida.josfa969.dungeonsv2.dungeon_interfaces.CharacterAction;
import se.liu.ida.josfa969.dungeonsv2.dungeon_objects.PlayerCharacter;
import se.liu.ida.josfa969.dungeonsv2.enums.Direction;
import se.liu.ida.josfa969.dungeonsv2.help_classes.Constants;
/**
* Created by Josef on 05/05/2014.
* <p/>
* A CharacterAction used to make the given character fire in the given direction
*
* @see se.liu.ida.josfa969.dungeonsv2.dungeon_interfaces.CharacterAction
*/
public class ShootAction implements CharacterAction {
private PlayerCharacter playerCharacter;
private Direction direction;
public ShootAction(PlayerCharacter playerCharacter, Direction direction) {
this.playerCharacter = playerCharacter;
this.direction = direction;
}
@Override
public void perform() {
playerCharacter.shoot(direction);
}
@Override
public int getUpdateRate() {
return Constants.CHARACTER_STANDARD_SHOOTING_RATE;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.