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 |
|---|---|---|---|---|---|---|
a339f489-10a8-4a63-9478-b1b81ab5c3b6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-11-11T08:52:01", "repo_name": "Growing-C/ZxingDemo", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1020, "line_count": 11, "lang": "en", "doc_type": "text", "blob_id": "2d1281dabdb4435dde8c4714071c527900767f55", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Growing-C/ZxingDemo | 225 | FILENAME: README.md | 0.273574 | # ZxingDemo
an AS demo for repository Zxing, a well know frame for QR code. this demo contains two modules .
There are two modules in this demo project .
Module app is just a copy of the well known frame Zxing (https://github.com/zxing/zxing ). As you can see, there are four android-related packages in the Zxing repository, and I have added them all to my module app.
The android package in Zxing is the basic android project ,the android-core package is addtional for camera config.These two package are the basic of my module app.
The androidtest package in Zxing is a test android project , I added this package to my module app and its contents are in my package test ,with the android-integration package in Zxing.
Module app is just a simple combination of Zxing android support packages without any modification, you can run this module to see how to use the Zxing frame.
Module Simplifiedzxingdemo is a simplified version of Zxing . In this module I removed some functions to make the frame easier to use.
|
46f2d373-1f46-4c89-8ff4-ad04942f13eb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-01-10T01:16:58", "repo_name": "gaozhilong/YibuyiquApp", "sub_path": "/plugins/cordova-plugin-android-status-bar-disabler/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 980, "line_count": 35, "lang": "en", "doc_type": "text", "blob_id": "5fbdd45a5815c7a2538da55f8e6b334f7646ff7c", "star_events_count": 3, "fork_events_count": 3, "src_encoding": "UTF-8"} | https://github.com/gaozhilong/YibuyiquApp | 221 | FILENAME: README.md | 0.256832 | # Cordova Android Status Bar disabler
> Plugin that simply disable status bar on Android device
## Using
Clone the plugin
$ git clone https://github.com/bazzooka/android-status-bar-disabler.git
Install the plugin
$ cd <your project directory>
$ cordova plugin add ../android-status-bar-disabler
Configure your project
Update your AndroidManifest.xml with :
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Install Android platform
phonegap add ../android-status-bar-disabler
phonegap build android
phonegap run android
## More Info
For more information on setting up Cordova see [the documentation](http://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html#The%20Command-Line%20Interface)
For more info on plugins see the [Plugin Development Guide](http://cordova.apache.org/docs/en/4.0.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide)
|
4264d73d-f813-49fb-84ad-550c1ce594a7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-07-08 22:07:16", "repo_name": "hendisantika/sekolah", "sub_path": "/src/main/java/com/hendisantika/sekolah/security/AuthenticationFailureHandler.java", "file_name": "AuthenticationFailureHandler.java", "file_ext": "java", "file_size_in_byte": 1276, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "87dd52d7277b89d690c4cc3d546b3c2b2e171162", "star_events_count": 18, "fork_events_count": 9, "src_encoding": "UTF-8"} | https://github.com/hendisantika/sekolah | 218 | FILENAME: AuthenticationFailureHandler.java | 0.216012 | package com.hendisantika.sekolah.security;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler;
import java.io.IOException;
/**
* Created by IntelliJ IDEA.
* Project : sekolah
* User: hendisantika
* Email: hendisantika@gmail.com
* Telegram : @hendisantika34
* Date: 21/03/20
* Time: 06.39
*/
public class AuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler {
@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
AuthenticationException exception) throws IOException {
String errorMessage = "failed login attempt. invalid username or password";
if (exception.getMessage().equalsIgnoreCase("blocked")) {
errorMessage = "you have been blocked for 3 unsuccessful login attempt";
}
System.out.println("path " + request.getPathInfo());
response.sendRedirect(request.getPathInfo());
}
} |
33e3f1ac-f37f-46c9-ada7-b4c403e12bef | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-06-26 13:29:12", "repo_name": "iconmaster5326/HPPPlus", "sub_path": "/src/com/iconmaster/hppplus/link/LinkSpaceGlobal.java", "file_name": "LinkSpaceGlobal.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "1e6e5c37d505097703bf9247d352991faa2d4b66", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/iconmaster5326/HPPPlus | 208 | FILENAME: LinkSpaceGlobal.java | 0.264358 |
package com.iconmaster.hppplus.link;
import java.util.HashMap;
/**
*
* @author iconmaster
*/
public class LinkSpaceGlobal extends LinkSpace implements Directable {
private final HashMap<String,FunctionPrototype> functions = new HashMap<>();
public LinkSpaceGlobal() {
super();
}
public void addFunction(FunctionPrototype func) {
functions.put(func.getName(), func);
}
@Override
public String toString() {
StringBuilder s = new StringBuilder("[G. LINKSPACE: ");
s.append("\n\tVariables:");
for (VariablePrototype var : this.vars.values()) {
s.append("\n\t\t");
s.append(var.toString().replace("\n", "\n\t"));
}
s.append("\n\tFunctions:");
for (FunctionPrototype func : this.functions.values()) {
s.append("\n\t\t");
s.append(func.toString().replace("\n", "\n\t"));
}
s.append("\n]");
return s.toString();
}
}
|
bb8f5315-182e-4477-93aa-ae22ee932f0e | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-18 07:47:46", "repo_name": "pmarkotan/startmedsol-prototype", "sub_path": "/src/main/java/hu/paninform/startmedsol/service/mapper/DictionaryItemMapper.java", "file_name": "DictionaryItemMapper.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "949e3cdbfa40ab8ad3d84a6c61390e5db24561c1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pmarkotan/startmedsol-prototype | 211 | FILENAME: DictionaryItemMapper.java | 0.250913 | package hu.paninform.startmedsol.service.mapper;
import hu.paninform.startmedsol.domain.*;
import hu.paninform.startmedsol.service.dto.DictionaryItemDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link DictionaryItem} and its DTO {@link DictionaryItemDTO}.
*/
@Mapper(componentModel = "spring", uses = {})
public interface DictionaryItemMapper extends EntityMapper<DictionaryItemDTO, DictionaryItem> {
@Mapping(target = "dictionaryTranslations", ignore = true)
@Mapping(target = "removeDictionaryTranslations", ignore = true)
@Mapping(target = "removeParent", ignore = true)
@Mapping(target = "children", ignore = true)
@Mapping(target = "removeChildren", ignore = true)
DictionaryItem toEntity(DictionaryItemDTO dictionaryItemDTO);
default DictionaryItem fromId(Long id) {
if (id == null) {
return null;
}
DictionaryItem dictionaryItem = new DictionaryItem();
dictionaryItem.setId(id);
return dictionaryItem;
}
}
|
9999298f-5966-49dd-96a9-99563ef347e7 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-13 13:37:45", "repo_name": "kelvas8/APIChat", "sub_path": "/src/chat/MainThread.java", "file_name": "MainThread.java", "file_ext": "java", "file_size_in_byte": 1174, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "111d3ba01928f41745b7ee156a403ff1d3fa7b7f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kelvas8/APIChat | 220 | FILENAME: MainThread.java | 0.288569 | package chat;
import chat.client.Client;
import chat.server.Server;
import java.io.*;
import java.util.ArrayList;
public class MainThread {
public static void threads() {
Files data = new Files();
ArrayList<String> contacts = data.read("contacts.json");
new Thread (new Server()).start();
Client client = new Client(contacts);
client.runClient();
}
}
class Files {
public ArrayList<String> read(String input) {
String separator = File.separator;
String path = "src"+separator+"chat"+separator+"data"+separator+input;
FileReader file = null;
try {
file = new FileReader(path);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
BufferedReader buffer = new BufferedReader(file);
String str;
ArrayList<String> list = new ArrayList<String>();
try {
while ((str = buffer.readLine()) != null) {
list.add(str);
}
buffer.close();
} catch (IOException e) {
e.printStackTrace();
}
return list;
}
} |
4521c0b7-4bea-44d3-912c-77d9e145869a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-12-16 23:04:20", "repo_name": "stefan2212/Week8", "sub_path": "/src/main/java/org/stefan/services/StudentService.java", "file_name": "StudentService.java", "file_ext": "java", "file_size_in_byte": 1015, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "574b9596aaf34fb12cbc698b8b73577d88a841f2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/stefan2212/Week8 | 207 | FILENAME: StudentService.java | 0.259826 | package org.stefan.services;
import org.stefan.dao.StudentDAO;
import org.stefan.entities.Student;
import org.stefan.entities.StudentsProject;
import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.Stateless;
import java.util.List;
@Stateless
@Local
public class StudentService {
private static StudentService studentService;
@EJB
private StudentDAO studentDAO;
public StudentService() {
}
public synchronized static StudentService getInstance() {
if (studentService == null) {
studentService = new StudentService();
}
return studentService;
}
public List<Student> findAll() {
return studentDAO.findAll();
}
public List<Student> getUnallocatedStudent() {
return studentDAO.findUnallocatedStudent();
}
public List<String> getProjectsWithStudentPreference() {
return studentDAO.findProjectWithStudentPreference();
}
public void populate() {
studentDAO.populate();
}
}
|
a8cc0004-85c7-4450-b8ef-c81f3cf151e2 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-21 05:42:37", "repo_name": "Zxnui/BusTicket", "sub_path": "/app/src/main/java/cn/zxnui/www/busticket/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1229, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "6f9bc44b86e5ea2453e37f07ceb9f9a31edcffac", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Zxnui/BusTicket | 225 | FILENAME: MainActivity.java | 0.246533 | package cn.zxnui.www.busticket;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import java.io.InputStream;
import cn.zxnui.www.busticket.util.PicEdit;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void updatePic(View view){
ImageView image = (ImageView) findViewById(R.id.image_pic);
}
public void getPicByMess(View v){
EditText firstNum =(EditText) findViewById(R.id.first_num);
EditText time =(EditText) findViewById(R.id.second_num);
EditText bus_num =(EditText) findViewById(R.id.three_num);
Intent intent = new Intent(MainActivity.this,TicketActivity.class);
intent.putExtra("num",firstNum.getText().toString());
intent.putExtra("time",time.getText().toString());
intent.putExtra("busNum",bus_num.getText().toString());
startActivity(intent);
}
}
|
495c54a4-8123-4aa3-a22d-556385dd1de4 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-11-23 10:55:28", "repo_name": "bilson2014/ppwDubboProviderService", "sub_path": "/src/main/java/com/paipianwang/pat/facade/team/service/dao/impl/PmsCityDaoImpl.java", "file_name": "PmsCityDaoImpl.java", "file_ext": "java", "file_size_in_byte": 999, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "2d477fcdbbb05c07c54bb2f006d39bb89d4437b6", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bilson2014/ppwDubboProviderService | 224 | FILENAME: PmsCityDaoImpl.java | 0.259826 | package com.paipianwang.pat.facade.team.service.dao.impl;
import java.util.List;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.paipianwang.pat.common.core.dao.impl.BaseDaoImpl;
import com.paipianwang.pat.facade.team.entity.PmsCity;
import com.paipianwang.pat.facade.team.service.dao.PmsCityDao;
@Repository
public class PmsCityDaoImpl extends BaseDaoImpl<PmsCity> implements PmsCityDao {
public static final String SQL_FIND_CITY_BY_PROVINCEID= "findCitysByProvinceId";
public static final String SQL_GETALL= "getAll";
@Autowired
private SqlSessionTemplate sessionTemplate = null;
@Override
public List<PmsCity> findCitysByProvinceId(String provinceId) {
return sessionTemplate.selectList(getStatement(SQL_FIND_CITY_BY_PROVINCEID), provinceId);
}
@Override
public List<PmsCity> getAll() {
return sessionTemplate.selectList(getStatement(SQL_GETALL));
}
}
|
ac7cd5f2-6fc3-491d-a7e3-9f6a6ea4b149 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-17 00:03:24", "repo_name": "kingvictorr/spring-demo", "sub_path": "/src/main/java/com/example/demo/configs/MongoConfig.java", "file_name": "MongoConfig.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "45c9187c94a4a5a1654c85c40c42c76e4f80a6da", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kingvictorr/spring-demo | 201 | FILENAME: MongoConfig.java | 0.224055 | package com.example.demo.configs;
import com.mongodb.ConnectionString;
import com.mongodb.MongoClientSettings;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
@Configuration
@EnableMongoRepositories(basePackages = "com.example.demo.repo")
public class MongoConfig {
/**
* This function is responsible for instantiating and initializing a mongodb client.
* @return
*/
@Bean
public MongoClient mongo() {
ConnectionString connectionString = new ConnectionString("mongodb://localhost:27017/test");
MongoClientSettings mongoClientSettings = MongoClientSettings.builder()
.applyConnectionString(connectionString)
.build();
return MongoClients.create(mongoClientSettings);
}
@Bean
public MongoTemplate mongoTemplate() throws Exception {
return new MongoTemplate(mongo(), "test");
}
}
|
fb01413e-3ae0-429b-b37b-d9e1aad4e77f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-03 17:13:38", "repo_name": "Ravaelles/Atlantis", "sub_path": "/src/atlantis/debug/tweaker/ParamTweaker.java", "file_name": "ParamTweaker.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "954d3af26c6065eaee181be7b464625633ff7dd6", "star_events_count": 63, "fork_events_count": 17, "src_encoding": "UTF-8"} | https://github.com/Ravaelles/Atlantis | 212 | FILENAME: ParamTweaker.java | 0.282988 | package atlantis.debug.tweaker;
import java.util.ArrayList;
public class ParamTweaker {
protected static ParamTweaker tweaker = null;
private ArrayList<Param> params = new ArrayList<>();
// =========================================================
protected ParamTweaker() { }
// =========================================================
protected void initParamValues() {
try {
for (Param param : params) {
param.setterCallable().call();
System.out.println("Randomized `" + param.name() + "` with " + param.getterCallable().call());
}
} catch (Exception e) {
e.printStackTrace();
}
}
// =========================================================
public static ParamTweaker get() {
if (tweaker == null) {
throw new RuntimeException("ParamTweaker has not been initialized.");
}
return tweaker;
}
public void addParam(Param param) {
params.add(param);
}
public ArrayList<Param> params() {
return params;
}
}
|
79bc14ba-5cba-403f-a833-f78ace9b8f24 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-18 07:58:05", "repo_name": "githubhuangyaohui/lan108-admin", "sub_path": "/src/main/java/com/persistenthuang/lan108admin/interceptor/LoginInterceptor.java", "file_name": "LoginInterceptor.java", "file_ext": "java", "file_size_in_byte": 1253, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "f8d663500fff64aafc62940eec6b860ae4e6a0b8", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/githubhuangyaohui/lan108-admin | 229 | FILENAME: LoginInterceptor.java | 0.225417 | package com.persistenthuang.lan108admin.interceptor;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Slf4j
public class LoginInterceptor implements HandlerInterceptor {
//登录拦截器
@Override
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) {
Subject subject = null;
try {
// 放行 options 请求,否则无法让前端带上自定义的 header 信息,
// 导致 sessionID 改变,shiro 验证失败
if (HttpMethod.OPTIONS.toString().equals(httpServletRequest.getMethod())) {
httpServletResponse.setStatus(HttpStatus.NO_CONTENT.value());
return true;
}
subject = SecurityUtils.getSubject();
// 使用 shiro 验证
} catch (Exception e) {
}
return subject.isAuthenticated() || subject.isRemembered();
}
}
|
20e07638-c3b1-4e7d-a3b9-e5a42fde4f10 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2022-04-05 20:09:11", "repo_name": "JRebirth/JRebirth", "sub_path": "/org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/beans/StackConfig.java", "file_name": "StackConfig.java", "file_ext": "java", "file_size_in_byte": 1043, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "5611944ad4d08a2ffc5bf33f76347a2d06624618", "star_events_count": 64, "fork_events_count": 32, "src_encoding": "UTF-8"} | https://github.com/JRebirth/JRebirth | 227 | FILENAME: StackConfig.java | 0.262842 | package org.jrebirth.af.component.ui.beans;
import org.jrebirth.af.component.ui.stack.PageEnum;
import org.jrebirth.af.component.ui.stack.StackModel;
import org.jrebirth.af.core.ui.object.ModelConfig;
public class StackConfig extends ModelConfig<StackModel, StackConfig> {
private String stackName;
private Class<? extends PageEnum> pageEnumClass;
public StackConfig() {
super(StackModel.class);
}
public StackConfig(Class<StackModel> modelClass) {
super(modelClass);
}
public static StackConfig create() {
return new StackConfig(StackModel.class);
}
public String stackName() {
return stackName;
}
public StackConfig stackName(String stackName) {
this.stackName = stackName;
return this;
}
public Class<? extends PageEnum> pageEnumClass() {
return pageEnumClass;
}
public StackConfig pageEnumClass(Class<? extends PageEnum> pageEnumClass) {
this.pageEnumClass = pageEnumClass;
return this;
}
}
|
4835799e-824c-4312-9384-ee789438459c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-17 07:35:21", "repo_name": "rearcherr/soa-exp1.3", "sub_path": "/test/weatheService.java", "file_name": "weatheService.java", "file_ext": "java", "file_size_in_byte": 1166, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "3769990f0034df2d53a40891b007f2160a8293e2", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rearcherr/soa-exp1.3 | 224 | FILENAME: weatheService.java | 0.233706 | import client.WeatherWebServiceLocator;
import client.WeatherWebServiceSoap_PortType;
import com.sun.org.apache.xml.internal.serialize.OutputFormat;
import jdk.internal.util.xml.impl.XMLWriter;
import javax.swing.text.Document;
import javax.xml.rpc.ServiceException;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.rmi.RemoteException;
public class weatheService {
public static void main(String[] args) {
try {
// 1.创建Locator对象,相当于传统服务的类或者是库
WeatherWebServiceLocator weatherWebServiceLocator = new WeatherWebServiceLocator();
// 2.获取port,相当于传统类或库的方法接口
WeatherWebServiceSoap_PortType wwsp = weatherWebServiceLocator.getWeatherWebServiceSoap();
// 3.通过port调用服务
String[] weather = wwsp.getWeatherbyCityName("长沙");
// 4.打印获得的结果
for (String info : weather) {
System.out.println(info);
}
}catch (ServiceException | RemoteException ex){
ex.printStackTrace();
}
}
}
|
7b5012a6-165e-41f5-abd4-4003bea00006 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-01 10:06:38", "repo_name": "SheenGitHub/testfirstjava", "sub_path": "/src/main/java/sample/crawler/DownLoadCall.java", "file_name": "DownLoadCall.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "4c00a5ceb2ee503c3ead4cf428ddd9fd9c42e85b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SheenGitHub/testfirstjava | 237 | FILENAME: DownLoadCall.java | 0.282196 | package sample.crawler;
import com.sun.webkit.network.URLs;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.*;
/**
* Created by Administrator on 2016/7/13.
*/
public class DownLoadCall implements Callable<String> {
private URL url;
public DownLoadCall(URL url) {
this.url = url;
}
@Override
public String call() throws Exception {
String content = null;
return content;
}
public static void main(String[] args) throws ExecutionException, InterruptedException {
List<URL> urls = new ArrayList<>();
int threads = 4;
ExecutorService executorService = Executors.newFixedThreadPool(4);
Set<Future<String>> set =new HashSet<>();
for (final URL url : urls) {
DownLoadCall task = new DownLoadCall(url);
Future<String> future = executorService.submit(task);
set.add(future);
}
for (Future<String> future : set) {
String content =future.get();
}
}
}
|
fc5662e3-d5a4-4ab3-a16a-f298239384cb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2021-03-21T16:01:02", "repo_name": "SomeJavaGuy/analog-nfthack", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1050, "line_count": 13, "lang": "en", "doc_type": "text", "blob_id": "0ad137b6ff44820e2f6e47f50a46ab27f0a21fd4", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SomeJavaGuy/analog-nfthack | 260 | FILENAME: README.md | 0.26588 | ## ETHGlobal NFTHack Project
# ANALOG NFTs – NFT platform designed for film photographers

## Description
This platform developed using the Zora protocol enables film photographers from all around the world to store film scans as NFTs on the Ethereum blockchain. Just like how one frame captured on film is forever unique, its digital version will be equally unique on the blockchain.
## How It's Made
This Vue.js web app is using the Zora protocol to mint, sell and exchange NFT tokens. Accounts that minted through this NFT platform are stored in a Firebase Firestore database for indexing. After the NFT is minted, a webhook will be triggered by Parsiq's smart trigger which monitors the Transfer() events of the NFT smart contract and returns the newly minted token ID. This way, even if the user leaves the website before the transaction gets confirmed, the database will be updated with the newly created ID by a web hook.
|
59c99d0c-bcd8-4c25-98fb-d601955e67e6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-03-26 06:38:36", "repo_name": "Cartrogen/REST-API-Springboot", "sub_path": "/src/main/java/com/restful/restapi/controller/Controller.java", "file_name": "Controller.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "62391e6798a5e223f2b3c403bbb425dde3a3d9d7", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Cartrogen/REST-API-Springboot | 221 | FILENAME: Controller.java | 0.262842 | package com.restful.restapi.controller;
import com.restful.restapi.entities.Courses;
import com.restful.restapi.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
public class Controller {
@Autowired
private CourseService courseService;
@GetMapping("/courses")
public List<Courses> getCourses() {
return courseService.getCourses();
}
@GetMapping("/specificCourse/{courseID}")
public Courses getSpecificCourse(@PathVariable String courseID) {
return courseService.getSpecificCourse(Long.parseLong(courseID));
}
@PostMapping("/addCourse")
public String addCourse(@RequestBody Courses course) {
return courseService.addCourse(course);
}
@DeleteMapping("/deleteCourse/{courseID}")
public String deleteCourse(@PathVariable String courseID) {
return courseService.deleteCourse(Long.parseLong(courseID));
}
@PutMapping("/updateCourse")
public String updateCourse(@RequestBody Courses course) {
return courseService.updateCourse(course);
}
}
|
35564cdc-2580-4d23-9b5e-d5bae588fdb5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-01-21 19:52:18", "repo_name": "ruiBarbosa03/dissertation", "sub_path": "/Hydrofox - App/app/src/main/java/com/example/utilizador/dissertation_hydrofox/RegisterRequest.java", "file_name": "RegisterRequest.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "31af5b3353e3cbc2bff8910278f7a0af827398bf", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/ruiBarbosa03/dissertation | 213 | FILENAME: RegisterRequest.java | 0.233706 | package com.example.utilizador.dissertation_hydrofox;
import com.android.volley.Response;
import com.android.volley.toolbox.StringRequest;
import java.util.HashMap;
import java.util.Map;
public class RegisterRequest extends StringRequest {
private static final String REGISTER_REQUEST_URL = "https://paginas.fe.up.pt/~ee12014/sigfoxDatabase/registerUser.php";
private Map<String, String> params;
public RegisterRequest(String login, String password, String username, String deviceID, String phonenumber, /*int firstread,*/ Response.Listener<String> listener){
super(Method.POST, REGISTER_REQUEST_URL, listener, null);
params = new HashMap<>();
params.put("login", login);
params.put("password", password);
params.put("deviceID", deviceID);
params.put("username", username);
params.put("phone", phonenumber);
//params.put("firstread", firstread);
}
@Override
public Map<String,String> getParams(){
return params;
}
}
|
1925658a-1199-4f6b-968a-3771d8fb3b27 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-14 09:41:53", "repo_name": "MichaelGeurts/Supermarkt", "sub_path": "/src/main/java/nl/yacht/supermarkt/Product.java", "file_name": "Product.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "bc628dec4c11c1381a152ad5e72d46ed5dd3917b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/MichaelGeurts/Supermarkt | 221 | FILENAME: Product.java | 0.249447 | package nl.yacht.supermarkt;
import java.util.ArrayList;
import java.util.List;
public class Product {
public String name;
public double price;
public int numberOfProducts;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public int getNumberOfProducts() {
return numberOfProducts;
}
public void setNumberOfProducts(int numberOfProducts) {
this.numberOfProducts = numberOfProducts;
}
public Product(String name, double price, int numberOfProducts) {
this.name = name;
this.price = price;
this.numberOfProducts = numberOfProducts;
Supermarket.addProductToInventory(this);
}
@Override
public String toString() {
return "Product{" +
"name='" + name + '\'' +
", price=" + price +
", numberOfProducts=" + numberOfProducts +
'}';
}
}
|
bd86c594-b301-4b8b-a765-aeaaba4c3759 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-03 09:26:07", "repo_name": "liusunGitHub/MeiChat", "sub_path": "/app/src/main/java/com/guosun/meichat/fragment/TabRecommendFragment.java", "file_name": "TabRecommendFragment.java", "file_ext": "java", "file_size_in_byte": 1230, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "e94d8559a8cf3dc654620cf28529bc123b5288fc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liusunGitHub/MeiChat | 237 | FILENAME: TabRecommendFragment.java | 0.23793 | package com.guosun.meichat.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import com.guosun.meichat.R;
public class TabRecommendFragment extends BackHandFragment{
public static TabRecommendFragment newInstance() {
TabRecommendFragment recommendFragment = new TabRecommendFragment();
Bundle bundle = new Bundle();
recommendFragment.setArguments(bundle);
return recommendFragment;
}
@Override
protected void initLazyView(@Nullable Bundle savedInstanceState) {
if (savedInstanceState == null) {
// ShopFragment是flow包里的
loadRootFragment(R.id.fl_recommend_container, RecommendFragment.newInstance());
} else { // 这里可能会出现该Fragment没被初始化时,就被强杀导致的没有load子Fragment
if (findChildFragment(RecommendFragment.class) == null) {
loadRootFragment(R.id.fl_recommend_container, RecommendFragment.newInstance());
}
}
}
@Override
protected int getRootLayoutId() {
return R.layout.tab_fragment_recommend;
}
@Override
protected void initUI(View view) {
}
}
|
98e7d94f-ea3d-4b41-beb8-ba320498612a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-09-06 11:31:28", "repo_name": "wubabalubab/TextViewer", "sub_path": "/app/src/main/java/com/example/basic/APSTSViewPager.java", "file_name": "APSTSViewPager.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "089084f410fec0e0fe17d262360fd9492464962c", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wubabalubab/TextViewer | 244 | FILENAME: APSTSViewPager.java | 0.290176 | package com.example.basic;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import androidx.viewpager.widget.ViewPager;
/**
* Created by linhonghong on 2015/8/10.
*/
public class APSTSViewPager extends ViewPager {
private boolean mNoFocus = false; //if true, keep View don't move
public APSTSViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
public APSTSViewPager(Context context){
this(context,null);
}
public boolean onInterceptTouchEvent(MotionEvent event) {
if (mNoFocus) {
return false;
}
return !noScroll && super.onInterceptTouchEvent(event);
}
private boolean noScroll = true;
@Override
public boolean onTouchEvent(MotionEvent event) {
/* return false;//super.onTouchEvent(arg0); */
switch(event.getAction()){
}
return !noScroll && super.onTouchEvent(event);
}
public void setNoScroll(boolean b){
noScroll = b;
}
public void setNoFocus(boolean b){
mNoFocus = b;
}
} |
5e3953ca-1cab-4e53-b460-b1f8e923cd84 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-12-23 18:26:06", "repo_name": "lachgar/ServerProject", "sub_path": "/Desktop/webStorage1/src/java/service/EmployeService.java", "file_name": "EmployeService.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 43, "lang": "en", "doc_type": "code", "blob_id": "1b89fe1978ba03061c2248709dbf870d5a32e221", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lachgar/ServerProject | 198 | FILENAME: EmployeService.java | 0.285372 | package service;
import beans.Employe;
import java.util.List;
import org.hibernate.HibernateError;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import util.HibernateUtil;
/*
* 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.
*/
/**
*
* @author a
*/
public class EmployeService {
public boolean create(List<Employe> emps) {
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
tx = session.beginTransaction();
for (Employe e : emps) {
session.save(e);
}
tx.commit();
return true;
} catch (HibernateException e) {
if (tx != null) {
tx.rollback();
}
return false;
}
}
}
|
2b824b5b-f281-4c2c-a7f5-139c44341f99 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-29 12:37:47", "repo_name": "djblackett/bill-splitter", "sub_path": "/splitter/Person.java", "file_name": "Person.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "26da4ebb473e20697a55f0ae587f279f1a43dbfc", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/djblackett/bill-splitter | 250 | FILENAME: Person.java | 0.293404 | package splitter;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;
public class Person {
private String name;
private int balance;
// Key is the date of transaction Object[] has 2 elements - otherPerson, amount (+ for borrowed, - for repayment)
private Map<LocalDate, Object[]> transactions = new HashMap<>();
// final solution for this stage didn't end up using the person's balance field
public Person(String name) {
this.name = name;
this.balance = 0;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getBalance() {
return balance;
}
public void setBalance(int balance) {
this.balance = balance;
}
public Map<LocalDate, Object[]> getTransactions() {
return transactions;
}
public void setTransactions(Map<LocalDate, Object[]> transactions) {
this.transactions = transactions;
}
// @Override
// public String toString() {
// return "Person{" +
// "name='" + name + '\'' +
// '}';
// }
}
|
4497231e-098d-4dad-8439-34dd82bd78ea | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2018-09-05T05:55:21", "repo_name": "dtruong11/onearc_node", "sub_path": "/readme.md", "file_name": "readme.md", "file_ext": "md", "file_size_in_byte": 1179, "line_count": 38, "lang": "en", "doc_type": "text", "blob_id": "34f0090c81032f83e5a19cd7aa51c8b34e846d7a", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dtruong11/onearc_node | 285 | FILENAME: readme.md | 0.267408 | # pump-up-the-volunteers-server
This repository is the backend for the react-native application for onearc, a result of AngelHack hackathon in Seattle, WA.
* This application allows users to stay safe and seek help during disaster.
* Users can report dangerours incidents around their neigborhood and view an interactive map of warnings and help requests.
* Users can also offer help or seek help from the community.
## Author
* Diep Truong
Students at [Galvanize](https://galvanize.com)
## Built With
* HTML/CSS/JavaScript
* Heroku, Surge
* Express
* NodeJS
* Materialize
* [BootStrap](http://www.getbootstrap.com/) - HTML/CSS Framework
* [Browserify](https://http://browserify.org/) - Used to provide require and build bundle.js
* [axios](https://www.npmjs.com/package/axios) - Promise based client for the browser and node.js
* [Moment.JS](https://momentjs.com/timezone/) - Parse & display dates/times properly.
## Installation
To install & run locally for development:
* fork this repo
* git clone
* npm install
* create .env file like the .env-sample.md
* npm run dev (run server)
* Use postman to test the routes
|
6850ed6b-9900-4bcc-a4de-4c7f340b2db5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-03-18 05:35:38", "repo_name": "NavjotPanesar/IRCu", "sub_path": "/app/src/main/java/ircu/navjotpanesar/com/ircu/models/SystemMessage.java", "file_name": "SystemMessage.java", "file_ext": "java", "file_size_in_byte": 991, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "0ca44dd248db869b3f5065c42f131821e5295934", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NavjotPanesar/IRCu | 198 | FILENAME: SystemMessage.java | 0.224055 | package ircu.navjotpanesar.com.ircu.models;
import ircu.navjotpanesar.com.ircu.pircbot.ChannelItem;
/**
* Created by Navjot on 6/24/2015.
*/
public class SystemMessage extends BaseMessage{
public enum SystemMessageType{
INFO,
TOPIC,
JOIN,
LEAVE
}
private SystemMessageType systemMessageType;
public SystemMessage(ChannelItem channel, SystemMessageType systemMessageType, String message) {
super(channel, message);
this.systemMessageType = systemMessageType;
}
public String getInfoType(){
switch(systemMessageType){
case INFO:
return "Info:";
case TOPIC:
return "Topic changed to";
case JOIN:
return "";
case LEAVE:
return "";
default:
return "";
}
}
@Override
public MessageType getMessageType() {
return MessageType.SYSTEM;
}
}
|
d659f8f8-ea85-430c-9292-480ab25205d9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-04-02T07:05:08", "repo_name": "iqbalprabu/FoodRecipes-Eudeka", "sub_path": "/app/src/main/java/com/osg31/resepmakanan/viewmodel/ListMealViewModel.java", "file_name": "ListMealViewModel.java", "file_ext": "java", "file_size_in_byte": 1038, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "6d11f2a5753eb38b2c64fe13a89ebd5d0e30e106", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/iqbalprabu/FoodRecipes-Eudeka | 220 | FILENAME: ListMealViewModel.java | 0.247987 | package com.osg31.resepmakanan.viewmodel;
import com.osg31.resepmakanan.data.MealDataSource;
import com.osg31.resepmakanan.data.MealRepository;
import com.osg31.resepmakanan.model.Meals;
import com.osg31.resepmakanan.navigator.MealNavigator;
public class ListMealViewModel {
private MealRepository mealRepository;
private MealNavigator mealNavigator;
public ListMealViewModel(MealRepository mealRepository) {
this.mealRepository = mealRepository;
}
public void setNavigator(MealNavigator navigator) {
mealNavigator = navigator;
}
public void getListMeal(String search) {
mealRepository.getAllMeals(search, new MealDataSource.GetMealCallback() {
@Override
public void onMealLoaded(Meals data) {
mealNavigator.loadListMeal(data.getMeals());
}
@Override
public void onDataNotAvailable(String errorMessage) {
mealNavigator.onErrorLoadMeal(errorMessage);
}
});
}
}
|
9c9ee9ed-b97c-4ad6-8e09-bcca4ae18a4c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-13 11:58:06", "repo_name": "zhangjingao/algorithm", "sub_path": "/leetcode/src/随笔/lambda/InterfaceImpl.java", "file_name": "InterfaceImpl.java", "file_ext": "java", "file_size_in_byte": 1191, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "f93195f94a763161f80bb55656aa2e65e0d07176", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/zhangjingao/algorithm | 241 | FILENAME: InterfaceImpl.java | 0.282196 | package 随笔.lambda;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import java.util.function.Predicate;
/**
* 测试java8默认实现
* @author zjg
* <p> 2019/5/17 8:31 </p>
*/
public class InterfaceImpl {
// implements InterfaceTest{
public static void main(String[] args) {
FutureTask futureTask = new FutureTask(new Callable() {
@Override
public Object call() throws Exception {
System.out.println("sd");
return null;
}
});
futureTask.run();
// new InterfaceImpl().test();
// String mess = "mess";
InterfaceTest interfaceTest = "s"::equals;
System.out.println(interfaceTest.funcationInterface("ssdsd"));
System.out.println(interfaceTest.funcationInterface("s"));
}
}
interface InterfaceTest {
Object funcationInterface(String mess);
default void test(){
System.out.println("default method");
}
}
class test implements Callable {
@Override
public Object call() throws Exception {
return null;
}
} |
0129a2db-5e18-4463-a97e-0a7b9dba1fce | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-23 22:13:29", "repo_name": "erikorbons/hurricane-old", "sub_path": "/core/src/main/java/hurricane/core/rdf/literals/UnknownLiteral.java", "file_name": "UnknownLiteral.java", "file_ext": "java", "file_size_in_byte": 1050, "line_count": 46, "lang": "en", "doc_type": "code", "blob_id": "6a2fd50ebc125b7cfd5f022661a0a61e9d261be1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/erikorbons/hurricane-old | 250 | FILENAME: UnknownLiteral.java | 0.242206 | package hurricane.core.rdf.literals;
import hurricane.core.iri.IriReference;
import hurricane.core.rdf.Literal;
import java.util.Objects;
public final class UnknownLiteral implements Literal {
private final IriReference iri;
private final String lexicalForm;
public UnknownLiteral(final IriReference iri, final String lexicalForm) {
this.iri = Objects.requireNonNull(iri, "iri cannot be null");
this.lexicalForm = Objects.requireNonNull("lexicalForm cannot be null");
}
@Override
public String getLexicalForm() {
return lexicalForm;
}
@Override
public IriReference getDataTypeIri() {
return iri;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UnknownLiteral that = (UnknownLiteral) o;
return Objects.equals(iri, that.iri) &&
Objects.equals(lexicalForm, that.lexicalForm);
}
@Override
public int hashCode() {
return Objects.hash(iri, lexicalForm);
}
}
|
f659207e-2fc5-4fec-be43-6c639bdd7c26 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-12 08:48:40", "repo_name": "liyongmign/gaodemap", "sub_path": "/gaode-amap/src/main/java/com/mly/lib/amap/utils/MapUtils.java", "file_name": "MapUtils.java", "file_ext": "java", "file_size_in_byte": 1083, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "6d234955cfd45f55a390c394599191d2237ddd7d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liyongmign/gaodemap | 233 | FILENAME: MapUtils.java | 0.221351 | package com.mly.lib.amap.utils;
import android.Manifest;
import android.app.Activity;
/**
* Created by lym on 2018/1/24.
* <p>
* 地图工具类
*/
public class MapUtils {
private static MapUtils instance;
private MapUtils() {
}
private static MapUtils getInstance() {
if (instance == null) {
synchronized (MapUtils.class) {
if (instance == null) {
instance = new MapUtils();
}
}
}
return instance;
}
/**
* 地图使用权限请求
* @param activity
*/
public static void chechMapPermission(Activity activity) {
String[] permissions=new String[]{
Manifest.permission.ACCESS_FINE_LOCATION
};
}
/**
* 地图使用权限请求监听
*/
public interface OnMapPermissionListener {
/**
* 地图权限通过
*/
void onMapPermissionChecked();
/**
* 地图权限不通过
*/
void onMapPermissionRefused();
}
}
|
7159cd1f-f788-4b19-abd5-c2aa67b4db6f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-05-26 18:42:01", "repo_name": "vidalfontoura/ufpr-cbio", "sub_path": "/src/main/java/org/ufpr/cbio/poc/view/Visualization.java", "file_name": "Visualization.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 48, "lang": "en", "doc_type": "code", "blob_id": "37b8fbce2de0582cb29ac2dccccea11d5225d140", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vidalfontoura/ufpr-cbio | 245 | FILENAME: Visualization.java | 0.295027 | package org.ufpr.cbio.poc.view;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import org.ufpr.cbio.poc.domain.Protein;
import org.ufpr.cbio.poc.domain.Residue;
@SuppressWarnings("serial")
public class Visualization extends JFrame{
private static Scenario scenario;
private ScenarioController controls;
public Visualization() {
setName("Structure Visualization");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new FlowLayout());
setResizable(false);
scenario = new Scenario(null);
//controls = new ScenarioController();
JScrollPane scroll = new JScrollPane(null, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
scroll.setPreferredSize(new Dimension(448, 448));
scroll.getViewport().add(scenario);
add(scroll);
//add(controls);
pack();
setVisible(true);
}
public void showStructure(Protein protein) {
scenario.setProtein(protein);
}
public static void update() {
scenario.repaint();
}
}
|
ef20efb0-192e-4540-908b-b49f3f7ceb9d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-05 09:06:54", "repo_name": "jensbackvall/KEA-Datamatiker", "sub_path": "/Java Exercises/1st term/week 10/HomeWork_462_14.java", "file_name": "HomeWork_462_14.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "0547e68fc432fbbd3c94472cd5f02022e1cc6c97", "star_events_count": 4, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jensbackvall/KEA-Datamatiker | 221 | FILENAME: HomeWork_462_14.java | 0.294215 | import java.util.*;
import java.io.*;
public class HomeWork_462_14 {
public static void main(String[] args) throws FileNotFoundException {
Scanner input = new Scanner(new File("duplicate.txt"));
while (input.hasNextLine()) {
String stuff = input.nextLine();
printDuplicates(stuff);
}
}
public static void printDuplicates(String stuff) throws FileNotFoundException {
Scanner data = new Scanner(stuff);
String dupl = "";
int count = 1;
while (data.hasNext()) {
String word = data.next();
if (word.equals(dupl)) {
count++;
} else if (count > 1) {
System.out.print(dupl + "*" + count + " ");
count = 1;
} else {
count = 1;
}
dupl = word;
}
if (count > 1) {
System.out.print(dupl + "*" + count + " ");
count = 1;
}
System.out.println();
}
} |
18f2258b-716f-490c-af7b-bb6c1da4ddb1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-12-10T09:18:56", "repo_name": "KarteekM/ABAP_Notepad_plus_plus", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1053, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "47a8771a2018eb25355f031dd10bdaa7a6d2a5a2", "star_events_count": 7, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/KarteekM/ABAP_Notepad_plus_plus | 254 | FILENAME: README.md | 0.256832 | # ABAP for Notepad++
The following XML file is a UDL(User Defined Language) for ABAP in Notepad++.
Importing this file would make Notepad++ identify all the ABAP keywords.
There are already many UDLs available for ABAP. This UDL includes the following features apart from already available ones:
• Modern ABAP keywords.
• RAP(Restful ABAP Programming) keywords.
• Missing keywords in existing UDLs.
# Steps to import:
1) Go to the Menu. Choose Language->User Defined Language->Define your Language.
2) In the "User Defined Language" dialog, click on "Import…".
3) Import the downloaded "abap.xml" file.
4) Now you should see a pop up that "Import is successful".
5) Restart Notepad++. (Sometimes, it might be required). Go to the menu Language and you should be able to see "ABAP" as an option to choose.
# Credit:
Couldn't find original authors who contributed to the base UDL.
# Contribution:
There are many more key words which are still missing. Feel free to contribute by creating a new pull request to keep the UDL updated.
|
91d6c0de-fd32-403a-a5ab-3466e9fb4946 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-02-21 06:13:37", "repo_name": "bololo22/Weather-App", "sub_path": "/app/src/main/java/model/Results.java", "file_name": "Results.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "31350915fd19783a8a2dafac1ae01072d5fbafff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/bololo22/Weather-App | 232 | FILENAME: Results.java | 0.267408 | package model;
/**
* Created by manolofernandez on 9/27/17.
*/
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Results implements Parcelable
{
@SerializedName("channel")
@Expose
private Channel channel;
public final static Parcelable.Creator<Results> CREATOR = new Creator<Results>() {
@SuppressWarnings({
"unchecked"
})
public Results createFromParcel(Parcel in) {
return new Results(in);
}
public Results[] newArray(int size) {
return (new Results[size]);
}
}
;
protected Results(Parcel in) {
this.channel = ((Channel) in.readValue((Channel.class.getClassLoader())));
}
public Results() {
}
public Channel getChannel() {
return channel;
}
public void setChannel(Channel channel) {
this.channel = channel;
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeValue(channel);
}
public int describeContents() {
return 0;
}
}
|
56492d24-7dc3-491e-be23-f1ac66563c99 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-08-22 01:52:15", "repo_name": "leejeongwha/spring-boot-batch", "sub_path": "/src/main/java/com/naver/simple/listener/SimpleJobCompletionNotificationListener.java", "file_name": "SimpleJobCompletionNotificationListener.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "084a4d46cf171f8114df530375312f6581fdfef1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/leejeongwha/spring-boot-batch | 211 | FILENAME: SimpleJobCompletionNotificationListener.java | 0.283781 | package com.naver.simple.listener;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.listener.JobExecutionListenerSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.naver.simple.model.Person;
import com.naver.simple.repository.SimpleRepository;
@Component
public class SimpleJobCompletionNotificationListener extends JobExecutionListenerSupport {
private static final Logger log = LoggerFactory.getLogger(SimpleJobCompletionNotificationListener.class);
@Autowired
private SimpleRepository simpleRepository;
@Override
public void afterJob(JobExecution jobExecution) {
if (jobExecution.getStatus() == BatchStatus.COMPLETED) {
log.info("!!! JOB FINISHED! Time to verify the results");
List<Person> results = simpleRepository.getPersonList();
for (Person person : results) {
log.info("Found <" + person + "> in the database.");
}
}
}
}
|
7ff2ef9f-e307-4100-82c6-c8632830edbb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-30 01:46:50", "repo_name": "LouisWT/Exercise", "sub_path": "/app/src/main/java/com/example/exercise/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1035, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "7fefa10b4756074051fcbb0b9901b4d419339884", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LouisWT/Exercise | 172 | FILENAME: MainActivity.java | 0.226784 | package com.example.exercise;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.ActionBar;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
private Button jumpBtn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
protected void onStart() {
super.onStart();
jumpBtn = findViewById(R.id.start_button);
jumpBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startExercise();
}
});
}
public void startExercise() {
Intent intent = new Intent(this, ExerciseActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.horizontal_slide, R.anim.horizontal_slide_back);
}
} |
a80299e8-ec1e-4ac8-9cb9-5dbad71e109f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-08 23:16:04", "repo_name": "danielkim011029/Mutex_Locks", "sub_path": "/customerClient.java", "file_name": "customerClient.java", "file_ext": "java", "file_size_in_byte": 1048, "line_count": 36, "lang": "en", "doc_type": "code", "blob_id": "83f293c4af05621f5d08e05b63822b43fed627da", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/danielkim011029/Mutex_Locks | 198 | FILENAME: customerClient.java | 0.264358 | import java.io.*;
import java.net.*;
public class customerClient extends Thread{
private int id;
String host;
int port;
public customerClient(String host,int port,int i){
this.host=host;
this.port=port;
id=i;
}
public void run(){
try{
Socket customerSocket=new Socket(host,port);
PrintWriter out =new PrintWriter(customerSocket.getOutputStream(), true);
BufferedReader in =new BufferedReader(new InputStreamReader(customerSocket.getInputStream()));
out.println("customer");
out.println(id);
int methodNumber=0;
String line;
while((line=in.readLine())!=null){
System.out.println("customer-"+id+" :"+line);
if(methodNumber<4){ //send 4 cases but only if they have received it
out.println(methodNumber);
}
methodNumber++;
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
} |
0153458e-d11a-4b0d-940f-81642ef92fc5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-19 12:09:00", "repo_name": "Aadward/Examples", "sub_path": "/zookeeper-demo/src/main/java/com/syh/zookeeper/demo/curator/leader/Candidate.java", "file_name": "Candidate.java", "file_ext": "java", "file_size_in_byte": 1013, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "97018314eab66c145b9be8185a6fe038f10a4482", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Aadward/Examples | 196 | FILENAME: Candidate.java | 0.23793 | package com.syh.zookeeper.demo.curator.leader;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.leader.LeaderSelector;
import org.apache.curator.framework.recipes.leader.LeaderSelectorListenerAdapter;
import java.io.Closeable;
public abstract class Candidate extends LeaderSelectorListenerAdapter
implements Closeable {
private LeaderSelector selector;
public Candidate(CuratorFramework client, String leaderPath) {
selector = new LeaderSelector(client, leaderPath, this);
}
abstract void process();
@Override
public void takeLeadership(CuratorFramework client) throws Exception {
process();
}
public void start() {
//For taking next leadership after releasing leadership.
selector.autoRequeue();
selector.start();
}
@Override
public void close() {
selector.close();
}
public boolean isLeader() {
return selector.hasLeadership();
}
}
|
e1ce1630-1e77-47ce-9e07-80092283077b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-06-11 18:35:57", "repo_name": "dbenac-foresee/okta-query-service", "sub_path": "/src/main/java/com/foresee/users/okta/Application.java", "file_name": "Application.java", "file_ext": "java", "file_size_in_byte": 1025, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "95cceb7862402858ca7c8c41f72e284836910222", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dbenac-foresee/okta-query-service | 177 | FILENAME: Application.java | 0.245085 | package com.foresee.users.okta;
import com.foresee.users.okta.service.UserService;
import com.google.common.base.Stopwatch;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(value = "com.foresee.users.okta")
@Slf4j
public class Application {
public static void main(String[] args) throws Exception {
ConfigurableApplicationContext ctx = new SpringApplicationBuilder(Application.class)
.web(false)
.application()
.run(args);
log.debug("Starting...");
Stopwatch stopwatch = Stopwatch.createStarted();
ctx.getBean(UserService.class).execute();
log.debug( "Took {} to complete", stopwatch);
ctx.close();
System.exit(0);
}
}
|
f5959433-0475-4a5c-b028-73b74880ae86 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-03 07:16:08", "repo_name": "AnnaKayam/GenDNAFinder", "sub_path": "/src/main/java/com/genfinfder/demo/service/DNAFileParser.java", "file_name": "DNAFileParser.java", "file_ext": "java", "file_size_in_byte": 1119, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "0d70a877a65ac907de7dee841a8771ee7f90a809", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/AnnaKayam/GenDNAFinder | 221 | FILENAME: DNAFileParser.java | 0.267408 | package com.genfinfder.demo.service;
import com.genfinfder.demo.repository.IDNARepository;
import com.genfinfder.demo.utilities.GenePatternUtility;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Scanner;
@Component
public class DNAFileParser {
@Autowired
private final IDNARepository repo;
public DNAFileParser(IDNARepository repo) {
this.repo = repo;
}
public void processDNAFile(Scanner scan) {
String prefix = GenePatternUtility.getPrefix();
String fileStartsWithPrefix = scan.findWithinHorizon(prefix, prefix.length());
scan.useDelimiter(prefix);
// if file does not start with PREFIX - ignore all input up until first PREFIX detected.
if (fileStartsWithPrefix == null) {
if (scan.hasNext()) {
scan.next();
}
}
while (scan.hasNext()) {
String gene = scan.next();
if (GenePatternUtility.isPatternWithoutPrefixValid(gene))
repo.insertGene(gene);
}
}
}
|
fd2264ff-e8db-4c6d-860c-db28e777c831 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-03-11 03:41:57", "repo_name": "cfyn/springcloud-frame", "sub_path": "/frame/siwei-common-utils/src/main/java/com/siwei/frame/common/utils/vo/RolePermissionVO.java", "file_name": "RolePermissionVO.java", "file_ext": "java", "file_size_in_byte": 1244, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "a5921144ed19d6fa423651a3ef65af5676d0116f", "star_events_count": 2, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/cfyn/springcloud-frame | 260 | FILENAME: RolePermissionVO.java | 0.224055 | package com.siwei.frame.common.utils.vo;
import com.siwei.frame.common.utils.entity.BaseEntityVO;
import com.siwei.frame.common.utils.entity.Permission;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import java.util.List;
@ApiModel(value = "角色权限")
public class RolePermissionVO extends BaseEntityVO {
@NotNull(message = "角色id不能为空")
@ApiModelProperty(value = "角色id", required = true)
private Integer roleId;
@NotNull(message = "所属系统码不能为空")
@ApiModelProperty(value = "所属系统码", required = true)
private Integer systemCode;
@NotNull(message = "权限不能为空")
@ApiModelProperty(value = "权限", required = true)
private List<Permission> permissions;
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public Integer getSystemCode() {
return systemCode;
}
public void setSystemCode(Integer systemCode) {
this.systemCode = systemCode;
}
public List<Permission> getPermissions() {
return permissions;
}
public void setPermissions(List<Permission> permissions) {
this.permissions = permissions;
}
}
|
b422cc6f-ae07-4974-aee9-0556962e5c60 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-04 17:00:14", "repo_name": "lorenzowind/ProjectHUB", "sub_path": "/app/src/main/java/br/com/lorenzowindmoller/projecthub/service/model/Project/Project.java", "file_name": "Project.java", "file_ext": "java", "file_size_in_byte": 1118, "line_count": 59, "lang": "en", "doc_type": "code", "blob_id": "a0144581247069e51ec0b242a67a7481e20819d1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lorenzowind/ProjectHUB | 228 | FILENAME: Project.java | 0.221351 | package br.com.lorenzowindmoller.projecthub.service.model.Project;
import java.io.Serializable;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
@Entity(tableName = "projects_table")
public class Project implements Serializable {
@PrimaryKey(autoGenerate = true)
private int id;
private int user_id;
private String name;
private String type;
private String description;
private String image;
public Project(int user_id, String name, String type, String description, String image) {
this.user_id = user_id;
this.name = name;
this.type = type;
this.description = description;
this.image = image;
}
public void setId(int id) {
this.id = id;
}
public int getId() {
return id;
}
public int getUser_id() {
return user_id;
}
public String getName() {
return name;
}
public String getType() {
return type;
}
public String getDescription() {
return description;
}
public String getImage() {
return image;
}
}
|
6f2e1642-af85-4422-96f3-bb6eb5416a78 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-01-09 08:32:13", "repo_name": "lyc88/luvx_trial", "sub_path": "/spring-boot-mybatis/src/main/java/org/luvx/entity/User.java", "file_name": "User.java", "file_ext": "java", "file_size_in_byte": 1174, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "af5ec5e3a853c4df63d1ac711b2b57e938aa9aba", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/lyc88/luvx_trial | 259 | FILENAME: User.java | 0.226784 | package org.luvx.entity;
import java.io.Serializable;
public class User implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String userName;
private String passWord;
private Integer age;
public User() {
super();
}
public User(String userName, String passWord, Integer age) {
this.passWord = passWord;
this.userName = userName;
this.age = age;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassWord() {
return passWord;
}
public void setPassWord(String passWord) {
this.passWord = passWord;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
@Override
public String toString() {
return "userName " + this.userName + ", pasword " + this.passWord + "age " + this.age.intValue();
}
} |
79ee2417-d445-4fc4-bf1c-0abc5daa21a5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-12-12 10:55:25", "repo_name": "NoumanBaig/PlanetZoom", "sub_path": "/app/src/main/java/com/angadi/tripmanagementa/models/RegisterResponse.java", "file_name": "RegisterResponse.java", "file_ext": "java", "file_size_in_byte": 991, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "c20f7d98756274d1a8c1c6a58dcf307a25da968e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NoumanBaig/PlanetZoom | 212 | FILENAME: RegisterResponse.java | 0.194368 | package com.angadi.tripmanagementa.models;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class RegisterResponse {
@SerializedName("UID")
@Expose
private Integer uID;
@SerializedName("rand")
@Expose
private Integer rand;
@SerializedName("message")
@Expose
private String message;
@SerializedName("status")
@Expose
private String status;
public Integer getUID() {
return uID;
}
public void setUID(Integer uID) {
this.uID = uID;
}
public Integer getRand() {
return rand;
}
public void setRand(Integer rand) {
this.rand = rand;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
|
b1617eb0-59a7-4f1d-af1d-a495bbe98af9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-14 12:48:08", "repo_name": "Overskyet/AnimationTesting", "sub_path": "/app/src/main/java/com/overskyet/animationtesting/BlankActivity.java", "file_name": "BlankActivity.java", "file_ext": "java", "file_size_in_byte": 1117, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "6ce3a5c947c34770cad0e4f09bae801f55f1a535", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Overskyet/AnimationTesting | 207 | FILENAME: BlankActivity.java | 0.233706 | package com.overskyet.animationtesting;
import androidx.appcompat.app.AppCompatActivity;
import androidx.slidingpanelayout.widget.SlidingPaneLayout;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
public class BlankActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_blank);
SlidingPaneLayout slidingPaneLayout = findViewById(R.id.sliding_pane);
slidingPaneLayout.openPane();
FrameLayout frameLayout = findViewById(R.id.bottomSheet_frame_layout);
// BottomSheetBehavior.from(frameLayout).setHideable(true);
BottomSheetBehavior.from(frameLayout).setPeekHeight(50);
BottomSheetBehavior.from(frameLayout).setState(BottomSheetBehavior.STATE_EXPANDED);
}
@Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(R.anim.fade_out, R.anim.slide_in_down);
}
} |
17f72936-2b22-4b81-9981-18021b4203fc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-21 15:43:07", "repo_name": "rcaso/calendar-app", "sub_path": "/src/main/java/com/shava/calendar/provider/JacksonConfig.java", "file_name": "JacksonConfig.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "b4793e8cffa23030649dc93c5875c899d5b22c6b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/rcaso/calendar-app | 222 | FILENAME: JacksonConfig.java | 0.253861 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.shava.calendar.provider;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
/**
*
* @author raul
*/
@Provider
public class JacksonConfig implements ContextResolver<ObjectMapper> {
private final ObjectMapper objectMapper;
public JacksonConfig() throws Exception {
objectMapper = new ObjectMapper()
.disable( SerializationFeature.WRITE_DATES_AS_TIMESTAMPS )
.disable( SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
.setSerializationInclusion( JsonInclude.Include.NON_NULL )
.registerModule( new JavaTimeModule () );
}
@Override
public ObjectMapper getContext(Class<?> type) {
return objectMapper;
}
}
|
32be1e4d-e511-4701-af15-bba0533c4747 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2020-09-29T01:52:40", "repo_name": "jhernandeztorres/Flutter-Clima", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1010, "line_count": 19, "lang": "en", "doc_type": "text", "blob_id": "84a6b936f7a848a44be749fe7e315b69a027ad57", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/jhernandeztorres/Flutter-Clima | 240 | FILENAME: README.md | 0.172172 | ## Clima Weather App
Simple weather application to check the weather in your location or in another city.
## The App Brewery
This application is part of The App Brewery course on Udemy.com
[Udemy Course](https://www.udemy.com/course/flutter-bootcamp-with-dart/?referralCode=2B7724A180C0502A2547)
## Getting Started
To run this application you will need to setup the environment.
[Flutter.dev](https://flutter.dev/docs/get-started/install) has a simple and easy to follow tutorial
on how to get the environment ready. <br>
Clone the repo to whatever folder you want and open it up in the IDE you most like. <br>
You might need to download some extensions/plugins. (Flutter and Dart)
## Learning
Spend some time changing things. Change the color or change the image. Whatever you do, enjoy it.
## Error
Full transparency - I am having a problem with it crashing on IOS. Android version is working as it should but on IOS when you press the button to get the local weather it will crash. Still debugging that. |
667429c2-a4ae-472b-be35-e1e55c0df7ec | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-03-12 10:39:12", "repo_name": "Xs0079/springBoot-mybatis-manyDatasource-demo", "sub_path": "/src/main/java/com/xs/demo/service/impl/ApiAccessLogServiceImpl1.java", "file_name": "ApiAccessLogServiceImpl1.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 32, "lang": "en", "doc_type": "code", "blob_id": "1a2cc29ecf1bf24e24132c31ffdde6c9d162cced", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/Xs0079/springBoot-mybatis-manyDatasource-demo | 217 | FILENAME: ApiAccessLogServiceImpl1.java | 0.233706 | package com.xs.demo.service.impl;
import com.xs.demo.dao.notice.NoticeAccessLogMapper;
import com.xs.demo.dao.portal.ApiAccessLogMapper;
import com.xs.demo.service.ApiAccessLogService1;
import com.yxp.common.db.entity.apiportal.ApiAccessLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
* ApiAccessLogServiceImpl
* Created by Xs on 2017/11/30.
*/
@Service
public class ApiAccessLogServiceImpl1 implements ApiAccessLogService1 {
@Autowired
private NoticeAccessLogMapper logMapper;
@Override
public ApiAccessLog insert(ApiAccessLog record) {
return null;
}
@Transactional(value = "slaveTransactionManager", propagation = Propagation.REQUIRES_NEW)
public void testTransactional1(ApiAccessLog apiAccessLog) {
logMapper.insertSelective(apiAccessLog);
throw new RuntimeException("123");
}
}
|
40e8c460-069c-4335-925a-186cbb9cbdca | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-12-06 21:15:21", "repo_name": "airbreather/Colorful-Mobs", "sub_path": "/src/main/java/net/epoxide/colorfulmobs/client/EntityUtil.java", "file_name": "EntityUtil.java", "file_ext": "java", "file_size_in_byte": 1054, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "09ba67c65e1918a38f110e8dfcc84aec1838d29f", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/airbreather/Colorful-Mobs | 205 | FILENAME: EntityUtil.java | 0.26588 | package net.epoxide.colorfulmobs.client;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.crash.CrashReport;
import net.minecraft.entity.Entity;
import net.minecraft.util.ReportedException;
public class EntityUtil {
/**
* Used to render an entity without a shadow
*/
public static void renderEntityWithPosYaw (Entity entity, double x, double y, double z, float entityYaw, float partialTicks) {
Render render = RenderManager.instance.getEntityRenderObject(entity);
if (render != null && RenderManager.instance.renderEngine != null) {
if (!render.isStaticEntity()) {
try {
render.doRender(entity, x, y, z, entityYaw, partialTicks);
}
catch (Throwable throwable2) {
throw new ReportedException(CrashReport.makeCrashReport(throwable2, "Rendering entity in world"));
}
}
}
}
}
|
64dc539f-6399-468d-aa09-4cecc2789c20 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-04-05 05:58:36", "repo_name": "RichieJi/liveobject-demo", "sub_path": "/src/main/java/com/fr/third/demo2/Customer.java", "file_name": "Customer.java", "file_ext": "java", "file_size_in_byte": 1114, "line_count": 50, "lang": "en", "doc_type": "code", "blob_id": "9cea4f0e59916aca695f027332bb807d1a20ea1d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/RichieJi/liveobject-demo | 242 | FILENAME: Customer.java | 0.267408 | package com.fr.third.demo2;
import org.redisson.api.annotation.REntity;
import org.redisson.api.annotation.RId;
import org.redisson.liveobject.resolver.UUIDGenerator;
import java.util.List;
@REntity
public class Customer {
@RId(generator = UUIDGenerator.class)
private String id;
private List<Order> orders;
private String name;
private String address;
private String phone;
protected Customer() {
}
public Customer(String id) {
super();
this.id = id;
}
public void setAddress(String address) {
this.address = address;
}
public String getAddress() {
return address;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPhone() {
return phone;
}
public void addOrder(Order order) {
orders.add(order);
}
public List<Order> getOrders() {
return orders;
}
public String getId() {
return id;
}
} |
e41a2cd1-c64e-40a1-97cf-6a8fe517df8b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-08-05 14:07:32", "repo_name": "BengagiAnis/gestion_livrason", "sub_path": "/src/utile/DataConnection.java", "file_name": "DataConnection.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "cbd258d2d2c59f3d538f009412da8235b7cd27c3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/BengagiAnis/gestion_livrason | 221 | FILENAME: DataConnection.java | 0.255344 | /*
* 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 utile;
import com.mysql.jdbc.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author anous
*/
public class DataConnection {
private String url="jdbc:mysql://localhost/elife";
private String login="root";
private String pwd="";
private Connection cnx;
private static DataConnection instance;
private DataConnection(){
try {
cnx=(Connection) DriverManager.getConnection(url, login, pwd);
System.out.println("connect");
} catch (SQLException ex) {
Logger.getLogger(DataConnection.class.getName()).log(Level.SEVERE, null, ex);
}
}
public static DataConnection getInstance(){
if(instance==null)
instance=new DataConnection();
return instance;
}
public Connection getCnx() {
return cnx;
}
}
|
ff08068d-9358-4258-9090-2523401048ff | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-12-14T13:52:40", "repo_name": "gaborveres-planorama/teaching-materials", "sub_path": "/java-spring/ioc-bean/workshop/Workshop02.md", "file_name": "Workshop02.md", "file_ext": "md", "file_size_in_byte": 1229, "line_count": 24, "lang": "en", "doc_type": "text", "blob_id": "72bf21d3e00c9ef19cc8085074ac6946193262d3", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gaborveres-planorama/teaching-materials | 302 | FILENAME: Workshop02.md | 0.284576 | #Workshop02 - Swapping Services through Beans
To get this to work, when you start the project you need to be sure that you've informed IntelliJ that you're working with Spring. Same as last time, but this time you need at least 1 library (but as I'm unsure which one, chose the first 4).
If you didn't select a particular library, there's help here. https://www.jetbrains.com/help/idea/2016.3/enabling-spring-support.html#addFacet
For this exercise, construct the code described in this worked example. http://www.journaldev.com/2410/spring-dependency-injection. You'll need to set up 4 package directories, which we renamed under com.greenfox in the solution:-
- configuration
- consumer
- services
- test
Specifically, copy and paste his solution in and then review the code so you understand it.
Test it, get familiar and then answer the following questions:-
- what does ComponentScan do?
- how does Autowired know what to pick up?
- how would one switch the service to do Twitter instead?
- what happens when you rename a Bean?
- Drawing out the way that one class calls the other with the annotation used to call upon the other.
# Links
[Previous Workshop - ](../Workshop01.md)
[Next Workshop - ](../Workshop03.md) |
e365697d-868f-4114-ab0e-57d785767f58 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-31 03:56:59", "repo_name": "whitestarrain/PersonInformationMange", "sub_path": "/src/utils/JdbcUtils.java", "file_name": "JdbcUtils.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "9b362c3905f2e9d29bd3d4798487bd123a2ea85c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/whitestarrain/PersonInformationMange | 186 | FILENAME: JdbcUtils.java | 0.218669 | package utils;
import com.alibaba.druid.pool.DruidDataSourceFactory;
import org.springframework.jdbc.datasource.embedded.DataSourceFactory;
import javax.sql.DataSource;
import javax.xml.crypto.Data;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
* @author liyu
*/
public class JdbcUtils {
private static DataSource ds;
static{
//加载properties对象
Properties pro=new Properties();
InputStream inputStream=JdbcUtils.class.getClassLoader().getResourceAsStream("druid.properties");
try {
pro.load(inputStream);
} catch (IOException e) {
e.printStackTrace();
}
//通过工厂类读取pro,并创建对应的DataSouce
try {
ds = DruidDataSourceFactory.createDataSource(pro);
} catch (Exception e) {
e.printStackTrace();
}
}
public static DataSource getDataSourse(){
return ds;
}
}
|
2f3b8845-7501-4be3-a504-373031c105a9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-10-21 14:48:45", "repo_name": "akageun/admin-console", "sub_path": "/admin/src/main/java/kr/geun/oss/admin/routes/user/SignupApi.java", "file_name": "SignupApi.java", "file_ext": "java", "file_size_in_byte": 1066, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "b1981f91e86daa5fa100aebde8ce6424a273820c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/akageun/admin-console | 223 | FILENAME: SignupApi.java | 0.210766 | package kr.geun.oss.admin.routes.user;
import kr.geun.oss.base.app.user.model.SignupModel;
import kr.geun.oss.base.app.user.service.UserManageSvc;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
* SignupApi
*
* @author akageun
* @since 2019-10-16
*/
@Slf4j
@RestController
public class SignupApi {
@Autowired
private UserManageSvc userManageSvc;
@PostMapping("/api/signup/v1/form")
public String signup(
@RequestBody @Valid SignupModel param,
BindingResult result
) {
if (result.hasErrors()) {
}
userManageSvc.valid(param.getUserId(), param.getEmail());
userManageSvc.createUser(param.getUserId(), param.getPassWd(), param.getEmail());
return "OK";
}
}
|
c2021199-e445-4043-a7c9-7f24f3926246 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-29T14:41:11", "repo_name": "Thanhtho96/handsomeman", "sub_path": "/app/src/main/java/com/tt/handsomeman/request/ReviewRequest.java", "file_name": "ReviewRequest.java", "file_ext": "java", "file_size_in_byte": 1017, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "4416be94170aa2a4b1beb990e639c6c7b0fc699e", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/Thanhtho96/handsomeman | 215 | FILENAME: ReviewRequest.java | 0.243642 | package com.tt.handsomeman.request;
public class ReviewRequest {
private int jobId;
private int receiverId;
private int vote;
private String comment;
public ReviewRequest(int jobId,
int receiverId,
int vote,
String comment) {
this.jobId = jobId;
this.receiverId = receiverId;
this.vote = vote;
this.comment = comment;
}
public int getJobId() {
return jobId;
}
public void setJobId(int jobId) {
this.jobId = jobId;
}
public int getReceiverId() {
return receiverId;
}
public void setReceiverId(int receiverId) {
this.receiverId = receiverId;
}
public int getVote() {
return vote;
}
public void setVote(int vote) {
this.vote = vote;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
}
|
70bf3556-bb5a-41c4-a438-90dd10ccf6fc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-07-19T02:13:07", "repo_name": "agronauts/UC-Timetable-to-GCalender", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1176, "line_count": 33, "lang": "en", "doc_type": "text", "blob_id": "c1a03698c00cf71159fce35fff912014ad77cf10", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/agronauts/UC-Timetable-to-GCalender | 297 | FILENAME: README.md | 0.218669 | # UC-Timetable-to-GCalender
Converts the exported CSV file from the UC Timetable webapp into a less verbose format for importing into Google Calenders
# Requirements
Python 3 installed
# Installation
Download or clone the python script to a suitable location and you're ready to go
# Usage
1. In the UC Timetable web app, go:
a. Timetable
b. Change to **All Weeks**
c. Export button (Looks like a square with an arrow protuding out the right side of it)
d. Text
2. Move the CSV file into the same directory as the python script.
3. From the command line, run `python UC_Timetable_GCalender.py filename` where `filename` is the name of the downloaded CSV file
4. In Google Calenders, go:
a. Click the cog button in top right corner
b. Settings
c. Calenders
5. After that, go:
a. Click the cog button in top right corner
b. Settings
c. Calenders
d. Import Calender
e. Choose file
f. Select the CSV file that was made by the python script
g. Select the calender you just made
h. Import
Congratulations, you will now have a non-verbose looking University timetable that's integrated with all your other events!
|
9799a3fc-119a-4443-9a02-1073d1525d0b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-03 02:36:25", "repo_name": "wanghaoqiang1994/spring-actual", "sub_path": "/manager/src/test/java/com/haoqiangwang/manager/test/TestOne.java", "file_name": "TestOne.java", "file_ext": "java", "file_size_in_byte": 981, "line_count": 31, "lang": "en", "doc_type": "code", "blob_id": "32580194584445ab431ce149a8e12fcd6c3a67c6", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/wanghaoqiang1994/spring-actual | 201 | FILENAME: TestOne.java | 0.196826 | package com.haoqiangwang.manager.test;
import com.haoqiangwang.manager.ManagerApplication;
import com.haoqiangwang.manager.constant.ManagerConstant;
import com.haoqiangwang.service.common.RedisService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ManagerApplication.class)
public class TestOne {
@Autowired
private RedisService redisService;
@Test
public void add(){
redisService.hset(ManagerConstant.LOGIN_ADMIN,"admin","admin");
System.out.println("插入成功");
}
@Test
public void permission(){
redisService.sSet(ManagerConstant.USER_AUTHORITY + "15531257696","authority:register","authority:login","test:button");
System.out.println("插入成功");
}
}
|
b865a6c5-edc2-4503-a562-a02f13d588c5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-05-23 17:43:44", "repo_name": "tzubeli/The-Single-Responsibility-Principle", "sub_path": "/src/main/java/com/theladders/solid/srp/refactor/ApplyView.java", "file_name": "ApplyView.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "19b52603faa5606f09c4eb058ce2b76f1670c728", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tzubeli/The-Single-Responsibility-Principle | 251 | FILENAME: ApplyView.java | 0.286968 | package com.theladders.solid.srp.refactor;
import com.theladders.solid.srp.Result;
import com.theladders.solid.srp.http.HttpResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by atzubeli on 5/22/14.
*/
public class ApplyView {
public static void provideApplySuccessView(HttpResponse response, Map<String, Object> model){
Result result = new Result("success", model);
response.setResult(result);
}
public static void provideResumeCompletionView(HttpResponse response, Map<String, Object> model){
Result result = new Result("completeResumePlease", model);
response.setResult(result);
}
public static void provideErrorView(HttpResponse response, List<String> errList, Map<String, Object> model){
Result result = new Result("error", model, errList);
response.setResult(result);
}
public static void provideInvalidJobView(HttpResponse response, int jobId){
Map<String, Object> model = new HashMap();
model.put("jobId", jobId);
Result result = new Result("invalidJob", model);
response.setResult(result);
}
}
|
f121397c-46ec-4283-a2a4-0949b5a46e00 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-04-29 00:29:36", "repo_name": "liniribeiro/yourselfCoffeeShop", "sub_path": "/app/src/main/java/yourself/aliniribeiro/com/yourself/MainActivity.java", "file_name": "MainActivity.java", "file_ext": "java", "file_size_in_byte": 1072, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "fdefbae59ad2242f56994d6b42811b715bb62256", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/liniribeiro/yourselfCoffeeShop | 176 | FILENAME: MainActivity.java | 0.191933 | package yourself.aliniribeiro.com.yourself;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
public class MainActivity extends AppCompatActivity {
private ImageView coffee;
private ImageView infos;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
coffee = (ImageView) findViewById(R.id.coffeeImage);
infos = (ImageView) findViewById(R.id.infos);
coffee.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, Coffee.class));
}
});
infos.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, Infos.class));
}
});
}
}
|
54e4f12c-3f46-4b21-b6ce-8a9057865a50 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-08-17 08:13:46", "repo_name": "syntrydy/TakeCare", "sub_path": "/app/src/main/java/com/it/mougang/gasmyr/takecare/service/BirthdayNotificationService.java", "file_name": "BirthdayNotificationService.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 41, "lang": "en", "doc_type": "code", "blob_id": "15530beb8f254cd17093a59c3e77e7172b2fd515", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/syntrydy/TakeCare | 248 | FILENAME: BirthdayNotificationService.java | 0.288569 | package com.it.mougang.gasmyr.takecare.service;
import android.app.IntentService;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.widget.SpinnerAdapter;
import com.it.mougang.gasmyr.takecare.domain.Birthday;
import com.it.mougang.gasmyr.takecare.utils.Utils;
import java.util.Date;
import io.realm.Realm;
import io.realm.RealmResults;
public class BirthdayNotificationService extends IntentService {
private RealmResults<Birthday> realmResults;
public BirthdayNotificationService() {
super("BirthdayNotificationService");
}
@Override
protected void onHandleIntent(@Nullable Intent intent) {
if (intent != null) {
realmResults = Realm.getDefaultInstance().where(Birthday.class).findAll();
for (Birthday birthday : realmResults) {
int remaingdays = birthday.getRemainingsDays();
if(remaingdays<=5){
notifyForBirthdayWith(birthday);
}
}
}
}
private void notifyForBirthdayWith(Birthday birthday) {
Utils.sendNewSms("new birthday comming soon","696534361");
}
}
|
2e071356-b28a-4f64-bbe1-3f39022e241a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-02 10:07:11", "repo_name": "aportenov/java-blog-softuni", "sub_path": "/src/main/java/softuni/services/CategoryServiceImpl.java", "file_name": "CategoryServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1038, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "5c99a17806f93abad7a9fa273f335567041f6388", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aportenov/java-blog-softuni | 196 | FILENAME: CategoryServiceImpl.java | 0.268941 | package softuni.services;
import softuni.entities.Category;
import softuni.repositories.CategoryRepository;
import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.inject.Inject;
import java.util.List;
@Stateless
@Local(CategoryService.class)
public class CategoryServiceImpl implements CategoryService {
@Inject
private CategoryRepository categoryRepository;
@Override
public List<Category> getAllCategories() {
List<Category> categories = this.categoryRepository.getAllCategories();
return categories;
}
@Override
public Category findById(long id) {
Category category = this.categoryRepository.findById(id);
return category;
}
@Override
public void save(Category category) {
this.categoryRepository.save(category);
}
@Override
public void edit(long id, String name) {
this.categoryRepository.edit(id, name);
}
@Override
public void delete(long id) {
this.categoryRepository.delete(id);
}
}
|
cac07172-9a76-46ca-af9a-d3d0e246d597 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-23 10:51:02", "repo_name": "Stefanov97/SoftUni", "sub_path": "/Java-Advanced/JavaAdvancedExams/src/heroRepository/Item.java", "file_name": "Item.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "957b43afec84280c85ccb1b59710bceb6f06a451", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Stefanov97/SoftUni | 208 | FILENAME: Item.java | 0.292595 | package heroRepository;
public class Item {
private int strength;
private int agility;
private int intelligence;
public Item(int strength, int agility, int intelligence) {
this.strength = strength;
this.agility = agility;
this.intelligence = intelligence;
}
public int getStrength() {
return strength;
}
public int getAgility() {
return agility;
}
public int getIntelligence() {
return intelligence;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Item:").append(System.lineSeparator());
sb.append(String.format(" * Strength: %d", this.getStrength())).append(System.lineSeparator());
sb.append(String.format(" * Agility: %d", this.getAgility())).append(System.lineSeparator());
sb.append(String.format(" * Intelligence: %d", this.getIntelligence())).append(System.lineSeparator());
return sb.toString().trim();
}
}
|
b6573259-7df6-4673-bf4f-47da899f2835 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-24 06:29:51", "repo_name": "swj0704/androidClassroom", "sub_path": "/bokseup/bokseup2/src/main/java/com/example/bokseup2/SecondActivity.java", "file_name": "SecondActivity.java", "file_ext": "java", "file_size_in_byte": 1208, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "990fb1b6552b1507a983b39b567c1e93111a5749", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/swj0704/androidClassroom | 195 | FILENAME: SecondActivity.java | 0.245085 | package com.example.bokseup2;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class SecondActivity extends AppCompatActivity {
TextView textView;
Button btnReturn;
EditText editText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
textView = findViewById(R.id.textView);
btnReturn = findViewById(R.id.btnReturn);
editText = findViewById(R.id.editReturn);
Intent intent = getIntent();
textView.setText(intent.getStringExtra("message"));
btnReturn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent outIntent = new Intent(getApplicationContext(), MainActivity.class);
outIntent.putExtra("returnMessage",editText.getText().toString());
setResult(RESULT_OK,outIntent);
finish();
}
});
}
}
|
4cc6fa37-8dfc-4f72-b7c3-c4784c149150 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-06-12 14:23:22", "repo_name": "vov4ik-bratik/ConverterLab", "sub_path": "/app/src/main/java/lessons/vs/petersonapps/converterlab/model/Currency_.java", "file_name": "Currency_.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 62, "lang": "en", "doc_type": "code", "blob_id": "9d0f522c515f511cb64e79c6af8e66966395dc18", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/vov4ik-bratik/ConverterLab | 285 | FILENAME: Currency_.java | 0.279042 | package lessons.vs.petersonapps.converterlab.model;
import com.google.gson.annotations.SerializedName;
/**
* Created by vs on 17.05.2017.
*/
public class Currency_ {
@SerializedName("ask")
String ask;
@SerializedName("bid")
String bid;
Double askChangeFlag;
Double bidChangeFlag;
public Currency_() {
this.ask = "0";
this.bid = "0";
this.askChangeFlag = 0d;
this.bidChangeFlag = 0d;
}
public Currency_(String ask, String bid) {
this.ask = ask;
this.bid = bid;
}
public String getAsk() {
return ask;
}
public void setAsk(String ask) {
this.ask = ask;
}
public String getBid() {
return bid;
}
public void setBid(String bid) {
this.bid = bid;
}
public Double getAskChangeFlag() {
return askChangeFlag;
}
public void setAskChangeFlag(Double askChangeFlag) {
this.askChangeFlag = askChangeFlag;
}
public Double getBidChangeFlag() {
return bidChangeFlag;
}
public void setBidChangeFlag(Double bidChangeFlag) {
this.bidChangeFlag = bidChangeFlag;
}
}
|
3cb71295-fcdf-4251-9135-e0b3a81a699a | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-04 00:15:17", "repo_name": "hyh-h/LawOffices", "sub_path": "/src/main/java/com/example/demo/entity/Express_type.java", "file_name": "Express_type.java", "file_ext": "java", "file_size_in_byte": 1186, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "b33a1139d4b64ef4dd06b25cad648a3a6296bc51", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/hyh-h/LawOffices | 272 | FILENAME: Express_type.java | 0.226784 | package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author hyh
* @since 2020-12-31
*/
public class Express_type implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 序号
*/
private String sorting;
/**
* 快件类型
*/
private String express_name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSorting() {
return sorting;
}
public void setSorting(String sorting) {
this.sorting = sorting;
}
public String getExpress_name() {
return express_name;
}
public void setExpress_name(String express_name) {
this.express_name = express_name;
}
@Override
public String toString() {
return "Express_type{" +
"id=" + id +
", sorting=" + sorting +
", express_name=" + express_name +
"}";
}
}
|
84b3bce5-bb79-41b1-bac5-c2458525734c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-04-21 08:42:50", "repo_name": "TomekKasprzycki/Irregularities", "sub_path": "/src/main/java/pl/malopolska/irregularities/services/PaymentRequestService.java", "file_name": "PaymentRequestService.java", "file_ext": "java", "file_size_in_byte": 1045, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "2a49cfaa670d1b31dd95b4fa5276b1a88ba5e338", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/TomekKasprzycki/Irregularities | 215 | FILENAME: PaymentRequestService.java | 0.281406 | package pl.malopolska.irregularities.services;
import org.springframework.stereotype.Service;
import pl.malopolska.irregularities.model.PaymentRequest;
import pl.malopolska.irregularities.model.Project;
import pl.malopolska.irregularities.repository.PaymentRequestRepo;
import java.util.List;
@Service
public class PaymentRequestService {
private PaymentRequestRepo paymentRequestRepo;
private PaymentRequestService(PaymentRequestRepo paymentRequestRepo){
this.paymentRequestRepo = paymentRequestRepo;
}
public List<PaymentRequest> getAllPaymentRequestByProject(Project project){return paymentRequestRepo.findAllByProject(project);}
public List<PaymentRequest> getAllByIrregularityId(Long id) {
return paymentRequestRepo.findAllByIrregularitiesId(id);
}
public List<PaymentRequest> getAllPaymentRequestByProjectId(Long id) {
return paymentRequestRepo.findAllByProjectId(id);
}
public PaymentRequest getById(Long id) {
return paymentRequestRepo.findPRById(id);
}
}
|
a805b1b5-6362-4783-9b44-efc96a96333f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2014-05-10 10:15:57", "repo_name": "Sythelux/SG_Spile", "sub_path": "/src/main/java/de/sydsoft/sg_wolfskrone/entities/items/Weapon.java", "file_name": "Weapon.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "e340a5f8c7c40c7e4a02ff907aef92b2387760db", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Sythelux/SG_Spile | 284 | FILENAME: Weapon.java | 0.281406 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package de.sydsoft.sg_wolfskrone.entities.items;
import de.sydsoft.sg_wolfskrone.entities.Item;
import de.sydsoft.sg_wolfskrone.entities.ItemBuilder;
import java.util.ResourceBundle;
/**
*
* @author sythelux
*/
public abstract class Weapon extends Item {
protected int handling = 0;//0=singlehand,onehanded;1=twohanded;2=mainhand;3=secuhand
protected WeaponPrefix prefix;
public Weapon(ItemBuilder builder) {
super(builder);
this.prefix = builder.getWeaponPrefix();
this.handling = builder.getHandling();
}
public Weapon(ItemSuffix suffix, WeaponPrefix prefix, ItemRareNess rareNess) {
super(suffix, rareNess);
this.prefix = prefix;
}
public boolean isTwoHanded() {
return (handling == 1) ? true : false;
}
@Override
public String toString() {
return "ItemID#" + id + " "+ prefix.getName() + ResourceBundle.getBundle("ItemName").getString(name).toLowerCase() + " " + suffix.getName();
}
public WeaponPrefix getPrefix() {
return prefix;
}
}
|
d4312150-a2eb-4595-b08c-f876f53b48ef | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-07-20 05:13:59", "repo_name": "SevakMart/diamond", "sub_path": "/src/main/java/am/diamond/utils/Validator.java", "file_name": "Validator.java", "file_ext": "java", "file_size_in_byte": 1024, "line_count": 45, "lang": "en", "doc_type": "code", "blob_id": "d1a526e40e759eab2728d4459fa2c429f3476102", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SevakMart/diamond | 251 | FILENAME: Validator.java | 0.255344 | package am.diamond.utils;
import org.springframework.stereotype.Component;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Created by sevak on 5/20/17.
*/
@Component
public class Validator {
private static final String EMAIL_PATTERN =
"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
/**
* Validate hex with regular expression
*
* @param hex
* hex for validation
* @return true valid hex, false invalid hex
*/
public boolean isEmail(final String hex) {
Pattern pattern = Pattern.compile(EMAIL_PATTERN);
Matcher matcher = pattern.matcher(hex);
return matcher.matches();
}
public void isEmailExcist(final String email){
}
/**
* check value is empty or not
* @param value
* @return boolean
*/
public boolean isEmpty(final String value){
return value == null || value.length() == 0;
}
}
|
b930c8ac-eb1e-4533-8c98-93245097af70 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-22 08:45:20", "repo_name": "pslichunbo/jbz-new-api-master", "sub_path": "/src/main/java/io/renren/modules/app/service/impl/VideoTypeServiceImpl.java", "file_name": "VideoTypeServiceImpl.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "5c316434e802c16100cdbb17c3f8f0d0dcca254c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/pslichunbo/jbz-new-api-master | 240 | FILENAME: VideoTypeServiceImpl.java | 0.288569 | package io.renren.modules.app.service.impl;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.app.dao.VideoTypeDao;
import io.renren.modules.app.entity.VideoTypeEntity;
import io.renren.modules.app.service.VideoTypeService;
import javax.annotation.Resource;
@Service("videoTypeService")
public class VideoTypeServiceImpl extends ServiceImpl<VideoTypeDao, VideoTypeEntity> implements VideoTypeService {
@Resource
private VideoTypeDao videoTypeDao;
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<VideoTypeEntity> page = this.selectPage(
new Query<VideoTypeEntity>(params).getPage(),
new EntityWrapper<VideoTypeEntity>()
);
return new PageUtils(page);
}
@Override
public List<VideoTypeEntity> queryALL() {
return videoTypeDao.findAll();
}
}
|
61aef361-0be0-4c86-88de-e4d6e120d106 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "markdown", "committer_date": "2016-01-18T03:06:58", "repo_name": "britcorona/First-Capstone", "sub_path": "/README.md", "file_name": "README.md", "file_ext": "md", "file_size_in_byte": 1020, "line_count": 36, "lang": "en", "doc_type": "text", "blob_id": "f4d40d6d1f107870046eb882ac01156a2b61704e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/britcorona/First-Capstone | 225 | FILENAME: README.md | 0.214691 | # NSS First-Capstone
###Know Thy Car
This app is for viewing car part prices for the cars provided, and keeping a vehicle service checklist.
###Running the application
#####Clone the repo https://github.com/britcorona/First-Capstone.git
#####Install the HTTP Server
*Only install if you have not already globally installed the server*
The http-server module is just a very basic project that will serve static files from the directory of your choice.
*sudo npm install -g http-server*
#####Serve the application
Next, go to the First-Capstone application root folder and start the server.
*http-server*
http://localhost:8080 (or whichever port it reports it is using) will display the application.
#####Install Bower
Go to the lib folder and *bower install*
#####Install Grunt
Still in the lib folder *npm install*
Now that everything is installed, make sure **Grunt** is running in the lib folder and the **http-server** is running in the applications *root folder*, and view the Know Thy Car webpage.
|
3cdab935-a712-4d82-bb53-242efa66821d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-12-04 01:47:31", "repo_name": "dctproject/basic_version", "sub_path": "/src/main/java/thymeleafexamples/stsm/business/entities/Area.java", "file_name": "Area.java", "file_ext": "java", "file_size_in_byte": 1022, "line_count": 49, "lang": "en", "doc_type": "code", "blob_id": "ce6d14036faf81a799add3bf93d8815a9767197e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/dctproject/basic_version | 241 | FILENAME: Area.java | 0.286968 | package thymeleafexamples.stsm.business.entities;
public enum Area {
BEIJING("BEIJING"),
GUANGZHOU("GUANGZHOU"),
SHANGHAI("SHANGHAI");
public static final Area[] ALL = { BEIJING,GUANGZHOU,SHANGHAI };
private final String name;
public static Area forName(final String name) {
if (name == null) {
throw new IllegalArgumentException("Name cannot be null for type");
}
if (name.toUpperCase().equals("BEIJING")) {
return BEIJING;
} else if (name.toUpperCase().equals("GUANGZHOU")) {
return GUANGZHOU;
} else if (name.toUpperCase().equals("SHANGHAI")) {
return SHANGHAI;
}
throw new IllegalArgumentException("Name \"" + name + "\" does not correspond to any Type");
}
private Area(final String name) {
this.name = name;
}
public String getName() {
return this.name;
}
@Override
public String toString() {
return getName();
}
}
|
d534f442-031a-4dec-a5be-82af536d4236 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-09-23 22:02:35", "repo_name": "alexjean/AndroidDev", "sub_path": "/ActivityTest/app/src/main/java/com/tomorrow_eyes/activitytest/SecondActivity.java", "file_name": "SecondActivity.java", "file_ext": "java", "file_size_in_byte": 1184, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "4fa2dfbce3277cf959cdce0d7d68002d0db6c127", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/alexjean/AndroidDev | 226 | FILENAME: SecondActivity.java | 0.236516 | package com.tomorrow_eyes.activitytest;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class SecondActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.second_layout);
Intent intent = getIntent();
String data = intent.getStringExtra("extra_data");
TextView tv = (TextView)findViewById(R.id.textViewMsg);
tv.setText(data);
}
public void onClickToSee(View v) {
Intent intent = new Intent();
intent.putExtra("data_return", getString(R.string.to_see));
setResult(RESULT_OK,intent);
finish();
}
public void onClickNoSee(View v) {
Intent intent = new Intent();
intent.putExtra("data_return", getString(R.string.no_see));
setResult(RESULT_OK,intent);
finish();
}
@Override
public void onBackPressed() {
Intent intent = new Intent();
intent.putExtra("data_return", "她不說話");
setResult(RESULT_OK,intent);
finish();
}
}
|
f927cffd-a3f4-4bbf-971c-525fa7c1d1ee | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2023-08-09 19:05:42", "repo_name": "iotivity/iotivity-lite", "sub_path": "/swig/apps/java_onboarding_tool/src/java_onboarding_tool/OwnedDeviceHandler.java", "file_name": "OwnedDeviceHandler.java", "file_ext": "java", "file_size_in_byte": 976, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "70686ade96ac1db19c4202ec437f79a895b3b874", "star_events_count": 143, "fork_events_count": 80, "src_encoding": "UTF-8"} | https://github.com/iotivity/iotivity-lite | 237 | FILENAME: OwnedDeviceHandler.java | 0.262842 | package java_onboarding_tool;
import org.iotivity.OCEndpoint;
import org.iotivity.OCEndpointUtil;
import org.iotivity.OCMain;
import org.iotivity.OCObtDiscoveryHandler;
import org.iotivity.OCQos;
import org.iotivity.OCUuidUtil;
import org.iotivity.OCUuid;
public class OwnedDeviceHandler implements OCObtDiscoveryHandler {
@Override
public void handler(OCUuid uuid, OCEndpoint endpoints) {
String deviceId = OCUuidUtil.uuidToString(uuid);
System.out.println("\nDiscovered owned device: "+ deviceId + " at:");
OCEndpoint ep = endpoints;
while (endpoints != null) {
String endpointStr = OCEndpointUtil.toString(endpoints);
System.out.println(endpointStr);
endpoints = endpoints.getNext();
}
OCMain.doGet("/oic/d", ep, null, getOwnedDeviceNameHandler, OCQos.HIGH_QOS);
}
public static GetOwnedDeviceNameHandler getOwnedDeviceNameHandler = new GetOwnedDeviceNameHandler();
}
|
509bcf07-2ea6-4957-8fa6-fc070926cae0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-26 13:35:19", "repo_name": "Gaelleb22/hotel-web-api", "sub_path": "/src/main/java/dev/hotel/service/ClientService.java", "file_name": "ClientService.java", "file_ext": "java", "file_size_in_byte": 980, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "d1bb4889c856c07051762941de5b3ea599694093", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Gaelleb22/hotel-web-api | 200 | FILENAME: ClientService.java | 0.267408 | package dev.hotel.service;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import javax.transaction.Transactional;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import dev.hotel.entite.Client;
import dev.hotel.repository.ClientRepository;
@Service
public class ClientService {
private ClientRepository clientRepository;
public ClientService(ClientRepository clientRepository) {
super();
this.clientRepository = clientRepository;
}
@Transactional
public Client creer(String nom, String prenoms) {
Client client = new Client(nom, prenoms);
Client clientSauvegarde = this.clientRepository.save(client);
return clientSauvegarde;
}
public List<Client> findAll(Integer start, Integer size) {
return clientRepository.findAll(PageRequest.of(start, size)).toList();
}
public Optional<Client> findByUuid(UUID uuid) {
return clientRepository.findById(uuid);
}
}
|
483291e4-4fc0-4d9b-8621-2820d14563fc | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-11-15 21:37:50", "repo_name": "PandoraPlugins/PandoraBot", "sub_path": "/src/main/java/dev/minecraftplugin/commands/ShutdownCommand.java", "file_name": "ShutdownCommand.java", "file_ext": "java", "file_size_in_byte": 1034, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "d759df6fa0bccad016636246d9eda23366409400", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/PandoraPlugins/PandoraBot | 235 | FILENAME: ShutdownCommand.java | 0.264358 | package dev.minecraftplugin.commands;
import com.jagrosh.jdautilities.command.Command;
import com.jagrosh.jdautilities.command.CommandEvent;
import dev.minecraftplugin.PandoraBot;
public class ShutdownCommand extends Command {
private final PandoraBot pandoraBot;
public ShutdownCommand(PandoraBot pandoraBot, Category category)
{
this.category = category;
this.pandoraBot = pandoraBot;
this.name = "shutdown";
this.help = "Bot go brrrrrr";
this.guildOnly = false;
}
/**
* The main body method of a {@link Command Command}.
* <br>This is the "response" for a successful
* {@link Command#run(CommandEvent) #run(CommandEvent)}.
*
* @param event The {@link CommandEvent CommandEvent} that
* triggered this Command
*/
@Override
protected void execute(CommandEvent event) {
event.reactSuccess();
pandoraBot.getBotConfig().saveConfig();
event.getJDA().shutdown();
System.exit(0);
}
}
|
3e0c1ddf-dad1-425b-ba14-e8d6e75183e0 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-11-06 18:09:28", "repo_name": "CindyKiran/PokeMart", "sub_path": "/Pokemart-inventory/pokemart-inventory-backend/src/main/java/com/CindyK/pokemartinventorybackend/controllers/ItemsController.java", "file_name": "ItemsController.java", "file_ext": "java", "file_size_in_byte": 1012, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "3574cf7fa828e8f1ac644e8b7718309e019eead0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/CindyKiran/PokeMart | 194 | FILENAME: ItemsController.java | 0.239349 | package com.CindyK.pokemartinventorybackend.controllers;
import com.CindyK.pokemartinventorybackend.models.Item;
import com.CindyK.pokemartinventorybackend.repositories.ItemRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/inventory/items")
public class ItemsController {
@Autowired
private ItemRepository itemRepository;
@GetMapping
public List<Item> inventoryList(){
return itemRepository.findAll();
}
@PostMapping
@ResponseStatus(HttpStatus.OK)
public void addItem(@RequestBody Item item){
itemRepository.save(item);
}
@GetMapping("/{id}")
public Item getItem(@PathVariable("id") long id){
return itemRepository.getOne(id);
}
@DeleteMapping("/{id}")
public void deleteItem(@PathVariable long id) {
itemRepository.deleteById(id);
}
}
|
ede3f653-e563-4b10-aa56-82c64dff7dd6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-02-09 13:48:47", "repo_name": "LastingEver/AndroidStudioProjects", "sub_path": "/FragmentDemo/app/src/main/java/com/example/lasting/fragmentdemo/MyFragment.java", "file_name": "MyFragment.java", "file_ext": "java", "file_size_in_byte": 1196, "line_count": 37, "lang": "en", "doc_type": "code", "blob_id": "6d89c446b4f0a40ba07198ab41e7955df322ff21", "star_events_count": 3, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/LastingEver/AndroidStudioProjects | 223 | FILENAME: MyFragment.java | 0.281406 | package com.example.lasting.fragmentdemo;
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
public class MyFragment extends Fragment{
private String code="谢谢!";
MyListener myListener;
public interface MyListener{
public void thank(String code);
}
@Override
public void onAttach(Activity activity) {
myListener=(MyListener)activity;
super.onAttach(activity);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view=inflater.inflate(R.layout.my_fragment2,container,false);
TextView textView1=(TextView)view.findViewById(R.id.textView1);
String text=getArguments().get("text").toString();
textView1.setText(text);
Toast.makeText(getActivity(),"接收到"+text,Toast.LENGTH_SHORT).show();
Toast.makeText(getActivity(),"发送感谢:"+code,Toast.LENGTH_SHORT).show();
myListener.thank(code);
return view;
}
}
|
d43a0d83-9398-48c1-b00c-ac780bbbc096 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-25 18:21:39", "repo_name": "chillxcode/BLM3520_ReminderApp", "sub_path": "/BLM3520_ReminderApp/app/src/main/java/com/example/reminderapp/ReminderBroadcast.java", "file_name": "ReminderBroadcast.java", "file_ext": "java", "file_size_in_byte": 993, "line_count": 26, "lang": "en", "doc_type": "code", "blob_id": "e1ce1dd648657559a4bd12bce3093fc2d624ee6e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/chillxcode/BLM3520_ReminderApp | 177 | FILENAME: ReminderBroadcast.java | 0.23793 | package com.example.reminderapp;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
public class ReminderBroadcast extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, "notify")
.setSmallIcon(R.drawable.ic_notifications_black_24dp)
.setSound(Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.hasty_ba_dum_tss))
.setContentTitle("ReminderApp")
.setContentText(":)")
.setPriority(NotificationCompat.PRIORITY_HIGH);
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
notificationManager.notify(200, builder.build());
}
}
|
15ddee74-cd19-45c4-bd77-eb87ba886d28 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-12-07 16:03:49", "repo_name": "NatalyaBranets/Dental-Management-System", "sub_path": "/src/main/java/com/softserve/demo/ConnectionData.java", "file_name": "ConnectionData.java", "file_ext": "java", "file_size_in_byte": 1014, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "e307d1dd56674288627d2c306fda1e5e55de9896", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/NatalyaBranets/Dental-Management-System | 176 | FILENAME: ConnectionData.java | 0.247987 | package com.softserve.demo;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class ConnectionData {
private static Connection connect;
private static Logger log = Logger.getLogger(ConnectionData.class.getName());
public static Connection getConnectionData() {
if (connect == null) {
String url = "jdbc:mysql://localhost:3306/dentistry";
String username = "";
String password = "";
try {
DriverManager.registerDriver(new com.mysql.cj.jdbc.Driver());
connect = DriverManager.getConnection(url, username, password);
if (connect == null) {
throw new SQLException("Connection error");
}
} catch (SQLException ex) {
log.log(Level.SEVERE, null, ex.getStackTrace());
}
}
return connect;
}
}
|
0d209f2b-470c-4a3b-aa96-2b6c2262b58b | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2015-11-20 13:12:19", "repo_name": "kkuja/agileo_projekti_jmpt", "sub_path": "/asterix_crm_JPAConf_2/src/main/java/fi/asterix/JPA/HelloAsterix.java", "file_name": "HelloAsterix.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 35, "lang": "en", "doc_type": "code", "blob_id": "6b4116b9d7e35bb749cdcd45374c6e038ed41b3b", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/kkuja/agileo_projekti_jmpt | 314 | FILENAME: HelloAsterix.java | 0.29584 | package fi.asterix.JPA;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
public class HelloAsterix {
public static void main(String[] args) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("asterix_crm_JPAConf_2");
EntityManager em = emf.createEntityManager();
EntityTransaction ta = em.getTransaction();
ta.begin();
HelloEntity hello = new HelloEntity();
hello.setMessage("jotain 4");
em.persist(hello);
// webuser2 wu = new webuser2();
// wu.setEnabled(true);
// wu.setFirstname("Uusi");
// wu.setLastname("Käyttäjä");
// wu.setUsername("kayttaja");
// wu.setPassword_encrypted("fe6c9ef3e1a61a37e1073fafaf7dc42b0d976a170ad4013e7b5304fd9ac60602770d18777361b2e5");
// em.persist(wu);
// ta.commit();
// em.close();
// Authority auth = new Authority();
// auth.setRole("POISTA_TAMA4");
// em.persist(auth);
ta.commit();
em.close();
}
} |
1f99d7ae-4c9d-4a60-b4da-0895689b9aa5 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-20 17:14:13", "repo_name": "340122/bookstore", "sub_path": "/mytest/itcaststore/src/cn/itcast/itcaststore/web/servlet/manager/DeleteProductServlet.java", "file_name": "DeleteProductServlet.java", "file_ext": "java", "file_size_in_byte": 1123, "line_count": 29, "lang": "en", "doc_type": "code", "blob_id": "ec73c93e2e41cc107e7f6de6008c1f39afd432a4", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/340122/bookstore | 181 | FILENAME: DeleteProductServlet.java | 0.267408 | package cn.itcast.itcaststore.web.servlet.manager;
import cn.itcast.itcaststore.service.ProductService;
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;
public class DeleteProductServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//获取请求参数的id
String id = request.getParameter("id");
//创建ServiceProduct对象
ProductService service = new ProductService();
//调用ProductService对象的deleteProduct()方法完成删除商品操作
service.deleteProduct(id);
//重定向回商品列表页面
response.sendRedirect(request.getContextPath()+"/listProduct");
return;
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
}
}
|
86a4a6d4-76f2-410a-997a-07a92a565d48 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-07-07 10:01:46", "repo_name": "arrowToTarget/multiThreadDesign", "sub_path": "/multiThread/src/com/lewis/multiThread/blockingQueue/lock/Consumer.java", "file_name": "Consumer.java", "file_ext": "java", "file_size_in_byte": 1002, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "a309ae79d790c1d25b6c859e055938b4a580dcfa", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/arrowToTarget/multiThreadDesign | 191 | FILENAME: Consumer.java | 0.247987 | package com.lewis.multiThread.blockingQueue.lock;
import com.lewis.multiThread.blockingQueue.Request;
import com.lewis.multiThread.blockingQueue.syn.Test;
import java.util.Date;
import java.util.Random;
public class Consumer {
private final BlockingQueue queue;
private Random random = new Random();
public Consumer(BlockingQueue queue) {
this.queue = queue;
}
private boolean terimated = false;
public void processRequest(){
while (!terimated) {
try {
Thread.sleep(random.nextInt(1000));
Request take = queue.take();
System.out.println(Thread.currentThread().getName() +"consumer :"+take.toString()+" take after queue size :" +queue.size()+" time:"+ Test.sdf.format(new Date()));
} catch (InterruptedException e) {
terimated = true;
System.out.println(Thread.currentThread().getName()+" enter interruptedException");
}
}
}
}
|
6a229899-ea4c-47f4-8ff3-b69c9644eecb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-07-11 12:45:21", "repo_name": "Dottools-Team/dottools-api-demo-android", "sub_path": "/app/src/main/java/com/lem/nicetools/baasdemo/sdk/bean/Token.java", "file_name": "Token.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 60, "lang": "en", "doc_type": "code", "blob_id": "7281b3b29de621e350da28c0d409aafa5617c9d0", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Dottools-Team/dottools-api-demo-android | 265 | FILENAME: Token.java | 0.228156 | package com.lem.nicetools.baasdemo.sdk.bean;
public class Token {
private String id;
private String token;
private String refreshToken;
private String expiration;
public Token() {
}
public Token(String id, String token, String refreshToken, String expiration) {
this.id = id;
this.token = token;
this.refreshToken = refreshToken;
this.expiration = expiration;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getRefreshToken() {
return refreshToken;
}
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
public String getExpiration() {
return expiration;
}
public void setExpiration(String expiration) {
this.expiration = expiration;
}
@Override public String toString() {
return "Token{" +
"id='" + id + '\'' +
", token='" + token + '\'' +
", refreshToken='" + refreshToken + '\'' +
", expiration='" + expiration + '\'' +
'}';
}
}
|
6e071365-c3dd-4d9e-929f-adb01ba23a04 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-28 10:40:08", "repo_name": "Rahil93/prog", "sub_path": "/Data_Structure/Queue/Queue.java", "file_name": "Queue.java", "file_ext": "java", "file_size_in_byte": 1020, "line_count": 66, "lang": "en", "doc_type": "code", "blob_id": "c0c712e3e631c91463bd54ce7f258feb29454abd", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Rahil93/prog | 291 | FILENAME: Queue.java | 0.284576 | public class Queue<T>{
public Node head;
public void queue(){
head = null;
}
public <T> void enqueue(T data){
Node node = new Node();
node.data = data;
node.next = null;
if (head == null) {
head = node;
}
else{
Node n = head;
while (n == head) {
node.next = head;
head = node;
}
}
}
public <T> T dequeue(){
Node<T> n = head;
Node n1 = null;
while (n.next != null) {
n1 = n;
n = n.next;
}
n1.next = null;
return n.data;
}
public boolean isEmpty(){
Node<T> n = head;
if (n == null) {
return true;
}
else {
return false;
}
}
public int size(){
Node n = head;
int count = 0;
while (n.next != null) {
count++;
n = n.next;
}
count++;
return count;
}
public void display(){
Node n = head;
while (n.next != null) {
System.out.print(n.data+" ");
n = n.next;
}
System.out.println(n.data);
}
}
|
3c1b2a92-080d-45de-9e24-17d26515d4a6 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-07-28 17:13:41", "repo_name": "tpardabe/algo", "sub_path": "/src/main/java/leetcode/MyQueue.java", "file_name": "MyQueue.java", "file_ext": "java", "file_size_in_byte": 978, "line_count": 44, "lang": "en", "doc_type": "code", "blob_id": "9b137b68ea153d2d9981517d85f2d9e5b1fde364", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/tpardabe/algo | 211 | FILENAME: MyQueue.java | 0.290176 | package leetcode;
import java.util.Stack;
class MyQueue {
/** Initialize your data structure here. */
Stack<Integer> stack = null;
public MyQueue() {
stack = new Stack();
}
/** Push element x to the back of queue. */
public void push(int x) {
if(stack.isEmpty()) {
stack.push(x);
return;
}
int number = stack.pop();
push(x);
stack.push(number);
}
/** Removes the element from in front of queue and returns that element. */
public int pop() {
if(stack.isEmpty()) return -1;
int number = stack.pop();
return number;
}
/** Get the front element. */
public int peek() {
if(stack.isEmpty()) return -1;
int number = stack.pop();
stack.push(number);
return number;
}
/** Returns whether the queue is empty. */
public boolean empty() {
return stack.isEmpty();
}
}
|
76544456-1c24-4daf-aa80-8e7cd206e6e9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-04-08 05:00:21", "repo_name": "aibingbing/EasyApp", "sub_path": "/basic/src/main/java/com/common/ui/BaseActivity.java", "file_name": "BaseActivity.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 51, "lang": "en", "doc_type": "code", "blob_id": "5f676f4f6bc50c4f0cc29d2caaa7b35beb964e06", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aibingbing/EasyApp | 232 | FILENAME: BaseActivity.java | 0.250913 | package com.common.ui;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Window;
import com.common.R;
import butterknife.ButterKnife;
/**
* author meikoz on 2016/3/30.
* email meikoz@126.com
*/
public abstract class BaseActivity extends FragmentActivity {
protected EasyToolBar mTitleBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(getLayoutResource());
ButterKnife.bind(this);
this.onInitData();
}
protected abstract int getLayoutResource();
protected abstract void onInitData();
protected void initTitleBar(String title) {
findTitleBar();
mTitleBar.setTitle(title);
}
private void findTitleBar() {
mTitleBar = (EasyToolBar) findViewById(R.id.toolbar);
}
public void startActivity(Intent intent) {
super.startActivity(intent);
}
@Override
protected void onDestroy() {
super.onDestroy();
ButterKnife.unbind(this);
}
}
|
3d1b940d-be0a-4b74-b034-18cdcc9ed198 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-26 16:37:08", "repo_name": "specialewt/Tower-of-Hanoi", "sub_path": "/requirements/view/ControlPanel.java", "file_name": "ControlPanel.java", "file_ext": "java", "file_size_in_byte": 1018, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "4626a1ae5b5cb724c0d0822c67681005d70b5a4b", "star_events_count": 1, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/specialewt/Tower-of-Hanoi | 210 | FILENAME: ControlPanel.java | 0.285372 | package view;
import javax.swing.*;
import java.awt.*;
public class ControlPanel extends JPanel {
private JLabel moves;
private int moveCount;
private JPanel movePanel;
private Font font = new Font(Font.SANS_SERIF, Font.PLAIN, 20);
public ControlPanel(int frameWidth, int frameHeight) {
this.setPreferredSize(new Dimension(frameWidth, frameHeight/6));
this.setLayout(new GridLayout(1, 4));
movePanel = new JPanel();
movePanel.setLayout(new GridBagLayout());
moveCount = 0;
moves = new JLabel("Moves: "+moveCount);
moves.setFont(font);
movePanel.add(moves, new GridBagConstraints());
JButton menu = new JButton("Menu");
menu.setFont(font);
JButton reset = new JButton("Reset");
reset.setFont(font);
JButton change = new JButton("Change Level");
change.setFont(font);
this.add(menu);
this.add(reset);
this.add(change);
this.add(movePanel);
}
}
|
b2708d42-2d0a-4764-a31e-237d5c527858 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-03 14:34:48", "repo_name": "adityamhatre/shazam-syncer-db-service", "sub_path": "/src/test/java/com/adityamhatre/db_service/rest/DBRestControllerTest.java", "file_name": "DBRestControllerTest.java", "file_ext": "java", "file_size_in_byte": 1052, "line_count": 38, "lang": "en", "doc_type": "code", "blob_id": "d6ab5c9785ce68869ebc0afcf6134a172fe2be9e", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/adityamhatre/shazam-syncer-db-service | 238 | FILENAME: DBRestControllerTest.java | 0.279828 | package com.adityamhatre.db_service.rest;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import static org.junit.jupiter.api.Assertions.*;
@SpringBootTest
@ActiveProfiles("test")
class DBRestControllerTest {
@Autowired
DBRestController dbRestController;
@BeforeEach
void setUp() {
}
@Test
void getLatestSongsPerUser() {
dbRestController.getLatestSongsPerUser().forEach(System.out::println);
}
@Test
void userExistTest() {
assertFalse(dbRestController.doesUserExist(""));
assertTrue(dbRestController.doesUserExist("-M0dcFAayxJ6YAY3JUvA"));
}
@Test
void songLinkTest() {
assertTrue((Boolean) dbRestController.getSongLink("65629131").get("link_exists"));
assertFalse((Boolean) dbRestController.getSongLink("65629131a").get("link_exists"));
}
} |
409997fb-f33e-4434-8293-1cf4b58d334c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-05-26 02:02:39", "repo_name": "hj295808/learngit", "sub_path": "/JSBD_ZT_Voice/src/com/jsbd/voice/entity/VoiceVehicleInfo.java", "file_name": "VoiceVehicleInfo.java", "file_ext": "java", "file_size_in_byte": 1219, "line_count": 84, "lang": "en", "doc_type": "code", "blob_id": "ffa427cef7da8be9749def83560d59d41cdda52c", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "GB18030"} | https://github.com/hj295808/learngit | 313 | FILENAME: VoiceVehicleInfo.java | 0.268941 | package com.jsbd.voice.entity;
public class VoiceVehicleInfo extends VoiceEntity {
private String rawText;//语音转写的文字
private String operation; //取值:【QUERY】
private String name;// 查询的车身名称,取值包括【油量|胎压|发动机|空调|水温|刹车|制动|整体】
public VoiceVehicleInfo(String strResult) {
super(strResult);
try{
this.rawText = this.getJsonObject().optString("rawText","");
this.name = this.getJsonObject().optString("name","");
this.operation = this.getJsonObject().optString("operation","");
}catch(Exception e){
e.printStackTrace();
}
}
/**
* @return the rawText
*/
public String getRawText() {
return rawText;
}
/**
* @param rawText the rawText to set
*/
public void setRawText(String rawText) {
this.rawText = rawText;
}
/**
* @return the operation
*/
public String getOperation() {
return operation;
}
/**
* @param operation the operation to set
*/
public void setOperation(String operation) {
this.operation = operation;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
}
|
84977a76-4487-4a4f-bc7b-830d185e0d58 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-05-24 06:51:49", "repo_name": "SpaceBurritos/keyboardDrivenFrameworkAssignment", "sub_path": "/selenium-tutorial/src/test/java/base/BaseTest.java", "file_name": "BaseTest.java", "file_ext": "java", "file_size_in_byte": 1021, "line_count": 40, "lang": "en", "doc_type": "code", "blob_id": "dd4e32fd476d7f901eb34eb59a825f8edc5a28e5", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SpaceBurritos/keyboardDrivenFrameworkAssignment | 218 | FILENAME: BaseTest.java | 0.27513 | package base;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.BeforeTest;
import pages.LogInPage;
public class BaseTest {
String driverPath = "src\\test\\resources\\chromedriver.exe";
private String username = "andressaurez";
private String password = "Andres123.#";
public WebDriver driver ;
LogInPage login;
@BeforeSuite(alwaysRun = true)
public void startUp() {
System.setProperty("webdriver.chrome.driver", driverPath);
driver = new ChromeDriver();
driver.manage().window().maximize();
login = new LogInPage(driver);
System.out.println("Chrome driver initialized");
}
@BeforeTest
public void login(){
driver.get("https://demoqa.com/login");
login.login(username, password);
}
@AfterSuite(alwaysRun = true)
public void exit() {
driver.close();
System.out.println("Chrome driver closed");
}
}
|
446d1ccf-5268-485c-8db0-ce87f098ec8d | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-05-21 23:25:29", "repo_name": "ye7ia10/BookStore_SQL", "sub_path": "/src/model/SalesReportInput.java", "file_name": "SalesReportInput.java", "file_ext": "java", "file_size_in_byte": 984, "line_count": 53, "lang": "en", "doc_type": "code", "blob_id": "1159ca996d2be414fac9b71650b4053b1d6a3554", "star_events_count": 0, "fork_events_count": 2, "src_encoding": "UTF-8"} | https://github.com/ye7ia10/BookStore_SQL | 190 | FILENAME: SalesReportInput.java | 0.26971 | package model;
import java.util.HashMap;
import java.util.Map;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
public class SalesReportInput {
private String type;
private JRBeanCollectionDataSource bookDataSource;
public SalesReportInput(String type) {
this.type = type;
}
public void setBookDataSource(JRBeanCollectionDataSource bookDataSource) {
this.bookDataSource = bookDataSource;
}
public String getType() {
return type;
}
public JRBeanCollectionDataSource getStudentDataSource() {
return bookDataSource;
}
public Map<String, Object> getParameters() {
Map<String,Object> parameters = new HashMap<>();
parameters.put("P_TYPE", getType());
return parameters;
}
public Map<String, Object> getDataSources() {
Map<String,Object> dataSources = new HashMap<>();
dataSources.put("bookDataSource", bookDataSource);
return dataSources;
}
}
|
6c34ffd5-3bea-455d-85fb-edfb788780b9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-06-18 19:13:07", "repo_name": "SteamDiver/YourMovies", "sub_path": "/YourMoviesApi/src/main/java/edu/vsu/YourMoviesApi/domain/dto/GenreDTO.java", "file_name": "GenreDTO.java", "file_ext": "java", "file_size_in_byte": 1007, "line_count": 52, "lang": "en", "doc_type": "code", "blob_id": "0fcb1a13a8406aa312dcbf467b2fa0327f86a28f", "star_events_count": 0, "fork_events_count": 1, "src_encoding": "UTF-8"} | https://github.com/SteamDiver/YourMovies | 233 | FILENAME: GenreDTO.java | 0.256832 | package edu.vsu.YourMoviesApi.domain.dto;
public class GenreDTO {
// private String username;
private String name;
private int id;
// public GenreDTO(String username, String name) {
// this.username = username;
// this.name = name;
// }
public GenreDTO(String name, int id) {
this.name = name;
this.id = id;
}
public GenreDTO(String name) {
this.name = name;
}
// public GenreDTO(String username, String name, int id) {
// this.username = username;
// this.name = name;
// this.id = id;
// }
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
// public String getUsername() {
// return username;
// }
//
// public void setUsername(String username) {
// this.username = username;
// }
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
|
6074878b-42f4-4003-84be-a9319505eeb1 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2021-01-26 08:24:51", "repo_name": "Eroven/dev_fw", "sub_path": "/micro-app/micro-app-api/src/main/java/me/zhaotb/app/api/register/RegistryConf.java", "file_name": "RegistryConf.java", "file_ext": "java", "file_size_in_byte": 1290, "line_count": 71, "lang": "zh", "doc_type": "code", "blob_id": "5381969b0e8216c87e9cb0b2775c71929799bd81", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Eroven/dev_fw | 369 | FILENAME: RegistryConf.java | 0.220007 | package me.zhaotb.app.api.register;
import lombok.Getter;
import lombok.Setter;
/**
* 注册表配置信息,用于初始化注册器
* @see Register
* @author zhaotangbo
* @date 2019/3/1
*/
@Getter
@Setter
public class RegistryConf {
/**
* zk连接串
*/
private String connectStr;
/**
* 根目录
*/
private String root = "/micro-app/scheduler";
/**
* 接收检测心跳的端口;如果是leader则为接收命令的端口
*/
private int tickPort = 3015;
/**
* 控制端口;数据交流端口
*/
private int ctrlPort = 3020;
/**
* 注册时绑定的地址,默认为本机ip
*/
private String address;
/**
* 程序会使用最小和最大值之间的端口,某个被占则用下一个
*/
private int minPort = 6000;
private int maxPort = 12000;
/**
* 通用重试次数
*/
private int retryTimes = 3;
/**
* 重试间隔,单位 ms
*/
private long retryInterval = 1000;
/**
* 每次心跳检测间隔, 单位: 毫秒
*/
private long tickTime = 3000;
/**
* 心跳无响应超过该次数,判定为失联
*/
private int tickLimit = 3;
private long tickTimeout = 3000;
}
|
cec24575-eab0-4eaa-811a-ec52f97c96fd | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-10-12 14:40:32", "repo_name": "TarikoDan/Java-Lessons", "sub_path": "/src/lesson3_AbstractClass_Interface/Hierarchy/Wolf.java", "file_name": "Wolf.java", "file_ext": "java", "file_size_in_byte": 996, "line_count": 55, "lang": "en", "doc_type": "code", "blob_id": "84b3459bfb686df826afe78f4247e565606fce88", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/TarikoDan/Java-Lessons | 216 | FILENAME: Wolf.java | 0.2227 | package lesson3_AbstractClass_Interface.Hierarchy;
public class Wolf extends WildAnimal {
String name;
public void roar() {};
public Wolf() {
}
public Wolf(int age, String name) {
super(age);
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public void run() {
super.run();
}
@Override
public void habitat() {
super.habitat();
}
public Wolf(int lifetime) {
super(lifetime);
}
@Override
public int getLifetime() {
return super.getLifetime();
}
@Override
public void setLifetime(int lifetime) {
super.setLifetime(lifetime);
}
@Override
public String toString() {
return "Wolf{" +
"name='" + name + '\'' +
", age=" + age +
", lifetime=" + lifetime +
'}';
}
}
|
0890b360-9cfb-4dfc-a695-40f79e38e9fb | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2018-07-08 22:40:14", "repo_name": "Luke-Walker/APCS", "sub_path": "/online/Client.java", "file_name": "Client.java", "file_ext": "java", "file_size_in_byte": 997, "line_count": 34, "lang": "en", "doc_type": "code", "blob_id": "3ef7c99bf163888e543afce0f08513ab26f894f9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/Luke-Walker/APCS | 182 | FILENAME: Client.java | 0.267408 | import java.io.*;
import java.net.*;
public class Client {
private Socket socket;
private PrintWriter out;
private BufferedReader in, stdIn;
public void connect(String ip, int port) {
try {
socket = new Socket(ip, port);
out = new PrintWriter(socket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
stdIn = new BufferedReader(new InputStreamReader(System.in));
String input;
while ((input = stdIn.readLine()) != null) {
out.println(input);
System.out.println("Echo: " + in.readLine());
}
} catch (UnknownHostException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}
}
public static void main(String[] args) {
Client client = new Client();
client.connect(args[0], Integer.parseInt(args[1]));
}
}
|
fa9ca36d-24d1-4e30-8a39-a5ce6a523a66 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-01-28 04:42:50", "repo_name": "joechengz/big-data-analysis", "sub_path": "/milestone2/RemoveStopWords.java", "file_name": "RemoveStopWords.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 47, "lang": "en", "doc_type": "code", "blob_id": "227989bea9802420b51f82dadd0f5e835483a40d", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/joechengz/big-data-analysis | 261 | FILENAME: RemoveStopWords.java | 0.289372 | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text;
public class RemoveStopWords {
ArrayList<String> wordsList = new ArrayList<String>();
Set<String> stopWordsSet = new HashSet<String>();
File stopwords = new File("/project2/english.stp");
public String remove(String input) throws IOException {
FileInputStream fstream = new FileInputStream(stopwords);
BufferedReader br = new BufferedReader(new InputStreamReader(fstream));
//Read File Line By Line
String line;
while ((line = br.readLine()) != null) {
stopWordsSet.add(line);
}
br.close();
// add non stop words into list
String[] words = input.split("\\s");
for(String word : words)
{
if(!stopWordsSet.contains(word))
{
wordsList.add(word + " ");
}
}
for(String str : wordsList) {
System.out.print(str);
}
String pureReview = wordsList.toString();
return pureReview;
}
}
|
c2f0530b-6691-45df-a7c5-66f4831a1db9 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2019-06-28 21:16:44", "repo_name": "aaparashar/drive-off", "sub_path": "/Source Code/sources/com/google/api/client/protobuf/ProtocolBuffers.java", "file_name": "ProtocolBuffers.java", "file_ext": "java", "file_size_in_byte": 1016, "line_count": 28, "lang": "en", "doc_type": "code", "blob_id": "c5805e7c9246b5337b31b2baa3eaeb51b80f2621", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/aaparashar/drive-off | 193 | FILENAME: ProtocolBuffers.java | 0.268941 | package com.google.api.client.protobuf;
import com.google.protobuf.MessageLite;
import java.io.IOException;
import java.io.InputStream;
public class ProtocolBuffers {
public static final String ALT_CONTENT_TYPE = "application/x-protobuffer";
public static final String CONTENT_TYPE = "application/x-protobuf";
public static <T extends MessageLite> T parseAndClose(InputStream inputStream, Class<T> messageClass) throws IOException {
try {
MessageLite messageLite = (MessageLite) messageClass.cast(messageClass.getDeclaredMethod("parseFrom", new Class[]{InputStream.class}).invoke(null, new Object[]{inputStream}));
inputStream.close();
return messageLite;
} catch (Exception e) {
IOException io = new IOException("Error parsing message of type " + messageClass);
io.initCause(e);
throw io;
} catch (Throwable th) {
inputStream.close();
}
}
private ProtocolBuffers() {
}
}
|
21426fb9-79a7-464d-85e9-d2b0cbd8b3f3 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2017-03-07 14:21:44", "repo_name": "chniccs/coco", "sub_path": "/app/src/main/java/com/chniccs/coco/adapter/CommonFragmentAdapter.java", "file_name": "CommonFragmentAdapter.java", "file_ext": "java", "file_size_in_byte": 1033, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "de2aec39a683d19738e4b0839bf5d06ae59f1858", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/chniccs/coco | 213 | FILENAME: CommonFragmentAdapter.java | 0.293404 | package com.chniccs.coco.adapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.chniccs.coco.factory.CategoryFragmentFactory;
public class CommonFragmentAdapter
extends FragmentPagerAdapter
{
private final CategoryFragmentFactory mFragmentFactory = new CategoryFragmentFactory();
private String[] mStrs;
public CommonFragmentAdapter(FragmentManager paramFragmentManager)
{
super(paramFragmentManager);
}
public int getCount()
{
if (this.mStrs == null) {
return 0;
}
return this.mStrs.length;
}
public Fragment getItem(int paramInt)
{
return this.mFragmentFactory.getFragment(paramInt, this.mStrs[paramInt]);
}
public CharSequence getPageTitle(int paramInt)
{
return this.mStrs[paramInt];
}
public void setData(String[] paramArrayOfString)
{
this.mStrs = paramArrayOfString;
}
}
|
64a20974-9e90-4177-850b-a319fd72974c | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2013-02-21 18:03:00", "repo_name": "mmoulou/codestory2013", "sub_path": "/codestory/src/main/java/net/codestory/RestServerPipelineFactory.java", "file_name": "RestServerPipelineFactory.java", "file_ext": "java", "file_size_in_byte": 1176, "line_count": 33, "lang": "en", "doc_type": "code", "blob_id": "4b82f5127957ecddb0c11691bed077f9a949abe1", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/mmoulou/codestory2013 | 222 | FILENAME: RestServerPipelineFactory.java | 0.23793 | package net.codestory;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.handler.codec.http.HttpChunkAggregator;
import org.jboss.netty.handler.codec.http.HttpContentCompressor;
import org.jboss.netty.handler.codec.http.HttpRequestDecoder;
import org.jboss.netty.handler.codec.http.HttpResponseEncoder;
import static org.jboss.netty.channel.Channels.pipeline;
/**
* @author : Mouhcine MOULOU
*/
public class RestServerPipelineFactory implements ChannelPipelineFactory {
private final Dispatcher dispatcher;
public RestServerPipelineFactory(Dispatcher dispatcher) {
this.dispatcher = dispatcher;
}
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = pipeline();
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("deflater", new HttpContentCompressor());
pipeline.addLast("rest", new RestServerHandler(dispatcher));
return pipeline;
}
}
|
81d32ea0-adfe-4150-9dae-08a712e3b258 | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2016-05-10 11:48:38", "repo_name": "gjgfuj/SandromaticLauncher", "sub_path": "/app/src/main/java/tk/sandradev/launcher/UnknownActivity.java", "file_name": "UnknownActivity.java", "file_ext": "java", "file_size_in_byte": 1175, "line_count": 39, "lang": "en", "doc_type": "code", "blob_id": "f527afd4f4b6632bfc84ccaaa7eb45747e8ebed9", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/gjgfuj/SandromaticLauncher | 212 | FILENAME: UnknownActivity.java | 0.247987 | package tk.sandradev.launcher;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.widget.Toast;
public class UnknownActivity extends Activity
{
AppsService service = null;
ServiceConnection connection = new ServiceConnection()
{
public void onServiceDisconnected(ComponentName componentName)
{
service = null;
}
public void onServiceConnected(ComponentName componentName, IBinder binder)
{
service = ((AppsService.ServiceBinder) binder).getService();
service.loadApps();
Toast.makeText(UnknownActivity.this, R.string.invalid_app, Toast.LENGTH_SHORT).show();
Intent i = new Intent(UnknownActivity.this, AppListActivity.class);
startActivity(i);
}
};
@Override
protected void onCreate(Bundle state)
{
super.onCreate(state);
bindService(new Intent(this, AppsService.class), connection, Context.BIND_AUTO_CREATE);
}
}
|
e6a48505-a149-49a9-8e78-add608160c8f | {"source": "refinecode", "ori_score": "", "domain": "code", "program_lang": "java", "committer_date": "2020-08-06 18:58:22", "repo_name": "SahilSonkar/covid-19_tracker", "sub_path": "/app/src/main/java/com/example/covid19/TablayoutAdapter.java", "file_name": "TablayoutAdapter.java", "file_ext": "java", "file_size_in_byte": 1036, "line_count": 42, "lang": "en", "doc_type": "code", "blob_id": "7b748870c301376e6a3bafa21d7b3f14b3138cff", "star_events_count": 0, "fork_events_count": 0, "src_encoding": "UTF-8"} | https://github.com/SahilSonkar/covid-19_tracker | 198 | FILENAME: TablayoutAdapter.java | 0.262842 | package com.example.covid19;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import java.util.ArrayList;
public class TablayoutAdapter extends FragmentPagerAdapter {
public ArrayList<Fragment> mFragmentList=new ArrayList<>();
public ArrayList<String> mFragmentTitleList =new ArrayList<>();
public TablayoutAdapter(@NonNull FragmentManager fm) {
super(fm);
}
public void add(Fragment fragment ,String title)
{
mFragmentTitleList.add(title);
mFragmentList.add(fragment);
}
@Nullable
@Override
public CharSequence getPageTitle(int position) {
return mFragmentTitleList.get(position);
}
@NonNull
@Override
public Fragment getItem(int position) {
return mFragmentList.get(position);
}
@Override
public int getCount() {
return mFragmentList.size();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.