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
|
|---|---|---|---|---|---|---|
7a5a4851-f4f2-4fde-8592-963f4cb5de6b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-06-04 18:43:20", "repo_name": "jbrionne/lxc-java-control", "sub_path": "/operation-core/src/main/java/fr/operation/core/command/DisplayStream.java", "file_name": "DisplayStream.java", "file_ext": "java", "file_size_in_byte": 1005, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "8e09385f1e8ba4938bee41ac601a6bc793d14f8e", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jbrionne/lxc-java-control
| 212
|
FILENAME: DisplayStream.java
| 0.262842
|
package fr.operation.core.command;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.concurrent.Callable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
class DisplayStream implements Callable<String> {
private static final Logger LOG = LoggerFactory
.getLogger(DisplayStream.class);
private final InputStream inputStream;
public DisplayStream(InputStream inputStream) {
this.inputStream = inputStream;
}
@Override
public String call() throws Exception {
String ligne = "";
StringBuilder sB = new StringBuilder();
try (BufferedReader br = new BufferedReader(new InputStreamReader(
(inputStream)));) {
int i = 0;
while ((ligne = br.readLine()) != null) {
LOG.info("- " + ligne);
sB.append(ligne).append(System.lineSeparator());
i++;
}
} catch (IOException e) {
LOG.error(ligne, e);
Thread.currentThread().interrupt();
}
return sB.toString();
}
}
|
5ffccaad-cecc-41e4-ad2f-6d470f55cca3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-16 03:46:46", "repo_name": "ujwalagawari/SpringMvcmmBank", "sub_path": "/src/main/java/com/moneymoney/validation/AccountValidation.java", "file_name": "AccountValidation.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "e315e8ebe7516e086ea54c1705a19befc91dc19b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ujwalagawari/SpringMvcmmBank
| 225
|
FILENAME: AccountValidation.java
| 0.26971
|
/**
*
*/
package com.moneymoney.validation;
import java.util.regex.Pattern;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
import com.moneymoney.pojo.account.SavingsAccount;
/**
* @author ugawari
*
*/
@Component
public class AccountValidation implements Validator {
@Override
public boolean supports(Class<?> clazz) {
return false;
}
@Override
public void validate(Object target, Errors errors) {
SavingsAccount account = (SavingsAccount) target;
if (account.getBankAccount().getAccountBalance() < 500) {
errors.rejectValue("bankAccount.accountBalance", "bankAccount.accountBalance.minimum",
"Balance should not be less then 500.");
}
if (!Pattern.matches("^[a-zA-Z]+$", account.getBankAccount().getAccountHolderName())) {
errors.rejectValue("bankAccount.accountHolderName", "bankAccount.accountHolderName.alphanumeric",
"Name should not contain special char and numbers.");
}
}
}
|
9a76720b-df2b-4498-925e-0b3823c23925
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-05-02 21:14:48", "repo_name": "erica-banda-03/BuffBear", "sub_path": "/Gymsense/src/gymsense/RegisterUserServlet.java", "file_name": "RegisterUserServlet.java", "file_ext": "java", "file_size_in_byte": 1147, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "df8f3fbfdeaf48d0b7b88b8464080d976c2a9bef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/erica-banda-03/BuffBear
| 198
|
FILENAME: RegisterUserServlet.java
| 0.252384
|
package gymsense;
import gymsense.dao.GymsenseDAO;
import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
public class RegisterUserServlet extends HttpServlet{
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
String firstName = req.getParameter("firstName");
String lastName = req.getParameter("lastName");
String email = req.getParameter("email");
String password = req.getParameter("password");
// String confirmPassword = req.getParameter("confirmPassword");
String workoutType = req.getParameter("workout");
GymsenseDAO.INSTANCE.add(firstName, lastName, email, password, workoutType);
resp.sendRedirect("/home.jsp");
}
}
|
3fd72b78-2b6c-4a02-a21d-4a73b7c543c9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-19 04:13:11", "repo_name": "Github-Benjamin/shop", "sub_path": "/shop/src/cn/benjamin/shop/interceptor/PrivilegeInterceptor.java", "file_name": "PrivilegeInterceptor.java", "file_ext": "java", "file_size_in_byte": 1198, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "1e24319bfcf0aec8542309af7d66d75a9d19b877", "star_events_count": 3, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/Github-Benjamin/shop
| 249
|
FILENAME: PrivilegeInterceptor.java
| 0.252384
|
package cn.benjamin.shop.interceptor;
import cn.benjamin.shop.adminuser.vo.AdminUser;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import org.apache.struts2.ServletActionContext;
/**
* Created by Benjamin on 2019/4/17.
*/
public class PrivilegeInterceptor extends MethodFilterInterceptor {
@Override
// 执行拦截的方法
protected String doIntercept(ActionInvocation actionInvocation) throws Exception {
// 判断session中是否保存了用户逇信息
AdminUser existAdminUser =(AdminUser) ServletActionContext.getRequest().getSession().getAttribute("existAdminUser");
if( existAdminUser == null ){
// 没有登录进行访问
ActionSupport actionSupport =(ActionSupport) actionInvocation.getAction();
actionSupport.addActionError("亲!您还没有登录!没有权限访问!");
return "loginFail";
// 跳转到login action
// return ActionSupport.LOGIN;
} else {
// 已登录过
return actionInvocation.invoke();
}
}
}
|
dd9af623-fda5-489e-befe-1de5582ffe9f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-04 19:12:03", "repo_name": "andres0219/SFAutomatizacionCO", "sub_path": "/AutomatizacionSuccesFactors/src/test/java/PruebaSF/AutomatizacionSuccesFactors/AppTest.java", "file_name": "AppTest.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "9cf08b9e3f885e7e43020d01af44f409d5f0c0fe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/andres0219/SFAutomatizacionCO
| 276
|
FILENAME: AppTest.java
| 0.282196
|
package PruebaSF.AutomatizacionSuccesFactors;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class AppTest
{
public void loginSF(WebDriver driver) {
String base = "https://salesdemo4.successfactors.com/"
+ "login?company=SFPRO000035&bplte_logout=1&_"
+ "s.crb=pwn2KZuIhzExxDNvYUYkVW5HZ30%253d#/login";
driver.get(base);
driver.manage().window().maximize();
WebElement insertarE = driver.findElement(By.id("__input1-inner"));
insertarE.sendKeys("sfadmin");
WebElement insertarP = driver.findElement(By.id("__input2-inner"));
insertarP.sendKeys("part1705DC4");
}
public void Complemento(WebDriver driver) {
WebElement button = driver.findElement(By.id("__button2-content"));
button.click();
WebElement Desarrollo = driver.findElement(By.xpath("//div[contains(@class,'admLinksSprite dev')]"));
Desarrollo.click();
WebElement Gestion = driver.findElement(By.xpath("//a[@id='94_']"));
Gestion.click();
}
}
|
6254f192-cf6c-4841-a94f-6dbda9abc954
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-13 15:06:48", "repo_name": "karesti/protobuf-marshalling-guide", "sub_path": "/marshalling-with-spring-boot/src/main/java/org/fantastic/ReadWriteSimulation.java", "file_name": "ReadWriteSimulation.java", "file_ext": "java", "file_size_in_byte": 1009, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "100759432e2902910af3b2a4bf7368231370580f", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/karesti/protobuf-marshalling-guide
| 198
|
FILENAME: ReadWriteSimulation.java
| 0.273574
|
package org.fantastic;
import org.fantastic.data.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.lang.invoke.MethodHandles;
@Component
public class ReadWriteSimulation {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private final PersonalShoppersRepository repository;
@Autowired
public ReadWriteSimulation(PersonalShoppersRepository repository) {
this.repository = repository;
}
@Scheduled(fixedDelay = 1000)
public void createPersonalShopper() {
this.repository.create(Data.getRandomPersonalShopper());
}
@Scheduled(fixedDelay = 1000)
public void retrievePersonalShopper() {
logger.info("The Personal Shopper was found " + this.repository.findById(Data.getRandomPersonalShopper().getId()));
}
}
|
032526f8-21d4-4317-bbf2-ac3377ef6881
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-02 06:22:37", "repo_name": "maheswaranapk/Android-Loading-Google-Concept", "sub_path": "/app/src/main/java/com/scriptedpapers/androidloadinggoogleconcept/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "c1efb8ff40865276ae8e617c7daf97b05c465594", "star_events_count": 13, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/maheswaranapk/Android-Loading-Google-Concept
| 203
|
FILENAME: MainActivity.java
| 0.23793
|
package com.scriptedpapers.androidloadinggoogleconcept;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import com.googleloading.LoadingView;
public class MainActivity extends AppCompatActivity {
LoadingView loadingView;
Button startButton;
Button stopButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
loadingView = (LoadingView) findViewById(R.id.loadingView);
startButton = (Button) findViewById(R.id.startButton);
stopButton = (Button) findViewById(R.id.stopButton);
startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
loadingView.setCurrentMode(LoadingView.START_MODE);
}
});
stopButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
loadingView.setCurrentMode(LoadingView.STOP_MODE);
}
});
}
}
|
8cfa718c-2162-47de-acf0-e6d4203db65a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-09 10:24:04", "repo_name": "sharesss/KWAPP", "sub_path": "/app/src/main/java/widget/popup/BaseDoubleEventPopup.java", "file_name": "BaseDoubleEventPopup.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "54f8584bd058ee2e6b4d44c3ccfbbab621d2351d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sharesss/KWAPP
| 195
|
FILENAME: BaseDoubleEventPopup.java
| 0.286968
|
package widget.popup;
import android.app.Activity;
import android.widget.Button;
/**
* @author meteorshower
* Double Click Event
*/
public abstract class BaseDoubleEventPopup extends BaseEventPopup {
protected Button btnDoubleEvent;
protected OnDoubleEventClickListener doubleEventListener;
public BaseDoubleEventPopup(Activity context) {
super(context);
findDoubleEventByID();
}
public abstract void findDoubleEventByID();
public void setDoubleEventText(int resources){
btnDoubleEvent.setText(resources);
}
public void setDoubleEventText(String value){
btnDoubleEvent.setText(value);
}
public void setDoubleEventColor(int color){
btnDoubleEvent.setTextColor(getContext().getResources().getColor(color));
}
public void setOnDoubleEventClickListener(OnDoubleEventClickListener listener){
this.doubleEventListener = listener;
}
public interface OnDoubleEventClickListener{
public void onDoubleEventClick(PopupObject obj);
}
}
|
f12ef9e8-a4b6-40c6-bf58-d2ed50958622
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-08 01:01:46", "repo_name": "vishaltorgal/HomeWork2-2", "sub_path": "/app/src/main/java/com/example/homework2_2/model/Student.java", "file_name": "Student.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "d6131fb1d03856e088f483629d9656ff414e67ec", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/vishaltorgal/HomeWork2-2
| 221
|
FILENAME: Student.java
| 0.2227
|
package com.example.homework2_2.model;
import java.util.ArrayList;
public class Student {
protected String mCWID;
protected String mFirstName;
protected String mLastName;
protected ArrayList<Vehicle> mVehicle;
public Student(String cwid,String fName, String lName ) {
mFirstName = fName;
mLastName = lName;
mCWID = cwid;
}
public String getFirstName() {
return mFirstName;
}
public void setFirstName(String firstName) {
mFirstName = firstName;
}
public String getLastName() {
return mLastName;
}
public void setLastName(String lastName) {
mLastName = lastName;
}
public String getCWID() {
return mCWID;
}
public void setCWID(String CWID) {
mCWID = CWID;
}
public ArrayList<Vehicle> getVehicle() {
return mVehicle;
}
public void setVehicle(ArrayList<Vehicle> vehicle) {
mVehicle = vehicle;
}
}
|
557dd0db-73a3-43d3-b998-6817ba7fe072
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-11 04:53:47", "repo_name": "AppSecAI-TEST/awaker", "sub_path": "/app/src/main/java/com/future/awaker/network/AwakerClient.java", "file_name": "AwakerClient.java", "file_ext": "java", "file_size_in_byte": 1014, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "b74be686091dec44c60a790385fd9d3fd9166f5d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AppSecAI-TEST/awaker
| 192
|
FILENAME: AwakerClient.java
| 0.256832
|
package com.future.awaker.network;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Copyright ©2017 by Teambition
*/
public final class AwakerClient {
private static final String HOST = "http://www.awaker.cn/api/";
private static AwakerApi api;
private AwakerClient() {
}
public static AwakerApi get() {
if (api == null) {
synchronized (AwakerClient.class) {
if (api == null) {
Retrofit client = new Retrofit.Builder().baseUrl(HOST)
.client(HttpClient.getHttpClient())
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
api = client.create(AwakerApi.class);
}
}
}
return api;
}
}
|
9bdc8d90-19eb-4659-afcc-399d3a2b353a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-11-03 13:48:55", "repo_name": "wayne06/em-sys", "sub_path": "/em/src/main/java/xyz/qzpx/em/controller/NewsController.java", "file_name": "NewsController.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "033e36dfe0ea4c3b6ee316dd23e632a4b8d49dbd", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wayne06/em-sys
| 218
|
FILENAME: NewsController.java
| 0.247987
|
package xyz.qzpx.em.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import xyz.qzpx.em.dataObject.NewsDO;
import xyz.qzpx.em.service.NewsService;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping("/api/news")
public class NewsController {
@Autowired
private NewsService newsService;
@PostMapping("/add")
public void add(@RequestBody NewsDO newsDO) {
newsService.add(newsDO);
}
@PostMapping("/del")
public void del(@RequestBody NewsDO newsDO) {
newsService.del(newsDO);
}
@PostMapping("/update")
public void update(@RequestBody NewsDO newsDO) {
newsService.update(newsDO);
}
@GetMapping("/all")
public List<NewsDO> all() {
return newsService.getAll();
}
@GetMapping("/allForHomepage")
public List<NewsDO> allForHomepage() {
return newsService.allForHomepage();
}
}
|
0d77e7cd-5eaf-4a8f-b797-e37243432ea8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-08 00:41:51", "repo_name": "Linxianghang/walkbookstore", "sub_path": "/sc-provider/sc-xzsd-app/src/main/java/com/xzsd/app/clientinformation/service/ClientService.java", "file_name": "ClientService.java", "file_ext": "java", "file_size_in_byte": 1259, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "5f25ca539bf33820bf711f37eb2e94b7fb2a585b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Linxianghang/walkbookstore
| 279
|
FILENAME: ClientService.java
| 0.262842
|
package com.xzsd.app.clientinformation.service;
import com.neusoft.core.restful.AppResponse;
import com.xzsd.app.clientinformation.dao.ClientDao;
import com.xzsd.app.clientinformation.entity.ClientInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* ClientService
* @author linxianghang
* @date 2020-04-27
*/
@Service
public class ClientService {
@Resource
private ClientDao clientDao;
/**
* 修改邀请码
* @param clientInfo
* @return
* @author linxianghang
* @date 2020-04-27
*/
@Transactional(rollbackFor = Exception.class)
public AppResponse updateClientInvite(ClientInfo clientInfo){
//判断输入的邀请码是否存在
int inviteCode = clientDao.countStoreInviteCode(clientInfo);
if(0 == inviteCode){
return AppResponse.versionError("你输入的门店邀请码不存在,请输入正确的邀请码");
}
int count = clientDao.updateClientInvite(clientInfo);
if(0 == count){
return AppResponse.versionError("修改邀请码失败");
}
return AppResponse.success("修改邀请码成功");
}
}
|
483378c1-4cfb-420b-bde9-faf3cbc9175f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-31 16:39:40", "repo_name": "giveachance/mpg", "sub_path": "/src/main/java/com/hqh/mp/beans/Department.java", "file_name": "Department.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "c298a6f685b66c8d59310347fa0920a9881ad433", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/giveachance/mpg
| 264
|
FILENAME: Department.java
| 0.249447
|
package com.hqh.mp.beans;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author hqh
* @since 2018-08-31
*/
@TableName("tbl_department")
public class Department extends Model<Department> {
private static final long serialVersionUID = 1L;
@TableId(value = "dept_id", type = IdType.AUTO)
private Integer deptId;
private String departmentName;
public Integer getDeptId() {
return deptId;
}
public void setDeptId(Integer deptId) {
this.deptId = deptId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
@Override
protected Serializable pkVal() {
return this.deptId;
}
@Override
public String toString() {
return "Department{" +
", deptId=" + deptId +
", departmentName=" + departmentName +
"}";
}
}
|
4f50c98c-150c-48b1-9ae9-a2b357944b1e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-26 02:51:49", "repo_name": "yongkanghuang/basics", "sub_path": "/src/main/java/com/basics/rabbitmq/producer/MqSender.java", "file_name": "MqSender.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "f78318f88f41398bfe7ea6ddb8b9714a473398d4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yongkanghuang/basics
| 222
|
FILENAME: MqSender.java
| 0.193147
|
package com.basics.rabbitmq.producer;
import com.basics.rabbitmq.entity.Message;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @Description mq生产者
* @Author hyk
* @Date 2019/2/17 21:50
**/
@Slf4j
@Component
public class MqSender {
@Autowired
private RabbitTemplate rabbitTemplate;
public void messageSender(Message message){
}
final RabbitTemplate.ConfirmCallback confirmCallback = new RabbitTemplate.ConfirmCallback() {
@Override
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
log.info(" 回调id:" + correlationData);
if (ack) {
log.info("消息成功消费");
} else {
log.info("消息消费失败:" + cause);
}
}
};
}
|
f60bbe95-4a42-45bf-ba5e-d6df9a23f36c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-14T09:34:18", "repo_name": "JiaoXR/Reading-Notes", "sub_path": "/codes/TestCode/src/com/jaxer/example/proxy/ProxyTest.java", "file_name": "ProxyTest.java", "file_ext": "java", "file_size_in_byte": 1111, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "5d900a5c0632f89355814a00e96fe13c9ea9b414", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/JiaoXR/Reading-Notes
| 300
|
FILENAME: ProxyTest.java
| 0.286968
|
package com.jaxer.example.proxy;
import com.jaxer.example.proxy.cglib.CglibProxyFactory;
import com.jaxer.example.proxy.jdk.JDKProxyFactory;
/**
* 代码千万行,注释第一行。
* 代理模式测试
* <p>
* Created by jaxer on 2019-07-13
*/
public class ProxyTest {
public static void main(String[] args) {
testStaticProxy();
// testJdkProxy();
// testCglibProxy();
}
/**
* Cglib代理
*/
private static void testCglibProxy() {
UserService userService = new UserServiceImpl();
CglibProxyFactory cglibProxyFactory = new CglibProxyFactory();
UserService proxy = (UserService) cglibProxyFactory.getProxy(userService.getClass());
proxy.save("jack");
}
/**
* JDk动态代理
*/
private static void testJdkProxy() {
UserService userService = new UserServiceImpl();
JDKProxyFactory jdkProxyFactory = new JDKProxyFactory();
UserService proxy = (UserService) jdkProxyFactory.getProxy(userService);
proxy.save("jack");
}
/**
* 静态代理
*/
private static void testStaticProxy() {
UserServiceProxy proxy = new UserServiceProxy();
proxy.save("jack");
}
}
|
9c2c4079-1ccd-4eca-a2bb-960c054e4e1b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-10 12:13:53", "repo_name": "pxiebray/x-framework", "sub_path": "/demo/consumer/src/main/java/com/x/framework/consumer/controller/TestController.java", "file_name": "TestController.java", "file_ext": "java", "file_size_in_byte": 1152, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "829736cba20e138776e106056878f6cac574a41e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pxiebray/x-framework
| 207
|
FILENAME: TestController.java
| 0.246533
|
package com.x.framework.consumer.controller;
import com.x.framework.provider.entity.Product;
import com.x.framework.provider.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/test")
public class TestController {
@Autowired
private ProductService productService;
@GetMapping
public String test() {
// System.out.println(productService.selectAll(1, 5, 0L));
// System.out.println(productService.selectById(1L));
ProductService.Page page = new ProductService.Page();
page.setOffset(100);
page.setLimit(5);
Product filter = new Product();
filter.setCategoryId(2L);
page.setFilter(filter);
page.setSort("-name,description");
productService.selectAllGet(page);
// productService.delete(1L);
// productService.selectById(1L);
return "time " + System.currentTimeMillis();
}
}
|
5466bb82-ab7c-4122-9f92-00f04d30623a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-03 02:16:41", "repo_name": "ronistone/DistributedToggleFeature", "sub_path": "/src/main/java/br/com/ronistone/feature/toggle/autofind/ip/generator/LazyIPGenerator.java", "file_name": "LazyIPGenerator.java", "file_ext": "java", "file_size_in_byte": 977, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "2d8999c0e4b3cbcb5eb1e72186e3c4314f09b886", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ronistone/DistributedToggleFeature
| 197
|
FILENAME: LazyIPGenerator.java
| 0.249447
|
package br.com.ronistone.feature.toggle.autofind.ip.generator;
import br.com.ronistone.feature.toggle.util.IPUtil;
import java.net.InetAddress;
import java.nio.ByteBuffer;
public class LazyIPGenerator extends IPGenerator {
private int beginIp;
private int endIp;
private int currentIp;
public LazyIPGenerator(InetAddress begin, InetAddress end) {
super();
ByteBuffer beginBuffer = ByteBuffer.wrap(begin.getAddress());
ByteBuffer endBuffer = ByteBuffer.wrap(end.getAddress());
beginIp = beginBuffer.getInt();
endIp = endBuffer.getInt();
currentIp = beginIp;
}
@Override
public String next() {
if(currentIp > endIp) {
currentIp = beginIp;
return null;
}
String currentAddress = IPUtil.getIpStringFromInt(currentIp++);
if(localAddresses.contains(currentAddress)){
return next();
}
return currentAddress;
}
}
|
5eb75bfe-e514-4699-87a0-9606f17bf7cb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-20 02:01:29", "repo_name": "dandiiiii/Responsi", "sub_path": "/app/src/main/java/com/example/jean/retrofitexample/model/Book.java", "file_name": "Book.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "ca9f0b23d352a1d1e5e5b22785011545248e318c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dandiiiii/Responsi
| 250
|
FILENAME: Book.java
| 0.216012
|
package com.example.jean.retrofitexample.model;
import com.google.gson.annotations.SerializedName;
public class Book{
@SerializedName("brief")
private static String brief;
@SerializedName("id")
private String id;
@SerializedName("title")
private static String title;
@SerializedName("filesource")
private String filesource;
public void setBrief(String brief){
this.brief = brief;
}
public static String getBrief(){
return brief;
}
public void setId(String id){
this.id = id;
}
public String getId(){
return id;
}
public void setTitle(String title){
this.title = title;
}
public static String getTitle(){
return title;
}
public void setFilesource(String filesource){
this.filesource = filesource;
}
public String getFilesource(){
return filesource;
}
@Override
public String toString(){
return
"Book{" +
"brief = '" + brief + '\'' +
",id = '" + id + '\'' +
",title = '" + title + '\'' +
",filesource = '" + filesource + '\'' +
"}";
}
}
|
d344699d-bff2-49be-aa63-2fda849ce915
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-19 09:15:41", "repo_name": "ax3726/fish_pond", "sub_path": "/app/src/main/java/com/gofishfarm/htkj/base/retrofit/intercept/CacheInterceptor.java", "file_name": "CacheInterceptor.java", "file_ext": "java", "file_size_in_byte": 1258, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "302730213604f4a40cd054c48c204b77c0a6438a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ax3726/fish_pond
| 270
|
FILENAME: CacheInterceptor.java
| 0.258326
|
package com.gofishfarm.htkj.base.retrofit.intercept;
import com.gofishfarm.htkj.utils.AppUtils;
import com.gofishfarm.htkj.utils.NetworkUtils;
import java.io.IOException;
import okhttp3.CacheControl;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
/**
* 设置缓存策略
* author: 康栋普
* date: 2018/5/24
*/
public class CacheInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
if (NetworkUtils.isConnected(AppUtils.getAppContext())) {
//有网络时只从网络获取
request = request.newBuilder()
.cacheControl(CacheControl.FORCE_NETWORK)
.build();
}
Response response = chain.proceed(request);
//设置缓存
if (NetworkUtils.isConnected(AppUtils.getAppContext())) {
//有网络时,设置缓存超时为0
int maxAge = 0;
response = response.newBuilder()
.removeHeader("Pramga")//清除头消息
.header("Cache-Control", "public,max-age=" + maxAge)
.build();
}
return response;
}
}
|
a67ba24a-0b46-4ed7-a1f6-87023b6734f3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-29 08:05:11", "repo_name": "yj970/ARouterDemo", "sub_path": "/app/src/main/java/com/yj/arouterdemo/activity/TestFragmentActivity.java", "file_name": "TestFragmentActivity.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "af5a9d08dbf74f831288d3e5288f843e13e471f0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yj970/ARouterDemo
| 180
|
FILENAME: TestFragmentActivity.java
| 0.214691
|
package com.yj.arouterdemo.activity;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import com.alibaba.android.arouter.launcher.ARouter;
import com.yj.arouterdemo.R;
public class TestFragmentActivity extends android.support.v4.app.FragmentActivity{
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragment);
// 利用路由获取fragment
Fragment fragment = (Fragment) ARouter.getInstance().build("/com/simpleFragment").navigation();
// 填充
FragmentManager manager = getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
transaction.replace(R.id.content, fragment);
transaction.commitAllowingStateLoss();
}
}
|
bbcbb209-e365-4e44-b30a-8d9e744c2873
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-04 18:05:19", "repo_name": "Siwoo-Kim/androidLabForJava", "sub_path": "/app/src/main/java/com/android/siwoo/androidlabforjava/ui/adapter/LabTwo.java", "file_name": "LabTwo.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "3084cdad11d0ce6d8d9eba7a0586e137923249c4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Siwoo-Kim/androidLabForJava
| 210
|
FILENAME: LabTwo.java
| 0.262842
|
package com.android.siwoo.androidlabforjava.ui.adapter;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.*;
import com.android.siwoo.androidlabforjava.R;
public class LabTwo extends AppCompatActivity implements AdapterView.OnItemClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lab_two5);
ListView itemList = findViewById(R.id.item_list);
String[] data = { "Seoul", "Busan", "Toronto", "Vancubur" };
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(this, R.layout.item_list, R.id.item_name, data);
itemList.setAdapter(arrayAdapter);
itemList.setOnItemClickListener(this);
arrayAdapter.notifyDataSetChanged();
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast toast = Toast.makeText(this, view.getId() +":"+position+":"+id +" clicked", Toast.LENGTH_SHORT);
toast.show();
}
}
|
1933f4c4-8eb5-4d11-90fc-3ebd470dbf04
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-25 10:05:55", "repo_name": "paweljaneta/DBbenchmark", "sub_path": "/src/main/java/pl/polsl/paweljaneta/databasebenchmark/model/sql/entities/SqlTransaction.java", "file_name": "SqlTransaction.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "d7fda477b5be2edc8aecd571b2cdb978394af11a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/paweljaneta/DBbenchmark
| 232
|
FILENAME: SqlTransaction.java
| 0.279828
|
package pl.polsl.paweljaneta.databasebenchmark.model.sql.entities;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import pl.polsl.paweljaneta.databasebenchmark.model.DeliveryMode;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Entity
@Table(schema = "public", name = "TRANSACTION")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SqlTransaction implements Serializable {
@Id
@GeneratedValue
private Long transactionId;
@OneToOne
@JoinColumn(name = "storeId", referencedColumnName = "id")
private SqlStore store;
@OneToOne
@JoinColumn(name = "clientId", referencedColumnName = "id")
private SqlClient client;
@ManyToMany
@JoinTable(name = "TRANSACTION_PRODUCT", joinColumns = {
@JoinColumn(name = "transactionId", referencedColumnName = "transactionId")},
inverseJoinColumns = @JoinColumn(name = "productId", referencedColumnName = "productId"))
private List<SqlProduct> products;
private DeliveryMode deliveryMode;
private Date date;
private Long entityId;
}
|
cf6a73ec-3b85-4890-bf0b-e1470c193f8c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-07-08 10:55:42", "repo_name": "conseweb/Launcher", "sub_path": "/Main/src/main/java/com/bitants/launcherdev/launcher/appslist/search/StringUtil.java", "file_name": "StringUtil.java", "file_ext": "java", "file_size_in_byte": 1096, "line_count": 51, "lang": "zh", "doc_type": "code", "blob_id": "cfb2d2caa1ee53526f0b15f9882d1b9112426b4b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/conseweb/Launcher
| 364
|
FILENAME: StringUtil.java
| 0.26588
|
package com.bitants.launcherdev.launcher.appslist.search;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringUtil {
/**
*
* @description 去除号码中的空格 如: 138 1234 5678 → 13812345678
*/
public static String replaceBlank(String str) {
String dest = "";
if (str != null) {
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
Matcher m = p.matcher(str);
dest = m.replaceAll("");
}
return dest;
}
/**
* Returns true if the string is null or 0-length.
*
* @param str
* @return
*/
public static boolean isEmpty(String str) {
return (str == null || str.length() == 0) ? true : false;
}
/**
* 是否为特殊字符
*
* @param c
* @return
*/
public static boolean isSpecialChar(char c) {
return " `~!@#$%^&*()-+._\"\\=|{}':;',//[//]<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?".indexOf(c) != -1;
}
/**
* 是否为中文字符
*
* @param c
* @return
*/
public static boolean isChineseChar(char c) {
return (c >= 0x4e00 && c < 0x9fa5) ? true : false;
}
}
|
f06dfa53-50d3-44b3-baa3-b8b4b8a01ab3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-29 14:21:48", "repo_name": "introsdeProject194513/introsde_project_ws_nhs", "sub_path": "/src/main/java/it/unitn/introsde/nhr/ws/PatientEndpoint.java", "file_name": "PatientEndpoint.java", "file_ext": "java", "file_size_in_byte": 1037, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "b113782d7a6abf77209013933073b18f68e247d9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/introsdeProject194513/introsde_project_ws_nhs
| 200
|
FILENAME: PatientEndpoint.java
| 0.23092
|
package it.unitn.introsde.nhr.ws;
import it.unitn.introsde.nhr.patientws.querypatient.GetPatientRequest;
import it.unitn.introsde.nhr.patientws.querypatient.GetPatientResponse;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
@Endpoint
public class PatientEndpoint {
private static final String NAMESPACE_URI = "http://www.unitn.it/introsde/nhr/patientWs/queryPatient";
private PatientRepository patients = new PatientRepository();
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getPatientRequest")
@ResponsePayload
public GetPatientResponse getPatient(@RequestPayload GetPatientRequest request) {
GetPatientResponse response = new GetPatientResponse();
response.setPatient(patients.findByTaxCode(request.getTaxCode()));
return response;
}
}
|
9872a042-b7f6-4aab-b5d7-bf31522e8a7c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-30 19:07:20", "repo_name": "weize/fws", "sub_path": "/java/src/main/java/edu/umass/ciir/fws/clustering/FacetRefinerFactory.java", "file_name": "FacetRefinerFactory.java", "file_ext": "java", "file_size_in_byte": 1098, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "c27fe8d1f74bcaee391d4c839cdd676f701b96bc", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/weize/fws
| 258
|
FILENAME: FacetRefinerFactory.java
| 0.283781
|
/*
* 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 edu.umass.ciir.fws.clustering;
import edu.umass.ciir.fws.demo.search.GalagoSearchEngine;
import edu.umass.ciir.fws.demo.search.SearchEngine;
import org.lemurproject.galago.tupleflow.Parameters;
/**
*
* @author wkong
*/
public class FacetRefinerFactory {
public static FacetRefiner instance(Parameters p, SearchEngine searchEngine) {
String facetModel = p.getString("facetModel");
GalagoSearchEngine galago;
if (searchEngine instanceof GalagoSearchEngine) {
galago = (GalagoSearchEngine) searchEngine;
} else {
galago = new GalagoSearchEngine(p);
}
if (facetModel.equals("gmj") || facetModel.equals("gmi")) {
return new GmFacetRefiner(p, galago);
} else if (facetModel.equals("qd")){
return new QDFacetRefiner(p, galago);
} else {
return null;
}
}
}
|
927cc1b0-4666-4c49-94be-dfe7fe7d8332
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-25 18:46:09", "repo_name": "heroes-coding/smart-share", "sub_path": "/src/main/java/entity/File.java", "file_name": "File.java", "file_ext": "java", "file_size_in_byte": 1151, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "92287483f547e088dfdbb2d8540dccdd635b8edd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/heroes-coding/smart-share
| 260
|
FILENAME: File.java
| 0.264358
|
package entity;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class File {
private String fileName;
private byte[] file;
/**
* Saves the underlying file to a relative directory with the File's fileName
* @param relativeDirectory
*/
public void saveFile(String relativeDirectory) {
try (FileOutputStream out = new FileOutputStream(relativeDirectory + "/" + this.fileName);) {
out.write(this.file);
System.out.printf("File %s saved successfully to ./%s\n", this.fileName, relativeDirectory);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public String toString() {
return "File " + this.fileName + ":\n\n" + new String(this.file);
}
public File(String fileName, byte[] file) {
super();
this.fileName = fileName;
this.file = file;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public byte[] getFile() {
return file;
}
public void setFile(byte[] file) {
this.file = file;
}
}
|
3294fea2-5509-452e-9460-00987a1229a4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-26 21:38:53", "repo_name": "wangsihao/SoftwareDevelopment", "sub_path": "/GroupProject/SDPCryptogram/app/src/main/java/edu/gatech/seclass/sdpcryptogram/Cryptogram.java", "file_name": "Cryptogram.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "4fd8bc87f31dfcb6cc9f161d70133211dabeb57f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wangsihao/SoftwareDevelopment
| 205
|
FILENAME: Cryptogram.java
| 0.245085
|
package edu.gatech.seclass.sdpcryptogram;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
public class Cryptogram {
protected String encodedPhrase;
protected String solutionPhrase;
protected int cryptogramID = -1;
public Cryptogram () { }
public Cryptogram (String encodedPhrase,String solutionPhrase)
{
this.setEncodedPhrase(encodedPhrase);
this.setSolutionPhrase(solutionPhrase);
}
public String getEncodedPhrase() {
return encodedPhrase;
}
public void setEncodedPhrase(String encodedPhrase) {
this.encodedPhrase = encodedPhrase;
}
public String getSolutionPhrase() {
return solutionPhrase;
}
public void setSolutionPhrase(String solutionPhrase) {
this.solutionPhrase = solutionPhrase;
}
public int getCryptogramID() { return cryptogramID; }
public void setCryptogramID(int cryptogramID) {
this.cryptogramID = cryptogramID;
}
}
|
4add4c22-7d8c-48ce-bd56-e87f0307e001
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-17 04:19:27", "repo_name": "dev-khanh/handle_event_change", "sub_path": "/android/src/main/java/com/devk/handle_event_change/FlutterRegistrarResponder.java", "file_name": "FlutterRegistrarResponder.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "5aa9de27d401eafb37439386da30c0a3d67dce91", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dev-khanh/handle_event_change
| 214
|
FILENAME: FlutterRegistrarResponder.java
| 0.292595
|
package com.devk.handle_event_change;
import android.os.Handler;
import android.os.Looper;
import java.util.HashMap;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.PluginRegistry;
abstract class FlutterRegistrarResponder {
MethodChannel channel;
PluginRegistry.Registrar flutterRegistrar;
void replyNotImplemented(final MethodChannel.Result reply) {
runOnMainThread(new Runnable() {
@Override
public void run() {
reply.notImplemented();
}
});
}
private void runOnMainThread(final Runnable runnable) {
if (Looper.getMainLooper().getThread() == Thread.currentThread())
runnable.run();
else {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(runnable);
}
}
void invokeMethodOnUiThread(final String methodName, final HashMap map) {
final MethodChannel channel = this.channel;
runOnMainThread(new Runnable() {
@Override
public void run() {
channel.invokeMethod(methodName, map);
}
});
}
}
|
7f29b211-461f-4641-a339-ea90a394a15e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-04-23T05:38:01", "repo_name": "platzmanfan/FriendFinder", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 982, "line_count": 46, "lang": "en", "doc_type": "text", "blob_id": "58576fdc53be549319b75f4e9b0fa241162022ee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/platzmanfan/FriendFinder
| 242
|
FILENAME: README.md
| 0.284576
|
# FriendFinder Application
- - -
## Description
Friend Finder is an application that implements 10 questions being asked by the user and stores them in our data and compares the results! From 1 (Strongly Disagree) to 5 (Strongly Agree). When the survey is done, the closest to the user scores will be displayed and toggle will pop up with his name and his image!
# Demo
- - -
Friend Finder is deplyoed to Heroku! You can see it [here](https://friendfinder1995.herokuapp.com)
## Installation
- - -
You can install it by cloning it!
git clone https://git.heroku.com/friendfinder1995.git
then do ( cd friendfinder)
npm install
* This app works so it get's the results from what the user typed in and it checks them with those who are already in the data! Then it loops trough all and it gives us who is the closest!!
## Technologies i used are :
- - -
* bootstrap for styling the html
* jquery
* express.js
* node
* heroku to deploy my site live
|
a8c1b42e-3deb-44be-98c5-fc44d431dc4d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-10 10:45:53", "repo_name": "prateekdroid08/visitor-app", "sub_path": "/app/src/main/java/com/visitorapp/bloominfotech/models/admin_detail/ResponseAdminDetail.java", "file_name": "ResponseAdminDetail.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "35a6130f0dfe678ae9749855657a82d2c6a92129", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/prateekdroid08/visitor-app
| 265
|
FILENAME: ResponseAdminDetail.java
| 0.26588
|
package com.visitorapp.bloominfotech.models.admin_detail;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.List;
/**
* Created by hp on 11/16/2016.
*/
public class ResponseAdminDetail {
@SerializedName("TotalRecordsCount")
@Expose
private Integer totalRecordsCount;
@SerializedName("UserLists")
@Expose
private List<UserList> userLists = new ArrayList<UserList>();
/**
*
* @return
* The totalRecordsCount
*/
public Integer getTotalRecordsCount() {
return totalRecordsCount;
}
/**
*
* @param totalRecordsCount
* The TotalRecordsCount
*/
public void setTotalRecordsCount(Integer totalRecordsCount) {
this.totalRecordsCount = totalRecordsCount;
}
/**
*
* @return
* The userLists
*/
public List<UserList> getUserLists() {
return userLists;
}
/**
*
* @param userLists
* The UserLists
*/
public void setUserLists(List<UserList> userLists) {
this.userLists = userLists;
}
}
|
4f7bc011-86f1-499c-ace7-ebf73f8a4011
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-23 18:49:10", "repo_name": "oscarnilsson929/Boo", "sub_path": "/app/src/main/java/com/boo/app/ui/activity/PhotoReview.java", "file_name": "PhotoReview.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "8b016ae2cade93b3694d65087f7fc4b38cefe6cd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/oscarnilsson929/Boo
| 210
|
FILENAME: PhotoReview.java
| 0.243642
|
package com.boo.app.ui.activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import com.boo.app.R;
import com.boo.app.utility.BitmapTransform;
import com.boo.app.utility.Utility;
import com.squareup.picasso.Picasso;
public class PhotoReview extends BaseActivity{
private ImageView ivPhoto;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_photo_review);
initUI();
}
private void initUI() {
ivPhoto = _findViewById(R.id.iv_photo_review);
ivPhoto.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
displayPhoto();
}
private void displayPhoto() {
String url = getIntent().getStringExtra(POST_PHOTO_URL);
url = Utility.utility.getMediaUrl(url);
Picasso.with(this)
.load(url)
.fit()
.centerInside()
.into(ivPhoto);
}
}
|
1aeeaf38-0960-4185-a49a-fa3eac28a31f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-27 21:15:21", "repo_name": "ArcBees/gwtchosen", "sub_path": "/integration-test/src/main/java/com/arcbees/chosen/integrationtest/client/testcases/AllowSingleDeselect.java", "file_name": "AllowSingleDeselect.java", "file_ext": "java", "file_size_in_byte": 584, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "b7e2455322b43d22ef520967fcdadfdb67d685be", "star_events_count": 43, "fork_events_count": 32, "src_encoding": "UTF-8"}
|
https://github.com/ArcBees/gwtchosen
| 256
|
FILENAME: AllowSingleDeselect.java
| 0.276691
|
/**
* Copyright 2015 ArcBees Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.arcbees.chosen.integrationtest.client.testcases;
import com.arcbees.chosen.client.ChosenOptions;
public class AllowSingleDeselect extends SimpleValueListBox {
public static final String PLACEHOLDER = "Some placeholder";
public AllowSingleDeselect() {
super(createChosenOption(), true);
}
private static ChosenOptions createChosenOption() {
ChosenOptions chosenOptions = new ChosenOptions();
chosenOptions.setPlaceholderText(PLACEHOLDER);
chosenOptions.setAllowSingleDeselect(true);
return chosenOptions;
}
}
|
5eb3d2d0-3c0c-46ed-8501-9251433e9e97
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-11 06:41:26", "repo_name": "zhizuyiwang/hsf-learn", "sub_path": "/learn-project/project-demo/src/main/java/com/hsf/learn/demo/collection/map/MyMapNode.java", "file_name": "MyMapNode.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "67140fe16a34f5f365946ab9fbf192b74b026492", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/zhizuyiwang/hsf-learn
| 257
|
FILENAME: MyMapNode.java
| 0.282196
|
package com.hsf.learn.demo.collection.map;
import java.util.Objects;
public class MyMapNode<K,V> {
final int hash;
final K key;
V value;
MyMapNode<K,V> next;
public MyMapNode(int hash, K key, V value, MyMapNode<K, V> next) {
this.hash = hash;
this.key = key;
this.value = value;
this.next = next;
}
public final V getValue() {
return value;
}
public final K getKey() {
return key;
}
public final boolean equals(Object object){
if(this == object){
return true;
}else if(object instanceof MyMapNode){
MyMapNode temp = (MyMapNode) object;
if(Objects.equals(key, temp.key) && Objects.equals(value, temp.value)){
return true;
}
}
return false;
}
public final int hashCode(){
return Objects.hashCode(key) ^ Objects.hashCode(value);
}
public final V setValue(final V newValue){
V oldValue = value;
value = newValue;
return oldValue;
}
public final String toString(){
return key + "=" + value;
}
}
|
404f9b54-b683-4217-9c74-b44117e78d17
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-10 17:43:29", "repo_name": "fintechutcc/Java-RMI-Demo", "sub_path": "/DateServer.java", "file_name": "DateServer.java", "file_ext": "java", "file_size_in_byte": 971, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "a77ac4e6233606b77d2b83acde6a6d64a19b7632", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fintechutcc/Java-RMI-Demo
| 210
|
FILENAME: DateServer.java
| 0.261331
|
package th.ac.utcc.computer.rmi;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Suparerk Manitpornsut
* @version 1.0.0
* @since April 10, 2020
*/
public class DateServer extends UnicastRemoteObject
implements DateServerInterface {
public DateServer() throws RemoteException {
super();
}
@Override
public Date getDate() throws RemoteException {
return new Date();
}
public static void main(String [] args) {
try {
DateServer dateServer = new DateServer();
Naming.rebind("//localhost/DateServer", dateServer);
} catch (MalformedURLException | RemoteException ex) {
Logger.getLogger(DateServer.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
|
2c49c253-0756-4bc1-95f3-ce67a956ce05
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-18 18:32:30", "repo_name": "dhavalshah05/AndroidTutorials", "sub_path": "/app/src/main/java/com/itgosolutions/tutorial/google_login/GoogleLoginHelper.java", "file_name": "GoogleLoginHelper.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "e1c889cb546bfb9edbf0abc90a900b906fe14f41", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dhavalshah05/AndroidTutorials
| 247
|
FILENAME: GoogleLoginHelper.java
| 0.289372
|
package com.itgosolutions.tutorial.google_login;
import android.content.Context;
import com.google.android.gms.auth.api.signin.GoogleSignIn;
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
final class GoogleLoginHelper {
static final int RC_SIGN_IN = 100;
private static final String SERVER_CLIENT_ID = "505181810181-fkmb259gd8oqolnt181bulo831tgqgh0.apps.googleusercontent.com";
private static GoogleSignInClient mGoogleSignInClient;
static GoogleSignInClient getGoogleSignInClient(Context context){
if(mGoogleSignInClient == null)
configureGoogleSignInClient(context);
return mGoogleSignInClient;
}
static void configureGoogleSignInClient(Context context){
mGoogleSignInClient = GoogleSignIn.getClient(context, configureGoogleSignInOptions());
}
private static GoogleSignInOptions configureGoogleSignInOptions(){
return new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.requestIdToken(SERVER_CLIENT_ID)
.build();
}
}
|
4eefe5e9-2e7d-47b1-96a5-24665321edef
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-17 15:43:29", "repo_name": "nimalank7/makers-acebook", "sub_path": "/src/main/java/MVP/PostsController.java", "file_name": "PostsController.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "1297af81b0ef6145e950d7789ab53a88d82a9567", "star_events_count": 0, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/nimalank7/makers-acebook
| 210
|
FILENAME: PostsController.java
| 0.277473
|
package MVP;
import MVP.entity.Post;
import MVP.repository.PostRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
@Controller
public class PostsController {
private final PostRepository postRepository;
@Autowired
public PostsController(PostRepository postRepository) {
this.postRepository = postRepository;
}
@GetMapping("/")
@ResponseBody
public String Hello() {
return "Hello World!";
}
@GetMapping("/posts")
public String displayPosts(Model model) {
model.addAttribute("post", new Post());
model.addAttribute("list", postRepository.findAll());
return "posts";
}
@PostMapping("/createpost")
public String createPost(@ModelAttribute Post post) {
postRepository.save(post);
return "redirect:/posts";
}
@PostMapping("/deletepost/{id}")
public String delete(@PathVariable Integer id){
postRepository.deleteById(id);
return "redirect:/posts";
}
}
|
fce52285-53a8-4f16-b3fb-753feddfc987
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-08-09T01:06:57", "repo_name": "osgi/osgi-test", "sub_path": "/org.osgi.test.junit5.listeners.log.osgi/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1072, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "2faa53cc096359fbe98dc4ce2eaeff7644070f8a", "star_events_count": 37, "fork_events_count": 18, "src_encoding": "UTF-8"}
|
https://github.com/osgi/osgi-test
| 246
|
FILENAME: README.md
| 0.267408
|
# org.osgi.test.junit5.listeners.log.osgi
This artifact provides a JUnit Jupiter `TestExecutionListener` implementation that logs test output through the OSGi Log Service. It registers a new logger for each log service that becomes available.
* Failing tests are logged as errors.
* Aborted and skipped tests are logged as warnings.
* Passing tests are logged as info messages.
* Everything else (test run start, test start, dynamic test registered, test run end) is logged as a debug message.
## Usage
These instructions are for running tests using Bnd and the JUnit Platform tester. It is theoretically possible to use the OSGiLogListener in a non-Bnd OSGi environment, but this has not been tested.
Under Bnd, you need to do the following:
1. Add the `log.osgi` bundle to the `-runrequires` of your test bnd(run) file.
2. Ensure that you are using the junit-platform tester (`-tester: biz.aQute.tester.junit-platform`).
3. Resolve your bnd(run) file.
4. Launch your tests.
The tests will run and the test output will be redirected through the OSGi Log Service.
|
6ccf6739-bc90-4574-9465-331d56af4d69
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-17 18:37:32", "repo_name": "DivyaVatturi/nopCommerceApp", "sub_path": "/src/test/java/com/nopcommerce/pageObjects/LoginPage.java", "file_name": "LoginPage.java", "file_ext": "java", "file_size_in_byte": 1055, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "f631a5927a293d7a2fc574028d0e0bef9081ad56", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/DivyaVatturi/nopCommerceApp
| 236
|
FILENAME: LoginPage.java
| 0.287768
|
package com.nopcommerce.pageObjects;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class LoginPage
{
WebDriver ldriver;
public LoginPage(WebDriver rdriver)
{
ldriver=rdriver;
PageFactory.initElements(rdriver, this);
ldriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@FindBy(id="Email") WebElement txtUserName;
@FindBy(id="Password") WebElement txtPassword;
@FindBy(xpath="/html/body/div[6]/div/div/div/div/div[2]/div[1]/div/form/div[3]/input") WebElement btnLogin;
@FindBy(linkText="Logout") WebElement ClkLogout;
public void setupEmail(String email)
{
txtUserName.clear();
txtUserName.sendKeys(email);
}
public void setupPassword(String pswd)
{
txtPassword.clear();
txtPassword.sendKeys(pswd);
}
public void setupClkLogin()
{
//btnLogin.clear();
btnLogin.click();
}
public void setupClkLogout()
{
//ClkLogout.clear();
ClkLogout.click();
}
}
|
3e4ea085-ed62-4e52-acfd-dfa7dcd52044
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-02-26 09:16:56", "repo_name": "fahim-bsmrstu/Krishighor_TEST_2", "sub_path": "/app/src/main/java/com/example/klayton/krishighor_test_2/reg/Login.java", "file_name": "Login.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "17d6563aac130a2b1e29e73851d84f3753b03a12", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fahim-bsmrstu/Krishighor_TEST_2
| 212
|
FILENAME: Login.java
| 0.201813
|
package com.example.klayton.krishighor_test_2.reg;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.example.klayton.krishighor_test_2.R;
public class Login extends AppCompatActivity {
EditText e_user,e_pass;
Button login,reg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
login = (Button)findViewById(R.id.button2);
reg = (Button)findViewById(R.id.button3);
reg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(Login.this,Register.class);
startActivity(i);
}
});
}
}
|
5d84aff0-2cdd-4209-8373-27f6433bce4e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-05 23:15:52", "repo_name": "stevehav/iowa-caucus-app", "sub_path": "/sources/com/drew/metadata/jpeg/HuffmanTablesDescriptor.java", "file_name": "HuffmanTablesDescriptor.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "800207a59907148067f273e966292fcfecbb0bc2", "star_events_count": 21, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/stevehav/iowa-caucus-app
| 193
|
FILENAME: HuffmanTablesDescriptor.java
| 0.291787
|
package com.drew.metadata.jpeg;
import com.drew.lang.annotations.NotNull;
import com.drew.lang.annotations.Nullable;
import com.drew.metadata.TagDescriptor;
public class HuffmanTablesDescriptor extends TagDescriptor<HuffmanTablesDirectory> {
public HuffmanTablesDescriptor(@NotNull HuffmanTablesDirectory huffmanTablesDirectory) {
super(huffmanTablesDirectory);
}
@Nullable
public String getDescription(int i) {
if (i != 1) {
return super.getDescription(i);
}
return getNumberOfTablesDescription();
}
@Nullable
public String getNumberOfTablesDescription() {
Integer integer = ((HuffmanTablesDirectory) this._directory).getInteger(1);
if (integer == null) {
return null;
}
StringBuilder sb = new StringBuilder();
sb.append(integer);
sb.append(integer.intValue() == 1 ? " Huffman table" : " Huffman tables");
return sb.toString();
}
}
|
44a8415b-036c-4e51-85dc-3ed4a89fe96e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-30 10:29:27", "repo_name": "PrateekKumar1/training", "sub_path": "/src/com/training/RetailMgmt/src/main/java/com/training/services/CustImpl.java", "file_name": "CustImpl.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "08a8e05405b70da561f65b105c6ca18d3a87c2a3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/PrateekKumar1/training
| 302
|
FILENAME: CustImpl.java
| 0.290176
|
/**
*
*/
package com.training.services;
import com.training.repo.CustomerRepo;
/**
* @author PRATEEK KR
*
*/
public class CustImpl implements CustmServ {
/*
* (non-Javadoc)
*
* @see com.training.services.CustmServ#addCustmr(int, java.lang.String,
* java.lang.String, java.lang.String)
*/
public int addCustmr(int custid, String custname, String custaddress, String paymode) {
CustomerRepo custd = null;
int adddata = custd.addCustmr(custid, custname,custaddress, paymode);
return adddata;
}
/*
* (non-Javadoc)
*
* @see com.training.services.CustmServ#updCustmr(int)
*/
public String updCustmr(int goodsId) {
CustomerRepo custdupd = null;
String updData = custdupd.updCustmr(custid);
return updData;
}
/*
* (non-Javadoc)
*
* @see com.training.services.CustmServ#rmvCustmr(int)
*/
public String rmvCustmr(int goodsId) {
CustomerRepo custdrmv = null;
String rmvData = custdrmv.rmvCustmr(custid);
return rmvData;
}
}
|
e681b06a-9e90-454a-917a-71a70a726f98
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-05 13:28:31", "repo_name": "ozzi-/G.o.L", "sub_path": "/src/utils/NW.java", "file_name": "NW.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "c51b18cf186a0b9ab96a1f89a22d9542a5974fc4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ozzi-/G.o.L
| 213
|
FILENAME: NW.java
| 0.293404
|
package utils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.NoSuchElementException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
public class NW {
public static String doGETRequest(String url) throws IOException {
CloseableHttpClient hc = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(url);
CloseableHttpResponse httpResponse = hc.execute(httpGet);
int responseCode = httpResponse.getStatusLine().getStatusCode();
if (responseCode == 404) {
throw new NoSuchElementException();
}
BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
String inputLine;
StringBuffer responseBody = new StringBuffer();
while ((inputLine = reader.readLine()) != null) {
responseBody.append(inputLine + System.lineSeparator());
}
reader.close();
hc.close();
return responseBody.toString();
}
}
|
5a416ff7-3471-49bc-b7ae-08cfe8b108cc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-06 19:12:27", "repo_name": "moyheen/MakeUpSearch", "sub_path": "/app/src/main/java/com/moyinoluwa/makeupsearch/data/MakeUpRepositoryImpl.java", "file_name": "MakeUpRepositoryImpl.java", "file_ext": "java", "file_size_in_byte": 1097, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "c94195f2e41c2e805365df8c2c1fd4d2454240e5", "star_events_count": 5, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/moyheen/MakeUpSearch
| 223
|
FILENAME: MakeUpRepositoryImpl.java
| 0.26588
|
package com.moyinoluwa.makeupsearch.data;
import com.moyinoluwa.makeupsearch.data.remote.MakeUpProductRestService;
import com.moyinoluwa.makeupsearch.data.remote.model.MakeUp;
import java.io.IOException;
import java.util.List;
import rx.Observable;
/**
* Created by moyinoluwa on 2/8/17.
*/
public class MakeUpRepositoryImpl implements MakeUpRepository {
private MakeUpProductRestService makeUpProductRestService;
public MakeUpRepositoryImpl(MakeUpProductRestService makeUpProductRestService) {
this.makeUpProductRestService = makeUpProductRestService;
}
@Override
public Observable<List<MakeUp>> searchMakeUp(final String brandName, final String productName) {
return Observable.defer(() -> makeUpProductRestService.searchMakeUpProducts(brandName,
productName))
.retryWhen(observable -> observable.flatMap(o -> {
if (o instanceof IOException) {
return Observable.just(null);
}
return Observable.error(o);
}));
}
}
|
ab7e958c-b0dd-4af3-9bc6-74c19fcf7d09
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-18 14:19:21", "repo_name": "KBelili/WhowheadProject", "sub_path": "/src/test/java/org/TestPackage/TestVerifyItem.java", "file_name": "TestVerifyItem.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "f64cbc6440d90753f9a6641af1ee99f4a7d72afb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/KBelili/WhowheadProject
| 256
|
FILENAME: TestVerifyItem.java
| 0.284576
|
package org.TestPackage;
import org.junit.Test;
import org.myPagesObject.BeforeResultPage;
import org.myPagesObject.CharacterPage;
import org.myPagesObject.HomePage;
import org.myPagesObject.ResultPage;
public class TestVerifyItem extends GenericTest {
public TestVerifyItem() {
super();
}
@Test
public void test() throws Exception{
//Access to application
HomePage home = new HomePage(driver);
//To accept cookies
Thread.sleep(5000);
home.cookiesActiviy();
home.clickInputResearch();
home.fileInputResearch(home.researchInput, "Lardeur");
//to make a research
BeforeResultPage beforeResult = home.clickResearch(home.researchClick);
Thread.sleep(1000);
//to go to PNJ
ResultPage result = beforeResult.clickPNJ(beforeResult.clicPNJ);
//to got to characters
CharacterPage charactere = result.clickCharacter(result.clicBoss);
charactere.firstObject();
// charactere.loadFile(/src/test/resources/sources/firstObject)
}
}
|
fd7ee26a-cacc-4f81-8f24-6ad40ce3d01b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-02 16:04:10", "repo_name": "RobertoGraham/docker-client-model-serializing", "sub_path": "/src/main/java/com/example/demo/ContainerController.java", "file_name": "ContainerController.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "a33d2c9c7b81a6a3876ac8e95bca69c2f7579cfd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/RobertoGraham/docker-client-model-serializing
| 168
|
FILENAME: ContainerController.java
| 0.2227
|
package com.example.demo;
import com.spotify.docker.client.DockerClient;
import com.spotify.docker.client.exceptions.DockerException;
import com.spotify.docker.client.messages.Container;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.spotify.docker.client.DockerClient.ListContainersParam.allContainers;
@RestController
public class ContainerController {
private final DockerClient dockerClient;
@Autowired
public ContainerController(DockerClient dockerClient) {
this.dockerClient = dockerClient;
}
@GetMapping(value = "/", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public List<Container> containerList() throws DockerException, InterruptedException {
return dockerClient.listContainers(
allContainers()
);
}
}
|
0dfb113d-c370-4e6e-828d-6637f7f8845a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-29 02:53:50", "repo_name": "Mdmhasan1/maven", "sub_path": "/MavenP/src/main/java/FHelper/FBrowserFactory.java", "file_name": "FBrowserFactory.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "35cf0f4507798afd868d541521b9d6cff0d166a3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Mdmhasan1/maven
| 191
|
FILENAME: FBrowserFactory.java
| 0.27513
|
package FHelper;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class FBrowserFactory {
static WebDriver driver;
public static WebDriver startBrowser(String browserName, String urls)
{
if(browserName.equalsIgnoreCase("firefox"))
{
System.out.println("fireFox not installed");
driver = new FirefoxDriver();
}
else if(browserName.equalsIgnoreCase("Chrome"))
{
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Hasan\\Desktop\\Java_Automation\\chromedriver.exe");
driver= new ChromeDriver();
}
else if(browserName.equalsIgnoreCase("IE"))
{
driver= new InternetExplorerDriver();
System.out.println("Sorry IE is not installed");
}
driver.manage().window().maximize();
driver.get(urls);
return driver;
}
}
|
d02df4c5-b22f-409a-b697-ae23c450db0e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-18 20:52:42", "repo_name": "kojote-git/library-server", "sub_path": "/src/main/java/com/jkojote/libraryserver/application/mailing/PropertiesAuthenticator.java", "file_name": "PropertiesAuthenticator.java", "file_ext": "java", "file_size_in_byte": 1113, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "2f88bdb00804b9477392c9a143832f02a9b3aca5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kojote-git/library-server
| 185
|
FILENAME: PropertiesAuthenticator.java
| 0.243642
|
package com.jkojote.libraryserver.application.mailing;
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class PropertiesAuthenticator extends Authenticator {
private PasswordAuthentication auth;
public PropertiesAuthenticator(String path)
throws IOException {
try (InputStream in = new FileInputStream(path)) {
Properties props = new Properties();
props.load(in);
String mail = props.getProperty("mail");
String password = props.getProperty("password");
if (mail == null)
throw new IllegalStateException("properties must have 'mail' property");
if (password == null)
throw new IllegalStateException("properties must have 'password' property");
auth = new PasswordAuthentication(mail, password);
}
}
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return auth;
}
}
|
b1e863eb-c251-438f-b3d4-fd30c850c4bf
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-01 13:26:34", "repo_name": "Isendoum/wotBackend", "sub_path": "/src/main/java/com/wot/wotbackend/itemModel/Gear.java", "file_name": "Gear.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "65804c408b10cb410bae9a0ca1abafdbb0075306", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Isendoum/wotBackend
| 214
|
FILENAME: Gear.java
| 0.236516
|
package com.wot.wotbackend.itemModel;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.wot.wotbackend.itemModel.GearModels.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@JsonDeserialize
public class Gear {
private Item weapon;
private Item offHand;
private Item helmet;
private Item chest;
private Item gloves;
private Item pants;
private Item shoulders;
private Item boots;
private Item amulet;
private Item ring1;
private Item ring2;
public Gear(){
this.weapon = new Weapon();
this.offHand = new OffHand();
this.helmet = new Helmet();
this.chest = new Chest();
this.gloves = new Gloves();
this.pants = new Pants();
this.shoulders = new Shoulders();
this.boots = new Boots();
this.amulet = new Amulet();
this.ring1 = new Ring();
this.ring2 = new Ring();
}
}
|
067b5d34-cdef-4a92-a82b-c2ac94cb4ce5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-11-28 13:42:36", "repo_name": "AAFC-BICoE/agent-api", "sub_path": "/src/main/java/ca/gc/aafc/agent/api/service/OrganizationService.java", "file_name": "OrganizationService.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "c664bec91339eafe6e99f49390af108cfa7655a8", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/AAFC-BICoE/agent-api
| 208
|
FILENAME: OrganizationService.java
| 0.255344
|
package ca.gc.aafc.agent.api.service;
import ca.gc.aafc.agent.api.entities.Organization;
import ca.gc.aafc.agent.api.validation.OrganizationValidator;
import ca.gc.aafc.dina.jpa.BaseDAO;
import ca.gc.aafc.dina.service.DefaultDinaService;
import lombok.NonNull;
import org.springframework.stereotype.Service;
import org.springframework.validation.SmartValidator;
import java.util.UUID;
@Service
public class OrganizationService extends DefaultDinaService<Organization> {
private final OrganizationValidator organizationValidator;
public OrganizationService(
@NonNull BaseDAO baseDAO,
@NonNull SmartValidator smartValidator,
@NonNull OrganizationValidator organizationValidator
) {
super(baseDAO, smartValidator);
this.organizationValidator = organizationValidator;
}
@Override
protected void preCreate(Organization entity) {
//Give new Organization UUID
entity.setUuid(UUID.randomUUID());
}
@Override
public void validateBusinessRules(Organization entity) {
applyBusinessRule(entity, organizationValidator);
}
}
|
e821034b-7b06-46ab-beeb-fb258fc4cde5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-21 15:37:29", "repo_name": "maxrporto/AndroidDev", "sub_path": "/AndroidAula6/app/src/main/java/com/target/androidaula6/json/Location.java", "file_name": "Location.java", "file_ext": "java", "file_size_in_byte": 1179, "line_count": 67, "lang": "en", "doc_type": "code", "blob_id": "7121ffc464fd4309294c4340340acc26c7fea18e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/maxrporto/AndroidDev
| 256
|
FILENAME: Location.java
| 0.200558
|
package com.target.androidaula6.json;
public class Location {
private String city;
private Integer postcode;
private String state;
private String street;
/**
* No args constructor for use in serialization
*
*/
public Location() {
}
/**
*
* @param street
* @param state
* @param postcode
* @param city
*/
public Location(String city, Integer postcode, String state, String street) {
super();
this.city = city;
this.postcode = postcode;
this.state = state;
this.street = street;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public Integer getPostcode() {
return postcode;
}
public void setPostcode(Integer postcode) {
this.postcode = postcode;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
}
|
78b49c24-bbc8-409b-9011-fc1d85123bf4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-13 15:54:55", "repo_name": "vfdxvffd/JavaWeb", "sub_path": "/Ajax/AjaxDemo/src/org/Ajax/servlet/MobileServlet.java", "file_name": "MobileServlet.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "ed6c6c0586f4711cc4feb23d3592973d130df328", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/vfdxvffd/JavaWeb
| 201
|
FILENAME: MobileServlet.java
| 0.250913
|
package org.Ajax.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class MobileServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
String mobile = request.getParameter("mobile");
System.out.println(mobile);
PrintWriter out = response.getWriter();
if("123".equals(mobile)) {
out.write("{\"msg\":\"true\"}"); //servlet以输出流方式,将信息返回给客户端
}else {
out.write("{\"msg\":\"false\"}");
}
out.close();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doGet(request, response);
}
}
|
590c51c3-ca7f-4802-b5df-388110c5eb8b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-18 12:26:06", "repo_name": "LiushuiXiaoxia/MsDemo", "sub_path": "/demo-client/src/main/java/com/example/democlient/config/FeignConfig.java", "file_name": "FeignConfig.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "8ec460d2ed22355c6c008b2c758d11cbc8c79d17", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/LiushuiXiaoxia/MsDemo
| 253
|
FILENAME: FeignConfig.java
| 0.256832
|
package com.example.democlient.config;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Slf4j
@Configuration
public class FeignConfig {
@Bean
public RequestInterceptor requestInterceptor() {
log.info("host = " + host);
log.info("dKey = " + dKey);
return new RequestInterceptor() {
@Override
public void apply(RequestTemplate template) {
log.info("url = {}", template.url());
}
};
}
@Value("${msg:abc123}")
String host;
@Value("${default_key:hehe}")
String dKey;
// @Bean
// public EurekaClientConfigBean eurekaClientConfigBean() {
// log.info("host = " + host);
//
// EurekaClientConfigBean bean = new EurekaClientConfigBean();
// Map<String, String> map = new HashMap<>();
// map.put("defaultZone", host);
// bean.setServiceUrl(map);
//
// return bean;
// }
}
|
3e661e58-a4fc-4d21-89a0-040120993455
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-12-29 14:26:01", "repo_name": "mulesoft/mule-migration-assistant", "sub_path": "/mule-migration-tool-library/src/main/java/com/mulesoft/tools/migration/library/mule/steps/spring/AuthorizationFilter.java", "file_name": "AuthorizationFilter.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "8ae9e048938b4b7eff7a917bbfab83f4a70e7a3b", "star_events_count": 25, "fork_events_count": 36, "src_encoding": "UTF-8"}
|
https://github.com/mulesoft/mule-migration-assistant
| 258
|
FILENAME: AuthorizationFilter.java
| 0.268941
|
/*
* Copyright (c) 2020, Mulesoft, LLC. All rights reserved.
* Use of this source code is governed by a BSD 3-Clause License
* license that can be found in the LICENSE.txt file.
*/
package com.mulesoft.tools.migration.library.mule.steps.spring;
import static java.util.Collections.singletonList;
import com.mulesoft.tools.migration.step.category.MigrationReport;
import org.jdom2.Element;
/**
* Migrates the authorization-filter element.
*
* @author Mulesoft Inc.
* @since 1.0.0
*/
public class AuthorizationFilter extends AbstractSpringMigratorStep {
public static final String XPATH_SELECTOR =
"//*[namespace-uri()='http://www.mulesoft.org/schema/mule/spring-security' and local-name()='authorization-filter']";
@Override
public String getDescription() {
return "Migrates the authorization-filter element.";
}
public AuthorizationFilter() {
this.setAppliedTo(XPATH_SELECTOR);
this.setNamespacesContributions(singletonList(SPRING_SECURITY_NAMESPACE));
}
@Override
public void execute(Element object, MigrationReport report) throws RuntimeException {
object.setNamespace(SPRING_NAMESPACE);
}
}
|
f6a6e321-0be0-481a-abbd-55d799d083de
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-18 10:46:47", "repo_name": "tanyaoley/java_course", "sub_path": "/01-workshop/src/it/sevenbits/workshop/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 991, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "5e8ef7439cadc5369142e0ecf32106a425eb3726", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tanyaoley/java_course
| 201
|
FILENAME: Main.java
| 0.282988
|
package it.sevenbits.workshop;
import it.sevenbits.workshop.matrix.Matrix;
import it.sevenbits.workshop.queue.DoubleEndedQueue;
public class Main {
public static void main(String[] args){
Matrix matrix = new Matrix(Integer.parseInt(args[0]), Integer.parseInt(args[1]));
System.out.println(matrix.toString());
matrix.inverseMatrix();
System.out.println(matrix);
Matrix matrix2 = new Matrix(Integer.parseInt(args[0]), Integer.parseInt(args[1]));
Matrix matrix3 = new Matrix(Integer.parseInt(args[0]), Integer.parseInt(args[1]));
DoubleEndedQueue queue = new DoubleEndedQueue();
queue.addFirst(matrix);
queue.addFirst(matrix2);
queue.addLast(matrix3);
queue.addLast(matrix);
queue.addLast(matrix);
System.out.println("Get last and first\n" + queue.getLast().val);
System.out.println(queue.getFirst().val);
System.out.println("queue\n" + queue.toString());
}
}
|
a7bcda5d-2d4b-4efe-822b-aef6b985f8d4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-04T12:25:52", "repo_name": "andiparjoleanu/Yellow-Sounds", "sub_path": "/Proiectv2/src/onlineShop/Administrator.java", "file_name": "Administrator.java", "file_ext": "java", "file_size_in_byte": 1042, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "20a8fdfad4ef4905bc48a4d43383a6025ef2a242", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/andiparjoleanu/Yellow-Sounds
| 200
|
FILENAME: Administrator.java
| 0.23092
|
package onlineShop;
public class Administrator
{
private final String name;
private final String username;
private final String password;
private final String responsabilities;
private final Buffer buffer;
public Administrator(String name, String username, String password,
String responsabilities)
{
this.name = name;
this.username = username;
this.password = password;
this.responsabilities = responsabilities;
this.buffer = Buffer.getInstance();
}
public String getName()
{
return name;
}
public String getUsername()
{
return username;
}
public String getPassword()
{
return password;
}
public String getResponsabilities()
{
return responsabilities;
}
public void addAlbum(Album a) throws InterruptedException
{
buffer.addAlbum(a);
}
public void sellAlbum(Album a)
{
buffer.sellAlbum(a);
}
}
|
4118ea94-d674-4246-9b52-c3694ba5ce74
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-03-02T13:56:28", "repo_name": "ausmarton/vanilla-espresso", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1178, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "499c4dcad01ffcf71217a09d42272216e68beed3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ausmarton/vanilla-espresso
| 280
|
FILENAME: README.md
| 0.224055
|
vanilla-espresso
================
The most basic ExpressJS app in CoffeeScript built with Cake and tested with Mocha
This is a plain ExpressJS app, which was generated using the express generator. It isn't intended to do anything useful as an app, the sole purpose of it is to demonstrate the simplest possible setup of an ExpressJS app written in CoffeeScript with a simple build plan and a couple of dummy tests.
I have drawn almost all "inspiration" from [express-coffee by twilson63](https://github.com/twilson63/express-coffee)!
So, anyone looking for a more concrete example or a more real world use-case, do have a look at express-coffee.
## It is composed of the following:
1. ExpressJS (The app generated by express is translated to coffeescript)
2. Cake - for running the build, tests, and the server
3. Procfile - for deploying to heroku
4. Mocha - for the tests
## Usage:
To run the dev build and startup the server
```
cake dev
```
To run tests
```
cake test
```
Deploying to heroku is pretty much like any other app.
You can find a lot of information on the express-coffee repository about the usage since the Cakefile is mostly a replica of what's there.
|
e4974a55-972d-4043-a8c5-f1168cd561a7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-05-04T20:10:32", "repo_name": "michaelxuch/d3", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1001, "line_count": 45, "lang": "en", "doc_type": "text", "blob_id": "b68effdc8ef10bd25e0c1d5b5f428bc29bc02f7a", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/michaelxuch/d3
| 247
|
FILENAME: README.md
| 0.271252
|
# Agent Check2: D3
## Overview
This check monitors [d3][1].
## Setup
### Installation
To install the d3 check on your host:
1. Install the [developer toolkit](https://docs.datadoghq.com/developers/integrations/new_check_howto/#developer-toolkit) on any machine.
2. Run `ddev release build d3` to build the package.
3. [Download the Datadog Agent](https://app.datadoghq.com/account/settings#agent).
4. Upload the build artifact to any host with an Agent and run `datadog-agent integration install -w path/to/d3/dist/<ARTIFACT_NAME>.whl`.
### Configuration
1. <List of steps to setup this Integration>
### Validation
<Steps to validate integration is functioning as expected>
## Data Collected
### Metrics
d3 does not include any metrics.
### Service Checks
d3 does not include any service checks.
### Events
d3 does not include any events.
## Troubleshooting
Need help? Contact [Datadog support][1].
[1]: https://docs.datadoghq.com/help/
|
a9c05518-92dd-4297-af7c-710069ec8ff1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-09 11:41:53", "repo_name": "838395446/CSDS", "sub_path": "/src/main/java/com/tm/csgl/domain/fortest/RunTaskList.java", "file_name": "RunTaskList.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 56, "lang": "en", "doc_type": "code", "blob_id": "77fcea741f5cbfa2e7f22c4adbddb743425f58ef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/838395446/CSDS
| 269
|
FILENAME: RunTaskList.java
| 0.27048
|
package com.tm.csgl.domain.fortest;
import java.util.List;
public class RunTaskList {
private String taskName;
private Boolean all;
private List<String> caseList;
public RunTaskList() {
this.all=false;
}
public RunTaskList(Boolean all, List<String> caseList) {
this.all = all;
this.caseList = caseList;
}
public RunTaskList(List<String> caseList) {
this.all = false;
this.caseList = caseList;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public Boolean getAll() {
return all;
}
public void setAll(Boolean all) {
this.all = all;
}
public List<String> getCaseList() {
return caseList;
}
public void setCaseList(List<String> caseList) {
this.caseList = caseList;
}
@Override
public String toString() {
return "RunTaskList{" +
"taskName='" + taskName + '\'' +
", all=" + all +
", caseList=" + caseList +
'}';
}
}
|
a3c9ae26-4acb-40a5-b46e-be5d74d7ae05
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-27 04:26:38", "repo_name": "sarkershantonu/jdbc-examples", "sub_path": "/SqlServer/src/main/java/org/automation/dal/JtdsSqlServer.java", "file_name": "JtdsSqlServer.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "6af25142b0332d130cc766fcaccaad257ce3e5ac", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sarkershantonu/jdbc-examples
| 230
|
FILENAME: JtdsSqlServer.java
| 0.243642
|
package org.automation.dal;
import com.microsoft.sqlserver.jdbc.SQLServerDataSource;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
* Created by shantonu on 7/17/16.
*/
public class JtdsSqlServer {
private static final String user = "user";
private static final String pass = "pass";
private static final String className = "net.sourceforge.jtds.jdbc.Driver";
private static final String url = "jdbc:jtds:sqlserver://<host>:<port>;instance=SQLEXPRESS;DatabaseName=master";//instance type and db name can be changed , make sure your DB is exposed via TCP/IP
public static synchronized Connection getConnection() throws SQLException {
DriverManager.registerDriver(new net.sourceforge.jtds.jdbc.Driver());
return DriverManager.getConnection(url, user,pass);
}
public static synchronized Connection getLegacyConnection() throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException {
Class.forName(className).newInstance();
return DriverManager.getConnection(url,user,pass);
}
public static void main(String... args){
}
}
|
952c45ae-b37b-4a0a-95c7-6b1e62ea51f7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-19 04:49:04", "repo_name": "kungfuwushu/backend", "sub_path": "/src/main/java/fr/kungfunantes/backend/model/round/Round.java", "file_name": "Round.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "64102f5c20ad1f05714f5ded7ad1a0436da322fd", "star_events_count": 1, "fork_events_count": 8, "src_encoding": "UTF-8"}
|
https://github.com/kungfuwushu/backend
| 222
|
FILENAME: Round.java
| 0.242206
|
package fr.kungfunantes.backend.model.round;
import fr.kungfunantes.backend.model.criteria.Criteria;
import fr.kungfunantes.backend.model.exercise.ExerciseRound;
import io.swagger.annotations.ApiModel;
import javax.persistence.*;
import java.util.List;
import java.util.Set;
@Entity
@ApiModel
public class Round {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@OneToMany
List<ExerciseRound> exerciseRound;
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name = "round_criteria",
joinColumns = @JoinColumn(name = "roundId"),
inverseJoinColumns = @JoinColumn(name = "criteriaId")
)
private Set<Criteria> criterion;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Set<Criteria> getCriterion() {
return criterion;
}
public void setCriterion(Set<Criteria> criterion) {
this.criterion = criterion;
}
}
|
8937a9f3-0d33-496d-bf96-5800a747b009
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-11 16:54:18", "repo_name": "MDingas/ALTO-server", "sub_path": "/src/main/java/com/example/restservice/entity/networkmap/AddressAggregationEntity.java", "file_name": "AddressAggregationEntity.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "b255ba81116750d23602eee2ea68c7515cf30819", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MDingas/ALTO-server
| 264
|
FILENAME: AddressAggregationEntity.java
| 0.259826
|
package com.example.restservice.entity.networkmap;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Optional;
public class AddressAggregationEntity {
@NotNull
private String pid;
private List<String> ipv4AddressList;
private List<String> ipv6AddressList;
public AddressAggregationEntity(String pid, List<String> ipv4AddressList, List<String> ipv6AddressList) {
this.pid = pid;
this.ipv4AddressList = ipv4AddressList;
this.ipv6AddressList = ipv6AddressList;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public Optional<List<String>> getIpv4AddressList() {
return Optional.ofNullable(ipv4AddressList);
}
public void setIpv4AddressList(List<String> ipv4AddressList) {
this.ipv4AddressList = ipv4AddressList;
}
public Optional<List<String>> getIpv6AddressList() {
return Optional.ofNullable(ipv6AddressList);
}
public void setIpv6AddressList(List<String> ipv6AddressList) {
this.ipv6AddressList = ipv6AddressList;
}
}
|
6276440f-6100-4ccd-8eb2-5dd1c537eacb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-26 16:04:24", "repo_name": "rolaleks/cloud-storage", "sub_path": "/common/src/main/java/cloudstorage/helpers/FileReader.java", "file_name": "FileReader.java", "file_ext": "java", "file_size_in_byte": 983, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "5ba945fe13e1525b5ef0bd06be2d29f34665814a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rolaleks/cloud-storage
| 190
|
FILENAME: FileReader.java
| 0.242206
|
package cloudstorage.helpers;
import java.io.*;
import java.util.Arrays;
public class FileReader {
private String path;
private int chunk = 262144;
private byte[] buffer;
private BufferedInputStream bufferedInputStream;
public FileReader(String path) throws FileNotFoundException {
this.path = path;
buffer = new byte[this.chunk];
bufferedInputStream = new BufferedInputStream(new FileInputStream(path));
}
public byte[] read() throws IOException {
int len;
if ((len = bufferedInputStream.read(buffer)) != -1) {
if (len == this.chunk) {
return buffer;
} else {
return Arrays.copyOfRange(buffer, 0, len);
}
}
this.close();
return new byte[0];
}
public void close() {
try {
bufferedInputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
379825d6-02f1-4c02-a110-f5019e175356
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-30 01:20:23", "repo_name": "carnation-security/carnation-core", "sub_path": "/src/main/java/com/violetfreesia/carnation/context/SecurityContextHolder.java", "file_name": "SecurityContextHolder.java", "file_ext": "java", "file_size_in_byte": 1160, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "cfdaa7680adc032731dff8dcd341cb82eb3274af", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/carnation-security/carnation-core
| 249
|
FILENAME: SecurityContextHolder.java
| 0.236516
|
package com.violetfreesia.carnation.context;
import com.violetfreesia.carnation.exception.NotAllowedNullException;
import com.violetfreesia.carnation.util.CarnationAssert;
/**
* @author violetfreesia
* @date 2021-04-26
*/
public class SecurityContextHolder {
private final static ThreadLocal<SecurityContext> SECURITY_CONTEXT = new ThreadLocal<>();
private SecurityContextHolder() {
}
/**
* 获取上下文
*
* @return 上下文
*/
public static SecurityContext getContext() {
SecurityContext context = SECURITY_CONTEXT.get();
if (context == null) {
context = new SecurityContextImpl();
SECURITY_CONTEXT.set(context);
}
return context;
}
/**
* 设置上下文
*
* @param context 上下文
*/
public static void setContext(SecurityContext context) {
CarnationAssert.notNull(context, new NotAllowedNullException("上下文对象不允许为Null"));
SECURITY_CONTEXT.set(context);
}
/**
* 清除上下文
*/
public static void clearContext() {
SECURITY_CONTEXT.remove();
}
}
|
6c8b2c96-91fa-4834-97d8-19ff54ba87e6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-16 09:21:52", "repo_name": "fratik/chinczyk", "sub_path": "/chinczyk-client/src/main/java/pl/fratik/chinczyk/client/game/GameListenerWrapper.java", "file_name": "GameListenerWrapper.java", "file_ext": "java", "file_size_in_byte": 1182, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "c6de02e3f3cfe468150812387f9cb71c9732c9fd", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fratik/chinczyk
| 259
|
FILENAME: GameListenerWrapper.java
| 0.283781
|
package pl.fratik.chinczyk.client.game;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pl.fratik.chinczyk.game.Event;
import pl.fratik.chinczyk.game.GameStatus;
class GameListenerWrapper implements GameListener {
final GameListener listener;
private final Logger logger;
public GameListenerWrapper(GameListener listener) {
this.listener = listener;
logger = LoggerFactory.getLogger(getClass());
}
protected void handleException(Throwable t) {
if (t instanceof Error) throw (Error) t;
logger.warn("Wystąpił błąd w " + listener, t);
}
@Override
public void onReady() {
try {
listener.onReady();
} catch (Throwable t) {
handleException(t);
}
}
@Override
public void onStatusUpdate(GameStatus oldStatus) {
try {
listener.onStatusUpdate(oldStatus);
} catch (Throwable t) {
handleException(t);
}
}
@Override
public void onEvent(Event event) {
try {
listener.onEvent(event);
} catch (Throwable t) {
handleException(t);
}
}
}
|
37514600-489d-4e52-aa8e-50adbced93d9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-08-29T14:06:17", "repo_name": "koenhoeymans/Fjor", "sub_path": "/CHANGELOG.md", "file_name": "CHANGELOG.md", "file_ext": "md", "file_size_in_byte": 992, "line_count": 52, "lang": "en", "doc_type": "text", "blob_id": "76b31414219cd0fa3ec928614e7c4d2099f31c98", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/koenhoeymans/Fjor
| 317
|
FILENAME: CHANGELOG.md
| 0.272799
|
# Fjor Changelog
## [Unreleased]
### Changed
- `addParam()` doesn't require an array with parameters to be injected. Parameters
are now specified the way they should be injected.
## [0.3.0] - 2018-08-07
### Changed
- Require PHPUnit 7.*
- Minimum PHP 7.2 required.
- Changelog format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### fixed
- Optional attributes no longer are passed `null`
## older changes
* 0.2.0
* Reorganized project directory structure.
* Conform to PSR-3 and PSR-4.
* Added changes for QualityCheck library to work.
* 0.1.5
* Updated to `Epa` version 0.2.0.
* 0.1.4
* Fixed bug where `AfterNew` event is thrown when object is requested
but not when object is created.
* 0.1.3
* Method injection can be specified for parentclasses.
* 0.1.2
* More easy to instantiate using utility static method.
* Pluggable (`AfterNew` event).
* 0.1.1
* Now installable through Composer.
* 0.1.0
* First release.
|
e8477dc7-a17a-4532-bf4d-e8191a5a451b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-27 18:32:42", "repo_name": "chvnaveenkumar/Recursion-Java", "sub_path": "/src/recursion/Student.java", "file_name": "Student.java", "file_ext": "java", "file_size_in_byte": 1037, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "c883c2db0927e833a2f3c3f9482a39e7b77c27c0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/chvnaveenkumar/Recursion-Java
| 235
|
FILENAME: Student.java
| 0.261331
|
/*
* 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 recursion;
/**
*
* @author Naveen Kumar,Chandaluri
*/
public class Student {
private String fname;
/**
* This is the constructor for the student class.
*
* @param fname of string type.
*/
public Student(String fname) {
this.fname = fname;
}
/**
* This is the getter method of First Name of Student class.
*
* @return the string type.
*/
public String getFname() {
return fname;
}
/**
* This is the setter method of Fname.
*
* @param fname of String type.
*/
public void setFname(String fname) {
this.fname = fname;
}
/*
* This is the toString method of Student class.
* @return It returns the fname of String type.
*/
@Override
public String toString() {
return fname;
}
}
|
1dc878a5-eb32-479f-a98f-194351452253
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-01 16:18:42", "repo_name": "benskov95/Cupcake_Webshop", "sub_path": "/src/main/java/PresentationLayer/NewCustomer.java", "file_name": "NewCustomer.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "dde4ced1efae1305f80bd2008e86bb4c64b4a246", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/benskov95/Cupcake_Webshop
| 185
|
FILENAME: NewCustomer.java
| 0.23231
|
package PresentationLayer;
import FunctionLayer.LogicFacade;
import FunctionLayer.LoginSampleException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.SQLException;
public class NewCustomer extends Command {
@Override
String execute(HttpServletRequest request, HttpServletResponse response) throws LoginSampleException, SQLException, ClassNotFoundException {
String navn = request.getParameter("navn");
String email = request.getParameter("email");
String password = request.getParameter("pass");
if (!email.contains("@")) {
request.setAttribute("emailFejl", "Du skal bruge en email (@) for at oprette en konto.");
return "newcustomer";
}
LogicFacade.createCustomer(navn, email, password);
request.setAttribute("nykunde", "Så er din konto oprettet!\nNu skal du bare logge ind for at bestille.");
return "index";
}
}
|
744fe330-1e54-4753-b32e-18afa8d38351
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-10-23 08:57:04", "repo_name": "blueesad/Android_GuoWei_Exam", "sub_path": "/app/src/main/java/com/qf/guo/guowei_exam/adapter/MyPagerAdapter.java", "file_name": "MyPagerAdapter.java", "file_ext": "java", "file_size_in_byte": 1154, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "45ebafb99a9ce2fbabf3e36d0015c1e128ffebd8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/blueesad/Android_GuoWei_Exam
| 255
|
FILENAME: MyPagerAdapter.java
| 0.282988
|
package com.qf.guo.guowei_exam.adapter;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.qf.guo.guowei_exam.bean.TitleJson;
import com.qf.guo.guowei_exam.fragment.MyListFrament;
import java.util.List;
/**
* Created by Administrator on 2016/10/9 0009.
*/
public class MyPagerAdapter extends FragmentPagerAdapter {
private final List<TitleJson.TngouBean> titles;
public MyPagerAdapter(FragmentManager fm, List<TitleJson.TngouBean> titles) {
super(fm);
this.titles = titles;
}
@Override
public Fragment getItem(int position) {
Fragment fragment = new MyListFrament();
Bundle bundle = new Bundle();
bundle.putInt("id",titles.get(position).getId());
fragment.setArguments(bundle);
return fragment;
}
@Override
public int getCount() {
return titles.size();
}
@Override
public CharSequence getPageTitle(int position) {
return titles.get(position).getName();
}
}
|
3c11958a-dd78-49de-a567-fe29a5f4f02a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-10 21:34:54", "repo_name": "georgianabrailoiu/mpai-project", "sub_path": "/mpai/src/main/java/eb/project/mpai/service/BiletNormalTeatruServiceImpl.java", "file_name": "BiletNormalTeatruServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1232, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "12b79a4628facd70351f6695a8921af53a79a959", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/georgianabrailoiu/mpai-project
| 281
|
FILENAME: BiletNormalTeatruServiceImpl.java
| 0.295027
|
package eb.project.mpai.service;
import eb.project.mpai.domain.bilete.BiletNormalConcert;
import eb.project.mpai.domain.bilete.BiletNormalTeatru;
import eb.project.mpai.repository.BiletNormalConcertRepository;
import eb.project.mpai.repository.BiletNormalTeatruRepository;
import eb.project.mpai.service.interfaces.BiletNormalConcertService;
import eb.project.mpai.service.interfaces.BiletNormalTeatruService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class BiletNormalTeatruServiceImpl implements BiletNormalTeatruService {
@Autowired
private BiletNormalTeatruRepository biletNormalTeatruRepository;
@Override
public List<BiletNormalTeatru> findAll() {
return biletNormalTeatruRepository.findAll();
}
@Override
public void save(BiletNormalTeatru bilet){
biletNormalTeatruRepository.save(bilet);
}
@Override
public void delete(BiletNormalTeatru bilet){
biletNormalTeatruRepository.delete(bilet);
}
@Override
public Optional<BiletNormalTeatru> findById(Long id){ return biletNormalTeatruRepository.findById(id);}
}
|
abe36822-3c12-4abc-94d8-bbba15c1b911
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-16 02:00:31", "repo_name": "SnowballClient/Client", "sub_path": "/src/org/golde/snowball/packets/server/SPacketInfo.java", "file_name": "SPacketInfo.java", "file_ext": "java", "file_size_in_byte": 967, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "fe28eeae953adcd48af52308c093773cbe57c77a", "star_events_count": 1, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/SnowballClient/Client
| 211
|
FILENAME: SPacketInfo.java
| 0.267408
|
package org.golde.snowball.packets.server;
import java.io.IOException;
import org.golde.snowball.Snowball;
import org.golde.snowball.render.gui.LoadingCustom;
import net.minecraft.client.Minecraft;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.INetHandlerPlayClient;
public class SPacketInfo extends SPacket {
private int customObjectCount;
public static LoadingCustom CURRENT_LOADING_SCREEN;
@Override
public void readPacketData(PacketBuffer buf) throws IOException {
customObjectCount = buf.readInt();
}
@Override
public void processPacket(INetHandlerPlayClient handler) {
Snowball.instance.isOnSnowballServer = true;
CURRENT_LOADING_SCREEN = new LoadingCustom("Initalising Snowball...", 1);
Minecraft.getMinecraft().addScheduledTask(() -> { Minecraft.getMinecraft().displayGuiScreen(CURRENT_LOADING_SCREEN); });
CURRENT_LOADING_SCREEN.startMajorTask("Loading Custom Objects", customObjectCount);
}
}
|
10447e67-d160-45f5-8047-4b1e8f04371e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-09 07:05:35", "repo_name": "aa0228/FyglWeb", "sub_path": "/src/main/java/nju/software/fygl/entity/Ajjb.java", "file_name": "Ajjb.java", "file_ext": "java", "file_size_in_byte": 1038, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "f58f77a0068f6ab2fb48011a45a500abfdb1681d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/aa0228/FyglWeb
| 279
|
FILENAME: Ajjb.java
| 0.288569
|
package nju.software.fygl.entity;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
@Entity
@Table(name="PUB_AJ_JB")
public class Ajjb implements Serializable {
private static final long serialVersionUID = 1L;
Integer AJXH;
String AH;
public Ajjb() {
}
public Ajjb(Integer AJXH, String AH) {
this.AJXH = AJXH;
this.AH = AH;
}
@Id
@GenericGenerator(name="bmbhgenerator",strategy = "native")
@GeneratedValue(generator = "bmbhgenerator")
@Column(name="AJXH",unique = true)
public Integer getAJXH() {
return AJXH;
}
public void setAJXH(Integer AJXH) {
this.AJXH = AJXH;
}
@Column(name="AH")
public String getAH() {
return AH;
}
public void setAH(String AH) {
this.AH = AH;
}
@Override
public String toString() {
return "Ajjb{" +
"AJXH=" + AJXH +
", AH='" + AH + '\'' +
'}';
}
}
|
2cee35f9-cfe9-4c2f-90d9-2372032d2776
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-17 11:16:31", "repo_name": "AnkitJangir/java", "sub_path": "/Vishal/AJ/breack file and marge file/MergeFile.java", "file_name": "MergeFile.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "b743d221d001e614650bfbaf76796cc2485d8519", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AnkitJangir/java
| 185
|
FILENAME: MergeFile.java
| 0.282988
|
import java.io.*;
class MergeFile
{
public static void main(String arg[])throws IOException
{
String filename;
int k=0;
Console con = System.console();
System.out.println("Name of File to be Merge: ");
String M=con.readLine();
for(int i=0;;i++)
{
String str=i+"."+M;
File f=new File(str);
if(f.exists())
{
FileInputStream fis=new FileInputStream(f);
File f2=new File(M);
FileOutputStream fos=new FileOutputStream(f2,true);
k++;
int ch;
while((ch=fis.read())!=-1)
{
fos.write(ch);
}
fis.close();
f.delete();
}
else
break;
}
System.out.println("\n"+k+" File to be Merged");
}
}
|
b5e3ea4c-571b-4ad1-a3d6-ad57179e9be0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-25 08:25:58", "repo_name": "zyh961117/CourseSpirit", "sub_path": "/src/com/example/coursespirit/adapter/CourseAdapter.java", "file_name": "CourseAdapter.java", "file_ext": "java", "file_size_in_byte": 1084, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "61928d95a65e3cc2050c372c9eebf17ec2610bbf", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "GB18030"}
|
https://github.com/zyh961117/CourseSpirit
| 217
|
FILENAME: CourseAdapter.java
| 0.290981
|
package com.example.coursespirit.adapter;
import java.util.List;
import com.example.coursespirit.R;
import com.example.coursespirit.db.Course;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
public class CourseAdapter extends ArrayAdapter<Course> {
private int resourceId;
public CourseAdapter(Context context, int textViewResourceId, List<Course> objects) {
super(context, textViewResourceId, objects);
resourceId = textViewResourceId;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Course course = getItem(position); // 获取当前项的Fruit实例
View view = LayoutInflater.from(getContext()).inflate(resourceId, null);
TextView courseName = (TextView) view.findViewById(R.id.course_name);
TextView teacherName = (TextView) view.findViewById(R.id.teacher_name);
courseName.setText(course.getCourseName());
teacherName.setText("老师:" + course.getTeacherId());
return view;
}
}
|
934c3dac-d3c8-45cd-bec1-aea873a433e6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-26 01:10:39", "repo_name": "aytanSafa/spring-transactions", "sub_path": "/src/main/java/com/ayt/springtransactions/controller/AppController.java", "file_name": "AppController.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "0ab2bbd95e37dab54147c4ae0cc785a8af24cce9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/aytanSafa/spring-transactions
| 193
|
FILENAME: AppController.java
| 0.26971
|
package com.ayt.springtransactions.controller;
import com.ayt.springtransactions.dto.CustomerOrdersDto;
import com.ayt.springtransactions.service.CustomerOrdersService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api")
public class AppController {
private final CustomerOrdersService service;
public AppController(CustomerOrdersService service) {
this.service = service;
}
@PostMapping(value = "/saveCustomerOrders")
public ResponseEntity<String> saveCustomerAndOrders(@RequestBody CustomerOrdersDto customerOrdersDto){
service.saveCustomerAndOrder(customerOrdersDto);
return ResponseEntity.ok("Customer and Orders save operations are success.");
}
@DeleteMapping(value = "/deleteCustomerOrders")
public ResponseEntity<String> deleteCustomerAndOrders(@RequestBody Long customerId,@RequestBody Long ordersId ){
service.deleteCustomerAndOrder(customerId,ordersId);
return ResponseEntity.ok("Customer and Orders save operations are success.");
}
}
|
0a57c4dd-7f0f-47fa-a262-1e3c703bb34b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-29 17:40:23", "repo_name": "beremm14/OpenHolzwurm", "sub_path": "/OpenHolzwurm/src/gui/model/ProductModel.java", "file_name": "ProductModel.java", "file_ext": "java", "file_size_in_byte": 1023, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "174ac8d6803cfd4480c450a69b4224337a01f2ca", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/beremm14/OpenHolzwurm
| 211
|
FILENAME: ProductModel.java
| 0.250913
|
package gui.model;
import data.Product;
import javax.swing.table.AbstractTableModel;
/**
*
* @author emil
*/
public class ProductModel extends AbstractTableModel {
private final String[] colNames = {"Material", "Menge", "Kosten"};
private final Product product;
public ProductModel(Product product) {
this.product = product;
}
@Override
public int getRowCount() {
return product.size();
}
@Override
public int getColumnCount() {
return colNames.length;
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
switch(columnIndex) {
case 0: return product.get(rowIndex).getPreset().getName();
case 1: return product.get(rowIndex).getValue();
case 2: return product.get(rowIndex).getPrice();
default: throw new RuntimeException("Wrong column index");
}
}
@Override
public String getColumnName(int column) {
return colNames[column];
}
}
|
248e5a98-f3a2-4237-af8b-67d9c63ad6c1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-10-03 17:26:52", "repo_name": "trascarobert/projects", "sub_path": "/Java Hiring Application/Marketing.java", "file_name": "Marketing.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "3ba2ca21de00c957b2084ab2555d48783e54a4b6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/trascarobert/projects
| 227
|
FILENAME: Marketing.java
| 0.284576
|
package TemaPOO;
public class Marketing extends Departament {
public Marketing(String name_departament) {
super(name_departament);
}
public double getTotalSalaryBudget() {
double big_salary = 0;
double small_salary = 0;
double half_salary = 0;
double total = 0;
for(Employee e : list_of_employees) {
if(name_departament.equals("Marketing")) {
if(e.salary > 5000)
big_salary += (e.salary * 10) / 100;
if(e.salary < 3000)
small_salary += e.salary;
if(e.salary > 3000 && e.salary < 5000)
half_salary += (e.salary * 16) / 100;
}
}
total = big_salary + small_salary + half_salary;
return total;
}
public int hashCode() {
return super.hashCode();
}
public boolean equals(Object o) {
return super.equals(o);
}
}
|
e0fdf9b5-df59-4692-b6e4-26ac683746aa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-23 00:50:16", "repo_name": "randyyan2000/3D-Pacman", "sub_path": "/src/DisplayThread.java", "file_name": "DisplayThread.java", "file_ext": "java", "file_size_in_byte": 1011, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "0c7d4cbfd237763759c31401cb3acd914e224e4a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/randyyan2000/3D-Pacman
| 193
|
FILENAME: DisplayThread.java
| 0.273574
|
public class DisplayThread extends Thread
{
private Thread t;
private Display d;
public DisplayThread(Display display)
{
d=display;
}
public void run()
{
System.out.println("Running thread");
try
{
while(true)
{
d.sort();
d.repaint();
if(d.linkedDisplay != null)
{
d.linkedDisplay.sort();
d.linkedDisplay.repaint();
}
// Let the thread sleep for a while.
Thread.sleep(50);
}
}
catch (InterruptedException e)
{
System.out.println("Thread interrupted.");
}
// System.out.println("Thread " + threadName + " exiting.");
}
public void start()
{
System.out.println("Starting thread");
if (t == null)
{
t = new Thread (this);
t.start ();
}
}
}
|
8aff39bf-d26b-464a-8877-99c2ed370630
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-12-09 04:36:08", "repo_name": "GeorgeKeo/Game", "sub_path": "/SpecialRoom.java", "file_name": "SpecialRoom.java", "file_ext": "java", "file_size_in_byte": 1178, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "9fd0a9b1647b7aeccc8920c769cd92588b581206", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/GeorgeKeo/Game
| 257
|
FILENAME: SpecialRoom.java
| 0.242206
|
import java.util.Set;
import java.util.HashMap;
/**
* Goodhue's SpecialRoom
*
* Adding a special capability to just one room.
*
* 2013-11-15
*/
public class SpecialRoom extends Room
{
private Object gurleyJersey;
//private HashMap<String, Object> bagItems;
/**
* Constructor for objects of class SpecialRoom
*/
public SpecialRoom(String description)
{
super(description);
}
public void press(Command command)
{
if(command.getSecondWord().equals("ID"))
{
System.out.println("You swipe your ID and then a door " +
"slides open revealing a staircase.");
Room creepyRoom = new Room("in a creepy room");
gurleyJersey = new Object("Jersey");
setExit("down", creepyRoom);
creepyRoom.setExit("up", this);
creepyRoom.setItem("Jersey", gurleyJersey);
changeDescription("in the Staff Room" +
". \nAn opening in the wall reveals a staircase leading down.");
}
else
{
super.press(command);
}
}
}
|
14877e78-1a8c-4647-91d6-333cc16fa5d2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-05-11 11:15:26", "repo_name": "cmusv-sc/OpenNEX-Team6", "sub_path": "/app/controllers/MakeSession.java", "file_name": "MakeSession.java", "file_ext": "java", "file_size_in_byte": 994, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "f654d5545b3e5d5accdb4973eb0ba75bb56b855c", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cmusv-sc/OpenNEX-Team6
| 198
|
FILENAME: MakeSession.java
| 0.27513
|
package controllers;
import models.Session;
import play.mvc.*;
import play.data.*;
import static play.data.Form.*;
import views.html.makesession.*;
import models.*;
public class MakeSession extends Controller {
/**
* Defines a form wrapping the User class.
*/
final static Form<models.Session> signupForm = form(models.Session.class);
/**
* Display a blank form.
*/
public static Result blank() {
return ok(form.render(signupForm));
}
/**
* Handle the form submission.
*/
public static Result submit() {
Form<models.Session> sessionForm = signupForm.bindFromRequest();
models.Session session = sessionForm.get();
session.setAdmin(System.getProperty("user.name"));
User user = User.byId(1L);
session.setUser(user);
session.save();
user.setSession(session.byTopic(session.getTopic()));
user.save();
return ok(summary.render(session));
}
}
|
eccc48ba-cec2-4484-a75a-eceef2dc1e8e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-23 09:14:48", "repo_name": "utshavtimsina/UbuntuWorkspace", "sub_path": "/Day9_JDBI/src/main/java/org/timsina/main/config/JDBIConfig.java", "file_name": "JDBIConfig.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "7602a8cfd7a052f8b8dbaf1c0a14f029e17a7994", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/utshavtimsina/UbuntuWorkspace
| 218
|
FILENAME: JDBIConfig.java
| 0.261331
|
package org.timsina.main.config;
import javax.sql.DataSource;
import org.jdbi.v3.core.Jdbi;
import org.jdbi.v3.sqlobject.SqlObjectPlugin;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
@Configuration
public class JDBIConfig {
@Bean
@Primary
public DataSource dataSource() {
DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
dataSourceBuilder.driverClassName("com.mysql.cj.jdbc.Driver");
dataSourceBuilder.url("jdbc:mysql://localhost:3306/test?autoreconnect=true");
dataSourceBuilder.username("root");
dataSourceBuilder.password("");
return dataSourceBuilder.build();
}
@Bean
public Jdbi jdbiObject(DataSource dataSource) {
Jdbi jdbi = Jdbi.create(dataSource);
jdbi.installPlugin(new SqlObjectPlugin());
return jdbi;
}
}
|
ea31b428-fc14-4ec7-b4c9-f58e5e089a42
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-07 05:49:48", "repo_name": "wusichao/xyx", "sub_path": "/x-kernel/src/main/java/com/xyx/x/model/Account.java", "file_name": "Account.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "29ba07aa0896865bdc54cb827a2593b504019519", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wusichao/xyx
| 296
|
FILENAME: Account.java
| 0.259826
|
package com.xyx.x.model;
import java.util.Set;
public class Account extends Identifiable<Long>{
/**
* serialVersionUID
*/
private static final long serialVersionUID = 2068652268262144767L;
/**
* 媒体Id集合
*/
private Set<Long> mediaIdSet;
/**
* 渠道Id集合
*/
private Set<Long> channelIdSet;
/**
* 转化点集合
*/
private Set<Long> convertionIdSet;
private int domainType;
public Set<Long> getMediaIdSet() {
return mediaIdSet;
}
public void setMediaIdSet(Set<Long> mediaIdSet) {
this.mediaIdSet = mediaIdSet;
}
public Set<Long> getChannelIdSet() {
return channelIdSet;
}
public void setChannelIdSet(Set<Long> channelIdSet) {
this.channelIdSet = channelIdSet;
}
public Set<Long> getConvertionIdSet() {
return convertionIdSet;
}
public void setConvertionIdSet(Set<Long> convertionIdSet) {
this.convertionIdSet = convertionIdSet;
}
public void setDomainType(int t){
this.domainType=t;
}
public int getDomainType(){
return domainType;
}
}
|
8398e41f-712a-4e15-88bb-f336adbe26a2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-22T21:44:20", "repo_name": "MFG-art/Beatbox", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1018, "line_count": 21, "lang": "en", "doc_type": "text", "blob_id": "f6200ef742267176746c0f1fa59dc017eec90803", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MFG-art/Beatbox
| 221
|
FILENAME: README.md
| 0.268941
|
# ReactBox
ReactBox is an online drum machine built with React.js. React.js allows for a dynamic interface which responds quickly to user input while not compromising the performance of the audio engine. ReactBox is inspired by popular drum machines such as the Roland TR-808 and TR-909, both of which played a crucial role in the development of modern electronic music. As a fan of electronic music, I wanted to recreate this piece of cultural history. This project helped me develop my skills as a React programmer.
## Installation
The application is hosted on Heroku and can be found here:
```javascript
// add link here
```
## Usage
The user can interact with the drum sequencer by clicking the buttons in the beat matrix. Each drum sample (kick, clap, hat) has it's own row with sixteenth steps. These steps divide one measure of music into 16th notes, as previous drum machines did.
The pattern can be saved locally by clicking the save button.
## License
[MIT](https://choosealicense.com/licenses/mit/)
|
2bb280bf-8dbe-4088-b26f-5fb4752a0bd7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-02 04:49:57", "repo_name": "bennabnm/programming-in-java", "sub_path": "/java-core-nio/test/johnny/java/core/nio/test/EchoTest.java", "file_name": "EchoTest.java", "file_ext": "java", "file_size_in_byte": 1152, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "51879574996b7df644b3e4b7a65fcb5c1a143a01", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bennabnm/programming-in-java
| 238
|
FILENAME: EchoTest.java
| 0.281406
|
package johnny.java.core.nio.test;
import johnny.java.core.nio.EchoClient;
import johnny.java.core.nio.EchoServer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
public class EchoTest {
Process server;
EchoClient client;
@Before
public void setup() throws IOException, InterruptedException {
server = EchoServer.start();
Thread.sleep(2000); // sleep to make sure server is up.
client = EchoClient.start();
}
@Test
public void givenServerClient_whenServerEchosMessage_thenCorrect() {
String resp1 = client.sendMessage("hello");
String resp2 = client.sendMessage("world");
String disconnect = client.sendMessage("POISON_PILL");
//String error = client.sendMessage("welcome"); // will fail as connection is closed
assertEquals("hello", resp1);
assertEquals("world", resp2);
assertEquals("POISON_PILL", disconnect);
}
@After
public void teardown() throws IOException {
server.destroy();
EchoClient.stop();
}
}
|
6267f03b-36eb-40d4-937f-e8fc82f919d7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-21 08:59:53", "repo_name": "AdamMorytko/BookApi_2", "sub_path": "/src/main/java/pl/coderslab/model/JpaBookService.java", "file_name": "JpaBookService.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "512703f7e426f7777af13bf7c888a223a7444383", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AdamMorytko/BookApi_2
| 224
|
FILENAME: JpaBookService.java
| 0.272025
|
package pl.coderslab.model;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;
import pl.coderslab.repository.BookRepository;
import java.util.List;
import java.util.Optional;
@Repository
@Primary
public class JpaBookService implements BookService {
private final BookRepository bookRepository;
public JpaBookService(BookRepository bookRepository) {
this.bookRepository = bookRepository;
}
@Override
public List<Book> getBooks() {
return bookRepository.findAll();
}
@Override
public void addBook(Book book) {
bookRepository.save(book);
}
@Override
public void updateBook(Book book) {
bookRepository.save(book);
}
@Override
public Optional<Book> getBookById(Long id) {
return bookRepository.findById(id);
}
@Override
public void deleteBook(long id) {
bookRepository.deleteById(id);
}
@Override
public List<Book> findBooksByTitle(String bookTitle) {
return bookRepository.findAllByTitle(bookTitle);
}
}
|
4df2bf46-e4b5-44c4-9130-078d5ac6cc20
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-20 03:24:10", "repo_name": "planet0104/lazy_dict", "sub_path": "/lazy_dict/app/src/main/java/cn/jy/lazydict/Word.java", "file_name": "Word.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "7f580b29368719388f5bafa0c884dbb60482db9d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/planet0104/lazy_dict
| 230
|
FILENAME: Word.java
| 0.23092
|
package cn.jy.lazydict;
/**
* 汉字释义
*/
public class Word {
private final String word;
private final String strokes;
private final String pinyin;
private final String radicals;
private final String explanation;
@Override
public String toString() {
return pinyin+"<br/><b>"+word+"</b><br/><br/>笔画数:"+strokes+"<br/>部首:"+radicals+"<br/><br/>"+explanation;
}
public Word(String word, String strokes, String pinyin, String radicals, String explanation) {
this.word = word;
this.strokes = strokes;
this.pinyin = pinyin;
this.radicals = radicals;
this.explanation = explanation;
}
public String getWord() {
return word;
}
public String getStrokes() {
return strokes;
}
public String getPinyin() {
return pinyin;
}
public String getRadicals() {
return radicals;
}
public String getExplanation() {
return explanation;
}
}
|
09d0ab4a-7b52-4890-aee3-2061d913646f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-11-11T18:18:52", "repo_name": "MaitreKuc/Symply_SoundBoard_MK", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1083, "line_count": 29, "lang": "en", "doc_type": "text", "blob_id": "b0122d0659814b3247bb4debfa7fa15d647c2c20", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MaitreKuc/Symply_SoundBoard_MK
| 331
|
FILENAME: README.md
| 0.243642
|
# Symply_SoundBoard_MK
Symply SoundBoard
Original Project
https://github.com/ZenitH-AT/JNSoundboard
A very simple soundboard that allows you to add as many buttons as you want to be able to play your sounds.<br>
A left click plays the sound.<br>
A middle click allows you to modify the name of the button.<br>
A right click allows to select the audio file.<br>
Profiles, button configuration and other parameters are saved in an SQLite database.<br>
Use [VB-CABLE](https://vb-audio.com/Cable/index.htm) to create a virtual sound card.<br>
Set the default virtual input sound card.<br>
Then in your microphone settings, select "Listen to this device" and choose "Cable Input".<br>
In the application, in "Virtual Cable" choose "Cable Input", in microphone, your microphone and in Playback Device, your preferred audio output (Headphones, speaker)


|
bd9c489a-91e6-49ad-a47d-5645050d64a3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-07-23 16:48:04", "repo_name": "supenBenny/dumpling", "sub_path": "/src/main/java/org/dumpling/commons/filters/CharacterEncodingFilter.java", "file_name": "CharacterEncodingFilter.java", "file_ext": "java", "file_size_in_byte": 1095, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "cc4dc358906de1c0ce99a05014e46e38f932a8a2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/supenBenny/dumpling
| 212
|
FILENAME: CharacterEncodingFilter.java
| 0.229535
|
package org.dumpling.commons.filters;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class CharacterEncodingFilter implements Filter {
private String encoding;
private boolean forceEncoding = false;
public void setEncoding(String encoding) {
this.encoding = encoding;
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
this.encoding = filterConfig.getInitParameter("encoding");
}
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
if (this.encoding != null
&& (this.forceEncoding || request.getCharacterEncoding() == null)) {
request.setCharacterEncoding(this.encoding);
if (this.forceEncoding) {
response.setCharacterEncoding(this.encoding);
}
}
chain.doFilter(request, response);
}
@Override
public void destroy() {
}
}
|
898a0620-1c0c-425b-90a6-b28d2cac42c3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-24 11:30:46", "repo_name": "wizzdi/translation-model", "sub_path": "/src/main/java/com/flexicore/translation/model/Translation.java", "file_name": "Translation.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "2c8daa3109da08155da7a919394a28cea01219b5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wizzdi/translation-model
| 214
|
FILENAME: Translation.java
| 0.228156
|
package com.flexicore.translation.model;
import com.flexicore.model.Baseclass;
import jakarta.persistence.Entity;
import jakarta.persistence.ManyToOne;
@Entity
public class Translation extends Baseclass {
private String externalId;
private String languageCode;
@ManyToOne(targetEntity = Baseclass.class)
private Baseclass translated;
public Translation() {
}
public String getExternalId() {
return externalId;
}
public <T extends Translation> T setExternalId(String externalId) {
this.externalId = externalId;
return (T) this;
}
public String getLanguageCode() {
return languageCode;
}
public <T extends Translation> T setLanguageCode(String languageCode) {
this.languageCode = languageCode;
return (T) this;
}
@ManyToOne(targetEntity = Baseclass.class)
public Baseclass getTranslated() {
return translated;
}
public <T extends Translation> T setTranslated(Baseclass translated) {
this.translated = translated;
return (T) this;
}
}
|
76473ac1-373f-4b53-af76-2ba0c388c678
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-13 19:25:21", "repo_name": "mbhantooa/gistscanner", "sub_path": "/app/src/main/java/com/rezolve/gistscanner/data/GistRepository.java", "file_name": "GistRepository.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "cffc5367933f4ba5f2e297d1e8f3be6b65fb2c3f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mbhantooa/gistscanner
| 208
|
FILENAME: GistRepository.java
| 0.259826
|
package com.rezolve.gistscanner.data;
import com.rezolve.gistscanner.model.CreateGistResponse;
import com.rezolve.gistscanner.model.GistCommentListResponse;
import javax.inject.Inject;
import javax.inject.Singleton;
@Singleton
public class GistRepository {
private final IGistDataSource gistApi;
@Inject
public GistRepository(@Remote IGistDataSource gistApi) {
this.gistApi = gistApi;
}
public void fetchGistCommentList(String gistID, String username, String password,
IGistDataSource.Callback<GistCommentListResponse> callback) {
gistApi.getGistCommentList(gistID, username, password, callback);
}
public void createdGistComment(String gistID, String username,
String password, String comment,
IGistDataSource.Callback<CreateGistResponse> callback) {
gistApi.createGistComment(gistID, username, password, comment, callback);
}
}
|
2e9fe268-d201-4851-af34-67f1fda9eeb3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-27 16:09:49", "repo_name": "aubricoc/xolis-android", "sub_path": "/app/src/main/java/cat/aubricoc/xolis/server/repository/OauthAccessTokenRepository.java", "file_name": "OauthAccessTokenRepository.java", "file_ext": "java", "file_size_in_byte": 1005, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "0ca76c784805bde3530e9aceaf0b3366263b2b73", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/aubricoc/xolis-android
| 186
|
FILENAME: OauthAccessTokenRepository.java
| 0.236516
|
package cat.aubricoc.xolis.server.repository;
import cat.aubricoc.xolis.core.utils.Callback;
import cat.aubricoc.xolis.server.model.UserAuthentication;
import cat.aubricoc.xolis.server.utils.HttpErrorHandler;
import cat.aubricoc.xolis.server.utils.RequestBuilder;
public class OauthAccessTokenRepository {
private static final OauthAccessTokenRepository INSTANCE = new OauthAccessTokenRepository();
private static final String RESOURCE = "/oauth/access_token";
private OauthAccessTokenRepository() {
super();
}
public static OauthAccessTokenRepository getInstance() {
return INSTANCE;
}
public void add(UserAuthentication userAuthentication, Callback<UserAuthentication> callback, HttpErrorHandler errorHandler) {
RequestBuilder.newPostRequest(RESOURCE, UserAuthentication.class)
.body(userAuthentication)
.callback(callback::execute)
.errorHandler(errorHandler)
.execute();
}
}
|
ae25aa97-6c7c-44d6-b76f-e5ed16c11fda
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-04 16:02:46", "repo_name": "FK-Christian/GestionMagasin", "sub_path": "/src/Gestion/Licence/Licence.java", "file_name": "Licence.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "f1ac3e4fe0cbcb0494359242e2373fe7286eef8f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/FK-Christian/GestionMagasin
| 230
|
FILENAME: Licence.java
| 0.217338
|
/*
* 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 Gestion.Licence;
import java.io.Serializable;
import java.security.interfaces.RSAPrivateKey;
/**
*
* @author christian
*/
public class Licence implements Serializable{
private RSAPrivateKey privatekey;
private String licenceText;
private byte[] licenceTexttab;
public byte[] getLicenceTexttab() {
return licenceTexttab;
}
public void setLicenceTexttab(byte[] licenceTexttab) {
this.licenceTexttab = licenceTexttab;
}
public RSAPrivateKey getPrivatekey() {
return privatekey;
}
public void setPrivatekey(RSAPrivateKey privatekey) {
this.privatekey = privatekey;
}
public String getLicenceText() {
return licenceText;
}
public void setLicenceText(String licenceText) {
this.licenceText = licenceText;
}
}
|
4058fc9b-94c6-4fa1-899d-c041ec75a242
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-12-13T21:03:19", "repo_name": "maccypher/skeleton", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1177, "line_count": 42, "lang": "en", "doc_type": "text", "blob_id": "414d60e1b3d402444c0dac700473a4b1c0d1773d", "star_events_count": 3, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/maccypher/skeleton
| 315
|
FILENAME: README.md
| 0.259826
|
# Skeleton
## Requirements
- NPM is required -> [https://www.npmjs.org/](https://www.npmjs.org/)
## Getting started:
1. download / clone into a folder on your local machine
2. cd into 'skeleton/'
3. run (bower components will be automatically installed):
npm install
4. to start the server just run:
npm start
or:
npm run watch
5. by default the server runs on port **5000** and you can call [http://localhost:5000](http://localhost:5000) in your browser
6. need / like another port? start the server by running this command:
PORT=<PORTNUMBER> npm run watch
## Notes
The live reload server is listening on the user given port+**1** or by default on port 5001. **Skeleton** creates a dedicated output folder called "**dest/**" and all the compiled stuff will be copied into this folder. The application URL points to this folder.
##### Example:
If your server was started by the command:
PORT=3333 npm run watch
the live reload server is listening on port ***3334***.
## Credits / Thanks
Thanks to [Mupat](https://github.com/mupat) for the [Gulp-Tasks](https://github.com/mupat/gulp-tasks) and the whole support for this little project.
|
ff1f169d-2f2b-4ba9-aff8-0543a0ee2d89
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-26 14:28:02", "repo_name": "lianghuazhang/githubdemo", "sub_path": "/src/test/java/com/example/springbootlogliz01/SpringBootLogLiz01ApplicationTests.java", "file_name": "SpringBootLogLiz01ApplicationTests.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "8c9960d8b0daa2d2e369dfbd32331f2ffb24d137", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lianghuazhang/githubdemo
| 220
|
FILENAME: SpringBootLogLiz01ApplicationTests.java
| 0.212069
|
package com.example.springbootlogliz01;
import com.example.springbootlogliz01.pojo.User;
import com.example.springbootlogliz01.service.UserService;
import com.example.springbootlogliz01.service.impl.UserviceImpl;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringBootLogLiz01ApplicationTests {
@Autowired
private UserService userService;
@Test
void contextLoads() {
Logger log = LoggerFactory.getLogger(getClass());
// 日志级别 trace<debug<info<warn<error
log.trace("trace 日志");
log.debug("调试信息");
log.info("自定义信息");
log.warn("警告信息");
log.error("异常信息");
// User user = new User();
// user.setAge(18);
// user.setName("liz");
// user.setSex("男");
// userService.add(user);
}
}
|
8b029db8-a6d1-4201-94ad-895a59bbf588
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-21 06:54:47", "repo_name": "liveqmock/lnkapp-gwk", "sub_path": "/src/main/java/org/fbi/gwk/domain/tps/record/Record9905.java", "file_name": "Record9905.java", "file_ext": "java", "file_size_in_byte": 1153, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "a7b4ba8b8bed20751c3fd275c9480fceca8cd49e", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/liveqmock/lnkapp-gwk
| 260
|
FILENAME: Record9905.java
| 0.2227
|
package org.fbi.gwk.domain.tps.record;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import org.fbi.gwk.domain.tps.base.TpsMsgBodyBatchRecord;
/**
* Created by zhanrui on 2015/3/11.
*/
@XStreamAlias("Record")
public class Record9905 extends TpsMsgBodyBatchRecord {
private String user_code = "";
private String password = "";
private String new_password = "";
public String getUser_code() {
return user_code;
}
public void setUser_code(String user_code) {
this.user_code = user_code;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getNew_password() {
return new_password;
}
public void setNew_password(String new_password) {
this.new_password = new_password;
}
@Override
public String toString() {
return "\n\t\tRecord9905{" +
"user_code='" + user_code + '\'' +
", password='" + password + '\'' +
", new_password='" + new_password + '\'' +
'}';
}
}
|
682fb767-057f-4a85-a38a-2f8ad7602cd1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-04-17T21:25:44", "repo_name": "stmoreau/general-fe-knowledge", "sub_path": "/generic-questions/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 977, "line_count": 20, "lang": "en", "doc_type": "text", "blob_id": "8ec84922b6597f2e960dfa6c48edd24947e03c28", "star_events_count": 2, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/stmoreau/general-fe-knowledge
| 285
|
FILENAME: README.md
| 0.239349
|
# Generic questions
1. [What is the call stack?](call-stack.md)
2. [What is Function Composition?](function-composition.md)
3. [What are Higher order functions? (one sentence)](higher-order-functions.md)
4. [What are the three phases of a compiler?](compiler.md)
5. [What is variable shadowing?](shadowing.md)
6. [Describe the steps that happen when a file is run. (in depth img)](in-depth.md)
7. [What happens when you type in a URL?](what-happens-when-you-type-url.md)
8. [What is REST?](what-is-rest.md)
9. [Brief http history](http-history.md)
10. [What Is HTTPS, and Why Should I Care?](https.md)
11. [What is CORS?](cors.md)
12. [Main Difference Between PUT and PATCH Requests](patch-vs-put.md)
13. [Top 10 web security threats](security-threats.md)
14. [Local Storage vs Session Storage vs Cookie](LocalStorage-SessionStorage-Cookie.md)
15. [JWT](jwt.md)
16. [What is NginX and What are its use cases?](nginx.md)
17. [Handle user permisions with react & CASL](casl.md)
|
329131f3-1b68-4862-8d36-91a7e091c7f9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-11 19:47:24", "repo_name": "Fucyd/simplerestproject", "sub_path": "/src/main/java/pl/michalski/restproject/orders/OrderModelAssembler.java", "file_name": "OrderModelAssembler.java", "file_ext": "java", "file_size_in_byte": 1177, "line_count": 27, "lang": "en", "doc_type": "code", "blob_id": "b774da75d38fdcb182c641568c7442deb63d376a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Fucyd/simplerestproject
| 223
|
FILENAME: OrderModelAssembler.java
| 0.281406
|
package pl.michalski.restproject.orders;
import org.springframework.hateoas.EntityModel;
import org.springframework.hateoas.server.RepresentationModelAssembler;
import org.springframework.stereotype.Component;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn;
@Component
public class OrderModelAssembler implements RepresentationModelAssembler<Order, EntityModel<Order>> {
@Override
public EntityModel<Order> toModel(Order entity) {
EntityModel<Order> orderModel = EntityModel.of(entity,
linkTo(methodOn(OrderController.class).oneOrder(entity.getId())).withSelfRel(),
linkTo(methodOn(OrderController.class).allOrders()).withRel("orders"));
if(entity.getStatus() == Status.IN_PROGRESS){
orderModel.add(
linkTo(methodOn(OrderController.class).cancelOrder(entity.getId())).withRel("cancel"));
orderModel.add(
linkTo(methodOn(OrderController.class).completeOrder(entity.getId())).withRel("complete"));
}
return orderModel;
}
}
|
a8287792-b5dc-4877-aff5-5d48426ca216
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-01-29 06:13:11", "repo_name": "angelmaskill/demo", "sub_path": "/src/main/java/com/netty/NettyStickyPacket/DelimiterBaseFrame/Server/DelimiterDecoderServerHandler.java", "file_name": "DelimiterDecoderServerHandler.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "9abaf928b2455acf81d00913a5447c4a463cc452", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/angelmaskill/demo
| 213
|
FILENAME: DelimiterDecoderServerHandler.java
| 0.247987
|
package com.netty.NettyStickyPacket.DelimiterBaseFrame.Server;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
public class DelimiterDecoderServerHandler extends ChannelHandlerAdapter {
private int counter;
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
System.out.println("服务器端开始接收数据:");
String body = (String) msg;
System.out.println("This is " + (++counter) + " receive client msg " + body);
String sendContent = "receive message is ok:" + "$_";
ByteBuf byteBuf = Unpooled.copiedBuffer(sendContent.getBytes());
ctx.writeAndFlush(byteBuf);
}
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
ctx.flush();
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
ctx.close();
}
}
|
3c848ecd-ebdf-4013-b62b-68146dd1bffd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-01-05T16:38:13", "repo_name": "codertd/react-hw", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1153, "line_count": 31, "lang": "en", "doc_type": "text", "blob_id": "dbb317ee543200a029e460eb3390d9ea21b481ca", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/codertd/react-hw
| 283
|
FILENAME: README.md
| 0.249447
|
# react-hw
A React/Express client/server bundle
### Based the boilerplate https://github.com/crsandeep/simple-react-full-stack
## Features
### Client and Server code
Under /src, there are both client and server directories. Client is a React app, while Server contains an express api.
I've added a React Router (v5) to enable basic routing to sub-components from App.js.
### Unit tests via Jest
Jest has been configured to mock css and binary assets. SetupTests.js is performing various setup of modules. Package.json has "test" and "testAll" commands that run tests locally with a watch, or without a watch so a branch can run all tests and report errors to fail the pipeline.
### Eslint
Husky has been setup in package.json to lint on a commit. Lint also run in the pipeline.
### Dockerize
The Dockerfile uses a multi-stage build to setup and build, then copy the production code into place for execution.
To build (with a Dockerfile.dev, for example)
docker build -f Dockerfile.dev -t sample:dev .
To Spin up and exec a shell to inspect the FS
docker run -it sample:dev sh
To spin it up and test it.
docker run -p 5000:5000 sample:dev
|
ecc6fbe4-e12e-41c7-8c74-901fa489d0ce
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-24 19:46:56", "repo_name": "Aleks1696/Ampoule", "sub_path": "/Ampoule_WEB/src/main/java/com/web/service/CardServiceImpl.java", "file_name": "CardServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1005, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "b0a21df74ec12ba67921b38ba949cd45a6264e6c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Aleks1696/Ampoule
| 191
|
FILENAME: CardServiceImpl.java
| 0.267408
|
package com.web.service;
import com.web.dao.CardRepository;
import com.web.domain.Card;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CardServiceImpl implements CardService {
private CardRepository cardRepository;
@Autowired
public CardServiceImpl(CardRepository cardRepository) {
this.cardRepository = cardRepository;
}
public Long createCard(Card card) {
return cardRepository.saveAndFlush(card).getId();
}
public boolean cardSingIn(String login, String password) {
return false;
}
public Card getCard(Long id) {
return cardRepository.findByIdEquals(id);
}
public void update(Card card) {
cardRepository.saveAndFlush(card);
}
public void deleteNote(Long id) {
cardRepository.delete(id);
}
public List<Card> findAllCard() {
return cardRepository.findAll();
}
}
|
55e4efc7-b061-4a49-8805-e0908c727fc8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-02-21 14:47:30", "repo_name": "Niyijie/java-project", "sub_path": "/qq/client/QQClient.java", "file_name": "QQClient.java", "file_ext": "java", "file_size_in_byte": 1006, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "9bfa362e20c428c7574c02d0cc401e045df702a7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Niyijie/java-project
| 227
|
FILENAME: QQClient.java
| 0.262842
|
package client;
import common.MessageFactory;
import common.Util;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;
public class QQClient extends Thread{
private Socket clientSock = null;
private QQClientUI ui = null;
public QQClient(Socket sock)
{
clientSock = sock;
ui = new QQClientUI(sock);
}
public void run() {
ui.sendLineOnMessage();
while (true) {
try {
MessageFactory.parseServerMessage(clientSock,ui);
} catch (Exception e) {
e.printStackTrace();
break;
}
}
}
public static void main(String[] args)
{
try {
// 47.93.213.146
Socket sock = new Socket("47.93.213.146", 8889);
QQClient c = new QQClient(sock);
c.start();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.