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
|
|---|---|---|---|---|---|---|
8970f05a-f27f-4af4-ab29-3302f8da4984
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-21 04:28:03", "repo_name": "jcbarbour72/InstrumentMaintenance", "sub_path": "/InstrumentMaintenanceGUI/src/instrumentmaintenancegui/Acoustic.java", "file_name": "Acoustic.java", "file_ext": "java", "file_size_in_byte": 1204, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "7521bacc12e6630f216822e8f00ce1ae0f9624f7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jcbarbour72/InstrumentMaintenance
| 268
|
FILENAME: Acoustic.java
| 0.23092
|
/**
*
*/
package instrumentmaintenancegui;
import java.io.Serializable;
/**
*
* @author Coleman Barbour
*/
class Acoustic extends Guitar implements Serializable{
/**
* Variable Initializers
*/
private String humidificationType;
private int humidificationDate;
/**
* An Enum to define the type of humidification
*/
private enum HumidificationType{ NONE, DAMP_IT, CLIMATE_CONTROL, HYDRO_PACKS };
/**
* Constructor
*/
public Acoustic(){
}
/**
* @return the humidificationType
*/
public String getHumidificationType() {
return humidificationType;
}
/**
* @param humidificationType the humidificationType to set
*/
public void setHumidificationType(String humidificationType) {
this.humidificationType = humidificationType;
}
/**
* @return the humidificationDate
*/
public int getHumidificationDate() {
return humidificationDate;
}
/**
* @param humidificationDate the humidificationDate to set
*/
public void setHumidificationDate(int humidificationDate) {
this.humidificationDate = humidificationDate;
}
}
|
9cba3b11-528f-4cde-922a-7b8832fabd6b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-24 06:28:52", "repo_name": "tomxukui/EaseMob", "sub_path": "/easeui/src/main/java/com/hyphenate/easeui/dao/UserDao.java", "file_name": "UserDao.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "3be600f0b9726bea3365dd958dd3fad5d2fd071f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tomxukui/EaseMob
| 224
|
FILENAME: UserDao.java
| 0.226784
|
package com.hyphenate.easeui.dao;
import com.hyphenate.easeui.domain.EaseUser;
import java.util.List;
import java.util.Map;
public class UserDao {
public static final String TABLE_NAME = "contactuser";
public static final String COLUMN_NAME_ID = "username";
public static final String COLUMN_NAME_NICK = "nickname";
public static final String COLUMN_NAME_AVATAR = "avatar";
/**
* 保存联系人列表
*/
public void saveContactList(List<EaseUser> contactList) {
DbManager.getInstance().saveContactList(contactList);
}
/**
* 获取联系人
*/
public Map<String, EaseUser> getContactList() {
return DbManager.getInstance().getContactList();
}
/**
* 删除联系人
*/
public void deleteContact(String username) {
DbManager.getInstance().deleteContact(username);
}
/**
* 保存联系人
*/
public void saveContact(EaseUser user) {
DbManager.getInstance().saveContact(user);
}
}
|
b92aef1a-68cb-441b-ad63-4097fd39c74a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-29 15:02:01", "repo_name": "HubertYoung/AcFun", "sub_path": "/acfun5_7/src/main/java/org/junit/rules/ErrorCollector.java", "file_name": "ErrorCollector.java", "file_ext": "java", "file_size_in_byte": 1031, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "39c7c8ce7f0b620302315c5cae23742669dc48c9", "star_events_count": 6, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/HubertYoung/AcFun
| 220
|
FILENAME: ErrorCollector.java
| 0.294215
|
package org.junit.rules;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import org.hamcrest.Matcher;
import org.junit.Assert;
import org.junit.runners.model.MultipleFailureException;
public class ErrorCollector extends Verifier {
private List<Throwable> a = new ArrayList();
protected void a() throws Throwable {
MultipleFailureException.assertEmpty(this.a);
}
public void a(Throwable th) {
this.a.add(th);
}
public <T> void a(T t, Matcher<T> matcher) {
a("", t, matcher);
}
public <T> void a(final String str, final T t, final Matcher<T> matcher) {
a(new Callable<Object>() {
public Object call() throws Exception {
Assert.a(str, t, matcher);
return t;
}
});
}
public <T> T a(Callable<T> callable) {
try {
return callable.call();
} catch (Throwable th) {
a(th);
return null;
}
}
}
|
cf9eff0a-95f4-49a7-80b8-25ffb7a57135
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-08-31 23:30:23", "repo_name": "grmaciel/android-good-practices-study", "sub_path": "/app/src/test/java/LoginActivityTest.java", "file_name": "LoginActivityTest.java", "file_ext": "java", "file_size_in_byte": 971, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "ff1dacc4bb5049fea37243a7855565eccbc36ae1", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/grmaciel/android-good-practices-study
| 198
|
FILENAME: LoginActivityTest.java
| 0.239349
|
import android.content.Intent;
import org.junit.Test;
import org.robolectric.Robolectric;
import org.robolectric.Shadows;
import br.com.lowestprice.view.activity.LoginActivity;
import br.com.lowestprice.view.activity.RegistrationActivity;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Created by Gilson Maciel on 29/07/2015.
*/
public class LoginActivityTest extends BaseTest {
private LoginActivity activity;
@Override
public void setup() {
this.activity = Robolectric.setupActivity(LoginActivity.class);
}
@Test
public void resgiterButtonClickOpensRegisterActivity() {
activity.getBtnRegisterEmail().performClick();
Intent expectedIntent = new Intent(activity, RegistrationActivity.class);
assertThat(Shadows.shadowOf(activity).getNextStartedActivity())
.isEqualTo(expectedIntent);
}
@Override
public void tearDown() {
this.activity = null;
}
}
|
d44c45cd-6fb7-4b27-8262-7d64793c7d4b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-09 19:52:54", "repo_name": "mccreery/sandbox", "sub_path": "/java/textadventure/src/main/java/adventure/item/Item.java", "file_name": "Item.java", "file_ext": "java", "file_size_in_byte": 1069, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "d5776279646d4e57c3564a7f98dfd1b14b476503", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/mccreery/sandbox
| 225
|
FILENAME: Item.java
| 0.284576
|
package adventure.item;
import adventure.INamed;
public class Item implements INamed {
public static final Item LIT_TORCH = new Torch(true);
public static final Item UNLIT_TORCH = new Torch(false);
public static final Item FLINT = new Item("flint");
private final String nameKey;
public Item(String nameKey) {
this.nameKey = nameKey;
}
@Override
public String getNameKey() {
return nameKey;
}
/**
* @return The result of combining the two items, with {@code this} as the
* primary ingredient.
*/
protected Item combine(Item item) {
return null;
}
/**
* Attempts to combine the primary ingredient with the secondary ingredient,
* then the reverse.
*
* @return The first successful combination.
*/
public static Item combine(Item primary, Item secondary) {
Item combination = primary.combine(secondary);
if (combination == null) {
combination = secondary.combine(primary);
}
return combination;
}
}
|
0bab57c7-6217-48fb-8d7c-c83e77bc9f4b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-26 02:03:04", "repo_name": "cainiaobang/smart-framework", "sub_path": "/src/main/java/org/smart4j/framework/Util/CodeUtil.java", "file_name": "CodeUtil.java", "file_ext": "java", "file_size_in_byte": 1116, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "92ccd021ac3e5f209f2e635c766baf340f3f7681", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/cainiaobang/smart-framework
| 227
|
FILENAME: CodeUtil.java
| 0.288569
|
package org.smart4j.framework.Util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URLDecoder;
import java.net.URLEncoder;
import org.apache.commons.codec.digest. DigestUtils;
public final class CodeUtil {
private static final Logger LOGGER= LoggerFactory.getLogger(CodeUtil.class);
public static String encodeURL(String source){
String target;
try{
target= URLEncoder.encode(source,"UTF-8");
}catch (Exception e){
LOGGER.error("encode url failure",e);
throw new RuntimeException(e);
}
return target;
}
public static String decodeURL(String source){
String target;
try{
target= URLDecoder.decode(source,"UTF-8");
}catch(Exception e){
LOGGER.error("decode url failure",e);
throw new RuntimeException(e);
}
return target;
}
public static String md5(String source){
return DigestUtils.md5Hex(source);
}
public static void main(String[] args){
System.out.println(DigestUtils.md5Hex("12"));
}
}
|
cea94259-2735-4fcf-8226-e7f766e7193e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-16 06:26:06", "repo_name": "SijiaLiu/testgit", "sub_path": "/folder/15843_中台_刘斯佳/src/main/Service/LoginService.java", "file_name": "LoginService.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "6f0cb1617f2ca66cd6136ba9f25342aeba425052", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SijiaLiu/testgit
| 205
|
FILENAME: LoginService.java
| 0.273574
|
package main.Service;
import main.Dao.Dao;
import main.DaoImpl.DaoImpl;
import main.Entity.Customer;
import main.Util.ConnectionFactory;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* Created by LiuSijia on 2017/8/15.
*/
public class LoginService {
private Dao dao = new DaoImpl();
public boolean checkUser(Customer customer){
Connection connection = null;
try {
ConnectionFactory cf = ConnectionFactory.getInstance();
connection = cf.makeConnection();
ResultSet rs = dao.findUserByName(connection, customer);
while (rs.next()){
return true;
}
} catch (SQLException e) {
e.printStackTrace();
try {
connection.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}finally {
try {
connection.close();
} catch (SQLException e2) {
e2.printStackTrace();
}
}
}
return false;
}
}
|
419271f3-3333-4bd1-b6e2-a23f561f02d5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-23 13:27:15", "repo_name": "rajksaha/hospital_platform", "sub_path": "/service/src/main/java/com/raydar/service/echo/ModuleService.java", "file_name": "ModuleService.java", "file_ext": "java", "file_size_in_byte": 1088, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "1418fbad04df3c23c6175c561c6642c4640b8dff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rajksaha/hospital_platform
| 225
|
FILENAME: ModuleService.java
| 0.262842
|
package com.raydar.service.echo;
import com.raydar.common.exception.RaydarException;
import com.raydar.mybatis.domain.echo.ModuleData;
import com.raydar.mybatis.persistence.echo.ModuleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* Created by raj on 6/1/2016.
*/
@Service
public class ModuleService {
@Autowired
private ModuleMapper moduleMapper;
public void create(ModuleData data) throws RaydarException {
moduleMapper.create(data);
}
public void update(ModuleData data) throws RaydarException{
moduleMapper.update(data);
}
public ModuleData getByID(Integer ID)throws RaydarException{
return this.moduleMapper.getByID(ID);
}
public List<ModuleData> getByParam(Map<String, Object> param) throws RaydarException{
return this.moduleMapper.getByParam(param);
}
public void delete (Map<String,Object> param) throws RaydarException {
this.moduleMapper.delete(param);
}
}
|
8ddc0cbe-f9b1-454a-a735-201001dbf940
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-02-01 14:55:02", "repo_name": "rlopes85/SDIS_servoClock", "sub_path": "/src/Master/SysCall.java", "file_name": "SysCall.java", "file_ext": "java", "file_size_in_byte": 1170, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "c8a09c3492183f396808394558609cf0c21c9a04", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rlopes85/SDIS_servoClock
| 221
|
FILENAME: SysCall.java
| 0.247987
|
package Master;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Chamada ao sistema
* @author Ricardo Lopes
*
*/
public class SysCall {
String result = "";
/**
* Execução de chamada ao sistema
* @param command Sring com o comando a executar pelo SO.
*/
public SysCall (String command){
Process proc = null;
try {
proc = Runtime.getRuntime().exec(command);
BufferedReader stdImput = new BufferedReader(new InputStreamReader(proc.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
String buff;
while ((buff = stdImput.readLine()) != null) {
result = buff;
System.out.println(result + "Success");
}
while ((buff = stdError.readLine()) != null){
result = buff;
System.out.println(result + "fail");
}
} catch (IOException e) {
System.out.println("Ocurreu uma excepção !!");
e.printStackTrace();
}
}
}
|
d167d478-116d-46ba-b86a-c1c244bc20e6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-31 14:35:44", "repo_name": "yrjkqq/CourseManagement", "sub_path": "/src/com/cdsxt/po/Student.java", "file_name": "Student.java", "file_ext": "java", "file_size_in_byte": 1085, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "83015b333e2ebe0ef64455857885f0c9c5fe01a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yrjkqq/CourseManagement
| 238
|
FILENAME: Student.java
| 0.280616
|
package com.cdsxt.po;
import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;
@Entity
@Table(name = "test_student")
public class Student {
@Id
@SequenceGenerator(name = "studentGen", sequenceName = "seq_test_student")
@GeneratedValue(generator = "studentGen")
private Integer sid;
private String sname;
@ManyToMany
@JoinTable(
name = "test_student_course",
joinColumns = {
@JoinColumn(name = "sid")
},
inverseJoinColumns = {
@JoinColumn(name = "cid")
}
)
private Set<Course> courses = new HashSet<>();
public Integer getSid() {
return sid;
}
public void setSid(Integer sid) {
this.sid = sid;
}
public String getSname() {
return sname;
}
public void setSname(String sname) {
this.sname = sname;
}
public Set<Course> getCourses() {
return courses;
}
public void setCourses(Set<Course> courses) {
this.courses = courses;
}
}
|
790eea45-2313-4d46-af98-8b6d532115a3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-07 11:05:03", "repo_name": "tornqvistb/tage-sthlm", "sub_path": "/src/main/java/se/goteborg/retursidan/service/ExpireService.java", "file_name": "ExpireService.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "8eb2dc6b449de2b41a694e925468313703d4617b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tornqvistb/tage-sthlm
| 232
|
FILENAME: ExpireService.java
| 0.287768
|
package se.goteborg.retursidan.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import se.goteborg.retursidan.dao.AdvertisementDAO;
import se.goteborg.retursidan.dao.RequestDAO;
@Service
@Transactional(propagation = Propagation.REQUIRES_NEW)
public class ExpireService {
private static Log logger = LogFactoryUtil.getLog(ExpireService.class);
@Autowired
AdvertisementDAO advertisementDAO;
@Autowired
RequestDAO requestDAO;
public void expireAds(int days) {
logger.debug("Expiring ads older than " + days + " days.");
int count = advertisementDAO.expireOldAds(days);
logger.debug(count + " ads were expired.");
}
public void expireRequests(int days) {
logger.debug("Expiring requests older than " + days + " days.");
int count = requestDAO.expireOldRequests(days);
logger.debug(count + " requests were expired.");
}
}
|
7cc276df-a992-4ec9-8d27-53c66ef33769
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-12 23:23:45", "repo_name": "gaofu/XposedHook", "sub_path": "/app/src/main/java/gaofu/xposedhook/domain/HookClass.java", "file_name": "HookClass.java", "file_ext": "java", "file_size_in_byte": 1164, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "f59b08b206ce9808f59d73960bdb7bcabb216f40", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/gaofu/XposedHook
| 255
|
FILENAME: HookClass.java
| 0.233706
|
package gaofu.xposedhook.domain;
import java.util.List;
/**
* Created by gaofu.
* Created on 2016/5/2.
*/
public class HookClass {
private String name;
private String tag;
private boolean constructor;
private List<HookMethod> hookMethods;
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<HookMethod> getHookMethods() {
return hookMethods;
}
public void setHookMethods(List<HookMethod> hookMethods) {
this.hookMethods = hookMethods;
}
public boolean isConstructor() {
return constructor;
}
public void setConstructor(boolean constructor) {
this.constructor = constructor;
}
@Override
public String toString() {
return "HookClass{" +
"tag='" + tag + '\'' +
", name='" + name + '\'' +
", constructor=" + constructor +
", hookMethods=" + hookMethods +
'}';
}
}
|
e30b0cd5-5980-4ea1-a5ec-c69deec778aa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-09T23:44:04", "repo_name": "shreyasdamle2017/Restaurant_Review_Mobile_App", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1140, "line_count": 13, "lang": "en", "doc_type": "text", "blob_id": "5468c05cad57d244d72ea6610d138602a26ab014", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/shreyasdamle2017/Restaurant_Review_Mobile_App
| 241
|
FILENAME: README.md
| 0.23793
|
# Restaurant_Review_Mobile_App
Mobile IOS/Android application which fetches restaurants and reviews in the New York with the help of RESTful api provided by Yelp
This app is developed using React-Native with the help of Yelp-Api to get updated JSON data.
This app has additonal dependencies which you can download by first downloading all the files, then navigate inside the folder using terminal and then hit "npm install" and then "npm start". This will download the dependencies required for this project.
As for the security reasons, I have not included my personal Yelp API key, so, you have to request your personal key from Yelp.com/fusion and this key has to be inserted in the "src/api/yelp.js" file. Inside the "yelp.js" file you can find "Insert your key here" text in front of "Bearer". Please insert key at this location.
This project makes use of reusable react-native components, hooks Rest APIs, etc. You can also change the location from new york to any other location supported by Yelp by changing the value inside the "location" parameter inside useResults.js file.
You can find all the project files in the Master.
|
101b9323-569c-4eb5-9de6-dc242944a07b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-27 02:27:11", "repo_name": "ifpb-disciplinas-2016-2/dac-topicos-especiais", "sub_path": "/src/main/java/ifpb/ads/dac/aop/LogEntities.java", "file_name": "LogEntities.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "f3c974e8063422198d11be82988165b142163b69", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ifpb-disciplinas-2016-2/dac-topicos-especiais
| 252
|
FILENAME: LogEntities.java
| 0.255344
|
package ifpb.ads.dac.aop;
import ifpb.ads.dac.domain.Aluno;
import java.time.LocalDateTime;
import javax.persistence.PostLoad;
import javax.persistence.PostPersist;
import javax.persistence.PrePersist;
/**
* @author Ricardo Job
* @mail ricardo.job@ifpb.edu.br
* @since 26/04/2017, 08:01:51
*/
public class LogEntities {
@PrePersist
public void antesDePersistir(Object object) {
String value = String.format("aluno: %s, salvo em: %s", object.toString(),
LocalDateTime.now().toString());
System.out.println(value);
}
@PostPersist
public void aposPersistir(Object object) {
String value = String.format("aluno: %s, salvo em: %s", object.toString(),
LocalDateTime.now().toString());
System.out.println(value);
}
@PostLoad
public void aposCarregar(Object object) {
String value = String.format("aluno: %s, carregado em: %s", object.toString(),
LocalDateTime.now().toString());
System.out.println(value);
}
}
|
fe1904aa-6047-476e-9a25-e39dd5953866
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-21 19:32:59", "repo_name": "sathish256/zoneddatetime-spring-boot", "sub_path": "/src/main/java/com/sat/poc/datetime/api/DateController.java", "file_name": "DateController.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "b117b6499e23565f35bb3593277b338c58ecf7d9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/sathish256/zoneddatetime-spring-boot
| 179
|
FILENAME: DateController.java
| 0.256832
|
package com.sat.poc.datetime.api;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@RestController
@RequestMapping("/v1/date")
public class DateController {
@PostMapping
public ResponseEntity<DatePojo> save(@RequestBody DatePojo datePojo) {
System.out.println("Request received");
try {
printPojo(datePojo);
}catch(Exception ex) {
ex.printStackTrace();
}
return ResponseEntity.ok(datePojo);
}
private void printPojo(DatePojo datePojo) throws JsonProcessingException {
ObjectMapper objMapper = new ObjectMapper();
System.out.println(objMapper.writeValueAsString(datePojo));
}
}
|
523af6bf-4a60-4a4d-ab6f-552ad1a14365
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-07 02:29:38", "repo_name": "WhosNickDoglio/NYCSchools", "sub_path": "/app/src/main/java/com/nicholasdoglio/nycschools/ui/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1165, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "d5083fe6cc0b4c8c1512cfc6f6ed83beff10d338", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/WhosNickDoglio/NYCSchools
| 209
|
FILENAME: MainActivity.java
| 0.224055
|
package com.nicholasdoglio.nycschools.ui;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import com.nicholasdoglio.nycschools.R;
import com.nicholasdoglio.nycschools.ui.common.NavigationController;
import javax.inject.Inject;
import dagger.android.AndroidInjection;
import dagger.android.DispatchingAndroidInjector;
import dagger.android.support.HasSupportFragmentInjector;
/**
* @author Nicholas Doglio
*/
public class MainActivity extends AppCompatActivity implements HasSupportFragmentInjector {
@Inject
DispatchingAndroidInjector<Fragment> fragmentAndroidInjector;
@Inject
NavigationController navigationController;
@Override
protected void onCreate(Bundle savedInstanceState) {
AndroidInjection.inject(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
navigationController.openListFragment();
}
}
@Override
public DispatchingAndroidInjector<Fragment> supportFragmentInjector() {
return fragmentAndroidInjector;
}
}
|
44fd8dcc-ef6f-46a1-9649-a6137699e827
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2015-11-03T15:05:15", "repo_name": "tpitale/watch_later", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1142, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "ac9edddc17c97b876eb882cf8466e2f7d40bf132", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tpitale/watch_later
| 291
|
FILENAME: README.md
| 0.253861
|
# Watch Later #
At some point I saw a neat page that GitHub put up of all the speaking their
team did. Since then, I've wanted a page of my own, but, not just for my own
speaking, but any videos that I had queued up in Instapaper.
This is that page.
## About ##
This setup has three parts:
1. A ruby script which uses the Instapaper API (via the instapaper rubygem) to download all the bookmarks in a particular folder.
2. The json download from the previous step
3. An html file and a javascript file configured to look for that json file, and display youtube embeds
### The Ruby ###
To set up the ruby, you'll need to clone the repo into `~/.instapaper`, `cd` in, and run `bundle install`. After that, run `bin/update_watch_later unread`
(or some other folder_id) using cron. I run it every 5 minutes.
### The json ###
Will get downloaded by cron.
### The html/js ###
Crack open the index.html, and change the body's `data-folder-id` to "unread", or whatever you used when running the `bin/update_watch_later` command.
## Pulling it ALL together ##
Lastly, run `foreman start`. Open your browser to `localhost:8000` and enjoy!
|
67ead292-c4f3-4da1-973e-0ea6b89697a9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-11 09:17:56", "repo_name": "qqhard/game", "sub_path": "/user/src/main/java/crazy/action/UserDetailAction.java", "file_name": "UserDetailAction.java", "file_ext": "java", "file_size_in_byte": 2518, "line_count": 71, "lang": "en", "doc_type": "code", "blob_id": "2bb7189ded7d49257ad519fcbb9e41504c5ec6f7", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/qqhard/game
| 201
|
FILENAME: UserDetailAction.java
| 0.240775
|
package crazy.action;
import java.util.HashMap;
import java.util.Map;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class UserDetailAction {
@RequestMapping(value = "/get_username", method = RequestMethod.GET)
public String testUsername() {
System.out.println(SecurityContextHolder.getContext().getAuthentication().getDetails());
return SecurityContextHolder.getContext().getAuthentication().getName();
}
@RequestMapping(value = "/get_userinfo", method = RequestMethod.GET)
public String testUserinfo() {
Map<String,String> ret = new HashMap<String,String>();
Object obj = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if( obj instanceof UserDetails){
return ((UserDetails)obj).getUsername();
}
return String.valueOf(obj);
}
}
|
47cfddaa-4d73-4c06-95c9-e1c6834582ec
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-20 12:41:13", "repo_name": "dipeshiem/microservice", "sub_path": "/netflix-zuul/src/main/java/com/training/netflixzuul/ZuulFilterSample.java", "file_name": "ZuulFilterSample.java", "file_ext": "java", "file_size_in_byte": 1053, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "a822c2f75dbcb104a45d51e44f1ae8e66b22ebee", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dipeshiem/microservice
| 221
|
FILENAME: ZuulFilterSample.java
| 0.243642
|
/**
*
*/
package com.training.netflixzuul;
import javax.servlet.http.HttpServletRequest;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
/**
* @author dipesh
*
*/
public class ZuulFilterSample extends ZuulFilter {
@Override
public boolean shouldFilter() {
return true;
}
@Override
public Object run() throws ZuulException {
RequestContext ctx = RequestContext.getCurrentContext();
System.out.println(RequestContext.getCurrentContext().getRequest().getRequestURI());
System.out.println("zull Gateway ");
HttpServletRequest request = ctx.getRequest();
String userName = request.getHeader("user");
String authorizationKey = request.getHeader("authorization");
// String[] userTokens = authorizationKey.split(" ", 2);
// authorizationKey=userTokens[1];
return null;
}
@Override
public String filterType() {
return "pre";
}
@Override
public int filterOrder() {
return 1;
}
}
|
d1bf522f-abe8-465d-9821-2db39a3053e2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-07-04T19:24:29", "repo_name": "waffle-iron/SOLSV", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1143, "line_count": 15, "lang": "en", "doc_type": "text", "blob_id": "4fbed410ec9cae2b0c656aaa2372d31f9c6bd142", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/waffle-iron/SOLSV
| 273
|
FILENAME: README.md
| 0.2227
|
[](https://waffle.io/pnshr/SOLSV?utm_source=badge)
# Streetz of Los Santos
The Streetz of Los Santos is the first and only Grand Theft: Mutli-Player roleplay server based on the story line and concept of the original game. Delivering fun, doubtlessly.
# San Andreas Multiplayer
The Streetz of Los Santos™ is the first and only San Andreas: Mutli-Player roleplay server based on the story line and concept of the original game. Delivering fun, doubtlessly. With our lively community, 10 years of success and gangster roleplay that you've seen nowhere else, you would surely be amazed and love having that 90's feel.
# GTA Network : GTA V
After 10 long years that we ran the San Andreas Multiplayer server and made insane development, we have decided to move on to the next trend - Grand Theft Auto V and more specifically GTA:Network. We aim to provide unique feeling and great text-based roleplay while keeping the gangster theme at the same time. Dive into the limitless world of possibilities and modern roleplay.
MAIN WEBSITE: https://sols-rpg.com
|
e4d7aeb5-bd32-45ae-a1de-9a955faac90c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-25 03:26:47", "repo_name": "govi22d/PracticeProjectsJava", "sub_path": "/SpringProject/src/main/java/spring/example/SpringProject/EmployeeController.java", "file_name": "EmployeeController.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "d710af7b0e12705980b55062920a0972a77b1faf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/govi22d/PracticeProjectsJava
| 212
|
FILENAME: EmployeeController.java
| 0.272025
|
package spring.example.SpringProject;
import java.util.List;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class EmployeeController {
@RequestMapping("/getemployees")
public String getemployees() {
EmployeeRepository repo = new EmployeeRepository();
List<Employee> ems1 = repo.getAllEmplyee();
StringBuilder sb = new StringBuilder();
sb.append("id" + ", " + "name" + ", " + "age");
for(Employee e: ems1) {
sb.append(" "+e.toString());
}
return sb.toString();
}
@RequestMapping("/getemployee")
public String getemployee() {
EmployeeRepository repo = new EmployeeRepository();
Employee emp = repo.getEmplyee(1);
return emp.toString();
}
// @Value("${spring.application.name}")
// private String name;
// @RequestMapping("/")
// public String getMyAppName() {
// return name;
// }
}
|
0cc35dff-0703-480e-86c8-94888a1bebde
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-17 18:40:29", "repo_name": "janswain/microservice", "sub_path": "/oneservice-consumer/src/main/java/com/sabre/consumer/StartConsumer.java", "file_name": "StartConsumer.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "30e102d12344c4c5a6824eceead9272b4e6f7241", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/janswain/microservice
| 182
|
FILENAME: StartConsumer.java
| 0.243642
|
package com.sabre.consumer;
import java.io.IOException;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestClientException;
import com.sabre.consumer.controllers.ConsumerControllerClient;
@ComponentScan
@EnableAutoConfiguration
@EnableDiscoveryClient
public class StartConsumer {
public static void main(String[] args) throws RestClientException, IOException {
ApplicationContext ctx = SpringApplication.run(StartConsumer.class, args);
ConsumerControllerClient consumerControllerClient = ctx.getBean(ConsumerControllerClient.class);
System.out.println(consumerControllerClient);
consumerControllerClient.getEmployee();
}
@Bean
public ConsumerControllerClient consumerControllerClient() {
return new ConsumerControllerClient();
}
}
|
550581cc-dd84-4f5b-af6f-b9cf71834b90
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-10 08:07:13", "repo_name": "icokeamy2/ResearchProject", "sub_path": "/src/main/java/com/algridashboard/dashboard/model/Temperature.java", "file_name": "Temperature.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "36ede0b2e18f20ae6b9d85db14b78b58a5361ad4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/icokeamy2/ResearchProject
| 202
|
FILENAME: Temperature.java
| 0.23793
|
package com.algridashboard.dashboard.model;
public class Temperature {
private Integer id;
private Double temperature;
private String time;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Double getTemperature() {
return temperature;
}
public void setTemperature(Double temperature) {
this.temperature = temperature;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time == null ? null : time.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", temperature=").append(temperature);
sb.append(", time=").append(time);
sb.append("]");
return sb.toString();
}
}
|
3f59dafc-3c6e-4b15-b57c-73a3170c0306
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-12-27T06:07:24", "repo_name": "erha19/eslint-plugin-weex", "sub_path": "/docs/rules/vue/valid-v-on.md", "file_name": "valid-v-on.md", "file_ext": "md", "file_size_in_byte": 1166, "line_count": 47, "lang": "en", "doc_type": "text", "blob_id": "6114bab822d26410354474539a483304fac63786", "star_events_count": 6, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/erha19/eslint-plugin-weex
| 320
|
FILENAME: valid-v-on.md
| 0.288569
|
# enforce valid `v-on` directives (weex/vue/valid-v-on)
- :gear: This rule is included in all of `"plugin:weex/vue/essential"`, `"plugin:weex/vue/strongly-recommended"` and `"plugin:weex/vue/recommended"`.
This rule checks whether every `v-on` directive is valid.
## :book: Rule Details
This rule reports `v-on` directives in the following cases:
- The directive does not have that event name. E.g. `<div v-on="foo"></div>`
- The directive has invalid modifiers. E.g. `<div v-on:click.bbb="foo"></div>`
- The directive does not have that attribute value and any verb modifiers. E.g. `<div v-on:click></div>`
This rule does not check syntax errors in directives because it's checked by [no-parsing-error] rule.
:-1: Examples of **incorrect** code for this rule:
```html
<div v-on/>
<div v-on:click/>
<div v-on:click.aaa="foo"/>
<div @click/>
```
:+1: Examples of **correct** code for this rule:
```html
<div v-on="foo"/>
<div v-on:click="foo"/>
<div @click="foo"/>
<div @click.left="foo"/>
<div @click.prevent/>
<div @click.stop/>
```
## :wrench: Options
Nothing.
## :couple: Related rules
- [no-parsing-error]
[no-parsing-error]: no-parsing-error.md
|
47763368-adad-41ac-b8f9-81be21b1efc6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-08 14:09:31", "repo_name": "eqxDev/Death-Room", "sub_path": "/src/me/eqxdev/deathroom/utils/Matcher.java", "file_name": "Matcher.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "c759dea6bff7a12444dab9fea3b805402ad6bb89", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/eqxDev/Death-Room
| 206
|
FILENAME: Matcher.java
| 0.252384
|
package me.eqxdev.deathroom.utils;
import me.eqxdev.deathroom.utils.cache.UUIDCache;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import java.util.UUID;
/**
* Created by eqxDev.
*/
public class Matcher {
public static Player matchPlayer(String name){
for(Player player : Bukkit.getOnlinePlayers()) {
if (player.getName().startsWith(name)) return player;
}
return null;
}
public static Player matchPlayer(UUID uuid){
for(Player player : Bukkit.getOnlinePlayers())
if(player.getUniqueId().equals(uuid)) return player;
return null;
}
public static UUID matchUUID(String name){
Player player = matchPlayer(name);
if(player != null) return player.getUniqueId();
return UUIDCache.getInstance().get(name);
}
public static String matchName(UUID uuid){
Player player = matchPlayer(uuid);
if(player != null) return player.getName();
return UUIDCache.getInstance().get(uuid);
}
}
|
84eeef17-b26b-4ea4-a56a-cb5d85efca6c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-17 17:43:36", "repo_name": "Ferenus/chess", "sub_path": "/src/main/java/com/danielstradowski/controller/TablesController.java", "file_name": "TablesController.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "61e014a3ed5351ebee4592ddd09e4e22d252868d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Ferenus/chess
| 211
|
FILENAME: TablesController.java
| 0.255344
|
package com.danielstradowski.controller;
import com.danielstradowski.dto.Game;
import com.danielstradowski.dto.Move;
import com.danielstradowski.dto.OutputMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.ArrayList;
import java.util.List;
@Controller
@RequestMapping("/tables")
public class TablesController {
private static List<Game> games = new ArrayList<>();
private Logger logger = LoggerFactory.getLogger(getClass());
@RequestMapping(method = RequestMethod.GET)
public String viewApplication(Model model) {
return "tables";
}
@MessageMapping("/newgame")
@SendTo("/topic/newgame")
public String sendMove(String id) {
logger.info("Move sent");
games.add(new Game());
return id;
}
}
|
4ae914ec-fc0a-4af4-ace1-873fe08b5476
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-31 10:35:05", "repo_name": "nvduong97/CarGara", "sub_path": "/src/com/ptit/model/Manager.java", "file_name": "Manager.java", "file_ext": "java", "file_size_in_byte": 1047, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "98056c34a0ef5714742a7a4dd5aeb77c8e982e6b", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/nvduong97/CarGara
| 214
|
FILENAME: Manager.java
| 0.194368
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.ptit.model;
/**
*
* @author DUONGNV
*/
public class Manager extends Employee{
private String managerID;
private String account;
private String password;
public Manager() {
}
public Manager(String managerID, String account, String password) {
this.managerID = managerID;
this.account = account;
this.password = password;
}
public String getManagerID() {
return managerID;
}
public void setManagerID(String managerID) {
this.managerID = managerID;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
|
2d888e02-fbc2-4ed6-9ddf-d4fac76deaa9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-06-15 10:11:28", "repo_name": "aaronang/git-server", "sub_path": "/git-server/src/main/java/nl/tudelft/ewi/git/web/BaseApi.java", "file_name": "BaseApi.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "25d6203d03cd46a4d71778bc425f01e01108377e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/aaronang/git-server
| 267
|
FILENAME: BaseApi.java
| 0.286169
|
package nl.tudelft.ewi.git.web;
import java.net.URLDecoder;
import javax.ws.rs.NotFoundException;
import lombok.SneakyThrows;
import nl.minicom.gitolite.manager.models.Config;
import nl.minicom.gitolite.manager.models.Group;
import nl.minicom.gitolite.manager.models.Repository;
import nl.minicom.gitolite.manager.models.User;
abstract class BaseApi {
User fetchUser(Config config, String userId) {
User user = config.getUser(userId);
if (user == null) {
throw new NotFoundException("Could not find user: " + userId);
}
return user;
}
Group fetchGroup(Config config, String groupId) {
Group group = config.getGroup(groupId);
if (group == null) {
throw new NotFoundException("Could not find group: " + groupId);
}
return group;
}
Repository fetchRepository(Config config, String repoId) {
Repository repository = config.getRepository(repoId);
if (repository == null) {
throw new NotFoundException("Could not find repository: " + repoId);
}
return repository;
}
@SneakyThrows
String decode(String value) {
return URLDecoder.decode(value, "UTF-8");
}
}
|
b8989b46-bde1-4d29-b676-3921a3b172fb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-08 07:39:00", "repo_name": "ShurAnd/test-chat-jpa", "sub_path": "/src/main/java/org/andrey/testchatjpa/service/MessageService.java", "file_name": "MessageService.java", "file_ext": "java", "file_size_in_byte": 1039, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "bed0ae6838f3c95b1aa5d24ffc43ef67a84d11d3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ShurAnd/test-chat-jpa
| 201
|
FILENAME: MessageService.java
| 0.282196
|
package org.andrey.testchatjpa.service;
import java.util.List;
import org.andrey.testchatjpa.domain.Message;
import org.andrey.testchatjpa.repository.MessageRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MessageService {
private MessageRepository messageRepository;
@Autowired
public MessageService(MessageRepository messageRepository) {
this.messageRepository = messageRepository;
}
public List<Message> getAllMessages() {
List<Message> messages = messageRepository.findAll();
return messages;
}
public Message findMessageById(Long id) {
Message message = messageRepository.findById(id).orElse(null);
return message;
}
public Message saveNewMessage(Message message) {
return messageRepository.save(message);
}
public Message updateMessage(Message message) {
/*
* так ли
*/
return saveNewMessage(message);
}
public void deleteMessageById(Long id) {
messageRepository.deleteById(id);
}
}
|
8465aa09-61d5-4ce1-96b1-3bd57cfd1cf1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-30 08:31:16", "repo_name": "KimNamKyu/JavaWeb", "sub_path": "/20190128maven/src/main/java/com/java/View.java", "file_name": "View.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "965c589e3becdf36153ac73f4971d0a3dca341ab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/KimNamKyu/JavaWeb
| 180
|
FILENAME: View.java
| 0.279828
|
package com.java;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class View extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
getView(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
getView(request, response);
}
private void getView(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String uri = request.getRequestURI();
String page = "/"+uri.substring(uri.lastIndexOf("/") + 1, uri.length()); //마지막 시작점 찾기
RequestDispatcher rd = request.getRequestDispatcher(page + ".jsp");
System.out.println(page);
rd.forward(request, response);
}
}
|
22a15cb9-365e-46ab-9d42-831401e0618b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-11 13:35:34", "repo_name": "indigo-dc/Monitoring", "sub_path": "/zabbix-wrapper/monitoring-pillar-domain/src/main/java/it/reply/monitoringpillar/domain/dsl/monitoring/pillar/zabbix/response/ZabbixAuthenticationResponse.java", "file_name": "ZabbixAuthenticationResponse.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "d5f8b47d2694ad106496a9ae0694157e50bba3c4", "star_events_count": 5, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/indigo-dc/Monitoring
| 230
|
FILENAME: ZabbixAuthenticationResponse.java
| 0.225417
|
package it.reply.monitoringpillar.domain.dsl.monitoring.pillar.zabbix.response;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({ "result" })
public class ZabbixAuthenticationResponse {
@JsonProperty("result")
private Object result;
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("result")
public Object getResult() {
return result;
}
@JsonProperty("result")
public void setResult(Object result) {
this.result = result;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
|
bbdd22e9-b469-42ff-b7f6-b7e787a29066
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-26 08:27:38", "repo_name": "dudefu/oldx-admin", "sub_path": "/oldx-generator/src/main/java/cc/oldx/mbg/domain/OSysMenuRole.java", "file_name": "OSysMenuRole.java", "file_ext": "java", "file_size_in_byte": 1115, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "e4c2f31ca3a52134174b949344bd11bda11a1fdb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dudefu/oldx-admin
| 221
|
FILENAME: OSysMenuRole.java
| 0.225417
|
package cc.oldx.mbg.domain;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
public class OSysMenuRole implements Serializable {
@ApiModelProperty(value = "角色ID")
private Long roleId;
@ApiModelProperty(value = "权限ID")
private Long permissionId;
private static final long serialVersionUID = 1L;
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getPermissionId() {
return permissionId;
}
public void setPermissionId(Long permissionId) {
this.permissionId = permissionId;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", roleId=").append(roleId);
sb.append(", permissionId=").append(permissionId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
|
8bcfdb49-1cfc-4456-95b6-d370b307549a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-27 06:18:23", "repo_name": "DogaDumanoglu/QueueStack", "sub_path": "/MyStack.java", "file_name": "MyStack.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "cec13920071a310a762a7b34fd589529cd39af1e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/DogaDumanoglu/QueueStack
| 226
|
FILENAME: MyStack.java
| 0.289372
|
import java.util.ArrayList;
import java.util.EmptyStackException;
public class MyStack {
private ArrayList<Integer> stack =new ArrayList<>();
public void push(int integer){
/*adds an element to the top of the stack*/
stack.add(0,integer);
}
public boolean isEmpty(){
/*removes an element to the top of the stack*/
return stack.size() == 0;
}
public int pop() {
/*removes an element from the top of the stack*/
if (!stack.isEmpty()) {
int removed = stack.get(0);
stack.remove(0);
return removed;
}
throw new EmptyStackException();//if stack is Empty throws EmptyStackException
}
public String toString(MyStack stack){
/*Returns the string of elements in the stack*/
MyStack copyStack=StackOperations.copyStack(stack);
StringBuilder str= new StringBuilder();
while(StackOperations.size(copyStack)!=1)
{
str.append(copyStack.pop()).append(" ");}
str.append(copyStack.pop());
return str.toString();
}
}
|
58e8ea7c-0ece-46d9-bce0-63488226a15e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-24 14:00:35", "repo_name": "HotCoode/ScighTravel", "sub_path": "/app/src/main/java/com/scigh/activities/LauncherActivity.java", "file_name": "LauncherActivity.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "75bcf8c0d29509c1bf7e8cef015671b50196366c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/HotCoode/ScighTravel
| 191
|
FILENAME: LauncherActivity.java
| 0.235108
|
package com.scigh.activities;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity;
/**
* Created by Abhay on 3/20/2015.
*/
public class LauncherActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
boolean firstLaunch = prefs.getBoolean(getString(R.string.pref_previously_started), true);
Intent intent;
if (firstLaunch) {
SharedPreferences.Editor edit = prefs.edit();
edit.putBoolean(getString(R.string.pref_previously_started), Boolean.FALSE);
edit.commit();
intent = new Intent(this, IntroductionActivity.class);
startActivity(intent);
finish();
} else {
intent = new Intent(this, HomeActivity.class);
startActivity(intent);
finish();
}
}
}
|
f3f66279-33ca-45ee-96e6-e85d8fd3ea36
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-12-12 08:52:54", "repo_name": "catalin-burcea/playground", "sub_path": "/spring/spring-retry/src/main/java/ro/cburcea/playground/spring/retry/DefaultListenerSupport.java", "file_name": "DefaultListenerSupport.java", "file_ext": "java", "file_size_in_byte": 1013, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "fc38341247301bae6ef83d25f189457997cc84f6", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/catalin-burcea/playground
| 201
|
FILENAME: DefaultListenerSupport.java
| 0.216012
|
package ro.cburcea.playground.spring.retry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.retry.RetryCallback;
import org.springframework.retry.RetryContext;
import org.springframework.retry.RetryListener;
public class DefaultListenerSupport implements RetryListener {
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultListenerSupport.class);
@Override
public <T, E extends Throwable> void close(RetryContext context, RetryCallback<T, E> callback, Throwable throwable) {
LOGGER.info("onClose");
}
@Override
public <T, E extends Throwable> void onError(RetryContext context,
RetryCallback<T, E> callback, Throwable throwable) {
LOGGER.info("onError: {}", throwable.getMessage());
}
@Override
public <T, E extends Throwable> boolean open(RetryContext context, RetryCallback<T, E> callback) {
LOGGER.info("onOpen");
return true;
}
}
|
65eb63a0-f183-42b7-a778-d831f26fb775
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-28 17:57:36", "repo_name": "mckonieczny/ZPI", "sub_path": "/src/main/java/database/repository/LanguageRepository.java", "file_name": "LanguageRepository.java", "file_ext": "java", "file_size_in_byte": 1139, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "b79e9a71b2a9a37a0967fba781509ee08fa2f034", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mckonieczny/ZPI
| 217
|
FILENAME: LanguageRepository.java
| 0.29584
|
package database.repository;
import database.document.LanguageDocument;
import database.mongo.MongoRepository;
import org.bson.Document;
import java.util.ArrayList;
import java.util.List;
import static com.mongodb.client.model.Filters.eq;
import static database.document.LanguageDocument.M_LANGUAGE;
/**
* Created by DjKonik on 2016-10-08.
*/
public class LanguageRepository extends MongoRepository<LanguageDocument> {
public final static String C_LANGUAGES = "languages";
public LanguageRepository() {
super(C_LANGUAGES);
}
public boolean exists(String language) {
return !findByLanguage(language).isEmpty();
}
public List<LanguageDocument> findAll() {
List<LanguageDocument> languages = new ArrayList<>();
getCollection()
.find()
.map(document -> new LanguageDocument((Document) document))
.into(languages);
return languages;
}
private LanguageDocument findByLanguage(String language) {
return new LanguageDocument((Document) getCollection().find(eq(M_LANGUAGE, language)).first());
}
}
|
8b2849b7-3b98-48cf-aa08-bbe46372200d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-21 04:32:03", "repo_name": "l-w-h/DebugTools", "sub_path": "/Module/DebugTools/src/main/java/com/lwh/debugtools/base/utils/md5/Md5Utils.java", "file_name": "Md5Utils.java", "file_ext": "java", "file_size_in_byte": 1080, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "1060b0bc0b4489f4dbb098b9025b6409e784e0a4", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/l-w-h/DebugTools
| 236
|
FILENAME: Md5Utils.java
| 0.280616
|
package com.lwh.debugtools.base.utils.md5;
import android.text.TextUtils;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* @author lwh
* @Date 2019/10/19 15:33
* @description Md5Utils
*/
public class Md5Utils {
/**
* 加密
* @param plaintext 明文
* @return ciphertext 密文
*/
public final static String encrypt(String plaintext) {
if (TextUtils.isEmpty(plaintext)) {
return "";
}
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
byte[] bytes = md5.digest(plaintext.getBytes());
String ciphertext = "";
for (byte b : bytes) {
String temp = Integer.toHexString(b & 0xff);
if (temp.length() == 1) {
temp = "0" + temp;
}
ciphertext += temp;
}
return ciphertext;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return "";
}
}
|
6c4df209-8d14-4048-9c09-7c3abc4e42f6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-07-14 08:23:04", "repo_name": "helinad/myRepoTest", "sub_path": "/ConstantTherapy/src/com/constant_therapy/dashboard/DragandDropTask.java", "file_name": "DragandDropTask.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "5baa22375bfe3db366bfc60333fc142da0d365fc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/helinad/myRepoTest
| 231
|
FILENAME: DragandDropTask.java
| 0.261331
|
package com.constant_therapy.dashboard;
import java.io.Serializable;
import java.util.ArrayList;
public class DragandDropTask implements Serializable {
public String task;
public String taskType;
public ArrayList<String> sequence = new ArrayList<String>();
public ArrayList<String> resources = new ArrayList<String>();
public String sessionId;
public Boolean autoplayInstructions;
public String getTaskType() {
return taskType;
}
public void setTaskType(String taskType) {
this.taskType = taskType;
}
public ArrayList<String> getItems() {
return sequence;
}
public void setItems(ArrayList<String> sequence) {
this.sequence = sequence;
}
public ArrayList<String> getResources() {
return resources;
}
public void setResources(ArrayList<String> resources) {
this.resources = resources;
}
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public Boolean getAutoplayInstructions() {
return autoplayInstructions;
}
public void setAutoplayInstructions(Boolean autoplayInstructions) {
this.autoplayInstructions = autoplayInstructions;
}
}
|
1674ec0e-dd3c-4387-ac61-fc553b025759
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-06 15:42:49", "repo_name": "moutainhigh/kuaixiu", "sub_path": "/src/com/common/wechat/bean/kefu/result/WxMpKfSessionGetResult.java", "file_name": "WxMpKfSessionGetResult.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "8c0fc0c47c08fc35fdb68341b91b2cd8b648ca82", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/moutainhigh/kuaixiu
| 283
|
FILENAME: WxMpKfSessionGetResult.java
| 0.255344
|
package com.common.wechat.bean.kefu.result;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.google.gson.annotations.SerializedName;
import com.common.wechat.util.json.WxMpGsonBuilder;
/**
*
* @author Binary Wang
*
*/
public class WxMpKfSessionGetResult {
/**
* kf_account 正在接待的客服,为空表示没有人在接待
*/
@SerializedName("kf_account")
private String kfAccount;
/**
* createtime 会话接入的时间 ,UNIX时间戳
*/
@SerializedName("createtime")
private long createTime;
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
public static WxMpKfSessionGetResult fromJson(String json) {
return WxMpGsonBuilder.INSTANCE.create().fromJson(json, WxMpKfSessionGetResult.class);
}
public String getKfAccount() {
return this.kfAccount;
}
public void setKfAccount(String kfAccount) {
this.kfAccount = kfAccount;
}
public long getCreateTime() {
return this.createTime;
}
public void setCreateTime(long createTime) {
this.createTime = createTime;
}
}
|
443025a8-393c-45e9-bd01-1a4c62ab6eba
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-18 15:50:26", "repo_name": "HeavenBackedup/oh-my-news", "sub_path": "/oh-my-news-model/src/main/java/com/oh/my/news/model/dto/Image.java", "file_name": "Image.java", "file_ext": "java", "file_size_in_byte": 1141, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "d6338f6877fe600319bc5bcbc1a36b22525a3895", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/HeavenBackedup/oh-my-news
| 287
|
FILENAME: Image.java
| 0.258326
|
package com.oh.my.news.model.dto;
/**
* Created by shj on 2017/4/13.
*/
public class Image {
private int id;
private String url;
public Image(int id, String url) {
this.id = id;
this.url = url;
}
public Image() {
}
@Override
public String toString() {
return "Image{" +
"id=" + id +
", url='" + url + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Image image = (Image) o;
if (id != image.id) return false;
return url != null ? url.equals(image.url) : image.url == null;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (url != null ? url.hashCode() : 0);
return result;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
|
1da88881-82ef-41a7-b10e-af571f1fb43b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-18 19:37:24", "repo_name": "latishpavan/codebook-backend", "sub_path": "/src/main/java/com/codebook/server/service/UserService.java", "file_name": "UserService.java", "file_ext": "java", "file_size_in_byte": 1085, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "182077120528fa13fc437ca13abd38029f21d4d9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/latishpavan/codebook-backend
| 180
|
FILENAME: UserService.java
| 0.250913
|
package com.codebook.server.service;
import com.codebook.server.domain.User;
import com.codebook.server.domain.request.CreateAccountRequest;
import com.codebook.server.repository.UserRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class UserService {
private final UserRepository userRepository;
private final PasswordEncoder passwordEncoder;
public UserService(
UserRepository repository,
PasswordEncoder passwordEncoder
) {
this.userRepository = repository;
this.passwordEncoder = passwordEncoder;
}
public void createAccount(CreateAccountRequest request) {
User user = User.builder()
.password(passwordEncoder.encode(request.getPassword()))
.username(request.getUsername())
.email(request.getEmail())
.build();
log.info("Creating a new user {}", user);
userRepository.save(user);
}
}
|
9f9a3830-e555-4cad-8310-44aa75488ebb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-18 15:43:56", "repo_name": "aydangoon/SimpleLM", "sub_path": "/code/TextureSwapper/Logger.java", "file_name": "Logger.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "2eaa7357fd4b9c495d93526ca96311c9ff7578b8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/aydangoon/SimpleLM
| 231
|
FILENAME: Logger.java
| 0.282988
|
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.text.DefaultCaret;
public class Logger extends JFrame{
private JTextArea log;
public Logger(String name) {
this.setSize(new Dimension(640, 640));
this.setTitle(name);
//this.setBackground(Color.BLACK);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JScrollPane scrollArea = new JScrollPane();
scrollArea.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
log = new JTextArea();
log.setVisible(true);
write("Log Output: ");
scrollArea.setBounds(0, 0, this.getWidth() - 15, this.getHeight() - 40);
scrollArea.getViewport().add(log);
scrollArea.setVisible(true);
this.add(scrollArea);
}
public void write(String text) {
log.append(text + "\n");
log.setCaretPosition(log.getDocument().getLength());
}
}
|
eaca7505-5466-4fc5-960f-2114bd6078ef
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-21 23:59:02", "repo_name": "jcsteele26/Library_Management_System", "sub_path": "/Cardholder.java", "file_name": "Cardholder.java", "file_ext": "java", "file_size_in_byte": 1141, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "8b4206f93516971f2c3e6010ae1d1cc889373468", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jcsteele26/Library_Management_System
| 234
|
FILENAME: Cardholder.java
| 0.23793
|
import java.util.ArrayList;
import java.util.List;
public class Cardholder {
private String name;
private String address;
private int cardNumber;
// members for overdue items
List <String> overdueBook = new ArrayList<>();
List <String> overduePeriodical = new ArrayList<>();
List <String> overdueVideo = new ArrayList<>();
// constructor for Cardholder class
public Cardholder(String name, String address, int cardNumber){
this.name = name;
this.address = address;
this.cardNumber = cardNumber;
}
// getters for Cardholder class
public String getName(){
return name;
}
public String getAddress(){
return address;
}
public int getCardNumber(){
return cardNumber;
}
// setters for Cardholder class
public void setName(String name){
this.name = name;
}
public void setAddress(String address){
this.address = address;
}
public void setCardNumber(int cardNumber){
this.cardNumber = cardNumber;
}
// method to check out items
// method to reserve items
}
|
a087a493-a493-49b0-a4e0-e89bd01ec678
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-24 19:38:40", "repo_name": "daominhdam/arquillian-testng-parallel", "sub_path": "/src/test/java/org/jboss/arquillian/pages/test/GoogleTest2.java", "file_name": "GoogleTest2.java", "file_ext": "java", "file_size_in_byte": 1165, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f7ba4476f840019ae54f1c344d4cdfa70a68a7d0", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/daominhdam/arquillian-testng-parallel
| 250
|
FILENAME: GoogleTest2.java
| 0.293404
|
package org.jboss.arquillian.pages.test;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.graphene.Graphene;
import org.jboss.arquillian.graphene.page.Page;
import org.jboss.arquillian.pages.GooglePage;
import org.jboss.arquillian.testng.Arquillian;
import org.testng.Assert;
import org.testng.annotations.Test;
@RunAsClient
public class GoogleTest2 extends Arquillian {
@Page
GooglePage google;
@Test(priority = 1)
public void launchGoogle(){
Graphene.goTo(GooglePage.class);
Assert.assertEquals(true, google.isAt());
}
@Test(priority = 2)
public void canGoogleSuggest(){
google.getSearchWidget().searchFor("Arquillian");
google.getSuggestions().show();
Assert.assertEquals(google.getSuggestions().getCount(), 4);
}
@Test(priority = 3)
public void canGoogleShowResult(){
google.getSearchWidget().searchFor("Test Automation Guru");
google.getSearchWidget().search();
google.getSearchResults().show();
Assert.assertEquals(google.getSearchResults().getCount(), 7);
}
}
|
4b661e2c-c55e-4a15-9d14-310e5f69ed5d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-05-14 14:11:55", "repo_name": "mimarox/testng-databinding", "sub_path": "/testng-databinding-xml/src/test/java/net/sf/testng/databinding/xml/beans/InnerTestBean.java", "file_name": "InnerTestBean.java", "file_ext": "java", "file_size_in_byte": 1062, "line_count": 57, "lang": "en", "doc_type": "code", "blob_id": "154d9728ddb9442cd6418f09f42b80e484ebcc0f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mimarox/testng-databinding
| 289
|
FILENAME: InnerTestBean.java
| 0.292595
|
package net.sf.testng.databinding.xml.beans;
public class InnerTestBean {
private String testValue;
public InnerTestBean() {
}
public InnerTestBean(final String testValue) {
setTestValue(testValue);
}
public String getTestValue() {
return testValue;
}
public void setTestValue(final String testValue) {
this.testValue = testValue;
}
/**
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((testValue == null) ? 0 : testValue.hashCode());
return result;
}
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final InnerTestBean other = (InnerTestBean) obj;
if (testValue == null) {
if (other.testValue != null) {
return false;
}
} else if (!testValue.equals(other.testValue)) {
return false;
}
return true;
}
}
|
ca2b87f5-96f9-4e46-b784-8ef2f6719d54
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-04 08:19:38", "repo_name": "huttonj/chevrolet", "sub_path": "/chevrolet-web/src/main/java/com/chevrolet/web/interceptor/ChevroletBaseInterceptor.java", "file_name": "ChevroletBaseInterceptor.java", "file_ext": "java", "file_size_in_byte": 1124, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "f0204ce9133106d178f202fa63612bdca7150c66", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/huttonj/chevrolet
| 211
|
FILENAME: ChevroletBaseInterceptor.java
| 0.2227
|
package com.chevrolet.web.interceptor;
import com.maihaoche.acura.api.model.Staff;
import com.mhc.subaru.validation.holder.CurrentUserHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Created by maihe on 2017/7/20.
* tesla基础拦截器,主要用于返回数据中增加用户信息
*/
@Slf4j
public class ChevroletBaseInterceptor extends HandlerInterceptorAdapter {
private final CurrentUserHolder currentUserHolder;
public ChevroletBaseInterceptor(CurrentUserHolder currentUserHolder) {
this.currentUserHolder = currentUserHolder;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
ModelAndView modelAndView) throws Exception {
if (modelAndView != null) {
modelAndView.getModelMap().addAttribute("staff", currentUserHolder.get(Staff.class));
}
}
}
|
d4574b0d-2995-4af9-af19-e2d378148b18
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-03-18T11:41:04", "repo_name": "taps1197/micro-ATM", "sub_path": "/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1086, "line_count": 30, "lang": "en", "doc_type": "text", "blob_id": "3882b2a320237523ddd3aa3b6ff25d0eb0cbd432", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/taps1197/micro-ATM
| 330
|
FILENAME: readme.md
| 0.288569
|
# Micro ATM & Smile to Pay
This project was made as a part of 24 hour hackathon by InterviewBit Academy. This repo hosts the code for the same. It is built with ReactJS, Firebase and Kairos.
## What is this project all about
[Click here](https://docs.google.com/document/d/1mXxgxSHYVAGsIiYFxyVNA61DIelp53n9EgfO80uQLoY/edit?usp=sharing) to read the documentaion of project
## Presentation
[Click here](https://docs.google.com/presentation/d/1eHT7-5Xo8L1v47pabZXb8OaT2tJMn3T75LZ8bSQ77S8/edit?usp=sharing) to see Presentation
### Running the project
To run this project, you need to have NodeJS installed. After installing node, run the following commands:
```
git clone https://github.com/boxdox/micro-ATM.git
cd micro-ATM/Paynow
npm install
npm start
```
_Note: You need API keys from [Kairos](https://www.kairos.com/docs/api/) and [Firebase](https://firebase.google.com/docs/reference/rest/database/) and fill in the data in appropriate files `src/constants/keys.js` and `src/components/firebase.js`_
### Build the project:
```
npm run build
```
### Licence
MIT © 2019
|
28b8bd5b-f669-4de9-b1e0-8599c4d34ab1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-13 10:39:30", "repo_name": "bksinha4497/Spring", "sub_path": "/spring-in-5-steps/src/main/java/com/tm/srping/basics/springin5steps/SpringIn5StepsScopeApplication.java", "file_name": "SpringIn5StepsScopeApplication.java", "file_ext": "java", "file_size_in_byte": 1165, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "b3deb9bac70d7ee914e2c7c74cf347233bb76e0d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bksinha4497/Spring
| 229
|
FILENAME: SpringIn5StepsScopeApplication.java
| 0.286968
|
package com.tm.srping.basics.springin5steps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import com.tm.srping.basics.springin5steps.scope.PersonDAO;
@Configuration
@ComponentScan
public class SpringIn5StepsScopeApplication {
private static Logger LOGGER = LoggerFactory.getLogger(SpringIn5StepsScopeApplication.class);
public static void main(String[] args) {
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(
SpringIn5StepsScopeApplication.class);
// ConfigurableApplicationContext applicationContext =
// SpringApplication.run(SpringIn5StepsScopeApplication.class,args);
PersonDAO dao1 = applicationContext.getBean(PersonDAO.class);
PersonDAO dao2 = applicationContext.getBean(PersonDAO.class);
LOGGER.info("{}", dao1);
LOGGER.info("{}", dao1.getJdbcConncetion());
LOGGER.info("{}", dao2);
LOGGER.info("{}", dao2.getJdbcConncetion());
applicationContext.close();
}
}
|
e115e033-78d3-48b3-8dbe-cad282007d8b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-07-30T18:13:59", "repo_name": "giladshanan/phase0-gps-1", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1089, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "095f6e5fe4484f688359ecb7b26fd974fa122cb9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/giladshanan/phase0-gps-1
| 252
|
FILENAME: README.md
| 0.272025
|
# phase0-gps-1
cd .. - change directory up one level
cd - change to home directory
cd desktop/git - change directory to 'git' directory
git clone https://github.com/giladshanan/phase0-gps-1.git - telling the current directory to clone the repo from github to the local drive
ls - list contents of current directory
cd phase0-gps-1/ - change directory to 'phase0-gps-1'
touch awesome_page.md - creates the markdown file named awesome_page
ls - list contents of current directory
git push origin master - pushes local changes to the master branch on github
git status - shows status of files in local repository
git add awesome_page.md - add the file 'awesome_page' to the repository
git commit -m 'create awesome page!' - add commit with a message
git status - shows status of files in the local repository
git push origin master - pushes local changes to the master branch on github
git co -b add-command-log - create and switch to a new branch 'add-command-log'
subl README.md - open the README.md file in Sublime text editor
history - lists all commands entered in the terminal session
|
d52c047b-b7d9-47da-bd4c-ee6d94861d58
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-23 06:23:39", "repo_name": "MikyPopescu/SoftwareQualityAndTesting", "sub_path": "/Exam_CheatSheet_DesignPatterns/1_creationale/01_singleton/src/cts/patterns/miky/implementation/SingletonConnection.java", "file_name": "SingletonConnection.java", "file_ext": "java", "file_size_in_byte": 1091, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "65afd2b817ac7674ffea59258cab2e32db531fea", "star_events_count": 3, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/MikyPopescu/SoftwareQualityAndTesting
| 196
|
FILENAME: SingletonConnection.java
| 0.250913
|
package cts.patterns.miky.implementation;
import cts.patterns.miky.exceptions.ExceptionCreateSingletonConnection;
public class SingletonConnection {
String name;
String password;
private static SingletonConnection instance = null;
private SingletonConnection() {
}
private SingletonConnection(String name, String password) {
this.name = name;
this.password = password;
}
public static SingletonConnection getInstance(String name, String password) throws ExceptionCreateSingletonConnection {
if (instance == null) {
System.out.println("Unique instance created");
instance = new SingletonConnection(name, password);
} else {
if (!name.equals(instance.name)) {
throw new ExceptionCreateSingletonConnection();
}
}
return instance;
}
@Override
public String toString() {
return "SingletonConnection{" +
"name='" + name + '\'' +
", password='" + password + '\'' +
'}';
}
}
|
2f64782b-66be-4e74-bfc6-1dfeefabb5e4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-04 16:04:50", "repo_name": "WildWeazel/naturenet-android", "sub_path": "/app/src/main/java/org/naturenet/data/model/PhotoCaptionContent.java", "file_name": "PhotoCaptionContent.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "052ffc4f6fb2ab0fa7574bb4b36c8a2e3d57d4c9", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/WildWeazel/naturenet-android
| 225
|
FILENAME: PhotoCaptionContent.java
| 0.201813
|
package org.naturenet.data.model;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY,
getterVisibility = JsonAutoDetect.Visibility.NONE,
setterVisibility = JsonAutoDetect.Visibility.NONE)
@JsonIgnoreProperties(ignoreUnknown = true)
public class PhotoCaptionContent {
@Override
public String toString() {
return "PhotoCaptionContent{" +
"mImageUrl='" + mImageUrl + '\'' +
", mCaption='" + mCaption + '\'' +
'}';
}
@JsonProperty("image")
private String mImageUrl;
@JsonProperty("text")
private String mCaption;
protected PhotoCaptionContent() {}
public String getImageUrl() {
return mImageUrl;
}
public void setImageUrl(String mPhotoUrl) {
this.mImageUrl = mPhotoUrl;
}
public String getCaption() {
return mCaption;
}
public void setCaption(String mCaption) {
this.mCaption = mCaption;
}
}
|
963b1520-b869-4ef2-87c5-90fca6d422aa
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-09-07 17:31:37", "repo_name": "Contrast-Security-OSS/contrast-sdk-java", "sub_path": "/src/test/java/com/contrastsecurity/TestDataConstants.java", "file_name": "TestDataConstants.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "43399b46399e8a778677142ffab00febdf5cb57b", "star_events_count": 6, "fork_events_count": 29, "src_encoding": "UTF-8"}
|
https://github.com/Contrast-Security-OSS/contrast-sdk-java
| 281
|
FILENAME: TestDataConstants.java
| 0.279828
|
package com.contrastsecurity;
/*-
* #%L
* Contrast Java SDK
* %%
* Copyright (C) 2022 Contrast Security, 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.
* #L%
*/
import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
/** Constants to reuse in Pact tests. */
public final class TestDataConstants {
/**
* Timestamp to use in Pact testing examples. Uses a date far in the past to easily distinguish
* this from production data.
*/
public static final Instant TIMESTAMP_EXAMPLE =
OffsetDateTime.of(1955, 11, 12, 22, 4, 0, 0, ZoneOffset.UTC).toInstant();
private TestDataConstants() {}
}
|
304128f0-e1c5-4ce4-b5cd-4c2054a0dc90
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-06-02 13:13:10", "repo_name": "mrtngv/University", "sub_path": "/Other-Projects/Java/Project1/src/com/company/Entry.java", "file_name": "Entry.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "e5016d5fc5dbfb59e1c5f0bb27cfca41c0bd331c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mrtngv/University
| 235
|
FILENAME: Entry.java
| 0.276691
|
package com.company;
public class Entry {
private double cost_whenSell;
private String title;
private EntryType entryType;
private paperSize paperSize;
private int entryPageNumber;
public Entry(String title,EntryType entryType,paperSize paperSize,int entryPageNumber){
this.title = title;
this.entryType = entryType;
this.paperSize = paperSize;
this.entryPageNumber = entryPageNumber;
this.cost_whenSell = cost_whenSell;
}
public void setCost_whenSell(double cost_whenSell) {
this.cost_whenSell = cost_whenSell;
}
public String getTitle(){
return this.title;
}
public EntryType getEntryType() {
return entryType;
}
public paperSize getPaperSize() {
return paperSize;
}
public int getEntryPageNumber() {
return entryPageNumber;
}
public double getCost_whenSell() {
return cost_whenSell;
}
@Override
public String toString() {
return title + "["+entryPageNumber+"](pages)";
}
}
|
8d5068ab-f168-4704-8325-4ea2690a7c20
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-26 09:43:15", "repo_name": "jackfo/mini-rpc", "sub_path": "/mini-remoting/src/main/java/com/cfs/mini/remoting/TimeoutException.java", "file_name": "TimeoutException.java", "file_ext": "java", "file_size_in_byte": 1079, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "2bc5163c8bca1b030442a3bdc045dff13f64b391", "star_events_count": 5, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jackfo/mini-rpc
| 245
|
FILENAME: TimeoutException.java
| 0.261331
|
package com.cfs.mini.remoting;
import java.net.InetSocketAddress;
public class TimeoutException extends RemotingException {
private static final long serialVersionUID = 3122966731958222692L;
/**
* 客户端
*/
public static final int CLIENT_SIDE = 0;
/**
* 服务端
*/
public static final int SERVER_SIDE = 1;
/**
* 阶段
*/
private final int phase;
public TimeoutException(boolean serverSide, Channel channel, String message) {
super(channel, message);
this.phase = serverSide ? SERVER_SIDE : CLIENT_SIDE;
}
public TimeoutException(boolean serverSide, InetSocketAddress localAddress,
InetSocketAddress remoteAddress, String message) {
super(localAddress, remoteAddress, message);
this.phase = serverSide ? SERVER_SIDE : CLIENT_SIDE;
}
public int getPhase() {
return phase;
}
public boolean isServerSide() {
return phase == 1;
}
public boolean isClientSide() {
return phase == 0;
}
}
|
e77cad3c-92a5-45e2-889e-73d759e638e2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-29 18:01:29", "repo_name": "ab74883/mdw", "sub_path": "/mdw-common/src/com/centurylink/mdw/util/TextHelper.java", "file_name": "TextHelper.java", "file_ext": "java", "file_size_in_byte": 1064, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "47780169ff93d5776507acc52ded25ed75b23ac6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ab74883/mdw
| 362
|
FILENAME: TextHelper.java
| 0.276691
|
package com.centurylink.mdw.util;
import java.io.UnsupportedEncodingException;
import java.util.regex.Pattern;
public class TextHelper {
private static Pattern p = Pattern.compile("\\A(\n" +
" [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\\n" +
"| [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n" +
"| \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n" +
"| [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n" +
"| \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n" +
"| \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n" +
"| [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n" +
"| \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n" +
")*\\z", Pattern.COMMENTS);
static boolean looksLikeUTF8(byte[] utf8) throws UnsupportedEncodingException {
String phonyString = new String(utf8, "ISO-8859-1");
return p.matcher(phonyString).matches();
}
}
|
e09cffe6-f645-44d0-982e-4e9e7f5f48e5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-04-17 06:11:49", "repo_name": "zaizi/activiti-form-rest-service", "sub_path": "/activiti-form-setup/src/main/java/com/zaizi/demo/activiti/util/ActivitiProperty.java", "file_name": "ActivitiProperty.java", "file_ext": "java", "file_size_in_byte": 1100, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "e8525ea58ce2b57633f793b1ae86759089ebeee5", "star_events_count": 0, "fork_events_count": 4, "src_encoding": "UTF-8"}
|
https://github.com/zaizi/activiti-form-rest-service
| 272
|
FILENAME: ActivitiProperty.java
| 0.282196
|
package com.zaizi.demo.activiti.util;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
/**
* This class is used to retrieve configured property values
* @author kvaratharaja
*
*/
public class ActivitiProperty {
private Properties prop = new Properties();
private InputStream input = null;
/**
* load the property file
*/
public void loadProperty() {
String tomcatPath = System.getProperty("catalina.base");
String filename = tomcatPath
+ "/webapps/activiti-app/WEB-INF/classes/META-INF/activiti-app/activiti-app.properties";
try {
input = new FileInputStream(filename);
if (input == null) {
System.out.println("Sorry, unable to find " + filename);
return;
}
prop.load(input);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
if (input != null) {
try {
input.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
/**
* get the property value by key
* @param key
* @return
*/
public String getValue(String key) {
return prop.getProperty(key);
}
}
|
3feb6da7-8117-4c8a-9b32-f6cf1f66d1d2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-27 15:59:11", "repo_name": "khaledchobi/rest-api-project", "sub_path": "/src/test/java/com/rest/api/test/databaseLib/DataBaseUtil.java", "file_name": "DataBaseUtil.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "119e832ca986c48be054341d298510fcac1df0e7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/khaledchobi/rest-api-project
| 225
|
FILENAME: DataBaseUtil.java
| 0.249447
|
package com.rest.api.test.databaseLib;
import java.sql.*;
public class DataBaseUtil {
public static void main(String[] args) throws SQLException {
// create the connection with database
String myDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String myUrl = "jdbc:sqlserver://localhost:1433";
Connection con;
Statement stmt;
ResultSet rs;
try {
con = DriverManager.getConnection(myUrl, "sa", "myPassword@12345");
stmt = con.createStatement();
String insertQuery = "Insert into Persons(PersonID, LastName, FirstName, Address, City) Value(10, 'DSouza', 'Peter', 'Summers Ave', 'NY')";
stmt.executeQuery(insertQuery);
String query = "select * from Persons";
rs = stmt.executeQuery(query);
while (rs.next()){
String FirstName = rs.getString("FirstName");
System.out.println(rs.getRow());
System.out.println(FirstName);
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
|
14bb3920-51d9-4ff7-b6e6-9256db3d985d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-09-16 09:11:54", "repo_name": "ycy2012/ylbms", "sub_path": "/src/com/ylbms/system/service/MenuService.java", "file_name": "MenuService.java", "file_ext": "java", "file_size_in_byte": 1187, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "7fd4badfa85c9415e2548842a85367125b4182bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ycy2012/ylbms
| 299
|
FILENAME: MenuService.java
| 0.277473
|
package com.ylbms.system.service;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ylbms.system.dao.MenuDao;
import com.ylbms.system.model.Menu;
/**
*
* @author JackLiang
* @version 1.0
* @date 2013-5-31
*/
@Service
@Transactional(readOnly = true)
public class MenuService {
private static final Log log = LogFactory.getLog(MenuService.class);
@Autowired
MenuDao menuDao;
public Menu getMenuById(Long id) {
return menuDao.get(id);
}
public void deleteMenu(Long id) {
menuDao.delete(id);
}
/**
*
* @param ids
*/
public void delByIds(String ids) {
String delHQL = "delete Menu where id in(" + ids + ")";
menuDao.createQuery(delHQL);
}
/**
* get all menus
*
* @return
*/
public List<Menu> getAll() {
return menuDao.getAll();
}
/**
* 查询菜单信息根据用户ID
*
* @param id
* @return
*/
public List<Menu> findByUserId(Long id) {
return menuDao.findByUserId(id);
}
}
|
b4280037-1d2e-43e0-ad09-531411b12c50
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-20 19:08:24", "repo_name": "richthofen911/LibDevContainer", "sub_path": "/app/src/main/java/net/callofdroidy/libdevcontainer/ActivityMain.java", "file_name": "ActivityMain.java", "file_ext": "java", "file_size_in_byte": 1075, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "164ef5bfdcf906a0d41896251d6d5d2b984c061a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/richthofen911/LibDevContainer
| 199
|
FILENAME: ActivityMain.java
| 0.235108
|
package net.callofdroidy.libdevcontainer;
import android.content.ContentValues;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
public class ActivityMain extends AppCompatActivity {
private boolean testValue;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
boolean result = Utils.verifyInputValue("a0aa", "\\d+");
Log.e("verify", String.valueOf(result));
}
@Override
protected void onSaveInstanceState(Bundle savedInstanceState){
super.onSaveInstanceState(savedInstanceState);
Log.e("lifecycle", "onSaveInstanceState");
}
@Override
protected void onResume() {
super.onResume();
Log.e("lifecycle", "onResume");
}
@Override
protected void onDestroy(){
super.onDestroy();
Log.e("lifecycle", "onDestroy");
}
}
|
8fd08fff-4a88-4769-a06d-6ac61a770904
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2014-03-03T04:11:50", "repo_name": "jer/docker_playground", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1167, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "f8902de34ab04fcfbebba456ff4f618f5dea703c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jer/docker_playground
| 302
|
FILENAME: README.md
| 0.208179
|
Docker Playground
=================
This is a Vagrant image for playing with various docker images. Just
run `vagrant up`, and there is a working docker with a handful of
`Dockerfile`s for experimentation.
Docker build scripts
--------------------
**chef-solo**: Intended as a playground for creating Docker images with
chef-solo.
**logstash**: A basic Docker image running the logstash server and
embedded elasticsearch and kibnana.
Steps to build and run (after `vagrant up`, `vagrant ssh`):
- Install and run elasticsearch:
cd /vagrant/logstash/elasticsearch
sudo docker build -t metrics/elasticsearch .
sudo docker run -d -p 9200:9200 --name elasticsearch metrics/elasticsearch
- Install and run the logstash indexer and web interface:
cd /vagrant/logstash/logstash-server
sudo docker build -t metrics/logstash .
sudo docker run -d -p 9292:9292 --link elasticsearch:elasticsearch metrics/logstash
- Visit `http://192.168.100.5:9292/` in your browser.
**node.js_app**: A simple node.js app in a box. Not much here for the
time being. Based on
http://docs.docker.io/en/latest/examples/nodejs_web_app/#nodejs-web-app
|
2036a777-182c-425e-a4bf-a288b1e680d4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-28 10:52:53", "repo_name": "A-Julien/krowemarf", "sub_path": "/krowemarf-kernel/src/main/java/appli/connexion/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "6413a28075fee049a9f43709734f5afca5acf155", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/A-Julien/krowemarf
| 244
|
FILENAME: Main.java
| 0.261331
|
package appli.connexion;
import com.prckt.krowemarf.struct.Server.Server;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import java.io.File;
import java.net.URL;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
try {
URL url = new File("C:\\Users\\Maxime\\IdeaProjects\\L3\\krowemarf\\krowemarf-kernel\\src\\main\\java\\appli\\connexion\\sample.fxml").toURL();
VBox root = (VBox) FXMLLoader.load(url);
primaryStage.setTitle("Projet MIAGE");
primaryStage.setResizable(false);
primaryStage.setScene(new Scene(root, 900, 300));
primaryStage.show();
Server server = new Server(1099, "127.0.0.1");
server.run();
}catch (Exception e){
e.printStackTrace();
}
}
//voici un commentaire
public static void main(String[] args) {
launch(args);
}
}
|
7335b1b3-8354-4bb2-9bfb-231a34ddd6c3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-12-20T21:26:38", "repo_name": "garrensweet/laravel-elixir-env", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1087, "line_count": 56, "lang": "en", "doc_type": "text", "blob_id": "64325cca93c33632498c632dd76b1925b5fddcfb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/garrensweet/laravel-elixir-env
| 277
|
FILENAME: README.md
| 0.279042
|
# laravel-elixir-env
[![NPM version][npm-image]][npm-url]
Use .env variables in your Javascript files with Laravel Elixir.
Currently supports Webpack.
## Installation
`
npm install laravel-elixir-env --save
`
or
`
yarn add laravel-elixir-env
`
## Requirements
- Laravel Elixir
- Laravel-elixir-webpack-official
## Usage
Require the package in your gulpfile, after Elixir:
```javascript
const elixir = require('laravel-elixir');
//...
require('laravel-elixir-env');
//...
```
Now you can access your variables in all the scripts that are packaged with Webpack like so:
```javascript
process.env.VAR_NAME
```
Be careful with sensitive variables that can hold private information. Don't forget to recompile on all your environments.
If you like this, please star on [GitHub](https://github.com/appstract/laravel-elixir-env)!
Issues and Pull Requests welcome.
## License
Laravel-elixir-env is licensed under [The MIT License (MIT)](LICENSE.md).
[npm-url]: https://www.npmjs.com/package/laravel-elixir-env
[npm-image]: https://badge.fury.io/js/laravel-elixir-env.svg
|
ed9ebdfa-caf7-4c06-ad36-1bfee294ccd9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-11-24 01:40:10", "repo_name": "rafikrafael/avaliacao-jpa-2012", "sub_path": "/src/main/java/entidade/ComposedProduct.java", "file_name": "ComposedProduct.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "a3799a12daab2b2171105728c0bf533f171e9538", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rafikrafael/avaliacao-jpa-2012
| 203
|
FILENAME: ComposedProduct.java
| 0.23793
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package entidade;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
/**
*
* @author rafik
*/
@Entity
@DiscriminatorValue("C")
public class ComposedProduct extends Product implements Serializable{
@Column(name="description")
private String description;
@ManyToMany
@JoinTable(name="composedproductitems")
private List<Product> products = new LinkedList<Product>();
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<Product> getProducts() {
return products;
}
public void setProducts(List<Product> products) {
this.products = products;
}
}
|
39189964-781f-4128-85a0-59ba94bbee44
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-02 12:48:23", "repo_name": "hanlipengpeng/blog", "sub_path": "/CloudDocLib/src/com/cdl/servlet/JspServlet.java", "file_name": "JspServlet.java", "file_ext": "java", "file_size_in_byte": 1085, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "91592b37aa345ba6c366cfb3005797da9fbf4cc8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hanlipengpeng/blog
| 204
|
FILENAME: JspServlet.java
| 0.290176
|
package com.cdl.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 JspServlet extends HttpServlet{
public JspServlet(){
super();
}
@Override
public void init() throws ServletException {
// put your code here
}
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
doPost(req,resp);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String scope =request.getParameter("scope");
String result =null;
if(scope.equals("portalSession")){
result = "zhangsan";
}
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.print(result);
out.flush();
out.close();
}
public void destroy(){
super.destroy();// Just puts
}
}
|
9f5587ef-a885-4db2-b89e-2d6aa78f3f0b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-05-06 17:39:08", "repo_name": "theNightosphere/JStateDrawer", "sub_path": "/src/edu/uwm/JStateDrawer/DrawerMain.java", "file_name": "DrawerMain.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "835dc828a92ad0abaac041a2bdf96f490cc7f451", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/theNightosphere/JStateDrawer
| 252
|
FILENAME: DrawerMain.java
| 0.292595
|
package edu.uwm.JStateDrawer;
import org.jhotdraw.app.Application;
import org.jhotdraw.app.DefaultApplicationModel;
import org.jhotdraw.app.MDIApplication;
import org.jhotdraw.app.OSXApplication;
import org.jhotdraw.app.SDIApplication;
public class DrawerMain {
/**
* Main.
*
*/
/** Creates a new instance. */
public static void main(String[] args) {
Application app;
String os = System.getProperty("os.name").toLowerCase();
if (os.startsWith("mac")) {
app = new OSXApplication();
} else if (os.startsWith("win")) {
// app = new MDIApplication();
app = new SDIApplication();
} else {
app = new SDIApplication();
}
DefaultApplicationModel model = new DrawerApplicationModel();
model.setName("JStateDrawer");
model.setVersion(DrawerMain.class.getPackage().getImplementationVersion());
model.setCopyright("Copyright 2013 (c) Reed Johnson, Chad Fisher, and Scott Gill");
model.setViewClassName("edu.uwm.JStateDrawer.DrawerView");
app.setModel(model);
app.launch(args);
}
}
|
aba93390-99fb-4f95-821b-547518fe4951
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-05-27 05:00:57", "repo_name": "zachtjones/Java-Compiler", "sub_path": "/src/main/java/main/FileWriter.java", "file_name": "FileWriter.java", "file_ext": "java", "file_size_in_byte": 1028, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "944054f6b82dd1f6c973467e5ed43dab226c450b", "star_events_count": 7, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/zachtjones/Java-Compiler
| 194
|
FILENAME: FileWriter.java
| 0.259826
|
package main;
import helper.CompileException;
import org.jetbrains.annotations.NotNull;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
public class FileWriter {
/**
* Utility method for writing to the output directory
* @param directory The OutputDirs constant for the directory.
* @param name The file name to write to.
* @param content The content to write as a string (platform default encoding).
* @throws CompileException If there is an error writing to the file
= */
public static void writeToOutput(@NotNull OutputDirs directory, @NotNull String name, @NotNull String content)
throws CompileException {
directory.createDir();
try {
PrintWriter pw = new PrintWriter(directory.location + name);
pw.println(content);
pw.flush();
pw.close();
} catch (FileNotFoundException e) {
throw new CompileException("Couldn't write to the file", e, name, -1);
}
}
}
|
5116e042-e2fb-490c-9a18-c05dae5fc64e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-03-06 10:52:56", "repo_name": "moali2402/Git", "sub_path": "/Android/APPS/Rave/src/dev/vision/rave/views/SquareText.java", "file_name": "SquareText.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "71cf3a37dcd3f9058c361a36940f4f69827574bc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/moali2402/Git
| 209
|
FILENAME: SquareText.java
| 0.293404
|
package dev.vision.rave.views;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
public class SquareText extends TextView {
int bH = 80;
public SquareText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public SquareText(Context context) {
super(context);
}
public SquareText(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int parentWidth =getMeasuredWidth();
int parentHeight = getMeasuredHeight();
parentHeight = parentHeight>parentWidth ? parentHeight : parentWidth;
parentWidth = parentHeight>parentWidth ? parentHeight : parentWidth;
parentHeight = parentHeight<=bH ? parentHeight : bH;
setMeasuredDimension(parentWidth, parentHeight);
}
}
|
110eabbf-26bd-4df1-80a2-87779c363bca
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-29 14:52:29", "repo_name": "pauloavelar/donee-android", "sub_path": "/app/src/main/java/me/avelar/donee/util/ConnectivityHelper.java", "file_name": "ConnectivityHelper.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "cb28794fe4fbcb911ad7e23f0ae99b43606e6d3a", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/pauloavelar/donee-android
| 206
|
FILENAME: ConnectivityHelper.java
| 0.259826
|
package me.avelar.donee.util;
import android.content.Context;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public final class ConnectivityHelper {
public static boolean isConnectedToInternet(Context c) {
ConnectivityManager cm = (ConnectivityManager) getService(c, Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
}
public static boolean isLocationEnabled(Context c) {
LocationManager lm = (LocationManager) getService(c, Context.LOCATION_SERVICE);
boolean gpsEnabled = false, networkEnabled = false;
try{
gpsEnabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
networkEnabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
} catch (Exception ignore) { }
return gpsEnabled || networkEnabled;
}
private static Object getService(Context context, String serviceId) {
return context.getSystemService(serviceId);
}
}
|
21ed9ad6-a743-4a37-9ed6-4421c0495b6b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-01 16:54:50", "repo_name": "abhishekghante/RestAPI", "sub_path": "/src/main/java/com/RestAPI/RestApiApplication.java", "file_name": "RestApiApplication.java", "file_ext": "java", "file_size_in_byte": 1163, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "e6cc01fc1c9a3427710bea36fa7d8f50a8e950cb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/abhishekghante/RestAPI
| 251
|
FILENAME: RestApiApplication.java
| 0.250913
|
package com.RestAPI;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import com.RestAPI.dao.userDetailDao;
import com.RestAPI.model.UserDetails;
@SpringBootApplication
public class RestApiApplication {
public static void main(String[] args) {
ApplicationContext context = SpringApplication.run(RestApiApplication.class, args);
/* userDetailDao userDetailDao = context.getBean(userDetailDao.class); */
/*
* UserDetails details = new UserDetails(); details.setFull_name("abhinav");
* details.decodePassword("1234"); details.setStatus(1);
* details.setUser_email("abhinav@gmail.com");
* details.setUserimage("user_image"); //
* details.setUserImageb64(Config.upload_directory + //
* rs.getString("user_image")); details.setRole_name("SUPADM");
* details.setUsername("Supervisor"); details.setUserID(4);
* details.setState("mumbai"); details.setCity("delhi");
* details.setZone("North"); details.setMobile_number("7710903455");
*
* System.out.println(userDetailDao.save(details));
*/
}
}
|
b1158980-8e69-43cf-a051-c94a581be3e2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-05-07 02:11:13", "repo_name": "TongzheZhang/CodeWork", "sub_path": "/Android/CS8803-Mobile-Appplications-and-Services/app/src/main/java/com/jluo80/amazinggifter/utils/URLReader.java", "file_name": "URLReader.java", "file_ext": "java", "file_size_in_byte": 1085, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "66944b4261d14ab16af61fd0d54abab17bd6dbca", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/TongzheZhang/CodeWork
| 231
|
FILENAME: URLReader.java
| 0.284576
|
package com.jluo80.amazinggifter.utils;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
public class URLReader {
public static String sendGet(String address) throws Exception{
URL url = new URL(address);
URLConnection connection = url.openConnection();
/** Set request header content */
connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8");
String inputLine;
String response;
long totalBytes = 0 ;
StringBuilder builder = new StringBuilder();
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
while ((inputLine = in.readLine()) != null) {
builder.append(inputLine);
totalBytes += inputLine.getBytes("UTF-8").length ;
//System.out.println("Total bytes read :: " + totalBytes);
}
response = builder.toString();
return response ;
}
}
|
81403729-d5f5-463b-8395-db63baacb264
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-06-30 14:42:34", "repo_name": "vinsguru/vinsguru-blog-code-samples", "sub_path": "/architectural-pattern/saga-choreography/inventory-service/src/main/java/com/vinsguru/inventory/config/InventoryConfig.java", "file_name": "InventoryConfig.java", "file_ext": "java", "file_size_in_byte": 1112, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "61c194ea26014fa48ff1d8052e7a869080bff836", "star_events_count": 422, "fork_events_count": 606, "src_encoding": "UTF-8"}
|
https://github.com/vinsguru/vinsguru-blog-code-samples
| 205
|
FILENAME: InventoryConfig.java
| 0.291787
|
package com.vinsguru.inventory.config;
import com.vinsguru.events.inventory.InventoryEvent;
import com.vinsguru.events.order.OrderEvent;
import com.vinsguru.events.order.OrderStatus;
import com.vinsguru.inventory.service.InventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.util.function.Function;
@Configuration
public class InventoryConfig {
@Autowired
private InventoryService service;
@Bean
public Function<Flux<OrderEvent>, Flux<InventoryEvent>> inventoryProcessor() {
return flux -> flux.flatMap(this::processInventory);
}
private Mono<InventoryEvent> processInventory(OrderEvent event){
if(event.getOrderStatus().equals(OrderStatus.ORDER_CREATED)){
return Mono.fromSupplier(() -> this.service.newOrderInventory(event));
}
return Mono.fromRunnable(() -> this.service.cancelOrderInventory(event));
}
}
|
181d7acd-0f8d-4f6d-a7db-ad996a296dee
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-18 12:12:42", "repo_name": "jkueng83/OO", "sub_path": "/src/at/cc/jk/OO/Mensch/Athlete.java", "file_name": "Athlete.java", "file_ext": "java", "file_size_in_byte": 1141, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "bc70a88e468274fe3f9e0826002b46b12d403203", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jkueng83/OO
| 251
|
FILENAME: Athlete.java
| 0.291787
|
package at.cc.jk.OO.Mensch;
public class Athlete extends Person {
private int fitnessLevel;
private int weekTrainingHours;
public Athlete(String firstName, String familyName, String birthday, float weight, float height , int fitnessLevel,
int weekTrainingHours) {
super(firstName, familyName, birthday, weight, height);
this.fitnessLevel = fitnessLevel;
this.weekTrainingHours = weekTrainingHours;
}
public int getFitnessLevel() {
return fitnessLevel;
}
public void setFitnessLevel(int fitnessLevel) {
this.fitnessLevel = fitnessLevel;
}
public int getWeekTrainingHours() {
return weekTrainingHours;
}
public void setWeekTrainingHours(int weekTrainingHours) {
this.weekTrainingHours = weekTrainingHours;
}
public void printAthleteData() {
System.out.println("I am a Athlete!!\t\t- Father - Child Object");
printPersonData();
System.out.println("Fitness level:\t\t\t" + this.fitnessLevel + " %");
System.out.println("Training h/week:\t\t" + this.weekTrainingHours);
}
}
|
4937c02e-55d4-401c-b428-b6c5d73579d9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-15 09:44:44", "repo_name": "AnnaPivovarchik/pdd", "sub_path": "/app/src/main/java/com/anna/pdd/SplashScreen/SplashActivity.java", "file_name": "SplashActivity.java", "file_ext": "java", "file_size_in_byte": 1106, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "aee467f2bfab5dd2ef9855ca9a16c031837f29ac", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AnnaPivovarchik/pdd
| 193
|
FILENAME: SplashActivity.java
| 0.221351
|
package com.anna.pdd.SplashScreen;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import com.anna.pdd.Home.MainActivity;
import com.anna.pdd.LoginActivity;
import com.anna.pdd.R;
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
//to remove the action bar (title bar)
getSupportActionBar().hide();
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(SplashActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
}, 500);
}
}
|
2c62c999-b3c4-4de9-819d-15c6b67f59d3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-26 09:42:09", "repo_name": "gdufexzq/exercise_app", "sub_path": "/src/main/java/com/gdufe/exercise_app/entity/CourseCategory.java", "file_name": "CourseCategory.java", "file_ext": "java", "file_size_in_byte": 1239, "line_count": 75, "lang": "en", "doc_type": "code", "blob_id": "e1d14b2453d7ec51843eb02adecede2764e286ab", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gdufexzq/exercise_app
| 298
|
FILENAME: CourseCategory.java
| 0.204342
|
package com.gdufe.exercise_app.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author xuzhiquan
* @since 2019-03-28
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class CourseCategory implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 目录id
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 图片url
*/
@TableField("imageUrl")
private String imageUrl;
/**
* 目录名称
*/
private String categoryName;
/**
* 目录下课程的数量
*/
private Integer categoryCount;
/**
* 创建时间
*/
private Long createTime;
/**
* 修改时间
*/
private Long modifyTime;
/**
* 扩展字段1
*/
private String ext1;
/**
* 扩展字段2
*/
private String ext2;
/**
* 扩展字段3
*/
private String ext3;
}
|
b44e8b14-971f-48b4-b9b3-b489aaeedc5a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-14 16:54:40", "repo_name": "AlawnLyu/lyu-tech", "sub_path": "/src/main/java/com/lyu/tech/common/config/security/CustomLogoutHandler.java", "file_name": "CustomLogoutHandler.java", "file_ext": "java", "file_size_in_byte": 1172, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "d599514c65f74962afcead797d305b8750ac3d76", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AlawnLyu/lyu-tech
| 209
|
FILENAME: CustomLogoutHandler.java
| 0.213377
|
package com.lyu.tech.common.config.security;
import com.lyu.tech.common.util.redis.RedisCache;
import com.lyu.tech.sys.entity.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutHandler;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CustomLogoutHandler implements LogoutHandler {
private static final Logger logger = LoggerFactory.getLogger(CustomLogoutHandler.class);
@Autowired private RedisCache redisCache;
@Override
public void logout(
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse,
Authentication authentication) {
if (authentication != null) {
User user = (User) authentication.getPrincipal();
boolean result = redisCache.del("userinfo-" + user.getLogin());
if (logger.isDebugEnabled()) {
logger.debug("{}退出登录,清除用户缓存{}", user.getLogin(), result ? "成功" : "失败");
}
}
}
}
|
650b33e4-8c5f-45e2-bb7d-33a9347b4b57
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-15 16:01:53", "repo_name": "AlisaMartyanova/Linux_System_Monitor", "sub_path": "/src/main/java/GpuTypes/Nvidia/NvidiaGpu.java", "file_name": "NvidiaGpu.java", "file_ext": "java", "file_size_in_byte": 1077, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "17e4e5a413adfbc24b93501046de9c742b4a93b9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AlisaMartyanova/Linux_System_Monitor
| 238
|
FILENAME: NvidiaGpu.java
| 0.272025
|
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
import java.util.ArrayList;
public class NvidiaGpu extends Gpu {
NvidiaUtilization nvUtilization;
NvidiaMemory nvMemory;
public NvidiaGpu() {
super();
nvUtilization = new NvidiaUtilization();
nvMemory = new NvidiaMemory();
}
public void parse(Element gNode) {
name = gNode.getElementsByTagName("product_name")
.item(0).getTextContent();
nvUtilization.parse((Element) gNode
.getElementsByTagName("utilization").item(0));
nvMemory.parse((Element) gNode
.getElementsByTagName("fb_memory_usage").item(0));
NodeList pList = gNode.getElementsByTagName("process_info");
for (int i = 0; i < pList.getLength(); i++) {
NvidiaProcessInfo p = new NvidiaProcessInfo();
p.parse((Element) pList.item(i));
processes.add(p);
}
utilization = nvUtilization;
memory = nvMemory;
}
}
|
f92e2ea2-f536-4e9f-8231-af04dff10541
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-03 08:24:24", "repo_name": "piglete/DAST", "sub_path": "/app_base/src/main/java/club/map/base/model/AuthToken.java", "file_name": "AuthToken.java", "file_ext": "java", "file_size_in_byte": 1109, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "58f64e16f886b28315a071b4de824eca63d4ac39", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/piglete/DAST
| 230
|
FILENAME: AuthToken.java
| 0.255344
|
package club.map.base.model;
import club.map.core.model.RootObject;
import club.map.core.model.TableName;
@TableName("auth_token")
public class AuthToken extends RootObject {
private String token;
private Integer type;
private Integer foreignId;
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getForeignId() {
return foreignId;
}
public void setForeignId(Integer foreignId) {
this.foreignId = foreignId;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", token=").append(token);
sb.append(", type=").append(type);
sb.append(", foreignId=").append(foreignId);
sb.append("]");
return sb.toString();
}
}
|
78e0250f-6dbe-4e46-ab1a-177e48c19f81
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-07-25 13:52:21", "repo_name": "zhabba/jdbctest", "sub_path": "/src/JDBCTest.java", "file_name": "JDBCTest.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "f71bf29d2f220b4837c8816919a68b442a02f4c6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/zhabba/jdbctest
| 230
|
FILENAME: JDBCTest.java
| 0.258326
|
import java.sql.Connection;
import java.sql.SQLException;
/**
* Created by zhabba on 22.07.14.
*/
public class JDBCTest {
public static void main(String[] args) {
JDBCConnector JDBCConnector;
Connection myConnection = null;
if (args[0] == null) {
System.err.println("Server type not specified at command line");
return;
} else {
try {
System.out.println("Reading properties file " + "\"" + args[0] + "\"");
JDBCConnector = new JDBCConnector("./properties/" + args[0] + ".xml");
} catch (Exception e) {
System.err.println("Problem reading properties file " + "./properties/" + args[0] + ".xml");
e.printStackTrace();
return;
}
}
try {
myConnection = JDBCConnector.getConnection();
} catch (SQLException e) {
JDBCConnector.printSQLException(e);
} catch (Exception e) {
e.printStackTrace(System.err);
} finally {
JDBCConnector.closeConnection(myConnection);
}
}
}
|
20a839c1-7d79-4467-bcd4-c32210860210
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-04-20 17:59:36", "repo_name": "fedevelatec/asic-core", "sub_path": "/src/main/java/com/fedevela/core/cod/Messages.java", "file_name": "Messages.java", "file_ext": "java", "file_size_in_byte": 1090, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "6a4d834b337206fc4eb3d814ce2b9b6006923080", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fedevelatec/asic-core
| 238
|
FILENAME: Messages.java
| 0.294215
|
package com.fedevela.core.cod;
/**
* Created by Federico on 20/04/14.
*/
import java.util.ArrayList;
import java.util.StringTokenizer;
public class Messages {
private int code;
private ArrayList params;
/**
*
* @param str String format
* <code>[|param1|param2|param3...|paramn]
*/
public Messages(String str) throws CDCException {
StringTokenizer st = new StringTokenizer(str, "|");
int i = 0;
params = null;
while (st.hasMoreTokens()) {
if (i == 0) {
code = TypeCast.toInt(st.nextToken());
} else {
if (params == null) {
params = new ArrayList();
params.add(st.nextToken());
} else {
params.add(st.nextToken());
}
}
i++;
}
}
/**
*
* @return
*/
public int getCode() {
return code;
}
/**
*
* @return
*/
public Object[] getParams() {
return params.toArray();
}
}
|
eaad6e40-e7f5-490b-8626-e3e694fb6ccc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-21 20:08:59", "repo_name": "testcurry/javaweb", "sub_path": "/javaweb-servlet/servlet/src/com/testcy/servlet/ContextServlet.java", "file_name": "ContextServlet.java", "file_ext": "java", "file_size_in_byte": 1363, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "e42a02998d49cc81760d5e395b16b877caa43ec1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/testcurry/javaweb
| 242
|
FILENAME: ContextServlet.java
| 0.261331
|
package com.testcy.servlet;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
public class ContextServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//获取web.xml中配置的上下文参数context-param
ServletContext context = getServletConfig().getServletContext();
String username = context.getInitParameter("username");
String password = context.getInitParameter("password");
System.out.println("context-param的username的参数值为:"+username);
System.out.println("context-param的password的参数值为:"+password);
//获取当前工程路径
System.out.println("当前工程的路径为:"+context.getContextPath());
//获取工程部署后再服务器上的绝对路径
System.out.println("部署在服务器上的绝对路径为"+context.getRealPath("/"));
//获取curry.jpg部署在服务器上的绝对路径
System.out.println("curry.jpg部署在服务器上的绝对路径"+context.getRealPath("/image"));
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
|
c5a7fc0d-fe88-49da-9061-f5061adb3001
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-25 16:21:22", "repo_name": "yeehomfoo/sell-server", "sub_path": "/src/main/java/com/yeehom/learn/service/impl/CategoryServiceImpl.java", "file_name": "CategoryServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1146, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "a47375428ab1f62dfb9420bd133b4d0a7a4af55f", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yeehomfoo/sell-server
| 217
|
FILENAME: CategoryServiceImpl.java
| 0.259826
|
package com.yeehom.learn.service.impl;
import com.yeehom.learn.dataobject.ProductCategory;
import com.yeehom.learn.repository.ProductCategoryRepository;
import com.yeehom.learn.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 类目
* Created by yFoo on 13/01/2018.
*/
@Service
public class CategoryServiceImpl implements CategoryService {
@Autowired
private ProductCategoryRepository productCategoryRepository;
@Override
public ProductCategory findOne(Integer categoryId) {
return productCategoryRepository.findOne(categoryId);
}
@Override
public List<ProductCategory> findAll() {
return productCategoryRepository.findAll();
}
@Override
public List<ProductCategory> findByCategoryTypeIn(List<Integer> categoryTypeList) {
return productCategoryRepository.findByCategoryTypeIn(categoryTypeList);
}
@Override
public ProductCategory save(ProductCategory productCategory) {
return productCategoryRepository.save(productCategory);
}
}
|
d0118306-6946-4019-8538-ca1e54cbc2a1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-22 12:53:51", "repo_name": "ha-heihei/DormitoryManage", "sub_path": "/src/test/java/com/lh/MyTest.java", "file_name": "MyTest.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "7f51f0ee863de679a89eda86cdf55008eb68b50c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ha-heihei/DormitoryManage
| 257
|
FILENAME: MyTest.java
| 0.216012
|
package com.lh;
import com.google.gson.Gson;
import com.lh.dao.ScoreMapper;
import com.lh.utils.ExcelUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiHao
* @create 20201124 10:24
*/
public class MyTest {
@Test
public void test(){
ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
ScoreMapper scoreMapper = context.getBean("scoreMapper", ScoreMapper.class);
List<Map<String, Object>> maps = scoreMapper.downLoadScoreListByDate(new HashMap<String, Object>());
System.out.println(new Gson().toJson(maps));
List<String> cols=new ArrayList<String>();
cols.add("1");
cols.add("1");
cols.add("1");
cols.add("1");
cols.add("1");
cols.add("1");
cols.add("1");
cols.add("1");
cols.add("1");
cols.add("1");
}
}
|
915afc0c-c952-4ae3-b9af-7688dc697a5c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-01-28T05:47:49", "repo_name": "Rtaylo16/At-What-Cost-", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1084, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "ef6b76fa87840058ec640d96bbcc09cb6cd57ae1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Rtaylo16/At-What-Cost-
| 237
|
FILENAME: README.md
| 0.253861
|
# At What Cost?

## Table of contents
* [General info](#general-info)
* [Technologies](#technologies)
* [Usage](#usage)
## General info
At what cost is an e-commerce application that optimizes the customer experience.
This application is an online thrift store meant to stir up nostalgia.
At What Cost provides unique items that will keep you guessing what will show up next in the inventory.
## Technologies
Project is created with:
* ReactJs
* commerce.js
* stripe
* Material-Ui
## Usage
This application allows the user to browse the products available.
The user can add the items from the product page to their cart.
From the cart the user can decrement and increment the amount items in there cart and also checkout.
Upon checking out the user can input their shipping information.
The user will then be prompted to put in their credit card information.
Upon filling out thr credit card information the user will receive an order confirmation and confirmation email.
## Live site
[At What Cost?](https://at-what-cost.netlify.app/)
|
81f04b75-9d47-4037-9c17-157117aef58b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-07-19T03:21:44", "repo_name": "OI-wiki/api", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1168, "line_count": 89, "lang": "en", "doc_type": "text", "blob_id": "0f9bc646ab5c427e6c13e769983f3d2be244fe0c", "star_events_count": 3, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/OI-wiki/api
| 340
|
FILENAME: README.md
| 0.261331
|
# API.oi-wiki.org
A collection of public APIs maintained by the OI Wiki Team.
## Installation
Clone the repository
```
npm install
```
For development:
```
npm run dev
```
To start:
```
npm run start
```
To debug in visual studio code:
```
npm run debug
```
Then run the `launch.json` configuration inside visual studio code `f5`. You should now be able to set breakpoints in your typescript.
Test
```
npm run test
```
Test Watch
```
npm run test:watch
```
Build to `./dist`
```
npm run build
```
Browse to http://localhost:3000
## Folder structure
```
|-- Dockerfile
|-- README.md
|-- package.json
|-- spec
| -- index.spec.ts
|-- src
| |-- config
| | -- config.ts
| | -- express.ts
| |-- controllers
| | -- index.server.controller.ts
| |-- index.ts
| |-- public
| | -- stylesheets
| | -- style.css
| |-- routes
| | -- index.server.route.ts
| |-- tsconfig.json
| -- views
| -- error.jade
| -- index.jade
| -- layout.jade
-- tsconfig.json
```
## Docker
Build the image `sudo docker build -t xxx/xxx .`
Run the image `docker-compose up`
Open `http://localhost:8080`
## License
MIT
|
57384b8b-94ef-4f92-9c94-cd5bf6689a6f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-06-23 00:22:15", "repo_name": "quinscape/automaton", "sub_path": "/src/main/java/de/quinscape/automaton/model/view/CompositeComponent.java", "file_name": "CompositeComponent.java", "file_ext": "java", "file_size_in_byte": 1105, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "ba10cbeefb7d28ce81db89edb09ede2000c9a01c", "star_events_count": 2, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/quinscape/automaton
| 235
|
FILENAME: CompositeComponent.java
| 0.286169
|
package de.quinscape.automaton.model.view;
import de.quinscape.automaton.model.NamedModel;
import org.svenson.JSONTypeHint;
import java.util.List;
public class CompositeComponent
implements NamedModel
{
private String name;
private List<ViewDeclaration> declarations;
private Component root;
public void setName(String name)
{
this.name = name;
}
@Override
public String getName()
{
return name;
}
public List<ViewDeclaration> getDeclarations()
{
return declarations;
}
@JSONTypeHint(ViewDeclaration.class)
public void setDeclarations(List<ViewDeclaration> declarations)
{
this.declarations = declarations;
}
public Component getRoot()
{
return root;
}
public void setRoot(Component root)
{
this.root = root;
}
@Override
public String toString()
{
return super.toString() + ": "
+ "name = '" + name + '\''
+ ", declarations = " + declarations
+ ", root = " + root
;
}
}
|
cdfb662f-56a8-4475-b737-aef375727b2e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-07T17:03:25", "repo_name": "freebz/Lucene-in-Action", "sub_path": "/ch09/ex9-3.java", "file_name": "ex9-3.java", "file_ext": "java", "file_size_in_byte": 1136, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "122f774e6188b550f6924ed2882e46e0fb05448d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/freebz/Lucene-in-Action
| 298
|
FILENAME: ex9-3.java
| 0.293404
|
// 예제 9.3 워드넷 유의어 색인에서 유의어 찾아오기
public static void main(String[] args) throws IOException {
if (args.length != 2) {
System.out.println(
"java org.apache.lucene.wordnet.SynLookup <index path> <word>");
}
FSDirectory directory = FSDirectory.open(new File(args[0]));
IndexSearcher searcher = new IndexSearcher(directory, true);
String word = args[1];
Query query = new TermQuery(new Term(Syns2Index.F_WORD, word));
CountingCollector countingCollector = new CountingCollector();
searcher.search(query, countingCollector);
if (countingCollector.numHits == 0) {
System.out.println("No synonyms found for " + word);
} else {
System.out.println("Synonyms found for \"" + word + "\":");
}
ScoreDoc[] hits = searcher.search(query,
countingCollector.numHits).scoreDocs;
for (int i = 0; i < hits.length; i++) {
Document doc = searcher.doc(hits[i].doc);
String[] values = doc.getValues(Syns2Index.F_SYN);
for (int j = 0; j < values.length; j++) {
System.out.println(values[j]);
}
}
searcher.close();
directory.close();
}
|
4c9979bb-bca5-41b2-aab6-80b6b2a739b8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-18 19:08:57", "repo_name": "BusraSahin/Employee_Project", "sub_path": "/EmployeeProject/src/main/java/MainApp.java", "file_name": "MainApp.java", "file_ext": "java", "file_size_in_byte": 1151, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "1646e77ecc199100c3f5ba4cd1ead114b4e0c402", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/BusraSahin/Employee_Project
| 224
|
FILENAME: MainApp.java
| 0.272799
|
import Controller.EmployeeController;
import Controller.EmployeeControllerImpl;
import Entity.Employee;
import java.util.List;
public class MainApp {
public static void main(String[] args) {
EmployeeController employeeController = new EmployeeControllerImpl();
Employee employee = new Employee();
employee.setFirstName("Büşra");
employee.setLastName("ŞAHİN");
employee.setDateOfBİrth("06/07/1999");
employee.setPlaceOfBirth("Bolu");
//employeeController.createNewEmployee(employee);
employeeController.getEmployeeList(5);
// employeeController.deleteEmployee(employee);
employeeController.updateEmployee(employee);
employeeListesi();
}
public static void employeeListesi (){
EmployeeController employeeController = new EmployeeControllerImpl();
List<Employee> liste = employeeController.getEmployeeList(5);
for(int i=0 ; i<liste.size();i++){
Employee employee = liste.get(i);
System.out.println("Adı/Soyadı : "+employee.getFirstName()+" " + employee.getLastName());
}
}
}
|
4b0bf2ae-e281-4029-8dd6-9770b6eba3d2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-03-06T20:02:43", "repo_name": "prestodb/presto", "sub_path": "/presto-base-jdbc/src/main/java/com/facebook/presto/plugin/jdbc/JdbcMetadataConfig.java", "file_name": "JdbcMetadataConfig.java", "file_ext": "java", "file_size_in_byte": 2590, "line_count": 87, "lang": "en", "doc_type": "code", "blob_id": "1160886ada56308f17f21a110921369d33dcbeb1", "star_events_count": 11721, "fork_events_count": 4470, "src_encoding": "UTF-8"}
|
https://github.com/prestodb/presto
| 233
|
FILENAME: JdbcMetadataConfig.java
| 0.268941
|
/*
* 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.facebook.presto.plugin.jdbc;
import com.facebook.airlift.configuration.Config;
import com.facebook.airlift.configuration.ConfigDescription;
public class JdbcMetadataConfig
{
private boolean allowDropTable;
public boolean isAllowDropTable()
{
return allowDropTable;
}
@Config("allow-drop-table")
@ConfigDescription("Allow connector to drop tables")
public JdbcMetadataConfig setAllowDropTable(boolean allowDropTable)
{
this.allowDropTable = allowDropTable;
return this;
}
}
|
4d68b733-e4c2-4763-aeda-bb3447cb3f8f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-13 08:35:47", "repo_name": "infinitete/upchain-solution", "sub_path": "/consumer/src/main/java/com/fecred/cxpt/consumer/utils/netUtil.java", "file_name": "netUtil.java", "file_ext": "java", "file_size_in_byte": 1049, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "e657ea965d30e1320ac7ec5e6f60c114880e0e67", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/infinitete/upchain-solution
| 193
|
FILENAME: netUtil.java
| 0.228156
|
package com.fecred.cxpt.consumer.utils;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
public class netUtil {
public static final String getLocalIp() {
String ipString = "";
try {
Enumeration<NetworkInterface> allNetInterfaces = NetworkInterface.getNetworkInterfaces();
InetAddress ip = null;
while (allNetInterfaces.hasMoreElements()) {
NetworkInterface networkInterface = allNetInterfaces.nextElement();
Enumeration<InetAddress> address = networkInterface.getInetAddresses();
while (address.hasMoreElements()) {
ip = address.nextElement();
if (ip != null && ip instanceof Inet4Address && !ip.equals("127.0.0.1")) {
return ip.getHostAddress();
}
}
}
return ipString;
} catch (Exception e) {}
return ipString;
}
}
|
dce6db19-2990-41c8-9b04-0c18c8aa9076
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-31 03:13:23", "repo_name": "firebat/common-java", "sub_path": "/common-monitor/src/main/java/common/monitor/servlet/MonitorServlet.java", "file_name": "MonitorServlet.java", "file_ext": "java", "file_size_in_byte": 1086, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "f7f1e16f98372224c97f5f2c9b4516c9e615a36a", "star_events_count": 4, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/firebat/common-java
| 199
|
FILENAME: MonitorServlet.java
| 0.27048
|
package common.monitor.servlet;
import common.monitor.Cache;
import common.monitor.Monitor;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
public class MonitorServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/plain");
PrintWriter writer = resp.getWriter();
Cache cache = Monitor.getCache();
cache.getValues().forEach((name, value) -> writer.println(makeName(name + "_Value") + "=" + value));
cache.getTimers().forEach((name, timer) -> {
writer.println(makeName(name + "_Count") + "=" + timer.getCount());
writer.println(makeName(name + "_Duration") + "=" + timer.getDuration());
});
}
private static String makeName(String name) {
return StringUtils.replaceChars(name, ' ', '_');
}
}
|
bfb40b1a-8bf8-48f6-af7d-28e3eda8b250
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-02 15:12:59", "repo_name": "mikeoles/SwiftSet", "sub_path": "/app/src/main/java/com/michaeloles/swiftset/SortingGroups/LatMovementPatterns.java", "file_name": "LatMovementPatterns.java", "file_ext": "java", "file_size_in_byte": 1046, "line_count": 23, "lang": "en", "doc_type": "code", "blob_id": "0c0bce073799efab6ce60411243919a04ad65b91", "star_events_count": 6, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/mikeoles/SwiftSet
| 208
|
FILENAME: LatMovementPatterns.java
| 0.256832
|
package com.michaeloles.swiftset.SortingGroups;
import com.michaeloles.swiftset.SortingCategory;
import com.michaeloles.swiftset.SortingGroup;
import com.michaeloles.swiftset.SortingGroups.Grip;
import java.io.Serializable;
public class LatMovementPatterns extends SortingGroup implements Serializable {
public LatMovementPatterns(){
this.setName("Movement Patterns");
SortingCategory horizontalpull = new SortingCategory("Horizontal Pull", "Movement", "Horizontal Pull");
horizontalpull.addNewOptions(new Angle());
this.addOption(horizontalpull);
SortingCategory verticalpull = new SortingCategory("Vertical Pull","Movement","Vertical Pull");
verticalpull.addNewOptions(new Grip());
this.addOption(verticalpull);
this.addOption(new SortingCategory("Pullover Variation", "Movement", "Pullover"));
SortingCategory pullup = new SortingCategory("Pullup Variations", "Movement", "Pullup");
pullup.addNewOptions(new Grip());
this.addOption(pullup);
}
}
|
aa4584be-8891-4c34-af21-85039d55c744
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-25 03:09:38", "repo_name": "guyuetftb/guyue-flink-learning", "sub_path": "/src/main/java/com/guyue/flink/duoyi/examples/KafkaSourceSimpleTest.java", "file_name": "KafkaSourceSimpleTest.java", "file_ext": "java", "file_size_in_byte": 1167, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "608da0778c8a863e63011791d2c56a995793f389", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/guyuetftb/guyue-flink-learning
| 275
|
FILENAME: KafkaSourceSimpleTest.java
| 0.267408
|
package com.guyue.flink.duoyi.examples;
import com.guyue.utils.KafkaUtils;
import java.util.Properties;
import org.apache.flink.api.common.serialization.SimpleStringSchema;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer;
/**
* @ClassName KafkaSourceSimpleTest
* @Description TOOD
* @Author lipeng
* @Date 2020-03-03 12:11
*/
public class KafkaSourceSimpleTest {
public static void main(String[] args) throws Exception {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
// Kafka Source
String topics = "wc10";
Properties kafkaProperties = KafkaUtils.buildKafkaProperties("gid-dy-wc01");
SimpleStringSchema stringSchema = new SimpleStringSchema();
FlinkKafkaConsumer<String> stringFlinkKafkaConsumer = new FlinkKafkaConsumer<>(topics, stringSchema, kafkaProperties);
// Source add
DataStreamSource<String> lines = env.addSource(stringFlinkKafkaConsumer);
// Sink print
lines.print();
env.execute("KafkaSourceSimpleTest");
}
}
|
54535b0a-a009-41a8-ab44-0dd87f26a86c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-05 12:59:17", "repo_name": "ShamsTabish/AndroidSamples", "sub_path": "/Session10/app/src/main/java/com/acadgild/session10/SwipeRefreshDemo.java", "file_name": "SwipeRefreshDemo.java", "file_ext": "java", "file_size_in_byte": 1094, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "2972ddbf4ed91d629655b1237d6a24e6058d9e94", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ShamsTabish/AndroidSamples
| 183
|
FILENAME: SwipeRefreshDemo.java
| 0.261331
|
package com.acadgild.session10;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
public class SwipeRefreshDemo extends AppCompatActivity {
SwipeRefreshLayout refreshLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_swipe_refresh_demo);
refreshLayout=(SwipeRefreshLayout)findViewById(R.id.refreshlayout);
refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
refreshLayout.setRefreshing(true);
try { Thread.sleep(3000); } catch (InterruptedException e) {
e.printStackTrace();
}
Toast.makeText(SwipeRefreshDemo.this, "Refreshing the Contents", Toast.LENGTH_SHORT).show();
refreshLayout.setRefreshing(false);
}
});
}
}
|
17b5a0d8-d969-4f90-b768-e9815cc9beec
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-01 09:00:24", "repo_name": "aishadiga7/Google-Places-Assignment", "sub_path": "/app/src/main/java/com/robosoftin/assignment/myapplication/model/PlaceResults.java", "file_name": "PlaceResults.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "c1a25556127d368602b2a07dd1298aea4044f426", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/aishadiga7/Google-Places-Assignment
| 237
|
FILENAME: PlaceResults.java
| 0.239349
|
package com.robosoftin.assignment.myapplication.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.List;
/**
* Created by aishwarya on 28/5/16.
*/
public class PlaceResults {
@SerializedName("html_attributions")
@Expose
public List<Object> mHtmlAttributions = new ArrayList<Object>();
@SerializedName("results")
@Expose
private ArrayList<Result> mResults = new ArrayList<Result>();
@SerializedName("status")
@Expose
private String mStatus;
@SerializedName("error_message")
@Expose
private String mErrorMessage;
public ArrayList<Result> getResults() {
return mResults;
}
public void setResults(ArrayList<Result> results) {
mResults = results;
}
public String getErrorMessage() {
return mErrorMessage;
}
public void setErrorMessage(String errorMessage) {
mErrorMessage = errorMessage;
}
public String getStatus() {
return mStatus;
}
public void setStatus(String status) {
mStatus = status;
}
}
|
94adecae-5dd0-4445-8629-d6d0cf17b9b3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-09 13:46:10", "repo_name": "weeroshara/Hotel-Management-System", "sub_path": "/src/entity/RoomBookDate.java", "file_name": "RoomBookDate.java", "file_ext": "java", "file_size_in_byte": 1092, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "b1eb244c4e9b3f6c160b0a0aac09a9af8cd5e8a2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/weeroshara/Hotel-Management-System
| 252
|
FILENAME: RoomBookDate.java
| 0.280616
|
package entity;
import java.sql.Date;
public class RoomBookDate implements SupperEntity{
private RoomBookDatePK roomBookDatePK;
private Date bookingDate;
public RoomBookDate() {
}
public RoomBookDate(RoomBookDatePK roomBookDatePK, Date bookingDate) {
this.roomBookDatePK = roomBookDatePK;
this.bookingDate = bookingDate;
}
public RoomBookDate(String roomId, String customerId, Date bookingDate) {
this.roomBookDatePK = new RoomBookDatePK(roomId,customerId);
this.bookingDate = bookingDate;
}
public Date getBookingDate() {
return bookingDate;
}
public void setBookingDate(Date bookingDate) {
this.bookingDate = bookingDate;
}
public RoomBookDatePK getRoomBookDatePK() {
return roomBookDatePK;
}
public void setRoomBookDatePK(RoomBookDatePK roomBookDatePK) {
this.roomBookDatePK = roomBookDatePK;
}
@Override
public String toString() {
return "RoomBookDate{" +
", bookingDate=" + bookingDate +
'}';
}
}
|
d1300acf-9df8-4b23-8642-5b0e0be97f02
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-08-24T04:02:50", "repo_name": "ortizjavier10/employee-tracker", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1111, "line_count": 40, "lang": "en", "doc_type": "text", "blob_id": "24b73ad35998a0297ba87c8b985b9a121dae11fb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ortizjavier10/employee-tracker
| 266
|
FILENAME: README.md
| 0.262842
|
# Employee Tracker

## Description
Employee Traker is an application that helps you keep track of employees. Simply answer some questions and it will automatically update your employees database with the information. Try it for your employees!
## Table of Contents
* [Installation](#installation)
* [Usage](#usage)
* [Sample](#sample)
* [License](#license)
* [Contribution](#contribution)
* [Questions](#questions)
## Installation
Download the application and run:
```
npm install
```
## Usage
Open a terminal window, type in "node index" and answer the questions. Once done the application will generate the updated employees database.
## Sample
Here is a sample screenshot:
<img src="./images/screenshot.PNG" >
Video demonstrating the application:
https://drive.google.com/file/d/1K4zE6-ahit-PT9SEv-m8bVz3i4DKzL_m/view
## License
Team Profile Generator is licensed under the MIT License.
## Questions
If you have any question please check out my GitHub https://github.com/ortizjavier10 or email me at ortiz.javier10@gmail.com .
|
d1fb40d8-5a3c-4d82-9d0e-88d2010727bd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-17 03:36:20", "repo_name": "ddeniel1/EP-Redes", "sub_path": "/src/java/main/br/com/cinemaja/AppStarter.java", "file_name": "AppStarter.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "86b83920553aa0798701438ecd42b7c10f300a89", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ddeniel1/EP-Redes
| 270
|
FILENAME: AppStarter.java
| 0.290176
|
package br.com.cinemaja;
import br.com.cinemaja.Model.Object.Session;
import br.com.cinemaja.Network.Client.Client;
import br.com.cinemaja.Network.Server.Server;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
public class AppStarter{
public static void main(String[] args) {
if (args[0].equals("servidor")) initializeServer();
else if (args[0].equals("client")) initializeClient();
else
System.out.println("Inicie o servidor digitando servidor como parametro ou cliente digitando client como parametro.");
}
private static void initializeClient() {
Client client = new Client("127.0.0.1", 3000);
client.run();
}
private static void initializeServer() {
Session sessao = new Session("Avengers", 5, 5, LocalDateTime.parse("2019-10-10T19:00:00"));
List<Session> sessionsList = new ArrayList<>();
sessionsList.add(sessao);
new Server(3000, sessionsList).start();
System.out.println(sessao.toString());
}
private static void msg(String s) {
System.out.println(s);
}
}
|
59ec580e-ff2d-4ce2-b7a4-90901503ae61
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-09T21:33:14", "repo_name": "otavioprado/gumga-passwordmeter", "sub_path": "/src/main/java/br/com/db1/gumga/passwordmeter/dto/PasswordMeterResponse.java", "file_name": "PasswordMeterResponse.java", "file_ext": "java", "file_size_in_byte": 1058, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "7096c27fe0ccb174b9d2d6f74a0f0c990bfe5ac9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/otavioprado/gumga-passwordmeter
| 244
|
FILENAME: PasswordMeterResponse.java
| 0.27513
|
package br.com.db1.gumga.passwordmeter.dto;
import java.util.Objects;
import br.com.db1.gumga.passwordmeter.enums.LevelScore;
public class PasswordMeterResponse {
private Long score;
private LevelScore levelScore;
public PasswordMeterResponse() {
}
public PasswordMeterResponse(Long score, LevelScore levelScore) {
this.score = score;
this.levelScore = levelScore;
}
public Long getScore() {
return score;
}
public LevelScore getLevelScore() {
return levelScore;
}
public String getDescription() {
return levelScore.getDescription();
}
public PasswordMeterResponse(LevelScore levelScore, Long score) {
this.levelScore = levelScore;
this.score = score;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
PasswordMeterResponse that = (PasswordMeterResponse) o;
return Objects.equals(score, that.score) && levelScore == that.levelScore;
}
@Override
public int hashCode() {
return Objects.hash(score, levelScore);
}
}
|
e0b4e814-e0a1-4f41-819f-17c734fbeb52
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-01-02 13:30:06", "repo_name": "PriyankaPathak/birdsquare", "sub_path": "/src/test/java/birdsquare/controller/LoginControllerTest.java", "file_name": "LoginControllerTest.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "3de7b82d749ef9050dc27dcfe7ef156965b0405d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/PriyankaPathak/birdsquare
| 197
|
FILENAME: LoginControllerTest.java
| 0.264358
|
package birdsquare.controller;
import org.junit.Before;
import org.junit.Test;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter;
import static org.springframework.test.web.ModelAndViewAssert.assertViewName;
public class LoginControllerTest {
private MockHttpServletRequest request;
private MockHttpServletResponse response;
private AnnotationMethodHandlerAdapter handlerAdapter;
private LoginController controller;
@Before
public void setUp() {
request = new MockHttpServletRequest();
response = new MockHttpServletResponse();
handlerAdapter = new AnnotationMethodHandlerAdapter();
controller = new LoginController();
}
@Test
public void shouldRenderHomePageAfterClickingHomeButton() throws Exception {
request.setRequestURI("/login");
final ModelAndView mav = handlerAdapter.handle(request, response, controller);
assertViewName(mav, "home/login");
}
}
|
0fbf6557-b2ec-46db-86a1-c88c68c73d7e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-18 02:58:01", "repo_name": "hongchun166/SlideSwitchDome", "sub_path": "/app/src/main/java/com/thc/mydomeview/dome/SlideSwitchDomeActivity.java", "file_name": "SlideSwitchDomeActivity.java", "file_ext": "java", "file_size_in_byte": 1142, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "341903567a58f9c4ab41a1060909da32e3672062", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/hongchun166/SlideSwitchDome
| 240
|
FILENAME: SlideSwitchDomeActivity.java
| 0.278257
|
package com.thc.mydomeview.dome;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.thc.mydomeview.R;
import thc.com.view.slideswitch.SlideSwitch;
/**
* Created by Nicky on 2017/10/12.
*/
public class SlideSwitchDomeActivity extends AppCompatActivity implements SlideSwitch.OnSlideListener{
SlideSwitch view_SlideSwitch_one;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_slideswitch_dome);
initView();
initEven();
}
private void initView(){
view_SlideSwitch_one= (SlideSwitch) findViewById(R.id.view_SlideSwitch_one);
}
private void initEven(){
view_SlideSwitch_one.setOnSlideListener(this);
}
public void startAlphabetClick(View view){
startActivity(new Intent(this,AlphabetDemoActivity.class));
}
@Override
public void onSlideChangCallback(SlideSwitch slideSwitch, boolean isOpen) {
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.