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
|
|---|---|---|---|---|---|---|
762ae0d4-f656-48b4-ac79-5dae214255e6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2023-09-04T18:33:12", "repo_name": "w3c/webref", "sub_path": "/ed/idlpatches/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1049, "line_count": 25, "lang": "en", "doc_type": "text", "blob_id": "2aebb86acbaf24cb84b3f0e60755a03e4945d77d", "star_events_count": 227, "fork_events_count": 47, "src_encoding": "UTF-8"}
|
https://github.com/w3c/webref
| 269
|
FILENAME: README.md
| 0.240775
|
# Web IDL patches
These are patches applied to the Web IDL scraped from specs to produce `@webref/idl` package. These patches can break as specs are updated and thus need ongoing maintenance.
## Creating patches
Using SVG as an example:
- Open a pull request or issue for the spec.
- Make the necessary changes to `ed/idl/SVG.idl` and commit that locally as a single commit. Reference the spec issue/PR in the commit message.
- Run `git format-patch -1` to create a patch file.
- Run `git reset HEAD~` to throw away the local commit.
- Move the patch to `ed/idlpatches/SVG.idl.patch` and commit the changes.
## Updating patches
Again using SVG as an example:
- Run `git am ed/idlpatches/SVG.idl.patch` to apply the patch locally, resolving any conflicts.
- Make the necessary changes to `ed/idl/SVG.idl`.
- Run `git commit --amend` to update the local commit.
- Run `git format-patch -1` to create a patch file.
- Run `git reset HEAD~` to throw away the local commit.
- Move the patch to `ed/idlpatches/SVG.idl.patch` and commit the changes.
|
f55763d9-16e0-4416-88c5-a4a99bd9e3b5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-08 14:21:09", "repo_name": "santubeikawhi/springJavaConfig", "sub_path": "/src/com/jl/spring/dao/PersonInfoDaoImpl.java", "file_name": "PersonInfoDaoImpl.java", "file_ext": "java", "file_size_in_byte": 985, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "f3b2b14a9948d5bb1acf14a4e4924a4d6797510f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "GB18030"}
|
https://github.com/santubeikawhi/springJavaConfig
| 202
|
FILENAME: PersonInfoDaoImpl.java
| 0.258326
|
package com.jl.spring.dao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import com.jl.spring.model.Customer;
import com.jl.spring.model.Person;
public class PersonInfoDaoImpl implements PersonInfoDao{
//config中 使用Autowired 在bean中 自动装配 bean
@Autowired
@Qualifier("person")
public Person person;
@Autowired
public Customer customer;
@Override
public void printPersonName() {
System.out.println("Dao.person(JavaConfig):"+person.getName());
}
@Override
public void printCustomerName() {
System.out.println("Dao.customer(JavaConfig):"+customer.getPerson().getName());
}
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
}
|
d59dc65a-dfe1-4016-bbd7-a57829d46a56
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-28 17:31:12", "repo_name": "ahmedishraq/CSE-111-Project-BankingSystem", "sub_path": "/project update/Pr/src/pr/Pr.java", "file_name": "Pr.java", "file_ext": "java", "file_size_in_byte": 1110, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "4cd948df8c855667ae6d4d5b99420fef57968613", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ahmedishraq/CSE-111-Project-BankingSystem
| 257
|
FILENAME: Pr.java
| 0.276691
|
/*
* 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 pr;
/**
*
* @author DOLPHIN
*/
import java.io.File;
import java.util.*;
public class Pr {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Account[] a = new Account[100];
try {
File f = new File("C:\\Users\\DOLPHIN\\Desktop\\project update\\hi.txt");
Scanner sx = new Scanner(f);
int i = 0;
while (sx.hasNext()) {
String n = sx.next();
String num = sx.next();
String pass = sx.next();
a[i] = new Account(n, num, pass);
i++;
}
for (int j = 0; j < i; j++) {
System.out.println(a[j].name + " " + a[j].number + " " + a[j].pass);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
1465c0c6-78ce-4266-9699-b04608df4836
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-19 03:21:08", "repo_name": "Fuy7/BookShop", "sub_path": "/src/com/fuy/book/dao/impl/UserDaoImpl.java", "file_name": "UserDaoImpl.java", "file_ext": "java", "file_size_in_byte": 971, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "d632f08d69516b3fb59e4e6b0fd6f910724001df", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Fuy7/BookShop
| 215
|
FILENAME: UserDaoImpl.java
| 0.279042
|
package com.fuy.book.dao.impl;
import com.fuy.book.dao.BaseUtils;
import com.fuy.book.dao.UserDao;
import com.fuy.book.entity.User;
public class UserDaoImpl extends BaseUtils implements UserDao {
@Override
public User queryUserByName(String userName) {
String sql = "select id,username,password,email from t_user where username = ?";
User user = (User) queryForOne(User.class, sql, userName);
return user;
}
@Override
public User queryUserByNameAndPwd(String userName, String password) {
String sql = "select id,username,password,email from t_user where username = ? and password = ?";
User user = (User) queryForOne(User.class, sql, userName,password);
return user;
}
@Override
public int saveUser(User user) {
String sql = "insert into t_user(username,`password`,email) values(?,?,?);";
return update(sql,user.getUsername(),user.getPassword(),user.getEmail());
}
}
|
da3c82bc-174a-4aed-940e-198ca7ec0720
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-13 04:27:50", "repo_name": "Mihail74/SpringLearning", "sub_path": "/SpringDataIntro/spring-data-intro/src/test/java/com/rusoft/JpaTest.java", "file_name": "JpaTest.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "89ac4fbaf0717460c9d56b134f42a3f1f57f52a7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Mihail74/SpringLearning
| 197
|
FILENAME: JpaTest.java
| 0.256832
|
package com.rusoft;
import com.rusoft.jpa.config.DataConfig;
import com.rusoft.jpa.employee.CrudEmployeeRepository;
import com.rusoft.jpa.employee.Employee;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.time.LocalDate;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {DataConfig.class, InitConfig.class})
public class JpaTest {
private static final Logger logger = LoggerFactory.getLogger(JpaTest.class);
@Autowired
private CrudEmployeeRepository employees;
@Test
public void findAll() throws Exception {
Iterable<Employee> all = employees.findAll();
all.forEach(e -> logger.debug("{} - {} - {}", e.getFirstName(), e.getLastName(), e.getDateOfBirth()));
}
}
|
c350ee92-8365-4a99-af9d-abcd421f76ff
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-07 15:31:19", "repo_name": "kyunss/AndroidLunaPlatformDemo", "sub_path": "/app/src/main/java/irisys/androidlunaplatformdemo/view/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "e4c6ffded9f06e3308b7a28a7d78e663d0e96355", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/kyunss/AndroidLunaPlatformDemo
| 204
|
FILENAME: MainActivity.java
| 0.228156
|
package irisys.androidlunaplatformdemo.view;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import irisys.androidlunaplatformdemo.R;
import irisys.androidlunaplatformdemo.contract.MainViewContract;
import irisys.androidlunaplatformdemo.databinding.ActivityMainBinding;
import irisys.androidlunaplatformdemo.viewmodel.MainViewModel;
public class MainActivity extends BaseActivity implements MainViewContract {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
binding.setViewModel(new MainViewModel(this));
}
@Override
public void startFaceEnrollmentActivity() {
startActivity(new Intent(MainActivity.this , FaceEnrollmentActivity.class));
// startActivity(new Intent(MainActivity.this , FaceEnroll.class));
}
@Override
public void startFaceRecognitionActivity() {
startActivity(new Intent(MainActivity.this , FaceRecognitionActivity.class));
}
}
|
7bbcfca1-e7c3-49be-9b67-94fb5342ea2a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-04-23 08:22:28", "repo_name": "Hsuchihhao/com.finalDesign", "sub_path": "/src/main/java/com/finalDesign/service/SchoolServiceImpl.java", "file_name": "SchoolServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1213, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "d92a4597fabfe149244c7edc8121b996183e9403", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Hsuchihhao/com.finalDesign
| 241
|
FILENAME: SchoolServiceImpl.java
| 0.274351
|
package com.finalDesign.service;
import com.finalDesign.dao.SchoolMapper;
import com.finalDesign.dao.UserMapper;
import com.finalDesign.pojo.School;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.UUID;
@Service("SchoolService")
public class SchoolServiceImpl implements SchoolService{
private SchoolMapper schoolMapper;
public void setSchoolMapper(SchoolMapper schoolMapper) {
this.schoolMapper = schoolMapper;
}
@Override
public int addSchool(School school) {
return schoolMapper.addSchool(school);
}
@Override
public List<School> queryAllSchool() {
return schoolMapper.queryAllSchool();
}
@Override
public School querySchoolByName(String schoolName) {
return schoolMapper.querySchoolByName(schoolName);
}
@Override
public School querySchoolById(int id) {
return schoolMapper.querySchoolById(id);
}
@Override
public int deleteSchoolById(int id) {
return schoolMapper.deleteSchoolById(id);
}
}
|
ee4ea8ee-4a47-456e-aa21-47fd95bac796
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-23 14:23:10", "repo_name": "soghao/zgyh", "sub_path": "/BOCMBankClient606/src/main/java/com/chinamworld/bocmbci/biz/foreign/ForeignDetailsHelpActivity.java", "file_name": "ForeignDetailsHelpActivity.java", "file_ext": "java", "file_size_in_byte": 1330, "line_count": 41, "lang": "zh", "doc_type": "code", "blob_id": "c5e4fa9299f706a8f886d9c69c8e37f5a130e43e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/soghao/zgyh
| 293
|
FILENAME: ForeignDetailsHelpActivity.java
| 0.258326
|
package com.chinamworld.bocmbci.biz.foreign;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.chinamworld.bocmbci.R;
import com.chinamworld.bocmbci.biz.foreign.ForeignBaseActivity;
import com.chinamworld.bocmbci.log.LogGloble;
/**
* 外汇买卖 行情帮助页
* 功能外置 @see ForeignDetailsHelpActivity
* @author luqp 2016年9月22日
*/
public class ForeignDetailsHelpActivity extends ForeignBaseActivity implements View.OnClickListener {
private final String TAG = "ForeignDetailsHelpActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.foreign_price_details_help);
clickIncident(); // title点击事件处理
}
/** Title点击事件统一处理*/
public void clickIncident(){
// getControls().setTitleText("帮助");
// getControls().setShareVisibility(View.GONE); // 设置右边分享图标隐藏
// getControls().setMoreVisibility(View.GONE); // 设置右边图标隐藏
}
public void onClick(View view){
switch (view.getId()){
// case R.id.foreign_landing: //登录
// break;
// default:
// break;
}
}
}
|
7a409737-6b00-4a3f-acd8-b5932adfbe29
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-04 09:00:09", "repo_name": "gjavolce/viap_demo_api", "sub_path": "/src/test/java/com/viaplay/api/utils/CustomStringManufacturerTest.java", "file_name": "CustomStringManufacturerTest.java", "file_ext": "java", "file_size_in_byte": 1001, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "382ce4961636b8b541f4343c799359bd8fe2826a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gjavolce/viap_demo_api
| 194
|
FILENAME: CustomStringManufacturerTest.java
| 0.229535
|
package com.viaplay.api.utils;
import uk.co.jemos.podam.api.AttributeMetadata;
import uk.co.jemos.podam.api.DataProviderStrategy;
import uk.co.jemos.podam.typeManufacturers.StringTypeManufacturerImpl;
import java.lang.reflect.Type;
import java.util.Map;
import java.util.UUID;
public class CustomStringManufacturerTest extends StringTypeManufacturerImpl {
private static final String FIELD_ID = "id";
private static final String FIELD_MBID = "mbid";
private static final String FIXED_IMAGE_TYPE = "mbid";
@Override
public String getType(final DataProviderStrategy strategy, final AttributeMetadata attributeMetadata,
final Map<String, Type> genericTypesArgumentsMap) {
if (FIELD_ID.equals(attributeMetadata.getAttributeName()) || FIELD_MBID.equals(attributeMetadata.getAttributeName())) {
return UUID.randomUUID().toString();
}
return super.getType(strategy, attributeMetadata, genericTypesArgumentsMap);
};
}
|
c55ac05a-ee64-4ceb-b7ff-600927cf2867
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-02 09:07:43", "repo_name": "szdengl/mimiduo-parent", "sub_path": "/mimiduo-manager/mimiduo-manager-service/src/main/java/net/mimiduo/boot/service/impl/business/ProvinceServiceImpl.java", "file_name": "ProvinceServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "81799a6c7e7423f6bd4fc277f33c3f64901f41de", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/szdengl/mimiduo-parent
| 224
|
FILENAME: ProvinceServiceImpl.java
| 0.253861
|
package net.mimiduo.boot.service.impl.business;
import com.google.common.base.Optional;
import net.mimiduo.boot.dao.BaseDao;
import net.mimiduo.boot.dao.bussiness.ProvinceDao;
import net.mimiduo.boot.pojo.business.Province;
import net.mimiduo.boot.service.busindess.ProvinceService;
import net.mimiduo.boot.service.impl.BaseServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ProvinceServiceImpl extends BaseServiceImpl<Province, Long> implements ProvinceService {
@Autowired
private ProvinceDao provinceDao;
@Override
public BaseDao<Province, Long> getDao() {
return provinceDao;
}
@Override
public boolean findByName(String name) {
boolean bResult=false;
if(StringUtils.isNotEmpty(name)&&!name.trim().equals("")){
Province province=this.provinceDao.findByName(name);
if(Optional.fromNullable(province).isPresent()) {
bResult=true;
}
}
return bResult;
}
}
|
2cabbbd3-e085-499b-bcd2-dba4261c7d35
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-29 08:14:23", "repo_name": "SijiaLiu/SSM", "sub_path": "/src/main/java/com/lsj/service/impl/CustomerServiceImpl.java", "file_name": "CustomerServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "38c1a7d93f1addae2a41ff82a4210400cb8e7adc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SijiaLiu/SSM
| 248
|
FILENAME: CustomerServiceImpl.java
| 0.278257
|
package com.lsj.service.impl;
import com.lsj.dao.CustomerDao;
import com.lsj.model.Customer;
import com.lsj.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by LiuSijia on 2017/8/28.
*/
@Service("customerService")
public class CustomerServiceImpl implements CustomerService {
@Autowired
private CustomerDao customerDao;
@Override
public boolean check(Customer customer) {
Customer customer1 = customerDao.selectOneByName(customer);
if (customer1 != null){
return true;
}else {
return false;
}
}
@Override
public List<Customer> findAllCustomer() {
return customerDao.selectAll();
}
@Override
public Customer findById(int id) {
return customerDao.selectOneById(id);
}
@Override
public void update(Customer customer) {
customerDao.update(customer);
}
@Override
public void deleteById(Integer id) {
customerDao.delete(id);
}
@Override
public void save(Customer customer) {
customerDao.save(customer);
}
}
|
67ab49e5-be82-4264-ad73-3b92d895c5f6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-03-06T21:46:36", "repo_name": "MisterPeddler/Instanews", "sub_path": "/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1070, "line_count": 12, "lang": "en", "doc_type": "text", "blob_id": "d3c907d33017ff59a39ab5d69dadb61965c39224", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/MisterPeddler/Instanews
| 235
|
FILENAME: readme.md
| 0.204342
|
# InstaNews
A responsive, single page, scratch built website.

## Project Details
This page is an exercise in using ajax requests to fetch data from a 3rd party API, in this case, the New York Times. The page content is generated dynamically as a result of data served up by the API. Additional css and jQuery animations, transitions and effects are used to give the site a more enhanced feel.
### Knowledge Gained
JQuery, Ajax, 3rd party API's, looping through complicated JSON objects in order to retrieve and display only what is of interest. The development environment was set up using a local node.js server running GULP with several additional packages downloaded with the node package manager. File changes were linted with eslint, js and css files were minified with Uglify, changes were pushed to the local browser with browser-sync, build files were prefixed for cross-browser support with auto-prefixer. Css for this project was built with Sass.
|
ed4de356-aae4-4e2a-86d3-45fd0ca6d73c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-08 19:21:00", "repo_name": "Jakub435/benchmark-mongoDb", "sub_path": "/src/main/java/com/benchmark/mongoDb/domain/MongoSpatialLineString.java", "file_name": "MongoSpatialLineString.java", "file_ext": "java", "file_size_in_byte": 1070, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "7c3e181680b395cea0cdc0dc27d755d206a03307", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Jakub435/benchmark-mongoDb
| 233
|
FILENAME: MongoSpatialLineString.java
| 0.245085
|
package com.benchmark.mongoDb.domain;
import org.bson.codecs.pojo.annotations.BsonId;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.geo.GeoJsonLineString;
import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection = "spatial_LineString")
public class MongoSpatialLineString {
@BsonId
private ObjectId id;
private String name;
private GeoJsonLineString lineString;
public MongoSpatialLineString(String name, GeoJsonLineString lineString) {
this.name = name;
this.lineString = lineString;
}
public MongoSpatialLineString() {}
public ObjectId getId() {
return id;
}
public void setId(ObjectId id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public GeoJsonLineString getLineString() {
return lineString;
}
public void setLineString(GeoJsonLineString lineString) {
this.lineString = lineString;
}
}
|
2498e1b5-a9ff-4cdc-b5a8-c092ae2ab183
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-05 14:05:18", "repo_name": "ZhangLi12060511/springboot-demo", "sub_path": "/src/main/java/com/springboot/service/impl/UserServiceImpl.java", "file_name": "UserServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "2b133c4cc54d543fe0e4b5a9f1ab958cd7190958", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ZhangLi12060511/springboot-demo
| 231
|
FILENAME: UserServiceImpl.java
| 0.226784
|
package com.springboot.service.impl;
import com.springboot.dao.UserDao;
import com.springboot.obj.User;
import com.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zhangbenben on 2018/5/12 0012
*/
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserDao userDao;
@Override
public User selectByPrimaryKey(Integer id) {
return userDao.selectByPrimaryKey(id);
}
@Override
public User selectByName(String name) {
return userDao.selectByName(name);
}
@Override
public int insert(User user) {
return userDao.insert(user);
}
@Override
public int update(User user) {
return userDao.update(user);
}
@Override
public int deleteById(Integer id) {
return userDao.deleteById(id);
}
@Override
public int deleteByList(List<Integer> idList) {
return userDao.deleteByList(idList);
}
}
|
cfe692c5-146e-4f74-9e4a-d7133e47633e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-10-28T22:55:32", "repo_name": "osrf/www.ros.org", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1006, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "5f98137bfcac2a54cfb79714df015e17ba9d09ad", "star_events_count": 17, "fork_events_count": 8, "src_encoding": "UTF-8"}
|
https://github.com/osrf/www.ros.org
| 264
|
FILENAME: README.md
| 0.226784
|
DEPRECATED
==========
This has been replaced by https://github.com/ros-infrastructure/www.ros.org
www.ros.org
===========
This is the www.ros.org site.
To deploy on a fresh machine with Apache (and php, and mysql, and everything else needed by Wordpress):
cd /var
rm -rf www
git clone https://github.com/osrf/www.ros.org.git www
cd www
git checkout master
git submodule init
git submodule update
You also need to set up the database, which will involve at least something like this:
cd /tmp
git clone https://github.com/osrf/www.ros.org.git www.ros.org
cd www.ros.org
git checkout wordpressdb
<undump the content of wordpress.sql into your mysql database>
<configure the username and password in /var/www/wp-config.php>
Also set up the following cron jobs
0 */6 * * * /home/ros/www.ros.org_cron_scripts/commit-db.sh > /dev/null 2> /dev/null
0 */6 * * * /home/ros/www.ros.org_cron_scripts/commit-website.sh > /dev/null 2> /dev/null
|
f6116120-69da-459f-81f8-c39be9b64f28
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-03-04T07:31:35", "repo_name": "ragadnajjar/reading-notes", "sub_path": "/read5.md", "file_name": "read5.md", "file_ext": "md", "file_size_in_byte": 1213, "line_count": 22, "lang": "en", "doc_type": "text", "blob_id": "ba205622cb101043b77db9de348b10cd106b51bb", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ragadnajjar/reading-notes
| 336
|
FILENAME: read5.md
| 0.293404
|
# adding images
## to add an imge into the page you need to use an:
1. `<img>` element
2. src,and this tells the browser where it can find the imge file
3. alt,this provides a text description of the imge which describes the imge if ypu cannot see it.
### so it should be like this :
* `<img src="the link" alt ="the description"`

# color can really bring your pages to life
* foreground color, and this color property allows you to specify the color of text inside an element
* so we can specify any color in css in one of three ways:
1. RGB values,and this one is ro express color in terms of how much red,green,and blue are used to make it up

2. HEX codes
3. color names
# text
* there are proparties to control the choice of font,size,weight,style and spacing
* there is a limited choices of font that you can essume most people will have installed
* you can control the space between lines of text,individual letters,and words.
* text also can be aligned to the left,right,center,or justified
<hr />
|
feca83f3-d6ef-40b1-8b73-cce2fa1954ce
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-24 07:24:08", "repo_name": "smallsnail-wh/wh-spring-test", "sub_path": "/src/main/java/com/wh/demo/test/async/DeferredResultListener.java", "file_name": "DeferredResultListener.java", "file_ext": "java", "file_size_in_byte": 1254, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "e3b7a19f9ca1bdda965afbde227fbc1bb7f69b7a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/smallsnail-wh/wh-spring-test
| 272
|
FILENAME: DeferredResultListener.java
| 0.284576
|
package com.wh.demo.test.async;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
public class DeferredResultListener implements ApplicationListener<ContextRefreshedEvent> {
Logger log = LoggerFactory.getLogger(getClass());
@Autowired
private DeferredResultEntity deferredResultEntity;
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
new Thread(()->{
int count = 0;
System.out.println("监听器");
while(true) {
if(deferredResultEntity.isFlag()) {
log.info("线程"+Thread.currentThread().getName()+"开始");
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
deferredResultEntity.getResult().setResult("SUCCESS");
deferredResultEntity.setFlag(false);
log.info("线程"+Thread.currentThread().getName()+"结束");
break;
}else {
log.info("第"+count+"检查");
count++;
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
}
}
|
10119108-f8ae-4902-ba1d-8164b8d1320c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-24 08:48:53", "repo_name": "EdgarArsenyan/Retrofit_new_example", "sub_path": "/app/src/main/java/com/noringerazancutyun/retrofit_new_example/Model/Model.java", "file_name": "Model.java", "file_ext": "java", "file_size_in_byte": 1226, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "cd5c7e962310f51c55657616e5a68b18a1163730", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/EdgarArsenyan/Retrofit_new_example
| 251
|
FILENAME: Model.java
| 0.242206
|
package com.noringerazancutyun.retrofit_new_example.Model;
import android.os.Parcel;
import android.os.Parcelable;
public class Model implements Parcelable {
private int userId;
private int id;
private String title;
private String body;
protected Model(Parcel in) {
userId = in.readInt();
id = in.readInt();
title = in.readString();
body = in.readString();
}
public static final Creator<Model> CREATOR = new Creator<Model>() {
@Override
public Model createFromParcel(Parcel in) {
return new Model(in);
}
@Override
public Model[] newArray(int size) {
return new Model[size];
}
};
public int getUserId() {
return userId;
}
public int getId() {
return id;
}
public String getTitle() {
return title;
}
public String getBody() {
return body;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(userId);
dest.writeInt(id);
dest.writeString(title);
dest.writeString(body);
}
}
|
53d5f969-08cc-4847-a45e-741c340a5227
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-09-03 19:54:35", "repo_name": "daniel0916/KillMoney", "sub_path": "/src/main/java/de/daniel0916/KillMoney/Listeners/PlayerListener.java", "file_name": "PlayerListener.java", "file_ext": "java", "file_size_in_byte": 1040, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "4a08cc55ec12e63341ac8f625bc35e4c76307eb4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/daniel0916/KillMoney
| 267
|
FILENAME: PlayerListener.java
| 0.284576
|
package de.daniel0916.KillMoney.Listeners;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import de.daniel0916.KillMoney.KillMoney;
public class PlayerListener implements Listener{
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
if (KillMoney.cfg.getBoolean("KillMoney.Enabled")) {
Player p = event.getEntity().getPlayer();
Player killer = event.getEntity().getKiller();
if (killer instanceof Player) {
String w = killer.getWorld().getName();
String w1 = KillMoney.cfg.getString("KillMoney.Worlds.1");
String w2 = KillMoney.cfg.getString("KillMoney.Worlds.2");
String w3 = KillMoney.cfg.getString("KillMoney.Worlds.3");
if (w.equals(w1)) {
KillMoney.HandleMoneyForPlayer(killer, p);
}
else if (w.equals(w2)) {
KillMoney.HandleMoneyForPlayer(killer, p);
}
else if (w.equals(w3)) {
KillMoney.HandleMoneyForPlayer(killer, p);
}
}
}
}
}
|
290f2a73-029f-461d-b247-116c6914bbef
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-11 20:55:19", "repo_name": "LansVegans/parserweb", "sub_path": "/src/main/java/net/parser/entities/PhysParamB.java", "file_name": "PhysParamB.java", "file_ext": "java", "file_size_in_byte": 1037, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "c1b8660bc5b09ddb3950b457e58f7dbf2d24467e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/LansVegans/parserweb
| 248
|
FILENAME: PhysParamB.java
| 0.267408
|
package net.parser.entities;
import javax.persistence.*;
import java.io.Serializable;
/**
* Created by LansVegans on 22.02.2017.
*/
@Entity
@Table(name = "physParamB")
public class PhysParamB implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "weightB")
private String weightB;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "id_notebook")
private Notebook notebook;
public Notebook getNotebook() {
return notebook;
}
public void setNotebook(Notebook notebook) {
this.notebook = notebook;
}
public PhysParamB() {
}
public PhysParamB(int id, String weightB) {
this.id = id;
this.weightB = weightB;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getWeightB() {
return weightB;
}
public void setWeightB(String weightB) {
this.weightB = weightB;
}
}
|
91295dbe-7c98-4328-a4b2-146c6163d9db
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-04-10 19:31:25", "repo_name": "simplyti/simple-server", "sub_path": "/acceptance/src/test/java/com/simplyti/service/steps/IdentityToken.java", "file_name": "IdentityToken.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "e229a46b8d290dc11376a47077dd8a993671b85c", "star_events_count": 6, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/simplyti/simple-server
| 208
|
FILENAME: IdentityToken.java
| 0.245085
|
package com.simplyti.service.steps;
import com.jsoniter.annotation.JsonCreator;
import com.jsoniter.annotation.JsonProperty;
import lombok.Getter;
import lombok.experimental.Accessors;
@Getter
@Accessors(fluent=true)
public class IdentityToken {
@JsonProperty("access_token")
private final String accessToken;
@JsonProperty("token_type")
private final String tokenType;
@JsonProperty("id_token")
private final String idToken;
@JsonProperty("refresh_token")
private final String refreshToken;
@JsonProperty("expires_in")
private final int expiresIn;
@JsonCreator
public IdentityToken(
@JsonProperty("access_token") String accessToken,
@JsonProperty("token_type") String tokenType,
@JsonProperty("id_token") String idToken,
@JsonProperty("refresh_token") String refreshToken,
@JsonProperty("expires_in") int expiresIn) {
this.accessToken=accessToken;
this.tokenType=tokenType;
this.idToken=idToken;
this.refreshToken=refreshToken;
this.expiresIn=expiresIn;
}
}
|
71cecb43-6ef9-4793-b2bf-5677eb66fdff
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-20 04:46:41", "repo_name": "astralbear435/KHFinalProject", "sub_path": "/src/main/java/kr/spring/websocket/ws/ChatHandshake.java", "file_name": "ChatHandshake.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "149b383ef570b575869df78cebef5cd8e66ef1b7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/astralbear435/KHFinalProject
| 179
|
FILENAME: ChatHandshake.java
| 0.246533
|
package kr.spring.websocket.ws;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor;
public class ChatHandshake extends HttpSessionHandshakeInterceptor {
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attribute) throws Exception {
ServletServerHttpRequest ssreq = (ServletServerHttpRequest) request;
HttpServletRequest req = ssreq.getServletRequest();
String user_id = (String)req.getSession().getAttribute("user_id");
attribute.put("user_id", user_id);
return super.beforeHandshake(request, response, wsHandler, attribute);
}
}
|
1711aa15-9868-4f23-8969-78aca2b93748
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-17 21:24:14", "repo_name": "umm-csci-3403-fall-2019/lab-5-echo-client-server-jackson-paul", "sub_path": "/src/echoserver/EchoServer.java", "file_name": "EchoServer.java", "file_ext": "java", "file_size_in_byte": 1057, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "17c67577d14a325c1e63dff5dea213778800b95e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/umm-csci-3403-fall-2019/lab-5-echo-client-server-jackson-paul
| 191
|
FILENAME: EchoServer.java
| 0.259826
|
package echoserver;
import java.net.*;
import java.io.*;
public class EchoServer {
public static final int portNumber = 6013;
public static void main(String[] args) {
try {
// Start listening on the specified port
ServerSocket socket = new ServerSocket(portNumber);
// Run forever, which is common for server style services
while (true) {
// Wait until someone connects, thereby requesting a date
Socket client = socket.accept();
System.out.println("Got a request!");
InputStream input = client.getInputStream();
OutputStream output = client.getOutputStream();
int b;
while ((b = input.read())!= -1) {
output.write(b);
}
}
// *Very* minimal error handling.
} catch (IOException ioe) {
System.out.println("We caught an unexpected exception");
ioe.printStackTrace();
}
}
}
|
1f44f87f-1db7-4029-ba92-32befa5a0e3c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-13 05:04:58", "repo_name": "Tibianobr/campo-minado-bombs", "sub_path": "/src/sample/Main.java", "file_name": "Main.java", "file_ext": "java", "file_size_in_byte": 1081, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "3dabd892219affc84ec7a645b95c8ba16c531317", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Tibianobr/campo-minado-bombs
| 222
|
FILENAME: Main.java
| 0.29584
|
package sample;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import sample.model.Grid;
import sample.model.Tile;
import java.util.List;
import static sample.model.Tile.TILE_SIZE;
public class Main extends Application {
private static final int WIDTH = 600;
private static final int HEIGHT = 600;
public static final int X_TILES = WIDTH / TILE_SIZE;
public static final int Y_TILES = WIDTH / TILE_SIZE;
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Campo Minado!");
primaryStage.setScene(new Scene(createGrid()));
primaryStage.show();
}
public Parent createGrid() {
Pane root = new Pane();
root.setPrefSize(WIDTH, HEIGHT);
Grid gridManager = new Grid();
List<Tile> tileList = gridManager.create();
root.getChildren().addAll(tileList);
return root;
}
public static void main(String[] args) {
launch(args);
}
}
|
703723b2-7fa9-40b7-944b-b1d8ee992469
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-20 02:20:07", "repo_name": "RoninKai/LifeApp", "sub_path": "/app/src/main/java/com/tanker/life/action/motto/EditMottoActivity.java", "file_name": "EditMottoActivity.java", "file_ext": "java", "file_size_in_byte": 1145, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "7adcbcce681807b3b6f265c35bafc34bc2ba4db7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/RoninKai/LifeApp
| 254
|
FILENAME: EditMottoActivity.java
| 0.221351
|
package com.tanker.life.action.motto;
import android.text.TextUtils;
import android.widget.EditText;
import com.tanker.life.R;
import com.tanker.life.action.base.BaseActivity;
import com.tanker.life.common.CommonValues;
import com.tanker.life.eventbus.Event;
import com.tanker.life.eventbus.EventBusUtil;
import com.tanker.life.manager.sharepre.SharePreManager;
import butterknife.BindView;
import butterknife.OnClick;
/**
* 编辑座右铭的页面
*
* @author zhoukai
*/
public class EditMottoActivity extends BaseActivity {
@BindView(R.id.et_motto_input)
EditText etMottoInput;
@OnClick(R.id.bt_motto_save)
public void onSaveMotto() {
String motto = etMottoInput.getText().toString().trim();
if (!TextUtils.isEmpty(motto)) {
SharePreManager.getInstance().putString(CommonValues.SHAREPRE_SAVE_MOTTO, motto);
EventBusUtil.sendEvent(new Event(Event.EventCode.UPDATE_MOTTOM_CONTENT));
}
finish();
}
@Override
protected int getContentViewId() {
return R.layout.activity_edit_motto;
}
@Override
protected void initView() {
}
}
|
44069e9f-4ccd-4396-adaf-0bf286187ab6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-13 06:04:35", "repo_name": "yirujiwang2001/Shiina-repository", "sub_path": "/demo3/src/com/shiina/SERV/RegisterToLoginServlet.java", "file_name": "RegisterToLoginServlet.java", "file_ext": "java", "file_size_in_byte": 1400, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "7d56ce218ffa422d79e96d3cce80a356ef79c6a5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/yirujiwang2001/Shiina-repository
| 244
|
FILENAME: RegisterToLoginServlet.java
| 0.277473
|
package com.shiina.SERV;
import org.apache.taglibs.standard.extra.spath.Step;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet(urlPatterns = "/registerToLoginServlet")
public class RegisterToLoginServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 拿到注册的账号密码
String username = request.getParameter("username");
String password = request.getParameter("password");
// 把账号密码存在session里,本次会话期间有效
request.getSession().setAttribute("username",username);
request.getSession().setAttribute("password",password);
// 重定向回登录页,即可通过el表达式拿到注册的账号密码,自动填满,不必重新输入
// el表达式有容错性,一开始启动服务器时虽然拿不到任何东西,但也不会报错
response.sendRedirect(request.getContextPath()+"/index.jsp");
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doPost(request, response);
}
}
|
68ad20d4-57b4-436e-a8ef-6bafd0018b2c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-03-06 15:45:12", "repo_name": "changelzj/webservice", "sub_path": "/src/main/java/com/example/ws/Server2.java", "file_name": "Server2.java", "file_ext": "java", "file_size_in_byte": 1246, "line_count": 35, "lang": "zh", "doc_type": "code", "blob_id": "d2b1c9a92a904ad7047d825c208459ccdb77514d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/changelzj/webservice
| 293
|
FILENAME: Server2.java
| 0.282988
|
package com.example.ws;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
public class Server2 {
/**
* 需要注解,不加注解不能暴漏任何方法
* 该类生成的wsdl文档更加规范
* 能添加拦截器
*
* 另:webservice访问流程:
* 第一步.检测本地代理描述的wsdl是否与服务端的一致:握手
* 第二步 通过soap协议实现通信,采用post请求,数据封装在满足soap协议的xml中
* 第三布 服务端返回,数据也封装在满足soap协议的xml中
*
*/
public static void main(String[] args) {
HelloWebService helloWebService = new HelloWebServiceImpl();
JaxWsServerFactoryBean service = new JaxWsServerFactoryBean();
service.setAddress("http://127.0.0.1:8712/ws/user");
service.setServiceClass(HelloWebService.class);
service.setServiceBean(helloWebService);
//添加输入拦截器
service.getInInterceptors().add(new LoggingInInterceptor());
service.getOutInterceptors().add(new LoggingOutInterceptor());
service.create();
}
}
|
7f34ced4-5adb-4b94-9db6-b0dbdb59c984
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-02-24T21:12:57", "repo_name": "Diope/hllo", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 507, "line_count": 11, "lang": "en", "doc_type": "text", "blob_id": "97757cf61dab65fc612525528236ff773ad9eb1a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Diope/hllo
| 256
|
FILENAME: README.md
| 0.206894
|
# Hllo
So this is me working on another medium sized app just to keep my knowledge up to date and because I enjoy coding. Not sure how far I'll go with this, but for the time being it'll be the bare basics of a social media app. So registration,
posting, deleting of posts. I might add in image hosting via AWS or Firestore, not sure. I'm trying to limit feature creep which ultimately dooms most projects I start.
### Technology Stack (as of Jan, 20th, 2021):
* React
* Express
* MongoDB
* Node
* GraphQL
### Notes
I've decided on putting comments within an array on the post model as I didn't want to deal with the complexities of handling/maintaining data duplication, and requesting data for what is ultimately a project I'm doing out of pandemic birthed boredom. To be certain, comments SHOULD get their own model/Schema and not be a subdocument if only from a architecture/design standpoint. Because the question arises what if a post has 150 comments? Suddenly being a subdocument in the post isn't looking so good!
But for the purposes of this toy app, I'll go with subdocument array for comments.
|
505f614f-7e31-47fe-a01c-22e15756e99e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-02 14:11:23", "repo_name": "mjung96/PetstoreAPI", "sub_path": "/rest-service/src/main/java/com/example/restservice/PetController.java", "file_name": "PetController.java", "file_ext": "java", "file_size_in_byte": 1226, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "0d6cc5f396b2b06127980d6dde79f91108532590", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/mjung96/PetstoreAPI
| 276
|
FILENAME: PetController.java
| 0.292595
|
package com.example.restservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
@RestController
public class PetController {
@Autowired
private PetsData petdata;
//not part of spec; for testing purposes
@RequestMapping("/pet/getAllPets")
public List<Pet> getAllPets() {
return petdata.getAllPets();
}
//gets the specific pet with given id
@RequestMapping("/pet/{petId}")
public Pet getPetByID(@PathVariable("petId") Long id) {
return petdata.getPetByID(id);
}
//add a pet to the store
@RequestMapping(method=RequestMethod.POST, value="/pet")
public void addPet(@RequestBody Pet pet) {
petdata.addPet(pet);
}
//update a pet in the store
@RequestMapping(method=RequestMethod.PUT, value="/pet/{id}")
public void updatePet(@RequestBody Pet pet, @PathVariable Long id) {
petdata.updatePet(id, pet);
}
//deletes a pet in the store
@RequestMapping(method=RequestMethod.DELETE, value="/pet/{petId}")
public void deletePet(@PathVariable("petId") Long id) {
petdata.deletePet(id);
}
}
|
4de57c6a-d79c-42be-8ce1-186b4f4c005c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-07 08:06:30", "repo_name": "Wzicheng/BesterLive", "sub_path": "/app/src/main/java/com/neusoft/besterlive/control/http/request/GetLiveRoomRequest.java", "file_name": "GetLiveRoomRequest.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "b1f06c275efe5f157ed9bd410dc0b9ed6f567a62", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Wzicheng/BesterLive
| 258
|
FILENAME: GetLiveRoomRequest.java
| 0.274351
|
package com.neusoft.besterlive.control.http.request;
import com.neusoft.besterlive.control.http.response.GetLiveRoomListResponseObject;
import com.neusoft.besterlive.utils.BaseRequest;
/**
* Created by Wzich on 2017/11/12.
*/
public class GetLiveRoomRequest extends BaseRequest {
// private static final String host = "http://besterlive.butterfly.mopaasapp.com/roomServlet?action=getLiveRoomList&";
private static final String host = "http://39.108.8.161/BesterLive/roomServlet?action=getLiveRoomList&";
public static class GetLiveRoomListParam {
public int pageIndex;
private static final String Param_page_index = "pageIndex";
@Override
public String toString() {
return Param_page_index + "=" + pageIndex;
}
}
public void request(GetLiveRoomListParam param){
String url = host + param.toString();
request(url);
}
@Override
public Object onSuccess(String body) {
GetLiveRoomListResponseObject responseObject = gson.fromJson(body,GetLiveRoomListResponseObject.class);
return responseObject.data;
}
}
|
124db55d-b269-400e-b9f9-e42041f9e6df
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-10-16 09:43:50", "repo_name": "PersistXL/javaEE", "sub_path": "/src/cn/perestxl/Servlet/UserServlet.java", "file_name": "UserServlet.java", "file_ext": "java", "file_size_in_byte": 1044, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "58a7e1ee7e72b3e11cf43327ca49564a177e2fd1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/PersistXL/javaEE
| 187
|
FILENAME: UserServlet.java
| 0.221351
|
package cn.perestxl.Servlet;
import cn.perestxl.bean.User;
import cn.perestxl.service.UserService;
import cn.perestxl.service.impl.UserServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Created by ACER on 2017/10/12.
*/
public class UserServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String username = req.getParameter("username");
String password = req.getParameter("password");
UserService userService =new UserServiceImpl();
User user = new User();
user.setName(username);
user.setPassword(password);
userService.add(user);
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
this.doPost(req, resp);
}
}
|
ee24901f-1388-496d-af3b-151cd435c647
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-12 12:17:51", "repo_name": "ben622/GifVideo", "sub_path": "/app/src/main/java/com/ben/android/gifvideo/example/Utils.java", "file_name": "Utils.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "0e12c901f5c083791a2e5962d3a2bf940d4b128d", "star_events_count": 6, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/ben622/GifVideo
| 246
|
FILENAME: Utils.java
| 0.264358
|
package com.ben.android.gifvideo.example;
import android.content.Context;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* @program: GifVideo
* @description:
* @author: black.cube
* @create: 2020-12-11 14:33
**/
public class Utils {
public static String copyAssetsFileToSdcard(Context context, String fileName){
try {
InputStream inputStream = context.getAssets().open(fileName);
File file = new File(context.getFilesDir().getAbsolutePath() + File.separator + fileName);
if(!file.exists() || file.length()==0) {
FileOutputStream fos =new FileOutputStream(file);
int len=-1;
byte[] buffer = new byte[1024];
while ((len=inputStream.read(buffer))!=-1){
fos.write(buffer,0,len);
}
fos.flush();//刷新缓存区
inputStream.close();
fos.close();
return file.getAbsolutePath();
}
return file.getAbsolutePath();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
|
c50e4e10-2d0b-4f28-b794-0f7994212a31
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-05-17 12:23:21", "repo_name": "pnoker/iot-dc3", "sub_path": "/dc3-driver/dc3-driver-opc-da/src/main/java/org/openscada/opc/dcom/common/impl/BaseCOMObject.java", "file_name": "BaseCOMObject.java", "file_ext": "java", "file_size_in_byte": 482, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "7a36035afe761be59ae44bc2b27ae35f7de3aeb9", "star_events_count": 1056, "fork_events_count": 292, "src_encoding": "UTF-8"}
|
https://github.com/pnoker/iot-dc3
| 255
|
FILENAME: BaseCOMObject.java
| 0.289372
|
/*
* Copyright 2022 Pnoker All Rights Reserved
*
* 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
*
* https://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 org.openscada.opc.dcom.common.impl;
import org.jinterop.dcom.core.IJIComObject;
public class BaseCOMObject {
private IJIComObject comObject = null;
/**
* Create a new base COM object
*
* @param comObject The COM object to wrap but be addRef'ed
*/
public BaseCOMObject(final IJIComObject comObject) {
this.comObject = comObject;
}
protected synchronized IJIComObject getCOMObject() {
return this.comObject;
}
}
|
7ce548f1-d80b-4e90-b21c-386ecbfc7c66
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-08-04 19:59:28", "repo_name": "svasilovski/ConvertCelciustoFatenheit", "sub_path": "/app/src/main/java/com/example/svasilovski/convertcelciustofatenheit/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1111, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "b3c9ddee944ac4b2a14ec677858e6ededc5a7508", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/svasilovski/ConvertCelciustoFatenheit
| 201
|
FILENAME: MainActivity.java
| 0.290981
|
package com.example.svasilovski.convertcelciustofatenheit;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
protected void convertCelsiusToFahrenheit(View view){
EditText temp= findViewById(R.id.txtTemperature);
if(!temp.getText().toString().trim().isEmpty()) {
double temperatura = Double.parseDouble(temp.getText().toString())*9/5+32;
Intent intent = new Intent(this, ResultadoActivity.class);
intent.putExtra("TEMPERATURA", String.format(getString(R.string.message), temperatura));
startActivity(intent);
}else{
Toast.makeText(this, getString(R.string.messageTempNull), Toast.LENGTH_SHORT).show();
}
}
}
|
da640e4f-751a-4933-bcf7-35fb9d7bc989
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-05-30 19:19:29", "repo_name": "ttt9912/prospringboot2", "sub_path": "/03-springboot-features/application/spring-application/src/main/java/ch3/spring/application/SpringApplicationDemo.java", "file_name": "SpringApplicationDemo.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "29229aae5e2988c12889012b6fd73675c7133179", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ttt9912/prospringboot2
| 163
|
FILENAME: SpringApplicationDemo.java
| 0.271252
|
package ch3.spring.application;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/*
* # SpringApplication.run()
* returns ConfigurableApplicationContext
*
* # SpringApplication instance
* Instead of calling static SpringApplication.run(), an instance
* of SpringApplication can be created - allows additional configuration
*
*/
@SpringBootApplication
public class SpringApplicationDemo {
// SpringApplication features
public static void main(String[] args) {
final SpringApplication springApplication = new SpringApplication(SpringApplicationDemo.class);
// set custom banner
springApplication.setBanner((environment, sourceClass, out) -> out.println("MY BANNER"));
// get/set WebApplicationType
System.out.println(springApplication.getWebApplicationType());
// etc..
springApplication
.run(args)
.close();
}
}
|
83f56696-c4f7-401c-9c59-bee1bd121b87
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-23T17:27:44", "repo_name": "MohdImran001/movie-booking-app", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1130, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "d14f55107d368a7966d9191a5ace7731e30483d8", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/MohdImran001/movie-booking-app
| 258
|
FILENAME: README.md
| 0.284576
|
# svelte movie booking app
Movie seat booking app made with Svelte.js. It consists of three components (movies, seats-booking, e-ticket). All the movies and their details are stored in svelte.js readable store. Movies component fetches the movies from svelte store. When a movie is clicked the id of that movie is passed to the seats-booking component. The user choose the desired seats and when seat is selected or deselected, the total amount also changes simultaneously. On clicking the checkout button the e-ticket component is mounted which show the ticket with all information and also generates the pdf using html2pdf (https://www.npmjs.com/package/html2pdf.js/v/0.9.0).
While working on this project, I learned about svelte modules, hooks (onMount and onDestroy), transitions, reactive values, local storage, stores etc.
*Note that you will need to have [Node.js](https://nodejs.org) installed.*
## Get started
Clone the app and Install the dependencies...
```bash
npm install
```
...then start webpack:
```bash
npm run dev
```
Navigate to [localhost:8080](http://localhost:8080). You should see the app running.
|
8607f465-16e8-43e6-980a-cfc445f88151
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-19 09:46:19", "repo_name": "abhi-ar17/Selenium", "sub_path": "/testng1/navigate_commands.java", "file_name": "navigate_commands.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "d4b00185920cb7080cac35ffe63d3b55d2ead677", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/abhi-ar17/Selenium
| 252
|
FILENAME: navigate_commands.java
| 0.285372
|
package testng1;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class navigate_commands {
String appUrl="http://www.DemoQA.com";
WebDriver driver;
@Test
public void f() throws InterruptedException {
driver.findElement(By.xpath("//*[@id=\"menu-top\"]/li[2]/a")).click();
Thread.sleep(1500l);
driver.navigate().back();
Thread.sleep(1500l);
driver.navigate().forward();
Thread.sleep(1500l);
driver.navigate().to(appUrl);
Thread.sleep(1500l);
driver.navigate().refresh();
Thread.sleep(3000l);
}
@BeforeTest
public void g()
{
System.setProperty("webdriver.chrome.driver","C:\\New folder\\chromedriver_win32\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.navigate().to(appUrl);
}
@AfterTest
public void h()
{
driver.close();
}
}
|
d1ecd4f6-a214-4d50-9cd1-20b4ce26cf0e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-10-06 17:15:22", "repo_name": "SiliconHoller/gc-code", "sub_path": "/gc-gui/src/gcgui/msg/StatusMessage.java", "file_name": "StatusMessage.java", "file_ext": "java", "file_size_in_byte": 1226, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "42712989ec78c4450bfac255e4aaf285eba1c8ae", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/SiliconHoller/gc-code
| 246
|
FILENAME: StatusMessage.java
| 0.291787
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcgui.msg;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Iterator;
import java.util.Queue;
import java.util.Vector;
/**
*
* @author david
*/
public class StatusMessage {
protected static StatusMessage instance;
protected Vector<MessageBoard> boards;
public StatusMessage() {
instance = this;
boards = new Vector<MessageBoard>();
}
public static StatusMessage getInstance() {
if (instance == null) {
instance = new StatusMessage();
}
return instance;
}
public void addBoard(MessageBoard board) {
boards.add(board);
}
public void removeBoard(MessageBoard board) {
boards.remove(board);
}
public void post(String txt) {
Iterator<MessageBoard> it = boards.iterator();
while (it.hasNext()) {
it.next().post(txt);
}
}
public void post(String txt, int severity) {
Iterator<MessageBoard> it = boards.iterator();
while (it.hasNext()) {
it.next().post(txt,severity);
}
}
}
|
b42dd150-49f3-433e-abee-c6bb8fa9ce7b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-03-11 14:22:11", "repo_name": "AMITCCILGITHUB/MaterialRegisterSpring", "sub_path": "/MaterialRegisterSpring/src/org/map/service/UserValidation.java", "file_name": "UserValidation.java", "file_ext": "java", "file_size_in_byte": 1067, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "9f55c2af631e609a864787adf44256fb5426e73b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AMITCCILGITHUB/MaterialRegisterSpring
| 207
|
FILENAME: UserValidation.java
| 0.274351
|
package org.map.service;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import javax.annotation.Resource;
import org.map.hibernate.ddo.UserMaster;
import org.map.hibernate.utils.UserData;
import org.springframework.stereotype.Repository;
@Repository("UserValidation")
public class UserValidation extends Service<Boolean> {
@Resource(name = "UserData")
private UserData userData;
private UserMaster user;
public UserValidation() {
this.user = new UserMaster();
}
public UserValidation(UserMaster user) {
this.user = user;
}
@Override
protected Task<Boolean> createTask() {
return new Task<Boolean>() {
@Override
protected Boolean call() {
return Boolean.valueOf(userData.validateUser(user));
}
};
}
public UserData getUserData() {
return userData;
}
public void setUserData(UserData userData) {
this.userData = userData;
}
public UserMaster getUser() {
return user;
}
public void setUser(UserMaster user) {
this.user = user;
}
}
|
0ad5d3cd-cee3-46f9-be46-184c48896db6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-22 23:52:53", "repo_name": "excelsiorsoft/spring-tinkering", "sub_path": "/spring-composite-cache-mgr/src/main/java/com/example/RedisCacheService.java", "file_name": "RedisCacheService.java", "file_ext": "java", "file_size_in_byte": 1213, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "ce5c041e1985f78c8c509136cdf321baa4bfe6a3", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/excelsiorsoft/spring-tinkering
| 263
|
FILENAME: RedisCacheService.java
| 0.291787
|
package com.example;
import static com.example.SpringCompositeCacheMgrApplicationTests.DATETIME_FORMAT;
import java.util.Date;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Service;
@Service
public class RedisCacheService {
public static final String REDIS_KEY = "redis-key";
public static final String REDIS_IDENTIFY_KEY = "redis-identify-key";
private int timesExecuted = 0;
public void clearTimesExecuted() {
timesExecuted = 0;
}
public int getTimesExecuted() {
return timesExecuted;
}
@Cacheable(REDIS_KEY)
public String get() {
timesExecuted++;
return DATETIME_FORMAT.format(new Date());
}
@Cacheable(value = REDIS_IDENTIFY_KEY, key = "#identify")
public String get(Long identify) {
timesExecuted++;
return DATETIME_FORMAT.format(new Date()) + "&identify:" + identify;
}
@Caching(evict = {
@CacheEvict(REDIS_KEY),
@CacheEvict(value = REDIS_IDENTIFY_KEY, allEntries = true)})
public void evictAll() {
}
}
|
ad2dcc3f-3a33-4974-b2f6-a237d684711a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-09-15 10:32:55", "repo_name": "P79N6A/nrosCrm", "sub_path": "/nros-crm/server/src/main/java/com/ztesoft/zsmart/nros/crm/core/server/middleware/rpc/feigin/BaseMetaDataServiceImpl.java", "file_name": "BaseMetaDataServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1237, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "a836fc5565e8477e4bd7d6c46e727dd950d7b35a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/P79N6A/nrosCrm
| 278
|
FILENAME: BaseMetaDataServiceImpl.java
| 0.240775
|
package com.ztesoft.zsmart.nros.crm.core.server.middleware.rpc.feigin;
import com.ztesoft.zsmart.nros.base.model.ResponseMsg;
import com.ztesoft.zsmart.nros.crm.core.server.middleware.rpc.BaseMetaDataService;
import com.ztesoft.zsmart.nros.crm.core.server.middleware.rpc.feigin.proxy.BaseMetaDataProxy;
import com.ztesoft.zsmart.nros.crm.core.server.middleware.rpc.feigin.proxy.model.AreaDTO;
import com.ztesoft.zsmart.nros.crm.core.server.middleware.rpc.feigin.proxy.model.EnumConfigDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 渠道列表获取
*
* @author yuan
* @date 2019/7/23
*/
@Service
@Slf4j
public class BaseMetaDataServiceImpl implements BaseMetaDataService {
@Autowired
private BaseMetaDataProxy baseMetaDataProxy;
@Override
public ResponseMsg<List<EnumConfigDTO>> listChannelEnumConfig() {
log.info("start to impl BaseMetaDataServiceImpl...");
return baseMetaDataProxy.listChannelEnumConfig();
}
@Override
public List<AreaDTO> queryAreaList(Long parentId) {
return baseMetaDataProxy.queryAreaList(parentId).getData();
}
}
|
f80ece5b-6a7d-4ce9-b320-87369c57526b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-13 03:57:56", "repo_name": "ankitvk/ftc_app-master", "sub_path": "/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Drivers/ExternalEncoder.java", "file_name": "ExternalEncoder.java", "file_ext": "java", "file_size_in_byte": 1082, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "7f39a39a90a264149faab3463720fdc8701e1777", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ankitvk/ftc_app-master
| 251
|
FILENAME: ExternalEncoder.java
| 0.286968
|
package org.firstinspires.ftc.teamcode.Drivers;
import com.qualcomm.robotcore.hardware.DcMotor;
import org.firstinspires.ftc.teamcode.Control.Constants;
public class ExternalEncoder implements Constants{
DcMotor motor;
private int previousPos = 0;
private long previousTime = 0;
private double rpm = 0;
private double power;
public ExternalEncoder (DcMotor motor) {
this.motor = motor;
}
public int getPosition () {
return motor.getCurrentPosition();
}
public double getRPM() {
int deltaPos = motor.getCurrentPosition() - previousPos;
double deltaTime = (System.nanoTime() - previousTime)/NANOSECONDS_PER_MINUTE;
if (deltaTime*6e4 > 10) {
rpm = (deltaPos/ E4T_COUNTS_PER_REV)/(deltaTime);
previousPos = motor.getCurrentPosition();
previousTime = System.nanoTime();
}
return rpm;
}
public void reset() {
motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
motor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
}
}
|
2420bc35-1de9-4df9-8093-7aeb0cccdc2c
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-11 08:22:20", "repo_name": "ifmylove2011/SlimCalendar", "sub_path": "/app/src/main/java/com/xter/slimcalendar/data/entity/BingWallpaper.java", "file_name": "BingWallpaper.java", "file_ext": "java", "file_size_in_byte": 1602, "line_count": 44, "lang": "zh", "doc_type": "code", "blob_id": "205582b265223c0621c7d9ae098486a94315f428", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ifmylove2011/SlimCalendar
| 441
|
FILENAME: BingWallpaper.java
| 0.264358
|
package com.xter.slimcalendar.data.entity;
import com.litesuits.orm.db.annotation.Table;
import com.xter.support.entity.BaseModelAuto;
/**
* Created by XTER on 2018/4/9.
* 必应每日壁纸
*/
@Table("bing_wallpaper")
public class BingWallpaper extends BaseModelAuto {
/**
* title : 自然的天堂
* img_1920 : http://api.seqier.com/api/bing/img_1920
* description : 勒拿河三角洲野生动物保护区的面积为5530平方英里,是俄罗斯最大的保护区之一。这张勒拿河流域的“伪彩色”图像是由陆地卫星7号拍摄的,图中的颜色是通过捕捉红外线、短波红外和红色波长而来的,光波的结合增强了各种地形特征的视野。保护区是众多重要鸟类物种的家园,各种陆地野生动物也在这里自由自在的生活。
* subtitle : 俄罗斯,勒拿河三角洲野生动物保护区
* copyright : 位于西伯利亚的勒拿河三角洲野生动物保护区,俄罗斯 (© USGS EROS Data Center/NASA)
* date : 20180409
* img_1366 : http://api.seqier.com/api/bing/img_1366
*/
public String title;
public String img_1920;
public String description;
public String subtitle;
public String copyright;
public String date;
public String img_1366;
@Override
public String toString() {
return "BingWallpaper{" +
"title='" + title + '\'' +
", img_1920='" + img_1920 + '\'' +
", description='" + description + '\'' +
", subtitle='" + subtitle + '\'' +
", copyright='" + copyright + '\'' +
", date='" + date + '\'' +
", img_1366='" + img_1366 + '\'' +
'}';
}
}
|
89355a86-2c19-4d8c-b2d9-5a1910c48439
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-10-13T03:22:10", "repo_name": "Detry322/hubot-espn", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 983, "line_count": 53, "lang": "en", "doc_type": "text", "blob_id": "032f4f2b18d57dee6e908fab63f32bbd891edaf4", "star_events_count": 5, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/Detry322/hubot-espn
| 327
|
FILENAME: README.md
| 0.291787
|
# hubot-espn
Get live sports data for most major sports leagues!
Leagues available:
- NBA
- NHL
- NFL
- MLB
- WNBA
Live score data accessible through `hubot espn NBA`, etc. Example Response:
```
> hubot espn MLB
Scores:
- ^Arizona 3 Philadelphia 1 (FINAL)
- San Francisco 0 Pittsburgh 0 (BOT 4TH)
- Chicago Sox 1 Boston 0 (BOT 4TH)
- Tampa Bay 3 Cleveland 1 (TOP 5TH)
- Seattle 4 Detroit 3 (TOP 3RD)
- Colorado 3 Miami 2 (TOP 4TH)
- Baltimore 0 Texas 0 (TOP 1ST)
- St. Louis 0 Chicago Cubs 0 (TOP 1ST)
- LA Angels 0 Houston 0 (TOP 1ST)
- Washington at LA Dodgers (10:00 PM ET)
```
See [`src/espn.coffee`][espn] for full code.
## Installation
In hubot project repo, run:
`npm install hubot-espn --save`
Then add **hubot-espn** to your `external-scripts.json`:
```json
[
"hubot-espn"
]
```
## License
Copyright (c) 2015 Jack Serrino. Released under the MIT License. See
[LICENSE.md][license] for details.
[espn]: src/espn.coffee
[license]: LICENSE.md
|
53dfa967-b3bc-4adc-8c5e-b4d3f1525bfe
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-04-13T17:16:21", "repo_name": "crazyfln/CamStream", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1003, "line_count": 28, "lang": "en", "doc_type": "text", "blob_id": "af13ec2c6e5dec704885b59c761e4989b3200058", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/crazyfln/CamStream
| 280
|
FILENAME: README.md
| 0.261331
|
# CamStream
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ARVABYAUX3NPC)
Stream your webcams over http using mjpeg format
###### [*] Basic authentication [admim,admin]
###### [*] Face detection
###### [*] Multiple webcams
###### [*] Image compression (quality, crop, grayscale)
###### [*] Config File
## Endpoints
###### [*] /?cam=(int)
###### [*] /list -> Show list of your connected webcams
## Url query
###### [*] example url: http://localhost:8080/?cam=0&q=50&gray=true&crop=2
###### [*] cam=(int)
###### [*] q=(int)
###### [*] gray=(bool)
###### [*] crop=(int) -> image size / crop
###### [*] face=(bool)
## Config File
###### [*] Want to disable basic auth -> In config.json change auth:allow to False
###### [*] Want to change basic auth username and password -> In config.json change auth:username & auth:password

|
148c6fbb-bfcd-4e0f-bdb0-016929968f8e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-04-21T05:05:30", "repo_name": "meisammofidi/reactjs-pagination", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 973, "line_count": 37, "lang": "en", "doc_type": "text", "blob_id": "f5204a1a5766f692a6f8fba5c93516d255c7d6a6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/meisammofidi/reactjs-pagination
| 236
|
FILENAME: README.md
| 0.26588
|
# Pagination Table with ReactJS
This is a ReactJs application Shows a table where load data from exteral API and display them in three columns with ability to paginate to next, pervious, first and last page. the default limit per page is 10 records.
## Installation
Please follow the structure below
Install dependencies
```bash
npm install
```
To run in development mode
```bash
npm run start
```
Create actual bundle to run
```bash
npm run build
```
## Usage
All the current items get fetch from API below:
'https://dummyapi.io/data/api/user'
app-id='607f65448ce9f17db07f0f33' must be passed in headers
Please use your app_id if current one does not work by generating new one from link below
https://dummyapi.io/account
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
## License
[MIT](https://choosealicense.com/licenses/mit/)
|
21a793a3-b70c-49a9-83b4-b43b83736f74
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-01-08 14:02:41", "repo_name": "GaoZhao66/spring-demo", "sub_path": "/update-file/src/main/java/com/cmb/updatefile/domain/entity/FileEntity.java", "file_name": "FileEntity.java", "file_ext": "java", "file_size_in_byte": 1200, "line_count": 64, "lang": "en", "doc_type": "code", "blob_id": "1b6c5ae190d44e23028cda59543344902b6aa949", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/GaoZhao66/spring-demo
| 327
|
FILENAME: FileEntity.java
| 0.228156
|
package com.cmb.updatefile.domain.entity;
import lombok.Data;
/**
* chengyangbing special annotation
*
* @Package: com.cmb.hbx.domain.entity
* @FileName: FileEntity.java
* @ClassName: FileEntity
* @Description: 文件实体
* @Author: chengyangbing
* @CreateDate: 2019/12/23 4:40 PM
* @UpdateUser: chengyangbing
* @UpdateDate: 2019/12/23 4:40 PM
* @UpdateRemark: 说明本次修改内容
* @Version: v1.0
*/
@Data
public class FileEntity extends BaseEntity{
/**
* @Desc: 文件键
*/
private String key;
/**
* @Desc: 文件内容
*/
private String value;
/**
* @Desc: 文件大小
*/
private Long size;
/**
* @Desc: 文件名称
*/
private String name;
/**
* @Desc: 文件类型
*/
private String type;
/**
* @Desc: 访问路径
*/
private String accessUrl;
public FileEntity() {
}
public FileEntity(String key, String value, Long size, String name, String type, String accessUrl) {
this.key = key;
this.value = value;
this.size = size;
this.name = name;
this.type = type;
this.accessUrl = accessUrl;
}
}
|
24ea153d-6a05-4f85-b6ac-4d0ecbee00e2
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-10-25 13:00:25", "repo_name": "PengQuanfeng/JavaDemo", "sub_path": "/src/main/java/com/example/demo3/Services/UserService.java", "file_name": "UserService.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "97ffcd37899caeab9c4c659796570388c9326bc6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/PengQuanfeng/JavaDemo
| 216
|
FILENAME: UserService.java
| 0.295027
|
package com.example.demo3.Services;
import com.example.demo3.DAO.UserMapper;
import com.example.demo3.Domain.IUserRespositry;
import com.example.demo3.Domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;
@Service
public class UserService implements IUserService {
@Autowired
private UserMapper userRespositry;
@Override
public Integer AddUser(User user)
{
return this .userRespositry.AddUser(user);
}
@Override
public User FindUserById(Long id)
{
return this .userRespositry.FindUserById(id);
}
@Override
public void UpdateUser(Long id,String name)throws Exception
{
User user=new User();
user.setId(id);
user.setName(name);
this .userRespositry.UpdateUser(user);
}
@Override
public void DeleteUser(Long id)throws Exception
{
this .userRespositry.DeleteUser(id);
}
}
|
1dbdbfe5-1405-4b15-86ad-bb4014d0df38
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-09-12 11:31:43", "repo_name": "liuzhushaonian/ys-the-most-bright-soul-by-java", "sub_path": "/src/main/java/ys/controller/CharacterController.java", "file_name": "CharacterController.java", "file_ext": "java", "file_size_in_byte": 1124, "line_count": 73, "lang": "en", "doc_type": "code", "blob_id": "9cea88844e482a9c01c5589b9b7e0ca1bd2f4de4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/liuzhushaonian/ys-the-most-bright-soul-by-java
| 242
|
FILENAME: CharacterController.java
| 0.261331
|
package ys.controller;
import com.blade.ioc.annotation.Inject;
import com.blade.mvc.annotation.GetRoute;
import com.blade.mvc.annotation.JSON;
import com.blade.mvc.annotation.Param;
import com.blade.mvc.annotation.Path;
import com.blade.mvc.http.Request;
import ys.jdbc.Database;
import ys.jdbc.inter.Character;
import ys.pojo.CharacterImpl;
import ys.service.CharacterManagerImpl;
import ys.service.inter.CharacterManager;
import java.util.List;
@Path
public class CharacterController {
@Inject
private Character character;
public CharacterController() {
}
/**
* 根据ID获取角色信息
* @param id
* @return
*/
@GetRoute("get-character-by-id")
@JSON
public CharacterImpl getCharacterById(@Param int id){
return character.getCharacterById(id);
}
@GetRoute("get-character-list")
@JSON
public List getCharacterList(){
return character.getCharacterList();
}
@GetRoute("/test")
@JSON
public String test(@Param int id){
character.getCharacterById(1);
return "success!";
}
}
|
9192d2b6-ca20-4eff-89c7-bc6613c2b312
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-30 12:27:48", "repo_name": "AntonKurbet/GeekBrains.Market", "sub_path": "/src/main/java/ru/geekbrains/spring/market/model/entities/Product.java", "file_name": "Product.java", "file_ext": "java", "file_size_in_byte": 1027, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "f3b7bb2e53d8d01e4558085db21a8cae034693d2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AntonKurbet/GeekBrains.Market
| 205
|
FILENAME: Product.java
| 0.290176
|
package ru.geekbrains.spring.market.model.entities;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import javax.persistence.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
@Entity
@Table(name = "product")
@NoArgsConstructor
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "title")
private String title;
@Column(name = "price")
private BigDecimal price;
@Column(name = "created_at")
@CreationTimestamp
private LocalDateTime createdAt;
@Column(name = "updated_at")
@UpdateTimestamp
private LocalDateTime updatedAt;
@Column(name = "deleted_at")
private LocalDateTime deletedAt;
@ManyToOne
@JoinColumn(name = "category_id")
private Category category;
public Product(String title, BigDecimal price) {
this.title = title;
this.price = price;
}
}
|
2d734d52-86f0-485f-97ad-2efa5c691b0b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-06-14T20:02:46", "repo_name": "jacob-earle/stm32f4discovery-blinker", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1225, "line_count": 42, "lang": "en", "doc_type": "text", "blob_id": "f6b37e66d3baa5586c1356a6374cc1eb35734a9c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jacob-earle/stm32f4discovery-blinker
| 337
|
FILENAME: README.md
| 0.252384
|
# `stm32f4discovery-blinker`
This project contains example code on how to configure GPIO pins on the STM32F4DISCOVERY board in Rust. In this example, the orange LED labeled LD3 will blink on and off at 1 second intervals.
## Building and Running
Follow the instructions in the [Rust Embedded Book](https://docs.rust-embedded.org/book/intro/install/linux.html) to download the necessary components. Additionally, make sure the `thumbv7em-none-eabi` target is installed on your *nightly* Rust toolchain:
```
rustup target add thumbv7em-none-eabi
```
From here we can compile with
```
cargo build
```
Now, from the root of this directory, run
```
openocd
```
after plugging in the board using the STLINK-v2 adaptor. In a new terminal, also from the root of this directory run
```
arm-none-eabi-gdb -q ./target/thumbv7em-none-eabi/debug/stm32f4discovery-blinker
```
or on Ubuntu
```
arm-none-eabi-gdb -q ./target/thumbv7em-none-eabi/debug/stm32f4discovery-blinker
```
to open a debugging session. Finally, connect to the board and run the program with
```
(gdb) target remote :3333
...
(gdb) load
...
(gdb) monitor arm semihosting enable
...
(gdb) continue
```
At this point the LED should begin blinking indefinitely.
|
df198787-804d-4809-ad62-4455c590ff1b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-11 14:45:35", "repo_name": "tiger2015/bigdata-projects", "sub_path": "/hadoop-mapred/src/main/java/com/tiger/hadoop/wordcount/WordCountMapper.java", "file_name": "WordCountMapper.java", "file_ext": "java", "file_size_in_byte": 1099, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "cf9cf5ea5be287c3e275c52c471b202e2c07137c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tiger2015/bigdata-projects
| 248
|
FILENAME: WordCountMapper.java
| 0.286968
|
package com.tiger.hadoop.wordcount;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import java.io.IOException;
/**
* @Author Zenghu
* @Date 2021/2/17 23:48
* @Description
* @Version: 1.0
**/
public class WordCountMapper extends Mapper<LongWritable, Text, Text, IntWritable> {
@Override
protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
}
@Override
protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
context.getCounter(CounterEnum.MAP_RECORDS).increment(1L);
String s = value.toString();
String[] split = s.split("[\\s+|,|.]");
for (String word : split) {
if (word.length() == 0) continue;
context.write(new Text(word.toLowerCase()), new IntWritable(1));
}
}
@Override
protected void cleanup(Context context) throws IOException, InterruptedException {
}
}
|
035be7b0-6d59-4aa8-a90a-3a3cd8b5bf14
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2012-03-20 20:32:37", "repo_name": "nkemler/Art-at-GVSU-Android-edition", "sub_path": "/src/edu/gvsu/cis/bardslej/artAtGVSU/ParseXML.java", "file_name": "ParseXML.java", "file_ext": "java", "file_size_in_byte": 1128, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "1760f25d7e693c8044d239a624d79163bf0aa69b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/nkemler/Art-at-GVSU-Android-edition
| 252
|
FILENAME: ParseXML.java
| 0.249447
|
package edu.gvsu.cis.bardslej.artAtGVSU;
import java.io.*;
import java.net.*;
import org.w3c.dom.Document;
public class ParseXML {
public static void main(String[] args) throws Exception {
URL yahoo = new URL("http://www.yahoo.com/");
URLConnection yc = yahoo.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
/*
URL xmlUrl;
InputStream in;
Document doc;
public ParseXML() throws Exception{
xmlUrl = new URL("http://gvsuartgallery.org/service.php/search/Search/rest?method=queryRest&type=ca_tours&query=*&additional_bundles[ca_tours.icon.largeicon][returnURL]=1&additional_bundles[ca_tours.access]");
URLConnection connect = xmlUrl.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(connect.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null){
System.out.println(inputLine);
}
in.close();
}
*/
}
|
0a2221ac-4280-421e-a280-81f4093602da
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-27 07:20:23", "repo_name": "CalmerZhang/concurrentTest", "sub_path": "/src/main/java/concurrent/test/SyncContainer.java", "file_name": "SyncContainer.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "a75f8080ea77bd569140d75fe26d30b0374494be", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/CalmerZhang/concurrentTest
| 220
|
FILENAME: SyncContainer.java
| 0.229535
|
package concurrent.test;
import java.util.ArrayDeque;
import java.util.LinkedList;
/**
* @author 张卓
* @Description
* @Date 创建于 2020/6/8 19:35
*/
public class SyncContainer {
private final int CAPACITY = 16;
private int count = 0;
private ArrayDeque<String> list = new ArrayDeque(CAPACITY);
private final Object lock = new Object();
private String get() throws InterruptedException {
String last = null;
synchronized (lock) {
last = list.pollLast();
while (last == null) {
lock.wait();
last = list.pollLast();
}
}
return last;
}
private void put(String item) throws InterruptedException {
synchronized (lock) {
while (list.size() == CAPACITY) {
lock.wait();
}
list.add(item);
}
}
private int getCount() {
return count;
}
public static void main(String[] args) {
}
}
|
2df4fb00-076d-4a90-ab16-3848e7ec29cb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-17 20:09:44", "repo_name": "gilbertopsantosjr/br.com.cadmea", "sub_path": "/framework/br.com.cadmea.share/src/main/java/br/com/cadmea/model/orm/SocialNetwork.java", "file_name": "SocialNetwork.java", "file_ext": "java", "file_size_in_byte": 1213, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "791b533b4a292f16a754b76fabd0ecc0b9ec6a55", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/gilbertopsantosjr/br.com.cadmea
| 271
|
FILENAME: SocialNetwork.java
| 0.245085
|
package br.com.cadmea.model.orm;
import br.com.cadmea.model.BaseEntityPersistent;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
/**
* @author Gilberto Santos
*/
@Entity
@Data
@Table(name = "social_network")
@AttributeOverrides(@AttributeOverride(name = "id", column = @Column(name = "soc_id", nullable = false)))
@EqualsAndHashCode(callSuper = false)
public class SocialNetwork extends BaseEntityPersistent {
@NotNull
@Column(name = "id_network", nullable = false)
private String idNetwork;
@NotNull
@Column(name = "primary_contact", nullable = false)
private String primaryContact;
@Column(name = "link")
private String link;
@Column(name = "picture_profile")
private String pictureProfile;
@Column(name = "type")
private TypeSocial type;
@NotNull
@OneToOne(cascade = {CascadeType.PERSIST, CascadeType.REMOVE}, fetch = FetchType.LAZY, targetEntity = UserSystem.class)
private UserSystem userSystem;
static enum TypeSocial {
FACEBOOK(1), GOOGLE(2);
int type = 0;
TypeSocial(final int i) {
type = i;
}
}
}
|
a2cf7f9d-56f0-4827-b43d-7c978ba72421
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-06 07:55:36", "repo_name": "wond-z/Java-Practice", "sub_path": "/helloworld/src/com/chend/hPoker/People.java", "file_name": "People.java", "file_ext": "java", "file_size_in_byte": 1226, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "2afc5572274f5dd3de36edfd7bcf9d3d2fe976fe", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/wond-z/Java-Practice
| 272
|
FILENAME: People.java
| 0.292595
|
package com.chend.hPoker;
import java.util.ArrayList;
import java.util.List;
public class People{
private Integer id;
private String name;
public List<Poker> pokers;
public People (Integer id, String name) {
super();
this.id = id;
this.name = name;
this.pokers = new ArrayList<Poker>();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof People))
return false;
People other = (People) obj;
if(id!=null&&name==null) {
if(!id.equals(other.id)) {
return false;
}
}else if(name!=null&&id==null) {
if(!name.equals(other.name)) {
return false;
}
}else if(!name.equals(other.name)||!id.equals(other.id)){
return false;
}
return true;
}
}
|
6e63e922-25ec-440b-8642-2594d482ac7a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-13 03:10:41", "repo_name": "WoSai/proxy-server", "sub_path": "/proxy-auto-api/src/main/java/com/wosai/upay/proxy/auto/model/ClientOrderTerminal.java", "file_name": "ClientOrderTerminal.java", "file_ext": "java", "file_size_in_byte": 1010, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "3ecc58788b28216aa0af50098470cf841973897b", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/WoSai/proxy-server
| 264
|
FILENAME: ClientOrderTerminal.java
| 0.261331
|
package com.wosai.upay.proxy.auto.model;
public enum ClientOrderTerminal {
ID("id"),
DEVICE_ID("device_id",null),
CLIENT_SN("client_sn"),
SN("sn",null),
DEVICE_FINGERPRINT("device_fingerprint"),
NAME("name"),
TYPE("type"),
SDK_VERSION("sdk_version"),
OS_VERSION("os_version"),
LONGITUDE("longitude"),
LATITUDE("latitude"),
EXTRA("extra"),
TARGET("target"),
TARGET_TYPE("target_type"),
TERMINAL_ID("terminal_id"),
STORE_ID("store_id"),
STORE_SN("store_sn"),
CLIENT_STORE_SN("client_store_sn",null),
VENDOR_APP_ID("vendor_app_appid");
//本地接口字段名
String value;
//服务端接口字段名
String map;
private ClientOrderTerminal(String value, String map) {
this.value = value;
this.map = map;
}
private ClientOrderTerminal(String value) {
this.value = value;
this.map = value;
}
@Override
public String toString() {
return value;
}
public String getValue() {
return value;
}
public String getMap() {
return map;
}
}
|
01d090ba-f316-40b6-bde0-dd3b080371b8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-06 13:13:46", "repo_name": "Mengzilong/yue", "sub_path": "/conmmon/src/main/java/com/zl/entity/Login.java", "file_name": "Login.java", "file_ext": "java", "file_size_in_byte": 1099, "line_count": 61, "lang": "en", "doc_type": "code", "blob_id": "1cceb16866e8154e4ebabed993d4948c32c09861", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Mengzilong/yue
| 258
|
FILENAME: Login.java
| 0.200558
|
package com.zl.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author Kobe
* @since 2020-12-30
*/
public class Login implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@TableField("name")
private String name;
@TableField("pwd")
private String pwd;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
@Override
public String toString() {
return "Login{" +
"id=" + id +
", name=" + name +
", pwd=" + pwd +
"}";
}
}
|
3185d36f-bbe1-47d5-82d5-a65b1bdb27b1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-22 14:09:25", "repo_name": "amplia-iiot/oda", "sub_path": "/oda-comms/mqtt/src/main/java/es/amplia/oda/comms/mqtt/Activator.java", "file_name": "Activator.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "0fd31453161c1979fdc2f06741b143a9c4d78c27", "star_events_count": 2, "fork_events_count": 6, "src_encoding": "UTF-8"}
|
https://github.com/amplia-iiot/oda
| 234
|
FILENAME: Activator.java
| 0.236516
|
package es.amplia.oda.comms.mqtt;
import es.amplia.oda.comms.mqtt.api.MqttClientFactory;
import es.amplia.oda.comms.mqtt.paho.MqttPahoClientFactory;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Activator implements BundleActivator {
private static final Logger LOGGER = LoggerFactory.getLogger(Activator.class);
private ServiceRegistration<MqttClientFactory> mqttClientFactoryServiceRegistration;
@Override
public void start(BundleContext bundleContext) {
LOGGER.info("Starting MQTT Comms bundle");
mqttClientFactoryServiceRegistration =
bundleContext.registerService(MqttClientFactory.class, new MqttPahoClientFactory(), null);
LOGGER.info("MQTT Comms bundle started");
}
@Override
public void stop(BundleContext bundleContext) {
LOGGER.info("Stopping MQTT Comms bundle");
mqttClientFactoryServiceRegistration.unregister();
LOGGER.info("MQTT Comms bundle stopped");
}
}
|
ded167a4-0feb-4bc8-b708-4bb9690568dd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-15 09:05:04", "repo_name": "AlekseyMikaelyan/Car-factory", "sub_path": "/cars-data/src/main/java/org/example/carfactory/data/service/impl/CarServiceImpl.java", "file_name": "CarServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1227, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "bd53755e7a37565e11697d87c796487982b3f1c0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/AlekseyMikaelyan/Car-factory
| 248
|
FILENAME: CarServiceImpl.java
| 0.289372
|
package org.example.carfactory.data.service.impl;
import org.example.carfactory.data.entity.Car;
import org.example.carfactory.data.repository.CarRepository;
import org.example.carfactory.data.repository.impl.CarRepositoryImpl;
import org.example.carfactory.data.service.CarService;
import java.util.List;
public class CarServiceImpl implements CarService {
private final CarRepository carRepository = new CarRepositoryImpl();
@Override
public void saveOrUpdate(Car car) {
if (car.getId() == null) {
long id = findAll().size();
car.setId(++id);
carRepository.save(car);
} else {
carRepository.update(car);
}
}
@Override
public Car findById(Long id) {
return carRepository.findById(id);
}
@Override
public List<Car> findAll() {
return carRepository.findAll();
}
@Override
public void remove(Long id) {
carRepository.remove(id);
}
@Override
public Car findByModel(String model) {
return carRepository.findByModel(model);
}
@Override
public List<Car> findByCarMake(String carMake) {
return carRepository.findByCarMake(carMake);
}
}
|
eeaa1daa-7948-476d-8cc9-c51ba394a1fd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-05 10:20:42", "repo_name": "larosamf/algo3-tp2", "sub_path": "/src/main/java/grupo/N6/algochess/interfaz/UnidadVista.java", "file_name": "UnidadVista.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "731689fa3e82a843d26785eef9b71df59b0d0f8c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/larosamf/algo3-tp2
| 276
|
FILENAME: UnidadVista.java
| 0.295027
|
package grupo.N6.algochess.interfaz;
import java.util.ArrayList;
import java.util.List;
import javafx.geometry.Pos;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
public class UnidadVista extends StackPane {
public double mouseX, mouseY;
public int posX, posY;
private int oldX, oldY;
private String imagen;
private Image icon;
public UnidadVista(int x, int y, String nombre) {
this.posX = x;
this.posY = y;
imagen = null;
if (nombre != null) {
imagen = "file:".concat(nombre.concat(".jpg"));
icon = new Image(imagen, 50, 50, true, true);
mover(x,y);
setAlignment(Pos.CENTER_RIGHT);
getChildren().add(new ImageView(icon));
}
setOnMouseDragged(e -> {
relocate(e.getSceneX(), e.getSceneY());
});
}
public void mover(int x, int y) {
oldX = x * Vista.TAM_CASILLERO;
oldY = y * Vista.TAM_CASILLERO;
this.posX = x;
this.posY = y;
relocate(oldX, oldY);
}
}
|
38676577-ecbc-4de4-b28d-02b8d28474d4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-12 09:34:10", "repo_name": "shen0512/CanvasPainter", "sub_path": "/app/src/main/java/com/example/user/canvaspainter/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1101, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "cb562b5a8dd02432180da135f95c619f5c1a958d", "star_events_count": 1, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/shen0512/CanvasPainter
| 192
|
FILENAME: MainActivity.java
| 0.240775
|
package com.example.user.canvaspainter;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {
Panel mPanel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_main);
//畫布
mPanel = new Panel(this);
setContentView(mPanel);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_about:
mPanel.resetCanvas();
break;
case R.id.menu_save:
mPanel.savePicture();
break;
case R.id.menu_quit:
this.finish();
break;
}
return super.onOptionsItemSelected(item);
}
}
|
360479d0-3f68-4c8e-8351-3fbdc80138a8
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-02 11:41:07", "repo_name": "dreamingdreaming/spring--learning", "sub_path": "/spring-day06/src/main/java/com/ren/li/springmabatis/pojo/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "4ead9b8d1c7e6802337e7e0864f9ce6dfde5b7ef", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dreamingdreaming/spring--learning
| 273
|
FILENAME: User.java
| 0.228156
|
package com.ren.li.springmabatis.pojo;
public class User {
private Integer id;
private String uName;
private String password;
private Integer age;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getuName() {
return uName;
}
public void setuName(String uName) {
this.uName = uName == null ? null : uName.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public User(Integer id, String uName, String password, Integer age) {
this.id = id;
this.uName = uName;
this.password = password;
this.age = age;
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", uName='" + uName + '\'' +
", password='" + password + '\'' +
", age=" + age +
'}';
}
}
|
57eb05c8-1da7-4a2f-8d4b-840bbfd343fb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-11 21:09:49", "repo_name": "locurasoft/ctrlr-utils", "sub_path": "/src/main/java/com/locurasoft/utils/ProcessUtils.java", "file_name": "ProcessUtils.java", "file_ext": "java", "file_size_in_byte": 1212, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "311ca66f2aa8f8ed9dbe9cf2154a14d6d387d6c2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/locurasoft/ctrlr-utils
| 225
|
FILENAME: ProcessUtils.java
| 0.282196
|
package com.locurasoft.utils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
public final class ProcessUtils {
private ProcessUtils() {
}
public static boolean execProcess(String[] cmd) throws InterruptedException, IOException {
System.out.println("Executing: " + Arrays.toString(cmd));
Process proc = Runtime.getRuntime().exec(cmd);
BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
// read the output from the command
System.out.println("Here is the standard output of the command:\n");
String s;
while ((s = stdInput.readLine()) != null) {
System.out.println(s);
}
// read any errors from the attempted command
System.out.println("Here is the standard error of the command (if any):\n");
while ((s = stdError.readLine()) != null) {
System.out.println(s);
}
return proc.waitFor(10, TimeUnit.MINUTES);
}
}
|
bf87a924-a243-4df4-b8c0-330d1c28e3dc
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-23 16:02:02", "repo_name": "NikitchenkoE/FinalProjectSpring", "sub_path": "/src/main/java/com/example/finalprojectspring/securityConfiguration/UserPrincipalsDetailsService.java", "file_name": "UserPrincipalsDetailsService.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "cd72f140ce5bc9be42ac702aa4487b0bde0e8723", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/NikitchenkoE/FinalProjectSpring
| 172
|
FILENAME: UserPrincipalsDetailsService.java
| 0.23793
|
package com.example.finalprojectspring.securityConfiguration;
import com.example.finalprojectspring.entities.UserEntity;
import com.example.finalprojectspring.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotNull;
@Service
public class UserPrincipalsDetailsService implements UserDetailsService {
private final UserRepository userRepository;
@Autowired
public UserPrincipalsDetailsService(UserRepository userRepository) {
this.userRepository = userRepository;
}
@Override
public UserDetails loadUserByUsername(@NotNull String email) throws UsernameNotFoundException {
UserEntity userEntity = this.userRepository.findByEmail(email);
UserPrincipal userPrincipal = new UserPrincipal(userEntity);
return userPrincipal;
}
}
|
01d0a6b4-da94-4040-ac57-ebe8d68da3cf
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-08 19:35:02", "repo_name": "dusanradojcic00/IT355-pz", "sub_path": "/src/main/java/com/met/it355pz/model/Reservation.java", "file_name": "Reservation.java", "file_ext": "java", "file_size_in_byte": 1227, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "6c10b7b7c73cbfac78fde1cfc0da9598b1887ecf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dusanradojcic00/IT355-pz
| 257
|
FILENAME: Reservation.java
| 0.272025
|
package com.met.it355pz.model;
import com.fasterxml.jackson.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.time.LocalDate;
import java.util.Date;
@Data
@NoArgsConstructor
@Entity
@JsonIdentityInfo(
generator = ObjectIdGenerators.PropertyGenerator.class,
property = "id")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class Reservation {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false)
private Long id;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private LocalDate startingDate;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private LocalDate endingDate;
@ManyToOne
private Car car;
@ManyToOne
private User user;
@JsonIgnore
@OneToOne(mappedBy = "reservation")
private Invoice invoice;
public User getUser() {
return user;
}
public Reservation(Long id, LocalDate startingDate, LocalDate endingDate, Car car) {
this.id = id;
this.startingDate = startingDate;
this.endingDate = endingDate;
this.car = car;
}
}
|
d7721840-3fdd-4a99-a87b-eff7ec069993
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-07-29 04:05:33", "repo_name": "rohitj782/BookFinder", "sub_path": "/app/src/main/java/rohitrj/com/bookfinder/Services/ServiceBuilder.java", "file_name": "ServiceBuilder.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "7968ed664a667d5f1b58e83960d77e8a110d7d36", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/rohitj782/BookFinder
| 184
|
FILENAME: ServiceBuilder.java
| 0.246533
|
package rohitrj.com.bookfinder.Services;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ServiceBuilder {
//the server URL
static final String URL = "https://www.googleapis.com/books/v1/";
static final HttpLoggingInterceptor logging = new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY);
static OkHttpClient.Builder okHttpClient = new OkHttpClient.Builder()
.callTimeout(5, TimeUnit.SECONDS)
.addInterceptor(logging);
static Retrofit.Builder builder = new Retrofit.Builder().baseUrl(URL)
.addConverterFactory(GsonConverterFactory.create())
.client(okHttpClient.build());
static Retrofit retrofit = builder.build();
public static Object buildService(Class<GetServices> sericeType) {
return retrofit.create(sericeType);
}
}
|
f9f5af22-e968-43ab-9c48-1b7fedca30d5
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-26 01:14:05", "repo_name": "tuegum/Servlet", "sub_path": "/src/tuegum/web/servlet/response/ResponseDemo1.java", "file_name": "ResponseDemo1.java", "file_ext": "java", "file_size_in_byte": 1343, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "9e35a41040a587ce1a8eee6904551ab8629a7432", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/tuegum/Servlet
| 247
|
FILENAME: ResponseDemo1.java
| 0.271252
|
package tuegum.web.servlet.response;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 重定向
*/
@WebServlet("/responseDemo1")
public class ResponseDemo1 extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//访问/responseDemo1, 会自动跳转到/responseDemo2资源
System.out.println("responseDemo1被访问了");
// //1.设置状态码为302
// response.setStatus(302);
// //2.设置响应头location
// response.setHeader("location","http://localhost/naruto/responseDemo2");
request.setAttribute("msg","response");
//动态获取虚拟目录,不能把虚拟目录给写死了
String contextPath = request.getContextPath();
System.out.println(contextPath);
//简化设置重定向,需要添加虚拟目录
response.sendRedirect(contextPath + "/responseDemo2");
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doPost(request,response);
}
}
|
cac379cb-3b15-4ebb-a3cb-1296773147d9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-09 10:55:45", "repo_name": "Smile-Chen/TabLayout-Recycler-ViewPage", "sub_path": "/app/src/main/java/co/example/hp/chenjia20180709/mvp/view/adapter/MyAdapter.java", "file_name": "MyAdapter.java", "file_ext": "java", "file_size_in_byte": 1037, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "2d5ffa5e28fb7584fa2446e773470dca378256dd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Smile-Chen/TabLayout-Recycler-ViewPage
| 226
|
FILENAME: MyAdapter.java
| 0.26588
|
package co.example.hp.chenjia20180709.mvp.view.adapter;
import android.media.Image;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import java.util.List;
/**
* Created by hp on 2018/7/9.
*/
public class MyAdapter extends PagerAdapter{
public List<ImageView>list;
public MyAdapter(List<ImageView> list) {
this.list = list;
}
@Override
public int getCount() {
return Integer.MAX_VALUE;
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view==object;
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
position = position % list.size();
ImageView imageView = list.get(position);
container.addView(imageView);
return imageView;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View) object);
}
}
|
0617f15e-c9a6-4089-90c3-d7d64c399396
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-07 09:12:48", "repo_name": "huao1990/KomaVideo", "sub_path": "/app/src/main/java/com/koma/video/data/source/remote/VideosRemoteDataSource.java", "file_name": "VideosRemoteDataSource.java", "file_ext": "java", "file_size_in_byte": 521, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "8c131cacf4eb1811c1c60ed6b2114899dd1191b4", "star_events_count": 5, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/huao1990/KomaVideo
| 237
|
FILENAME: VideosRemoteDataSource.java
| 0.262842
|
/*
* Copyright 2017 Koma
*
* 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.koma.video.data.source.remote;
import android.support.annotation.NonNull;
import com.koma.video.data.VideosDataSource;
import javax.inject.Singleton;
/**
* Created by koma on 6/20/17.
*/
@Singleton
public class VideosRemoteDataSource implements VideosDataSource {
private static final String TAG = VideosRemoteDataSource.class.getSimpleName();
public VideosRemoteDataSource() {
}
@Override
public void loadVideos(@NonNull LoadVideosCallback callback, String folderpath) {
}
}
|
941d373e-218e-42f1-8c8b-543f2b23ad2d
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-21 21:13:14", "repo_name": "inzimam/Clean-Architecture-Android", "sub_path": "/app/src/main/java/com/example/jhordan/euro_cleanarchitecture/domain/usecase/GetTeamUseCase.java", "file_name": "GetTeamUseCase.java", "file_ext": "java", "file_size_in_byte": 611, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "80f8579ab980d08cae25ff9ff42e07bd862292c8", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/inzimam/Clean-Architecture-Android
| 262
|
FILENAME: GetTeamUseCase.java
| 0.286968
|
/*
* Copyright (C) 2016 Erik Jhordan Rey.
*
* 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.example.jhordan.euro_cleanarchitecture.domain.usecase;
import com.example.jhordan.euro_cleanarchitecture.data.repository.TeamsRepository;
import com.example.jhordan.euro_cleanarchitecture.domain.model.Team;
import io.reactivex.rxjava3.core.Observable;
import javax.inject.Inject;
public class GetTeamUseCase {
private final TeamsRepository teamsRepository;
@Inject
public GetTeamUseCase(TeamsRepository teamsRepository) {
this.teamsRepository = teamsRepository;
}
public Observable<Team> getTeam(String flag) {
return teamsRepository.getTeam(flag);
}
}
|
df405744-e4bf-4ea2-90ff-5d019d09d1c1
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-11 11:16:17", "repo_name": "EkaterinaBurshtyn/Pharmacy", "sub_path": "/src/main/java/org/burshtyn/pharmacy/mapper/SoldDtoMapper.java", "file_name": "SoldDtoMapper.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "b6fe0dc79db7538de5f0cde07bbad8846bcf4836", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/EkaterinaBurshtyn/Pharmacy
| 214
|
FILENAME: SoldDtoMapper.java
| 0.286169
|
package org.burshtyn.pharmacy.mapper;
import org.burshtyn.pharmacy.dto.sold.SoldDto;
import org.burshtyn.pharmacy.entity.Sold;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SoldDtoMapper implements BaseDtoMapper<SoldDto, Sold> {
@Autowired
private PreparationDtoMapper preparationDtoMapper;
@Override
public SoldDto mapToDto(Sold entity) {
if (entity== null) {
return null;
}
SoldDto dto = new SoldDto();
dto.setId(entity.getId());
dto.setPreparation(preparationDtoMapper.mapToDto(entity.getPreparation()));
dto.setQuantity(entity.getQuantity());
dto.setPricePerPack(entity.getPricePerPack());
return dto;
}
/**
* Don't remove this method.
* It has been created only for compatibility.
*/
@Override
public Sold mapToEntity(SoldDto dto) {
return null;
}
}
|
16eade45-dd02-46e0-a8b0-c1e07840d68f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-06-28 02:13:02", "repo_name": "xchenum/TwilioOSMan", "sub_path": "/src/main/java/com/att/research/openstack/VoiceCommandServlet.java", "file_name": "VoiceCommandServlet.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "25e9eb828e9960ada736c823386403bac6145dac", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/xchenum/TwilioOSMan
| 190
|
FILENAME: VoiceCommandServlet.java
| 0.239349
|
package com.att.research.openstack;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.FileWriter;
public class VoiceCommandServlet extends HttpServlet
{
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
try {
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("/tmp/log", true)));
if (request.getParameter("RecordingUrl") != null) {
out.println(request.getParameter("RecordingUrl"));
} else {
out.println("RecordingUrl parameter not found!");
}
out.close();
} catch (IOException e) {
//oh noes!
}
response.setContentType("text/html");
response.setStatus(HttpServletResponse.SC_OK);
response.getWriter().println("<h1>RESPONSE GENERATED</h1>");
}
}
|
e87e1b0a-bba2-45f3-b6db-fe61c66e1acb
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-11-07 15:22:15", "repo_name": "maayanpolitzer/Android2017May", "sub_path": "/android/lesson7-11.9.17/ListView/app/src/main/java/com/example/hackeru/listview/Contact.java", "file_name": "Contact.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 54, "lang": "en", "doc_type": "code", "blob_id": "082c9a0a2aaf98302d1824c64b0a658c333c1c90", "star_events_count": 5, "fork_events_count": 3, "src_encoding": "UTF-8"}
|
https://github.com/maayanpolitzer/Android2017May
| 225
|
FILENAME: Contact.java
| 0.233706
|
package com.example.hackeru.listview;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import java.io.Serializable;
/**
* Created by hackeru on 9/11/2017.
*/
public class Contact implements Serializable {
private String name;
private String phone;
private int image;
private int color;
public Contact(String name, String phone, @DrawableRes int drawableId, @ColorRes int colorId){
this.name = name;
this.phone = phone;
image = drawableId;
color = colorId;
}
@Override
public String toString() {
return "Contact{" +
"name='" + name + '\'' +
", phone='" + phone + '\'' +
", image=" + image +
", color=" + color +
'}';
}
public String getName() {
return name;
}
public String getPhone() {
return phone;
}
public int getImage() {
return image;
}
public int getColor() {
return color;
}
}
|
4683ec5f-6f29-4a37-8c9a-8bf50d11f36a
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-15 14:41:24", "repo_name": "abacsrob/restdemo", "sub_path": "/src/main/java/com/example/restdemo/controller/exceptionhandler/CustomerExceptionHandler.java", "file_name": "CustomerExceptionHandler.java", "file_ext": "java", "file_size_in_byte": 1227, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "4824935872a289a3f58a169aa878f2db34a9be7e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/abacsrob/restdemo
| 178
|
FILENAME: CustomerExceptionHandler.java
| 0.279042
|
package com.example.restdemo.controller.exceptionhandler;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import java.util.Date;
@ControllerAdvice
public class CustomerExceptionHandler {
@ExceptionHandler
public ResponseEntity<CustomerErrorResponse> customerNotFoundException(CustomerNotFoundException e) {
CustomerErrorResponse customerErrorResponse = new CustomerErrorResponse(
Long.valueOf(HttpStatus.NOT_FOUND.value()),
e.getMessage(), e.getUriString(),
new Date().getTime());
return new ResponseEntity<>(customerErrorResponse, HttpStatus.NOT_FOUND);
}
// @ExceptionHandler
public ResponseEntity<CustomerErrorResponse> genericException(Exception e) {
CustomerErrorResponse customerErrorResponse = new CustomerErrorResponse(
Long.valueOf(HttpStatus.BAD_REQUEST.value()),
e.getMessage(), "",
new Date().getTime());
return new ResponseEntity<>(customerErrorResponse, HttpStatus.BAD_REQUEST);
}
}
|
b240db4c-0d4a-48eb-a863-66e2a0cef9ad
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-11-20 14:38:51", "repo_name": "idea4j/mljr", "sub_path": "/mljr/src/test/java/com/mljr/demo/mq/MQDemo.java", "file_name": "MQDemo.java", "file_ext": "java", "file_size_in_byte": 1278, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "0445f191e913b9e1cafdbef0f96a2438b0da2e2b", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/idea4j/mljr
| 282
|
FILENAME: MQDemo.java
| 0.221351
|
package com.mljr.demo.mq;
import org.apache.activemq.command.ActiveMQQueue;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jms.core.JmsTemplate;
import java.util.concurrent.locks.ReentrantLock;
/**
* @Description:
* @Author: 牛神成--Tinker
* @Company:
* @CreateDate: 2016/11/12
*/
public class MQDemo {
/**
* 消息生产者
*
* @throws Exception
*/
@Test
public void run1() throws Exception {
ApplicationContext ac = new ClassPathXmlApplicationContext("classpath:applicationContext-activemq-producer.xml");
JmsTemplate template = ac.getBean(JmsTemplate.class);
ActiveMQQueue queue = ac.getBean(ActiveMQQueue.class);
template.send(queue, session -> session.createTextMessage("2"));
}
/**
* 消息消费者
*
* @throws Exception
*/
@Test
public void run2() throws Exception {
ReentrantLock lock = new ReentrantLock();
if (lock.tryLock()) {
try {
System.out.println("尝试成功获取到了锁!");
} finally {
lock.unlock();
}
}
}
}
|
f0b84e39-d32d-4684-9c82-63e410b90fad
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-24 14:12:15", "repo_name": "lin19950817/java-study", "sub_path": "/structs2/base2/src/main/java/base2/org/lzn/domain/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1223, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "d42e712234428f2f50c507e36a8b823673a8751d", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/lin19950817/java-study
| 256
|
FILENAME: User.java
| 0.256832
|
package base2.org.lzn.domain;
import java.io.Serializable;
import java.util.Date;
/**
* 数据模型
*
* @author LinZhenNan lin_hehe@qq.com 2020/04/07 20:46
*/
public class User implements Serializable {
private String username;
private int age;
private Date birthday;
//
// setter/getter、toString
// ------------------------------------------------------------------------------
public String getUsername() {
System.out.println("getUsername");
return username;
}
public void setUsername(String username) {
System.out.println("setUsername");
this.username = username;
}
public int getAge() {
System.out.println("getAge");
return age;
}
public void setAge(int age) {
System.out.println("setAge");
this.age = age;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
@Override
public String toString() {
return "User{" +
"username='" + username + '\'' +
", age=" + age +
", birthday=" + birthday +
'}';
}
}
|
d67f1b26-09f8-4de6-a36b-366c7ab58e10
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-10 10:23:38", "repo_name": "Shivani-N-Shivakumar/TY_CG_HTD_Bangalore-November_JFS_ShivaniNS-", "sub_path": "/BackEnd/Hibernate/jpawithhibernate/src/main/java/com/capgemini/jpawithhibernate/onetoone/EmployeeInfo.java", "file_name": "EmployeeInfo.java", "file_ext": "java", "file_size_in_byte": 1226, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "fa9858874f29531dbe5b56f0c040d66e885bb5a9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Shivani-N-Shivakumar/TY_CG_HTD_Bangalore-November_JFS_ShivaniNS-
| 287
|
FILENAME: EmployeeInfo.java
| 0.253861
|
package com.capgemini.jpawithhibernate.onetoone;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import com.capgemini.jpawithhibernate.manytoone.EmployeeExperience;
@Entity
@Table(name="employee_info")
public class EmployeeInfo {
@Id
@Column
private int eid;
@Column
private String ename;
@Column
private String email;
@Column
private String password;
public int getEid() {
return eid;
}
public void setEid(int eid) {
this.eid = eid;
}
public String getEname() {
return ename;
}
public void setEname(String name) {
this.ename = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@OneToOne(cascade=CascadeType.ALL,mappedBy="emp")
private EmployeeOther other;
@OneToMany(cascade=CascadeType.ALL,mappedBy="emp")
private EmployeeExperience exp;
@ManyToMany(cascade=CascadeType.ALL,mappedBy="List")
private<List<>>
}
|
9f4931bf-7456-4a58-b0ef-b5e72dd212fd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-30 22:01:05", "repo_name": "smccauliff/sync-async-example", "sub_path": "/src/main/java/com/example/kafka/httpproxy/EmbeddedJetty.java", "file_name": "EmbeddedJetty.java", "file_ext": "java", "file_size_in_byte": 998, "line_count": 30, "lang": "en", "doc_type": "code", "blob_id": "197dab5245fb3e4f6eaefa599805c6e8ce7bc5f5", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/smccauliff/sync-async-example
| 210
|
FILENAME: EmbeddedJetty.java
| 0.216012
|
package com.example.kafka.httpproxy;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
public class EmbeddedJetty {
private Server _server;
public void start() throws Exception {
_server = new Server();
ServerConnector connector = new ServerConnector(_server);
connector.setPort(8090);
_server.setConnectors(new Connector[]{connector});
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/example");
_server.setHandler(context);
context.addServlet(new ServletHolder(new ProduceServlet()), "/*");
_server.start();
}
public static void main(String[] argv) throws Exception {
EmbeddedJetty embeddedJetty = new EmbeddedJetty();
embeddedJetty.start();
System.out.println("Exited main");
}
}
|
e9f8308b-4df4-499d-82d7-d36c42c2392f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-25 14:51:40", "repo_name": "raojin/SMG", "sub_path": "/Dsoa/src/dsoap/tools/mail/MailSender.java", "file_name": "MailSender.java", "file_ext": "java", "file_size_in_byte": 985, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "8ee9ba478ca5125a31f0f3dae4d37b73b60e50be", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/raojin/SMG
| 175
|
FILENAME: MailSender.java
| 0.249447
|
package dsoap.tools.mail;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
public class MailSender {
static ThreadPoolTaskExecutor taskExecutor;
static {
taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setMaxPoolSize(2);
taskExecutor.setCorePoolSize(1);
taskExecutor.initialize();
}
public static void sendMailByAsynchronousMode(final Email email) {
// System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n###############################################################################" + taskExecutor);
taskExecutor.execute(new Runnable() {
public void run() {
try {
MailSenderImpl sender = new MailSenderImpl();
sender.sendMail(email.getTo(), email.getSubject(), email.getContent());
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
|
8a47d841-db0c-4538-9c20-f13a5f11e687
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-19 03:16:42", "repo_name": "allulong/SBook", "sub_path": "/app/src/main/java/com/logn/sbook/welcome/WelcomeActivity.java", "file_name": "WelcomeActivity.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "8f6b28e13f5a2cb6298af365ff832b4e236682de", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/allulong/SBook
| 223
|
FILENAME: WelcomeActivity.java
| 0.220007
|
package com.logn.sbook.welcome;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.widget.ImageView;
//import com.logn.sbook.MainActivity;
import com.logn.sbook.R;
import com.logn.sbook.ui.GuideActivity;
import com.logn.sbook.ui.LoginActivity;
import com.logn.sbook.ui.PhoneCheckActivity;
/**
* Created by long on 2017/6/27.
*/
public class WelcomeActivity extends FragmentActivity {
private ImageView imageView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_welcome);
initView();
}
private void initView() {
imageView = (ImageView) findViewById(R.id.welcome_img);
imageView.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(WelcomeActivity.this, GuideActivity.class);
startActivity(intent);
finish();
}
}, 2000);
}
}
|
25411b71-5301-4be3-bace-82271cca414f
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-06-29 20:19:19", "repo_name": "adarshkumarsingh83/hibernate", "sub_path": "/APPLICATION/PropertyFileForHibernateConfiguration/src/main/java/com/adarsh/factory/SessionFactoryUtil.java", "file_name": "SessionFactoryUtil.java", "file_ext": "java", "file_size_in_byte": 1227, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "73af2ea098690e1169e2451d27ff91a1abf62e54", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/adarshkumarsingh83/hibernate
| 208
|
FILENAME: SessionFactoryUtil.java
| 0.276691
|
package com.adarsh.factory;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import java.io.FileInputStream;
import java.util.Properties;
@Slf4j
public class SessionFactoryUtil {
static SessionFactory sessionFactory;
static {
sessionFactory = createSessionFactory();
}
public static SessionFactory createSessionFactory() {
Configuration hibernateConfigurationObject = null;
try {
Properties hibernateCfg = new Properties();
hibernateCfg.load(new FileInputStream("src/main/resources/hibernate-cfg.properties"));
hibernateConfigurationObject = new Configuration();
hibernateConfigurationObject.setProperties(hibernateCfg);
hibernateConfigurationObject.addFile("src/main/resources/person.hbm.xml");
} catch (Exception exceptionObject) {
log.error(exceptionObject.getMessage());
exceptionObject.printStackTrace();
}
return hibernateConfigurationObject.buildSessionFactory();
}
public static Session getHibernateSession() {
return sessionFactory.openSession();
}
}
|
076cfdac-0c7c-4359-8ccf-63d01d1aa3c0
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-16 01:47:16", "repo_name": "superMelo/open-tracing", "sub_path": "/src/main/java/com/qyf/opentracing/es/EsClient.java", "file_name": "EsClient.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "f9c8a45488b2ff9d708af5bb54f9e109134cbd3f", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/superMelo/open-tracing
| 217
|
FILENAME: EsClient.java
| 0.243642
|
package com.qyf.opentracing.es;
import com.alibaba.fastjson.JSON;
import org.apache.http.HttpHost;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.xcontent.XContentType;
import java.io.IOException;
public class EsClient {
private static RestHighLevelClient getClient() {
return new RestHighLevelClient(RestClient.builder(new HttpHost("127.0.0.1", 9200, "http")));
}
public static void save(Object object) {
RestHighLevelClient client = getClient();
IndexRequest indexRequest = new IndexRequest("open-trace");
indexRequest.source(JSON.toJSONString(object), XContentType.JSON);
try {
client.index(indexRequest, RequestOptions.DEFAULT);
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
client.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
|
d346d236-bbe6-49d3-a045-f231a0b3f3ba
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-09-21 06:44:11", "repo_name": "qqj19891210/scw", "sub_path": "/scw-manager/manager-pojo/src/main/java/com/smart/scw/manager/bean/TRole.java", "file_name": "TRole.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "e34435a6f5b8bb26bbcb85058ee10911af992bd9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/qqj19891210/scw
| 228
|
FILENAME: TRole.java
| 0.243642
|
package com.smart.scw.manager.bean;
import java.io.Serializable;
import java.util.Objects;
public class TRole implements Serializable {
private Integer id;
private String name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
@Override
public String toString() {
return "TRole{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TRole tRole = (TRole) o;
return Objects.equals(id, tRole.id) &&
Objects.equals(name, tRole.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
}
|
468424d1-a843-4f6c-abd3-bb91bd2aa626
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-24 01:56:09", "repo_name": "ZongweiBai/springboot-basic", "sub_path": "/springboot-basic-store/src/main/java/com/baymin/springboot/store/entity/Feedback.java", "file_name": "Feedback.java", "file_ext": "java", "file_size_in_byte": 1251, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "3300cc5fd16e9d1e4551890ee04ec30bf8a289c9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ZongweiBai/springboot-basic
| 265
|
FILENAME: Feedback.java
| 0.240775
|
package com.baymin.springboot.store.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* 意见反馈
*/
@ApiModel(description = "意见反馈")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "T_FEEDBACK")
public class Feedback implements Serializable {
@ApiModelProperty(hidden = true)
@Id
@Column(name = "ID", length = 32)
@GeneratedValue(strategy = GenerationType.TABLE, generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid")
private String id;
@ApiModelProperty(notes = "等级评分 1-5星")
@Column(name = "GRADE")
private Integer grade = 5;
@ApiModelProperty(notes = "反馈内容")
@Column(name = "CONTENT", length = 2048)
private String content;
@ApiModelProperty(notes = "用户ID")
@Column(name = "USER_ID")
private String userId;
@ApiModelProperty(hidden = true)
@Column(name = "CREATE_TIME", columnDefinition = "timestamp")
private Date createTime;
}
|
117fae30-9d7a-4926-add5-37a9ba4df763
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-09-22 12:31:54", "repo_name": "WangLingYu/WangYiYunMusicIndex", "sub_path": "/app/src/main/java/com/example/wang/yunmusic/MainFragmentPagerAdapter.java", "file_name": "MainFragmentPagerAdapter.java", "file_ext": "java", "file_size_in_byte": 982, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "7ba662f38537d62e4bbf5f8d3e03410fc6b25b31", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/WangLingYu/WangYiYunMusicIndex
| 205
|
FILENAME: MainFragmentPagerAdapter.java
| 0.252384
|
package com.example.wang.yunmusic;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import java.util.List;
/**
* Created by wang on 16/9/22.
*/
public class MainFragmentPagerAdapter extends FragmentPagerAdapter {
private List<String> mTitles;
private Context mContext;
private List<Fragment> mFragments;
public MainFragmentPagerAdapter(FragmentManager fm, List<String> titles, Context context, List<Fragment> fragments) {
super(fm);
mTitles = titles;
mContext = context;
mFragments = fragments;
}
@Override
public Fragment getItem(int position) {
return mFragments.get(position);
}
@Override
public int getCount() {
return mFragments.size();
}
@Override
public CharSequence getPageTitle(int position) {
return mTitles.get(position);
}
}
|
cd50c0df-9819-45a6-8147-1d8b5e1b38ca
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-02-11 16:08:20", "repo_name": "celine-villain/JavaTrainings", "sub_path": "/Generics/src/academy/learnprogramming/League.java", "file_name": "League.java", "file_ext": "java", "file_size_in_byte": 991, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "c497fff9fdc6e699e2faec38df127e29d4dc5bc2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/celine-villain/JavaTrainings
| 209
|
FILENAME: League.java
| 0.272799
|
package academy.learnprogramming;
import java.util.ArrayList;
import java.util.Collections;
public class League<T extends Team> {
private String name;
private ArrayList<T> league = new ArrayList<T>();
//constructor
public League(String name) {
this.name = name;
}
public boolean addTeam (T team) {
if (this.league.contains(team)){
System.out.println(team.getName() + " is already in the league");
return false;
} else {
this.league.add(team);
return true;
}
}
public void printListOfTeams () {
Collections.sort(league);
for (T team : league) {
System.out.println(team.getName() + " : " + team.ranking());
}
}
//getters & setters
public String getName() {
return name;
}
public ArrayList<T> getLeague() {
return league;
}
public void setName(String name) {
this.name = name;
}
}
|
99305329-5577-46b3-8d64-9b24603a04cd
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-11-10 06:20:22", "repo_name": "bkhk06/Java", "sub_path": "/mongodb_test/src/main/java/cn/adcc/mongodb_test/Student.java", "file_name": "Student.java", "file_ext": "java", "file_size_in_byte": 1124, "line_count": 58, "lang": "en", "doc_type": "code", "blob_id": "7ff555d97622a6ed399c03fea1cab17cb9c4db5c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/bkhk06/Java
| 251
|
FILENAME: Student.java
| 0.259826
|
package cn.adcc.mongodb_test;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import java.io.Serializable;
import java.util.Date;
/**
* @author LD
* @version 1.0
* @date 2022/3/10 13:35
*/
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Data
public class Student implements Serializable {
@Id// 必须指定id列
private String studentId;
private String studentName;
private Integer studentAge;
private Double studentScore;
private Date studentBirthday;
public void setStudentId(String s) {
studentId=s;
}
public void setStudentName(String s) {
studentName=s;
}
public void setStudentAge(int i) {
studentAge=i;
}
public void setStudentScore(double v) {
studentScore=v;
}
public void setStudentBirthday(Date date) {
studentBirthday=date;
}
public String getStudentInfo() {
return studentName+"_ "+studentId+" _"+studentAge+"_ "+studentScore;
}
}
|
67c529f6-5492-4c23-9104-cf990537986b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-24 11:12:44", "repo_name": "Swinger-w/cz", "sub_path": "/common/src/main/java/com/zhjl/tech/common/zjlsign/request/GenRequestSignStr.java", "file_name": "GenRequestSignStr.java", "file_ext": "java", "file_size_in_byte": 1302, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "09ef264c747c2d3a9b0c858a0ec3e91202b75263", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Swinger-w/cz
| 273
|
FILENAME: GenRequestSignStr.java
| 0.290981
|
package com.zhjl.tech.common.zjlsign.request;
import lombok.extern.slf4j.Slf4j;
import java.util.*;
@Slf4j
public class GenRequestSignStr {
/**
* 上传文件所需请求签名参数 checked
* @param accessKey 渠道accessKey
* @param random 随机数
* @param ordersn 订单号
* @param fileToken 文件上传标识
* @return
*/
public static String encodeUploadParams(String accessKey, String random, String ordersn, String fileToken){
Map<String,String> parameters = new HashMap<>();
parameters.put("accessKey",accessKey);
parameters.put("random",random);
parameters.put("ordersn",ordersn);
parameters.put("fileToken",fileToken);
//参数排序
List<String> arrayList = new ArrayList<>(parameters.keySet());
Collections.sort( arrayList );
String finalParams="";
StringBuilder sb = new StringBuilder();
for( String s :arrayList){
sb.append("&")
.append(s)
.append("=")
.append(parameters.get(s));
}
finalParams = sb.toString();
log.info("生成上传文件请求签名的前提字符串:{}",finalParams);
return finalParams;
}
}
|
bae8e083-3493-42eb-b2b6-bf5080a528db
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-12-29 14:26:01", "repo_name": "mulesoft/mule-migration-assistant", "sub_path": "/mule-migration-tool-library/src/main/java/com/mulesoft/tools/migration/library/gateway/steps/policy/http/ErrorResponseBuilderMigrationStep.java", "file_name": "ErrorResponseBuilderMigrationStep.java", "file_ext": "java", "file_size_in_byte": 945, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "404071fecda85e0b54db8da8a7c0898872d56af5", "star_events_count": 25, "fork_events_count": 36, "src_encoding": "UTF-8"}
|
https://github.com/mulesoft/mule-migration-assistant
| 234
|
FILENAME: ErrorResponseBuilderMigrationStep.java
| 0.281406
|
/*
* Copyright (c) 2020, Mulesoft, LLC. All rights reserved.
* Use of this source code is governed by a BSD 3-Clause License
* license that can be found in the LICENSE.txt file.
*/
package com.mulesoft.tools.migration.library.gateway.steps.policy.http;
import static com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.HTTP_NAMESPACE;
import com.mulesoft.tools.migration.step.category.MigrationReport;
import org.jdom2.Element;
/**
* Migrate error-response-builder element
*
* @author Mulesoft Inc.
*/
public class ErrorResponseBuilderMigrationStep extends AbstractResponseBuilderMigrationStep {
private static final String ERROR_RESPONSE_BUILDER_TAG_NAME = "error-response-builder";
private static final String HTTP_LISTENER_RESPONSE_ERROR_STATUS_CODE =
"#[vars.statusCode default migration::HttpListener::httpListenerResponseErrorStatusCode(vars)]";
public ErrorResponseBuilderMigrationStep() {
super(HTTP_NAMESPACE, ERROR_RESPONSE_BUILDER_TAG_NAME);
}
@Override
protected String getListenerResponseStatusCode() {
return HTTP_LISTENER_RESPONSE_ERROR_STATUS_CODE;
}
}
|
c4a8e37d-4f49-4cd0-b4a7-2316579b29d9
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-25 12:44:01", "repo_name": "Sohanur-Rahman642/ZSSBD-Second-Phase-Test-Code", "sub_path": "/ZS/app/src/main/java/com/example/zs/ui/NextAcitivity.java", "file_name": "NextAcitivity.java", "file_ext": "java", "file_size_in_byte": 1227, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "61ac88a97f13fde8034d3626206b79879020d424", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/Sohanur-Rahman642/ZSSBD-Second-Phase-Test-Code
| 224
|
FILENAME: NextAcitivity.java
| 0.258326
|
package com.example.zs.ui;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
import com.example.zs.R;
import com.example.zs.service.model.Event;
import com.example.zs.service.repository.EventService;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class NextAcitivity extends AppCompatActivity {
private EventService eventService;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_next_acitivity);
}
private void doLogin(final String email,final String password){
Call call = eventService.getEventList();
call.enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
updateUi((List<Event>) response.body());
}
@Override
public void onFailure(Call call, Throwable t) {
Toast.makeText(NextAcitivity.this, t.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
public void updateUi(List<Event> eventList)
{
}
}
|
d3c43dc2-b6ce-438e-8dc8-e8f97bed6ac7
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-02-21T13:55:37", "repo_name": "klejeune/Earley", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1066, "line_count": 27, "lang": "en", "doc_type": "text", "blob_id": "ccd0fce9d98a1464069ef9ae47438d620c11f964", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/klejeune/Earley
| 272
|
FILENAME: README.md
| 0.277473
|
# Earley parser
A C# implementation of an Earley parser working on Tree-adjoining grammars (working on natural languages)
# NLP
The Natural Language examples must use a Part-of-Speech Tagger.
## Stanford POS Tagger
Download the Stanford POS Tagger at http://nlp.stanford.edu/software/tagger.html#Download
Make sure it is well referenced in the PosTagger class constructor.
In the examples, make sure you are using the StanfordPosTagger class to generate the ISentence objects.
## Talismane
Download Talismane at http://redac.univ-tlse2.fr/applications/talismane.html
Download a language pack like English or French at https://github.com/urieli/talismane/releases
Run Talismane with a command line like:
java -Xmx1G -jar talismane-core-2.4.7b.jar languagePack=frenchLanguagePack-2.4.4b.zip command=analyse mode=server encoding=UTF-8 port=7171
In the examples, make sure you are using the Talismane class to generate the ISentence objects.
# References
See:
- https://en.wikipedia.org/wiki/Earley_parser
- https://en.wikipedia.org/wiki/Tree-adjoining_grammar
|
886ca157-3dd2-406a-963d-4e4a2794eda3
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2017-10-23T15:13:18", "repo_name": "fakeharxy/Tech_test", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1213, "line_count": 23, "lang": "en", "doc_type": "text", "blob_id": "07eae904339f831cfdd5fff5eb8c53f29bb99a57", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/fakeharxy/Tech_test
| 281
|
FILENAME: README.md
| 0.221351
|
Hey Chaps, hope you having a good day!
So here is the result from my test coding application to create an product that consumes a video api for searching movies and getting movie information.
The time was a little on the short side so I didn't achieve as much as I would like.
Things left todo:
#1 Unit tests, normally with react and redux I would use JEST and ENZYME and combined with `axios-mock-adaptor` for testing api responses.
#2 More effort in CSS architecture, i've used `styled-components` with a bit of BEM, but I would have liked to build out an `ITCSS` base,
this methodology works really well with `styled-components`
#3 Fill out `PropTypes` for each component
#4 General code clean up, apply `eslint` rules, refactor where needed
#5 Implement Conditional rendering for favourites heading if the list of videos doesn't contain a trailer
#6 Style search page
How to run.
This app is bootstrap with `create-react-app` mainly to save time setting up the environment, build scripts etc. I found whilst using `create-react-app`
it come with some pretty cool features for debugging.
#1 npm install
#2 npm run start - should spin up a server, if not navigate tp 'localhost:1337'
|
23d18edf-8dc4-4fe6-bd09-d6e397701874
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-01-27 00:30:32", "repo_name": "ndefilippis/APCS-BlockMario", "sub_path": "/entities/Entity.java", "file_name": "Entity.java", "file_ext": "java", "file_size_in_byte": 995, "line_count": 65, "lang": "en", "doc_type": "code", "blob_id": "f258826bf09777fd9246ec67f599696b66078241", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/ndefilippis/APCS-BlockMario
| 260
|
FILENAME: Entity.java
| 0.278257
|
package entities;
import game.Direction;
import java.awt.Graphics;
import java.awt.geom.Rectangle2D;
public abstract class Entity{
protected int x, y, width, height;
protected boolean passThrough;
protected int serialNum;
public Entity(int x, int y, int width, int height) {
this.x = x;
this.y = y;
this.height = height;
this.width = width;
}
public void setIndex(int serialNum){
this.serialNum = serialNum;
}
public abstract void collide(Entity m, Direction d);
public abstract void draw(Graphics g, int x, int y);
public Rectangle2D.Double getBounds(){
return new Rectangle2D.Double(x, y, width, height);
}
public int x() {
return x;
}
public int y() {
return y;
}
public boolean passThrough(){
return passThrough;
}
public int width() {
return width;
}
public int height() {
return height;
}
public int num(){
return serialNum;
}
public void setX(int x) {
this.x = x;
}
public void setY(int y){
this.y = y;
}
}
|
d4ea1024-b660-4858-ae7b-c5ec0b7d257b
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-02-14 22:18:13", "repo_name": "vovkalexander/job4j_dreamjob", "sub_path": "/src/main/java/ru/job4j/dream/model/StoreStub.java", "file_name": "StoreStub.java", "file_ext": "java", "file_size_in_byte": 1213, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "9c34c7ee3f97123e0ad1da021cfeb33c639d5594", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/vovkalexander/job4j_dreamjob
| 272
|
FILENAME: StoreStub.java
| 0.282988
|
package ru.job4j.dream.model;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
public class StoreStub implements Store {
private final Map<Integer, Post> postStore = new HashMap<>();
private int postId = 0;
@Override
public Collection<Post> findAllPosts() {
return new ArrayList<Post>(this.postStore.values());
}
@Override
public Collection<Candidate> findAllCandidates() {
return null;
}
@Override
public void save(Post post) {
post.setId(this.postId++);
this.postStore.put(post.getId(), post);
}
@Override
public void save(Candidate candidate) {
}
@Override
public Post findPostById(int id) {
return this.postStore.get(id);
}
@Override
public Candidate findCandidateById(int id) {
return null;
}
@Override
public void deleteCandidate(String id) {
}
@Override
public void saveUser(User user) {
}
@Override
public User findUserByDate(String name, String email) {
return null;
}
@Override
public Collection<City> findAllCities() {
return null;
}
}
|
40404ddf-c71a-4de8-8962-10f61c00b2ce
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-03 16:36:31", "repo_name": "iLemonBr/skyminingworld", "sub_path": "/src/main/java/com/skyland/skymining/listeners/HasteListener.java", "file_name": "HasteListener.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "0dee6fe095736587789099230d7ce5cd4292c2a2", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"}
|
https://github.com/iLemonBr/skyminingworld
| 222
|
FILENAME: HasteListener.java
| 0.242206
|
package com.skyland.skymining.listeners;
import com.skyland.skymining.Main;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class HasteListener implements Listener {
private static Main m = (Main) Bukkit.getPluginManager().getPlugin("MinaCore");
@EventHandler
public void onWorldChange(PlayerChangedWorldEvent event) {
Player player = event.getPlayer();
World world = player.getWorld();
if (world.getName().equalsIgnoreCase(m.getConfig().getString("Mundo"))) {
player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 999999, 1));
} else if (player.hasPotionEffect(PotionEffectType.FAST_DIGGING)) {
player.removePotionEffect(PotionEffectType.FAST_DIGGING);
}
}
}
|
49bdc10d-4489-4de2-93b7-5c8c687160b6
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-08-19T13:02:32", "repo_name": "intchloe/swehack", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1019, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "99202e593fb603de053f7fd71842c4e238652a1a", "star_events_count": 6, "fork_events_count": 2, "src_encoding": "UTF-8"}
|
https://github.com/intchloe/swehack
| 256
|
FILENAME: README.md
| 0.226784
|
# swehack
swehack.org configuration and information
#### swehack security and privacy adjustments
* Hard code "127.0.0.1" as IP for all members
* No logging
* Auto remove private messages after X days
* Techniques to fight onion-rewriting
* Check if private messages are PGP-encrypted (see [check_pgp.js](https://github.com/intchloe/swehack/blob/master/check_pgp.js))
* Check if the user is using our domains (and not onion.cab/link, Tor2Web) (see [check_domain.js](https://github.com/intchloe/swehack/blob/master/check_domain.js))
* Eliminate disclosure-attacks by giving a neutral answer on forgot password, registration and login
* Dynamic CSP
* No need for email at registration
* Password policy - at least 6 chars, 1 uppercase and digit. 255 max
* No personal information in emails (no username)
* Random blinding at forgot password-page to eliminate timing attacks
* Longer GUID(6-12 chars) and reset password(12 chars) at forgot password URL in mail
* Custom CSP-violate-reporter served locally and via .onion
|
86c9e6b9-0b42-4e83-a4d0-33ba2c196e41
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-25 16:12:06", "repo_name": "CARTESLA17/deliveries", "sub_path": "/DeliveriesRoot/DeliveriesModelsLayer/src/main/java/org/com/deliveries/models/Deliveries.java", "file_name": "Deliveries.java", "file_ext": "java", "file_size_in_byte": 1130, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "b742a85fc0a706e383d17a32db6428318951b772", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/CARTESLA17/deliveries
| 268
|
FILENAME: Deliveries.java
| 0.267408
|
package org.com.deliveries.models;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class Deliveries implements Serializable{
private static final long serialVersionUID = -4676000037557420104L;
private List<String> deliveryPaths;
private Drone drone;
private List<String> deliveryReports = new ArrayList<>();
private String id;
public Deliveries() {
super();
}
public Deliveries(List<String> deliveryPaths, Drone drone, String id) {
this.deliveryPaths = deliveryPaths;
this.drone = drone;
this.id = id;
}
public List<String> getDeliveryPaths() {
return deliveryPaths;
}
public void setDeliveryPaths(List<String> deliveryPaths) {
this.deliveryPaths = deliveryPaths;
}
public Drone getDrone() {
return drone;
}
public void setDrone(Drone drone) {
this.drone = drone;
}
public List<String> getDeliveryReports() {
return deliveryReports;
}
public void setDeliveryReports(List<String> deliveryReports) {
this.deliveryReports = deliveryReports;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
|
3072242c-0105-4087-b596-b1e5d06101f4
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-07-05 17:56:54", "repo_name": "dharanimishra/DD-ZJPlatform", "sub_path": "/ziksana-app/zdomain/src/main/java/com/ziksana/domain/course/Duration.java", "file_name": "Duration.java", "file_ext": "java", "file_size_in_byte": 1228, "line_count": 63, "lang": "en", "doc_type": "code", "blob_id": "f95cb61fcc52271d1015026a6bc41444950c6d8b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/dharanimishra/DD-ZJPlatform
| 259
|
FILENAME: Duration.java
| 0.261331
|
package com.ziksana.domain.course;
/**
* @author bhashasp
*/
public class Duration {
public Duration(Integer duration, DurationUnits durationUnits) {
this.duration = duration;
this.durationUnits = durationUnits;
}
public Duration(Integer duration, Integer durationUnit) {
this.duration = duration;
this.durationUnit = durationUnit;
}
private Integer duration = null;
private Integer durationUnit = 0;
public Integer getDurationUnit() {
return durationUnit;
}
public void setDurationUnit(Integer durationUnit) {
this.durationUnit = durationUnit;
}
private DurationUnits durationUnits = null;
/**
* @return the courseDuration
*/
public Integer getDuration() {
return duration;
}
/**
* @param courseDuration
* the courseDuration to set
*/
public void setDuration(Integer duration) {
this.duration = duration;
}
/**
* @return the durationUnits
*/
public DurationUnits getDurationUnits() {
return durationUnits;
}
/**
* @param durationUnits
* the durationUnits to set
*/
public void setDurationUnits(DurationUnits durationUnits) {
this.durationUnits = durationUnits;
}
}
|
732819e2-8d42-4383-a988-c8c550b2cc0e
|
{"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-08 03:57:53", "repo_name": "jorgezhong/springcloud-learning", "sub_path": "/rabbitmq-api/src/main/java/com/jorge/rabbitmq/exchange/direct/DirectExchangeProducer.java", "file_name": "DirectExchangeProducer.java", "file_ext": "java", "file_size_in_byte": 1249, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "f1caa79c07f304de52268898a4ffc1c6aacb7df7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"}
|
https://github.com/jorgezhong/springcloud-learning
| 268
|
FILENAME: DirectExchangeProducer.java
| 0.256832
|
package com.jorge.rabbitmq.exchange.direct;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
/**
* 生产者
* Created by jorgezhong on 2019/3/1 17:19.
*/
public class DirectExchangeProducer {
public static void main(String[] args) throws IOException, TimeoutException {
//1. 创建ConnectionFactory
ConnectionFactory connectionFactory = new ConnectionFactory();
connectionFactory.setHost("192.168.4.189");
connectionFactory.setPort(5672);
connectionFactory.setVirtualHost("/");
//2. 创还能Connection
Connection connection = connectionFactory.newConnection();
//3. 创建Channel
Channel channel = connection.createChannel();
//4. 声明
String exchangeName = "test_direct_exchange";
//routingKey必须一致
String routingKey = "count.direct";
String msg = "Hello World RabbitMQ , Direct Exchange Message...";
//5. 发送
channel.basicPublish(exchangeName, routingKey, null, msg.getBytes());
channel.close();
connection.close();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.